@azure/msal-browser 5.0.0-alpha.0 → 5.0.1
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/README.md +24 -32
- package/dist/app/IPublicClientApplication.d.ts +2 -2
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.mjs +1 -1
- package/dist/app/IPublicClientApplication.mjs.map +1 -1
- package/dist/app/PublicClientApplication.d.ts +5 -9
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.mjs +11 -19
- package/dist/app/PublicClientApplication.mjs.map +1 -1
- package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +9 -9
- package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +17 -17
- package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +12 -12
- package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/cache/AccountManager.d.ts +0 -25
- package/dist/cache/AccountManager.d.ts.map +1 -1
- package/dist/cache/AccountManager.mjs +7 -86
- package/dist/cache/AccountManager.mjs.map +1 -1
- package/dist/cache/AsyncMemoryStorage.mjs +9 -9
- package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/cache/BrowserCacheManager.d.ts +65 -8
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.mjs +475 -209
- package/dist/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/cache/CacheHelpers.mjs +1 -1
- package/dist/cache/CacheHelpers.mjs.map +1 -1
- package/dist/cache/CacheKeys.d.ts +3 -3
- package/dist/cache/CacheKeys.mjs +4 -4
- package/dist/cache/CacheKeys.mjs.map +1 -1
- package/dist/cache/CookieStorage.mjs +1 -1
- package/dist/cache/CookieStorage.mjs.map +1 -1
- package/dist/cache/DatabaseStorage.mjs +1 -1
- package/dist/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/cache/EncryptedData.mjs +1 -1
- package/dist/cache/IWindowStorage.d.ts +1 -1
- package/dist/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/cache/LocalStorage.d.ts +1 -1
- package/dist/cache/LocalStorage.d.ts.map +1 -1
- package/dist/cache/LocalStorage.mjs +26 -17
- package/dist/cache/LocalStorage.mjs.map +1 -1
- package/dist/cache/MemoryStorage.mjs +1 -1
- package/dist/cache/MemoryStorage.mjs.map +1 -1
- package/dist/cache/SessionStorage.mjs +1 -1
- package/dist/cache/SessionStorage.mjs.map +1 -1
- package/dist/cache/TokenCache.d.ts +7 -5
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +62 -49
- package/dist/cache/TokenCache.mjs.map +1 -1
- package/dist/config/Configuration.d.ts +4 -12
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +7 -9
- package/dist/config/Configuration.mjs.map +1 -1
- package/dist/controllers/IController.d.ts +2 -57
- package/dist/controllers/IController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.d.ts +4 -43
- package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/controllers/NestedAppAuthController.mjs +30 -82
- package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
- package/dist/controllers/StandardController.d.ts +3 -27
- package/dist/controllers/StandardController.d.ts.map +1 -1
- package/dist/controllers/StandardController.mjs +80 -135
- package/dist/controllers/StandardController.mjs.map +1 -1
- package/dist/controllers/UnknownOperatingContextController.d.ts +4 -13
- package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.mjs +1 -1
- package/dist/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/crypto/CryptoOps.mjs +3 -3
- package/dist/crypto/CryptoOps.mjs.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +1 -1
- package/dist/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/crypto/SignedHttpRequest.mjs +1 -1
- package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
- package/dist/custom-auth-path/app/IPublicClientApplication.d.ts +2 -2
- package/dist/custom-auth-path/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/custom-auth-path/app/PublicClientApplication.d.ts +5 -9
- package/dist/custom-auth-path/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/custom-auth-path/app/PublicClientApplication.mjs +2 -14
- package/dist/custom-auth-path/app/PublicClientApplication.mjs.map +1 -1
- package/dist/custom-auth-path/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthDOMHandler.mjs +9 -9
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +17 -17
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs +10 -10
- package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
- package/dist/custom-auth-path/cache/AccountManager.d.ts +0 -25
- package/dist/custom-auth-path/cache/AccountManager.d.ts.map +1 -1
- package/dist/custom-auth-path/cache/AccountManager.mjs +7 -86
- package/dist/custom-auth-path/cache/AccountManager.mjs.map +1 -1
- package/dist/custom-auth-path/cache/AsyncMemoryStorage.mjs +9 -9
- package/dist/custom-auth-path/cache/AsyncMemoryStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts +65 -8
- package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/custom-auth-path/cache/BrowserCacheManager.mjs +475 -209
- package/dist/custom-auth-path/cache/BrowserCacheManager.mjs.map +1 -1
- package/dist/custom-auth-path/cache/CacheHelpers.mjs +1 -1
- package/dist/custom-auth-path/cache/CacheHelpers.mjs.map +1 -1
- package/dist/custom-auth-path/cache/CacheKeys.d.ts +3 -3
- package/dist/custom-auth-path/cache/CacheKeys.mjs +4 -4
- package/dist/custom-auth-path/cache/CacheKeys.mjs.map +1 -1
- package/dist/custom-auth-path/cache/CookieStorage.mjs +1 -1
- package/dist/custom-auth-path/cache/CookieStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/DatabaseStorage.mjs +1 -1
- package/dist/custom-auth-path/cache/DatabaseStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/EncryptedData.mjs +1 -1
- package/dist/custom-auth-path/cache/IWindowStorage.d.ts +1 -1
- package/dist/custom-auth-path/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/custom-auth-path/cache/LocalStorage.d.ts +1 -1
- package/dist/custom-auth-path/cache/LocalStorage.d.ts.map +1 -1
- package/dist/custom-auth-path/cache/LocalStorage.mjs +26 -17
- package/dist/custom-auth-path/cache/LocalStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/MemoryStorage.mjs +1 -1
- package/dist/custom-auth-path/cache/MemoryStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/SessionStorage.mjs +1 -1
- package/dist/custom-auth-path/cache/SessionStorage.mjs.map +1 -1
- package/dist/custom-auth-path/cache/TokenCache.d.ts +7 -5
- package/dist/custom-auth-path/cache/TokenCache.d.ts.map +1 -1
- package/dist/custom-auth-path/config/Configuration.d.ts +4 -12
- package/dist/custom-auth-path/config/Configuration.d.ts.map +1 -1
- package/dist/custom-auth-path/config/Configuration.mjs +7 -9
- package/dist/custom-auth-path/config/Configuration.mjs.map +1 -1
- package/dist/custom-auth-path/controllers/IController.d.ts +2 -57
- package/dist/custom-auth-path/controllers/IController.d.ts.map +1 -1
- package/dist/custom-auth-path/controllers/NestedAppAuthController.d.ts +4 -43
- package/dist/custom-auth-path/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/dist/custom-auth-path/controllers/StandardController.d.ts +3 -27
- package/dist/custom-auth-path/controllers/StandardController.d.ts.map +1 -1
- package/dist/custom-auth-path/controllers/StandardController.mjs +80 -135
- package/dist/custom-auth-path/controllers/StandardController.mjs.map +1 -1
- package/dist/custom-auth-path/controllers/UnknownOperatingContextController.d.ts +4 -13
- package/dist/custom-auth-path/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/dist/custom-auth-path/crypto/BrowserCrypto.mjs +1 -1
- package/dist/custom-auth-path/crypto/BrowserCrypto.mjs.map +1 -1
- package/dist/custom-auth-path/crypto/CryptoOps.mjs +3 -3
- package/dist/custom-auth-path/crypto/CryptoOps.mjs.map +1 -1
- package/dist/custom-auth-path/crypto/PkceGenerator.mjs +1 -1
- package/dist/custom-auth-path/crypto/PkceGenerator.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthConstants.d.ts +2 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthConstants.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthConstants.mjs +2 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthConstants.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.d.ts +1 -0
- package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs +50 -31
- package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.d.ts +2 -2
- package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +2 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +13 -5
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowResultBase.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.mjs +3 -3
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts +29 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +45 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts +5 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +9 -2
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +9 -3
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +7 -6
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +6 -2
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +5 -4
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts +7 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +12 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts +7 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +12 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +8 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +25 -10
- package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts +27 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +42 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +40 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +46 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +34 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +45 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts +11 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +24 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts +11 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +24 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +67 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +140 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts +19 -0
- package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/CustomAuthApiError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/CustomAuthError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/CustomAuthError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/HttpError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/HttpError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/InvalidArgumentError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/MethodNotImplementedError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/MsalCustomAuthError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/NoCachedAccountFoundError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UnexpectedError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UnexpectedError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UnsupportedEnvironmentError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UserAccountAttributeError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/error/UserAlreadySignedInError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +3 -3
- package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.d.ts +2 -8
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.mjs +21 -39
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts +0 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts +2 -11
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +2 -9
- package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.d.ts +21 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.mjs +88 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts +14 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts +23 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +24 -0
- package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs.map +1 -0
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +2 -2
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +3 -2
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts +7 -2
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +14 -3
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts +1 -0
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +4 -3
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +5 -0
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts +5 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts +2 -0
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +5 -3
- package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/core/network_client/http_client/FetchHttpClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/network_client/http_client/IHttpClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.d.ts +4 -3
- package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.mjs +7 -5
- package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/core/utils/UrlUtils.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/core/utils/UrlUtils.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +8 -8
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +4 -3
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +4 -3
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +4 -3
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts +8 -0
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +16 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts +8 -0
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +16 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.d.ts +8 -0
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.mjs +16 -1
- package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +20 -18
- package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/index.d.ts +7 -0
- package/dist/custom-auth-path/custom_auth/index.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/index.mjs +7 -1
- package/dist/custom-auth-path/custom_auth/index.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/operating_context/CustomAuthOperatingContext.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +4 -7
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +17 -7
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +9 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +9 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +13 -4
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts +2 -0
- package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +29 -28
- package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/SignInScenario.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +4 -3
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +10 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +15 -10
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +19 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +19 -4
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +10 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +13 -6
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +21 -11
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +9 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +16 -36
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +9 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +16 -33
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.d.ts +16 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.mjs +68 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +2 -0
- package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.d.ts +8 -6
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs +86 -59
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts +6 -0
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +9 -2
- package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +4 -7
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +6 -8
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +4 -4
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +6 -8
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +5 -6
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +15 -6
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +22 -10
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts +5 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +10 -2
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +9 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts +4 -0
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +16 -6
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpState.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts +2 -0
- package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.d.ts +4 -4
- package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.d.ts.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.mjs +55 -50
- package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.mjs.map +1 -1
- package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
- package/dist/custom-auth-path/encode/Base64Decode.mjs +1 -1
- package/dist/custom-auth-path/encode/Base64Encode.mjs +1 -1
- package/dist/custom-auth-path/error/BrowserAuthError.mjs +1 -1
- package/dist/custom-auth-path/error/BrowserAuthError.mjs.map +1 -1
- package/dist/custom-auth-path/error/BrowserAuthErrorCodes.d.ts +3 -2
- package/dist/custom-auth-path/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/dist/custom-auth-path/error/BrowserAuthErrorCodes.mjs +6 -4
- package/dist/custom-auth-path/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/custom-auth-path/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/custom-auth-path/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/custom-auth-path/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/custom-auth-path/error/NativeAuthError.d.ts.map +1 -1
- package/dist/custom-auth-path/error/NativeAuthError.mjs +3 -2
- package/dist/custom-auth-path/error/NativeAuthError.mjs.map +1 -1
- package/dist/custom-auth-path/error/NativeAuthErrorCodes.d.ts +1 -0
- package/dist/custom-auth-path/error/NativeAuthErrorCodes.d.ts.map +1 -1
- package/dist/custom-auth-path/error/NativeAuthErrorCodes.mjs +3 -2
- package/dist/custom-auth-path/error/NativeAuthErrorCodes.mjs.map +1 -1
- package/dist/custom-auth-path/event/EventHandler.mjs +5 -5
- package/dist/custom-auth-path/event/EventHandler.mjs.map +1 -1
- package/dist/custom-auth-path/event/EventType.mjs +1 -1
- package/dist/custom-auth-path/event/EventType.mjs.map +1 -1
- package/dist/custom-auth-path/index.d.ts +4 -4
- package/dist/custom-auth-path/index.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs +7 -7
- package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/custom-auth-path/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
- package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs +27 -28
- package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/PopupClient.d.ts +3 -6
- package/dist/custom-auth-path/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/PopupClient.mjs +78 -52
- package/dist/custom-auth-path/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/RedirectClient.d.ts +6 -1
- package/dist/custom-auth-path/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/RedirectClient.mjs +67 -63
- package/dist/custom-auth-path/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs +2 -2
- package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/SilentCacheClient.mjs +4 -4
- package/dist/custom-auth-path/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs +37 -17
- package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_client/StandardInteractionClient.d.ts +3 -1
- package/dist/custom-auth-path/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs +23 -18
- package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs +3 -7
- package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/custom-auth-path/interaction_handler/SilentHandler.d.ts +2 -7
- package/dist/custom-auth-path/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs +17 -68
- package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/custom-auth-path/log-strings-mapping.json +1703 -0
- package/dist/custom-auth-path/navigation/NavigationClient.mjs +1 -1
- package/dist/custom-auth-path/navigation/NavigationClient.mjs.map +1 -1
- package/dist/custom-auth-path/network/FetchClient.mjs +1 -1
- package/dist/custom-auth-path/network/FetchClient.mjs.map +1 -1
- package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/custom-auth-path/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/custom-auth-path/operatingcontext/StandardOperatingContext.mjs.map +1 -1
- package/dist/custom-auth-path/packageMetadata.d.ts +1 -1
- package/dist/custom-auth-path/packageMetadata.d.ts.map +1 -1
- package/dist/custom-auth-path/packageMetadata.mjs +2 -2
- package/dist/custom-auth-path/protocol/Authorize.d.ts +4 -0
- package/dist/custom-auth-path/protocol/Authorize.d.ts.map +1 -1
- package/dist/custom-auth-path/protocol/Authorize.mjs +32 -6
- package/dist/custom-auth-path/protocol/Authorize.mjs.map +1 -1
- package/dist/custom-auth-path/redirect_bridge/index.d.ts +16 -0
- package/dist/custom-auth-path/redirect_bridge/index.d.ts.map +1 -0
- package/dist/custom-auth-path/request/AuthorizationCodeRequest.d.ts +18 -0
- package/dist/custom-auth-path/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/ClearCacheRequest.d.ts +6 -2
- package/dist/custom-auth-path/request/ClearCacheRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/EndSessionPopupRequest.d.ts +13 -10
- package/dist/custom-auth-path/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/EndSessionRequest.d.ts +4 -9
- package/dist/custom-auth-path/request/EndSessionRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/HandleRedirectPromiseOptions.d.ts +5 -0
- package/dist/custom-auth-path/request/HandleRedirectPromiseOptions.d.ts.map +1 -0
- package/dist/custom-auth-path/request/InitializeApplicationRequest.d.ts +3 -2
- package/dist/custom-auth-path/request/InitializeApplicationRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/PopupRequest.d.ts +13 -24
- package/dist/custom-auth-path/request/PopupRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/RedirectRequest.d.ts +6 -23
- package/dist/custom-auth-path/request/RedirectRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/RequestHelpers.d.ts +11 -1
- package/dist/custom-auth-path/request/RequestHelpers.d.ts.map +1 -1
- package/dist/custom-auth-path/request/RequestHelpers.mjs +30 -5
- package/dist/custom-auth-path/request/RequestHelpers.mjs.map +1 -1
- package/dist/custom-auth-path/request/SilentRequest.d.ts +33 -14
- package/dist/custom-auth-path/request/SilentRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/request/SsoSilentRequest.d.ts +0 -22
- package/dist/custom-auth-path/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/custom-auth-path/response/ResponseHandler.mjs +4 -4
- package/dist/custom-auth-path/response/ResponseHandler.mjs.map +1 -1
- package/dist/custom-auth-path/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/custom-auth-path/telemetry/BrowserPerformanceEvents.d.ts +4 -1
- package/dist/custom-auth-path/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/dist/custom-auth-path/telemetry/BrowserPerformanceEvents.mjs +2 -4
- package/dist/custom-auth-path/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/custom-auth-path/telemetry/BrowserRootPerformanceEvents.d.ts +1 -0
- package/dist/custom-auth-path/telemetry/BrowserRootPerformanceEvents.d.ts.map +1 -1
- package/dist/custom-auth-path/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
- package/dist/custom-auth-path/utils/BrowserConstants.d.ts +0 -4
- package/dist/custom-auth-path/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/custom-auth-path/utils/BrowserConstants.mjs +1 -5
- package/dist/custom-auth-path/utils/BrowserConstants.mjs.map +1 -1
- package/dist/custom-auth-path/utils/BrowserProtocolUtils.mjs +2 -2
- package/dist/custom-auth-path/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/custom-auth-path/utils/BrowserUtils.d.ts +36 -2
- package/dist/custom-auth-path/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/custom-auth-path/utils/BrowserUtils.mjs +152 -10
- package/dist/custom-auth-path/utils/BrowserUtils.mjs.map +1 -1
- package/dist/custom-auth-path/utils/Helpers.mjs +1 -1
- package/dist/custom-auth-path/utils/Helpers.mjs.map +1 -1
- package/dist/custom-auth-path/utils/MsalFrameStatsUtils.mjs +2 -2
- package/dist/custom-auth-path/utils/MsalFrameStatsUtils.mjs.map +1 -1
- package/dist/custom_auth/CustomAuthConstants.d.ts +2 -1
- package/dist/custom_auth/CustomAuthConstants.d.ts.map +1 -1
- package/dist/custom_auth/controller/CustomAuthStandardController.d.ts +1 -0
- package/dist/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/dist/custom_auth/core/CustomAuthAuthority.d.ts +2 -2
- package/dist/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +2 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowState.d.ts +4 -0
- package/dist/custom_auth/core/auth_flow/AuthFlowState.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts +29 -0
- package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts +5 -0
- package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +9 -3
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +6 -2
- package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts +7 -0
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts +7 -0
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +8 -0
- package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts +27 -0
- package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +40 -0
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +34 -0
- package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts +11 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts +11 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +67 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts +19 -0
- package/dist/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts.map +1 -0
- package/dist/custom_auth/core/interaction_client/jit/JitClient.d.ts +2 -8
- package/dist/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
- package/dist/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts +0 -1
- package/dist/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts.map +1 -1
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts +2 -11
- package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts.map +1 -1
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.d.ts +21 -0
- package/dist/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -0
- package/dist/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts +14 -0
- package/dist/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts.map +1 -0
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts +23 -0
- package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts.map +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts +7 -2
- package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts +1 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +5 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts +5 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts.map +1 -1
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts +2 -0
- package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts.map +1 -1
- package/dist/custom_auth/core/telemetry/PublicApiId.d.ts +4 -3
- package/dist/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts +8 -0
- package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts +8 -0
- package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts.map +1 -1
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.d.ts +8 -0
- package/dist/custom_auth/get_account/auth_flow/state/SignOutState.d.ts.map +1 -1
- package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/dist/custom_auth/index.d.ts +7 -0
- package/dist/custom_auth/index.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts +4 -0
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts +4 -0
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts +4 -0
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts +4 -0
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts +2 -0
- package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts.map +1 -1
- package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +10 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +19 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +10 -1
- package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts +4 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts +4 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts +4 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts +4 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts +4 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.d.ts +16 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInState.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +2 -0
- package/dist/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.d.ts +8 -6
- package/dist/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts +6 -0
- package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts +4 -0
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts +4 -0
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts +5 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts +4 -0
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts +4 -0
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts +2 -0
- package/dist/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts.map +1 -1
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.d.ts +4 -4
- package/dist/custom_auth/sign_up/interaction_client/SignUpClient.d.ts.map +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/BrowserAuthError.mjs.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.d.ts +3 -2
- package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/BrowserAuthErrorCodes.mjs +6 -5
- package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
- package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
- package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
- package/dist/error/NativeAuthError.d.ts.map +1 -1
- package/dist/error/NativeAuthError.mjs +3 -2
- package/dist/error/NativeAuthError.mjs.map +1 -1
- package/dist/error/NativeAuthErrorCodes.d.ts +1 -0
- package/dist/error/NativeAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/NativeAuthErrorCodes.mjs +3 -2
- package/dist/error/NativeAuthErrorCodes.mjs.map +1 -1
- package/dist/error/NestedAppAuthError.mjs +1 -1
- package/dist/error/NestedAppAuthError.mjs.map +1 -1
- package/dist/event/EventHandler.mjs +5 -5
- package/dist/event/EventHandler.mjs.map +1 -1
- package/dist/event/EventMessage.mjs +1 -1
- package/dist/event/EventMessage.mjs.map +1 -1
- package/dist/event/EventType.mjs +1 -1
- package/dist/event/EventType.mjs.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.mjs +7 -7
- package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs.map +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
- package/dist/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs +27 -28
- package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +3 -6
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.mjs +78 -52
- package/dist/interaction_client/PopupClient.mjs.map +1 -1
- package/dist/interaction_client/RedirectClient.d.ts +6 -1
- package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
- package/dist/interaction_client/RedirectClient.mjs +67 -63
- package/dist/interaction_client/RedirectClient.mjs.map +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.mjs +2 -2
- package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentCacheClient.mjs +4 -4
- package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.mjs +37 -17
- package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
- package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts +3 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.mjs +23 -18
- package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.mjs +3 -7
- package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +2 -7
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.mjs +17 -68
- package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
- package/dist/log-strings-mapping.json +1135 -0
- package/dist/naa/BridgeError.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs +1 -1
- package/dist/naa/BridgeProxy.mjs.map +1 -1
- package/dist/naa/BridgeStatusCode.mjs +1 -1
- package/dist/naa/BridgeStatusCode.mjs.map +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
- package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
- package/dist/navigation/NavigationClient.mjs +1 -1
- package/dist/navigation/NavigationClient.mjs.map +1 -1
- package/dist/network/FetchClient.mjs +1 -1
- package/dist/network/FetchClient.mjs.map +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
- package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/NestedAppOperatingContext.mjs +3 -3
- package/dist/operatingcontext/NestedAppOperatingContext.mjs.map +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
- package/dist/operatingcontext/StandardOperatingContext.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +4 -0
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +32 -6
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/redirect-bridge/app/IPublicClientApplication.d.ts +48 -0
- package/dist/redirect-bridge/app/IPublicClientApplication.d.ts.map +1 -0
- package/dist/{app/PublicClientNext.d.ts → redirect-bridge/app/PublicClientApplication.d.ts} +35 -19
- package/dist/redirect-bridge/app/PublicClientApplication.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/IPlatformAuthHandler.d.ts +12 -0
- package/dist/redirect-bridge/broker/nativeBroker/IPlatformAuthHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/NativeStatusCodes.d.ts +9 -0
- package/dist/redirect-bridge/broker/nativeBroker/NativeStatusCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +30 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts +63 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthProvider.d.ts +28 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthRequest.d.ts +78 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthResponse.d.ts +71 -0
- package/dist/redirect-bridge/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/AccountManager.d.ts +24 -0
- package/dist/redirect-bridge/cache/AccountManager.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/AsyncMemoryStorage.d.ts +58 -0
- package/dist/redirect-bridge/cache/AsyncMemoryStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/BrowserCacheManager.d.ts +366 -0
- package/dist/redirect-bridge/cache/BrowserCacheManager.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/CacheHelpers.d.ts +16 -0
- package/dist/redirect-bridge/cache/CacheHelpers.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/CacheKeys.d.ts +14 -0
- package/dist/redirect-bridge/cache/CacheKeys.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/CacheKeys.mjs +10 -0
- package/dist/redirect-bridge/cache/CacheKeys.mjs.map +1 -0
- package/dist/redirect-bridge/cache/CookieStorage.d.ts +23 -0
- package/dist/redirect-bridge/cache/CookieStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/DatabaseStorage.d.ts +57 -0
- package/dist/redirect-bridge/cache/DatabaseStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/EncryptedData.d.ts +8 -0
- package/dist/redirect-bridge/cache/EncryptedData.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/IAsyncStorage.d.ts +33 -0
- package/dist/redirect-bridge/cache/IAsyncStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/IWindowStorage.d.ts +42 -0
- package/dist/redirect-bridge/cache/IWindowStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/LocalStorage.d.ts +51 -0
- package/dist/redirect-bridge/cache/LocalStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/MemoryStorage.d.ts +16 -0
- package/dist/redirect-bridge/cache/MemoryStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/SessionStorage.d.ts +14 -0
- package/dist/redirect-bridge/cache/SessionStorage.d.ts.map +1 -0
- package/dist/redirect-bridge/cache/TokenCache.d.ts +20 -0
- package/dist/redirect-bridge/cache/TokenCache.d.ts.map +1 -0
- package/dist/redirect-bridge/config/Configuration.d.ts +175 -0
- package/dist/redirect-bridge/config/Configuration.d.ts.map +1 -0
- package/dist/redirect-bridge/config/Configuration.mjs +10 -0
- package/dist/redirect-bridge/config/Configuration.mjs.map +1 -0
- package/dist/redirect-bridge/controllers/IController.d.ts +3 -0
- package/dist/redirect-bridge/controllers/IController.d.ts.map +1 -0
- package/dist/redirect-bridge/controllers/NestedAppAuthController.d.ts +159 -0
- package/dist/redirect-bridge/controllers/NestedAppAuthController.d.ts.map +1 -0
- package/dist/{custom-auth-path/app/PublicClientNext.d.ts → redirect-bridge/controllers/StandardController.d.ts} +265 -116
- package/dist/redirect-bridge/controllers/StandardController.d.ts.map +1 -0
- package/dist/redirect-bridge/controllers/UnknownOperatingContextController.d.ts +73 -0
- package/dist/redirect-bridge/controllers/UnknownOperatingContextController.d.ts.map +1 -0
- package/dist/redirect-bridge/crypto/BrowserCrypto.d.ts +96 -0
- package/dist/redirect-bridge/crypto/BrowserCrypto.d.ts.map +1 -0
- package/dist/redirect-bridge/crypto/CryptoOps.d.ts +77 -0
- package/dist/redirect-bridge/crypto/CryptoOps.d.ts.map +1 -0
- package/dist/redirect-bridge/crypto/PkceGenerator.d.ts +9 -0
- package/dist/redirect-bridge/crypto/PkceGenerator.d.ts.map +1 -0
- package/dist/redirect-bridge/crypto/SignedHttpRequest.d.ts +32 -0
- package/dist/redirect-bridge/crypto/SignedHttpRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthActionInputs.d.ts +29 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthActionInputs.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthConstants.d.ts +35 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthConstants.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthPublicClientApplication.d.ts +55 -0
- package/dist/redirect-bridge/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/ICustomAuthPublicClientApplication.d.ts +33 -0
- package/dist/redirect-bridge/custom_auth/ICustomAuthPublicClientApplication.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/UserAccountAttributes.d.ts +12 -0
- package/dist/redirect-bridge/custom_auth/UserAccountAttributes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/configuration/CustomAuthConfiguration.d.ts +14 -0
- package/dist/redirect-bridge/custom_auth/configuration/CustomAuthConfiguration.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/controller/CustomAuthStandardController.d.ts +27 -0
- package/dist/redirect-bridge/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/controller/ICustomAuthStandardController.d.ts +13 -0
- package/dist/redirect-bridge/custom_auth/controller/ICustomAuthStandardController.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/CustomAuthAuthority.d.ts +29 -0
- package/dist/redirect-bridge/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +40 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowResultBase.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowResultBase.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowState.d.ts +31 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts +29 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/AuthMethodDetails.d.ts +15 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/AuthMethodDetails.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts +27 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +47 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +82 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationStateParameters.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationStateParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts +27 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +40 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +34 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +67 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts +19 -0
- package/dist/redirect-bridge/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/CustomAuthApiError.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/core/error/CustomAuthApiError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/CustomAuthError.d.ts +9 -0
- package/dist/redirect-bridge/custom_auth/core/error/CustomAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/HttpError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/HttpError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/HttpErrorCodes.d.ts +3 -0
- package/dist/redirect-bridge/custom_auth/core/error/HttpErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidArgumentError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidArgumentError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidConfigurationError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidConfigurationError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidConfigurationErrorCodes.d.ts +4 -0
- package/dist/redirect-bridge/custom_auth/core/error/InvalidConfigurationErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/MethodNotImplementedError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/MethodNotImplementedError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/MsalCustomAuthError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/MsalCustomAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/NoCachedAccountFoundError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/NoCachedAccountFoundError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/ParsedUrlError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/ParsedUrlError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/ParsedUrlErrorCodes.d.ts +2 -0
- package/dist/redirect-bridge/custom_auth/core/error/ParsedUrlErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/UnexpectedError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/UnexpectedError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/UnsupportedEnvironmentError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/UnsupportedEnvironmentError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAccountAttributeError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAccountAttributeError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAccountAttributeErrorCodes.d.ts +2 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAccountAttributeErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAlreadySignedInError.d.ts +5 -0
- package/dist/redirect-bridge/custom_auth/core/error/UserAlreadySignedInError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +34 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts +22 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/JitClient.d.ts +21 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts +22 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/MfaClient.d.ts +21 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts +14 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts +23 -0
- package/dist/redirect-bridge/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/BaseApiClient.d.ts +15 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/BaseApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts +14 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +16 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/ICustomAuthApiClient.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/ICustomAuthApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.d.ts +18 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.d.ts +34 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/SignupApiClient.d.ts +23 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/SignupApiClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts +23 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiErrorResponseTypes.d.ts +29 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiErrorResponseTypes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +86 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts +71 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts +13 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiTypesBase.d.ts +9 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/custom_auth_api/types/ApiTypesBase.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/http_client/FetchHttpClient.d.ts +13 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/http_client/FetchHttpClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/http_client/IHttpClient.d.ts +35 -0
- package/dist/redirect-bridge/custom_auth/core/network_client/http_client/IHttpClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/telemetry/PublicApiId.d.ts +25 -0
- package/dist/redirect-bridge/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/utils/ArgumentValidator.d.ts +4 -0
- package/dist/redirect-bridge/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/core/utils/UrlUtils.d.ts +3 -0
- package/dist/redirect-bridge/custom_auth/core/utils/UrlUtils.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts +47 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/error_type/GetAccountError.d.ts +32 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/error_type/GetAccountError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts +36 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts +35 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/SignOutState.d.ts +20 -0
- package/dist/redirect-bridge/custom_auth/get_account/auth_flow/state/SignOutState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts +21 -0
- package/dist/redirect-bridge/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/index.d.ts +84 -0
- package/dist/redirect-bridge/custom_auth/index.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/operating_context/CustomAuthOperatingContext.d.ts +13 -0
- package/dist/redirect-bridge/custom_auth/operating_context/CustomAuthOperatingContext.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.d.ts +40 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts +32 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts +27 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts +16 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordState.d.ts +6 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts +19 -0
- package/dist/redirect-bridge/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts +33 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/parameter/ResetPasswordParams.d.ts +19 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/parameter/ResetPasswordParams.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/result/ResetPasswordActionResult.d.ts +14 -0
- package/dist/redirect-bridge/custom_auth/reset_password/interaction_client/result/ResetPasswordActionResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/SignInScenario.d.ts +6 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/SignInScenario.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts +45 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +72 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +51 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +46 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts +33 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts +12 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts +17 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts +21 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInState.d.ts +22 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +25 -0
- package/dist/redirect-bridge/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/SignInClient.d.ts +49 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts +32 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts +43 -0
- package/dist/redirect-bridge/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/error_type/SignUpError.d.ts +62 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/error_type/SignUpError.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts +53 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts +37 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts +53 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts +45 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts +25 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts +32 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts +11 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts +16 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpState.d.ts +6 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpState.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts +24 -0
- package/dist/redirect-bridge/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/SignUpClient.d.ts +41 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/SignUpClient.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/parameter/SignUpParams.d.ts +26 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/parameter/SignUpParams.d.ts.map +1 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/result/SignUpActionResult.d.ts +34 -0
- package/dist/redirect-bridge/custom_auth/sign_up/interaction_client/result/SignUpActionResult.d.ts.map +1 -0
- package/dist/redirect-bridge/encode/Base64Decode.d.ts +15 -0
- package/dist/redirect-bridge/encode/Base64Decode.d.ts.map +1 -0
- package/dist/redirect-bridge/encode/Base64Decode.mjs +44 -0
- package/dist/redirect-bridge/encode/Base64Decode.mjs.map +1 -0
- package/dist/redirect-bridge/encode/Base64Encode.d.ts +20 -0
- package/dist/redirect-bridge/encode/Base64Encode.d.ts.map +1 -0
- package/dist/redirect-bridge/error/BrowserAuthError.d.ts +12 -0
- package/dist/redirect-bridge/error/BrowserAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/error/BrowserAuthError.mjs +27 -0
- package/dist/redirect-bridge/error/BrowserAuthError.mjs.map +1 -0
- package/dist/redirect-bridge/error/BrowserAuthErrorCodes.d.ts +53 -0
- package/dist/redirect-bridge/error/BrowserAuthErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/error/BrowserAuthErrorCodes.mjs +14 -0
- package/dist/redirect-bridge/error/BrowserAuthErrorCodes.mjs.map +1 -0
- package/dist/redirect-bridge/error/BrowserConfigurationAuthError.d.ts +11 -0
- package/dist/redirect-bridge/error/BrowserConfigurationAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/error/BrowserConfigurationAuthErrorCodes.d.ts +4 -0
- package/dist/redirect-bridge/error/BrowserConfigurationAuthErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/error/NativeAuthError.d.ts +27 -0
- package/dist/redirect-bridge/error/NativeAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/error/NativeAuthErrorCodes.d.ts +5 -0
- package/dist/redirect-bridge/error/NativeAuthErrorCodes.d.ts.map +1 -0
- package/dist/redirect-bridge/error/NestedAppAuthError.d.ts +6 -0
- package/dist/redirect-bridge/error/NestedAppAuthError.d.ts.map +1 -0
- package/dist/redirect-bridge/event/EventHandler.d.ts +49 -0
- package/dist/redirect-bridge/event/EventHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/event/EventMessage.d.ts +40 -0
- package/dist/redirect-bridge/event/EventMessage.d.ts.map +1 -0
- package/dist/redirect-bridge/event/EventType.d.ts +24 -0
- package/dist/redirect-bridge/event/EventType.d.ts.map +1 -0
- package/dist/redirect-bridge/index.d.ts +73 -0
- package/dist/redirect-bridge/index.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/BaseInteractionClient.d.ts +77 -0
- package/dist/redirect-bridge/interaction_client/BaseInteractionClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
- package/dist/redirect-bridge/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/PlatformAuthInteractionClient.d.ts +151 -0
- package/dist/redirect-bridge/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/PopupClient.d.ts +106 -0
- package/dist/redirect-bridge/interaction_client/PopupClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/RedirectClient.d.ts +77 -0
- package/dist/redirect-bridge/interaction_client/RedirectClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/SilentAuthCodeClient.d.ts +24 -0
- package/dist/redirect-bridge/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/SilentCacheClient.d.ts +17 -0
- package/dist/redirect-bridge/interaction_client/SilentCacheClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/SilentIframeClient.d.ts +43 -0
- package/dist/redirect-bridge/interaction_client/SilentIframeClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/SilentRefreshClient.d.ts +32 -0
- package/dist/redirect-bridge/interaction_client/SilentRefreshClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_client/StandardInteractionClient.d.ts +76 -0
- package/dist/redirect-bridge/interaction_client/StandardInteractionClient.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_handler/InteractionHandler.d.ts +32 -0
- package/dist/redirect-bridge/interaction_handler/InteractionHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/interaction_handler/SilentHandler.d.ts +11 -0
- package/dist/redirect-bridge/interaction_handler/SilentHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/AccountInfo.d.ts +13 -0
- package/dist/redirect-bridge/naa/AccountInfo.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/AuthBridge.d.ts +9 -0
- package/dist/redirect-bridge/naa/AuthBridge.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/AuthResult.d.ts +7 -0
- package/dist/redirect-bridge/naa/AuthResult.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeAccountContext.d.ts +13 -0
- package/dist/redirect-bridge/naa/BridgeAccountContext.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeCapabilities.d.ts +4 -0
- package/dist/redirect-bridge/naa/BridgeCapabilities.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeError.d.ts +10 -0
- package/dist/redirect-bridge/naa/BridgeError.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeProxy.d.ts +69 -0
- package/dist/redirect-bridge/naa/BridgeProxy.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeRequest.d.ts +8 -0
- package/dist/redirect-bridge/naa/BridgeRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeRequestEnvelope.d.ts +13 -0
- package/dist/redirect-bridge/naa/BridgeRequestEnvelope.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeResponseEnvelope.d.ts +14 -0
- package/dist/redirect-bridge/naa/BridgeResponseEnvelope.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/BridgeStatusCode.d.ts +12 -0
- package/dist/redirect-bridge/naa/BridgeStatusCode.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/IBridgeProxy.d.ts +11 -0
- package/dist/redirect-bridge/naa/IBridgeProxy.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/InitContext.d.ts +9 -0
- package/dist/redirect-bridge/naa/InitContext.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/TokenRequest.d.ts +20 -0
- package/dist/redirect-bridge/naa/TokenRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/TokenResponse.d.ts +14 -0
- package/dist/redirect-bridge/naa/TokenResponse.d.ts.map +1 -0
- package/dist/redirect-bridge/naa/mapping/NestedAppAuthAdapter.d.ts +36 -0
- package/dist/redirect-bridge/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -0
- package/dist/redirect-bridge/navigation/INavigationClient.d.ts +17 -0
- package/dist/redirect-bridge/navigation/INavigationClient.d.ts.map +1 -0
- package/dist/redirect-bridge/navigation/NavigationClient.d.ts +23 -0
- package/dist/redirect-bridge/navigation/NavigationClient.d.ts.map +1 -0
- package/dist/redirect-bridge/navigation/NavigationClient.mjs +48 -0
- package/dist/redirect-bridge/navigation/NavigationClient.mjs.map +1 -0
- package/dist/redirect-bridge/navigation/NavigationOptions.d.ts +13 -0
- package/dist/redirect-bridge/navigation/NavigationOptions.d.ts.map +1 -0
- package/dist/redirect-bridge/network/FetchClient.d.ts +21 -0
- package/dist/redirect-bridge/network/FetchClient.d.ts.map +1 -0
- package/dist/redirect-bridge/operatingcontext/BaseOperatingContext.d.ts +43 -0
- package/dist/redirect-bridge/operatingcontext/BaseOperatingContext.d.ts.map +1 -0
- package/dist/redirect-bridge/operatingcontext/NestedAppOperatingContext.d.ts +41 -0
- package/dist/redirect-bridge/operatingcontext/NestedAppOperatingContext.d.ts.map +1 -0
- package/dist/redirect-bridge/operatingcontext/StandardOperatingContext.d.ts +26 -0
- package/dist/redirect-bridge/operatingcontext/StandardOperatingContext.d.ts.map +1 -0
- package/dist/redirect-bridge/operatingcontext/UnknownOperatingContext.d.ts +26 -0
- package/dist/redirect-bridge/operatingcontext/UnknownOperatingContext.d.ts.map +1 -0
- package/dist/redirect-bridge/packageMetadata.d.ts +3 -0
- package/dist/redirect-bridge/packageMetadata.d.ts.map +1 -0
- package/dist/redirect-bridge/protocol/Authorize.d.ts +69 -0
- package/dist/redirect-bridge/protocol/Authorize.d.ts.map +1 -0
- package/dist/redirect-bridge/redirect_bridge/index.d.ts +16 -0
- package/dist/redirect-bridge/redirect_bridge/index.d.ts.map +1 -0
- package/dist/redirect-bridge/redirect_bridge/index.mjs +108 -0
- package/dist/redirect-bridge/redirect_bridge/index.mjs.map +1 -0
- package/dist/redirect-bridge/request/AuthorizationCodeRequest.d.ts +27 -0
- package/dist/redirect-bridge/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/ClearCacheRequest.d.ts +15 -0
- package/dist/redirect-bridge/request/ClearCacheRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/EndSessionPopupRequest.d.ts +24 -0
- package/dist/redirect-bridge/request/EndSessionPopupRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/EndSessionRequest.d.ts +11 -0
- package/dist/redirect-bridge/request/EndSessionRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/HandleRedirectPromiseOptions.d.ts +5 -0
- package/dist/redirect-bridge/request/HandleRedirectPromiseOptions.d.ts.map +1 -0
- package/dist/redirect-bridge/request/InitializeApplicationRequest.d.ts +10 -0
- package/dist/redirect-bridge/request/InitializeApplicationRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/PopupRequest.d.ts +25 -0
- package/dist/redirect-bridge/request/PopupRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/PopupWindowAttributes.d.ts +16 -0
- package/dist/redirect-bridge/request/PopupWindowAttributes.d.ts.map +1 -0
- package/dist/redirect-bridge/request/RedirectRequest.d.ts +16 -0
- package/dist/redirect-bridge/request/RedirectRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/RequestHelpers.d.ts +28 -0
- package/dist/redirect-bridge/request/RequestHelpers.d.ts.map +1 -0
- package/dist/redirect-bridge/request/SilentRequest.d.ts +52 -0
- package/dist/redirect-bridge/request/SilentRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/request/SsoSilentRequest.d.ts +6 -0
- package/dist/redirect-bridge/request/SsoSilentRequest.d.ts.map +1 -0
- package/dist/redirect-bridge/response/AuthenticationResult.d.ts +5 -0
- package/dist/redirect-bridge/response/AuthenticationResult.d.ts.map +1 -0
- package/dist/redirect-bridge/response/ResponseHandler.d.ts +8 -0
- package/dist/redirect-bridge/response/ResponseHandler.d.ts.map +1 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceClient.d.ts +18 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceClient.d.ts.map +1 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceEvents.d.ts +134 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceEvents.d.ts.map +1 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceMeasurement.d.ts +22 -0
- package/dist/redirect-bridge/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -0
- package/dist/redirect-bridge/telemetry/BrowserRootPerformanceEvents.d.ts +36 -0
- package/dist/redirect-bridge/telemetry/BrowserRootPerformanceEvents.d.ts.map +1 -0
- package/dist/redirect-bridge/utils/BrowserConstants.d.ts +162 -0
- package/dist/redirect-bridge/utils/BrowserConstants.d.ts.map +1 -0
- package/dist/redirect-bridge/utils/BrowserConstants.mjs +38 -0
- package/dist/redirect-bridge/utils/BrowserConstants.mjs.map +1 -0
- package/dist/redirect-bridge/utils/BrowserProtocolUtils.d.ts +12 -0
- package/dist/redirect-bridge/utils/BrowserProtocolUtils.d.ts.map +1 -0
- package/dist/redirect-bridge/utils/BrowserUtils.d.ts +111 -0
- package/dist/redirect-bridge/utils/BrowserUtils.d.ts.map +1 -0
- package/dist/redirect-bridge/utils/BrowserUtils.mjs +97 -0
- package/dist/redirect-bridge/utils/BrowserUtils.mjs.map +1 -0
- package/dist/redirect-bridge/utils/Helpers.d.ts +7 -0
- package/dist/redirect-bridge/utils/Helpers.d.ts.map +1 -0
- package/dist/redirect-bridge/utils/MsalFrameStatsUtils.d.ts +3 -0
- package/dist/redirect-bridge/utils/MsalFrameStatsUtils.d.ts.map +1 -0
- package/dist/redirect_bridge/index.d.ts +16 -0
- package/dist/redirect_bridge/index.d.ts.map +1 -0
- package/dist/request/AuthorizationCodeRequest.d.ts +18 -0
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/ClearCacheRequest.d.ts +6 -2
- package/dist/request/ClearCacheRequest.d.ts.map +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts +13 -10
- package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/request/EndSessionRequest.d.ts +4 -9
- package/dist/request/EndSessionRequest.d.ts.map +1 -1
- package/dist/request/HandleRedirectPromiseOptions.d.ts +5 -0
- package/dist/request/HandleRedirectPromiseOptions.d.ts.map +1 -0
- package/dist/request/InitializeApplicationRequest.d.ts +3 -2
- package/dist/request/InitializeApplicationRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +13 -24
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/RedirectRequest.d.ts +6 -23
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/request/RequestHelpers.d.ts +11 -1
- package/dist/request/RequestHelpers.d.ts.map +1 -1
- package/dist/request/RequestHelpers.mjs +30 -5
- package/dist/request/RequestHelpers.mjs.map +1 -1
- package/dist/request/SilentRequest.d.ts +33 -14
- package/dist/request/SilentRequest.d.ts.map +1 -1
- package/dist/request/SsoSilentRequest.d.ts +0 -22
- package/dist/request/SsoSilentRequest.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +4 -4
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceClient.mjs +3 -3
- package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.d.ts +4 -1
- package/dist/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/dist/telemetry/BrowserPerformanceEvents.mjs +7 -5
- package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.mjs.map +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.d.ts +1 -0
- package/dist/telemetry/BrowserRootPerformanceEvents.d.ts.map +1 -1
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs +5 -3
- package/dist/telemetry/BrowserRootPerformanceEvents.mjs.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +0 -4
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.mjs +1 -5
- package/dist/utils/BrowserConstants.mjs.map +1 -1
- package/dist/utils/BrowserProtocolUtils.mjs +2 -2
- package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
- package/dist/utils/BrowserUtils.d.ts +36 -2
- package/dist/utils/BrowserUtils.d.ts.map +1 -1
- package/dist/utils/BrowserUtils.mjs +152 -10
- package/dist/utils/BrowserUtils.mjs.map +1 -1
- package/dist/utils/Helpers.mjs +1 -1
- package/dist/utils/Helpers.mjs.map +1 -1
- package/dist/utils/MsalFrameStatsUtils.mjs +2 -2
- package/dist/utils/MsalFrameStatsUtils.mjs.map +1 -1
- package/lib/custom-auth-path/log-strings-mapping.json +1703 -0
- package/lib/custom-auth-path/msal-custom-auth.cjs +11652 -10579
- package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
- package/lib/custom-auth-path/types/app/IPublicClientApplication.d.ts +2 -2
- package/lib/custom-auth-path/types/app/IPublicClientApplication.d.ts.map +1 -1
- package/lib/custom-auth-path/types/app/PublicClientApplication.d.ts +5 -9
- package/lib/custom-auth-path/types/app/PublicClientApplication.d.ts.map +1 -1
- package/lib/custom-auth-path/types/cache/AccountManager.d.ts +0 -25
- package/lib/custom-auth-path/types/cache/AccountManager.d.ts.map +1 -1
- package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts +65 -8
- package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/lib/custom-auth-path/types/cache/CacheKeys.d.ts +3 -3
- package/lib/custom-auth-path/types/cache/IWindowStorage.d.ts +1 -1
- package/lib/custom-auth-path/types/cache/IWindowStorage.d.ts.map +1 -1
- package/lib/custom-auth-path/types/cache/LocalStorage.d.ts +1 -1
- package/lib/custom-auth-path/types/cache/LocalStorage.d.ts.map +1 -1
- package/lib/custom-auth-path/types/cache/TokenCache.d.ts +7 -5
- package/lib/custom-auth-path/types/cache/TokenCache.d.ts.map +1 -1
- package/lib/custom-auth-path/types/config/Configuration.d.ts +4 -12
- package/lib/custom-auth-path/types/config/Configuration.d.ts.map +1 -1
- package/lib/custom-auth-path/types/controllers/IController.d.ts +2 -57
- package/lib/custom-auth-path/types/controllers/IController.d.ts.map +1 -1
- package/lib/custom-auth-path/types/controllers/NestedAppAuthController.d.ts +4 -43
- package/lib/custom-auth-path/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/lib/custom-auth-path/types/controllers/StandardController.d.ts +3 -27
- package/lib/custom-auth-path/types/controllers/StandardController.d.ts.map +1 -1
- package/lib/custom-auth-path/types/controllers/UnknownOperatingContextController.d.ts +4 -13
- package/lib/custom-auth-path/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/CustomAuthConstants.d.ts +2 -1
- package/lib/custom-auth-path/types/custom_auth/CustomAuthConstants.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/controller/CustomAuthStandardController.d.ts +1 -0
- package/lib/custom-auth-path/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/CustomAuthAuthority.d.ts +2 -2
- package/lib/custom-auth-path/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +2 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts +29 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts +5 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +9 -3
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +6 -2
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts +7 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts +7 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +8 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts +27 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +40 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +34 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts +11 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts +11 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +67 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts +19 -0
- package/lib/custom-auth-path/types/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/JitClient.d.ts +2 -8
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts +0 -1
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts +2 -11
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts +21 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts +14 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts +23 -0
- package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts.map +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts +7 -2
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts +1 -0
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +5 -0
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts +5 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts +2 -0
- package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/core/telemetry/PublicApiId.d.ts +4 -3
- package/lib/custom-auth-path/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts +8 -0
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts +8 -0
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/SignOutState.d.ts +8 -0
- package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/state/SignOutState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/index.d.ts +7 -0
- package/lib/custom-auth-path/types/custom_auth/index.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts +2 -0
- package/lib/custom-auth-path/types/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +10 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +19 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +10 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInState.d.ts +16 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +2 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts +8 -6
- package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts +6 -0
- package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts +5 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts +4 -0
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts +2 -0
- package/lib/custom-auth-path/types/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts.map +1 -1
- package/lib/custom-auth-path/types/custom_auth/sign_up/interaction_client/SignUpClient.d.ts +4 -4
- package/lib/custom-auth-path/types/custom_auth/sign_up/interaction_client/SignUpClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/error/BrowserAuthErrorCodes.d.ts +3 -2
- package/lib/custom-auth-path/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/lib/custom-auth-path/types/error/NativeAuthError.d.ts.map +1 -1
- package/lib/custom-auth-path/types/error/NativeAuthErrorCodes.d.ts +1 -0
- package/lib/custom-auth-path/types/error/NativeAuthErrorCodes.d.ts.map +1 -1
- package/lib/custom-auth-path/types/index.d.ts +4 -4
- package/lib/custom-auth-path/types/index.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
- package/lib/custom-auth-path/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_client/PopupClient.d.ts +3 -6
- package/lib/custom-auth-path/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_client/RedirectClient.d.ts +6 -1
- package/lib/custom-auth-path/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_client/StandardInteractionClient.d.ts +3 -1
- package/lib/custom-auth-path/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/lib/custom-auth-path/types/interaction_handler/SilentHandler.d.ts +2 -7
- package/lib/custom-auth-path/types/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/lib/custom-auth-path/types/packageMetadata.d.ts +1 -1
- package/lib/custom-auth-path/types/packageMetadata.d.ts.map +1 -1
- package/lib/custom-auth-path/types/protocol/Authorize.d.ts +4 -0
- package/lib/custom-auth-path/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/custom-auth-path/types/redirect_bridge/index.d.ts +16 -0
- package/lib/custom-auth-path/types/redirect_bridge/index.d.ts.map +1 -0
- package/lib/custom-auth-path/types/request/AuthorizationCodeRequest.d.ts +18 -0
- package/lib/custom-auth-path/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/ClearCacheRequest.d.ts +6 -2
- package/lib/custom-auth-path/types/request/ClearCacheRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/EndSessionPopupRequest.d.ts +13 -10
- package/lib/custom-auth-path/types/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/EndSessionRequest.d.ts +4 -9
- package/lib/custom-auth-path/types/request/EndSessionRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/HandleRedirectPromiseOptions.d.ts +5 -0
- package/lib/custom-auth-path/types/request/HandleRedirectPromiseOptions.d.ts.map +1 -0
- package/lib/custom-auth-path/types/request/InitializeApplicationRequest.d.ts +3 -2
- package/lib/custom-auth-path/types/request/InitializeApplicationRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/PopupRequest.d.ts +13 -24
- package/lib/custom-auth-path/types/request/PopupRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/RedirectRequest.d.ts +6 -23
- package/lib/custom-auth-path/types/request/RedirectRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/RequestHelpers.d.ts +11 -1
- package/lib/custom-auth-path/types/request/RequestHelpers.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/SilentRequest.d.ts +33 -14
- package/lib/custom-auth-path/types/request/SilentRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/request/SsoSilentRequest.d.ts +0 -22
- package/lib/custom-auth-path/types/request/SsoSilentRequest.d.ts.map +1 -1
- package/lib/custom-auth-path/types/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/lib/custom-auth-path/types/telemetry/BrowserPerformanceEvents.d.ts +4 -1
- package/lib/custom-auth-path/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/lib/custom-auth-path/types/telemetry/BrowserRootPerformanceEvents.d.ts +1 -0
- package/lib/custom-auth-path/types/telemetry/BrowserRootPerformanceEvents.d.ts.map +1 -1
- package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts +0 -4
- package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts.map +1 -1
- package/lib/custom-auth-path/types/utils/BrowserUtils.d.ts +36 -2
- package/lib/custom-auth-path/types/utils/BrowserUtils.d.ts.map +1 -1
- package/lib/log-strings-mapping.json +1135 -0
- package/lib/msal-browser.cjs +15070 -15362
- package/lib/msal-browser.cjs.map +1 -1
- package/lib/msal-browser.js +15070 -15362
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +2 -75
- package/lib/redirect-bridge/msal-redirect-bridge.js +729 -0
- package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -0
- package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -0
- package/lib/types/app/IPublicClientApplication.d.ts +2 -2
- package/lib/types/app/IPublicClientApplication.d.ts.map +1 -1
- package/lib/types/app/PublicClientApplication.d.ts +5 -9
- package/lib/types/app/PublicClientApplication.d.ts.map +1 -1
- package/lib/types/cache/AccountManager.d.ts +0 -25
- package/lib/types/cache/AccountManager.d.ts.map +1 -1
- package/lib/types/cache/BrowserCacheManager.d.ts +65 -8
- package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
- package/lib/types/cache/CacheKeys.d.ts +3 -3
- package/lib/types/cache/IWindowStorage.d.ts +1 -1
- package/lib/types/cache/IWindowStorage.d.ts.map +1 -1
- package/lib/types/cache/LocalStorage.d.ts +1 -1
- package/lib/types/cache/LocalStorage.d.ts.map +1 -1
- package/lib/types/cache/TokenCache.d.ts +7 -5
- package/lib/types/cache/TokenCache.d.ts.map +1 -1
- package/lib/types/config/Configuration.d.ts +4 -12
- package/lib/types/config/Configuration.d.ts.map +1 -1
- package/lib/types/controllers/IController.d.ts +2 -57
- package/lib/types/controllers/IController.d.ts.map +1 -1
- package/lib/types/controllers/NestedAppAuthController.d.ts +4 -43
- package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
- package/lib/types/controllers/StandardController.d.ts +3 -27
- package/lib/types/controllers/StandardController.d.ts.map +1 -1
- package/lib/types/controllers/UnknownOperatingContextController.d.ts +4 -13
- package/lib/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
- package/lib/types/custom_auth/CustomAuthConstants.d.ts +2 -1
- package/lib/types/custom_auth/CustomAuthConstants.d.ts.map +1 -1
- package/lib/types/custom_auth/controller/CustomAuthStandardController.d.ts +1 -0
- package/lib/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
- package/lib/types/custom_auth/core/CustomAuthAuthority.d.ts +2 -2
- package/lib/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +2 -1
- package/lib/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/AuthFlowState.d.ts +4 -0
- package/lib/types/custom_auth/core/auth_flow/AuthFlowState.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts +29 -0
- package/lib/types/custom_auth/core/auth_flow/AuthFlowStateTypes.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts +5 -0
- package/lib/types/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +9 -3
- package/lib/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +6 -2
- package/lib/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts +7 -0
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts +7 -0
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +8 -0
- package/lib/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
- package/lib/types/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts +27 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/error_type/MfaError.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +40 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +34 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts +11 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts +11 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaFailedState.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +67 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts +19 -0
- package/lib/types/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.d.ts.map +1 -0
- package/lib/types/custom_auth/core/interaction_client/jit/JitClient.d.ts +2 -8
- package/lib/types/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
- package/lib/types/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts +0 -1
- package/lib/types/custom_auth/core/interaction_client/jit/parameter/JitParams.d.ts.map +1 -1
- package/lib/types/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts +2 -11
- package/lib/types/custom_auth/core/interaction_client/jit/result/JitActionResult.d.ts.map +1 -1
- package/lib/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts +21 -0
- package/lib/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -0
- package/lib/types/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts +14 -0
- package/lib/types/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.d.ts.map +1 -0
- package/lib/types/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts +23 -0
- package/lib/types/custom_auth/core/interaction_client/mfa/result/MfaActionResult.d.ts.map +1 -0
- package/lib/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
- package/lib/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts +7 -2
- package/lib/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts +1 -0
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +5 -0
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts +5 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.d.ts.map +1 -1
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts +2 -0
- package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.d.ts.map +1 -1
- package/lib/types/custom_auth/core/telemetry/PublicApiId.d.ts +4 -3
- package/lib/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/result/GetAccountResult.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/result/SignOutResult.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts +8 -0
- package/lib/types/custom_auth/get_account/auth_flow/state/GetAccessTokenState.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts +8 -0
- package/lib/types/custom_auth/get_account/auth_flow/state/GetAccountState.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/auth_flow/state/SignOutState.d.ts +8 -0
- package/lib/types/custom_auth/get_account/auth_flow/state/SignOutState.d.ts.map +1 -1
- package/lib/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
- package/lib/types/custom_auth/index.d.ts +7 -0
- package/lib/types/custom_auth/index.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts +4 -0
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts +4 -0
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts +2 -0
- package/lib/types/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.d.ts.map +1 -1
- package/lib/types/custom_auth/reset_password/interaction_client/ResetPasswordClient.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +10 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +19 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +10 -1
- package/lib/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts +4 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInCompletedState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts +4 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts +4 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInFailedState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInState.d.ts +16 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +2 -0
- package/lib/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts +8 -6
- package/lib/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts +6 -0
- package/lib/types/custom_auth/sign_in/interaction_client/result/SignInActionResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/result/SignUpResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts +5 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts +4 -0
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpFailedState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts +4 -0
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts +2 -0
- package/lib/types/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.d.ts.map +1 -1
- package/lib/types/custom_auth/sign_up/interaction_client/SignUpClient.d.ts +4 -4
- package/lib/types/custom_auth/sign_up/interaction_client/SignUpClient.d.ts.map +1 -1
- package/lib/types/error/BrowserAuthErrorCodes.d.ts +3 -2
- package/lib/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/NativeAuthError.d.ts.map +1 -1
- package/lib/types/error/NativeAuthErrorCodes.d.ts +1 -0
- package/lib/types/error/NativeAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/index.d.ts +4 -4
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
- package/lib/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
- package/lib/types/interaction_client/PopupClient.d.ts +3 -6
- package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
- package/lib/types/interaction_client/RedirectClient.d.ts +6 -1
- package/lib/types/interaction_client/RedirectClient.d.ts.map +1 -1
- package/lib/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/lib/types/interaction_client/StandardInteractionClient.d.ts +3 -1
- package/lib/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/lib/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/lib/types/interaction_handler/SilentHandler.d.ts +2 -7
- package/lib/types/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Authorize.d.ts +4 -0
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/redirect_bridge/index.d.ts +16 -0
- package/lib/types/redirect_bridge/index.d.ts.map +1 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts +18 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/lib/types/request/ClearCacheRequest.d.ts +6 -2
- package/lib/types/request/ClearCacheRequest.d.ts.map +1 -1
- package/lib/types/request/EndSessionPopupRequest.d.ts +13 -10
- package/lib/types/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/lib/types/request/EndSessionRequest.d.ts +4 -9
- package/lib/types/request/EndSessionRequest.d.ts.map +1 -1
- package/lib/types/request/HandleRedirectPromiseOptions.d.ts +5 -0
- package/lib/types/request/HandleRedirectPromiseOptions.d.ts.map +1 -0
- package/lib/types/request/InitializeApplicationRequest.d.ts +3 -2
- package/lib/types/request/InitializeApplicationRequest.d.ts.map +1 -1
- package/lib/types/request/PopupRequest.d.ts +13 -24
- package/lib/types/request/PopupRequest.d.ts.map +1 -1
- package/lib/types/request/RedirectRequest.d.ts +6 -23
- package/lib/types/request/RedirectRequest.d.ts.map +1 -1
- package/lib/types/request/RequestHelpers.d.ts +11 -1
- package/lib/types/request/RequestHelpers.d.ts.map +1 -1
- package/lib/types/request/SilentRequest.d.ts +33 -14
- package/lib/types/request/SilentRequest.d.ts.map +1 -1
- package/lib/types/request/SsoSilentRequest.d.ts +0 -22
- package/lib/types/request/SsoSilentRequest.d.ts.map +1 -1
- package/lib/types/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/BrowserPerformanceEvents.d.ts +4 -1
- package/lib/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
- package/lib/types/telemetry/BrowserRootPerformanceEvents.d.ts +1 -0
- package/lib/types/telemetry/BrowserRootPerformanceEvents.d.ts.map +1 -1
- package/lib/types/utils/BrowserConstants.d.ts +0 -4
- package/lib/types/utils/BrowserConstants.d.ts.map +1 -1
- package/lib/types/utils/BrowserUtils.d.ts +36 -2
- package/lib/types/utils/BrowserUtils.d.ts.map +1 -1
- package/package.json +126 -112
- package/src/app/IPublicClientApplication.ts +2 -2
- package/src/app/PublicClientApplication.ts +17 -31
- package/src/cache/AccountManager.ts +0 -142
- package/src/cache/BrowserCacheManager.ts +765 -239
- package/src/cache/CacheKeys.ts +3 -3
- package/src/cache/IWindowStorage.ts +2 -1
- package/src/cache/LocalStorage.ts +30 -17
- package/src/cache/TokenCache.ts +167 -96
- package/src/config/Configuration.ts +12 -25
- package/src/controllers/IController.ts +2 -119
- package/src/controllers/NestedAppAuthController.ts +46 -114
- package/src/controllers/StandardController.ts +112 -141
- package/src/controllers/UnknownOperatingContextController.ts +3 -72
- package/src/custom_auth/CustomAuthConstants.ts +1 -0
- package/src/custom_auth/controller/CustomAuthStandardController.ts +34 -0
- package/src/custom_auth/core/CustomAuthAuthority.ts +3 -2
- package/src/custom_auth/core/auth_flow/AuthFlowErrorBase.ts +13 -2
- package/src/custom_auth/core/auth_flow/AuthFlowState.ts +6 -1
- package/src/custom_auth/core/auth_flow/AuthFlowStateTypes.ts +60 -0
- package/src/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.ts +9 -1
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts +21 -8
- package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts +15 -5
- package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.ts +10 -1
- package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.ts +10 -1
- package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts +18 -4
- package/src/custom_auth/core/auth_flow/mfa/error_type/MfaError.ts +40 -0
- package/src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts +67 -0
- package/src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts +60 -0
- package/src/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.ts +17 -0
- package/src/custom_auth/core/auth_flow/mfa/state/MfaFailedState.ts +17 -0
- package/src/custom_auth/core/auth_flow/mfa/state/MfaState.ts +202 -0
- package/src/custom_auth/core/auth_flow/mfa/state/MfaStateParameters.ts +28 -0
- package/src/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.ts +1 -1
- package/src/custom_auth/core/interaction_client/jit/JitClient.ts +18 -60
- package/src/custom_auth/core/interaction_client/jit/parameter/JitParams.ts +0 -2
- package/src/custom_auth/core/interaction_client/jit/result/JitActionResult.ts +2 -22
- package/src/custom_auth/core/interaction_client/mfa/MfaClient.ts +165 -0
- package/src/custom_auth/core/interaction_client/mfa/parameter/MfaClientParameters.ts +20 -0
- package/src/custom_auth/core/interaction_client/mfa/result/MfaActionResult.ts +48 -0
- package/src/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.ts +2 -1
- package/src/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/SignInApiClient.ts +27 -1
- package/src/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.ts +1 -0
- package/src/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.ts +6 -0
- package/src/custom_auth/core/network_client/custom_auth_api/types/ApiResponseTypes.ts +6 -1
- package/src/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.ts +2 -0
- package/src/custom_auth/core/telemetry/PublicApiId.ts +6 -3
- package/src/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.ts +6 -2
- package/src/custom_auth/get_account/auth_flow/result/GetAccountResult.ts +6 -2
- package/src/custom_auth/get_account/auth_flow/result/SignOutResult.ts +6 -2
- package/src/custom_auth/get_account/auth_flow/state/GetAccessTokenState.ts +16 -2
- package/src/custom_auth/get_account/auth_flow/state/GetAccountState.ts +16 -2
- package/src/custom_auth/get_account/auth_flow/state/SignOutState.ts +16 -2
- package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +18 -13
- package/src/custom_auth/index.ts +22 -0
- package/src/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.ts +6 -8
- package/src/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.ts +6 -2
- package/src/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.ts +8 -2
- package/src/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.ts +6 -2
- package/src/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.ts +8 -0
- package/src/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.ts +7 -1
- package/src/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.ts +7 -1
- package/src/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.ts +7 -0
- package/src/custom_auth/reset_password/auth_flow/state/ResetPasswordStateParameters.ts +2 -0
- package/src/custom_auth/reset_password/interaction_client/ResetPasswordClient.ts +18 -17
- package/src/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.ts +6 -2
- package/src/custom_auth/sign_in/auth_flow/result/SignInResult.ts +28 -6
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.ts +38 -3
- package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.ts +26 -4
- package/src/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.ts +17 -11
- package/src/custom_auth/sign_in/auth_flow/state/SignInCompletedState.ts +7 -1
- package/src/custom_auth/sign_in/auth_flow/state/SignInContinuationState.ts +14 -50
- package/src/custom_auth/sign_in/auth_flow/state/SignInFailedState.ts +7 -1
- package/src/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.ts +18 -49
- package/src/custom_auth/sign_in/auth_flow/state/SignInState.ts +108 -0
- package/src/custom_auth/sign_in/auth_flow/state/SignInStateParameters.ts +2 -0
- package/src/custom_auth/sign_in/interaction_client/SignInClient.ts +162 -73
- package/src/custom_auth/sign_in/interaction_client/result/SignInActionResult.ts +15 -0
- package/src/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.ts +6 -6
- package/src/custom_auth/sign_up/auth_flow/result/SignUpResult.ts +10 -4
- package/src/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.ts +6 -2
- package/src/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.ts +10 -4
- package/src/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.ts +8 -3
- package/src/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.ts +7 -0
- package/src/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.ts +10 -0
- package/src/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.ts +8 -2
- package/src/custom_auth/sign_up/auth_flow/state/SignUpFailedState.ts +7 -1
- package/src/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.ts +8 -0
- package/src/custom_auth/sign_up/auth_flow/state/SignUpStateParameters.ts +2 -0
- package/src/custom_auth/sign_up/interaction_client/SignUpClient.ts +62 -46
- package/src/error/BrowserAuthErrorCodes.ts +4 -2
- package/src/error/NativeAuthError.ts +1 -0
- package/src/error/NativeAuthErrorCodes.ts +1 -0
- package/src/index.ts +6 -11
- package/src/interaction_client/PlatformAuthInteractionClient.ts +13 -6
- package/src/interaction_client/PopupClient.ts +239 -105
- package/src/interaction_client/RedirectClient.ts +109 -80
- package/src/interaction_client/SilentIframeClient.ts +123 -59
- package/src/interaction_client/StandardInteractionClient.ts +35 -19
- package/src/interaction_handler/InteractionHandler.ts +0 -11
- package/src/interaction_handler/SilentHandler.ts +25 -90
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +65 -6
- package/src/redirect_bridge/index.ts +131 -0
- package/src/request/AuthorizationCodeRequest.ts +18 -0
- package/src/request/ClearCacheRequest.ts +6 -2
- package/src/request/EndSessionPopupRequest.ts +13 -12
- package/src/request/EndSessionRequest.ts +4 -11
- package/src/request/HandleRedirectPromiseOptions.ts +9 -0
- package/src/request/InitializeApplicationRequest.ts +3 -2
- package/src/request/PopupRequest.ts +13 -24
- package/src/request/RedirectRequest.ts +6 -23
- package/src/request/RequestHelpers.ts +34 -0
- package/src/request/SilentRequest.ts +33 -14
- package/src/request/SsoSilentRequest.ts +0 -22
- package/src/telemetry/BrowserPerformanceClient.ts +5 -2
- package/src/telemetry/BrowserPerformanceEvents.ts +5 -1
- package/src/telemetry/BrowserRootPerformanceEvents.ts +2 -0
- package/src/utils/BrowserConstants.ts +0 -4
- package/src/utils/BrowserProtocolUtils.ts +1 -1
- package/src/utils/BrowserUtils.ts +228 -9
- package/dist/app/PublicClientNext.d.ts.map +0 -1
- package/dist/app/PublicClientNext.mjs +0 -303
- package/dist/app/PublicClientNext.mjs.map +0 -1
- package/dist/controllers/ControllerFactory.d.ts +0 -6
- package/dist/controllers/ControllerFactory.d.ts.map +0 -1
- package/dist/controllers/ControllerFactory.mjs +0 -41
- package/dist/controllers/ControllerFactory.mjs.map +0 -1
- package/dist/controllers/UnknownOperatingContextController.mjs +0 -255
- package/dist/controllers/UnknownOperatingContextController.mjs.map +0 -1
- package/dist/custom-auth-path/app/PublicClientNext.d.ts.map +0 -1
- package/dist/custom-auth-path/controllers/ControllerFactory.d.ts +0 -6
- package/dist/custom-auth-path/controllers/ControllerFactory.d.ts.map +0 -1
- package/dist/custom-auth-path/controllers/ControllerFactory.mjs +0 -19
- package/dist/custom-auth-path/controllers/ControllerFactory.mjs.map +0 -1
- package/dist/custom-auth-path/utils/PopupUtils.d.ts +0 -33
- package/dist/custom-auth-path/utils/PopupUtils.d.ts.map +0 -1
- package/dist/custom-auth-path/utils/PopupUtils.mjs +0 -90
- package/dist/custom-auth-path/utils/PopupUtils.mjs.map +0 -1
- package/dist/operatingcontext/UnknownOperatingContext.mjs +0 -49
- package/dist/operatingcontext/UnknownOperatingContext.mjs.map +0 -1
- package/dist/utils/PopupUtils.d.ts +0 -33
- package/dist/utils/PopupUtils.d.ts.map +0 -1
- package/dist/utils/PopupUtils.mjs +0 -90
- package/dist/utils/PopupUtils.mjs.map +0 -1
- package/lib/custom-auth-path/types/app/PublicClientNext.d.ts +0 -231
- package/lib/custom-auth-path/types/app/PublicClientNext.d.ts.map +0 -1
- package/lib/custom-auth-path/types/controllers/ControllerFactory.d.ts +0 -6
- package/lib/custom-auth-path/types/controllers/ControllerFactory.d.ts.map +0 -1
- package/lib/custom-auth-path/types/utils/PopupUtils.d.ts +0 -33
- package/lib/custom-auth-path/types/utils/PopupUtils.d.ts.map +0 -1
- package/lib/types/app/PublicClientNext.d.ts +0 -231
- package/lib/types/app/PublicClientNext.d.ts.map +0 -1
- package/lib/types/controllers/ControllerFactory.d.ts +0 -6
- package/lib/types/controllers/ControllerFactory.d.ts.map +0 -1
- package/lib/types/utils/PopupUtils.d.ts +0 -33
- package/lib/types/utils/PopupUtils.d.ts.map +0 -1
- package/src/app/PublicClientNext.ts +0 -389
- package/src/controllers/ControllerFactory.ts +0 -49
- package/src/utils/PopupUtils.ts +0 -117
package/lib/msal-browser.min.js
CHANGED
|
@@ -1,75 +1,2 @@
|
|
|
1
|
-
/*! @azure/msal-browser v5.0.
|
|
2
|
-
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msal={})}(this,(function(e){
|
|
3
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
4
|
-
function t(e){return`See https://aka.ms/msal.js.errors#${e} for details`}class r extends Error{constructor(e,n,o){const i=n||(e?t(e):"");super(i?`${e}: ${i}`:e),Object.setPrototypeOf(this,r.prototype),this.errorCode=e||"",this.errorMessage=i||"",this.subError=o||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function n(e,n){return new r(e,n||t(e))}
|
|
5
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class o extends r{constructor(e,t){super(e,t),this.name="ClientAuthError",Object.setPrototypeOf(this,o.prototype)}}function i(e,t){return new o(e,t)}
|
|
6
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const s="client_info_decoding_error",a="client_info_empty_error",c="token_parsing_error",l="null_or_empty_token",h="endpoints_resolution_error",d="network_error",u="openid_config_error",g="hash_not_deserialized",p="invalid_state",m="state_mismatch",f="state_not_found",y="nonce_mismatch",w="auth_time_not_found",C="max_age_transpired",I="multiple_matching_appMetadata",v="request_cannot_be_made",k="cannot_remove_empty_scope",T="cannot_append_scopeset",A="empty_input_scopeset",b="no_account_in_silent_request",S="invalid_cache_record",_="invalid_cache_environment",E="no_account_found",P="no_crypto_object",R="token_refresh_required",O="token_claims_cnf_required_for_signedjwt",M="authorization_code_missing_from_server_response",q="binding_key_not_removed",N="end_session_endpoint_not_supported",x="key_id_missing",U="no_network_connectivity",L="user_canceled",H="method_not_implemented",B="nested_app_auth_bridge_disabled";var D=Object.freeze({__proto__:null,authTimeNotFound:w,authorizationCodeMissingFromServerResponse:M,bindingKeyNotRemoved:q,cannotAppendScopeSet:T,cannotRemoveEmptyScope:k,clientInfoDecodingError:s,clientInfoEmptyError:a,emptyInputScopeSet:A,endSessionEndpointNotSupported:N,endpointResolutionError:h,hashNotDeserialized:g,invalidCacheEnvironment:_,invalidCacheRecord:S,invalidState:p,keyIdMissing:x,maxAgeTranspired:C,methodNotImplemented:H,multipleMatchingAppMetadata:I,multipleMatchingTokens:"multiple_matching_tokens",nestedAppAuthBridgeDisabled:B,networkError:d,noAccountFound:E,noAccountInSilentRequest:b,noCryptoObject:P,noNetworkConnectivity:U,nonceMismatch:y,nullOrEmptyToken:l,openIdConfigError:u,requestCannotBeMade:v,stateMismatch:m,stateNotFound:f,tokenClaimsCnfRequiredForSignedJwt:O,tokenParsingError:c,tokenRefreshRequired:R,unexpectedCredentialType:"unexpected_credential_type",userCanceled:L});
|
|
7
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const F={createNewGuid:()=>{throw i(H)},base64Decode:()=>{throw i(H)},base64Encode:()=>{throw i(H)},base64UrlEncode:()=>{throw i(H)},encodeKid:()=>{throw i(H)},async getPublicKeyThumbprint(){throw i(H)},async removeTokenBindingKey(){throw i(H)},async clearKeystore(){throw i(H)},async signJwt(){throw i(H)},async hashString(){throw i(H)}};
|
|
8
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */var K;e.LogLevel=void 0,(K=e.LogLevel||(e.LogLevel={}))[K.Error=0]="Error",K[K.Warning=1]="Warning",K[K.Info=2]="Info",K[K.Verbose=3]="Verbose",K[K.Trace=4]="Trace";class ${constructor(t,r,n){this.level=e.LogLevel.Info;const o=t||$.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||(()=>{}),this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level="number"==typeof o.logLevel?o.logLevel:e.LogLevel.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info}}clone(e,t){return new $({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,t)}logMessage(t,r){if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;const n=`${`[${(new Date).toUTCString()}] : [${r.correlationId}]`} : ${this.packageName}@${this.packageVersion} : ${e.LogLevel[r.logLevel]} - ${t}`;this.executeCallback(r.logLevel,n,r.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:r})}errorPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:r})}warning(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:r})}warningPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:r})}info(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:r})}infoPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:r})}verbose(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:r})}verbosePii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:r})}trace(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:r})}tracePii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}
|
|
9
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const z="https://login.microsoftonline.com/common/",j="common",W=`${z}discovery/instance?api-version=1.1&authorization_endpoint=`,J=".ciamlogin.com",Q="openid",G="profile",V="offline_access",Y="N/A",X="Not Available",Z="http://169.254.169.254/metadata/instance/compute/location",ee=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],te=[Q,G,V],re=[...te,"email"],ne="Content-Type",oe="Content-Length",ie="Retry-After",se="X-AnchorMailbox",ae="WWW-Authenticate",ce="Authentication-Info",le="x-ms-request-id",he="x-ms-httpver",de="active-account-filters",ue="common",ge="organizations",pe="consumers",me="access_token",fe="xms_cc",ye={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},we="code",Ce="id_token token refresh_token",Ie={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},ve="authorization_code",ke="refresh_token",Te="Generic",Ae={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},be="appmetadata",Se="1",_e="authority-metadata",Ee="config",Pe="cache",Re="network",Oe="hardcoded_values",Me=5,qe="server-telemetry",Ne=",",xe={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Ue="throttling",Le="1",He="3",Be="4",De="2",Fe="4",Ke="5",$e="0",ze="1",je="2",We="3",Je="4",Qe={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},Ge="@azure/msal-common",Ve="16.0.0-alpha.0",Ye={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};
|
|
10
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
11
|
-
class Xe extends r{constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Xe.prototype)}}function Ze(e){return new Xe(e)}
|
|
12
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class et{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),n=e=>decodeURIComponent(e.replace(/\+/g," "));return r.forEach((e=>{if(e.trim()){const[r,o]=e.split(/=(.+)/g,2);r&&o&&(t[n(r)]=n(o))}})),t}static trimArrayEntries(e){return e.map((e=>e.trim()))}static removeEmptyStringsFromArray(e){return e.filter((e=>!!e))}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}
|
|
13
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const tt="redirect_uri_empty",rt="authority_uri_insecure",nt="url_parse_error",ot="empty_url_error",it="empty_input_scopes_error",st="invalid_claims",at="token_request_empty",ct="logout_request_empty",lt="pkce_params_missing",ht="invalid_cloud_discovery_metadata",dt="invalid_authority_metadata",ut="untrusted_authority",gt="missing_ssh_jwk",pt="missing_ssh_kid",mt="missing_nonce_authentication_header",ft="invalid_authentication_header",yt="cannot_set_OIDCOptions",wt="cannot_allow_platform_broker",Ct="authority_mismatch";var It=Object.freeze({__proto__:null,authorityMismatch:Ct,authorityUriInsecure:rt,cannotAllowPlatformBroker:wt,cannotSetOIDCOptions:yt,claimsRequestParsingError:"claims_request_parsing_error",emptyInputScopesError:it,invalidAuthenticationHeader:ft,invalidAuthorityMetadata:dt,invalidClaims:st,invalidCloudDiscoveryMetadata:ht,invalidCodeChallengeMethod:"invalid_code_challenge_method",logoutRequestEmpty:ct,missingNonceAuthenticationHeader:mt,missingSshJwk:gt,missingSshKid:pt,pkceParamsMissing:lt,redirectUriEmpty:tt,tokenRequestEmpty:at,untrustedAuthority:ut,urlEmptyError:ot,urlParseError:nt});
|
|
14
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class vt{constructor(e){const t=e?et.trimArrayEntries([...e]):[],r=t?et.removeEmptyStringsFromArray(t):[];if(!r||!r.length)throw Ze(it);this.scopes=new Set,r.forEach((e=>this.scopes.add(e)))}static fromString(e){const t=(e||"").split(" ");return new vt(t)}static createSearchScopes(e){const t=e&&e.length>0?e:[...te],r=new vt(t);return r.containsOnlyOIDCScopes()?r.removeScope(V):r.removeOIDCScopes(),r}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new vt(t);return!!e&&r.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((e=>this.containsScope(e))))}containsOnlyOIDCScopes(){let e=0;return re.forEach((t=>{this.containsScope(t)&&(e+=1)})),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach((e=>this.appendScope(e)))}catch(e){throw i(T)}}removeScope(e){if(!e)throw i(k);this.scopes.delete(e.trim())}removeOIDCScopes(){re.forEach((e=>{this.scopes.delete(e)}))}unionScopeSets(e){if(!e)throw i(A);const t=new Set;return e.scopes.forEach((e=>t.add(e.toLowerCase()))),this.scopes.forEach((e=>t.add(e.toLowerCase()))),t}intersectingScopeSets(e){if(!e)throw i(A);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach((t=>e.push(t))),e}printScopes(){if(this.scopes){return this.asArray().join(" ")}return""}printScopesLowerCase(){return this.printScopes().toLowerCase()}}
|
|
15
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function kt(e,t){return!!e&&!!t&&e===t.split(".")[1]}function Tt(e,t,r,n){if(n){const{oid:t,sub:r,tid:o,name:i,tfp:s,acr:a,preferred_username:c,upn:l,login_hint:h}=n,d=o||s||a||"";return{tenantId:d,localAccountId:t||r||"",name:i,username:c||l||"",loginHint:h,isHomeTenant:kt(d,e)}}return{tenantId:r,localAccountId:t,username:"",isHomeTenant:kt(r,e)}}function At(e,t,r,n){let o=e;if(t){const{isHomeTenant:r,...n}=t;o={...e,...n}}if(r){const{isHomeTenant:t,...i}=Tt(e.homeAccountId,e.localAccountId,e.tenantId,r);return o={...o,...i,idTokenClaims:r,idToken:n},o}return o}
|
|
16
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function bt(e,t){const r=function(e){if(!e)throw i(l);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw i(c);return t[2]}(e);try{const e=t(r);return JSON.parse(e)}catch(e){throw i(c)}}function St(e,t){if(0===t||Date.now()-3e5>e+t)throw i(C)}
|
|
17
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class _t{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Ze(ot);e.includes("#")||(this._urlString=_t.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return et.endsWith(t,"?")?t=t.slice(0,-1):et.endsWith(t,"?/")&&(t=t.slice(0,-2)),et.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw Ze(nt)}if(!e.HostNameAndPort||!e.PathSegments)throw Ze(nt);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw Ze(rt)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return _t.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==ue&&r[0]!==ge||(r[0]=e),_t.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw Ze(nt);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let n=r.AbsolutePath.split("/");return n=n.filter((e=>e&&e.length>0)),r.PathSegments=n,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw Ze(nt);return r[2]}static getAbsoluteUrl(e,t){if("/"===e[0]){const r=new _t(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new _t(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}}
|
|
18
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const Et={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},Pt={metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},Rt=new Set;function Ot(e,t,r,n,o){if(e.trace(`getAliasesFromMetadata called with source: '${o}'`,t),r&&n){const i=Mt(n,r);if(i)return e.trace(`getAliasesFromMetadata: found cloud discovery metadata in '${o}', returning aliases`,t),i.aliases;e.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in '${o}'`,t)}return null}function Mt(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.aliases.includes(t))return n}return null}
|
|
19
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */Pt.metadata.forEach((e=>{e.aliases.forEach((e=>{Rt.add(e)}))}));const qt="cache_quota_exceeded";
|
|
20
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
21
|
-
class Nt extends Error{constructor(e,r){const n=r||t(e);super(n),Object.setPrototypeOf(this,Nt.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=n}}function xt(e){return e instanceof Error?"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?new Nt(qt):new Nt(e.name,e.message):new Nt("cache_error_unknown")}
|
|
22
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function Ut(e,t){if(!e)throw i(a);try{const r=t(e);return JSON.parse(r)}catch(e){throw i(s)}}function Lt(e){if(!e)throw i(s);const t=e.split(".",2);return{uid:t[0],utid:t.length<2?"":t[1]}}
|
|
23
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const Ht=0,Bt=1,Dt=2,Ft=3;
|
|
24
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function Kt(e){if(e){return e.tid||e.tfp||e.acr||null}return null}
|
|
25
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const $t={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};
|
|
26
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function zt(e){return{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,loginHint:e.loginHint,name:e.name,nativeAccountId:e.nativeAccountId,authorityType:e.authorityType,tenantProfiles:new Map((e.tenantProfiles||[]).map((e=>[e.tenantId,e])))}}function jt(e,t,r){let n,o;n=t.authorityType===Bt?"ADFS":t.protocolMode===$t.OIDC?Te:"MSSTS",e.clientInfo&&r&&(o=Ut(e.clientInfo,r));const s=e.environment||t&&t.getPreferredCache();if(!s)throw i(_);const a=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null,l=a||c||"",h=e.idTokenClaims?.login_hint,d=o?.utid||Kt(e.idTokenClaims)||"",u=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";let g;if(e.tenantProfiles)g=e.tenantProfiles;else{g=[Tt(e.homeAccountId,u,d,e.idTokenClaims)]}return{homeAccountId:e.homeAccountId,environment:s,realm:d,localAccountId:u,username:l,authorityType:n,loginHint:h,clientInfo:e.clientInfo,name:e.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:e.cloudGraphHostName,msGraphHost:e.msGraphHost,nativeAccountId:e.nativeAccountId,tenantProfiles:g}}function Wt(e,t,r){return{authorityType:e.authorityType||Te,homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,nativeAccountId:e.nativeAccountId,realm:e.tenantId,environment:e.environment,username:e.username,loginHint:e.loginHint,name:e.name,cloudGraphHostName:t,msGraphHost:r,tenantProfiles:Array.from(e.tenantProfiles?.values()||[])}}function Jt(e,t,r,n,o,i){if(t!==Bt&&t!==Dt){if(e)try{const t=Ut(e,n.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}r.warning("No client info in response",o)}return i?.sub||""}function Qt(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))}var Gt=Object.freeze({__proto__:null,accountInfoIsEqual:function(e,t,r){if(!e||!t)return!1;let n=!0;if(r){const r=e.idTokenClaims||{},o=t.idTokenClaims||{};n=r.iat===o.iat&&r.nonce===o.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},createAccountEntity:jt,createAccountEntityFromAccountInfo:Wt,generateAccountId:function(e){return[e.homeAccountId,e.environment].join("-").toLowerCase()},generateHomeAccountId:Jt,getAccountInfo:zt,isAccountEntity:Qt,isSingleTenant:function(e){return!e.tenantProfiles}});
|
|
27
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class Vt{constructor(e,t,r,n,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(Ge,Ve),this.staticAuthorityOptions=o,this.performanceClient=n}getAllAccounts(e={},t){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,t),t,e)}getAccountInfoFilteredBy(e,t){const r=this.getAllAccounts(e,t);if(r.length>1){return r.sort((e=>e.idTokenClaims?-1:1))[0]}return 1===r.length?r[0]:null}getBaseAccountInfo(e,t){const r=this.getAccountsFilteredBy(e,t);return r.length>0?zt(r[0]):null}buildTenantProfiles(e,t,r){return e.flatMap((e=>this.getTenantProfilesFromAccountEntity(e,t,r?.tenantId,r)))}getTenantedAccountInfoByFilter(e,t,r,n,o){let i,s=null;if(o&&!this.tenantProfileMatchesFilter(r,o))return null;const a=this.getIdToken(e,n,t,r.tenantId);return a&&(i=bt(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(i,o))?null:(s=At(e,r,i,a?.secret),s)}getTenantProfilesFromAccountEntity(e,t,r,n){const o=zt(e);let i=o.tenantProfiles||new Map;const s=this.getTokenKeys();if(r){const e=i.get(r);if(!e)return[];i=new Map([[r,e]])}const a=[];return i.forEach((e=>{const r=this.getTenantedAccountInfoByFilter(o,s,e,t,n);r&&a.push(r)})),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId))&&((!t.name||e.name===t.name)&&(void 0===t.isHomeTenant||e.isHomeTenant===t.isHomeTenant))}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,n){if(!e)throw i(S);try{e.account&&await this.setAccount(e.account,t),e.idToken&&!1!==n?.idToken&&await this.setIdTokenCredential(e.idToken,t),e.accessToken&&!1!==n?.accessToken&&await this.saveAccessToken(e.accessToken,t),e.refreshToken&&!1!==n?.refreshToken&&await this.setRefreshTokenCredential(e.refreshToken,t),e.appMetadata&&this.setAppMetadata(e.appMetadata,t)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed",t),e instanceof r?e:xt(e)}}async saveAccessToken(e,t){const r={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},n=this.getTokenKeys(),o=vt.fromString(e.target);n.accessToken.forEach((e=>{if(!this.accessTokenKeyMatchesFilter(e,r,!1))return;const n=this.getAccessTokenCredential(e,t);if(n&&this.credentialMatchesFilter(n,r,t)){vt.fromString(n.target).intersectingScopeSets(o)&&this.removeAccessToken(e,t)}})),await this.setAccessTokenCredential(e,t)}getAccountsFilteredBy(e,t){const r=this.getAccountKeys(),n=[];return r.forEach((r=>{const o=this.getAccount(r,t);if(!o)return;if(e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId))return;if(e.username&&!this.matchUsername(o.username,e.username))return;if(e.environment&&!this.matchEnvironment(o,e.environment,t))return;if(e.realm&&!this.matchRealm(o,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const i={localAccountId:e?.localAccountId,name:e?.name},s=o.tenantProfiles?.filter((e=>this.tenantProfileMatchesFilter(e,i)));s&&0===s.length||n.push(o)})),n}credentialMatchesFilter(e,t,r){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment,r))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if(e.credentialType===Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===xe.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e,t){const r=this.getKeys(),n={};return r.forEach((r=>{if(!this.isAppMetadata(r))return;const o=this.getAppMetadata(r,t);o&&(e.environment&&!this.matchEnvironment(o,e.environment,t)||e.clientId&&!this.matchClientId(o,e.clientId)||(n[r]=o))})),n}getAuthorityMetadataByAlias(e,t){const r=this.getAuthorityMetadataKeys();let n=null;return r.forEach((r=>{if(!this.isAuthorityMetadata(r)||-1===r.indexOf(this.clientId))return;const o=this.getAuthorityMetadata(r,t);o&&-1!==o.aliases.indexOf(e)&&(n=o)})),n}removeAllAccounts(e){this.getAllAccounts({},e).forEach((t=>{this.removeAccount(t,e)}))}removeAccount(e,t){this.removeAccountContext(e,t);this.getAccountKeys().filter((t=>t.includes(e.homeAccountId)&&t.includes(e.environment))).forEach((e=>{this.removeItem(e,t),this.performanceClient.incrementFields({accountsRemoved:1},t)}))}removeAccountContext(e,t){const r=this.getTokenKeys(),n=t=>t.includes(e.homeAccountId)&&t.includes(e.environment);r.idToken.filter(n).forEach((e=>{this.removeIdToken(e,t)})),r.accessToken.filter(n).forEach((e=>{this.removeAccessToken(e,t)})),r.refreshToken.filter(n).forEach((e=>{this.removeRefreshToken(e,t)}))}removeAccessToken(e,t){const r=this.getAccessTokenCredential(e,t);if(r&&(this.removeItem(e,t),this.performanceClient.incrementFields({accessTokensRemoved:1},t),r.credentialType.toLowerCase()===Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&r.tokenType===xe.POP)){const e=r.keyId;e&&this.cryptoImpl.removeTokenBindingKey(e,t).catch((()=>{this.commonLogger.error(`Failed to remove token binding key '${e}'`,t),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},t)}))}}removeAppMetadata(e){return this.getKeys().forEach((t=>{this.isAppMetadata(t)&&this.removeItem(t,e)})),!0}getIdToken(e,t,r,n){this.commonLogger.trace("CacheManager - getIdToken called",t);const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ae.ID_TOKEN,clientId:this.clientId,realm:n},i=this.getIdTokensByFilter(o,t,r),s=i.size;if(s<1)return this.commonLogger.info("CacheManager:getIdToken - No token found",t),null;if(s>1){let r=i;if(!n){const n=new Map;i.forEach(((t,r)=>{t.realm===e.tenantId&&n.set(r,t)}));const o=n.size;if(o<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result",t),i.values().next().value;if(1===o)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile",t),n.values().next().value;r=n}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them",t),r.forEach(((e,r)=>{this.removeIdToken(r,t)})),this.performanceClient.addFields({multiMatchedID:i.size},t),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token",t),i.values().next().value}getIdTokensByFilter(e,t,r){const n=r&&r.idToken||this.getTokenKeys().idToken,o=new Map;return n.forEach((r=>{if(!this.idTokenKeyMatchesFilter(r,{clientId:this.clientId,...e}))return;const n=this.getIdTokenCredential(r,t);n&&this.credentialMatchesFilter(n,e,t)&&o.set(r,n)})),o}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.clientId||-1!==r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e,t){this.removeItem(e,t)}removeRefreshToken(e,t){this.removeItem(e,t)}getAccessToken(e,t,r,n){const o=t.correlationId;this.commonLogger.trace("CacheManager - getAccessToken called",o);const i=vt.createSearchScopes(t.scopes),s=t.authenticationScheme||xe.BEARER,a=s&&s.toLowerCase()!==xe.BEARER.toLowerCase()?Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME:Ae.ACCESS_TOKEN,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:a,clientId:this.clientId,realm:n||e.tenantId,target:i,tokenType:s,keyId:t.sshKid},l=r&&r.accessToken||this.getTokenKeys().accessToken,h=[];l.forEach((e=>{if(this.accessTokenKeyMatchesFilter(e,c,!0)){const t=this.getAccessTokenCredential(e,o);t&&this.credentialMatchesFilter(t,c,o)&&h.push(t)}}));const d=h.length;return d<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found",o),null):d>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them",o),h.forEach((e=>{this.removeAccessToken(this.generateCredentialKey(e),o)})),this.performanceClient.addFields({multiMatchedAT:h.length},o),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token",o),h[0])}accessTokenKeyMatchesFilter(e,t,r){const n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(r&&!n.includes(e[t].toLowerCase()))return!1;if(!r&&n.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,t){const r=this.getTokenKeys(),n=[];return r.accessToken.forEach((r=>{if(!this.accessTokenKeyMatchesFilter(r,e,!0))return;const o=this.getAccessTokenCredential(r,t);o&&this.credentialMatchesFilter(o,e,t)&&n.push(o)})),n}getRefreshToken(e,t,r,n){this.commonLogger.trace("CacheManager - getRefreshToken called",r);const o=t?Se:void 0,i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:Ae.REFRESH_TOKEN,clientId:this.clientId,familyId:o},s=n&&n.refreshToken||this.getTokenKeys().refreshToken,a=[];s.forEach((e=>{if(this.refreshTokenKeyMatchesFilter(e,i)){const t=this.getRefreshTokenCredential(e,r);t&&this.credentialMatchesFilter(t,i,r)&&a.push(t)}}));const c=a.length;return c<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found.",r),null):(c>1&&this.performanceClient.addFields({multiMatchedRT:c},r),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token",r),a[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.familyId||-1!==r.indexOf(t.familyId.toLowerCase()))&&(!(!t.familyId&&t.clientId&&-1===r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase())))}readAppMetadataFromCache(e,t){const r={environment:e,clientId:this.clientId},n=this.getAppMetadataFilteredBy(r,t),o=Object.keys(n).map((e=>n[e])),s=o.length;if(s<1)return null;if(s>1)throw i(I);return o[0]}isAppMetadataFOCI(e,t){const r=this.readAppMetadataFromCache(e,t);return!(!r||r.familyId!==Se)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t,r){if(this.staticAuthorityOptions){const n=function(e,t,r){let n;const o=e.canonicalAuthority;if(o){const i=new _t(o).getUrlComponents().HostNameAndPort;n=Ot(t,r,i,e.cloudDiscoveryMetadata?.metadata,Ee)||Ot(t,r,i,Pt.metadata,Oe)||e.knownAuthorities}return n||[]}(this.staticAuthorityOptions,this.commonLogger,r);if(n.includes(t)&&n.includes(e.environment))return!0}const n=this.getAuthorityMetadataByAlias(t,r);return!!(n&&n.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||(e.preferred_username===t||e.upn===t)}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){if(e.credentialType!==Ae.ACCESS_TOKEN&&e.credentialType!==Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;return vt.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(be)}isAuthorityMetadata(e){return-1!==e.indexOf(_e)}generateAuthorityMetadataCacheKey(e){return`${_e}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class Yt extends Vt{async setAccount(){throw i(H)}getAccount(){throw i(H)}async setIdTokenCredential(){throw i(H)}getIdTokenCredential(){throw i(H)}async setAccessTokenCredential(){throw i(H)}getAccessTokenCredential(){throw i(H)}async setRefreshTokenCredential(){throw i(H)}getRefreshTokenCredential(){throw i(H)}setAppMetadata(){throw i(H)}getAppMetadata(){throw i(H)}setServerTelemetry(){throw i(H)}getServerTelemetry(){throw i(H)}setAuthorityMetadata(){throw i(H)}getAuthorityMetadata(){throw i(H)}getAuthorityMetadataKeys(){throw i(H)}setThrottlingCache(){throw i(H)}getThrottlingCache(){throw i(H)}removeItem(){throw i(H)}getKeys(){throw i(H)}getAccountKeys(){throw i(H)}getTokenKeys(){throw i(H)}generateCredentialKey(){throw i(H)}generateAccountKey(){throw i(H)}}
|
|
28
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const Xt=1,Zt=2,er=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT","unencryptedCacheCount","encryptedCacheExpiredCount","oldAccountCount","oldAccessCount","oldIdCount","oldRefreshCount","currAccountCount","currAccessCount","currIdCount","currRefreshCount","expiredCacheRemovedCount","upgradedCacheCount"]);
|
|
29
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
30
|
-
class tr{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:Xt,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}
|
|
31
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const rr={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},nr={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:""},or={async sendGetRequestAsync(){throw i(H)},async sendPostRequestAsync(){throw i(H)}},ir={sku:"msal.js.common",version:Ve,cpu:"",os:""},sr={clientSecret:"",clientAssertion:void 0},ar={azureCloudInstance:Ye.None,tenant:`${j}`},cr={application:{appName:"",appVersion:""}};function lr(e){return e.authOptions.authority.options.protocolMode===$t.OIDC}
|
|
32
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const hr="home_account_id",dr="UPN",ur="client_id",gr="redirect_uri",pr="token_type",mr="req_cnf",fr="return_spa_code",yr="x-client-xtra-sku",wr="brk_client_id",Cr="brk_redirect_uri",Ir="instance_aware";
|
|
33
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
34
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
35
|
-
function vr(e,t,r){if(!t)return;const n=e.get(ur);n&&e.has(wr)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:e.get(gr)},t)}function kr(e,t){e.set("response_type",t)}function Tr(e,t,r=!0,n=te){!r||n.includes("openid")||t.includes("openid")||n.push("openid");const o=r?[...t||[],...n]:t||[],i=new vt(o);e.set("scope",i.printScopes())}function Ar(e,t){e.set(ur,t)}function br(e,t){e.set(gr,t)}function Sr(e,t){e.set("login_hint",t)}function _r(e,t){e.set(se,`UPN:${t}`)}function Er(e,t){e.set(se,`Oid:${t.uid}@${t.utid}`)}function Pr(e,t){e.set("sid",t)}function Rr(e,t,r){const n=Kr(t,r);try{JSON.parse(n)}catch(e){throw Ze(st)}e.set("claims",n)}function Or(e,t){e.set("client-request-id",t)}function Mr(e,t){e.set("x-client-SKU",t.sku),e.set("x-client-VER",t.version),t.os&&e.set("x-client-OS",t.os),t.cpu&&e.set("x-client-CPU",t.cpu)}function qr(e,t){t?.appName&&e.set("x-app-name",t.appName),t?.appVersion&&e.set("x-app-ver",t.appVersion)}function Nr(e,t){t&&e.set("state",t)}function xr(e,t){e.set("client_secret",t)}function Ur(e,t){t&&e.set("client_assertion",t)}function Lr(e,t){t&&e.set("client_assertion_type",t)}function Hr(e,t){e.set("grant_type",t)}function Br(e){e.set("client_info","1")}function Dr(e){e.has(Ir)||e.set(Ir,"true")}function Fr(e,t){Object.entries(t).forEach((([t,r])=>{!e.has(t)&&r&&e.set(t,r)}))}function Kr(e,t){let r;if(e)try{r=JSON.parse(e)}catch(e){throw Ze(st)}else r={};return t&&t.length>0&&(r.hasOwnProperty(me)||(r[me]={}),r[me][fe]={values:t}),JSON.stringify(r)}function $r(e,t){t&&(e.set(pr,xe.POP),e.set(mr,t))}function zr(e,t){t&&(e.set(pr,xe.SSH),e.set(mr,t))}function jr(e,t){e.set("x-client-current-telemetry",t.generateCurrentRequestHeaderValue()),e.set("x-client-last-telemetry",t.generateLastRequestHeaderValue())}function Wr(e){e.set("x-ms-lib-capability","retry-after, h429")}function Jr(e,t,r){e.has(wr)||e.set(wr,t),e.has(Cr)||e.set(Cr,r)}
|
|
36
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
37
|
-
function Qr(e){if(!e)return e;let t=e.toLowerCase();return et.endsWith(t,"?")?t=t.slice(0,-1):et.endsWith(t,"?/")&&(t=t.slice(0,-2)),et.endsWith(t,"/")||(t+="/"),t}function Gr(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function Vr(e){if(!e||e.indexOf("=")<0)return null;try{const t=Gr(e),r=Object.fromEntries(new URLSearchParams(t));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch(e){throw i(g)}return null}function Yr(e){const t=new Array;return e.forEach(((e,r)=>{t.push(`${r}=${encodeURIComponent(e)}`)})),t.join("&")}function Xr(e){if(!e)return e;const t=e.split("#")[0];try{const e=new URL(t);return Qr(e.origin+e.pathname+e.search)}catch(e){return Qr(t)}}
|
|
38
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
39
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
40
|
-
const Zr="refreshTokenClientAcquireTokenWithCachedRefreshToken",en="getAuthCodeUrl",tn="handleCodeResponseFromServer",rn="popTokenGenerateCnf",nn="handleServerTokenResponse",on="authorityUpdateMetadataWithRegionalInformation",sn="regionDiscoveryGetRegionFromIMDS",an=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function '${t}'`,o);const s=n.startMeasurement(t,o);if(o){const e=t+"CallCount";n.incrementFields({[e]:1},o)}try{const n=e(...i);return s.end({success:!0}),r.trace(`Returning result from '${t}'`,o),n}catch(e){r.trace(`Error occurred in '${t}'`,o);try{r.trace(JSON.stringify(e),o)}catch(e){r.trace("Unable to print error message.",o)}throw s.end({success:!1},e),e}},cn=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function '${t}'`,o);const s=n.startMeasurement(t,o);if(o){const e=t+"CallCount";n.incrementFields({[e]:1},o)}return e(...i).then((e=>(r.trace(`Returning result from '${t}'`,o),s.end({success:!0}),e))).catch((e=>{r.trace(`Error occurred in '${t}'`,o);try{r.trace(JSON.stringify(e),o)}catch(e){r.trace("Unable to print error message.",o)}throw s.end({success:!1},e),e}))};
|
|
41
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
42
|
-
class ln{constructor(e,t,r,n){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=n}async detectRegion(e,t){let r=e;if(r)t.region_source=He;else{const e=ln.IMDS_OPTIONS;try{const n=await cn(this.getRegionFromIMDS.bind(this),sn,this.logger,this.performanceClient,this.correlationId)("2020-06-01",e);if(200===n.status&&(r=n.body,t.region_source=Be),400===n.status){const n=await cn(this.getCurrentVersion.bind(this),"regionDiscoveryGetCurrentVersion",this.logger,this.performanceClient,this.correlationId)(e);if(!n)return t.region_source=Le,null;const o=await cn(this.getRegionFromIMDS.bind(this),sn,this.logger,this.performanceClient,this.correlationId)(n,e);200===o.status&&(r=o.body,t.region_source=Be)}}catch(e){return t.region_source=Le,null}}return r||(t.region_source=Le),r||null}async getRegionFromIMDS(e,t){return this.networkInterface.sendGetRequestAsync(`${Z}?api-version=${e}&format=text`,t,2e3)}async getCurrentVersion(e){try{const t=await this.networkInterface.sendGetRequestAsync(`${Z}?format=json`,e);return 400===t.status&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}
|
|
43
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
44
|
-
function hn(){return Math.round((new Date).getTime()/1e3)}function dn(e){return e.getTime()/1e3}function un(e){return e?new Date(1e3*Number(e)):new Date}function gn(e,t){const r=Number(e)||0;return hn()+t>r}function pn(e,t){const r=Number(e)+24*t*60*60*1e3;return Date.now()>r}function mn(e){return Number(e)>hn()}
|
|
45
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function fn(e,t,r,n,o){return{credentialType:Ae.ID_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}function yn(e,t,r,n,o,s,a,c,l,h,d,u,g){const p={homeAccountId:e,credentialType:Ae.ACCESS_TOKEN,secret:r,cachedAt:hn().toString(),expiresOn:a.toString(),extendedExpiresOn:c.toString(),environment:t,clientId:n,realm:o,target:s,tokenType:d||xe.BEARER,lastUpdatedAt:Date.now().toString()};if(u&&(p.userAssertionHash=u),h&&(p.refreshOn=h.toString()),p.tokenType?.toLowerCase()!==xe.BEARER.toLowerCase())switch(p.credentialType=Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME,p.tokenType){case xe.POP:const e=bt(r,l);if(!e?.cnf?.kid)throw i(O);p.keyId=e.cnf.kid;break;case xe.SSH:p.keyId=g}return p}function wn(e,t,r,n,o,i,s){const a={credentialType:Ae.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return i&&(a.userAssertionHash=i),o&&(a.familyId=o),s&&(a.expiresOn=s.toString()),a}function Cn(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function In(e){return!!e&&(Cn(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===Ae.ACCESS_TOKEN||e.credentialType===Ae.ACCESS_TOKEN_WITH_AUTH_SCHEME))}function vn(e){return!!e&&(Cn(e)&&e.credentialType===Ae.REFRESH_TOKEN)}function kn(){return hn()+86400}function Tn(e,t,r){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=r,e.jwks_uri=t.jwks_uri}function An(e,t,r){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=r}function bn(e){return e.expiresAt<=hn()}
|
|
46
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */ln.IMDS_OPTIONS={headers:{Metadata:"true"}};class Sn{constructor(e,t,r,n,o,i,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=s,this.correlationId=i,this.managedIdentity=a||!1,this.regionDiscovery=new ln(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(J))return Ft;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case"adfs":return Bt;case"dstsv2":return Dt}return Ht}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new _t(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw i(h)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw i(h)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw i(h)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw i(N);return this.replacePath(this.metadata.end_session_endpoint)}throw i(h)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw i(h)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw i(h)}canReplaceTenant(e){return 1===e.PathSegments.length&&!Sn.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===Ht&&this.protocolMode!==$t.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new _t(this.metadata.canonical_authority).getUrlComponents(),n=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(((e,o)=>{let i=n[o];if(0===o&&this.canReplaceTenant(r)){const e=new _t(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];i!==e&&(this.logger.verbose(`Replacing tenant domain name '${i}' with id '${e}'`,this.correlationId),i=e)}e!==i&&(t=t.replace(`/${i}/`,`/${e}/`))})),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Bt||this.protocolMode===$t.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){const e=this.getCurrentMetadataEntity(),t=await cn(this.updateCloudDiscoveryMetadata.bind(this),"authorityUpdateCloudDiscoveryMetadata",this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await cn(this.updateEndpointMetadata.bind(this),"authorityUpdateEndpointMetadata",this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:kn(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==Pe&&r?.source!==Pe&&(e.expiresAt=kn(),e.canonical_authority=this.canonicalAuthority);const n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(n,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Oe&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata){Tn(e,await cn(this.updateMetadataWithRegionalInformation.bind(this),on,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await cn(this.getEndpointMetadataFromNetwork.bind(this),"authorityGetEndpointMetadataFromNetwork",this.logger,this.performanceClient,this.correlationId)();if(r)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(r=await cn(this.updateMetadataWithRegionalInformation.bind(this),on,this.logger,this.performanceClient,this.correlationId)(r)),Tn(e,r,!0),Re;throw i(u,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration",this.correlationId);const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration",this.correlationId),Tn(e,t,!1),{source:Ee};this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.",this.correlationId);const r=this.getEndpointMetadataFromHardcodedValues();if(r)return Tn(e,r,!1),{source:Oe,metadata:r};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.",this.correlationId);const n=bn(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!n?(this.logger.verbose("Found endpoint metadata in the cache.",""),{source:Pe}):(n&&this.logger.verbose("The metadata entity is expired.",""),null)}isAuthoritySameType(e){return new _t(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw Ze(dt)}return null}async getEndpointMetadataFromNetwork(){const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from '${t}'`,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(t,e),n=function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}
|
|
47
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */(r.body);return n?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration",this.correlationId),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: '${e}'`,this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Et?Et[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if("TryAutoDetect"!==t)return this.regionDiscoveryMetadata.region_outcome=De,this.regionDiscoveryMetadata.region_used=t,Sn.replaceWithRegionalInformation(e,t);const r=await cn(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),"regionDiscoveryDetectRegion",this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(r)return this.regionDiscoveryMetadata.region_outcome=Fe,this.regionDiscoveryMetadata.region_used=r,Sn.replaceWithRegionalInformation(e,r);this.regionDiscoveryMetadata.region_outcome=Ke}return e}async updateCloudDiscoveryMetadata(e){const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await cn(this.getCloudDiscoveryMetadataFromNetwork.bind(this),"authorityGetCloudDiscoveryMetadataFromNetwork",this.logger,this.performanceClient,this.correlationId)();if(r)return An(e,r,!0),Re;throw Ze(ut)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration",this.correlationId),this.logger.verbosePii(`Known Authorities: '${this.authorityOptions.knownAuthorities||Y}'`,this.correlationId),this.logger.verbosePii(`Authority Metadata: '${this.authorityOptions.authorityMetadata||Y}'`,this.correlationId),this.logger.verbosePii(`Canonical Authority: '${e.canonical_authority||Y}'`,this.correlationId);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("Found cloud discovery metadata in authority configuration",this.correlationId),An(e,t,!1),Ee;this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.",this.correlationId);const r=(n=this.hostnameAndPort,Mt(Pt.metadata,n));var n;if(r)return this.logger.verbose("Found cloud discovery metadata from hardcoded values.",this.correlationId),An(e,r,!1),Oe;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.",this.correlationId);const o=bn(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache.",""),Pe):(o&&this.logger.verbose("The metadata entity is expired.",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Ft)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.",this.correlationId),Sn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.",this.correlationId);try{this.logger.verbose("Attempting to parse the cloud discovery metadata.",this.correlationId);const e=Mt(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata.",""),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata.",this.correlationId),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.",this.correlationId)}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.",this.correlationId),Ze(ht)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.",this.correlationId),Sn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){const e=`${W}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let n=null;try{const r=await this.networkInterface.sendGetRequestAsync(e,t);let o,i;if(function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}
|
|
48
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */(r.body))o=r.body,i=o.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: '${o.tenant_discovery_endpoint}'`,this.correlationId);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(r.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse",this.correlationId),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: '${r.status}'`,this.correlationId),o=r.body,"invalid_instance"===o.error)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance.",this.correlationId),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is '${o.error}'`,this.correlationId),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is '${o.error_description}'`,this.correlationId),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network, correlationId) to []",this.correlationId),i=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),n=Mt(i,this.hostnameAndPort)}catch(e){if(e instanceof r)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\nError: '${e.errorCode}'\nError Description: '${e.errorMessage}'`,this.correlationId);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\nError: '${t.name}'\nError Description: '${t.message}'`,this.correlationId)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.",this.correlationId),this.logger.verbose("Creating custom Authority for custom domain scenario.",this.correlationId),n=Sn.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter((e=>e&&_t.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort)).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==Ye.None){const e=t.tenant?t.tenant:j;r=`${t.azureCloudInstance}/${e}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return"login.microsoftonline.com";if(this.discoveryComplete())return this.metadata.preferred_cache;throw i(h)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Rt.has(e)}static isPublicCloudAuthority(e){return ee.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const n=new _t(e);n.validateAsUri();const o=n.getUrlComponents();let i=`${t}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=`${t}.login.microsoft.com`);const s=_t.constructAuthorityUriFromObject({...n.getUrlComponents(),HostNameAndPort:i}).urlString;return r?`${s}?${r}`:s}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Sn.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Sn.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Sn.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const r=new _t(e).getUrlComponents();if(0===r.PathSegments.length&&r.HostNameAndPort.endsWith(J)){t=`${t}${r.HostNameAndPort.split(".")[0]}.onmicrosoft.com`}return t}}function _n(e){return e.endsWith("/")?e:`${e}/`}function En(e){const t=e.cloudDiscoveryMetadata;let r;if(t)try{r=JSON.parse(t)}catch(e){throw Ze(ht)}return{canonicalAuthority:e.authority?_n(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:r}}
|
|
49
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */async function Pn(e,t,r,n,o,s,a){const c=Sn.transformCIAMAuthority(_n(e)),l=new Sn(c,t,r,n,o,s,a);try{return await cn(l.resolveEndpointsAsync.bind(l),"authorityResolveEndpointsAsync",o,a,s)(),l}catch(e){throw i(h)}}
|
|
50
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */Sn.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ue,pe,ge]);class Rn extends r{constructor(e,t,r,n,o){super(e,t,r),this.name="ServerError",this.errorNo=n,this.status=o,Object.setPrototypeOf(this,Rn.prototype)}}
|
|
51
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function On(e,t,r){return{clientId:e,authority:t.authority,scopes:t.scopes,homeAccountIdentifier:r,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid,embeddedClientId:t.embeddedClientId||t.tokenBodyParameters?.clientId}}
|
|
52
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class Mn{static generateThrottlingStorageKey(e){return`${Ue}.${JSON.stringify(e)}`}static preProcess(e,t,r){const n=Mn.generateThrottlingStorageKey(t),o=e.getThrottlingCache(n,r);if(o){if(o.throttleTime<Date.now())return void e.removeItem(n,r);throw new Rn(o.errorCodes?.join(" ")||"",o.errorMessage,o.subError)}}static postProcess(e,t,r,n){if(Mn.checkResponseStatus(r)||Mn.checkResponseForRetryAfter(r)){const o={throttleTime:Mn.calculateThrottleTime(parseInt(r.headers[ie])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Mn.generateThrottlingStorageKey(t),o,n)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&(e.headers.hasOwnProperty(ie)&&(e.status<200||e.status>=300))}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||60),r+3600))}static removeThrottle(e,t,r,n){const o=On(t,r,n),i=this.generateThrottlingStorageKey(o);e.removeItem(i,r.correlationId)}}
|
|
53
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class qn extends r{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,qn.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function Nn(e,t,r,n){return e.errorMessage=`${e.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new qn(e,t,r)}
|
|
54
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class xn{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:i,clientCredentials:s,libraryInfo:a,telemetry:c,serverTelemetryManager:l,persistencePlugin:h,serializableCache:d}){const u={...nr,...r};return{authOptions:(g=e,{clientCapabilities:[],azureCloudOptions:ar,instanceAware:!1,...g}),systemOptions:{...rr,...t},loggerOptions:u,storageInterface:n||new Yt(e.clientId,F,new $(u),new tr),networkInterface:o||or,cryptoInterface:i||F,clientCredentials:s||sr,libraryInfo:{...ir,...a},telemetry:{...cr,...c},serverTelemetryManager:l||null,persistencePlugin:h||null,serializableCache:d||null};var g}(e),this.logger=new $(this.config.loggerOptions,Ge,Ve),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[ne]="application/x-www-form-urlencoded;charset=utf-8",!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case hr:try{const r=Lt(e.credential);t[se]=`Oid:${r.uid}@${r.utid}`}catch(e){this.logger.verbose(`Could not parse home account ID for CCS Header: '${e}'`,"")}break;case dr:t[se]=`UPN: ${e.credential}`}return t}async executePostToTokenEndpoint(e,t,r,n,o){const i=await this.sendPostRequest(n,e,{body:t,headers:r},o);return this.config.serverTelemetryManager&&i.status<500&&429!==i.status&&this.config.serverTelemetryManager.clearTelemetryCache(),i}async sendPostRequest(e,t,n,o){let s;Mn.preProcess(this.cacheManager,e,o);try{s=await cn(this.networkClient.sendPostRequestAsync.bind(this.networkClient),"networkClientSendPostRequestAsync",this.logger,this.performanceClient,o)(t,n);const e=s.headers||{};this.performanceClient?.addFields({refreshTokenSize:s.body.refresh_token?.length||0,httpVerToken:e[he]||"",requestId:e[le]||""},o)}catch(e){if(e instanceof qn){const t=e.responseHeaders;throw t&&this.performanceClient?.addFields({httpVerToken:t[he]||"",requestId:t[le]||"",contentTypeHeader:t[ne]||void 0,contentLengthHeader:t[oe]||void 0,httpStatus:e.httpStatus},o),e.error}throw e instanceof r?e:i(d)}return Mn.postProcess(this.cacheManager,e,s,o),s}async updateAuthority(e,t){const r=`https://${e}/${this.authority.tenant}/`,n=await Pn(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=n}createTokenQueryParameters(e){const t=new Map;return e.embeddedClientId&&Jr(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenQueryParameters&&Fr(t,e.tokenQueryParameters),Or(t,e.correlationId),vr(t,e.correlationId,this.performanceClient),Yr(t)}}
|
|
55
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const Un="no_tokens_found",Ln="native_account_unavailable",Hn="refresh_token_expired",Bn="ux_not_allowed",Dn="interaction_required",Fn="consent_required",Kn="login_required",$n="bad_token";var zn=Object.freeze({__proto__:null,badToken:$n,consentRequired:Fn,interactionRequired:Dn,loginRequired:Kn,nativeAccountUnavailable:Ln,noTokensFound:Un,refreshTokenExpired:Hn,uxNotAllowed:Bn});
|
|
56
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const jn=[Dn,Fn,Kn,$n,Bn],Wn=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed"];class Jn extends r{constructor(e,t,r,n,o,i,s,a){super(e,t,r),Object.setPrototypeOf(this,Jn.prototype),this.timestamp=n||"",this.traceId=o||"",this.correlationId=i||"",this.claims=s||"",this.name="InteractionRequiredAuthError",this.errorNo=a}}function Qn(e,t,r){const n=!!e&&jn.indexOf(e)>-1,o=!!r&&Wn.indexOf(r)>-1,i=!!t&&jn.some((e=>t.indexOf(e)>-1));return n||i||o}function Gn(e,t){return new Jn(e,t)}
|
|
57
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class Vn{static setRequestState(e,t,r){const n=Vn.generateLibraryState(e,r);return t?`${n}|${t}`:n}static generateLibraryState(e,t){if(!e)throw i(P);const r={id:e.createNewGuid()};t&&(r.meta=t);const n=JSON.stringify(r);return e.base64Encode(n)}static parseRequestState(e,t){if(!e)throw i(P);if(!t)throw i(p);try{const r=t.split("|"),n=r[0],o=r.length>1?r.slice(1).join("|"):"",i=e.base64Decode(n);return{userRequestState:o||"",libraryState:JSON.parse(i)}}catch(e){throw i(p)}}}
|
|
58
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const Yn="sw";class Xn{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){const r=await cn(this.generateKid.bind(this),rn,t,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:n}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Yn}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,n){const{resourceRequestMethod:o,resourceRequestUri:i,shrClaims:s,shrNonce:a,shrOptions:c}=r,l=i?new _t(i):void 0,h=l?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:hn(),m:o?.toUpperCase(),u:h?.HostNameAndPort,nonce:a||this.cryptoUtils.createNewGuid(),p:h?.AbsolutePath,q:h?.QueryString?[[],h.QueryString]:void 0,client_claims:s||void 0,...n},t,c,r.correlationId)}}
|
|
59
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class Zn{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}
|
|
60
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class eo{constructor(e,t,r,n,o,i,s){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.performanceClient=o,this.serializableCache=i,this.persistencePlugin=s}validateTokenResponse(e,t,r){if(e.error||e.error_description||e.suberror){const n=`Error(s): ${e.error_codes||X} - Timestamp: ${e.timestamp||X} - Description: ${e.error_description||X} - Correlation ID: ${e.correlation_id||X} - Trace ID: ${e.trace_id||X}`,o=e.error_codes?.length?e.error_codes[0]:void 0,i=new Rn(e.error,n,e.suberror,o,e.status);if(r&&e.status&&e.status>=500&&e.status<=599)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\n${i}`,t);if(r&&e.status&&e.status>=400&&e.status<=499)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\n${i}`,t);if(Qn(e.error,e.error_description,e.suberror))throw new Jn(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",o);throw i}}async handleServerTokenResponse(e,t,r,n,o,s,a,c,l){let h,d;if(e.id_token){if(h=bt(e.id_token||"",this.cryptoObj.base64Decode),o&&o.nonce&&h.nonce!==o.nonce)throw i(y);if(n.maxAge||0===n.maxAge){const e=h.auth_time;if(!e)throw i(w);St(e,n.maxAge)}}this.homeAccountIdentifier=Jt(e.client_info||"",t.authorityType,this.logger,this.cryptoObj,n.correlationId,h),o&&o.state&&(d=Vn.parseRequestState(this.cryptoObj,o.state)),e.key_id=e.key_id||n.sshKid||void 0;const u=this.generateCacheRecord(e,t,r,n,h,s,o);let g;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess",n.correlationId),g=new Zn(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(g)),a&&!c&&u.account){const e=this.cacheStorage.generateAccountKey(zt(u.account));if(!this.cacheStorage.getAccount(e,n.correlationId))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache",n.correlationId),await eo.generateAuthenticationResult(this.cryptoObj,t,u,!1,n,this.performanceClient,h,d,void 0,l)}await this.cacheStorage.saveCacheRecord(u,n.correlationId,n.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&g&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess",n.correlationId),await this.persistencePlugin.afterCacheAccess(g))}return eo.generateAuthenticationResult(this.cryptoObj,t,u,!1,n,this.performanceClient,h,d,e,l)}generateCacheRecord(e,t,r,n,o,s,a){const c=t.getPreferredCache();if(!c)throw i(_);const l=Kt(o);let h,d;e.id_token&&o&&(h=fn(this.homeAccountIdentifier,c,e.id_token,this.clientId,l||""),d=to(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,n.correlationId,o,e.client_info,c,l,a,void 0,this.logger));let u=null;if(e.access_token){const o=e.scope?vt.fromString(e.scope):new vt(n.scopes||[]),i=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,a=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,h=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,d=r+i,g=d+a,p=h&&h>0?r+h:void 0;u=yn(this.homeAccountIdentifier,c,e.access_token,this.clientId,l||t.tenant||"",o.printScopes(),d,g,this.cryptoObj.base64Decode,p,e.token_type,s,e.key_id)}let g=null;if(e.refresh_token){let t;if(e.refresh_token_expires_in){t=r+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in)}g=wn(this.homeAccountIdentifier,c,e.refresh_token,this.clientId,e.foci,s,t)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:c,familyId:e.foci}),{account:d,idToken:h,accessToken:u,refreshToken:g,appMetadata:p}}static async generateAuthenticationResult(e,t,r,n,o,s,a,c,l,h){let d,u,g="",p=[],m=null,f="";if(r.accessToken){if(r.accessToken.tokenType!==xe.POP||o.popKid)g=r.accessToken.secret;else{const t=new Xn(e,s),{secret:n,keyId:a}=r.accessToken;if(!a)throw i(x);g=await t.signPopToken(n,a,o)}p=vt.fromString(r.accessToken.target).asArray(),m=un(r.accessToken.expiresOn),d=un(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(u=un(r.accessToken.refreshOn))}r.appMetadata&&(f=r.appMetadata.familyId===Se?Se:"");const y=a?.oid||a?.sub||"",w=a?.tid||"";l?.spa_accountid&&r.account&&(r.account.nativeAccountId=l?.spa_accountid);const C=r.account?At(zt(r.account),void 0,a,r.idToken?.secret):null;return{authority:t.canonicalAuthority,uniqueId:y,tenantId:w,scopes:p,account:C,idToken:r?.idToken?.secret||"",idTokenClaims:a||{},accessToken:g,fromCache:n,expiresOn:m,extExpiresOn:d,refreshOn:u,correlationId:o.correlationId,requestId:h||"",familyId:f,tokenType:r.accessToken?.tokenType||"",state:c?c.userRequestState:"",cloudGraphHostName:r.account?.cloudGraphHostName||"",msGraphHost:r.account?.msGraphHost||"",code:l?.spa_code,fromPlatformBroker:!1}}}function to(e,t,r,n,o,i,s,a,c,l,h,d){d?.verbose("setCachedAccount called",o);const u=e.getAccountKeys().find((e=>e.startsWith(r)));let g=null;u&&(g=e.getAccount(u,o));const p=g||jt({homeAccountId:r,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:l?.cloud_graph_host_name,msGraphHost:l?.msgraph_host,nativeAccountId:h},t,n),m=p.tenantProfiles||[],f=c||p.realm;if(f&&!m.find((e=>e.tenantId===f))){const e=Tt(r,p.localAccountId,f,i);m.push(e)}return p.tenantProfiles=m,p}
|
|
61
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */async function ro(e,t,r){if("string"==typeof e)return e;return e({clientId:t,tokenEndpoint:r})}
|
|
62
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class no extends xn{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,t){if(!e.code)throw i(v);const r=hn(),n=await cn(this.executeTokenRequest.bind(this),"authClientExecuteTokenRequest",this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=n.headers?.[le],s=new eo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(n.body,e.correlationId),cn(s.handleServerTokenResponse.bind(s),nn,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,r,e,t,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw Ze(ct);const t=this.createLogoutUrlQueryString(e);return _t.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){const r=this.createTokenQueryParameters(t),n=_t.appendQueryString(e.tokenEndpoint,r),o=await cn(this.createTokenRequestBody.bind(this),"authClientCreateTokenRequestBody",this.logger,this.performanceClient,t.correlationId)(t);let i;if(t.clientInfo)try{const e=Ut(t.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${e.uid}.${e.utid}`,type:hr}}catch(e){this.logger.verbose(`Could not parse client info for CCS Header: '${e}'`,t.correlationId)}const s=this.createTokenRequestHeaders(i||t.ccsCredential),a=On(this.config.authOptions.clientId,t);return cn(this.executePostToTokenEndpoint.bind(this),"authorizationCodeClientExecutePostToTokenEndpoint",this.logger,this.performanceClient,t.correlationId)(n,o,s,a,t.correlationId)}async createTokenRequestBody(e){const t=new Map;if(Ar(t,e.embeddedClientId||e.tokenBodyParameters?.[ur]||this.config.authOptions.clientId),this.includeRedirectUri)br(t,e.redirectUri);else if(!e.redirectUri)throw Ze(tt);if(Tr(t,e.scopes,!0,this.oidcDefaultScopes),function(e,t){e.set("code",t)}(t,e.code),Mr(t,this.config.libraryInfo),qr(t,this.config.telemetry.application),Wr(t),this.serverTelemetryManager&&!lr(this.config)&&jr(t,this.serverTelemetryManager),e.codeVerifier&&function(e,t){e.set("code_verifier",t)}(t,e.codeVerifier),this.config.clientCredentials.clientSecret&&xr(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;Ur(t,await ro(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Lr(t,r.assertionType)}if(Hr(t,ve),Br(t),e.authenticationScheme===xe.POP){const r=new Xn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await cn(r.generateCnf.bind(r),rn,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}$r(t,n)}else if(e.authenticationScheme===xe.SSH){if(!e.sshJwk)throw Ze(gt);zr(t,e.sshJwk)}let r;if((!et.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Rr(t,e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Ut(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${t.uid}.${t.utid}`,type:hr}}catch(t){this.logger.verbose(`Could not parse client info for CCS Header: '${t}'`,e.correlationId)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case hr:try{Er(t,Lt(r.credential))}catch(t){this.logger.verbose(`Could not parse home account ID for CCS Header: '${t}'`,e.correlationId)}break;case dr:_r(t,r.credential)}return e.embeddedClientId&&Jr(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Fr(t,e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[fr]||Fr(t,{[fr]:"1"}),vr(t,e.correlationId,this.performanceClient),Yr(t)}createLogoutUrlQueryString(e){const t=new Map;return e.postLogoutRedirectUri&&function(e,t){e.set("post_logout_redirect_uri",t)}(t,e.postLogoutRedirectUri),e.correlationId&&Or(t,e.correlationId),e.idTokenHint&&function(e,t){e.set("id_token_hint",t)}(t,e.idTokenHint),e.state&&Nr(t,e.state),e.logoutHint&&function(e,t){e.set("logout_hint",t)}(t,e.logoutHint),e.extraQueryParameters&&Fr(t,e.extraQueryParameters),this.config.authOptions.instanceAware&&Dr(t),Yr(t)}}
|
|
63
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class oo extends xn{constructor(e,t){super(e,t)}async acquireToken(e){const t=hn(),r=await cn(this.executeTokenRequest.bind(this),"refreshTokenClientExecuteTokenRequest",this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=r.headers?.[le],o=new eo(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(r.body,e.correlationId),cn(o.handleServerTokenResponse.bind(o),nn,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw Ze(at);if(!e.account)throw i(b);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await cn(this.acquireTokenWithCachedRefreshToken.bind(this),Zr,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const r=t instanceof Jn&&t.errorCode===Un,n=t instanceof Rn&&"invalid_grant"===t.errorCode&&"client_mismatch"===t.subError;if(r||n)return cn(this.acquireTokenWithCachedRefreshToken.bind(this),Zr,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return cn(this.acquireTokenWithCachedRefreshToken.bind(this),Zr,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){const r=an(this.cacheManager.getRefreshToken.bind(this.cacheManager),"cacheManagerGetRefreshToken",this.logger,this.performanceClient,e.correlationId)(e.account,t,e.correlationId,void 0);if(!r)throw Gn(Un);if(r.expiresOn&&gn(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||300))throw this.performanceClient?.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),Gn(Hn);const n={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||xe.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:hr}};try{return await cn(this.acquireToken.bind(this),"refreshTokenClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(n)}catch(t){if(t instanceof Jn&&(this.performanceClient?.addFields({rtExpiresOnMs:Number(r.expiresOn)},e.correlationId),t.subError===$n)){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache",e.correlationId);const t=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(t,e.correlationId)}throw t}}async executeTokenRequest(e,t){const r=this.createTokenQueryParameters(e),n=_t.appendQueryString(t.tokenEndpoint,r),o=await cn(this.createTokenRequestBody.bind(this),"refreshTokenClientCreateTokenRequestBody",this.logger,this.performanceClient,e.correlationId)(e),i=this.createTokenRequestHeaders(e.ccsCredential),s=On(this.config.authOptions.clientId,e);return cn(this.executePostToTokenEndpoint.bind(this),"refreshTokenClientExecutePostToTokenEndpoint",this.logger,this.performanceClient,e.correlationId)(n,o,i,s,e.correlationId)}async createTokenRequestBody(e){const t=new Map;if(Ar(t,e.embeddedClientId||e.tokenBodyParameters?.[ur]||this.config.authOptions.clientId),e.redirectUri&&br(t,e.redirectUri),Tr(t,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),Hr(t,ke),Br(t),Mr(t,this.config.libraryInfo),qr(t,this.config.telemetry.application),Wr(t),this.serverTelemetryManager&&!lr(this.config)&&jr(t,this.serverTelemetryManager),function(e,t){e.set("refresh_token",t)}(t,e.refreshToken),this.config.clientCredentials.clientSecret&&xr(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;Ur(t,await ro(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),Lr(t,r.assertionType)}if(e.authenticationScheme===xe.POP){const r=new Xn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await cn(r.generateCnf.bind(r),rn,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}$r(t,n)}else if(e.authenticationScheme===xe.SSH){if(!e.sshJwk)throw Ze(gt);zr(t,e.sshJwk)}if((!et.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Rr(t,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case hr:try{Er(t,Lt(e.ccsCredential.credential))}catch(t){this.logger.verbose(`Could not parse home account ID for CCS Header: '${t}'`,e.correlationId)}break;case dr:_r(t,e.ccsCredential.credential)}return e.embeddedClientId&&Jr(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.tokenBodyParameters&&Fr(t,e.tokenBodyParameters),vr(t,e.correlationId,this.performanceClient),Yr(t)}}
|
|
64
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class io extends xn{constructor(e,t){super(e,t)}async acquireCachedToken(e){let t=$e;if(e.forceRefresh||!et.isEmptyObj(e.claims))throw this.setCacheOutcome(ze,e.correlationId),i(R);if(!e.account)throw i(b);const r=e.account.tenantId||function(e){const t=new _t(e).getUrlComponents(),r=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(r){case ue:case ge:case pe:return;default:return r}}(e.authority),n=this.cacheManager.getTokenKeys(),o=this.cacheManager.getAccessToken(e.account,e,n,r);if(!o)throw this.setCacheOutcome(je,e.correlationId),i(R);if(mn(o.cachedAt)||gn(o.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(We,e.correlationId),i(R);o.refreshOn&&gn(o.refreshOn,0)&&(t=Je);const s=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:o,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,n,r),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(s,e.correlationId)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await cn(this.generateResultFromCacheRecord.bind(this),"silentFlowClientGenerateResultFromCacheRecord",this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==$e&&this.logger.info(`Token refresh is required due to cache outcome: '${e}'`,t)}async generateResultFromCacheRecord(e,t){let r;if(e.idToken&&(r=bt(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=r?.auth_time;if(!e)throw i(w);St(e,t.maxAge)}return eo.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,this.performanceClient,r)}}
|
|
65
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */const so={sendGetRequestAsync:()=>Promise.reject(i(H)),sendPostRequestAsync:()=>Promise.reject(i(H))};
|
|
66
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function ao(e,t,r,n){const o=t.correlationId,i=new Map;Ar(i,t.embeddedClientId||t.extraQueryParameters?.[ur]||e.clientId);if(Tr(i,[...t.scopes||[],...t.extraScopesToConsent||[]],!0,e.authority.options.OIDCOptions?.defaultScopes),br(i,t.redirectUri),Or(i,o),function(e,t){e.set("response_mode",t||Ie.QUERY)}(i,t.responseMode),Br(i),t.prompt&&(!function(e,t){e.set("prompt",t)}(i,t.prompt),n?.addFields({prompt:t.prompt},o)),t.domainHint&&(!function(e,t){e.set("domain_hint",t)}(i,t.domainHint),n?.addFields({domainHintFromRequest:!0},o)),t.prompt!==ye.SELECT_ACCOUNT)if(t.sid&&t.prompt===ye.NONE)r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request",t.correlationId),Pr(i,t.sid),n?.addFields({sidFromRequest:!0},o);else if(t.account){const e=(s=t.account,s.idTokenClaims?.sid||null);let a=function(e){return e.loginHint||e.idTokenClaims?.login_hint||null}
|
|
67
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */(t.account);if(a&&t.domainHint&&(r.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint',t.correlationId),a=null),a){r.verbose("createAuthCodeUrlQueryString: login_hint claim present on account",t.correlationId),Sr(i,a),n?.addFields({loginHintFromClaim:!0},o);try{Er(i,Lt(t.account.homeAccountId))}catch(e){r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",t.correlationId)}}else if(e&&t.prompt===ye.NONE){r.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account",t.correlationId),Pr(i,e),n?.addFields({sidFromClaim:!0},o);try{Er(i,Lt(t.account.homeAccountId))}catch(e){r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",t.correlationId)}}else if(t.loginHint)r.verbose("createAuthCodeUrlQueryString: Adding login_hint from request",t.correlationId),Sr(i,t.loginHint),_r(i,t.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(t.account.username){r.verbose("createAuthCodeUrlQueryString: Adding login_hint from account",t.correlationId),Sr(i,t.account.username),n?.addFields({loginHintFromUpn:!0},o);try{Er(i,Lt(t.account.homeAccountId))}catch(e){r.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header",t.correlationId)}}}else t.loginHint&&(r.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request",t.correlationId),Sr(i,t.loginHint),_r(i,t.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints",t.correlationId);var s;return t.nonce&&function(e,t){e.set("nonce",t)}(i,t.nonce),t.state&&Nr(i,t.state),(t.claims||e.clientCapabilities&&e.clientCapabilities.length>0)&&Rr(i,t.claims,e.clientCapabilities),t.embeddedClientId&&Jr(i,e.clientId,e.redirectUri),!e.instanceAware||t.extraQueryParameters&&Object.keys(t.extraQueryParameters).includes(Ir)||Dr(i),i}function co(e,t){const r=Yr(t);return _t.appendQueryString(e.authorizationEndpoint,r)}function lo(e,t){if(!e.state||!t)throw e.state?i(f,"Cached State"):i(f,"Server State");let r,n;try{r=decodeURIComponent(e.state)}catch(t){throw i(p,e.state)}try{n=decodeURIComponent(t)}catch(t){throw i(p,e.state)}if(r!==n)throw i(m);if(e.error||e.error_description||e.suberror){const t=function(e){const t="code=",r=e.error_uri?.lastIndexOf(t);return r&&r>=0?e.error_uri?.substring(r+t.length):void 0}(e);if(Qn(e.error,e.error_description,e.suberror))throw new Jn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new Rn(e.error||"",e.error_description,e.suberror,t)}}
|
|
68
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
69
|
-
const ho="unexpected_error";var uo=Object.freeze({__proto__:null,postRequestFailed:"post_request_failed",unexpectedError:ho});
|
|
70
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function go(e){const{skus:t,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:i}=e,s=new Map([[0,[r,n]],[2,[o,i]]]);let a=[];if(t?.length){if(a=t.split(","),a.length<4)return t}else a=Array.from({length:4},(()=>"|"));return s.forEach(((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:r,skuName:n,skuVersion:o}=e;if(r>=t.length)return;t[r]=[n,o].join("|")}({skuArr:a,index:t,skuName:e[0],skuVersion:e[1]})})),a.join(",")}class po{constructor(e,t){this.cacheOutcome=$e,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=qe+"-"+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Ne}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r?.length&&t.push(`broker_error=${r}`);const n=t.join(Ne),o=[e,this.getRegionDiscoveryFields()].join(Ne);return[Me,o,n].join("|")}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=po.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Ne),n=e.errors.slice(0,t).join(Ne),o=e.errors.length,i=[o,t<o?"1":"0"].join(Ne);return[Me,e.cacheHits,r,n,i].join("|")}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=50&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof r?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push("unknown_error"),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=po.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const r={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}}static maxErrorsToSend(e){let t,r=0,n=0;const o=e.errors.length;for(t=0;t<o;t++){const o=e.failedRequests[2*t]||"",i=e.failedRequests[2*t+1]||"",s=e.errors[t]||"";if(n+=o.toString().length+i.toString().length+s.length+3,!(n<330))break;r+=1}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return go(e)}}
|
|
71
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */class mo extends r{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,mo.prototype)}}function fo(e){return new mo(e)}
|
|
72
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
73
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */
|
|
74
|
-
class yo{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw fo("missing_kid_error");if(!e.alg)throw fo("missing_alg_error");const t=new yo({typ:e.typ||Qe.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}
|
|
75
|
-
/*! @azure/msal-common v16.0.0-alpha.0 2025-10-02 */function wo(e,t,n,o=5){if(e instanceof Error)return e instanceof r?(n.errorCode=e.errorCode,n.subErrorCode=e.subError,void((e instanceof Rn||e instanceof Jn)&&(n.serverErrorNo=e.errorNo))):void(e instanceof Nt?n.errorCode=e.errorCode:n.errorStack?.length?t.trace("PerformanceClient.addErrorStack: Stack already exist",n.correlationId):e.stack?.length?(e.stack&&(n.errorStack=function(e,t){if(t<0)return[];const r=e.split("\n")||[],n=[],o=r[0];o.startsWith("TypeError: Cannot read property")||o.startsWith("TypeError: Cannot read properties of")||o.startsWith("TypeError: Cannot set property")||o.startsWith("TypeError: Cannot set properties of")||o.endsWith("is not a function")?n.push(Co(o)):(o.startsWith("SyntaxError")||o.startsWith("TypeError"))&&n.push(Co(o.replace(/['].*[']|["].*["]/g,"<redacted>")));for(let e=1;e<r.length&&!(n.length>=t);e++){const t=r[e];n.push(Co(t))}return n}(e.stack,o)),n.errorName=e.name):t.trace("PerformanceClient.addErrorStack: Input stack is empty",n.correlationId));t.trace("PerformanceClient.addErrorStack: Input error is not instance of Error",n.correlationId)}function Co(e){const t=e.lastIndexOf(" ")+1;if(t<1)return e;const r=e.substring(t);let n=r.lastIndexOf("/");return n=n<0?r.lastIndexOf("\\"):n,n>=0?(e.substring(0,t)+"("+r.substring(n+1)+(")"===r.charAt(r.length-1)?"":")")).trimStart():e.trimStart()}class Io{constructor(e,t,r,n,o,i,s){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.eventStack=new Map,this.intFields=s||new Set;for(const e of er)this.intFields.add(e)}startMeasurement(e,t){const r=t||this.generateId();t||this.logger.info(`PerformanceClient: No correlation id provided for '${e}', generating`,r),this.logger.trace(`PerformanceClient: Performance measurement started for '${e}'`,r);const n={eventId:this.generateId(),status:Xt,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:r,appName:this.applicationTelemetry?.appName,appVersion:this.applicationTelemetry?.appVersion};var o,i;return this.cacheEventByCorrelationId(n),o=n,(i=this.eventStack.get(r))&&i.push({name:o.name}),{end:(e,t)=>this.endMeasurement({...n,...e},t),discard:()=>this.discardMeasurements(n.correlationId),add:e=>this.addFields(e,n.correlationId),increment:e=>this.incrementFields(e,n.correlationId),event:n}}endMeasurement(e,t){const n=this.eventsByCorrelationId.get(e.correlationId);if(!n)return this.logger.trace(`PerformanceClient: Measurement not found for '${e.eventId}'`,e.correlationId),null;const o=e.eventId===n.eventId;e.durationMs=Math.round(e.durationMs||this.getDurationMs(e.startTimeMs));const i=JSON.stringify(function(e,t,n){if(!t?.length)return;const o=e=>e.length?e[e.length-1]:void 0,i=e.name,s=o(t);if(s?.name!==i)return;const a=t?.pop();if(!a)return;const c=n instanceof r?n.errorCode:n instanceof Error?n.name:void 0,l=n instanceof r?n.subError:void 0;c&&a.childErr!==c&&(a.err=c,l&&(a.subErr=l)),delete a.name,delete a.childErr;const h={...a,dur:e.durationMs};e.success||(h.fail=1);const d=o(t);if(!d)return{[i]:h};let u;if(c&&(d.childErr=c),d[i]){const e=Object.keys(d).filter((e=>e.startsWith(i))).length;u=`${i}_${e+1}`}else u=i;return d[u]=h,d}(e,this.eventStack.get(n.correlationId),t));if(o?this.discardMeasurements(n.correlationId):n.incompleteSubMeasurements?.delete(e.eventId),this.logger.trace(`PerformanceClient: Performance measurement ended for '${e.name}': '${e.durationMs}' ms`,e.correlationId),t&&wo(t,this.logger,n),!o)return n[e.name+"DurationMs"]=Math.floor(e.durationMs),{...n};o&&!t&&(n.errorCode||n.subErrorCode)&&(this.logger.trace(`PerformanceClient: Remove error and sub-error codes for root event '${e.name}' as intermediate error was successfully handled`,e.correlationId),n.errorCode=void 0,n.subErrorCode=void 0);let s={...n,...e},a=0;return s.incompleteSubMeasurements?.forEach((t=>{this.logger.trace(`PerformanceClient: Incomplete submeasurement '${t.name}' found for '${e.name}'`,s.correlationId),a++})),s.incompleteSubMeasurements=void 0,s={...s,status:Zt,incompleteSubsCount:a,context:i},this.truncateIntegralFields(s),this.emitEvents([s],e.correlationId),s}addFields(e,t){this.logger.trace("PerformanceClient: Updating static fields",t);const r=this.eventsByCorrelationId.get(t);r?this.eventsByCorrelationId.set(t,{...r,...e}):this.logger.trace("PerformanceClient: Event not found for",t)}incrementFields(e,t){this.logger.trace("PerformanceClient: Updating counters",t);const r=this.eventsByCorrelationId.get(t);if(r)for(const t in e){if(r.hasOwnProperty(t)){if(isNaN(Number(r[t])))return}else r[t]=0;r[t]+=e[t]}else this.logger.trace("PerformanceClient: Event not found for",t)}cacheEventByCorrelationId(e){const t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace(`PerformanceClient: Performance measurement for '${e.name}' added/updated`,e.correlationId),t.incompleteSubMeasurements=t.incompleteSubMeasurements||new Map,t.incompleteSubMeasurements.set(e.eventId,{name:e.name,startTimeMs:e.startTimeMs})):(this.logger.trace(`PerformanceClient: Performance measurement for '${e.name}' started`,e.correlationId),this.eventsByCorrelationId.set(e.correlationId,{...e}),this.eventStack.set(e.correlationId,[]))}discardMeasurements(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e),this.logger.trace("PerformanceClient: Event stack discarded",e),this.eventStack.delete(e)}addPerformanceCallback(e){for(const[t,r]of this.callbacks)if(r.toString()===e.toString())return this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${t}`,""),t;const t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose(`PerformanceClient: Performance callback registered with id: '${t}'`,""),t}removePerformanceCallback(e){const t=this.callbacks.delete(e);return t?this.logger.verbose(`PerformanceClient: Performance callback '${e}' removed.`,""):this.logger.verbose(`PerformanceClient: Performance callback '${e}' not removed.`,""),t}emitEvents(e,t){this.logger.verbose("PerformanceClient: Emitting performance events",t),this.callbacks.forEach(((r,n)=>{this.logger.trace(`PerformanceClient: Emitting event to callback '${n}'`,t),r.apply(null,[e])}))}truncateIntegralFields(e){this.intFields.forEach((t=>{t in e&&"number"==typeof e[t]&&(e[t]=Math.floor(e[t]))}))}getDurationMs(e){const t=Date.now()-e;return t<0?t:0}}const vo="pkce_not_created",ko="ear_jwk_empty",To="ear_jwe_empty",Ao="crypto_nonexistent",bo="empty_navigate_uri",So="hash_empty_error",_o="no_state_in_hash",Eo="hash_does_not_contain_known_properties",Po="unable_to_parse_state",Ro="state_interaction_type_mismatch",Oo="interaction_in_progress",Mo="popup_window_error",qo="empty_window_error",No="user_cancelled",xo="monitor_window_timeout",Uo="redirect_in_iframe",Lo="block_iframe_reload",Ho="block_nested_popups",Bo="silent_logout_unsupported",Do="no_account_error",Fo="no_token_request_cache_error",Ko="unable_to_parse_token_request_cache_error",$o="non_browser_environment",zo="database_not_open",jo="no_network_connectivity",Wo="post_request_failed",Jo="get_request_failed",Qo="failed_to_parse_response",Go="unable_to_load_token",Vo="crypto_key_not_found",Yo="auth_code_required",Xo="auth_code_or_nativeAccountId_required",Zo="spa_code_and_nativeAccountId_present",ei="database_unavailable",ti="unable_to_acquire_token_from_native_platform",ri="native_handshake_timeout",ni="native_extension_not_installed",oi="native_connection_not_established",ii="uninitialized_public_client_application",si="native_prompt_not_supported",ai="invalid_base64_string",ci="invalid_pop_token_request",li="failed_to_build_headers",hi="failed_to_parse_headers",di="failed_to_decrypt_ear_response",ui="timed_out";var gi=Object.freeze({__proto__:null,authCodeOrNativeAccountIdRequired:Xo,authCodeRequired:Yo,authRequestNotSetError:"auth_request_not_set_error",blockIframeReload:Lo,blockNestedPopups:Ho,cryptoKeyNotFound:Vo,cryptoNonExistent:Ao,databaseNotOpen:zo,databaseUnavailable:ei,earJweEmpty:To,earJwkEmpty:ko,emptyNavigateUri:bo,emptyWindowError:qo,failedToBuildHeaders:li,failedToDecryptEarResponse:di,failedToParseHeaders:hi,failedToParseResponse:Qo,getRequestFailed:Jo,hashDoesNotContainKnownProperties:Eo,hashEmptyError:So,iframeClosedPrematurely:"iframe_closed_prematurely",interactionInProgress:Oo,invalidBase64String:ai,invalidCacheType:"invalid_cache_type",invalidPopTokenRequest:ci,monitorPopupTimeout:"monitor_popup_timeout",monitorWindowTimeout:xo,nativeConnectionNotEstablished:oi,nativeExtensionNotInstalled:ni,nativeHandshakeTimeout:ri,nativePromptNotSupported:si,noAccountError:Do,noNetworkConnectivity:jo,noStateInHash:_o,noTokenRequestCacheError:Fo,nonBrowserEnvironment:$o,pkceNotCreated:vo,popupWindowError:Mo,postRequestFailed:Wo,redirectInIframe:Uo,silentLogoutUnsupported:Bo,silentPromptValueError:"silent_prompt_value_error",spaCodeAndNativeAccountIdPresent:Zo,stateInteractionTypeMismatch:Ro,timedOut:ui,unableToAcquireTokenFromNativePlatform:ti,unableToLoadToken:Go,unableToParseState:Po,unableToParseTokenRequestCacheError:Ko,uninitializedPublicClientApplication:ii,userCancelled:No});function pi(e){return`See https://aka.ms/msal.js.errors#${e} for details`}class mi extends r{constructor(e,t){super(e,pi(e),t),Object.setPrototypeOf(this,mi.prototype),this.name="BrowserAuthError"}}function fi(e,t){return new mi(e,t)}const yi="invalid_grant",wi=483,Ci=600,Ii="msal",vi=30,ki="msal.js.browser",Ti="53ee284d-920a-4b59-9d30-a60315b26836",Ai="ppnbnpeolgkicgegkbkbjmhlideopiji",bi="MATS",Si="MicrosoftEntra",_i="DOM API",Ei="get-token-and-sign-out",Pi="PlatformAuthDOMHandler",Ri="PlatformAuthExtensionHandler",Oi="Handshake",Mi="HandshakeResponse",qi="GetToken",Ni="Response",xi={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Ui="GET",Li="POST",Hi="signin",Bi="signout",Di="request.origin",Fi="urlHash",Ki="request.params",$i="code.verifier",zi="interaction.status",ji="request.native",Wi="wrapper.sku",Ji="wrapper.version",Qi={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var Gi;e.InteractionType=void 0,(Gi=e.InteractionType||(e.InteractionType={})).Redirect="redirect",Gi.Popup="popup",Gi.Silent="silent",Gi.None="none";const Vi={Startup:"startup",Logout:"logout",AcquireToken:"acquireToken",HandleRedirect:"handleRedirect",None:"none"},Yi={scopes:te},Xi="msal.db",Zi=`${Xi}.keys`,es={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},ts=[es.Default,es.Skip,es.RefreshTokenAndNetwork];function rs(e){return encodeURIComponent(os(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function ns(e){return is(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function os(e){return is((new TextEncoder).encode(e))}function is(e){const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)}function ss(e){return(new TextDecoder).decode(as(e))}function as(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw fi(ai)}const r=atob(t);return Uint8Array.from(r,(e=>e.codePointAt(0)||0))}const cs="AES-GCM",ls="HKDF",hs="SHA-256",ds=new Uint8Array([1,0,1]),us="0123456789abcdef",gs=new Uint32Array(1),ps="raw",ms="encrypt",fs="decrypt",ys={name:"RSASSA-PKCS1-v1_5",hash:hs,modulusLength:2048,publicExponent:ds};async function ws(e){const t=(new TextEncoder).encode(e);return window.crypto.subtle.digest(hs,t)}function Cs(e){return window.crypto.getRandomValues(e)}function Is(){return window.crypto.getRandomValues(gs),gs[0]}function vs(){const e=Date.now(),t=1024*Is()+(1023&Is()),r=new Uint8Array(16),n=Math.trunc(t/2**30),o=t&2**30-1,i=Is();r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i;let s="";for(let e=0;e<r.length;e++)s+=us.charAt(r[e]>>>4),s+=us.charAt(15&r[e]),3!==e&&5!==e&&7!==e&&9!==e||(s+="-");return s}async function ks(e){return window.crypto.subtle.exportKey("jwk",e)}async function Ts(){const e=await bs(),t={alg:"dir",kty:"oct",k:ns(new Uint8Array(e))};return os(JSON.stringify(t))}async function As(e,t){const r=t.split(".");if(5!==r.length)throw fi(di,"jwe_length");const n=await async function(e){const t=ss(e),r=as(JSON.parse(t).k);return window.crypto.subtle.importKey(ps,r,cs,!1,[fs])}(e).catch((()=>{throw fi(di,"import_key")}));try{const e=(new TextEncoder).encode(r[0]),t=as(r[2]),o=as(r[3]),i=as(r[4]),s=8*i.byteLength,a=new Uint8Array(o.length+i.length);a.set(o),a.set(i,o.length);const c=await window.crypto.subtle.decrypt({name:cs,iv:t,tagLength:s,additionalData:e},n,a);return(new TextDecoder).decode(c)}catch(e){throw fi(di,"decrypt")}}async function bs(){const e=await window.crypto.subtle.generateKey({name:cs,length:256},!0,[ms,fs]);return window.crypto.subtle.exportKey(ps,e)}async function Ss(e){return window.crypto.subtle.importKey(ps,e,ls,!1,["deriveKey"])}async function _s(e,t,r){return window.crypto.subtle.deriveKey({name:ls,salt:t,hash:hs,info:(new TextEncoder).encode(r)},e,{name:cs,length:256},!1,[ms,fs])}async function Es(e,t,r){const n=(new TextEncoder).encode(t),o=window.crypto.getRandomValues(new Uint8Array(16)),i=await _s(e,o,r),s=await window.crypto.subtle.encrypt({name:cs,iv:new Uint8Array(12)},i,n);return{data:ns(new Uint8Array(s)),nonce:ns(o)}}async function Ps(e,t,r,n){const o=as(n),i=await _s(e,as(t),r),s=await window.crypto.subtle.decrypt({name:cs,iv:new Uint8Array(12)},i,o);return(new TextDecoder).decode(s)}const Rs="storage_not_supported",Os="stubbed_public_client_application_called";class Ms extends r{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Ms.prototype)}}function qs(e){return new Ms(e,pi(e))}function Ns(e){e.location.hash="","function"==typeof e.history.replaceState&&e.history.replaceState(null,"",`${e.location.origin}${e.location.pathname}${e.location.search}`)}function xs(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}function Us(){return window.parent!==window}function Ls(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(`${Ii}.`)}function Hs(){return"undefined"!=typeof window&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function Bs(){const e=new _t(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Ds(){if(Vr(window.location.hash)&&Us())throw fi(Lo)}function Fs(e){if(Us()&&!e)throw fi(Uo)}function Ks(){if(Ls())throw fi(Ho)}function $s(){if("undefined"==typeof window)throw fi($o)}function zs(e){if(!e)throw fi(ii)}function js(e){$s(),Ds(),Ks(),zs(e)}function Ws(e,t){if(js(e),Fs(t.system.allowRedirectInIframe),t.cache.cacheLocation===xi.MemoryStorage)throw qs("in_mem_redirect_unavailable")}function Js(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout((()=>{try{document.head.removeChild(t)}catch{}}),1e4)}function Qs(){return vs()}const Gs=Kr;var Vs=Object.freeze({__proto__:null,addClientCapabilitiesToClaims:Gs,blockAPICallsBeforeInitialize:zs,blockAcquireTokenInPopups:Ks,blockNonBrowserEnvironment:$s,blockRedirectInIframe:Fs,blockReloadInHiddenIframes:Ds,clearHash:Ns,createGuid:Qs,getCurrentUri:Hs,getHomepage:Bs,invoke:an,invokeAsync:cn,isInIframe:Us,isInPopup:Ls,preconnect:Js,preflightCheck:js,redirectPreflightCheck:Ws,replaceHash:xs});class Ys{navigateInternal(e,t){return Ys.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ys.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(((e,r)=>{setTimeout((()=>{r(fi(ui,"failed_to_redirect"))}),t.timeout)}))}}class Xs{async sendGetRequestAsync(e,t){let r,n={},o=0;const i=Zs(t);try{r=await fetch(e,{method:Ui,headers:i})}catch(e){throw Nn(fi(window.navigator.onLine?Jo:jo),void 0,void 0,e)}n=ea(r.headers);try{return o=r.status,{headers:n,body:await r.json(),status:o}}catch(e){throw Nn(fi(Qo),o,n,e)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",n=Zs(t);let o,i=0,s={};try{o=await fetch(e,{method:Li,headers:n,body:r})}catch(e){throw Nn(fi(window.navigator.onLine?Wo:jo),void 0,void 0,e)}s=ea(o.headers);try{return i=o.status,{headers:s,body:await o.json(),status:i}}catch(e){throw Nn(fi(Qo),i,s,e)}}}function Zs(e){try{const t=new Headers;if(!e||!e.headers)return t;const r=e.headers;return Object.entries(r).forEach((([e,r])=>{t.append(e,r)})),t}catch(e){throw Nn(fi(li),void 0,void 0,e)}}function ea(e){try{const t={};return e.forEach(((e,r)=>{t[r]=e})),t}catch(e){throw fi(hi)}}const ta=1e4;function ra({auth:t,cache:r,system:n,telemetry:o},i){const s={clientId:"",authority:`${z}`,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:"undefined"!=typeof window?Hs():"",postLogoutRedirectUri:"",clientCapabilities:[],OIDCOptions:{responseMode:Ie.FRAGMENT,defaultScopes:[Q,G,V]},azureCloudOptions:{azureCloudInstance:Ye.None,tenant:""},instanceAware:!1},a={cacheLocation:xi.SessionStorage,cacheRetentionDays:5},c={loggerCallback:()=>{},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},l={...{...rr,loggerOptions:c,networkClient:i?new Xs:so,navigationClient:new Ys,loadFrameTimeout:0,windowHashTimeout:n?.loadFrameTimeout||6e4,iframeHashTimeout:n?.loadFrameTimeout||ta,redirectNavigationTimeout:3e4,allowRedirectInIframe:!1,navigatePopups:!0,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:n?.nativeBrokerHandshakeTimeout||2e3,pollIntervalMilliseconds:vi,protocolMode:$t.AAD},...n,loggerOptions:n?.loggerOptions||c},h={application:{appName:"",appVersion:""},client:new tr};if(n?.protocolMode!==$t.OIDC&&t?.OIDCOptions){new $(l.loggerOptions).warning(JSON.stringify(Ze(yt)),"")}if(n?.protocolMode&&n.protocolMode===$t.OIDC&&l?.allowPlatformBroker)throw Ze(wt);return{auth:{...s,...t,OIDCOptions:{...s.OIDCOptions,...t?.OIDCOptions}},cache:{...a,...r},system:l,telemetry:{...h,...o}}}const na="@azure/msal-browser",oa="5.0.0-alpha.0",ia="msal",sa="browser",aa=`${ia}.${sa}.log.level`,ca=`${ia}.${sa}.log.pii`,la=`${ia}.${sa}.performance.enabled`,ha=`${ia}.${sa}.platform.auth.dom`,da=`${ia}.version`,ua="account.keys",ga="token.keys";function pa(e=1){return e<1?`${ia}.${ua}`:`${ia}.${e}.${ua}`}function ma(e,t=1){return t<1?`${ia}.${ga}.${e}`:`${ia}.${t}.${ga}.${e}`}class fa{static loggerCallback(t,r){switch(t){case e.LogLevel.Error:return void console.error(r);case e.LogLevel.Info:return void console.info(r);case e.LogLevel.Verbose:return void console.debug(r);case e.LogLevel.Warning:return void console.warn(r);default:return void console.log(r)}}constructor(t){let r;this.browserEnvironment="undefined"!=typeof window,this.config=ra(t,this.browserEnvironment);try{r=window[xi.SessionStorage]}catch(e){}const n=r?.getItem(aa),o=r?.getItem(ca)?.toLowerCase(),i="true"===o||"false"!==o&&void 0,s={...this.config.system.loggerOptions},a=n&&Object.keys(e.LogLevel).includes(n)?e.LogLevel[n]:void 0;a&&(s.loggerCallback=fa.loggerCallback,s.logLevel=a),void 0!==i&&(s.piiLoggingEnabled=i),this.logger=new $(s,na,oa),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}const ya="USER_INTERACTION_REQUIRED",wa="USER_CANCEL",Ca="NO_NETWORK",Ia="TRANSIENT_ERROR",va="PERSISTENT_ERROR",ka="DISABLED",Ta="ACCOUNT_UNAVAILABLE",Aa="NESTED_APP_AUTH_UNAVAILABLE";class ba{static async initializeNestedAppAuthBridge(){if(void 0===window)throw new Error("window is undefined");if(void 0===window.nestedAppAuthBridge)throw new Error("window.nestedAppAuthBridge is undefined");try{window.nestedAppAuthBridge.addEventListener("message",(e=>{const t="string"==typeof e?e:e.data,r=JSON.parse(t),n=ba.bridgeRequests.find((e=>e.requestId===r.requestId));void 0!==n&&(ba.bridgeRequests.splice(ba.bridgeRequests.indexOf(n),1),r.success?n.resolve(r):n.reject(r.error))}));const e=await new Promise(((e,t)=>{const r=ba.buildRequest("GetInitContext"),n={requestId:r.requestId,method:r.method,resolve:e,reject:t};ba.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}));return ba.validateBridgeResultOrThrow(e.initContext)}catch(e){throw window.console.log(e),e}}getTokenInteractive(e){return this.getToken("GetTokenPopup",e)}getTokenSilent(e){return this.getToken("GetToken",e)}async getToken(e,t){const r=await this.sendRequest(e,{tokenParams:t});return{token:ba.validateBridgeResultOrThrow(r.token),account:ba.validateBridgeResultOrThrow(r.account)}}getHostCapabilities(){return this.capabilities??null}getAccountContext(){return this.accountContext?this.accountContext:null}static buildRequest(e,t){return{messageType:"NestedAppAuthRequest",method:e,requestId:vs(),sendTime:Date.now(),clientLibrary:ki,clientLibraryVersion:oa,...t}}sendRequest(e,t){const r=ba.buildRequest(e,t);return new Promise(((e,t)=>{const n={requestId:r.requestId,method:r.method,resolve:e,reject:t};ba.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}))}static validateBridgeResultOrThrow(e){if(void 0===e){throw{status:Aa}}return e}constructor(e,t,r,n){this.sdkName=e,this.sdkVersion=t,this.accountContext=r,this.capabilities=n}static async create(){const e=await ba.initializeNestedAppAuthBridge();return new ba(e.sdkName,e.sdkVersion,e.accountContext,e.capabilities)}}ba.bridgeRequests=[];class Sa extends fa{constructor(){super(...arguments),this.bridgeProxy=void 0,this.accountContext=null}getModuleName(){return Sa.MODULE_NAME}getId(){return Sa.ID}getBridgeProxy(){return this.bridgeProxy}async initialize(e){try{if("undefined"!=typeof window){"function"==typeof window.__initializeNestedAppAuth&&await window.__initializeNestedAppAuth();const e=await ba.create();this.accountContext=e.getAccountContext(),this.bridgeProxy=e,this.available=void 0!==e}}catch(t){this.logger.infoPii(`Could not initialize Nested App Auth bridge ('${t}')`,e)}return this.logger.info(`Nested App Auth Bridge available: '${this.available}'`,e),this.available}}Sa.MODULE_NAME="",Sa.ID="NestedAppOperatingContext";class _a extends fa{getModuleName(){return _a.MODULE_NAME}getId(){return _a.ID}async initialize(e){return this.available="undefined"!=typeof window,this.available}}_a.MODULE_NAME="",_a.ID="StandardOperatingContext";const Ea="standardInteractionClientGetDiscoveredAuthority",Pa="nativeInteractionClientAcquireToken",Ra="acquireTokenBySilentIframe",Oa="initializeBaseRequest",Ma="silentIframeClientTokenHelper",qa="silentHandlerInitiateAuthRequest",Na="silentHandlerMonitorIframeForHash",xa="standardInteractionClientCreateAuthCodeClient",Ua="standardInteractionClientGetClientConfiguration",La="standardInteractionClientInitializeAuthorizationRequest",Ha="handleResponseEar",Ba="handleResponsePlatformBroker",Da="handleResponseCode",Fa="deserializeResponse",Ka="generatePkceCodes",$a="generateHKDF",za="decrypt",ja="generateEarKey";class Wa{constructor(){this.dbName=Xi,this.version=1,this.tableName=Zi,this.dbOpen=!1}async open(){return new Promise(((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",(e=>{e.target.result.createObjectStore(this.tableName)})),r.addEventListener("success",(t=>{const r=t;this.db=r.target.result,this.dbOpen=!0,e()})),r.addEventListener("error",(()=>t(fi(ei))))}))}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(fi(zo));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async setItem(e,t){return await this.validateDbIsOpen(),new Promise(((r,n)=>{if(!this.db)return n(fi(zo));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);o.addEventListener("success",(()=>{this.closeConnection(),r()})),o.addEventListener("error",(e=>{this.closeConnection(),n(e)}))}))}async removeItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(fi(zo));const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.addEventListener("success",(()=>{this.closeConnection(),t()})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async getKeys(){return await this.validateDbIsOpen(),new Promise(((e,t)=>{if(!this.db)return t(fi(zo));const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();r.addEventListener("success",(t=>{const r=t;this.closeConnection(),e(r.target.result)})),r.addEventListener("error",(e=>{this.closeConnection(),t(e)}))}))}async containsKey(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(fi(zo));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(1===r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise(((e,t)=>{const r=window.indexedDB.deleteDatabase(Xi),n=setTimeout((()=>t(!1)),200);r.addEventListener("success",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("blocked",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("error",(()=>(clearTimeout(n),t(!1))))}))}}class Ja{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,t){this.cache.set(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach(((t,r)=>{e.push(r)})),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}class Qa{constructor(e){this.inMemoryCache=new Ja,this.indexedDBCache=new Wa,this.logger=e}handleDatabaseAccessError(e,t){if(!(e instanceof mi&&e.errorCode===ei))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.",t)}async getItem(e,t){const r=this.inMemoryCache.getItem(e);if(!r)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage.",t),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e,t)}return r}async setItem(e,t,r){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e,r)}}async removeItem(e,t){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e,t)}}async getKeys(e){const t=this.inMemoryCache.getKeys();if(0===t.length)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage.",e),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t,e)}return t}async containsKey(e,t){const r=this.inMemoryCache.containsKey(e);if(!r)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage.",t),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e,t)}return r}clearInMemory(e){this.logger.verbose("Deleting in-memory keystore",e),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted",e)}async clearPersistent(e){try{this.logger.verbose("Deleting persistent keystore",e);const t=await this.indexedDBCache.deleteDatabase();return t&&this.logger.verbose("Persistent keystore deleted",e),t}catch(t){return this.handleDatabaseAccessError(t,e),!1}}}class Ga{constructor(e,t,r){this.logger=e,function(e){if(!window)throw fi($o);if(!window.crypto)throw fi(Ao);if(!e&&!window.crypto.subtle)throw fi(Ao,"crypto_subtle_undefined")}(r??!1),this.cache=new Qa(this.logger),this.performanceClient=t}createNewGuid(){return vs()}base64Encode(e){return os(e)}base64Decode(e){return ss(e)}base64UrlEncode(e){return rs(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement("cryptoOptsGetPublicKeyThumbprint",e.correlationId),r=await async function(e,t){return window.crypto.subtle.generateKey(ys,e,t)}(Ga.EXTRACTABLE,Ga.POP_KEY_USAGES),n=await ks(r.publicKey),o=Va({e:n.e,kty:n.kty,n:n.n}),i=await this.hashString(o),s=await ks(r.privateKey),a=await async function(e,t,r){return window.crypto.subtle.importKey("jwk",e,ys,t,r)}(s,!1,["sign"]);return await this.cache.setItem(i,{privateKey:a,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri},e.correlationId),t&&t.end({success:!0}),i}async removeTokenBindingKey(e,t){await this.cache.removeItem(e,t);if(await this.cache.containsKey(e,t))throw i(q)}async clearKeystore(e){this.cache.clearInMemory(e);try{return await this.cache.clearPersistent(e),!0}catch(t){return t instanceof Error?this.logger.error(`Clearing keystore failed with error: '${t.message}'`,e):this.logger.error("Clearing keystore failed with unknown error",e),!1}}async signJwt(e,t,r,n){const o=this.performanceClient?.startMeasurement("cryptoOptsSignJwt",n),i=await this.cache.getItem(t,n||"");if(!i)throw fi(Vo);const s=await ks(i.publicKey),a=Va(s),c=rs(JSON.stringify({kid:t})),l=rs(yo.getShrHeaderString({...r?.header,alg:s.alg,kid:c}));e.cnf={jwk:JSON.parse(a)};const h=`${l}.${rs(JSON.stringify(e))}`,d=(new TextEncoder).encode(h),u=await async function(e,t){return window.crypto.subtle.sign(ys,e,t)}(i.privateKey,d),g=`${h}.${ns(new Uint8Array(u))}`;return o&&o.end({success:!0}),g}async hashString(e){return async function(e){const t=await ws(e);return ns(new Uint8Array(t))}(e)}}function Va(e){return JSON.stringify(e,Object.keys(e).sort())}Ga.POP_KEY_USAGES=["sign","verify"],Ga.EXTRACTABLE=!0;const Ya="acquireTokenSilent",Xa="acquireTokenByCode",Za="acquireTokenPopup",ec="acquireTokenPreRedirect",tc="acquireTokenRedirect",rc="ssoSilent",nc="initializeClientApplication",oc="localStorageUpdated";var ic=Object.freeze({__proto__:null,AcquireTokenByCode:Xa,AcquireTokenPopup:Za,AcquireTokenPreRedirect:ec,AcquireTokenRedirect:tc,AcquireTokenSilent:Ya,InitializeClientApplication:nc,LocalStorageUpdated:oc,SsoSilent:rc});const sc=864e5,ac="Lax",cc="None";class lc{initialize(){return Promise.resolve()}getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let e=0;e<r.length;e++){const n=r[e],[o,...i]=decodeURIComponent(n).trim().split("="),s=i.join("=");if(o===t)return s}return""}getUserData(){throw i(H)}setItem(e,t,r,n=!0,o=ac){let i=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=${o};`;if(r){const e=function(e){const t=new Date,r=new Date(t.getTime()+e*sc);return r.toUTCString()}(r);i+=`expires=${e};`}(n||o===cc)&&(i+="Secure;"),document.cookie=i}async setUserData(){return Promise.reject(i(H))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach((e=>{const r=decodeURIComponent(e).trim().split("=");t.push(r[0])})),t}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function hc(e,t){const r=e.getItem(pa(t));return r?JSON.parse(r):[]}function dc(e,t,r){const n=t.getItem(ma(e,r));if(n){const e=JSON.parse(n);if(e&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("accessToken")&&e.hasOwnProperty("refreshToken"))return e}return{idToken:[],accessToken:[],refreshToken:[]}}function uc(e){return e.hasOwnProperty("id")&&e.hasOwnProperty("nonce")&&e.hasOwnProperty("data")}const gc="msal.cache.encryption";class pc{constructor(e,t,r){if(!window.localStorage)throw qs(Rs);this.memoryStorage=new Ja,this.initialized=!1,this.clientId=e,this.logger=t,this.performanceClient=r,this.broadcast=new BroadcastChannel("msal.broadcast.cache")}async initialize(e){const t=new lc,r=t.getItem(gc);let n={key:"",id:""};if(r)try{n=JSON.parse(r)}catch(e){}if(n.key&&n.id){const t=an(as,"base64Decode",this.logger,this.performanceClient,e)(n.key);this.encryptionCookie={id:n.id,key:await cn(Ss,$a,this.logger,this.performanceClient,e)(t)}}else{const r=vs(),n=await cn(bs,"generateBaseKey",this.logger,this.performanceClient,e)(),o=an(ns,"urlEncodeArr",this.logger,this.performanceClient,e)(new Uint8Array(n));this.encryptionCookie={id:r,key:await cn(Ss,$a,this.logger,this.performanceClient,e)(n)};const i={id:r,key:o};t.setItem(gc,JSON.stringify(i),0,!0,cc)}await cn(this.importExistingCache.bind(this),"importExistingCache",this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",(t=>{this.updateCache(t,e)})),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw fi(ii);return this.memoryStorage.getItem(e)}async decryptData(e,t,r){if(!this.initialized||!this.encryptionCookie)throw fi(ii);if(t.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const n=await cn(Ps,za,this.logger,this.performanceClient,r)(this.encryptionCookie.key,t.nonce,this.getContext(e),t.data);if(!n)return null;try{return JSON.parse(n)}catch(e){return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,t){window.localStorage.setItem(e,t)}async setUserData(e,t,r,n){if(!this.initialized||!this.encryptionCookie)throw fi(ii);const{data:o,nonce:i}=await cn(Es,"encrypt",this.logger,this.performanceClient,r)(this.encryptionCookie.key,t,this.getContext(e)),s={id:this.encryptionCookie.id,nonce:i,data:o,lastUpdatedAt:n};this.memoryStorage.setItem(e,t),this.setItem(e,JSON.stringify(s)),this.broadcast.postMessage({key:e,value:t,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear();hc(this).forEach((e=>this.removeItem(e)));const e=dc(this.clientId,this);e.idToken.forEach((e=>this.removeItem(e))),e.accessToken.forEach((e=>this.removeItem(e))),e.refreshToken.forEach((e=>this.removeItem(e))),this.getKeys().forEach((e=>{(e.startsWith(ia)||-1!==e.indexOf(this.clientId))&&this.removeItem(e)}))}async importExistingCache(e){if(!this.encryptionCookie)return;let t=hc(this);t=await this.importArray(t,e),t.length?this.setItem(pa(),JSON.stringify(t)):this.removeItem(pa());const r=dc(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(ma(this.clientId),JSON.stringify(r)):this.removeItem(ma(this.clientId))}async getItemFromEncryptedCache(e,t){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let n;try{n=JSON.parse(r)}catch(e){return null}return uc(n)?n.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},t),null):cn(Ps,za,this.logger,this.performanceClient,t)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data):(this.performanceClient.incrementFields({unencryptedCacheCount:1},t),n)}async importArray(e,t){const r=[],n=[];return e.forEach((e=>{const o=this.getItemFromEncryptedCache(e,t).then((t=>{t?(this.memoryStorage.setItem(e,t),r.push(e)):this.removeItem(e)}));n.push(o)})),await Promise.all(n),r}getContext(e){let t="";return e.includes(this.clientId)&&(t=this.clientId),t}updateCache(e,t){this.logger.trace("Updating internal cache from broadcast event",t);const r=this.performanceClient.startMeasurement(oc);r.add({isBackground:!0});const{key:n,value:o,context:i}=e.data;return n?i&&i!==this.clientId?(this.logger.trace(`Ignoring broadcast event from clientId: '${i}'`,t),void r.end({success:!1,errorCode:"contextMismatch"})):(o?(this.memoryStorage.setItem(n,o),this.logger.verbose("Updated item in internal cache",t)):(this.memoryStorage.removeItem(n),this.logger.verbose("Removed item from internal cache",t)),void r.end({success:!0})):(this.logger.error("Broadcast event missing key",t),void r.end({success:!1,errorCode:"noKey"}))}}class mc{constructor(){if(!window.sessionStorage)throw qs(Rs)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}const fc={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_SUCCESS:"msal:loginSuccess",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",BROKERED_REQUEST_START:"msal:brokeredRequestStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",BROKERED_REQUEST_SUCCESS:"msal:brokeredRequestSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",BROKERED_REQUEST_FAILURE:"msal:brokeredRequestFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};function yc(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class wc extends Vt{constructor(e,t,r,n,o,i,s){super(e,r,n,o,s),this.cacheConfig=t,this.logger=n,this.internalStorage=new Ja,this.browserStorage=Cc(e,t.cacheLocation,n,o),this.temporaryCacheStorage=Cc(e,xi.SessionStorage,n,o),this.cookieStorage=new lc,this.eventHandler=i}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){const t=hc(this.browserStorage,0),r=dc(this.clientId,this.browserStorage,0);this.performanceClient.addFields({oldAccountCount:t.length,oldAccessCount:r.accessToken.length,oldIdCount:r.idToken.length,oldRefreshCount:r.refreshToken.length},e);const n=hc(this.browserStorage,1),o=dc(this.clientId,this.browserStorage,1);this.performanceClient.addFields({currAccountCount:n.length,currAccessCount:o.accessToken.length,currIdCount:o.idToken.length,currRefreshCount:o.refreshToken.length},e),await Promise.all([this.updateV0ToCurrent(1,t,n,e),this.updateV0ToCurrent(1,r.idToken,o.idToken,e),this.updateV0ToCurrent(1,r.accessToken,o.accessToken,e),this.updateV0ToCurrent(1,r.refreshToken,o.refreshToken,e)]),t.length>0?this.browserStorage.setItem(pa(0),JSON.stringify(t)):this.browserStorage.removeItem(pa(0)),n.length>0?this.browserStorage.setItem(pa(1),JSON.stringify(n)):this.browserStorage.removeItem(pa(1)),this.setTokenKeys(r,e,0),this.setTokenKeys(o,e,1)}async updateV0ToCurrent(e,t,r,n){const o=[];for(const i of[...t]){const s=this.browserStorage.getItem(i),a=this.validateAndParseJson(s||"");if(!a){yc(t,i);continue}a.lastUpdatedAt||(a.lastUpdatedAt=Date.now().toString(),this.setItem(i,JSON.stringify(a),n));const c=uc(a)?await this.browserStorage.decryptData(i,a,n):a;let l;if(c&&(In(c)||vn(c))&&(l=c.expiresOn),!c||pn(a.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)||l&&gn(l,300))this.browserStorage.removeItem(i),yc(t,i),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},n);else if(this.cacheConfig.cacheLocation!==xi.LocalStorage||uc(a)){const t=`${ia}.${e}-${i}`,s=this.browserStorage.getItem(t);if(!s){o.push(this.setUserData(t,JSON.stringify(c),n,a.lastUpdatedAt).then((()=>{r.push(t),this.performanceClient.incrementFields({upgradedCacheCount:1},n)})));continue}{const e=this.validateAndParseJson(s);if(Number(a.lastUpdatedAt)>Number(e.lastUpdatedAt)){o.push(this.setUserData(t,JSON.stringify(c),n,a.lastUpdatedAt).then((()=>{this.performanceClient.incrementFields({updatedCacheFromV0Count:1},n)})));continue}}}}return Promise.all(o)}trackVersionChanges(e){const t=this.browserStorage.getItem(da);t&&(this.logger.info(`MSAL.js was last initialized by version: '${t}'`,e),this.performanceClient.addFields({previousLibraryVersion:t},e)),t!==oa&&this.setItem(da,oa,e)}validateAndParseJson(e){if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}setItem(e,t,r){let n=0,o=[];for(let i=0;i<=20;i++)try{this.browserStorage.setItem(e,t),i>0&&(i<=n?this.removeAccessTokenKeys(o.slice(0,i),r,0):(this.removeAccessTokenKeys(o.slice(0,n),r,0),this.removeAccessTokenKeys(o.slice(n,i),r)));break}catch(s){const a=xt(s);if(!(a.errorCode===qt&&i<20))throw a;if(!o.length){const r=e===ma(this.clientId,0)?JSON.parse(t).accessToken:this.getTokenKeys(0).accessToken,i=e===ma(this.clientId)?JSON.parse(t).accessToken:this.getTokenKeys().accessToken;o=[...r,...i],n=r.length}if(o.length<=i)throw a;this.removeAccessToken(o[i],r,!1)}}async setUserData(e,t,r,n){let o=0,i=[];for(let s=0;s<=20;s++)try{await cn(this.browserStorage.setUserData.bind(this.browserStorage),"setUserData",this.logger,this.performanceClient,r)(e,t,r,n),s>0&&(s<=o?this.removeAccessTokenKeys(i.slice(0,s),r,0):(this.removeAccessTokenKeys(i.slice(0,o),r,0),this.removeAccessTokenKeys(i.slice(o,s),r)));break}catch(e){const t=xt(e);if(!(t.errorCode===qt&&s<20))throw t;if(!i.length){const e=this.getTokenKeys(0).accessToken,t=this.getTokenKeys().accessToken;i=[...e,...t],o=e.length}if(i.length<=s)throw t;this.removeAccessToken(i[s],r,!1)}}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called",t);const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,t),null;const n=this.validateAndParseJson(r);return n&&Qt(n)?Vt.toObject({},n):null}async setAccount(e,t){this.logger.trace("BrowserCacheManager.setAccount called",t);const r=this.generateAccountKey(zt(e)),n=Date.now().toString();e.lastUpdatedAt=n,await this.setUserData(r,JSON.stringify(e),t,n),this.addAccountKeyToMap(r,t)}getAccountKeys(){return hc(this.browserStorage)}addAccountKeyToMap(e,t){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called",t),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: '${e}'`,t);const r=this.getAccountKeys();return-1===r.indexOf(e)?(r.push(e),this.setItem(pa(),JSON.stringify(r),t),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added",t),!0):(this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map",t),!1)}removeAccountKeyFromMap(e,t){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called",t),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: '${e}'`,t);const r=this.getAccountKeys(),n=r.indexOf(e);if(n>-1){if(r.splice(n,1),0===r.length)return void this.removeItem(pa());this.setItem(pa(),JSON.stringify(r),t),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed",t)}else this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map",t)}removeAccount(e,t){const r=this.getActiveAccount(t);r?.homeAccountId===e.homeAccountId&&r?.environment===e.environment&&this.setActiveAccount(null,t),super.removeAccount(e,t),this.removeAccountKeyFromMap(this.generateAccountKey(e),t),this.browserStorage.getKeys().forEach((t=>{t.includes(e.homeAccountId)&&t.includes(e.environment)&&this.browserStorage.removeItem(t)}))}removeIdToken(e,t){super.removeIdToken(e,t);const r=this.getTokenKeys(),n=r.idToken.indexOf(e);n>-1&&(this.logger.info("idToken removed from tokenKeys map",t),r.idToken.splice(n,1),this.setTokenKeys(r,t))}removeAccessToken(e,t,r=!0){super.removeAccessToken(e,t),r&&this.removeAccessTokenKeys([e],t)}removeAccessTokenKeys(e,t,r=1){this.logger.trace("removeAccessTokenKey called",t);const n=this.getTokenKeys(r);let o=0;if(e.forEach((e=>{const t=n.accessToken.indexOf(e);t>-1&&(n.accessToken.splice(t,1),o++)})),o>0)return this.logger.info(`removed '${o}' accessToken keys from tokenKeys map`,t),void this.setTokenKeys(n,t,r)}removeRefreshToken(e,t){super.removeRefreshToken(e,t);const r=this.getTokenKeys(),n=r.refreshToken.indexOf(e);n>-1&&(this.logger.info("refreshToken removed from tokenKeys map",t),r.refreshToken.splice(n,1),this.setTokenKeys(r,t))}getTokenKeys(e=1){return dc(this.clientId,this.browserStorage,e)}setTokenKeys(e,t,r=1){0!==e.idToken.length||0!==e.accessToken.length||0!==e.refreshToken.length?this.setItem(ma(this.clientId,r),JSON.stringify(e),t):this.removeItem(ma(this.clientId,r))}getIdTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit",t),this.removeIdToken(e,t),null;const n=this.validateAndParseJson(r);return n&&((o=n)&&Cn(o)&&o.hasOwnProperty("realm")&&o.credentialType===Ae.ID_TOKEN)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit",t),null);var o}async setIdTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setIdTokenCredential called",t);const r=this.generateCredentialKey(e),n=Date.now().toString();e.lastUpdatedAt=n,await this.setUserData(r,JSON.stringify(e),t,n);const o=this.getTokenKeys();-1===o.idToken.indexOf(r)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map",t),o.idToken.push(r),this.setTokenKeys(o,t))}getAccessTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit",t),this.removeAccessTokenKeys([e],t),null;const n=this.validateAndParseJson(r);return n&&In(n)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit",t),null)}async setAccessTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called",t);const r=this.generateCredentialKey(e),n=Date.now().toString();e.lastUpdatedAt=n,await this.setUserData(r,JSON.stringify(e),t,n);const o=this.getTokenKeys(),i=o.accessToken.indexOf(r);-1!==i&&o.accessToken.splice(i,1),this.logger.trace(`access token '${-1===i?"added to":"updated in"}' map`,t),o.accessToken.push(r),this.setTokenKeys(o,t)}getRefreshTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit",t),this.removeRefreshToken(e,t),null;const n=this.validateAndParseJson(r);return n&&vn(n)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit",t),null)}async setRefreshTokenCredential(e,t){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called",t);const r=this.generateCredentialKey(e),n=Date.now().toString();e.lastUpdatedAt=n,await this.setUserData(r,JSON.stringify(e),t,n);const o=this.getTokenKeys();-1===o.refreshToken.indexOf(r)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map",t),o.refreshToken.push(r),this.setTokenKeys(o,t))}getAppMetadata(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit",t),null;const n=this.validateAndParseJson(r);return n&&(o=e,(i=n)&&0===o.indexOf(be)&&i.hasOwnProperty("clientId")&&i.hasOwnProperty("environment"))?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit",t),null);var o,i}setAppMetadata(e,t){this.logger.trace("BrowserCacheManager.setAppMetadata called",t);const r=function({environment:e,clientId:t}){return[be,e,t].join("-").toLowerCase()}(e);this.setItem(r,JSON.stringify(e),t)}getServerTelemetry(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){const r=0===e.indexOf(qe);let n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n}(e,n)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit",t),null)}setServerTelemetry(e,t,r){this.logger.trace("BrowserCacheManager.setServerTelemetry called",r),this.setItem(e,JSON.stringify(t),r)}getAuthorityMetadata(e,t){const r=this.internalStorage.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){return!!t&&0===e.indexOf(_e)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,n)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit",t),n):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter((e=>this.isAuthorityMetadata(e)))}setWrapperMetadata(e,t){this.internalStorage.setItem(Wi,e),this.internalStorage.setItem(Ji,t)}getWrapperMetadata(){return[this.internalStorage.getItem(Wi)||"",this.internalStorage.getItem(Ji)||""]}setAuthorityMetadata(e,t,r){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called",r),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(e){const t=this.generateCacheKey(de),r=this.browserStorage.getItem(t);if(!r)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters found",e),null;const n=this.validateAndParseJson(r);return n?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found",e),this.getAccountInfoFilteredBy({homeAccountId:n.homeAccountId,localAccountId:n.localAccountId,tenantId:n.tenantId},e)):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found",e),null)}setActiveAccount(e,t){const r=this.generateCacheKey(de);if(e){this.logger.verbose("setActiveAccount: Active account set",t);const n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.setItem(r,JSON.stringify(n),t)}else this.logger.verbose("setActiveAccount: No account passed, active account not set",t),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(fc.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){let r=!1;e&&(r=0===e.indexOf(Ue));let n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n}(e,n)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit",t),n):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit",t),null)}setThrottlingCache(e,t,r){this.logger.trace("BrowserCacheManager.setThrottlingCache called",r),this.setItem(e,JSON.stringify(t),r)}getTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e,o=this.temporaryCacheStorage.getItem(n);if(!o){if(this.cacheConfig.cacheLocation===xi.LocalStorage){const e=this.browserStorage.getItem(n);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage",t),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage",t),null}return o}setTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t)}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e)}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach((e=>{-1===e.indexOf(ia)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)})),this.browserStorage.getKeys().forEach((e=>{-1===e.indexOf(ia)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)})),this.internalStorage.clear()}generateCacheKey(e){return et.startsWith(e,ia)?e:`${ia}.${this.clientId}.${e}`}generateCredentialKey(e){const t=e.credentialType===Ae.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==xe.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${ia}.1`,e.homeAccountId,e.environment,e.credentialType,t,e.realm||"",e.target||"",r].join("-").toLowerCase()}generateAccountKey(e){const t=e.homeAccountId.split(".")[1];return[`${ia}.1`,e.homeAccountId,e.environment,t||e.tenantId||""].join("-").toLowerCase()}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called",e),this.removeTemporaryItem(this.generateCacheKey(Ki)),this.removeTemporaryItem(this.generateCacheKey($i)),this.removeTemporaryItem(this.generateCacheKey(Di)),this.removeTemporaryItem(this.generateCacheKey(Fi)),this.removeTemporaryItem(this.generateCacheKey(ji)),this.setInteractionInProgress(!1,void 0)}cacheAuthorizeRequest(e,t,r){this.logger.trace("BrowserCacheManager.cacheAuthorizeRequest called",t);const n=os(JSON.stringify(e));if(this.setTemporaryCache(Ki,n,!0),r){const e=os(r);this.setTemporaryCache($i,e,!0)}}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called",e);const t=this.getTemporaryCache(Ki,e,!0);if(!t)throw fi(Fo);const r=this.getTemporaryCache($i,e,!0);let n,o="";try{n=JSON.parse(ss(t)),r&&(o=ss(r))}catch(r){throw this.logger.errorPii(`Attempted to parse: '${t}'`,e),this.logger.error(`Parsing cached token request threw with error: '${r}'`,e),fi(Ko)}return[n,o]}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called","");const e=this.getTemporaryCache(ji,"",!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found",""),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request",""),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress()?.clientId;return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${ia}.${zi}`,t=this.getTemporaryCache(e,"",!1);try{return t?JSON.parse(t):null}catch(t){return this.logger.error("Cannot parse interaction status. Removing temporary cache items and clearing url hash. Retrying interaction should fix the error",""),this.removeTemporaryItem(e),this.resetRequestCache(""),Ns(window),null}}setInteractionInProgress(e,t=Hi){const r=`${ia}.${zi}`;if(e){if(this.getInteractionInProgress())throw fi(Oo);this.setTemporaryCache(r,JSON.stringify({clientId:this.clientId,type:t}),!1)}else e||this.getInteractionInProgress()?.clientId!==this.clientId||this.removeTemporaryItem(r)}async hydrateCache(e,t){const r={idToken:fn(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId),accessToken:yn(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?dn(e.expiresOn):0,e.extExpiresOn?dn(e.extExpiresOn):0,ss,void 0,e.tokenType,void 0,t.sshKid)};return this.saveCacheRecord(r,e.correlationId)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(e){if(e instanceof Nt&&this.performanceClient&&t)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},t)}catch(e){}throw e}}}function Cc(e,t,r,n){try{switch(t){case xi.LocalStorage:return new pc(e,r,n);case xi.SessionStorage:return new mc}}catch(e){r.error(e,"")}return new Ja}const Ic=(e,t,r,n)=>new wc(e,{cacheLocation:xi.MemoryStorage,cacheRetentionDays:5},F,t,r,n);function vc(e,t,r,n,o){return e.verbose("getAllAccounts called",n),r?t.getAllAccounts(o,n):[]}function kc(e,t,r,n){if(t.trace("getAccount called",n),0===Object.keys(e).length)return t.warning("getAccount: No accountFilter provided",n),null;const o=r.getAccountInfoFilteredBy(e,n);return o?(t.verbose("getAccount: Account matching provided filter found, returning",n),o):(t.verbose("getAccount: No matching account found, returning null",n),null)}function Tc(e,t,r,n){if(t.trace("getAccountByUsername called",n),!e)return t.warning("getAccountByUsername: No username provided",n),null;const o=r.getAccountInfoFilteredBy({username:e},n);return o?(t.verbose("getAccountByUsername: Account matching username found, returning",n),t.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: '${e}'`,n),o):(t.verbose("getAccountByUsername: No matching account found, returning null",n),null)}function Ac(e,t,r,n){if(t.trace("getAccountByHomeId called",n),!e)return t.warning("getAccountByHomeId: No homeAccountId provided",n),null;const o=r.getAccountInfoFilteredBy({homeAccountId:e},n);return o?(t.verbose("getAccountByHomeId: Account matching homeAccountId found, returning",n),t.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: '${e}'`,n),o):(t.verbose("getAccountByHomeId: No matching account found, returning null",n),null)}function bc(e,t,r,n){if(t.trace("getAccountByLocalId called",n),!e)return t.warning("getAccountByLocalId: No localAccountId provided",n),null;const o=r.getAccountInfoFilteredBy({localAccountId:e},n);return o?(t.verbose("getAccountByLocalId: Account matching localAccountId found, returning",n),t.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: '${e}'`,n),o):(t.verbose("getAccountByLocalId: No matching account found, returning null",n),null)}function Sc(e,t,r){t.setActiveAccount(e,r)}function _c(e,t){return e.getActiveAccount(t)}class Ec{constructor(e){this.eventCallbacks=new Map,this.logger=e||new $({}),"undefined"!=typeof BroadcastChannel&&(this.broadcastChannel=new BroadcastChannel("msal.broadcast.event")),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,t,r){if("undefined"!=typeof window){const n=r||Qs();return this.eventCallbacks.has(n)?(this.logger.error(`Event callback with id: '${n}' is already registered. Please provide a unique id or remove the existing callback and try again.`,""),null):(this.eventCallbacks.set(n,[e,t||[]]),this.logger.verbose(`Event callback registered with id: '${n}'`,""),n)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback '${e}' removed.`,"")}emitEvent(e,t,r,n){const o={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};switch(e){case fc.LOGIN_SUCCESS:case fc.LOGOUT_SUCCESS:case fc.ACTIVE_ACCOUNT_CHANGED:this.broadcastChannel?.postMessage(o)}this.invokeCallbacks(o)}invokeCallbacks(e){this.eventCallbacks.forEach((([t,r],n)=>{(0===r.length||r.includes(e.eventType))&&(this.logger.verbose(`Emitting event to callback '${n}': '${e.eventType}'`,""),t.apply(null,[e]))}))}invokeCrossTabCallbacks(e){const t=e.data;this.invokeCallbacks(t)}subscribeCrossTab(){this.broadcastChannel?.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){this.broadcastChannel?.removeEventListener("message",this.invokeCrossTabCallbacks)}}class Pc{constructor(e,t,r,n,o,i,s,a,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.platformAuthProvider=c,this.correlationId=a,this.logger=n.clone(ki,oa),this.performanceClient=s}}function Rc(e,t,r,n){r.verbose("getRedirectUri called",n);const o=e||t||"";return _t.getAbsoluteUrl(o,Hs())}function Oc(e,t,r,n,o,i){o.verbose("initializeServerTelemetryManager called",r);const s={clientId:t,correlationId:r,apiId:e,forceRefresh:!1,wrapperSKU:n.getWrapperMetadata()[0],wrapperVer:n.getWrapperMetadata()[1]};return new po(s,n)}async function Mc(e,t,r,n,o,i,s,a,c){const l=a&&a.hasOwnProperty("instance_aware")?a.instance_aware:void 0,h={protocolMode:e.system.protocolMode,OIDCOptions:e.auth.OIDCOptions,knownAuthorities:e.auth.knownAuthorities,cloudDiscoveryMetadata:e.auth.cloudDiscoveryMetadata,authorityMetadata:e.auth.authorityMetadata},d=i||e.auth.authority,u=l?.length?"true"===l:e.auth.instanceAware,g=c&&u?e.auth.authority.replace(_t.getDomainFromUrl(d),c.environment):d,p=Sn.generateAuthority(g,s||e.auth.azureCloudOptions),m=await cn(Pn,"authorityFactoryCreateDiscoveredInstance",o,r,t)(p,e.system.networkClient,n,h,o,t,r);if(c&&!m.isAlias(c.environment))throw Ze(Ct);return m}async function qc(e,t,r,n,o){if(o)try{e.removeAccount(o,n),r.verbose("Cleared cache items belonging to the account provided in the logout request.",n)}catch(e){r.error("Account provided in logout request was not found. Local cache unchanged.",n)}else try{r.verbose("No account provided in logout request, clearing all cache items.",n),e.clear(n),await t.clearKeystore(n)}catch(e){r.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.",n)}}async function Nc(e,t,r,n,o){const i=e.authority||t.auth.authority,s=[...e&&e.scopes||[]],a={...e,correlationId:e.correlationId,authority:i,scopes:s};if(a.authenticationScheme){if(a.authenticationScheme===xe.SSH){if(!e.sshJwk)throw Ze(gt);if(!e.sshKid)throw Ze(pt)}n.verbose(`Authentication Scheme set to "'${a.authenticationScheme}'" as configured in Auth request`,o)}else a.authenticationScheme=xe.BEARER,n.verbose('Authentication Scheme was not explicitly set in request, defaulting to "Bearer" request',o);return a}async function xc(e,t,r,n,o){const i=await cn(Nc,Oa,o,n,e.correlationId)(e,r,n,o,e.correlationId);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}}class Uc extends Pc{initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",this.correlationId);const t={correlationId:this.correlationId,...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest",this.correlationId);else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided",this.correlationId),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set",this.correlationId);else this.logger.verbose("logoutHint will not be set since no logout request was configured",this.correlationId);return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=_t.getAbsoluteUrl(e.postLogoutRedirectUri,Hs())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=_t.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Hs())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=_t.getAbsoluteUrl(Hs(),Hs())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request",this.correlationId)}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request",this.correlationId);return null}async createAuthCodeClient(e){const t=await cn(this.getClientConfiguration.bind(this),Ua,this.logger,this.performanceClient,this.correlationId)(e);return new no(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:n,requestExtraQueryParameters:o,account:i}=e,s=await cn(Mc,Ea,this.logger,this.performanceClient,this.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:s,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:a.loggerCallback,piiLoggingEnabled:a.piiLoggingEnabled,logLevel:a.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:ki,version:oa,cpu:"",os:""},telemetry:this.config.telemetry}}}async function Lc(e,t,r,n,o,i,s,a){const c=Rc(e.redirectUri,r.auth.redirectUri,i,a),l={interactionType:t},h=Vn.setRequestState(n,e&&e.state||"",l),d={...await cn(Nc,Oa,i,s,a)({...e,correlationId:a},r,s,i,a),redirectUri:c,state:h,nonce:e.nonce||vs(),responseMode:r.auth.OIDCOptions.responseMode};if(e.loginHint||e.sid)return d;const u=e.account||o.getActiveAccount(a);return u&&(i.verbose("Setting validated request account",a),i.verbosePii(`Setting validated request account: '${u.homeAccountId}'`,a),d.account=u),d}function Hc(e,t,r,n){const o=Vr(e);if(!o)throw Gr(e)?(r.error(`A '${t}' is present in the iframe but it does not contain known properties. It's likely that the '${t}' has been replaced by code running on the redirectUri page.`,n),r.errorPii(`The '${t}' detected is: '${e}'`,n),fi(Eo)):(r.error(`The request has returned to the redirectUri but a '${t}' is not present. It's likely that the '${t}' has been removed or the page has been redirected by code running on the redirectUri page.`,n),fi(So));return o}function Bc(e,t,r){if(!e.state)throw fi(_o);const n=function(e,t){if(!t)return null;try{return Vn.parseRequestState(e,t).libraryState.meta}catch(e){throw i(p)}}(t,e.state);if(!n)throw fi(Po);if(n.interactionType!==r)throw fi(Ro)}class Dc{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async handleCodeResponse(e,t){let r;try{r=function(e,t){if(lo(e,t),!e.code)throw i(M);return e}(e,t.state)}catch(e){throw e instanceof Rn&&e.subError===No?fi(No):e}return cn(this.handleCodeResponseFromServer.bind(this),tn,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.logger.trace("InteractionHandler.handleCodeResponseFromServer called",t.correlationId),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await cn(this.authModule.updateAuthority.bind(this.authModule),"updateTokenEndpointAuthority",this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await cn(this.authModule.acquireToken.bind(this.authModule),"authClientAcquireToken",this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:hr}:e.loginHint?{credential:e.loginHint,type:dr}:null}}class Fc extends r{constructor(e,t,r){super(e,t||pi(e)),Object.setPrototypeOf(this,Fc.prototype),this.name="NativeAuthError",this.ext=r}}function Kc(e){return!(!e.ext||!e.ext.status||"PERSISTENT_ERROR"!==e.ext.status&&"DISABLED"!==e.ext.status)||(!(!e.ext||!e.ext.error||-2147186943!==e.ext.error)||"ContentError"===e.errorCode)}function $c(e,t,r){if(r&&r.status)switch(r.status){case"ACCOUNT_UNAVAILABLE":return Gn(Ln,pi(e));case"USER_INTERACTION_REQUIRED":return new Jn(e,t);case"USER_CANCEL":return fi(No);case"NO_NETWORK":return fi(jo);case"UX_NOT_ALLOWED":return Gn(Bn)}return new Fc(e,t,r)}class zc extends Uc{async acquireToken(e){const t=Oc(Qi.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),r=await cn(this.getClientConfiguration.bind(this),Ua,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),n=new io(r,this.performanceClient);this.logger.verbose("Silent auth client created",this.correlationId);try{const t=(await cn(n.acquireCachedToken.bind(n),"silentFlowClientAcquireCachedToken",this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof mi&&e.errorCode===Vo&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.",this.correlationId),e}}logout(e){this.logger.verbose("logoutRedirect called",this.correlationId);const t=this.initializeLogoutRequest(e);return qc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,t.account)}}class jc extends Pc{constructor(e,t,r,n,o,i,s,a,c,l,h,d){super(e,t,r,n,o,i,a,d,c),this.apiId=s,this.accountId=l,this.platformAuthProvider=c,this.nativeStorageManager=h,this.silentCacheClient=new zc(e,this.nativeStorageManager,r,n,o,i,a,d,c);const u=this.platformAuthProvider.getExtensionName();this.skus=po.makeExtraSkuString({libraryName:ki,libraryVersion:oa,extensionName:u,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[yr]:this.skus}}async acquireToken(e,t){this.logger.trace("NativeInteractionClient - acquireToken called.",this.correlationId);const r=this.performanceClient.startMeasurement(Pa,e.correlationId),n=hn(),o=Oc(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const i=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,i);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){if(t===es.AccessToken)throw this.logger.info("MSAL internal Cache does not contain tokens, return error as per cache policy",this.correlationId),e;this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call",this.correlationId)}const s=await this.platformAuthProvider.sendMessage(i);return await this.handleNativeResponse(s,i,n).then((e=>(r.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),o.clearNativeBrokerErrorCode(),e))).catch((e=>{throw r.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e}))}catch(e){throw e instanceof Fc&&o.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:vt.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided",this.correlationId),i(E);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},t.correlationId);if(!r)throw i(E);try{const e=this.createSilentCacheRequest(t,r),n=await this.silentCacheClient.acquireToken(e),o={...r,idTokenClaims:n?.idTokenClaims,idToken:n?.idToken};return{...n,account:o}}catch(e){throw e}}async acquireTokenRedirect(e,t,r){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.",this.correlationId);const n=await this.initializeNativeRequest(e),o=r?.navigateToLoginRequestUrl??!0;try{await this.platformAuthProvider.sendMessage(n)}catch(e){if(e instanceof Fc){if(Oc(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).setNativeBrokerErrorCode(e.errorCode),Kc(e))throw e}}this.browserStorage.setTemporaryCache(ji,JSON.stringify(n),!0);const i={apiId:Qi.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=o?window.location.href:Rc(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId);t.end({success:!0}),await this.navigationClient.navigateExternal(s,i)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called.",this.correlationId),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.",this.correlationId),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.",this.correlationId),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:n,...o}=r;n&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.",this.correlationId),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ji));const i=hn();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.",this.correlationId);const e=await this.platformAuthProvider.sendMessage(o),t=await this.handleNativeResponse(e,o,i);return Oc(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).clearNativeBrokerErrorCode(),t}catch(e){throw e}}logout(){return this.logger.trace("NativeInteractionClient - logout called.",this.correlationId),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){this.logger.trace("NativeInteractionClient - handleNativeResponse called.",this.correlationId);const n=bt(e.id_token,ss),o=this.createHomeAccountIdentifier(e,n),i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId},this.correlationId)?.homeAccountId;if(t.extraParameters?.child_client_id&&e.account.id!==t.accountId)this.logger.info("handleNativeServerResponse: Double broker flow detected, ignoring accountId mismatch",this.correlationId);else if(o!==i&&e.account.id!==t.accountId)throw $c("user_switch");const s=await Mc(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,t.authority),a=to(this.browserStorage,s,o,ss,this.correlationId,n,e.client_info,void 0,n.tid,void 0,e.account.id);e.expires_in=Number(e.expires_in);const c=await this.generateAuthenticationResult(e,t,n,a,s.canonicalAuthority,r);return await this.cacheAccount(a),await this.cacheNativeTokens(e,t,o,n,e.access_token,c.tenantId,r),c}createHomeAccountIdentifier(e,t){return Jt(e.client_info||"",Ht,this.logger,this.browserCrypto,this.correlationId,t)}generateScopes(e,t){return t?vt.fromString(t):vt.fromString(e)}async generatePopAccessToken(e,t){if(t.tokenType===xe.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer",this.correlationId),e.shr;const r=new Xn(this.browserCrypto,this.performanceClient),n={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce,correlationId:this.correlationId};if(!t.keyId)throw i(x);return r.signPopToken(e.access_token,t.keyId,n)}return e.access_token}async generateAuthenticationResult(e,t,r,n,o,i){const s=this.addTelemetryFromNativeResponse(e.properties.MATS),a=this.generateScopes(t.scope,e.scope),c=e.account.properties||{},l=c.UID||r.oid||r.sub||"",h=c.TenantId||r.tid||"",d=At(zt(n),void 0,r,e.id_token);d.nativeAccountId!==e.account.id&&(d.nativeAccountId=e.account.id);const u=await this.generatePopAccessToken(e,t),g=t.tokenType===xe.POP?xe.POP:xe.BEARER;return{authority:o,uniqueId:l,tenantId:h,scopes:a.asArray(),account:d,idToken:e.id_token,idTokenClaims:r,accessToken:u,fromCache:!!s&&this.isResponseFromCache(s),expiresOn:un(i+e.expires_in),tokenType:g,correlationId:this.correlationId,state:e.state,fromPlatformBroker:!0}}async cacheAccount(e){await this.browserStorage.setAccount(e,this.correlationId),this.browserStorage.removeAccountContext(zt(e),this.correlationId)}cacheNativeTokens(e,t,r,n,o,i,s){const a=fn(r,t.authority,e.id_token||"",t.clientId,n.tid||""),c=s+(t.tokenType===xe.POP?240:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),l=this.generateScopes(e.scope,t.scope),h={idToken:a,accessToken:yn(r,t.authority,o,t.clientId,n.tid||i,l.printScopes(),c,0,ss,void 0,t.tokenType,void 0,t.keyId)};return this.nativeStorageManager.saveCacheRecord(h,this.correlationId,t.storeInCache)}getExpiresInValue(e,t){return e===xe.POP?240:("string"==typeof t?parseInt(t,10):t)||0}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead",this.correlationId)}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.",this.correlationId),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called",this.correlationId);const t=await this.getCanonicalAuthority(e),{scopes:r,...n}=e,o=new vt(r||[]);o.appendScopes(te);const i={...n,accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,scope:o.printScopes(),redirectUri:Rc(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(i.signPopToken&&e.popKid)throw fi(ci);if(this.handleExtraBrokerParams(i),i.extraParameters=i.extraParameters||{},i.extraParameters.telemetry=bi,e.authenticationScheme===xe.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce,correlationId:this.correlationId},r=new Xn(this.browserCrypto,this.performanceClient);let n;if(i.keyId)n=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:i.keyId})),i.signPopToken=!1;else{const e=await cn(r.generateCnf.bind(r),rn,this.logger,this.performanceClient,this.correlationId)(t,this.logger);n=e.reqCnfString,i.keyId=e.kid,i.signPopToken=!0}i.reqCnf=n}return this.addRequestSKUs(i),i}async getCanonicalAuthority(e){const t=e.authority||this.config.auth.authority,{azureCloudOptions:r,account:n}=e;n&&await Mc(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,t,r,void 0,n);const o=new _t(t);return o.validateAsUri(),o}getPrompt(e){switch(this.apiId){case Qi.ssoSilent:case Qi.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none",this.correlationId),ye.NONE}if(e)switch(e){case ye.NONE:case ye.CONSENT:case ye.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow",this.correlationId),e;default:throw this.logger.trace(`initializeNativeRequest: prompt = '${e}' is not compatible with native flow`,this.correlationId),fi(si)}else this.logger.trace("initializeNativeRequest: prompt was not provided",this.correlationId)}handleExtraBrokerParams(e){const t=e.extraParameters&&e.extraParameters.hasOwnProperty(wr)&&e.extraParameters.hasOwnProperty(Cr)&&e.extraParameters.hasOwnProperty(ur);if(!e.embeddedClientId&&!t)return;let r="";const n=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[Cr],r=e.extraParameters[ur]),e.extraParameters={child_client_id:r,child_redirect_uri:n},this.performanceClient?.addFields({embeddedClientId:r,embeddedRedirectUri:n},e.correlationId)}}async function Wc(e,t,r,n,o){const i=ao({...e.auth,authority:t},r,n,o);if(Mr(i,{sku:ki,version:oa,os:"",cpu:""}),e.system.protocolMode!==$t.OIDC&&qr(i,e.telemetry.application),r.platformBroker&&(function(e){e.set("nativebroker","1")}(i),r.authenticationScheme===xe.POP)){const e=new Ga(n,o),t=new Xn(e,o);let s;if(r.popKid)s=e.encodeKid(r.popKid);else{s=(await cn(t.generateCnf.bind(t),rn,n,o,r.correlationId)(r,n)).reqCnfString}$r(i,s)}return vr(i,r.correlationId,o),i}async function Jc(e,t,r,n,o){if(!r.codeChallenge)throw Ze(lt);const i=await cn(Wc,"getStandardParams",n,o,r.correlationId)(e,t,r,n,o);return kr(i,we),function(e,t,r){if(!t||!r)throw Ze(lt);e.set("code_challenge",t),e.set("code_challenge_method",r)}(i,r.codeChallenge,"S256"),Fr(i,r.extraQueryParameters||{}),co(t,i)}async function Qc(e,t,r,n,o,i){if(!n.earJwk)throw fi(ko);const s=await Wc(t,r,n,o,i);kr(s,Ce),function(e,t){e.set("ear_jwk",encodeURIComponent(t)),e.set("ear_jwe_crypto","eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}(s,n.earJwk);const a=new Map;Fr(a,n.extraQueryParameters||{});return function(e,t,r){const n=e.createElement("form");return n.method="post",n.action=t,r.forEach(((t,r)=>{const o=e.createElement("input");o.hidden=!0,o.name=r,o.value=t,n.appendChild(o)})),e.body.appendChild(n),n}(e,co(r,a),s)}async function Gc(e,t,r,n,o,i,s,a,c,l){if(a.verbose("Account id found, calling WAM for token",e.correlationId),!l)throw fi(oi);const h=new Ga(a,c),d=new jc(n,o,h,a,s,n.system.navigationClient,r,c,l,t,i,e.correlationId),{userRequestState:u}=Vn.parseRequestState(h,e.state);return cn(d.acquireToken.bind(d),Pa,a,c,e.correlationId)({...e,state:u,prompt:void 0})}async function Vc(e,t,r,n,o,i,s,a,c,l,h,d){if(Mn.removeThrottle(s,o.auth.clientId,e),t.accountId)return cn(Gc,Ba,l,h,e.correlationId)(e,t.accountId,n,o,s,a,c,l,h,d);const u={...e,code:t.code||"",codeVerifier:r},g=new Dc(i,s,u,l,h);return await cn(g.handleCodeResponse.bind(g),"handleCodeResponse",l,h,e.correlationId)(t,e)}async function Yc(e,t,r,n,o,i,s,a,c,l,h){if(Mn.removeThrottle(i,n.auth.clientId,e),lo(t,e.state),!t.ear_jwe)throw fi(To);if(!e.earJwk)throw fi(ko);const d=JSON.parse(await cn(As,"decryptEarResponse",c,l,e.correlationId)(e.earJwk,t.ear_jwe));if(d.accountId)return cn(Gc,Ba,c,l,e.correlationId)(e,d.accountId,r,n,i,s,a,c,l,h);const u=new eo(n.auth.clientId,i,new Ga(c,l),c,l,null,null);u.validateTokenResponse(d,e.correlationId);const g={code:"",state:e.state,nonce:e.nonce,client_info:d.client_info,cloud_graph_host_name:d.cloud_graph_host_name,cloud_instance_host_name:d.cloud_instance_host_name,cloud_instance_name:d.cloud_instance_name,msgraph_host:d.msgraph_host};return await cn(u.handleServerTokenResponse.bind(u),nn,c,l,e.correlationId)(d,o,hn(),e,g,void 0,void 0,void 0,void 0)}async function Xc(e,t,r){const n=an(Zc,"generateCodeVerifier",t,e,r)(e,t,r);return{verifier:n,challenge:await cn(el,"generateCodeChallengeFromVerifier",t,e,r)(n,e,t,r)}}function Zc(e,t,r){try{const n=new Uint8Array(32);an(Cs,"getRandomValues",t,e,r)(n);return ns(n)}catch(e){throw fi(vo)}}async function el(e,t,r,n){try{const o=await cn(ws,"sha256Digest",r,t,n)(e);return ns(new Uint8Array(o))}catch(e){throw fi(vo)}}class tl{constructor(e,t,r,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement("nativeMessageHandlerHandshake"),this.platformAuthType=Ri}async sendMessage(e){this.logger.trace(`'${this.platformAuthType}' - sendMessage called.`,e.correlationId);const t={method:qi,request:e},r={channel:Ti,extensionId:this.extensionId,responseId:vs(),body:t};this.logger.trace(`'${this.platformAuthType}' - Sending request to browser extension`,e.correlationId),this.logger.tracePii(`'${this.platformAuthType}' - Sending request to browser extension: '${JSON.stringify(r)}'`,e.correlationId),this.messageChannel.port1.postMessage(r);const n=await new Promise(((e,t)=>{this.resolvers.set(r.responseId,{resolve:e,reject:t})}));return this.validatePlatformBrokerResponse(n)}static async createProvider(e,t,r,n){e.trace("PlatformAuthExtensionHandler - createProvider called.",n);try{const o=new tl(e,t,r,Ai);return await o.sendHandshakeRequest(n),o}catch(o){const i=new tl(e,t,r);return await i.sendHandshakeRequest(n),i}}async sendHandshakeRequest(e){this.logger.trace(`'${this.platformAuthType}' - sendHandshakeRequest called.`,e),window.addEventListener("message",this.windowListener,!1);const t={channel:Ti,extensionId:this.extensionId,responseId:vs(),body:{method:Oi}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(t,window.origin,[this.messageChannel.port2]),new Promise(((e,r)=>{this.handshakeResolvers.set(t.responseId,{resolve:e,reject:r}),this.timeoutId=window.setTimeout((()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(fi(ri)),this.handshakeResolvers.delete(t.responseId)}),this.handshakeTimeoutMs)}))}onWindowMessage(e){const t=Qs();if(this.logger.trace(`'${this.platformAuthType}' - onWindowMessage called`,t),e.source!==window)return;const r=e.data;if(r.channel&&r.channel===Ti&&(!r.extensionId||r.extensionId===this.extensionId)&&r.body.method===Oi){const e=this.handshakeResolvers.get(r.responseId);if(!e)return void this.logger.trace(`'${this.platformAuthType}'.onWindowMessage - resolver can't be found for request '${r.responseId}'`,t);this.logger.verbose(r.extensionId?`Extension with id: ${r.extensionId} not installed`:"No extension installed",t),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject(fi(ni))}}onChannelMessage(e){const t=Qs();this.logger.trace(`'${this.platformAuthType}' - onChannelMessage called.`,t);const r=e.data,o=this.resolvers.get(r.responseId),i=this.handshakeResolvers.get(r.responseId);try{const e=r.body.method;if(e===Ni){if(!o)return;const e=r.body.response;if(this.logger.trace(`'${this.platformAuthType}' - Received response from browser extension`,t),this.logger.tracePii(`'${this.platformAuthType}' - Received response from browser extension: '${JSON.stringify(e)}'`,t),"Success"!==e.status)o.reject($c(e.code,e.description,e.ext));else{if(!e.result)throw n(ho,"Event does not contain result.");e.result.code&&e.result.description?o.reject($c(e.result.code,e.result.description,e.result.ext)):o.resolve(e.result)}this.resolvers.delete(r.responseId)}else if(e===Mi){if(!i)return void this.logger.trace(`'${this.platformAuthType}'.onChannelMessage - resolver can't be found for request '${r.responseId}'`,t);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose(`'${this.platformAuthType}' - Received HandshakeResponse from extension: '${this.extensionId}'`,t),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(r){this.logger.error("Error parsing response from WAM Extension",t),this.logger.errorPii(`Error parsing response from WAM Extension: '${r}'`,t),this.logger.errorPii(`Unable to parse '${e}'`,t),o?o.reject(r):i&&i.reject(r)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw n(ho,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.getExtensionId()===Ai?"chrome":this.getExtensionId()?.length?"unknown":void 0}}class rl{constructor(e,t,r){this.logger=e,this.performanceClient=t,this.correlationId=r,this.platformAuthType=Pi}static async createProvider(e,t,r){if(e.trace("PlatformAuthDOMHandler: createProvider called",r),window.navigator?.platformAuthentication){const n=await window.navigator.platformAuthentication.getSupportedContracts(Si);if(n?.includes(Ei))return e.trace("Platform auth api available in DOM",r),new rl(e,t,r)}}getExtensionId(){return Si}getExtensionVersion(){return""}getExtensionName(){return _i}async sendMessage(e){this.logger.trace(`'${this.platformAuthType}' - Sending request to browser DOM API`,e.correlationId);try{const t=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(t);return this.validatePlatformBrokerResponse(r,e.correlationId)}catch(t){throw this.logger.error(`'${this.platformAuthType}' - executeGetToken DOM API error`,e.correlationId),t}}initializePlatformDOMRequest(e){this.logger.trace(`'${this.platformAuthType}' - initializeNativeDOMRequest called`,e.correlationId);const{accountId:t,clientId:r,authority:n,scope:o,redirectUri:i,correlationId:s,state:a,storeInCache:c,embeddedClientId:l,extraParameters:h,...d}=e,u=this.getDOMExtraParams(d);return{accountId:t,brokerId:this.getExtensionId(),authority:n,clientId:r,correlationId:s||this.correlationId,extraParameters:{...h,...u},isSecurityTokenService:!1,redirectUri:i,scope:o,state:a,storeInCache:c,embeddedClientId:l}}validatePlatformBrokerResponse(e,t){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace(`'${this.platformAuthType}' - platform broker returned successful and valid response`,t),this.convertToPlatformBrokerResponse(e,t);if(e.hasOwnProperty("error")){const r=e;if(!1===r.isSuccess&&r.error&&r.error.code)throw this.logger.trace(`'${this.platformAuthType}' - platform broker returned error response`,t),$c(r.error.code,r.error.description,{error:parseInt(r.error.errorCode),protocol_error:r.error.protocolError,status:r.error.status,properties:r.error.properties})}}throw n(ho,"Response missing expected properties.")}convertToPlatformBrokerResponse(e,t){this.logger.trace(`'${this.platformAuthType}' - convertToNativeResponse called`,t);return{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce(((e,[t,r])=>(e[t]=String(r),e)),{})}}}async function nl(e,t,r,n){e.trace("getPlatformAuthProvider called",r);const o=function(){let e;try{return e=window[xi.SessionStorage],"true"===e?.getItem(ha)}catch(e){return!1}}();let i;e.trace(`Has client allowed platform auth via DOM API: '${o}'`,r);try{o&&(i=await rl.createProvider(e,t,r)),i||(e.trace("Platform auth via DOM API not available, checking for extension",r),i=await tl.createProvider(e,n||2e3,t,r))}catch(t){e.trace("Platform auth not available",t)}return i}function ol(e,t,r,n,o){if(t.trace("isPlatformAuthAllowed called",r),!e.system.allowPlatformBroker)return t.trace("isPlatformAuthAllowed: allowPlatformBroker is not enabled, returning false",r),!1;if(!n)return t.trace("isPlatformAuthAllowed: Platform auth provider is not initialized, returning false",r),!1;if(o)switch(o){case xe.BEARER:case xe.POP:return t.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true",r),!0;default:return t.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false",r),!1}return!0}async function il(e,t,r,n,o,i,s){return new Promise(((t,i)=>{o.verbose("PopupHandler.monitorPopupForHash - polling started",s);const a=setInterval((()=>{if(e.closed)return o.error("PopupHandler.monitorPopupForHash - window closed",s),clearInterval(a),void i(fi(No));let n="";try{n=e.location.href}catch(e){}if(!n||"about:blank"===n)return;clearInterval(a);let c="";e&&(c=r===Ie.QUERY?e.location.search:e.location.hash),o.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller",s),t(c)}),n)})).finally((()=>{!function(e,t,r){e.close(),t.removeEventListener("beforeunload",r)}(e,t,i)}))}class sl extends Uc{constructor(e,t,r,n,o,i,s,a,c,l){super(e,t,r,n,o,i,s,c,l),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=a,this.eventHandler=o}acquireToken(e,t){try{const r={popupName:this.generatePopupName(e.scopes||te,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.performanceClient.addFields({isAsyncPopup:!this.config.system.navigatePopups},this.correlationId),this.config.system.navigatePopups?(this.logger.verbose("navigatePopups set to true, opening popup before acquiring token",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r,t)):(this.logger.verbose("navigatePopups set to false, acquiring token",this.correlationId),this.acquireTokenPopupAsync(e,r,t))}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("logoutPopup called",this.correlationId);const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},n=e&&e.authority,o=e&&e.mainWindowRedirectUri;return this.config.system.navigatePopups?(this.logger.verbose("navigatePopups set to true, opening popup",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,n,o)):(this.logger.verbose("navigatePopups set to false",this.correlationId),this.logoutPopupAsync(t,r,n,o))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(t,r,n){this.logger.verbose("acquireTokenPopupAsync called",this.correlationId);const o=await cn(Lc,La,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Popup,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);r.popup&&Js(o.authority);const i=ol(this.config,this.logger,this.correlationId,this.platformAuthProvider,t.authenticationScheme);return o.platformBroker=i,this.config.system.protocolMode===$t.EAR?this.executeEarFlow(o,r):this.executeCodeFlow(o,r,n)}async executeCodeFlow(t,n,o){const i=t.correlationId,s=Oc(Qi.acquireTokenPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),a=o||await cn(Xc,Ka,this.logger,this.performanceClient,i)(this.performanceClient,this.logger,i),c={...t,codeChallenge:a.challenge};try{const r=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,i)({serverTelemetryManager:s,requestAuthority:c.authority,requestAzureCloudOptions:c.azureCloudOptions,requestExtraQueryParameters:c.extraQueryParameters,account:c.account}),o=await cn(Jc,en,this.logger,this.performanceClient,i)(this.config,r.authority,c,this.logger,this.performanceClient),l=this.initiateAuthRequest(o,n);this.eventHandler.emitEvent(fc.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:l},null);const h=await il(l,n.popupWindowParent,this.config.auth.OIDCOptions.responseMode,this.config.system.pollIntervalMilliseconds,this.logger,this.unloadWindow,this.correlationId),d=an(Hc,Fa,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return await cn(Vc,Da,this.logger,this.performanceClient,i)(t,d,a.verifier,Qi.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}catch(e){throw n.popup?.close(),e instanceof r&&(e.setCorrelationId(this.correlationId),s.cacheFailedRequest(e)),e}}async executeEarFlow(e,t){const{correlationId:r,authority:n,azureCloudOptions:o,extraQueryParameters:i,account:s}=e,a=await cn(Mc,Ea,this.logger,this.performanceClient,r)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n,o,i,s),c=await cn(Ts,ja,this.logger,this.performanceClient,r)(),l={...e,earJwk:c},h=t.popup||this.openPopup("about:blank",t);(await Qc(h.document,this.config,a,l,this.logger,this.performanceClient)).submit();const d=await cn(il,Na,this.logger,this.performanceClient,r)(h,t.popupWindowParent,this.config.auth.OIDCOptions.responseMode,this.config.system.pollIntervalMilliseconds,this.logger,this.unloadWindow,r),u=an(Hc,Fa,this.logger,this.performanceClient,this.correlationId)(d,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return cn(Yc,Ha,this.logger,this.performanceClient,r)(l,u,Qi.acquireTokenPopup,this.config,a,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(t,n,o,i){this.logger.verbose("logoutPopupAsync called",this.correlationId),this.eventHandler.emitEvent(fc.LOGOUT_START,e.InteractionType.Popup,t);const s=Oc(Qi.logoutPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{await qc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,t.account);const r=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:o,account:t.account||void 0});try{r.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId&&t.postLogoutRedirectUri&&r.authority.protocolMode===$t.OIDC){if(this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Popup,t),i){const e={apiId:Qi.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=_t.getAbsoluteUrl(i,Hs());await this.navigationClient.navigateInternal(t,e)}return void n.popup?.close()}}const a=r.getLogoutUri(t);this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Popup,t);const c=this.openPopup(a,n);if(this.eventHandler.emitEvent(fc.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:c},null),await il(c,n.popupWindowParent,this.config.auth.OIDCOptions.responseMode,this.config.system.pollIntervalMilliseconds,this.logger,this.unloadWindow,this.correlationId).catch((()=>{})),i){const e={apiId:Qi.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=_t.getAbsoluteUrl(i,Hs());this.logger.verbose("Redirecting main window to url specified in the request",this.correlationId),this.logger.verbosePii(`Redirecting main window to: '${t}'`,this.correlationId),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("No main window navigation requested",this.correlationId)}catch(t){throw n.popup?.close(),t instanceof r&&(t.setCorrelationId(this.correlationId),s.cacheFailedRequest(t)),this.eventHandler.emitEvent(fc.LOGOUT_FAILURE,e.InteractionType.Popup,null,t),this.eventHandler.emitEvent(fc.LOGOUT_END,e.InteractionType.Popup),t}this.eventHandler.emitEvent(fc.LOGOUT_END,e.InteractionType.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: '${e}'`,this.correlationId),this.openPopup(e,t);throw this.logger.error("Navigate url is empty",this.correlationId),fi(bo)}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: '${e}'`,this.correlationId),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii(`Opening popup window to: '${e}'`,this.correlationId),r=this.openSizedPopup(e,t)),!r)throw fi(qo);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error(`error opening popup '${e.message}'`,this.correlationId),fi(Mo)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:n}){const o=n.screenLeft?n.screenLeft:n.screenX,i=n.screenTop?n.screenTop:n.screenY,s=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=r.popupSize?.width,l=r.popupSize?.height,h=r.popupPosition?.top,d=r.popupPosition?.left;return(!c||c<0||c>s)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid.",this.correlationId),c=wi),(!l||l<0||l>a)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid.",this.correlationId),l=Ci),(!h||h<0||h>a)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid.",this.correlationId),h=Math.max(0,a/2-Ci/2+i)),(!d||d<0||d>s)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid.",this.correlationId),d=Math.max(0,s/2-wi/2+o)),n.open(e,t,`width=${c}, height=${l}, top=${h}, left=${d}, scrollbars=yes`)}unloadWindow(e){this.currentWindow&&this.currentWindow.close(),e.preventDefault()}generatePopupName(e,t){return`${Ii}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Ii}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}class al extends Uc{constructor(e,t,r,n,o,i,s,a,c,l){super(e,t,r,n,o,i,s,c,l),this.nativeStorage=a}async acquireToken(t){const n=await cn(Lc,La,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Redirect,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.platformBroker=ol(this.config,this.logger,this.correlationId,this.platformAuthProvider,t.authenticationScheme);const o=t=>{t.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache.",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),this.eventHandler.emitEvent(fc.RESTORE_FROM_BFCACHE,e.InteractionType.Redirect))},i=this.getRedirectStartPage(t.redirectStartPage);this.logger.verbosePii(`Redirect start page: '${i}'`,this.correlationId),this.browserStorage.setTemporaryCache(Di,i,!0),window.addEventListener("pageshow",o);try{this.config.system.protocolMode===$t.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n)}catch(e){throw e instanceof r&&e.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),e}}async executeCodeFlow(e){const t=e.correlationId,n=Oc(Qi.acquireTokenRedirect,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=await cn(Xc,Ka,this.logger,this.performanceClient,t)(this.performanceClient,this.logger,t),i={...e,codeChallenge:o.challenge};this.browserStorage.cacheAuthorizeRequest(i,this.correlationId,o.verifier);try{const t=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),r=await cn(Jc,en,this.logger,this.performanceClient,e.correlationId)(this.config,t.authority,i,this.logger,this.performanceClient);return await this.initiateAuthRequest(r)}catch(e){throw e instanceof r&&(e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e)),e}}async executeEarFlow(e){const{correlationId:t,authority:r,azureCloudOptions:n,extraQueryParameters:o,account:i}=e,s=await cn(Mc,Ea,this.logger,this.performanceClient,t)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=await cn(Ts,ja,this.logger,this.performanceClient,t)(),c={...e,earJwk:a};this.browserStorage.cacheAuthorizeRequest(c,this.correlationId);return(await Qc(document,this.config,s,c,this.logger,this.performanceClient)).submit(),new Promise(((e,t)=>{setTimeout((()=>{t(fi(ui,"failed_to_redirect"))}),this.config.system.redirectNavigationTimeout)}))}async handleRedirectPromise(e,t,n,o){const i=Oc(Qi.handleRedirectPromise,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),s=o?.navigateToLoginRequestUrl??!0;try{const[r,a]=this.getRedirectResponse(o?.hash||"");if(!r)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache.",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),"back_forward"!==function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?n.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error",this.correlationId),null;const c=this.browserStorage.getTemporaryCache(Di,this.correlationId,!0)||"",l=Xr(c);if(l===Xr(window.location.href)&&s){this.logger.verbose("Current page is loginRequestUrl, handling response",this.correlationId),c.indexOf("#")>-1&&xs(c);return await this.handleResponse(r,e,t,i)}if(!s)return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response",this.correlationId),await this.handleResponse(r,e,t,i);if(!Us()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Fi,a,!0);const n={apiId:Qi.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let o=!0;if(c&&"null"!==c)this.logger.verbose(`Navigating to loginRequestUrl: '${c}'`,this.correlationId),o=await this.navigationClient.navigateInternal(c,n);else{const e=Bs();this.browserStorage.setTemporaryCache(Di,e,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page",this.correlationId),o=await this.navigationClient.navigateInternal(e,n)}if(!o)return await this.handleResponse(r,e,t,i)}return null}catch(e){throw e instanceof r&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}getRedirectResponse(t){this.logger.verbose("getRedirectResponseHash called",this.correlationId);let n=t;n||(n=this.config.auth.OIDCOptions.responseMode===Ie.QUERY?window.location.search:window.location.hash);let o=Vr(n);if(o){try{Bc(o,this.browserCrypto,e.InteractionType.Redirect)}catch(e){return e instanceof r&&this.logger.error(`Interaction type validation failed due to '${e.errorCode}': '${e.errorMessage}'`,this.correlationId),[null,""]}return Ns(window),this.logger.verbose("Hash contains known properties, returning response hash",this.correlationId),[o,n]}const i=this.browserStorage.getTemporaryCache(Fi,this.correlationId,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Fi)),i&&(o=Vr(i),o)?(this.logger.verbose("Hash does not contain known properties, returning cached hash",this.correlationId),[o,i]):[null,""]}async handleResponse(e,t,r,n){if(!e.state)throw fi(_o);const{authority:o,azureCloudOptions:i,extraQueryParameters:s,account:a}=t;if(e.ear_jwe){const r=await cn(Mc,Ea,this.logger,this.performanceClient,t.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,i,s,a);return cn(Yc,Ha,this.logger,this.performanceClient,t.correlationId)(t,e,Qi.acquireTokenRedirect,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const c=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority});return cn(Vc,Da,this.logger,this.performanceClient,t.correlationId)(t,e,r,Qi.acquireTokenRedirect,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called",this.correlationId),e){this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: '${e}'`,this.correlationId);const t={apiId:Qi.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=this.config.auth.onRedirectNavigate;if("function"==typeof r){this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback",this.correlationId);return!1!==r(e)?(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating",this.correlationId),void await this.navigationClient.navigateExternal(e,t)):void this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation",this.correlationId)}return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url",this.correlationId),void await this.navigationClient.navigateExternal(e,t)}throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty",this.correlationId),fi(bo)}async logout(t){this.logger.verbose("logoutRedirect called",this.correlationId);const n=this.initializeLogoutRequest(t),o=Oc(Qi.logout,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{this.eventHandler.emitEvent(fc.LOGOUT_START,e.InteractionType.Redirect,t),await qc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account);const r={apiId:Qi.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},i=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:t&&t.authority,requestExtraQueryParameters:t?.extraQueryParameters,account:t&&t.account||void 0}),{onRedirectNavigate:s,...a}=n;if(i.authority.protocolMode===$t.OIDC)try{i.authority.endSessionEndpoint}catch{if(n.account?.homeAccountId)return void("function"==typeof n.onRedirectNavigate?this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Redirect,a):this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Redirect,n))}const c=i.getLogoutUri(n);if(n.account?.homeAccountId&&("function"==typeof n.onRedirectNavigate?this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Redirect,a):this.eventHandler.emitEvent(fc.LOGOUT_SUCCESS,e.InteractionType.Redirect,n)),!t||"function"!=typeof t.onRedirectNavigate)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,Bi),void await this.navigationClient.navigateExternal(c,r);if(!1!==t.onRedirectNavigate(c))return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating",this.correlationId),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,Bi),void await this.navigationClient.navigateExternal(c,r);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation",this.correlationId)}catch(t){throw t instanceof r&&(t.setCorrelationId(this.correlationId),o.cacheFailedRequest(t)),this.eventHandler.emitEvent(fc.LOGOUT_FAILURE,e.InteractionType.Redirect,null,t),this.eventHandler.emitEvent(fc.LOGOUT_END,e.InteractionType.Redirect),t}this.eventHandler.emitEvent(fc.LOGOUT_END,e.InteractionType.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return _t.getAbsoluteUrl(t,Hs())}}async function cl(e,t,r,n){if(!e)throw r.info("Navigate url is empty",n),fi(bo);return an(dl,"silentHandlerLoadFrameSync",r,t,n)(e)}async function ll(e,t,r,n,o){const i=ul();if(!i.contentDocument)throw"No document associated with iframe!";return(await Qc(i.contentDocument,e,t,r,n,o)).submit(),i}async function hl(e,t,r,n,o,i,s){return new Promise(((n,a)=>{t<ta&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${t}ms) than the default (10000ms). This may result in timeouts.`,i);const c=window.setTimeout((()=>{window.clearInterval(l),a(fi(xo))}),t),l=window.setInterval((()=>{let t="";const r=e.contentWindow;try{t=r?r.location.href:""}catch(e){}if(!t||"about:blank"===t)return;let o="";r&&(o=s===Ie.QUERY?r.location.search:r.location.hash),window.clearTimeout(c),window.clearInterval(l),n(o)}),r)})).finally((()=>{an(gl,"removeHiddenIframe",o,n,i)(e)}))}function dl(e){const t=ul();return t.src=e,t}function ul(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(e),e}function gl(e){document.body===e.parentNode&&document.body.removeChild(e)}class pl extends Uc{constructor(e,t,r,n,o,i,s,a,c,l,h){super(e,t,r,n,o,i,a,l,h),this.apiId=s,this.nativeStorage=c}async acquireToken(t){t.loginHint||t.sid||t.account&&t.account.username||this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.",this.correlationId);const r={...t};r.prompt?r.prompt!==ye.NONE&&r.prompt!==ye.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt '${r.prompt}' with '${ye.NONE}'`,this.correlationId),r.prompt=ye.NONE):r.prompt=ye.NONE;const n=await cn(Lc,La,this.logger,this.performanceClient,this.correlationId)(r,e.InteractionType.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);return n.platformBroker=ol(this.config,this.logger,this.correlationId,this.platformAuthProvider,n.authenticationScheme),Js(n.authority),this.config.system.protocolMode===$t.EAR?this.executeEarFlow(n):this.executeCodeFlow(n)}async executeCodeFlow(e){let t;const n=Oc(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{return t=await cn(this.createAuthCodeClient.bind(this),xa,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await cn(this.silentTokenHelper.bind(this),Ma,this.logger,this.performanceClient,e.correlationId)(t,e)}catch(o){if(o instanceof r&&(o.setCorrelationId(this.correlationId),n.cacheFailedRequest(o)),!(t&&o instanceof r&&o.errorCode===yi))throw o;return this.performanceClient.addFields({retryError:o.errorCode},this.correlationId),await cn(this.silentTokenHelper.bind(this),Ma,this.logger,this.performanceClient,this.correlationId)(t,e)}}async executeEarFlow(e){const{correlationId:t,authority:r,azureCloudOptions:n,extraQueryParameters:o,account:i}=e,s=await cn(Mc,Ea,this.logger,this.performanceClient,t)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=await cn(Ts,ja,this.logger,this.performanceClient,t)(),c={...e,earJwk:a},l=await cn(ll,qa,this.logger,this.performanceClient,t)(this.config,s,c,this.logger,this.performanceClient),h=this.config.auth.OIDCOptions.responseMode,d=await cn(hl,Na,this.logger,this.performanceClient,t)(l,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,t,h),u=an(Hc,Fa,this.logger,this.performanceClient,t)(d,h,this.logger,this.correlationId);return cn(Yc,Ha,this.logger,this.performanceClient,t)(c,u,this.apiId,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(fi(Bo))}async silentTokenHelper(e,t){const r=t.correlationId,n=await cn(Xc,Ka,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),o={...t,codeChallenge:n.challenge},i=await cn(Jc,en,this.logger,this.performanceClient,r)(this.config,e.authority,o,this.logger,this.performanceClient),s=await cn(cl,qa,this.logger,this.performanceClient,r)(i,this.performanceClient,this.logger,r),a=this.config.auth.OIDCOptions.responseMode,c=await cn(hl,Na,this.logger,this.performanceClient,r)(s,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,a),l=an(Hc,Fa,this.logger,this.performanceClient,r)(c,a,this.logger,this.correlationId);return cn(Vc,Da,this.logger,this.performanceClient,r)(t,l,n.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}class ml extends Uc{async acquireToken(e){const t=await cn(Nc,Oa,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger,this.correlationId),r={...e,...t};e.redirectUri&&(r.redirectUri=Rc(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId));const n=Oc(Qi.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=await this.createRefreshTokenClient({serverTelemetryManager:n,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return cn(o.acquireTokenByRefreshToken.bind(o),"refreshTokenClientAcquireTokenByRefreshToken",this.logger,this.performanceClient,e.correlationId)(r).catch((e=>{throw e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e),e}))}logout(){return Promise.reject(fi(Bo))}async createRefreshTokenClient(e){const t=await cn(this.getClientConfiguration.bind(this),Ua,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new oo(t,this.performanceClient)}}class fl extends no{constructor(e,t){super(e,t),this.includeRedirectUri=!1}}class yl extends Uc{constructor(e,t,r,n,o,i,s,a,c,l){super(e,t,r,n,o,i,a,c,l),this.apiId=s}async acquireToken(t){if(!t.code)throw fi(Yo);const n=await cn(Lc,La,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),o=Oc(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const e={...n,code:t.code},r=await cn(this.getClientConfiguration.bind(this),Ua,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),i=new fl(r,this.performanceClient);this.logger.verbose("Auth code client created",this.correlationId);const s=new Dc(i,this.browserStorage,e,this.logger,this.performanceClient);return await cn(s.handleCodeResponseFromServer.bind(s),tn,this.logger,this.performanceClient,this.correlationId)({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},n,!1)}catch(e){throw e instanceof r&&(e.setCorrelationId(this.correlationId),o.cacheFailedRequest(e)),e}}logout(){return Promise.reject(fi(Bo))}}function wl(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}function Cl(e,t){try{js(e)}catch(e){throw t.end({success:!1},e),e}}class Il{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ga(this.logger,this.performanceClient):F,this.eventHandler=new Ec(this.logger),this.browserStorage=this.isBrowserEnvironment?new wc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,En(this.config.auth)):Ic(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const t={cacheLocation:xi.MemoryStorage,cacheRetentionDays:5};this.nativeInternalStorage=new wc(this.config.auth.clientId,t,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,t){const r=new Il(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected",e),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e,t){const r=this.getRequestCorrelationId(e);if(this.logger.trace("initialize called",r),this.initialized)return void this.logger.info("initialize has already been called, exiting early.",r);if(!this.isBrowserEnvironment)return this.logger.info("in non-browser environment, exiting early.",r),this.initialized=!0,void this.eventHandler.emitEvent(fc.INITIALIZE_END);const n=e?.correlationId||this.getRequestCorrelationId(),o=this.config.system.allowPlatformBroker,i=this.performanceClient.startMeasurement(nc,n);if(this.eventHandler.emitEvent(fc.INITIALIZE_START),!t)try{this.logMultipleInstances(i,n)}catch{}if(await cn(this.browserStorage.initialize.bind(this.browserStorage),"initializeCache",this.logger,this.performanceClient,n)(n),o)try{this.platformAuthProvider=await nl(this.logger,this.performanceClient,n,this.config.system.nativeBrokerHandshakeTimeout)}catch(e){this.logger.verbose(e,n)}this.config.cache.cacheLocation===xi.LocalStorage&&this.eventHandler.subscribeCrossTab(),!this.config.system.navigatePopups&&await this.preGeneratePkceCodes(n),this.initialized=!0,this.eventHandler.emitEvent(fc.INITIALIZE_END),i.end({allowPlatformBroker:o,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called",""),zs(this.initialized),this.isBrowserEnvironment){const t=e?.hash||"";let r=this.redirectResponse.get(t);return void 0===r?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise","")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call",""),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment",""),null}async handleRedirectPromiseInternal(t){if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null.",""),null;const r=this.browserStorage.getInteractionInProgress()?.type;if(r===Bi)return this.logger.verbose("handleRedirectPromise removing interaction_in_progress flag and returning null after sign-out",""),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const n=this.getAllAccounts(),o=this.browserStorage.getCachedNativeRequest(),i=o&&this.platformAuthProvider&&!t?.hash;let s,a;this.eventHandler.emitEvent(fc.HANDLE_REDIRECT_START,e.InteractionType.Redirect);try{if(i&&this.platformAuthProvider){const e=o?.correlationId||"";s=this.performanceClient.startMeasurement(tc,e),this.logger.trace("handleRedirectPromise - acquiring token from native platform",e);const t=new jc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Qi.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,o.accountId,this.nativeInternalStorage,o.correlationId);a=cn(t.handleRedirectPromise.bind(t),"handleNativeRedirectPromise",this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{const[e,r]=this.browserStorage.getCachedRequest(""),n=e.correlationId;s=this.performanceClient.startMeasurement(tc,n),this.logger.trace("handleRedirectPromise - acquiring token from web flow",n);const o=this.createRedirectClient(n);a=cn(o.handleRedirectPromise.bind(o),"handleRedirectPromise",this.logger,this.performanceClient,s.event.correlationId)(e,r,s,t)}}catch(e){throw this.browserStorage.resetRequestCache(""),e}return a.then((t=>{if(t){this.browserStorage.resetRequestCache(t.correlationId),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),this.logger.verbose("handleRedirectResponse returned result, acquire token success",t.correlationId);n.length<this.getAllAccounts().length&&(this.eventHandler.emitEvent(fc.LOGIN_SUCCESS,e.InteractionType.Redirect,t.account),this.logger.verbose("handleRedirectResponse returned result, login success",t.correlationId)),s.end({success:!0,accountType:wl(t.account)})}else s.event.errorCode?s.end({success:!1}):s.discard();return this.eventHandler.emitEvent(fc.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((t=>{this.browserStorage.resetRequestCache(s.event.correlationId);const r=t;throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,r),this.eventHandler.emitEvent(fc.HANDLE_REDIRECT_END,e.InteractionType.Redirect),s.end({success:!1},r),t}))}async acquireTokenRedirect(t){const r=this.getRequestCorrelationId(t);this.logger.verbose("acquireTokenRedirect called",r);const n=this.performanceClient.startMeasurement(ec,r);n.add({accountType:wl(t.account),scenarioId:t.scenarioId});const o=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=e=>{const t="function"==typeof o?o(e):void 0;return n.add({navigateCallbackResult:!1!==t}),n.event=n.end({success:!0})||n.event,t};try{let o;if(Ws(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,Hi),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t),this.platformAuthProvider&&this.canUsePlatformBroker(t)){o=new jc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Qi.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(t),this.nativeInternalStorage,r).acquireTokenRedirect(t,n).catch((e=>{if(e instanceof Fc&&Kc(e)){this.platformAuthProvider=void 0;return this.createRedirectClient(r).acquireToken(t)}if(e instanceof Jn){this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow",r);return this.createRedirectClient(r).acquireToken(t)}throw e}))}else{o=this.createRedirectClient(r).acquireToken(t)}return await o}catch(t){throw this.browserStorage.resetRequestCache(r),2===n.event.status?this.performanceClient.startMeasurement(tc,r).end({success:!1},t):n.end({success:!1},t),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t),t}}acquireTokenPopup(t){const r=this.getRequestCorrelationId(t),n=this.performanceClient.startMeasurement(Za,r);n.add({scenarioId:t.scenarioId,accountType:wl(t.account)});try{this.logger.verbose("acquireTokenPopup called",r),Cl(this.initialized,n),this.browserStorage.setInteractionInProgress(!0,Hi)}catch(e){return Promise.reject(e)}const o=this.getAllAccounts();let i;this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t);const s=this.getPreGeneratedPkceCodes(r);if(this.canUsePlatformBroker(t))i=this.acquireTokenNative({...t,correlationId:r},Qi.acquireTokenPopup).then((e=>(n.end({success:!0,isNativeBroker:!0,accountType:wl(e.account)}),e))).catch((e=>{if(e instanceof Fc&&Kc(e)){this.platformAuthProvider=void 0;return this.createPopupClient(r).acquireToken(t,s)}if(e instanceof Jn){this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow",r);return this.createPopupClient(r).acquireToken(t,s)}throw e}));else{i=this.createPopupClient(r).acquireToken(t,s)}return i.then((t=>{const r=o.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),r&&this.eventHandler.emitEvent(fc.LOGIN_SUCCESS,e.InteractionType.Popup,t.account),n.end({success:!0,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:wl(t.account)}),t})).catch((t=>(this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t),n.end({success:!1},t),Promise.reject(t)))).finally((async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.navigatePopups||await this.preGeneratePkceCodes(r)}))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&e.increment({visibilityChangeCount:1})}async ssoSilent(t){const r=this.getRequestCorrelationId(t),n={...t,prompt:t.prompt,correlationId:r};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(rc,r),this.ssoSilentMeasurement?.add({scenarioId:t.scenarioId,accountType:wl(t.account)}),Cl(this.initialized,this.ssoSilentMeasurement),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const o=this.getAllAccounts();let i;if(this.logger.verbose("ssoSilent called",r),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,n),this.canUsePlatformBroker(n))i=this.acquireTokenNative(n,Qi.ssoSilent).catch((e=>{if(e instanceof Fc&&Kc(e)){this.platformAuthProvider=void 0;return this.createSilentIframeClient(n.correlationId).acquireToken(n)}throw e}));else{i=this.createSilentIframeClient(n.correlationId).acquireToken(n)}return i.then((t=>{const r=o.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),r&&this.eventHandler.emitEvent(fc.LOGIN_SUCCESS,e.InteractionType.Silent,t.account),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:t.fromPlatformBroker,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:wl(t.account)}),t})).catch((t=>{throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),this.ssoSilentMeasurement?.end({success:!1},t),t})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenByCode(t){const r=this.getRequestCorrelationId(t);this.logger.trace("acquireTokenByCode called",r);const n=this.performanceClient.startMeasurement(Xa,r);Cl(this.initialized,n),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),n.add({scenarioId:t.scenarioId});try{if(t.code&&t.nativeAccountId)throw fi(Zo);if(t.code){const o=t.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",r),n.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",r),i=this.acquireTokenByCodeAsync({...t,correlationId:r}).then((t=>(this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),this.hybridAuthCodeResponses.delete(o),n.end({success:!0,isNativeBroker:t.fromPlatformBroker,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:wl(t.account)}),t))).catch((t=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t})),this.hybridAuthCodeResponses.set(o,i)),await i}if(t.nativeAccountId){if(this.canUsePlatformBroker(t,t.nativeAccountId)){const e=await this.acquireTokenNative({...t,correlationId:r},Qi.acquireTokenByCode,t.nativeAccountId).catch((e=>{throw e instanceof Fc&&Kc(e)&&(this.platformAuthProvider=void 0),e}));return n.end({accountType:wl(e.account),success:!0}),e}throw fi(ti)}throw fi(Xo)}catch(t){throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t}}async acquireTokenByCodeAsync(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCodeAsync called",t),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement("acquireTokenByCodeAsync",t),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const r=this.createSilentAuthCodeClient(t);return await r.acquireToken(e).then((e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromPlatformBroker}),e))).catch((e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenFromCache(e,t){switch(t){case es.Default:case es.AccessToken:case es.AccessTokenAndRefreshToken:const t=this.createSilentCacheClient(e.correlationId);return cn(t.acquireToken.bind(t),"silentCacheClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e);default:throw i(R)}}async acquireTokenByRefreshToken(e,t){switch(t){case es.Default:case es.AccessTokenAndRefreshToken:case es.RefreshToken:case es.RefreshTokenAndNetwork:const t=this.createSilentRefreshClient(e.correlationId);return cn(t.acquireToken.bind(t),"silentRefreshClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e);default:throw i(R)}}async acquireTokenBySilentIframe(e){const t=this.createSilentIframeClient(e.correlationId);return cn(t.acquireToken.bind(t),"silentIframeClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e)}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);Ws(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,Bi);return this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);js(this.initialized),this.browserStorage.setInteractionInProgress(!0,Bi);return this.createPopupClient(t).logout(e).finally((()=>{this.browserStorage.setInteractionInProgress(!1)}))}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return;const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return vc(this.logger,this.browserStorage,this.isBrowserEnvironment,this.getRequestCorrelationId(),e)}getAccount(e){return kc(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}getAccountByUsername(e){return Tc(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}getAccountByHomeId(e){return Ac(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}getAccountByLocalId(e){return bc(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}setActiveAccount(e){Sc(e,this.browserStorage,this.getRequestCorrelationId())}getActiveAccount(){return _c(this.browserStorage,this.getRequestCorrelationId())}async hydrateCache(e,t){this.logger.verbose("hydrateCache called",e.correlationId);const r=Wt(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),e.fromPlatformBroker?(this.logger.verbose("Response was from native broker, storing in-memory",e.correlationId),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r,n){const o=this.getRequestCorrelationId(e);if(this.logger.trace("acquireTokenNative called",o),!this.platformAuthProvider)throw fi(oi);return new jc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,o).acquireToken(e,n)}canUsePlatformBroker(e,t){const r=this.getRequestCorrelationId(e);if(this.logger.trace("canUsePlatformBroker called",r),!this.platformAuthProvider)return this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false",r),!1;if(!ol(this.config,this.logger,r,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("canUsePlatformBroker: isBrokerAvailable returned false, returning false",r),!1;if(e.prompt)switch(e.prompt){case ye.NONE:case ye.CONSENT:case ye.LOGIN:this.logger.trace("canUsePlatformBroker: prompt is compatible with platform broker flow",r);break;default:return this.logger.trace(`canUsePlatformBroker: prompt = '${e.prompt}' is not compatible with platform broker flow, returning false`,r),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUsePlatformBroker: nativeAccountId is not available, returning false",r),!1)}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new sl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createRedirectClient(e){return new al(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentIframeClient(e){return new pl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Qi.ssoSilent,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentCacheClient(e){return new zc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentRefreshClient(e){return new ml(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentAuthCodeClient(e){return new yl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Qi.acquireTokenByCode,this.performanceClient,e,this.platformAuthProvider)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return $s(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?vs():""}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Yi})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Yi})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(Ya,t);n.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Cl(this.initialized,n),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw fi(Do);return n.add({accountType:wl(o)}),this.acquireTokenSilentDeduped(e,o,t).then((r=>(n.end({success:!0,fromCache:r.fromCache,isNativeBroker:r.fromPlatformBroker,accessTokenSize:r.accessToken.length,idTokenSize:r.idToken.length}),{...r,state:e.state,correlationId:t}))).catch((e=>{throw e instanceof r&&e.setCorrelationId(t),n.end({success:!1},e),e}))}async acquireTokenSilentDeduped(e,t,r){const n=On(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},t.homeAccountId),o=JSON.stringify(n),i=this.activeSilentTokenRequests.get(o);if(void 0===i){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.addFields({deduped:!1},r);const n=cn(this.acquireTokenSilentAsync.bind(this),"acquireTokenSilentAsync",this.logger,this.performanceClient,r)({...e,correlationId:r},t);return this.activeSilentTokenRequests.set(o,n),n.finally((()=>{this.activeSilentTokenRequests.delete(o)}))}return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),this.performanceClient.addFields({deduped:!0},r),i}async acquireTokenSilentAsync(t,r){const n=()=>this.trackPageVisibility(t.correlationId);this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),t.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},t.correlationId),document.addEventListener("visibilitychange",n);const o=await cn(xc,"initializeSilentRequest",this.logger,this.performanceClient,t.correlationId)(t,r,this.config,this.performanceClient,this.logger),i=t.cacheLookupPolicy||es.Default;return this.acquireTokenSilentNoIframe(o,i).catch((async e=>{const t=function(e,t){const r=!(e instanceof Jn&&e.subError!==$n),n=e.errorCode===yi||e.errorCode===R,o=r&&n||e.errorCode===Un||e.errorCode===Hn,i=ts.includes(t);return o&&i}(e,i);if(t){if(this.activeIframeRequest){if(i!==es.Skip){const[t,r]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: '${r}'`,o.correlationId);const n=this.performanceClient.startMeasurement("awaitConcurrentIframe",o.correlationId);n.add({awaitIframeCorrelationId:r});const s=await t;if(n.end({success:s}),s)return this.logger.verbose(`Parallel iframe request with correlationId: '${r}' succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: '${r}' failed. Interaction is required.`,o.correlationId),e}return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),cn(this.acquireTokenBySilentIframe.bind(this),Ra,this.logger,this.performanceClient,o.correlationId)(o)}{let e;return this.activeIframeRequest=[new Promise((t=>{e=t})),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),cn(this.acquireTokenBySilentIframe.bind(this),Ra,this.logger,this.performanceClient,o.correlationId)(o).then((t=>(e(!0),t))).catch((t=>{throw e(!1),t})).finally((()=>{this.activeIframeRequest=void 0}))}}throw e})).then((r=>(this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,r),t.correlationId&&this.performanceClient.addFields({fromCache:r.fromCache,isNativeBroker:r.fromPlatformBroker},t.correlationId),r))).catch((t=>{throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),t})).finally((()=>{document.removeEventListener("visibilitychange",n)}))}async acquireTokenSilentNoIframe(t,r){return ol(this.config,this.logger,t.correlationId,this.platformAuthProvider,t.authenticationScheme)&&t.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform",t.correlationId),this.acquireTokenNative(t,Qi.acquireTokenSilent_silentFlow,t.account.nativeAccountId,r).catch((async e=>{if(e instanceof Fc&&Kc(e))throw this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow",t.correlationId),this.platformAuthProvider=void 0,i(R);throw e}))):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow",t.correlationId),r===es.AccessToken&&this.logger.verbose("acquireTokenSilent - cache lookup policy set to AccessToken, attempting to acquire token from local cache",t.correlationId),cn(this.acquireTokenFromCache.bind(this),"acquireTokenFromCache",this.logger,this.performanceClient,t.correlationId)(t,r).catch((n=>{if(r===es.AccessToken)throw n;return this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),cn(this.acquireTokenByRefreshToken.bind(this),"acquireTokenByRefreshToken",this.logger,this.performanceClient,t.correlationId)(t,r)})))}async preGeneratePkceCodes(e){return this.logger.verbose("Generating new PKCE codes",e),this.pkceCode=await cn(Xc,Ka,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){this.logger.verbose("Attempting to pick up pre-generated PKCE codes",e);const t=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,this.logger.verbose(`'${t?"Found":"Did not find"}' pre-generated PKCE codes`,e),this.performanceClient.addFields({usePreGeneratedPkce:!!t},e),t}logMultipleInstances(e,t){const r=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[];window.msal.clientIds.length>0&&this.logger.verbose("There is already an instance of MSAL.js in the window.",t),window.msal.clientIds.push(r),function(e,t,r,n){const o=window.msal?.clientIds||[],i=o.length,s=o.filter((t=>t===e)).length;s>1&&r.warning("There is already an instance of MSAL.js in the window with the same client id.",n),t.add({msalInstanceCount:i,sameClientIdInstanceCount:s})}(r,e,this.logger,t)}}class vl{constructor(e,t,r,n){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=n}toNaaTokenRequest(e){let t;t=void 0===e.extraQueryParameters?new Map:new Map(Object.entries(e.extraQueryParameters));const r=e.correlationId||this.crypto.createNewGuid(),n=Kr(e.claims,this.clientCapabilities),o=e.scopes||te;return{platformBrokerId:e.account?.homeAccountId,clientId:this.clientId,authority:e.authority,scope:o.join(" "),correlationId:r,claims:et.isEmptyObj(n)?void 0:n,state:e.state,authenticationScheme:e.authenticationScheme||xe.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw i(l);const n=un(r+(t.token.expires_in||0)),o=bt(t.token.id_token,this.crypto.base64Decode),s=this.fromNaaAccountInfo(t.account,t.token.id_token,o),a=t.token.scope||e.scope;return{authority:t.token.authority||s.environment,uniqueId:s.localAccountId,tenantId:s.tenantId,scopes:a.split(" "),account:s,idToken:t.token.id_token,idTokenClaims:o,accessToken:t.token.access_token,fromCache:!1,expiresOn:n,tokenType:e.authenticationScheme||xe.BEARER,correlationId:e.correlationId,extExpiresOn:n,state:e.state}}fromNaaAccountInfo(e,t,r){const n=r||e.idTokenClaims,o=e.localAccountId||n?.oid||n?.sub||"",i=e.tenantId||n?.tid||"",s=e.homeAccountId||`${o}.${i}`,a=e.username||n?.preferred_username||"",c=e.name||n?.name,l=e.loginHint||n?.login_hint,h=new Map,d=Tt(s,o,i,n);h.set(i,d);return{homeAccountId:s,environment:e.environment,tenantId:i,username:a,localAccountId:o,name:c,loginHint:l,idToken:t,idTokenClaims:n,tenantProfiles:h}}fromBridgeError(e){if(!function(e){return void 0!==e.status}(e))return new r("unknown_error","An unknown error occurred");switch(e.status){case wa:return new o(L);case Ca:return new o(U);case Ta:return new o(E);case ka:return new o(B);case Aa:return new o(e.code||B,e.description);case Ia:case va:return new Rn(e.code,e.description);case ya:return new Jn(e.code,e.description);default:return new r(e.code,e.description)}}toAuthenticationResultFromCache(e,t,r,n,o){if(!t||!r)throw i(l);const s=bt(t.secret,this.crypto.base64Decode),a=r.target||n.scopes.join(" ");return{authority:r.environment||e.environment,uniqueId:e.localAccountId,tenantId:e.tenantId,scopes:a.split(" "),account:e,idToken:t.secret,idTokenClaims:s||{},accessToken:r.secret,fromCache:!0,expiresOn:un(r.expiresOn),extExpiresOn:un(r.extendedExpiresOn),tokenType:n.authenticationScheme||xe.BEARER,correlationId:o,state:n.state}}}class kl extends r{constructor(e,t){super(e,t),Object.setPrototypeOf(this,kl.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new kl("unsupported_method")}}class Tl{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(void 0===t)throw new Error("unexpected: bridgeProxy is undefined");this.bridgeProxy=t,this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new Ga(this.logger,this.performanceClient,!0):F,this.eventHandler=new Ec(this.logger),this.browserStorage=this.operatingContext.isBrowserEnvironment()?new wc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,En(this.config.auth)):Ic(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler),this.nestedAppAuthAdapter=new vl(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger);const r=this.bridgeProxy.getAccountContext();this.currentAccountContext=r||null}static async createController(e){const t=new Tl(e);return Promise.resolve(t)}async initialize(e,t){const r=e?.correlationId||vs();return await this.browserStorage.initialize(r),Promise.resolve()}ensureValidRequest(e){return e?.correlationId?e:{...e,correlationId:this.browserCrypto.createNewGuid()}}async acquireTokenInteractive(t){const n=this.ensureValidRequest(t),o=n.correlationId||vs();this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Popup,n);const i=this.performanceClient.startMeasurement(Za,o);i?.add({nestedAppAuthRequest:!0});try{const r=this.nestedAppAuthAdapter.toNaaTokenRequest(n),s=hn(),a=await this.bridgeProxy.getTokenInteractive(r),c={...this.nestedAppAuthAdapter.fromNaaTokenResponse(r,a,s)};try{await this.hydrateCache(c,t)}catch(e){this.logger.warningPii(`Failed to hydrate cache. Error: ${e}`,o)}return this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,c),i.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i.end({success:!0,requestId:c.requestId}),c}catch(t){const n=t instanceof r?t:this.nestedAppAuthAdapter.fromBridgeError(t);throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t),i.end({success:!1},t),n}}async acquireTokenSilentInternal(t){const n=this.ensureValidRequest(t),o=n.correlationId||vs();this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,n);const i=await this.acquireTokenFromCache(n);if(i)return this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,i),i;const s=this.performanceClient.startMeasurement(rc,o);s?.increment({visibilityChangeCount:0}),s?.add({nestedAppAuthRequest:!0});try{const r=this.nestedAppAuthAdapter.toNaaTokenRequest(n);r.forceRefresh=n.forceRefresh;const i=hn(),a=await this.bridgeProxy.getTokenSilent(r),c=this.nestedAppAuthAdapter.fromNaaTokenResponse(r,a,i);try{await this.hydrateCache(c,t)}catch(e){this.logger.warningPii(`Failed to hydrate cache. Error: ${e}`,o)}return this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,c),s?.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),s?.end({success:!0,requestId:c.requestId}),c}catch(t){const n=t instanceof r?t:this.nestedAppAuthAdapter.fromBridgeError(t);throw this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),s?.end({success:!1},t),n}}async acquireTokenFromCache(t){const r=t.correlationId||vs(),n=this.performanceClient.startMeasurement(Ya,r);if(n?.add({nestedAppAuthRequest:!0}),t.claims)return this.logger.verbose("Claims are present in the request, skipping cache lookup",r),null;if(t.forceRefresh)return this.logger.verbose("forceRefresh is set to true, skipping cache lookup",r),null;let o=null;switch(t.cacheLookupPolicy||(t.cacheLookupPolicy=es.Default),t.cacheLookupPolicy){case es.Default:case es.AccessToken:case es.AccessTokenAndRefreshToken:o=await this.acquireTokenFromCacheInternal(t);break;default:return null}return o?(this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,o),n?.add({accessTokenSize:o?.accessToken.length,idTokenSize:o?.idToken.length}),n?.end({success:!0}),o):(this.logger.warning("Cached tokens are not found for the account, proceeding with silent token request.",r),this.eventHandler.emitEvent(fc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null),n?.end({success:!1}),null)}async acquireTokenFromCacheInternal(e){const t=this.bridgeProxy.getAccountContext()||this.currentAccountContext,r=e.correlationId||vs();let n=null;if(t&&(n=kc(t,this.logger,this.browserStorage,r)),!n)return this.logger.verbose("No active account found, falling back to the host",r),Promise.resolve(null);this.logger.verbose("active account found, attempting to acquire token silently",r);const o={...e,correlationId:r,authority:e.authority||n.environment,scopes:e.scopes?.length?e.scopes:[...te]},i=this.browserStorage.getTokenKeys(),s=this.browserStorage.getAccessToken(n,o,i,n.tenantId);if(!s)return this.logger.verbose("No cached access token found",r),Promise.resolve(null);if(mn(s.cachedAt)||gn(s.expiresOn,this.config.system.tokenRenewalOffsetSeconds))return this.logger.verbose("Cached access token has expired",r),Promise.resolve(null);const a=this.browserStorage.getIdToken(n,o.correlationId,i,n.tenantId);return a?this.nestedAppAuthAdapter.toAuthenticationResultFromCache(n,a,s,o,o.correlationId):(this.logger.verbose("No cached id token found",r),Promise.resolve(null))}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw kl.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw kl.createUnsupportedError()}acquireTokenNative(e,t,r){throw kl.createUnsupportedError()}acquireTokenByRefreshToken(e,t){throw kl.createUnsupportedError()}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw kl.createUnsupportedError()}removePerformanceCallback(e){throw kl.createUnsupportedError()}getAllAccounts(e){return vc(this.logger,this.browserStorage,this.isBrowserEnv(),vs(),e)}getAccount(e){return kc(e,this.logger,this.browserStorage,vs())}getAccountByUsername(e){return Tc(e,this.logger,this.browserStorage,vs())}getAccountByHomeId(e){return Ac(e,this.logger,this.browserStorage,vs())}getAccountByLocalId(e){return bc(e,this.logger,this.browserStorage,vs())}setActiveAccount(e){return Sc(e,this.browserStorage,vs())}getActiveAccount(){return _c(this.browserStorage,vs())}handleRedirectPromise(e){return Promise.resolve(null)}loginPopup(e){return this.acquireTokenInteractive(e||Yi)}loginRedirect(e){throw kl.createUnsupportedError()}logoutRedirect(e){throw kl.createUnsupportedError()}logoutPopup(e){throw kl.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("setNavigationClient is not supported in nested app auth","")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw kl.createUnsupportedError()}getRedirectResponse(){throw kl.createUnsupportedError()}async clearCache(e){throw kl.createUnsupportedError()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called",e.correlationId);const r=Wt(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId),this.browserStorage.hydrateCache(e,t)}}async function Al(e,t){const r=vs(),n=new _a(e),o=new Sa(e),i=[n.initialize(r),o.initialize(r)];return await Promise.all(i),o.isAvailable()?Tl.createController(o):n.isAvailable()?Il.createController(n,{correlationId:r}):null}class bl{static async createPublicClientApplication(e){const t=await async function(e){const t=vs(),r=new _a(e);return await r.initialize(t),Il.createController(r,{correlationId:t})}(e);return new bl(e,t)}constructor(e,t){this.isBroker=!1,this.controller=t||new Il(new _a(e))}async initialize(e){return this.controller.initialize(e,this.isBroker)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}async function Sl(e){const t=new bl(e);return await t.initialize(),t}class _l{constructor(e){this.initialized=!1,this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.logger=e.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ga(this.logger,this.performanceClient):F,this.eventHandler=new Ec(this.logger),this.browserStorage=this.isBrowserEnvironment?new wc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler):Ic(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler)}getBrowserStorage(){return this.browserStorage}getAccount(e){return null}getAccountByHomeId(e){return null}getAccountByLocalId(e){return null}getAccountByUsername(e){return null}getAllAccounts(){return[]}initialize(){return this.initialized=!0,Promise.resolve()}acquireTokenPopup(e){return zs(this.initialized),$s(),{}}acquireTokenRedirect(e){return zs(this.initialized),$s(),Promise.resolve()}acquireTokenSilent(e){return zs(this.initialized),$s(),{}}acquireTokenByCode(e){return zs(this.initialized),$s(),{}}acquireTokenNative(e,t,r){return zs(this.initialized),$s(),{}}acquireTokenByRefreshToken(e,t){return zs(this.initialized),$s(),{}}addEventCallback(e,t){return null}removeEventCallback(e){}addPerformanceCallback(e){return zs(this.initialized),$s(),""}removePerformanceCallback(e){return zs(this.initialized),$s(),!0}handleRedirectPromise(e){return zs(this.initialized),Promise.resolve(null)}loginPopup(e){return zs(this.initialized),$s(),{}}loginRedirect(e){return zs(this.initialized),$s(),{}}logout(e){return zs(this.initialized),$s(),{}}logoutRedirect(e){return zs(this.initialized),$s(),{}}logoutPopup(e){return zs(this.initialized),$s(),{}}ssoSilent(e){return zs(this.initialized),$s(),{}}getLogger(){return this.logger}setLogger(e){zs(this.initialized),$s()}setActiveAccount(e){zs(this.initialized),$s()}getActiveAccount(){return zs(this.initialized),$s(),null}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){zs(this.initialized),$s()}getConfiguration(){return this.config}isBrowserEnv(){return zs(this.initialized),$s(),!0}getBrowserCrypto(){return zs(this.initialized),$s(),{}}getPerformanceClient(){return zs(this.initialized),$s(),{}}getRedirectResponse(){return zs(this.initialized),$s(),{}}async clearCache(e){zs(this.initialized),$s()}async hydrateCache(e,t){zs(this.initialized),$s()}}class El extends fa{getId(){return El.ID}getModuleName(){return El.MODULE_NAME}async initialize(){return!0}}El.MODULE_NAME="",El.ID="UnknownOperatingContext";class Pl{static async createPublicClientApplication(e){const t=await Al(e);let r;return r=null!==t?new Pl(e,t):new Pl(e),r}constructor(e,t){if(this.configuration=e,t)this.controller=t;else{const t=new El(e);this.controller=new _l(t)}}async initialize(){if(this.controller instanceof _l){const e=await Al(this.configuration);return null!==e&&(this.controller=e),this.controller.initialize()}return Promise.resolve()}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const Rl={initialize:()=>Promise.reject(qs(Os)),acquireTokenPopup:()=>Promise.reject(qs(Os)),acquireTokenRedirect:()=>Promise.reject(qs(Os)),acquireTokenSilent:()=>Promise.reject(qs(Os)),acquireTokenByCode:()=>Promise.reject(qs(Os)),getAllAccounts:()=>[],getAccount:()=>null,handleRedirectPromise:()=>Promise.reject(qs(Os)),loginPopup:()=>Promise.reject(qs(Os)),loginRedirect:()=>Promise.reject(qs(Os)),logoutRedirect:()=>Promise.reject(qs(Os)),logoutPopup:()=>Promise.reject(qs(Os)),ssoSilent:()=>Promise.reject(qs(Os)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,getLogger:()=>{throw qs(Os)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw qs(Os)},hydrateCache:()=>Promise.reject(qs(Os)),clearCache:()=>Promise.reject(qs(Os))};function Ol(){let e;try{e=window[xi.SessionStorage];const t=e?.getItem(la);if(1===Number(t))return Promise.resolve().then((function(){return xl}))}catch(e){}}function Ml(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.now}function ql(e){if(e&&Ml())return Math.round(window.performance.now()-e)}class Nl{constructor(e,t){this.correlationId=t,this.measureName=Nl.makeMeasureName(e,t),this.startMark=Nl.makeStartMark(e,t),this.endMark=Nl.makeEndMark(e,t)}static makeMeasureName(e,t){return`msal.measure.${e}.${t}`}static makeStartMark(e,t){return`msal.start.${e}.${t}`}static makeEndMark(e,t){return`msal.end.${e}.${t}`}static supportsBrowserPerformance(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName}static flushMeasurements(e,t){if(Nl.supportsBrowserPerformance())try{t.forEach((t=>{const r=Nl.makeMeasureName(t.name,e);window.performance.getEntriesByName(r,"measure").length>0&&(window.performance.clearMeasures(r),window.performance.clearMarks(Nl.makeStartMark(r,e)),window.performance.clearMarks(Nl.makeEndMark(r,e)))}))}catch(e){}}startMeasurement(){if(Nl.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}}endMeasurement(){if(Nl.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}}flushMeasurement(){if(Nl.supportsBrowserPerformance())try{const e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){const t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null}}var xl=Object.freeze({__proto__:null,BrowserPerformanceMeasurement:Nl});const Ul=xe,Ll=Ie,Hl=ye,Bl=Qe,Dl=te;e.AccountEntityUtils=Gt,e.ApiId=Qi,e.AuthError=r,e.AuthErrorCodes=uo,e.AuthenticationHeaderParser=class{constructor(e){this.headers=e}getShrNonce(){const e=this.headers[ce];if(e){const t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw Ze(ft)}const t=this.headers[ae];if(t){const e=this.parseChallenges(t);if(e.nonce)return e.nonce;throw Ze(ft)}throw Ze(mt)}parseChallenges(e){const t=e.indexOf(" "),r=e.substr(t+1).split(","),n={};return r.forEach((e=>{const[t,r]=e.split("=");n[t]=unescape(r.replace(/['"]+/g,""))})),n}},e.AuthenticationScheme=Ul,e.AzureCloudInstance=Ye,e.BrowserAuthError=mi,e.BrowserAuthErrorCodes=gi,e.BrowserCacheLocation=xi,e.BrowserConfigurationAuthError=Ms,e.BrowserPerformanceClient=class extends Io{constructor(e,t){super(e.auth.clientId,e.auth.authority||`${z}`,new $(e.system?.loggerOptions||{},na,oa),na,oa,e.telemetry?.application||{appName:"",appVersion:""},t)}generateId(){return vs()}getPageVisibility(){return document.visibilityState?.toString()||null}deleteIncompleteSubMeasurements(e){Ol()?.then((t=>{const r=this.eventsByCorrelationId.get(e.event.correlationId),n=r&&r.eventId===e.event.eventId,o=[];n&&r?.incompleteSubMeasurements&&r.incompleteSubMeasurements.forEach((e=>{o.push({...e})})),t.BrowserPerformanceMeasurement.flushMeasurements(e.event.correlationId,o)}))}startMeasurement(e,t){const r=this.getPageVisibility(),n=super.startMeasurement(e,t),o=Ml()?window.performance.now():void 0,i=Ol()?.then((t=>new t.BrowserPerformanceMeasurement(e,n.event.correlationId)));return i?.then((e=>e.startMeasurement())),{...n,end:(e,t)=>{const s=n.end({...e,startPageVisibility:r,endPageVisibility:this.getPageVisibility(),durationMs:ql(o)},t);return i?.then((e=>e.endMeasurement())),this.deleteIncompleteSubMeasurements(n),s},discard:()=>{n.discard(),i?.then((e=>e.flushMeasurement())),this.deleteIncompleteSubMeasurements(n)}}}},e.BrowserPerformanceMeasurement=Nl,e.BrowserRootPerformanceEvents=ic,e.BrowserUtils=Vs,e.CacheLookupPolicy=es,e.ClientAuthError=o,e.ClientAuthErrorCodes=D,e.ClientConfigurationError=Xe,e.ClientConfigurationErrorCodes=It,e.DEFAULT_IFRAME_TIMEOUT_MS=ta,e.EventHandler=Ec,e.EventMessageUtils=class{static getInteractionStatusFromEvent(t,r){switch(t.eventType){case fc.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return Vi.AcquireToken;break;case fc.HANDLE_REDIRECT_START:return Vi.HandleRedirect;case fc.LOGOUT_START:return Vi.Logout;case fc.LOGOUT_END:if(r&&r!==Vi.Logout)break;return Vi.None;case fc.HANDLE_REDIRECT_END:if(r&&r!==Vi.HandleRedirect)break;return Vi.None;case fc.ACQUIRE_TOKEN_SUCCESS:case fc.ACQUIRE_TOKEN_FAILURE:case fc.RESTORE_FROM_BFCACHE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==Vi.AcquireToken)break;return Vi.None}}return null}},e.EventType=fc,e.InteractionRequiredAuthError=Jn,e.InteractionRequiredAuthErrorCodes=zn,e.InteractionStatus=Vi,e.JsonWebTokenTypes=Bl,e.LocalStorage=pc,e.Logger=$,e.MemoryStorage=Ja,e.NavigationClient=Ys,e.OIDC_DEFAULT_SCOPES=Dl,e.PromptValue=Hl,e.ProtocolMode=$t,e.PublicClientApplication=bl,e.PublicClientNext=Pl,e.ResponseMode=Ll,e.ServerError=Rn,e.SessionStorage=mc,e.SignedHttpRequest=class{constructor(e,t){const r=t&&t.loggerOptions||{};this.logger=new $(r,na,oa),this.cryptoOps=new Ga(this.logger),this.popTokenGenerator=new Xn(this.cryptoOps,new tr),this.shrParameters=e}async generatePublicKeyThumbprint(){const{kid:e}=await this.popTokenGenerator.generateKid(this.shrParameters);return e}async signRequest(e,t,r){return this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)}async removeKeys(e,t){return this.cryptoOps.removeTokenBindingKey(e,t)}},e.StringUtils=et,e.StubPerformanceClient=tr,e.UrlString=_t,e.WrapperSKU={React:"@azure/msal-react",Angular:"@azure/msal-angular"},e.createNestablePublicClientApplication=async function(e){const t=vs(),r=new Sa(e);if(await r.initialize(t),r.isAvailable()){const n=new Tl(r),o=new bl(e,n);return await o.initialize({correlationId:t}),o}return Sl(e)},e.createStandardPublicClientApplication=Sl,e.isPlatformBrokerAvailable=async function(e,t,r){const n=new $(e||{},na,oa),o=r||"";n.trace("isPlatformBrokerAvailable called",o);const i=t||new tr;return"undefined"==typeof window?(n.trace("Non-browser environment detected, returning false",o),!1):!!await nl(n,i,o)},e.loadExternalTokens=async function(e,t,r,n){$s();const o=ra(e,!0),i=t.correlationId||vs(),s=r.id_token?bt(r.id_token,ss):void 0,a={protocolMode:o.system.protocolMode,knownAuthorities:o.auth.knownAuthorities,cloudDiscoveryMetadata:o.auth.cloudDiscoveryMetadata,authorityMetadata:o.auth.authorityMetadata},c=new $(o.system.loggerOptions||{}),l=new Ga(c,o.telemetry.client),h=new wc(o.auth.clientId,o.cache,l,c,o.telemetry.client,new Ec(c),En(o.auth)),d=t.authority?new Sn(Sn.generateAuthority(t.authority,t.azureCloudOptions),o.system.networkClient,h,a,c,t.correlationId||vs(),o.telemetry.client):void 0,u=await async function(e,t,r,n,o,i,s,a){if(o.verbose("TokenCache - loading account",r),e.account){const t=Wt(e.account);return await n.setAccount(t,r),t}if(!a||!t&&!s)throw o.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead.",r),fi(Go);const c=Jt(t,a.authorityType,o,i,r,s),l=s?.tid,h=to(n,a,c,ss,r,s,t,a.hostnameAndPort,l,void 0,void 0,o);return await n.setAccount(h,r),h}(t,n.clientInfo||r.client_info||"",i,h,c,l,s,d),g=await async function(e,t,r,n,o,i,s,a){if(!e.id_token)return s.verbose("TokenCache - no id token found in response",o),null;s.verbose("TokenCache - loading id token",o);const c=fn(t,r,e.id_token,a,n);return await i.setIdTokenCredential(c,o),c}(r,u.homeAccountId,u.environment,u.realm,i,h,c,e.auth.clientId),p=await async function(e,t,r,n,o,i,s,a,c,l){if(!t.access_token)return c.verbose("TokenCache - no access token found in response",s),null;if(!t.expires_in)return c.error("TokenCache - no expiration set on the access token. Cannot add it to the cache.",s),null;if(!(t.scope||e.scopes&&e.scopes.length))return c.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache.",s),null;c.verbose("TokenCache - loading access token",s);const h=t.scope?vt.fromString(t.scope):new vt(e.scopes),d=i.expiresOn||t.expires_in+hn(),u=i.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+hn(),g=yn(r,n,t.access_token,l,o,h.printScopes(),d,u,ss);return await a.setAccessTokenCredential(g,s),g}(t,r,u.homeAccountId,u.environment,u.realm,n,i,h,c,e.auth.clientId),m=await async function(e,t,r,n,o,i,s){if(!e.refresh_token)return i.verbose("TokenCache - no refresh token found in response",n),null;i.verbose("TokenCache - loading refresh token",n);const a=wn(t,r,e.refresh_token,s,e.foci,void 0,e.refresh_token_expires_in);return await o.setRefreshTokenCredential(a,n),a}(r,u.homeAccountId,u.environment,i,h,c,e.auth.clientId);return function(e,t,r,n){let o,i="",s=[],a=null;t?.accessToken&&(i=t.accessToken.secret,s=vt.fromString(t.accessToken.target).asArray(),a=un(t.accessToken.expiresOn),o=un(t.accessToken.extendedExpiresOn));const c=t.account;return{authority:n?n.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:zt(c),idToken:t.idToken?.secret||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:o,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:c.cloudGraphHostName||"",msGraphHost:c.msGraphHost||"",fromPlatformBroker:!1}}(t,{account:u,idToken:g,accessToken:p,refreshToken:m},s,d)},e.stubbedPublicClientApplication=Rl,e.version=oa}));
|
|
1
|
+
/*! @azure/msal-browser v5.0.1 2026-01-16 */
|
|
2
|
+
"use strict";!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msal={})}(this,(function(e){const t="https://login.microsoftonline.com/common/",r="common",n=`${t}discovery/instance?api-version=1.1&authorization_endpoint=`,o=".ciamlogin.com",i="openid",s="profile",a="offline_access",c="S256",h="Not Available",l="http://169.254.169.254/metadata/instance/compute/location",d=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],u="GET",g="POST",p=[i,s,a],m=[...p,"email"],f="Content-Type",y="Content-Length",w="Retry-After",I="X-AnchorMailbox",C="WWW-Authenticate",v="Authentication-Info",k="x-ms-request-id",T="x-ms-httpver",b="active-account-filters",A="common",S="organizations",_="consumers",E="access_token",P="xms_cc",R={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},O="code",M="id_token token refresh_token",x={QUERY:"query",FRAGMENT:"fragment",FORM_POST:"form_post"},q="authorization_code",N="refresh_token",U="Generic",L={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},H="appmetadata",D="1",F="authority-metadata",K="config",B="cache",z="network",j="hardcoded_values",$=5,J="server-telemetry",W=",",G={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},Q="throttling",V="1",X="3",Y="4",Z="2",ee="4",te="5",re="0",ne="1",oe="2",ie="3",se="4",ae={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},ce="client_id",he="redirect_uri",le="token_type",de="req_cnf",ue="return_spa_code",ge="x-client-xtra-sku",pe="brk_client_id",me="brk_redirect_uri",fe="instance_aware";function ye(e){return`See https://aka.ms/msal.js.errors#${e} for details`}class we extends Error{constructor(e,t,r){const n=t||(e?ye(e):"");super(n?`${e}: ${n}`:e),Object.setPrototypeOf(this,we.prototype),this.errorCode=e||"",this.errorMessage=n||"",this.subError=r||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function Ie(e,t){return new we(e,t||ye(e))}class Ce extends we{constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Ce.prototype)}}function ve(e){return new Ce(e)}class ke{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),n=e=>decodeURIComponent(e.replace(/\+/g," "));return r.forEach((e=>{if(e.trim()){const[r,o]=e.split(/=(.+)/g,2);r&&o&&(t[n(r)]=n(o))}})),t}static trimArrayEntries(e){return e.map((e=>e.trim()))}static removeEmptyStringsFromArray(e){return e.filter((e=>!!e))}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}}class Te extends we{constructor(e,t){super(e,t),this.name="ClientAuthError",Object.setPrototypeOf(this,Te.prototype)}}function be(e,t){return new Te(e,t)}const Ae="redirect_uri_empty",Se="authority_uri_insecure",_e="url_parse_error",Ee="empty_url_error",Pe="empty_input_scopes_error",Re="invalid_claims",Oe="token_request_empty",Me="logout_request_empty",xe="pkce_params_missing",qe="invalid_cloud_discovery_metadata",Ne="invalid_authority_metadata",Ue="untrusted_authority",Le="missing_ssh_jwk",He="missing_ssh_kid",De="missing_nonce_authentication_header",Fe="invalid_authentication_header",Ke="cannot_set_OIDCOptions",Be="cannot_allow_platform_broker",ze="authority_mismatch",je="invalid_request_method_for_EAR";var $e=Object.freeze({__proto__:null,authorityMismatch:ze,authorityUriInsecure:Se,cannotAllowPlatformBroker:Be,cannotSetOIDCOptions:Ke,claimsRequestParsingError:"claims_request_parsing_error",emptyInputScopesError:Pe,invalidAuthenticationHeader:Fe,invalidAuthorityMetadata:Ne,invalidClaims:Re,invalidCloudDiscoveryMetadata:qe,invalidCodeChallengeMethod:"invalid_code_challenge_method",invalidRequestMethodForEAR:je,logoutRequestEmpty:Me,missingNonceAuthenticationHeader:De,missingSshJwk:Le,missingSshKid:He,pkceParamsMissing:xe,redirectUriEmpty:Ae,tokenRequestEmpty:Oe,untrustedAuthority:Ue,urlEmptyError:Ee,urlParseError:_e});const Je="client_info_decoding_error",We="client_info_empty_error",Ge="token_parsing_error",Qe="null_or_empty_token",Ve="endpoints_resolution_error",Xe="network_error",Ye="openid_config_error",Ze="hash_not_deserialized",et="invalid_state",tt="state_mismatch",rt="state_not_found",nt="nonce_mismatch",ot="auth_time_not_found",it="max_age_transpired",st="multiple_matching_appMetadata",at="request_cannot_be_made",ct="cannot_remove_empty_scope",ht="cannot_append_scopeset",lt="empty_input_scopeset",dt="no_account_in_silent_request",ut="invalid_cache_record",gt="invalid_cache_environment",pt="no_account_found",mt="no_crypto_object",ft="token_refresh_required",yt="token_claims_cnf_required_for_signedjwt",wt="authorization_code_missing_from_server_response",It="binding_key_not_removed",Ct="end_session_endpoint_not_supported",vt="key_id_missing",kt="no_network_connectivity",Tt="user_canceled",bt="method_not_implemented",At="nested_app_auth_bridge_disabled";var St=Object.freeze({__proto__:null,authTimeNotFound:ot,authorizationCodeMissingFromServerResponse:wt,bindingKeyNotRemoved:It,cannotAppendScopeSet:ht,cannotRemoveEmptyScope:ct,clientInfoDecodingError:Je,clientInfoEmptyError:We,emptyInputScopeSet:lt,endSessionEndpointNotSupported:Ct,endpointResolutionError:Ve,hashNotDeserialized:Ze,invalidCacheEnvironment:gt,invalidCacheRecord:ut,invalidState:et,keyIdMissing:vt,maxAgeTranspired:it,methodNotImplemented:bt,multipleMatchingAppMetadata:st,multipleMatchingTokens:"multiple_matching_tokens",nestedAppAuthBridgeDisabled:At,networkError:Xe,noAccountFound:pt,noAccountInSilentRequest:dt,noCryptoObject:mt,noNetworkConnectivity:kt,nonceMismatch:nt,nullOrEmptyToken:Qe,openIdConfigError:Ye,platformBrokerError:"platform_broker_error",requestCannotBeMade:at,stateMismatch:tt,stateNotFound:rt,tokenClaimsCnfRequiredForSignedJwt:yt,tokenParsingError:Ge,tokenRefreshRequired:ft,unexpectedCredentialType:"unexpected_credential_type",userCanceled:Tt});class _t{constructor(e){const t=e?ke.trimArrayEntries([...e]):[],r=t?ke.removeEmptyStringsFromArray(t):[];if(!r||!r.length)throw ve(Pe);this.scopes=new Set,r.forEach((e=>this.scopes.add(e)))}static fromString(e){const t=(e||"").split(" ");return new _t(t)}static createSearchScopes(e){const t=e&&e.length>0?e:[...p],r=new _t(t);return r.containsOnlyOIDCScopes()?r.removeScope(a):r.removeOIDCScopes(),r}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new _t(t);return!!e&&r.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((e=>this.containsScope(e))))}containsOnlyOIDCScopes(){let e=0;return m.forEach((t=>{this.containsScope(t)&&(e+=1)})),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach((e=>this.appendScope(e)))}catch(e){throw be(ht)}}removeScope(e){if(!e)throw be(ct);this.scopes.delete(e.trim())}removeOIDCScopes(){m.forEach((e=>{this.scopes.delete(e)}))}unionScopeSets(e){if(!e)throw be(lt);const t=new Set;return e.scopes.forEach((e=>t.add(e.toLowerCase()))),this.scopes.forEach((e=>t.add(e.toLowerCase()))),t}intersectingScopeSets(e){if(!e)throw be(lt);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach((t=>e.push(t))),e}printScopes(){if(this.scopes){return this.asArray().join(" ")}return""}printScopesLowerCase(){return this.printScopes().toLowerCase()}}function Et(e,t,r){if(!t)return;const n=e.get(ce);n&&e.has(pe)&&r?.addFields({embeddedClientId:n,embeddedRedirectUri:e.get(he)},t)}function Pt(e,t){e.set("response_type",t)}function Rt(e,t,r=!0,n=p){!r||n.includes("openid")||t.includes("openid")||n.push("openid");const o=r?[...t||[],...n]:t||[],i=new _t(o);e.set("scope",i.printScopes())}function Ot(e,t){e.set(ce,t)}function Mt(e,t){e.set(he,t)}function xt(e,t){e.set("login_hint",t)}function qt(e,t){e.set(I,`UPN:${t}`)}function Nt(e,t){e.set(I,`Oid:${t.uid}@${t.utid}`)}function Ut(e,t){e.set("sid",t)}function Lt(e,t,r){const n=Vt(t,r);try{JSON.parse(n)}catch(e){throw ve(Re)}e.set("claims",n)}function Ht(e,t){e.set("client-request-id",t)}function Dt(e,t){e.set("x-client-SKU",t.sku),e.set("x-client-VER",t.version),t.os&&e.set("x-client-OS",t.os),t.cpu&&e.set("x-client-CPU",t.cpu)}function Ft(e,t){t?.appName&&e.set("x-app-name",t.appName),t?.appVersion&&e.set("x-app-ver",t.appVersion)}function Kt(e,t){t&&e.set("state",t)}function Bt(e,t,r){if(!t||!r)throw ve(xe);e.set("code_challenge",t),e.set("code_challenge_method",r)}function zt(e,t){e.set("client_secret",t)}function jt(e,t){t&&e.set("client_assertion",t)}function $t(e,t){t&&e.set("client_assertion_type",t)}function Jt(e,t){e.set("grant_type",t)}function Wt(e){e.set("client_info","1")}function Gt(e){e.has(fe)||e.set(fe,"true")}function Qt(e,t){Object.entries(t).forEach((([t,r])=>{!e.has(t)&&r&&e.set(t,r)}))}function Vt(e,t){let r;if(e)try{r=JSON.parse(e)}catch(e){throw ve(Re)}else r={};return t&&t.length>0&&(r.hasOwnProperty(E)||(r[E]={}),r[E][P]={values:t}),JSON.stringify(r)}function Xt(e,t){t&&(e.set(le,G.POP),e.set(de,t))}function Yt(e,t){t&&(e.set(le,G.SSH),e.set(de,t))}function Zt(e,t){e.set("x-client-current-telemetry",t.generateCurrentRequestHeaderValue()),e.set("x-client-last-telemetry",t.generateLastRequestHeaderValue())}function er(e){e.set("x-ms-lib-capability","retry-after, h429")}function tr(e,t,r){e.has(pe)||e.set(pe,t),e.has(me)||e.set(me,r)}function rr(e){if(!e)return e;let t=e.toLowerCase();return ke.endsWith(t,"?")?t=t.slice(0,-1):ke.endsWith(t,"?/")&&(t=t.slice(0,-2)),ke.endsWith(t,"/")||(t+="/"),t}function nr(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function or(e){if(!e||e.indexOf("=")<0)return null;try{const t=nr(e),r=Object.fromEntries(new URLSearchParams(t));if(r.code||r.ear_jwe||r.error||r.error_description||r.state)return r}catch(e){throw be(Ze)}return null}function ir(e){const t=new Array;return e.forEach(((e,r)=>{t.push(`${r}=${encodeURIComponent(e)}`)})),t.join("&")}function sr(e){if(!e)return e;const t=e.split("#")[0];try{const e=new URL(t);return rr(e.origin+e.pathname+e.search)}catch(e){return rr(t)}}const ar={createNewGuid:()=>{throw be(bt)},base64Decode:()=>{throw be(bt)},base64Encode:()=>{throw be(bt)},base64UrlEncode:()=>{throw be(bt)},encodeKid:()=>{throw be(bt)},async getPublicKeyThumbprint(){throw be(bt)},async removeTokenBindingKey(){throw be(bt)},async clearKeystore(){throw be(bt)},async signJwt(){throw be(bt)},async hashString(){throw be(bt)}};var cr;e.LogLevel=void 0,(cr=e.LogLevel||(e.LogLevel={}))[cr.Error=0]="Error",cr[cr.Warning=1]="Warning",cr[cr.Info=2]="Info",cr[cr.Verbose=3]="Verbose",cr[cr.Trace=4]="Trace";const hr=new Map;function lr(e,t){const r=Date.now();let n=hr.get(e);if(n)!function(e,t){hr.delete(e),hr.set(e,t)}(e,n);else if(n={logs:[],firstEventTime:r},hr.set(e,n),hr.size>50){const e=hr.keys().next().value;e&&hr.delete(e)}n.logs.push({...t,milliseconds:r-n.firstEventTime}),n.logs.length>500&&n.logs.shift()}class dr{constructor(t,r,n){this.level=e.LogLevel.Info;const o=t||dr.createDefaultLoggerOptions();this.localCallback=o.loggerCallback||(()=>{}),this.piiLoggingEnabled=o.piiLoggingEnabled||!1,this.level="number"==typeof o.logLevel?o.logLevel:e.LogLevel.Info,this.packageName=r||"",this.packageVersion=n||""}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info}}clone(e,t){return new dr({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,t)}logMessage(t,r){const n=r.correlationId;if(function(e){if(6!==e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!(r>="a"&&r<="z"||r>="A"&&r<="Z"||r>="0"&&r<="9"))return!1}return!0}(t)){lr(n,{hash:t,level:r.logLevel,containsPii:r.containsPii||!1,milliseconds:0})}if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;const o=`${`[${(new Date).toUTCString()}] : [${n}]`} : ${this.packageName}@${this.packageVersion} : ${e.LogLevel[r.logLevel]} - ${t}`;this.executeCallback(r.logLevel,o,r.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:r})}errorPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:r})}warning(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:r})}warningPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:r})}info(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:r})}infoPii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:r})}verbose(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:r})}verbosePii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:r})}trace(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:r})}tracePii(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:r})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}const ur="@azure/msal-common",gr="16.0.1",pr={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"};function mr(e,t){return!!e&&!!t&&e===t.split(".")[1]}function fr(e,t,r,n){if(n){const{oid:t,sub:r,tid:o,name:i,tfp:s,acr:a,preferred_username:c,upn:h,login_hint:l}=n,d=o||s||a||"";return{tenantId:d,localAccountId:t||r||"",name:i,username:c||h||"",loginHint:l,isHomeTenant:mr(d,e)}}return{tenantId:r,localAccountId:t,username:"",isHomeTenant:mr(r,e)}}function yr(e,t,r,n){let o=e;if(t){const{isHomeTenant:r,...n}=t;o={...e,...n}}if(r){const{isHomeTenant:t,...i}=fr(e.homeAccountId,e.localAccountId,e.tenantId,r);return o={...o,...i,idTokenClaims:r,idToken:n},o}return o}function wr(e,t){const r=function(e){if(!e)throw be(Qe);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw be(Ge);return t[2]}(e);try{const e=t(r);return JSON.parse(e)}catch(e){throw be(Ge)}}function Ir(e){if(!e.signin_state)return!1;const t=["kmsi","dvc_dmjd"];return e.signin_state.some((e=>t.includes(e.trim().toLowerCase())))}function Cr(e,t){if(0===t||Date.now()-3e5>e+t)throw be(it)}class vr{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw ve(Ee);e.includes("#")||(this._urlString=vr.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return ke.endsWith(t,"?")?t=t.slice(0,-1):ke.endsWith(t,"?/")&&(t=t.slice(0,-2)),ke.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw ve(_e)}if(!e.HostNameAndPort||!e.PathSegments)throw ve(_e);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw ve(Se)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return vr.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==A&&r[0]!==S||(r[0]=e),vr.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw ve(_e);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let n=r.AbsolutePath.split("/");return n=n.filter((e=>e&&e.length>0)),r.PathSegments=n,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw ve(_e);return r[2]}static getAbsoluteUrl(e,t){if("/"===e[0]){const r=new vr(t).getUrlComponents();return r.Protocol+"//"+r.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new vr(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}}const kr={endpointMetadata:[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}].reduce(((e,{host:t,issuerHost:r})=>(e[t]=function(e,t){return{token_endpoint:`https://${e}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${e}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${t}/{tenantid}/v2.0`,authorization_endpoint:`https://${e}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${e}/{tenantid}/oauth2/v2.0/logout`}}(t,r||t),e)),{}),instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}},Tr=kr.endpointMetadata,br=kr.instanceDiscoveryMetadata,Ar=new Set;function Sr(e,t,r,n,o){if(e.trace("1bmquz",t),r&&n){const o=_r(n,r);if(o)return e.trace("1fotbt",t),o.aliases;e.trace("14avvj",t)}return null}function _r(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.aliases.includes(t))return n}return null}br.metadata.forEach((e=>{e.aliases.forEach((e=>{Ar.add(e)}))}));const Er="cache_quota_exceeded";class Pr extends Error{constructor(e,t){const r=t||ye(e);super(r),Object.setPrototypeOf(this,Pr.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}}function Rr(e){return e instanceof Error?"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?new Pr(Er):new Pr(e.name,e.message):new Pr("cache_error_unknown")}function Or(e,t){if(!e)throw be(We);try{const r=t(e);return JSON.parse(r)}catch(e){throw be(Je)}}function Mr(e){if(!e)throw be(Je);const t=e.split(".",2);return{uid:t[0],utid:t.length<2?"":t[1]}}const xr=0,qr=1,Nr=2,Ur=3;function Lr(e){if(e){return e.tid||e.tfp||e.acr||null}return null}const Hr={AAD:"AAD",OIDC:"OIDC",EAR:"EAR"};function Dr(e){return{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,loginHint:e.loginHint,name:e.name,nativeAccountId:e.nativeAccountId,authorityType:e.authorityType,tenantProfiles:new Map((e.tenantProfiles||[]).map((e=>[e.tenantId,e]))),dataBoundary:e.dataBoundary}}function Fr(e,t,r){return{authorityType:e.authorityType||U,homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,nativeAccountId:e.nativeAccountId,realm:e.tenantId,environment:e.environment,username:e.username,loginHint:e.loginHint,name:e.name,cloudGraphHostName:t,msGraphHost:r,tenantProfiles:Array.from(e.tenantProfiles?.values()||[]),dataBoundary:e.dataBoundary}}function Kr(e,t,r,n,o,i){if(t!==qr&&t!==Nr){if(e)try{const t=Or(e,n.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}r.warning("1ub6wv",o)}return i?.sub||""}class Br{constructor(e,t,r,n,o){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(ur,gr),this.staticAuthorityOptions=o,this.performanceClient=n}getAllAccounts(e={},t){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,t),t,e)}getAccountInfoFilteredBy(e,t){const r=this.getAllAccounts(e,t);if(r.length>1){return r.sort((e=>e.idTokenClaims?-1:1))[0]}return 1===r.length?r[0]:null}getBaseAccountInfo(e,t){const r=this.getAccountsFilteredBy(e,t);return r.length>0?Dr(r[0]):null}buildTenantProfiles(e,t,r){return e.flatMap((e=>this.getTenantProfilesFromAccountEntity(e,t,r?.tenantId,r)))}getTenantedAccountInfoByFilter(e,t,r,n,o){let i,s=null;if(o&&!this.tenantProfileMatchesFilter(r,o))return null;const a=this.getIdToken(e,n,t,r.tenantId);return a&&(i=wr(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(i,o))?null:(s=yr(e,r,i,a?.secret),s)}getTenantProfilesFromAccountEntity(e,t,r,n){const o=Dr(e);let i=o.tenantProfiles||new Map;const s=this.getTokenKeys();if(r){const e=i.get(r);if(!e)return[];i=new Map([[r,e]])}const a=[];return i.forEach((e=>{const r=this.getTenantedAccountInfoByFilter(o,s,e,t,n);r&&a.push(r)})),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId))&&((!t.name||e.name===t.name)&&(void 0===t.isHomeTenant||e.isHomeTenant===t.isHomeTenant))}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,r,n){if(!e)throw be(ut);try{e.account&&await this.setAccount(e.account,t,r),e.idToken&&!1!==n?.idToken&&await this.setIdTokenCredential(e.idToken,t,r),e.accessToken&&!1!==n?.accessToken&&await this.saveAccessToken(e.accessToken,t,r),e.refreshToken&&!1!==n?.refreshToken&&await this.setRefreshTokenCredential(e.refreshToken,t,r),e.appMetadata&&this.setAppMetadata(e.appMetadata,t)}catch(e){throw this.commonLogger?.error("0j476p",t),e instanceof we?e:Rr(e)}}async saveAccessToken(e,t,r){const n={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},o=this.getTokenKeys(),i=_t.fromString(e.target);o.accessToken.forEach((e=>{if(!this.accessTokenKeyMatchesFilter(e,n,!1))return;const r=this.getAccessTokenCredential(e,t);if(r&&this.credentialMatchesFilter(r,n,t)){_t.fromString(r.target).intersectingScopeSets(i)&&this.removeAccessToken(e,t)}})),await this.setAccessTokenCredential(e,t,r)}getAccountsFilteredBy(e,t){const r=this.getAccountKeys(),n=[];return r.forEach((r=>{const o=this.getAccount(r,t);if(!o)return;if(e.homeAccountId&&!this.matchHomeAccountId(o,e.homeAccountId))return;if(e.username&&!this.matchUsername(o.username,e.username))return;if(e.environment&&!this.matchEnvironment(o,e.environment,t))return;if(e.realm&&!this.matchRealm(o,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(o,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(o,e.authorityType))return;const i={localAccountId:e?.localAccountId,name:e?.name},s=o.tenantProfiles?.filter((e=>this.tenantProfileMatchesFilter(e,i)));s&&0===s.length||n.push(o)})),n}credentialMatchesFilter(e,t,r){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment,r))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if(e.credentialType===L.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===G.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e,t){const r=this.getKeys(),n={};return r.forEach((r=>{if(!this.isAppMetadata(r))return;const o=this.getAppMetadata(r,t);o&&(e.environment&&!this.matchEnvironment(o,e.environment,t)||e.clientId&&!this.matchClientId(o,e.clientId)||(n[r]=o))})),n}getAuthorityMetadataByAlias(e,t){const r=this.getAuthorityMetadataKeys();let n=null;return r.forEach((r=>{if(!this.isAuthorityMetadata(r)||-1===r.indexOf(this.clientId))return;const o=this.getAuthorityMetadata(r,t);o&&-1!==o.aliases.indexOf(e)&&(n=o)})),n}removeAllAccounts(e){this.getAllAccounts({},e).forEach((t=>{this.removeAccount(t,e)}))}removeAccount(e,t){this.removeAccountContext(e,t);this.getAccountKeys().filter((t=>t.includes(e.homeAccountId)&&t.includes(e.environment))).forEach((e=>{this.removeItem(e,t),this.performanceClient.incrementFields({accountsRemoved:1},t)}))}removeAccountContext(e,t){const r=this.getTokenKeys(),n=t=>t.includes(e.homeAccountId)&&t.includes(e.environment);r.idToken.filter(n).forEach((e=>{this.removeIdToken(e,t)})),r.accessToken.filter(n).forEach((e=>{this.removeAccessToken(e,t)})),r.refreshToken.filter(n).forEach((e=>{this.removeRefreshToken(e,t)}))}removeAccessToken(e,t){const r=this.getAccessTokenCredential(e,t);if(r&&(this.removeItem(e,t),this.performanceClient.incrementFields({accessTokensRemoved:1},t),r.credentialType.toLowerCase()===L.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&r.tokenType===G.POP)){const e=r.keyId;e&&this.cryptoImpl.removeTokenBindingKey(e,t).catch((()=>{this.commonLogger.error("0cx291",t),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},t)}))}}removeAppMetadata(e){return this.getKeys().forEach((t=>{this.isAppMetadata(t)&&this.removeItem(t,e)})),!0}getIdToken(e,t,r,n){this.commonLogger.trace("1drz22",t);const o={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:L.ID_TOKEN,clientId:this.clientId,realm:n},i=this.getIdTokensByFilter(o,t,r),s=i.size;if(s<1)return this.commonLogger.info("1atvtd",t),null;if(s>1){let r=i;if(!n){const n=new Map;i.forEach(((t,r)=>{t.realm===e.tenantId&&n.set(r,t)}));const o=n.size;if(o<1)return this.commonLogger.info("0ooalx",t),i.values().next().value;if(1===o)return this.commonLogger.info("1eq2vc",t),n.values().next().value;r=n}return this.commonLogger.info("1ws328",t),r.forEach(((e,r)=>{this.removeIdToken(r,t)})),this.performanceClient.addFields({multiMatchedID:i.size},t),null}return this.commonLogger.info("1sm769",t),i.values().next().value}getIdTokensByFilter(e,t,r){const n=r&&r.idToken||this.getTokenKeys().idToken,o=new Map;return n.forEach((r=>{if(!this.idTokenKeyMatchesFilter(r,{clientId:this.clientId,...e}))return;const n=this.getIdTokenCredential(r,t);n&&this.credentialMatchesFilter(n,e,t)&&o.set(r,n)})),o}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.clientId||-1!==r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e,t){this.removeItem(e,t)}removeRefreshToken(e,t){this.removeItem(e,t)}getAccessToken(e,t,r,n){const o=t.correlationId;this.commonLogger.trace("1t7hz1",o);const i=_t.createSearchScopes(t.scopes),s=t.authenticationScheme||G.BEARER,a=s&&s.toLowerCase()!==G.BEARER.toLowerCase()?L.ACCESS_TOKEN_WITH_AUTH_SCHEME:L.ACCESS_TOKEN,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:a,clientId:this.clientId,realm:n||e.tenantId,target:i,tokenType:s,keyId:t.sshKid},h=r&&r.accessToken||this.getTokenKeys().accessToken,l=[];h.forEach((e=>{if(this.accessTokenKeyMatchesFilter(e,c,!0)){const t=this.getAccessTokenCredential(e,o);t&&this.credentialMatchesFilter(t,c,o)&&l.push(t)}}));const d=l.length;return d<1?(this.commonLogger.info("1nckna",o),null):d>1?(this.commonLogger.info("1wkfwp",o),l.forEach((e=>{this.removeAccessToken(this.generateCredentialKey(e),o)})),this.performanceClient.addFields({multiMatchedAT:l.length},o),null):(this.commonLogger.info("06yt98",o),l[0])}accessTokenKeyMatchesFilter(e,t,r){const n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(r&&!n.includes(e[t].toLowerCase()))return!1;if(!r&&n.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e,t){const r=this.getTokenKeys(),n=[];return r.accessToken.forEach((r=>{if(!this.accessTokenKeyMatchesFilter(r,e,!0))return;const o=this.getAccessTokenCredential(r,t);o&&this.credentialMatchesFilter(o,e,t)&&n.push(o)})),n}getRefreshToken(e,t,r,n){this.commonLogger.trace("0x53vi",r);const o=t?D:void 0,i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:L.REFRESH_TOKEN,clientId:this.clientId,familyId:o},s=n&&n.refreshToken||this.getTokenKeys().refreshToken,a=[];s.forEach((e=>{if(this.refreshTokenKeyMatchesFilter(e,i)){const t=this.getRefreshTokenCredential(e,r);t&&this.credentialMatchesFilter(t,i,r)&&a.push(t)}}));const c=a.length;return c<1?(this.commonLogger.info("0dlw11",r),null):(c>1&&this.performanceClient.addFields({multiMatchedRT:c},r),this.commonLogger.info("0wcnep",r),a[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.familyId||-1!==r.indexOf(t.familyId.toLowerCase()))&&(!(!t.familyId&&t.clientId&&-1===r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase())))}readAppMetadataFromCache(e,t){const r={environment:e,clientId:this.clientId},n=this.getAppMetadataFilteredBy(r,t),o=Object.keys(n).map((e=>n[e])),i=o.length;if(i<1)return null;if(i>1)throw be(st);return o[0]}isAppMetadataFOCI(e,t){const r=this.readAppMetadataFromCache(e,t);return!(!r||r.familyId!==D)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t,r){if(this.staticAuthorityOptions){const n=function(e,t,r){let n;const o=e.canonicalAuthority;if(o){const i=new vr(o).getUrlComponents().HostNameAndPort;n=Sr(t,r,i,e.cloudDiscoveryMetadata?.metadata)||Sr(t,r,i,br.metadata)||e.knownAuthorities}return n||[]}(this.staticAuthorityOptions,this.commonLogger,r);if(n.includes(t)&&n.includes(e.environment))return!0}const n=this.getAuthorityMetadataByAlias(t,r);return!!(n&&n.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||(e.preferred_username===t||e.upn===t)}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){if(e.credentialType!==L.ACCESS_TOKEN&&e.credentialType!==L.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;return _t.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(H)}isAuthorityMetadata(e){return-1!==e.indexOf(F)}generateAuthorityMetadataCacheKey(e){return`${F}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class zr extends Br{async setAccount(){throw be(bt)}getAccount(){throw be(bt)}async setIdTokenCredential(){throw be(bt)}getIdTokenCredential(){throw be(bt)}async setAccessTokenCredential(){throw be(bt)}getAccessTokenCredential(){throw be(bt)}async setRefreshTokenCredential(){throw be(bt)}getRefreshTokenCredential(){throw be(bt)}setAppMetadata(){throw be(bt)}getAppMetadata(){throw be(bt)}setServerTelemetry(){throw be(bt)}getServerTelemetry(){throw be(bt)}setAuthorityMetadata(){throw be(bt)}getAuthorityMetadata(){throw be(bt)}getAuthorityMetadataKeys(){throw be(bt)}setThrottlingCache(){throw be(bt)}getThrottlingCache(){throw be(bt)}removeItem(){throw be(bt)}getKeys(){throw be(bt)}getAccountKeys(){throw be(bt)}getTokenKeys(){throw be(bt)}generateCredentialKey(){throw be(bt)}generateAccountKey(){throw be(bt)}}const jr=1,$r=2,Jr=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT","unencryptedCacheCount","encryptedCacheExpiredCount","oldAccountCount","oldAccessCount","oldIdCount","oldRefreshCount","currAccountCount","currAccessCount","currIdCount","currRefreshCount","expiredCacheRemovedCount","upgradedCacheCount"]);class Wr{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:jr,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}const Gr={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},Qr={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:""},Vr={async sendGetRequestAsync(){throw be(bt)},async sendPostRequestAsync(){throw be(bt)}},Xr={sku:"msal.js.common",version:gr,cpu:"",os:""},Yr={clientSecret:"",clientAssertion:void 0},Zr={azureCloudInstance:pr.None,tenant:`${r}`},en={application:{appName:"",appVersion:""}};function tn({authOptions:e,systemOptions:t,loggerOptions:r,storageInterface:n,networkInterface:o,cryptoInterface:i,clientCredentials:s,libraryInfo:a,telemetry:c,serverTelemetryManager:h,persistencePlugin:l,serializableCache:d}){const u={...Qr,...r};return{authOptions:(g=e,{clientCapabilities:[],azureCloudOptions:Zr,instanceAware:!1,...g}),systemOptions:{...Gr,...t},loggerOptions:u,storageInterface:n||new zr(e.clientId,ar,new dr(u),new Wr),networkInterface:o||Vr,cryptoInterface:i||ar,clientCredentials:s||Yr,libraryInfo:{...Xr,...a},telemetry:{...en,...c},serverTelemetryManager:h||null,persistencePlugin:l||null,serializableCache:d||null};var g}function rn(e){return e.authOptions.authority.options.protocolMode===Hr.OIDC}class nn extends we{constructor(e,t,r,n,o){super(e,t,r),this.name="ServerError",this.errorNo=n,this.status=o,Object.setPrototypeOf(this,nn.prototype)}}const on="no_tokens_found",sn="native_account_unavailable",an="refresh_token_expired",cn="ux_not_allowed",hn="interaction_required",ln="consent_required",dn="login_required",un="bad_token";var gn=Object.freeze({__proto__:null,badToken:un,consentRequired:ln,interactionRequired:hn,loginRequired:dn,nativeAccountUnavailable:sn,noTokensFound:on,refreshTokenExpired:an,uxNotAllowed:cn});const pn=[hn,ln,dn,un,cn],mn=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed"];class fn extends we{constructor(e,t,r,n,o,i,s,a){super(e,t,r),Object.setPrototypeOf(this,fn.prototype),this.timestamp=n||"",this.traceId=o||"",this.correlationId=i||"",this.claims=s||"",this.name="InteractionRequiredAuthError",this.errorNo=a}}function yn(e,t,r){const n=!!e&&pn.indexOf(e)>-1,o=!!r&&mn.indexOf(r)>-1,i=!!t&&pn.some((e=>t.indexOf(e)>-1));return n||i||o}function wn(e,t){return new fn(e,t)}function In(e,t,r){const n=function(e,t){if(!e)throw be(mt);const r={id:e.createNewGuid()};t&&(r.meta=t);const n=JSON.stringify(r);return e.base64Encode(n)}(e,r);return t?`${n}|${t}`:n}function Cn(e,t){if(!e)throw be(mt);if(!t)throw be(et);try{const r=t.split("|"),n=r[0],o=r.length>1?r.slice(1).join("|"):"",i=e(n);return{userRequestState:o||"",libraryState:JSON.parse(i)}}catch(e){throw be(et)}}function vn(){return Math.round((new Date).getTime()/1e3)}function kn(e){return e.getTime()/1e3}function Tn(e){return e?new Date(1e3*Number(e)):new Date}function bn(e,t){const r=Number(e)||0;return vn()+t>r}function An(e,t){const r=Number(e)+24*t*60*60*1e3;return Date.now()>r}function Sn(e){return Number(e)>vn()}const _n="networkClientSendPostRequestAsync",En="refreshTokenClientAcquireTokenWithCachedRefreshToken",Pn="getAuthCodeUrl",Rn="handleCodeResponseFromServer",On="popTokenGenerateCnf",Mn="handleServerTokenResponse",xn="authorityUpdateMetadataWithRegionalInformation",qn="regionDiscoveryGetRegionFromIMDS",Nn=(e,t,r,n,o)=>(...i)=>{r.trace("1plfzx",o);const s=n.startMeasurement(t,o);if(o){const e=t+"CallCount";n.incrementFields({[e]:1},o)}try{const t=e(...i);return s.end({success:!0}),r.trace("1g8n6a",o),t}catch(e){r.trace("0cfd8i",o);try{r.trace(JSON.stringify(e),o)}catch(e){r.trace("00dty7",o)}throw s.end({success:!1},e),e}},Un=(e,t,r,n,o)=>(...i)=>{r.trace("1plfzx",o);const s=n.startMeasurement(t,o);if(o){const e=t+"CallCount";n.incrementFields({[e]:1},o)}return e(...i).then((e=>(r.trace("1g8n6a",o),s.end({success:!0}),e))).catch((e=>{r.trace("0cfd8i",o);try{r.trace(JSON.stringify(e),o)}catch(e){r.trace("00dty7",o)}throw s.end({success:!1},e),e}))},Ln="sw";class Hn{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){const r=await Un(this.generateKid.bind(this),On,t,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:n}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Ln}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,n){const{resourceRequestMethod:o,resourceRequestUri:i,shrClaims:s,shrNonce:a,shrOptions:c}=r,h=i?new vr(i):void 0,l=h?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:vn(),m:o?.toUpperCase(),u:l?.HostNameAndPort,nonce:a||this.cryptoUtils.createNewGuid(),p:l?.AbsolutePath,q:l?.QueryString?[[],l.QueryString]:void 0,client_claims:s||void 0,...n},t,c,r.correlationId)}}class Dn{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}function Fn(e,t,r,n,o){return{credentialType:L.ID_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,realm:o,lastUpdatedAt:Date.now().toString()}}function Kn(e,t,r,n,o,i,s,a,c,h,l,d,u){const g={homeAccountId:e,credentialType:L.ACCESS_TOKEN,secret:r,cachedAt:vn().toString(),expiresOn:s.toString(),extendedExpiresOn:a.toString(),environment:t,clientId:n,realm:o,target:i,tokenType:l||G.BEARER,lastUpdatedAt:Date.now().toString()};if(d&&(g.userAssertionHash=d),h&&(g.refreshOn=h.toString()),g.tokenType?.toLowerCase()!==G.BEARER.toLowerCase())switch(g.credentialType=L.ACCESS_TOKEN_WITH_AUTH_SCHEME,g.tokenType){case G.POP:const e=wr(r,c);if(!e?.cnf?.kid)throw be(yt);g.keyId=e.cnf.kid;break;case G.SSH:g.keyId=u}return g}function Bn(e,t,r,n,o,i,s){const a={credentialType:L.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,lastUpdatedAt:Date.now().toString()};return i&&(a.userAssertionHash=i),o&&(a.familyId=o),s&&(a.expiresOn=s.toString()),a}function zn(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function jn(e){return!!e&&(zn(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===L.ACCESS_TOKEN||e.credentialType===L.ACCESS_TOKEN_WITH_AUTH_SCHEME))}function $n(e){return!!e&&(zn(e)&&e.credentialType===L.REFRESH_TOKEN)}function Jn(){return vn()+86400}function Wn(e,t,r){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=r,e.jwks_uri=t.jwks_uri}function Gn(e,t,r){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=r}function Qn(e){return e.expiresAt<=vn()}class Vn{constructor(e,t,r,n,o,i,s){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.performanceClient=o,this.serializableCache=i,this.persistencePlugin=s}validateTokenResponse(e,t,r){if(e.error||e.error_description||e.suberror){const n=`Error(s): ${e.error_codes||h} - Timestamp: ${e.timestamp||h} - Description: ${e.error_description||h} - Correlation ID: ${e.correlation_id||h} - Trace ID: ${e.trace_id||h}`,o=e.error_codes?.length?e.error_codes[0]:void 0,i=new nn(e.error,n,e.suberror,o,e.status);if(r&&e.status&&e.status>=500&&e.status<=599)return void this.logger.warning("16ks7j",t);if(r&&e.status&&e.status>=400&&e.status<=499)return void this.logger.warning("0g61x3",t);if(yn(e.error,e.error_description,e.suberror))throw new fn(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",o);throw i}}async handleServerTokenResponse(e,t,r,n,o,i,s,a,c){let h,l;if(e.id_token){if(h=wr(e.id_token||"",this.cryptoObj.base64Decode),o&&o.nonce&&h.nonce!==o.nonce)throw be(nt);if(n.maxAge||0===n.maxAge){const e=h.auth_time;if(!e)throw be(ot);Cr(e,n.maxAge)}}this.homeAccountIdentifier=Kr(e.client_info||"",t.authorityType,this.logger,this.cryptoObj,n.correlationId,h),o&&o.state&&(l=Cn(this.cryptoObj.base64Decode,o.state)),e.key_id=e.key_id||n.sshKid||void 0;const d=this.generateCacheRecord(e,t,r,n,h,i,o);let u;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("0jbz5k",n.correlationId),u=new Dn(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(u)),s&&!a&&d.account){const e=this.cacheStorage.generateAccountKey(Dr(d.account));if(!this.cacheStorage.getAccount(e,n.correlationId))return this.logger.warning("1gmt66",n.correlationId),await Vn.generateAuthenticationResult(this.cryptoObj,t,d,!1,n,this.performanceClient,h,l,void 0,c)}await this.cacheStorage.saveCacheRecord(d,n.correlationId,Ir(h||{}),n.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&u&&(this.logger.verbose("1bh17u",n.correlationId),await this.persistencePlugin.afterCacheAccess(u))}return Vn.generateAuthenticationResult(this.cryptoObj,t,d,!1,n,this.performanceClient,h,l,e,c)}generateCacheRecord(e,t,r,n,o,i,s){const a=t.getPreferredCache();if(!a)throw be(gt);const c=Lr(o);let h,l;e.id_token&&o&&(h=Fn(this.homeAccountIdentifier,a,e.id_token,this.clientId,c||""),l=Xn(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,n.correlationId,o,e.client_info,a,c,s,void 0,this.logger));let d=null;if(e.access_token){const o=e.scope?_t.fromString(e.scope):new _t(n.scopes||[]),s=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,h=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,l=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,u=r+s,g=u+h,p=l&&l>0?r+l:void 0;d=Kn(this.homeAccountIdentifier,a,e.access_token,this.clientId,c||t.tenant||"",o.printScopes(),u,g,this.cryptoObj.base64Decode,p,e.token_type,i,e.key_id)}let u=null;if(e.refresh_token){let t;if(e.refresh_token_expires_in){t=r+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in),this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:t},n.correlationId)}u=Bn(this.homeAccountIdentifier,a,e.refresh_token,this.clientId,e.foci,i,t)}let g=null;return e.foci&&(g={clientId:this.clientId,environment:a,familyId:e.foci}),{account:l,idToken:h,accessToken:d,refreshToken:u,appMetadata:g}}static async generateAuthenticationResult(e,t,r,n,o,i,s,a,c,h){let l,d,u="",g=[],p=null,m="";if(r.accessToken){if(r.accessToken.tokenType!==G.POP||o.popKid)u=r.accessToken.secret;else{const t=new Hn(e,i),{secret:n,keyId:s}=r.accessToken;if(!s)throw be(vt);u=await t.signPopToken(n,s,o)}g=_t.fromString(r.accessToken.target).asArray(),p=Tn(r.accessToken.expiresOn),l=Tn(r.accessToken.extendedExpiresOn),r.accessToken.refreshOn&&(d=Tn(r.accessToken.refreshOn))}r.appMetadata&&(m=r.appMetadata.familyId===D?D:"");const f=s?.oid||s?.sub||"",y=s?.tid||"";c?.spa_accountid&&r.account&&(r.account.nativeAccountId=c?.spa_accountid);const w=r.account?yr(Dr(r.account),void 0,s,r.idToken?.secret):null;return{authority:t.canonicalAuthority,uniqueId:f,tenantId:y,scopes:g,account:w,idToken:r?.idToken?.secret||"",idTokenClaims:s||{},accessToken:u,fromCache:n,expiresOn:p,extExpiresOn:l,refreshOn:d,correlationId:o.correlationId,requestId:h||"",familyId:m,tokenType:r.accessToken?.tokenType||"",state:a?a.userRequestState:"",cloudGraphHostName:r.account?.cloudGraphHostName||"",msGraphHost:r.account?.msGraphHost||"",code:c?.spa_code,fromPlatformBroker:!1}}}function Xn(e,t,r,n,o,i,s,a,c,h,l,d){d?.verbose("09jz0t",o);const u=e.getAccountKeys().find((e=>e.startsWith(r)));let g=null;u&&(g=e.getAccount(u,o));const p=g||function(e,t,r){let n,o,i;n=t.authorityType===qr?"ADFS":t.protocolMode===Hr.OIDC?U:"MSSTS",e.clientInfo&&r&&(o=Or(e.clientInfo,r),o.xms_tdbr&&(i="EU"===o.xms_tdbr?"EU":"None"));const s=e.environment||t&&t.getPreferredCache();if(!s)throw be(gt);const a=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,c=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null,h=a||c||"",l=e.idTokenClaims?.login_hint,d=o?.utid||Lr(e.idTokenClaims)||"",u=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";let g;g=e.tenantProfiles?e.tenantProfiles:[fr(e.homeAccountId,u,d,e.idTokenClaims)];return{homeAccountId:e.homeAccountId,environment:s,realm:d,localAccountId:u,username:h,authorityType:n,loginHint:l,clientInfo:e.clientInfo,name:e.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:e.cloudGraphHostName,msGraphHost:e.msGraphHost,nativeAccountId:e.nativeAccountId,tenantProfiles:g,dataBoundary:i}}({homeAccountId:r,idTokenClaims:i,clientInfo:s,environment:a,cloudGraphHostName:h?.cloud_graph_host_name,msGraphHost:h?.msgraph_host,nativeAccountId:l},t,n),m=p.tenantProfiles||[],f=c||p.realm;if(f&&!m.find((e=>e.tenantId===f))){const e=fr(r,p.localAccountId,f,i);m.push(e)}return p.tenantProfiles=m,p}const Yn="home_account_id",Zn="UPN";async function eo(e,t,r){if("string"==typeof e)return e;return e({clientId:t,tokenEndpoint:r})}function to(e,t,r){return{clientId:e,authority:t.authority,scopes:t.scopes,homeAccountIdentifier:r,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid,embeddedClientId:t.embeddedClientId||t.extraParameters?.clientId}}class ro{static generateThrottlingStorageKey(e){return`${Q}.${JSON.stringify(e)}`}static preProcess(e,t,r){const n=ro.generateThrottlingStorageKey(t),o=e.getThrottlingCache(n,r);if(o){if(o.throttleTime<Date.now())return void e.removeItem(n,r);throw new nn(o.errorCodes?.join(" ")||"",o.errorMessage,o.subError)}}static postProcess(e,t,r,n){if(ro.checkResponseStatus(r)||ro.checkResponseForRetryAfter(r)){const o={throttleTime:ro.calculateThrottleTime(parseInt(r.headers[w])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(ro.generateThrottlingStorageKey(t),o,n)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&(e.headers.hasOwnProperty(w)&&(e.status<200||e.status>=300))}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||60),r+3600))}static removeThrottle(e,t,r,n){const o=to(t,r,n),i=this.generateThrottlingStorageKey(o);e.removeItem(i,r.correlationId)}}class no extends we{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,no.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function oo(e,t,r,n){return e.errorMessage=`${e.errorMessage}, additionalErrorInfo: error.name:${n?.name}, error.message:${n?.message}`,new no(e,t,r)}function io(e,t,r){const n={};if(n[f]="application/x-www-form-urlencoded;charset=utf-8",!t&&r)switch(r.type){case Yn:try{const e=Mr(r.credential);n[I]=`Oid:${e.uid}@${e.utid}`}catch(t){e.verbose("1qhtee","")}break;case Zn:n[I]=`UPN: ${r.credential}`}return n}function so(e,t,r,n){const o=new Map;return e.embeddedClientId&&tr(o,t,r),e.extraQueryParameters&&Qt(o,e.extraQueryParameters),Ht(o,e.correlationId),Et(o,e.correlationId,n),ir(o)}async function ao(e,t,r,n,o,i,s,a,c,h){const l=await async function(e,t,r,n,o,i,s,a){let c;ro.preProcess(o,e,n);try{c=await Un(i.sendPostRequestAsync.bind(i),_n,s,a,n)(t,r);const e=c.headers||{};a?.addFields({refreshTokenSize:c.body.refresh_token?.length||0,httpVerToken:e[T]||"",requestId:e[k]||""},n)}catch(e){if(e instanceof no){const t=e.responseHeaders;throw t&&a?.addFields({httpVerToken:t[T]||"",requestId:t[k]||"",contentTypeHeader:t[f]||void 0,contentLengthHeader:t[y]||void 0,httpStatus:e.httpStatus},n),e.error}throw e instanceof we?e:be(Xe)}return ro.postProcess(o,e,c,n),c}(n,e,{body:t,headers:r},o,i,s,a,c);return h&&l.status<500&&429!==l.status&&h.clearTelemetryCache(),l}class co{constructor(e,t,r,n){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=n}async detectRegion(e,t){let r=e;if(r)t.region_source=X;else{const e=co.IMDS_OPTIONS;try{const n=await Un(this.getRegionFromIMDS.bind(this),qn,this.logger,this.performanceClient,this.correlationId)("2020-06-01",e);if(200===n.status&&(r=n.body,t.region_source=Y),400===n.status){const n=await Un(this.getCurrentVersion.bind(this),"regionDiscoveryGetCurrentVersion",this.logger,this.performanceClient,this.correlationId)(e);if(!n)return t.region_source=V,null;const o=await Un(this.getRegionFromIMDS.bind(this),qn,this.logger,this.performanceClient,this.correlationId)(n,e);200===o.status&&(r=o.body,t.region_source=Y)}}catch(e){return t.region_source=V,null}}return r||(t.region_source=V),r||null}async getRegionFromIMDS(e,t){return this.networkInterface.sendGetRequestAsync(`${l}?api-version=${e}&format=text`,t,2e3)}async getCurrentVersion(e){try{const t=await this.networkInterface.sendGetRequestAsync(`${l}?format=json`,e);return 400===t.status&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?t.body["newest-versions"][0]:null}catch(e){return null}}}co.IMDS_OPTIONS={headers:{Metadata:"true"}};class ho{constructor(e,t,r,n,o,i,s,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=s,this.correlationId=i,this.managedIdentity=a||!1,this.regionDiscovery=new co(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(o))return Ur;const t=e.PathSegments;if(t.length)switch(t[0].toLowerCase()){case"adfs":return qr;case"dstsv2":return Nr}return xr}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new vr(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw be(Ve)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw be(Ve)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw be(Ve)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw be(Ct);return this.replacePath(this.metadata.end_session_endpoint)}throw be(Ve)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw be(Ve)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw be(Ve)}canReplaceTenant(e){return 1===e.PathSegments.length&&!ho.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===xr&&this.protocolMode!==Hr.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new vr(this.metadata.canonical_authority).getUrlComponents(),n=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(((e,o)=>{let i=n[o];if(0===o&&this.canReplaceTenant(r)){const e=new vr(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];i!==e&&(this.logger.verbose("1q3g2x",this.correlationId),i=e)}e!==i&&(t=t.replace(`/${i}/`,`/${e}/`))})),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===qr||this.protocolMode===Hr.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){const e=this.getCurrentMetadataEntity(),t=await Un(this.updateCloudDiscoveryMetadata.bind(this),"authorityUpdateCloudDiscoveryMetadata",this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await Un(this.updateEndpointMetadata.bind(this),"authorityUpdateEndpointMetadata",this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Jn(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==B&&r?.source!==B&&(e.expiresAt=Jn(),e.canonical_authority=this.canonicalAuthority);const n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(n,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===j&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata){Wn(e,await Un(this.updateMetadataWithRegionalInformation.bind(this),xn,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await Un(this.getEndpointMetadataFromNetwork.bind(this),"authorityGetEndpointMetadataFromNetwork",this.logger,this.performanceClient,this.correlationId)();if(r)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(r=await Un(this.updateMetadataWithRegionalInformation.bind(this),xn,this.logger,this.performanceClient,this.correlationId)(r)),Wn(e,r,!0),z;throw be(Ye,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("1fi0kc",this.correlationId);const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("06t0uj",this.correlationId),Wn(e,t,!1),{source:K};this.logger.verbose("151k0p",this.correlationId);const r=this.getEndpointMetadataFromHardcodedValues();if(r)return Wn(e,r,!1),{source:j,metadata:r};this.logger.verbose("1imop5",this.correlationId);const n=Qn(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!n?(this.logger.verbose("16uq31",""),{source:B}):(n&&this.logger.verbose("0uoibc",""),null)}isAuthoritySameType(e){return new vr(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw ve(Ne)}return null}async getEndpointMetadataFromNetwork(){const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose("1y65x6",this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(t,e),n=function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")}(r.body);return n?r.body:(this.logger.verbose("1koyv8",this.correlationId),null)}catch(e){return this.logger.verbose("0a9wik",this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in Tr?Tr[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){const t=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(t){if("TryAutoDetect"!==t)return this.regionDiscoveryMetadata.region_outcome=Z,this.regionDiscoveryMetadata.region_used=t,ho.replaceWithRegionalInformation(e,t);const r=await Un(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),"regionDiscoveryDetectRegion",this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(r)return this.regionDiscoveryMetadata.region_outcome=ee,this.regionDiscoveryMetadata.region_used=r,ho.replaceWithRegionalInformation(e,r);this.regionDiscoveryMetadata.region_outcome=te}return e}async updateCloudDiscoveryMetadata(e){const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await Un(this.getCloudDiscoveryMetadataFromNetwork.bind(this),"authorityGetCloudDiscoveryMetadataFromNetwork",this.logger,this.performanceClient,this.correlationId)();if(r)return Gn(e,r,!0),z;throw ve(Ue)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("0jhlgt",this.correlationId),this.logger.verbosePii("1fy7uz",this.correlationId),this.logger.verbosePii("08zabj",this.correlationId),this.logger.verbosePii("1o1kv3",this.correlationId);const t=this.getCloudDiscoveryMetadataFromConfig();if(t)return this.logger.verbose("1nakio",this.correlationId),Gn(e,t,!1),K;this.logger.verbose("1x74aj",this.correlationId);const r=(n=this.hostnameAndPort,_r(br.metadata,n));var n;if(r)return this.logger.verbose("0by47c",this.correlationId),Gn(e,r,!1),j;this.logger.verbose("0r2fzy",this.correlationId);const o=Qn(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("1uffgh",""),B):(o&&this.logger.verbose("0uoibc",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Ur)return this.logger.verbose("04y84h",this.correlationId),ho.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("0gszr3",this.correlationId);try{this.logger.verbose("1iifkx",this.correlationId);const e=_r(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("0q67e3",""),e)return this.logger.verbose("0hzfao",this.correlationId),e;this.logger.verbose("1ajz3u",this.correlationId)}catch(e){throw this.logger.verbose("1wq5tu",this.correlationId),ve(qe)}}return this.isInKnownAuthorities()?(this.logger.verbose("0mt9al",this.correlationId),ho.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){const e=`${n}${this.canonicalAuthority}oauth2/v2.0/authorize`,t={};let r=null;try{const n=await this.networkInterface.sendGetRequestAsync(e,t);let o,i;if(function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(n.body))o=n.body,i=o.metadata,this.logger.verbosePii("1vglyt",this.correlationId);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(n.body))return this.logger.error("0768g0",this.correlationId),null;if(this.logger.warning("062uto",this.correlationId),o=n.body,"invalid_instance"===o.error)return this.logger.error("1x90tm",this.correlationId),null;this.logger.warning("0wchdm",this.correlationId),this.logger.warning("1s5mpv",this.correlationId),this.logger.warning("1yhqpw",this.correlationId),i=[]}this.logger.verbose("1lrobr",this.correlationId),r=_r(i,this.hostnameAndPort)}catch(e){return e instanceof we?this.logger.error("0vwhc7",this.correlationId):this.logger.error("0s2z41",this.correlationId),null}return r||(this.logger.warning("0jp28q",this.correlationId),this.logger.verbose("130sd8",this.correlationId),r=ho.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter((e=>e&&vr.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort)).length>0}static generateAuthority(e,t){let n;if(t&&t.azureCloudInstance!==pr.None){const e=t.tenant?t.tenant:r;n=`${t.azureCloudInstance}/${e}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return"login.microsoftonline.com";if(this.discoveryComplete())return this.metadata.preferred_cache;throw be(Ve)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Ar.has(e)}static isPublicCloudAuthority(e){return d.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const n=new vr(e);n.validateAsUri();const o=n.getUrlComponents();let i=`${t}.${o.HostNameAndPort}`;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=`${t}.login.microsoft.com`);const s=vr.constructAuthorityUriFromObject({...n.getUrlComponents(),HostNameAndPort:i}).urlString;return r?`${s}?${r}`:s}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=ho.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=ho.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=ho.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const r=new vr(e).getUrlComponents();if(0===r.PathSegments.length&&r.HostNameAndPort.endsWith(o)){t=`${t}${r.HostNameAndPort.split(".")[0]}.onmicrosoft.com`}return t}}function lo(e){return e.endsWith("/")?e:`${e}/`}function uo(e){const t=e.cloudDiscoveryMetadata;let r;if(t)try{r=JSON.parse(t)}catch(e){throw ve(qe)}return{canonicalAuthority:e.authority?lo(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:r}}async function go(e,t,r,n,o,i,s){const a=ho.transformCIAMAuthority(lo(e)),c=new ho(a,t,r,n,o,i,s);try{return await Un(c.resolveEndpointsAsync.bind(c),"authorityResolveEndpointsAsync",o,s,i)(),c}catch(e){throw be(Ve)}}ho.reservedTenantDomains=new Set(["{tenant}","{tenantid}",A,_,S]);class po{constructor(e,t){this.includeRedirectUri=!0,this.config=tn(e),this.logger=new dr(this.config.loggerOptions,ur,gr),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,t){if(!e.code)throw be(at);t&&t.cloud_instance_host_name&&await Un(this.updateTokenEndpointAuthority.bind(this),"updateTokenEndpointAuthority",this.logger,this.performanceClient,e.correlationId)(t.cloud_instance_host_name,e.correlationId);const r=vn(),n=await Un(this.executeTokenRequest.bind(this),"authClientExecuteTokenRequest",this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),o=n.headers?.[k],i=new Vn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return i.validateTokenResponse(n.body,e.correlationId),Un(i.handleServerTokenResponse.bind(i),Mn,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,r,e,t,void 0,void 0,void 0,o)}getLogoutUri(e){if(!e)throw ve(Me);const t=this.createLogoutUrlQueryString(e);return vr.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t,r){const n=so(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),o=vr.appendQueryString(e.tokenEndpoint,n),i=await Un(this.createTokenRequestBody.bind(this),"authClientCreateTokenRequestBody",this.logger,this.performanceClient,t.correlationId)(t);let s;if(t.clientInfo)try{const e=Or(t.clientInfo,this.cryptoUtils.base64Decode);s={credential:`${e.uid}.${e.utid}`,type:Yn}}catch(e){this.logger.verbose("0wznt3",t.correlationId)}const a=io(this.logger,this.config.systemOptions.preventCorsPreflight,s||t.ccsCredential),c=to(this.config.authOptions.clientId,t);return Un(ao,"authorizationCodeClientExecutePostToTokenEndpoint",this.logger,this.performanceClient,t.correlationId)(o,i,a,c,t.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,r)}async createTokenRequestBody(e){const t=new Map;if(Ot(t,e.embeddedClientId||e.extraParameters?.[ce]||this.config.authOptions.clientId),this.includeRedirectUri)Mt(t,e.redirectUri);else if(!e.redirectUri)throw ve(Ae);if(Rt(t,e.scopes,!0,this.oidcDefaultScopes),function(e,t){e.set("code",t)}(t,e.code),Dt(t,this.config.libraryInfo),Ft(t,this.config.telemetry.application),er(t),this.serverTelemetryManager&&!rn(this.config)&&Zt(t,this.serverTelemetryManager),e.codeVerifier&&function(e,t){e.set("code_verifier",t)}(t,e.codeVerifier),this.config.clientCredentials.clientSecret&&zt(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;jt(t,await eo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),$t(t,r.assertionType)}if(Jt(t,q),Wt(t),e.authenticationScheme===G.POP){const r=new Hn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await Un(r.generateCnf.bind(r),On,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}Xt(t,n)}else if(e.authenticationScheme===G.SSH){if(!e.sshJwk)throw ve(Le);Yt(t,e.sshJwk)}let r;if((!ke.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Lt(t,e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Or(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${t.uid}.${t.utid}`,type:Yn}}catch(t){this.logger.verbose("0wznt3",e.correlationId)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Yn:try{Nt(t,Mr(r.credential))}catch(t){this.logger.verbose("1qhtee",e.correlationId)}break;case Zn:qt(t,r.credential)}return e.embeddedClientId&&tr(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&Qt(t,e.extraParameters),!e.enableSpaAuthorizationCode||e.extraParameters&&e.extraParameters[ue]||Qt(t,{[ue]:"1"}),Et(t,e.correlationId,this.performanceClient),ir(t)}createLogoutUrlQueryString(e){const t=new Map;return e.postLogoutRedirectUri&&function(e,t){e.set("post_logout_redirect_uri",t)}(t,e.postLogoutRedirectUri),e.correlationId&&Ht(t,e.correlationId),e.idTokenHint&&function(e,t){e.set("id_token_hint",t)}(t,e.idTokenHint),e.state&&Kt(t,e.state),e.logoutHint&&function(e,t){e.set("logout_hint",t)}(t,e.logoutHint),e.extraQueryParameters&&Qt(t,e.extraQueryParameters),this.config.authOptions.instanceAware&&Gt(t),ir(t)}async updateTokenEndpointAuthority(e,t){const r=`https://${e}/${this.authority.tenant}/`,n=await go(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=n}}class mo{constructor(e,t){this.config=tn(e),this.logger=new dr(this.config.loggerOptions,ur,gr),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}async acquireToken(e){const t=vn(),r=await Un(this.executeTokenRequest.bind(this),"refreshTokenClientExecuteTokenRequest",this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=r.headers?.[k],o=new Vn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(r.body,e.correlationId),Un(o.handleServerTokenResponse.bind(o),Mn,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw ve(Oe);if(!e.account)throw be(dt);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await Un(this.acquireTokenWithCachedRefreshToken.bind(this),En,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const r=t instanceof fn&&t.errorCode===on,n=t instanceof nn&&"invalid_grant"===t.errorCode&&"client_mismatch"===t.subError;if(r||n)return Un(this.acquireTokenWithCachedRefreshToken.bind(this),En,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return Un(this.acquireTokenWithCachedRefreshToken.bind(this),En,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){const r=Nn(this.cacheManager.getRefreshToken.bind(this.cacheManager),"cacheManagerGetRefreshToken",this.logger,this.performanceClient,e.correlationId)(e.account,t,e.correlationId,void 0);if(!r)throw wn(on);if(r.expiresOn){const t=e.refreshTokenExpirationOffsetSeconds||300;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(r.expiresOn),rtOffsetSeconds:t},e.correlationId),bn(r.expiresOn,t))throw wn(an)}const n={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||G.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Yn}};try{return await Un(this.acquireToken.bind(this),"refreshTokenClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(n)}catch(t){if(t instanceof fn&&t.subError===un){this.logger.verbose("1pg3ap",e.correlationId);const t=this.cacheManager.generateCredentialKey(r);this.cacheManager.removeRefreshToken(t,e.correlationId)}throw t}}async executeTokenRequest(e,t){const r=so(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),n=vr.appendQueryString(t.tokenEndpoint,r),o=await Un(this.createTokenRequestBody.bind(this),"refreshTokenClientCreateTokenRequestBody",this.logger,this.performanceClient,e.correlationId)(e),i=io(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),s=to(this.config.authOptions.clientId,e);return Un(ao,"refreshTokenClientExecutePostToTokenEndpoint",this.logger,this.performanceClient,e.correlationId)(n,o,i,s,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){const t=new Map;if(Ot(t,e.embeddedClientId||e.extraParameters?.[ce]||this.config.authOptions.clientId),e.redirectUri&&Mt(t,e.redirectUri),Rt(t,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),Jt(t,N),Wt(t),Dt(t,this.config.libraryInfo),Ft(t,this.config.telemetry.application),er(t),this.serverTelemetryManager&&!rn(this.config)&&Zt(t,this.serverTelemetryManager),function(e,t){e.set("refresh_token",t)}(t,e.refreshToken),this.config.clientCredentials.clientSecret&&zt(t,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;jt(t,await eo(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),$t(t,r.assertionType)}if(e.authenticationScheme===G.POP){const r=new Hn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await Un(r.generateCnf.bind(r),On,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}Xt(t,n)}else if(e.authenticationScheme===G.SSH){if(!e.sshJwk)throw ve(Le);Yt(t,e.sshJwk)}if((!ke.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Lt(t,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Yn:try{Nt(t,Mr(e.ccsCredential.credential))}catch(t){this.logger.verbose("1qhtee",e.correlationId)}break;case Zn:qt(t,e.ccsCredential.credential)}return e.embeddedClientId&&tr(t,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&Qt(t,{...e.extraParameters}),Et(t,e.correlationId,this.performanceClient),ir(t)}}class fo{constructor(e,t){this.config=tn(e),this.logger=new dr(this.config.loggerOptions,ur,gr),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}async acquireCachedToken(e){let t=re;if(e.forceRefresh||!ke.isEmptyObj(e.claims))throw this.setCacheOutcome(ne,e.correlationId),be(ft);if(!e.account)throw be(dt);const r=e.account.tenantId||function(e){const t=new vr(e).getUrlComponents(),r=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(r){case A:case S:case _:return;default:return r}}(e.authority),n=this.cacheManager.getTokenKeys(),o=this.cacheManager.getAccessToken(e.account,e,n,r);if(!o)throw this.setCacheOutcome(oe,e.correlationId),be(ft);if(Sn(o.cachedAt)||bn(o.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(ie,e.correlationId),be(ft);o.refreshOn&&bn(o.refreshOn,0)&&(t=se);const i=e.authority||this.authority.getPreferredCache(),s={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:o,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,n,r),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(i,e.correlationId)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Un(this.generateResultFromCacheRecord.bind(this),"silentFlowClientGenerateResultFromCacheRecord",this.logger,this.performanceClient,e.correlationId)(s,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==re&&this.logger.info("09ingz",t)}async generateResultFromCacheRecord(e,t){let r;if(e.idToken&&(r=wr(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=r?.auth_time;if(!e)throw be(ot);Cr(e,t.maxAge)}return Vn.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,this.performanceClient,r)}}const yo={sendGetRequestAsync:()=>Promise.reject(be(bt)),sendPostRequestAsync:()=>Promise.reject(be(bt))};function wo(e,t,r,n){const o=t.correlationId,i=new Map;Ot(i,t.embeddedClientId||t.extraQueryParameters?.[ce]||e.clientId);if(Rt(i,[...t.scopes||[],...t.extraScopesToConsent||[]],!0,e.authority.options.OIDCOptions?.defaultScopes),Mt(i,t.redirectUri),Ht(i,o),function(e,t){e.set("response_mode",t||x.QUERY)}(i,t.responseMode),Wt(i),t.prompt&&(!function(e,t){e.set("prompt",t)}(i,t.prompt),n?.addFields({prompt:t.prompt},o)),t.domainHint&&(!function(e,t){e.set("domain_hint",t)}(i,t.domainHint),n?.addFields({domainHintFromRequest:!0},o)),t.prompt!==R.SELECT_ACCOUNT)if(t.sid&&t.prompt===R.NONE)r.verbose("1tvqyx",t.correlationId),Ut(i,t.sid),n?.addFields({sidFromRequest:!0},o);else if(t.account){const e=(s=t.account,s.idTokenClaims?.sid||null);let a=function(e){return e.loginHint||e.idTokenClaims?.login_hint||null}(t.account);if(a&&t.domainHint&&(r.warning("0wkg3v",t.correlationId),a=null),a){r.verbose("1eyfsw",t.correlationId),xt(i,a),n?.addFields({loginHintFromClaim:!0},o);try{Nt(i,Mr(t.account.homeAccountId))}catch(e){r.verbose("12ugck",t.correlationId)}}else if(e&&t.prompt===R.NONE){r.verbose("1rmd8s",t.correlationId),Ut(i,e),n?.addFields({sidFromClaim:!0},o);try{Nt(i,Mr(t.account.homeAccountId))}catch(e){r.verbose("12ugck",t.correlationId)}}else if(t.loginHint)r.verbose("0y3007",t.correlationId),xt(i,t.loginHint),qt(i,t.loginHint),n?.addFields({loginHintFromRequest:!0},o);else if(t.account.username){r.verbose("02f507",t.correlationId),xt(i,t.account.username),n?.addFields({loginHintFromUpn:!0},o);try{Nt(i,Mr(t.account.homeAccountId))}catch(e){r.verbose("12ugck",t.correlationId)}}}else t.loginHint&&(r.verbose("0g01ey",t.correlationId),xt(i,t.loginHint),qt(i,t.loginHint),n?.addFields({loginHintFromRequest:!0},o));else r.verbose("169k9v",t.correlationId);var s;return t.nonce&&function(e,t){e.set("nonce",t)}(i,t.nonce),t.state&&Kt(i,t.state),(t.claims||e.clientCapabilities&&e.clientCapabilities.length>0)&&Lt(i,t.claims,e.clientCapabilities),t.embeddedClientId&&tr(i,e.clientId,e.redirectUri),!e.instanceAware||t.extraQueryParameters&&Object.keys(t.extraQueryParameters).includes(fe)||Gt(i),i}function Io(e,t){const r=ir(t);return vr.appendQueryString(e.authorizationEndpoint,r)}function Co(e,t){if(!e.state||!t)throw e.state?be(rt,"Cached State"):be(rt,"Server State");let r,n;try{r=decodeURIComponent(e.state)}catch(t){throw be(et,e.state)}try{n=decodeURIComponent(t)}catch(t){throw be(et,e.state)}if(r!==n)throw be(tt);if(e.error||e.error_description||e.suberror){const t=function(e){const t="code=",r=e.error_uri?.lastIndexOf(t);return r&&r>=0?e.error_uri?.substring(r+t.length):void 0}(e);if(yn(e.error,e.error_description,e.suberror))throw new fn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new nn(e.error||"",e.error_description,e.suberror,t)}}const vo="unexpected_error";var ko=Object.freeze({__proto__:null,postRequestFailed:"post_request_failed",unexpectedError:vo});function To(e){const{skus:t,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:i}=e,s=new Map([[0,[r,n]],[2,[o,i]]]);let a=[];if(t?.length){if(a=t.split(","),a.length<4)return t}else a=Array.from({length:4},(()=>"|"));return s.forEach(((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:r,skuName:n,skuVersion:o}=e;if(r>=t.length)return;t[r]=[n,o].join("|")}({skuArr:a,index:t,skuName:e[0],skuVersion:e[1]})})),a.join(",")}class bo{constructor(e,t){this.cacheOutcome=re,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=J+"-"+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${W}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r?.length&&t.push(`broker_error=${r}`);const n=t.join(W),o=[e,this.getRegionDiscoveryFields()].join(W);return[$,o,n].join("|")}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=bo.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(W),n=e.errors.slice(0,t).join(W),o=e.errors.length,i=[o,t<o?"1":"0"].join(W);return[$,e.cacheHits,r,n,i].join("|")}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=50&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof we?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push("unknown_error"),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=bo.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const r={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r,this.correlationId)}}static maxErrorsToSend(e){let t,r=0,n=0;const o=e.errors.length;for(t=0;t<o;t++){const o=e.failedRequests[2*t]||"",i=e.failedRequests[2*t+1]||"",s=e.errors[t]||"";if(n+=o.toString().length+i.toString().length+s.length+3,!(n<330))break;r+=1}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t,this.correlationId)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId)}static makeExtraSkuString(e){return To(e)}}class Ao extends we{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,Ao.prototype)}}function So(e){return new Ao(e)}class _o{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw So("missing_kid_error");if(!e.alg)throw So("missing_alg_error");const t=new _o({typ:e.typ||ae.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}function Eo(e,t,r,n=5){if(e instanceof Error)return e instanceof we?(r.errorCode=e.errorCode,r.subErrorCode=e.subError,void((e instanceof nn||e instanceof fn)&&(r.serverErrorNo=e.errorNo))):void(e instanceof Pr?r.errorCode=e.errorCode:r.errorStack?.length?t.trace("0lmqrh",r.correlationId):e.stack?.length?(e.stack&&(r.errorStack=function(e,t){if(t<0)return[];const r=e.split("\n")||[],n=[],o=r[0];o.startsWith("TypeError: Cannot read property")||o.startsWith("TypeError: Cannot read properties of")||o.startsWith("TypeError: Cannot set property")||o.startsWith("TypeError: Cannot set properties of")||o.endsWith("is not a function")?n.push(Po(o)):(o.startsWith("SyntaxError")||o.startsWith("TypeError"))&&n.push(Po(o.replace(/['].*[']|["].*["]/g,"<redacted>")));for(let e=1;e<r.length&&!(n.length>=t);e++){const t=r[e];n.push(Po(t))}return n}(e.stack,n)),r.errorName=e.name):t.trace("1cnpwa",r.correlationId));t.trace("0gcyox",r.correlationId)}function Po(e){const t=e.lastIndexOf(" ")+1;if(t<1)return e;const r=e.substring(t);let n=r.lastIndexOf("/");return n=n<0?r.lastIndexOf("\\"):n,n>=0?(e.substring(0,t)+"("+r.substring(n+1)+(")"===r.charAt(r.length-1)?"":")")).trimStart():e.trimStart()}class Ro{constructor(e,t,r,n,o,i,s){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.eventStack=new Map,this.intFields=s||new Set;for(const e of Jr)this.intFields.add(e)}startMeasurement(e,t){const r=t||this.generateId(),n={eventId:this.generateId(),status:jr,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:r,appName:this.applicationTelemetry?.appName,appVersion:this.applicationTelemetry?.appVersion};var o,i;return this.cacheEventByCorrelationId(n),o=n,(i=this.eventStack.get(r))&&i.push({name:o.name}),{end:(e,t,r)=>this.endMeasurement({...n,...e},t,r),discard:()=>this.discardMeasurements(n.correlationId),add:e=>this.addFields(e,n.correlationId),increment:e=>this.incrementFields(e,n.correlationId),event:n}}endMeasurement(e,t,r){const n=this.eventsByCorrelationId.get(e.correlationId);if(!n)return this.logger.trace("0k9ti8",e.correlationId),null;const o=e.eventId===n.eventId;e.durationMs=Math.round(e.durationMs||this.getDurationMs(e.startTimeMs));const i=JSON.stringify(function(e,t,r){if(!t?.length)return;const n=e=>e.length?e[e.length-1]:void 0,o=e.name,i=n(t);if(i?.name!==o)return;const s=t?.pop();if(!s)return;const a=r instanceof we?r.errorCode:r instanceof Error?r.name:void 0,c=r instanceof we?r.subError:void 0;a&&s.childErr!==a&&(s.err=a,c&&(s.subErr=c)),delete s.name,delete s.childErr;const h={...s,dur:e.durationMs};e.success||(h.fail=1);const l=n(t);if(!l)return{[o]:h};let d;if(a&&(l.childErr=a),l[o]){const e=Object.keys(l).filter((e=>e.startsWith(o))).length;d=`${o}_${e+1}`}else d=o;return l[d]=h,l}(e,this.eventStack.get(n.correlationId),t));if(o?this.discardMeasurements(n.correlationId):n.incompleteSubMeasurements?.delete(e.eventId),t&&Eo(t,this.logger,n),!o)return n[e.name+"DurationMs"]=Math.floor(e.durationMs),{...n};o&&!t&&(n.errorCode||n.subErrorCode)&&(this.logger.trace("1fm1tm",e.correlationId),n.errorCode=void 0,n.subErrorCode=void 0);let s={...n,...e},a=0;s.incompleteSubMeasurements?.forEach((e=>{this.logger.trace("0nxk52",s.correlationId),a++})),s.incompleteSubMeasurements=void 0;const c=function(e){const t=[];for(const r of["",e]){const e=hr.get(r);t.push(...e?.logs??[]),hr.delete(r)}return t}(e.correlationId).map((e=>`${e.milliseconds},${e.hash}`)).join(";");return s={...s,status:$r,incompleteSubsCount:a,context:i,logs:c},r&&(s.accountType=function(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}(r),s.dataBoundary=r.dataBoundary),this.truncateIntegralFields(s),this.emitEvents([s],e.correlationId),s}addFields(e,t){const r=this.eventsByCorrelationId.get(t);r?this.eventsByCorrelationId.set(t,{...r,...e}):this.logger.trace("0thl6s",t)}incrementFields(e,t){const r=this.eventsByCorrelationId.get(t);if(r)for(const t in e){if(r.hasOwnProperty(t)){if(isNaN(Number(r[t])))return}else r[t]=0;r[t]+=e[t]}else this.logger.trace("0thl6s",t)}cacheEventByCorrelationId(e){const t=this.eventsByCorrelationId.get(e.correlationId);t?(t.incompleteSubMeasurements=t.incompleteSubMeasurements||new Map,t.incompleteSubMeasurements.set(e.eventId,{name:e.name,startTimeMs:e.startTimeMs})):(this.eventsByCorrelationId.set(e.correlationId,{...e}),this.eventStack.set(e.correlationId,[]))}discardMeasurements(e){this.eventsByCorrelationId.delete(e),this.eventStack.delete(e)}addPerformanceCallback(e){for(const[t,r]of this.callbacks)if(r.toString()===e.toString())return this.logger.warning("1eap5p",""),t;const t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("0c9ujz",""),t}removePerformanceCallback(e){const t=this.callbacks.delete(e);return t?this.logger.verbose("0253if",""):this.logger.verbose("0iqk07",""),t}emitEvents(e,t){this.logger.verbose("11jb1y",t),this.callbacks.forEach(((r,n)=>{this.logger.trace("0p2pjl",t),r.apply(null,[e])}))}truncateIntegralFields(e){this.intFields.forEach((t=>{t in e&&"number"==typeof e[t]&&(e[t]=Math.floor(e[t]))}))}getDurationMs(e){const t=Date.now()-e;return t<0?t:0}}const Oo="pkce_not_created",Mo="ear_jwk_empty",xo="ear_jwe_empty",qo="crypto_nonexistent",No="empty_navigate_uri",Uo="hash_empty_error",Lo="no_state_in_hash",Ho="hash_does_not_contain_known_properties",Do="unable_to_parse_state",Fo="state_interaction_type_mismatch",Ko="interaction_in_progress",Bo="interaction_in_progress_cancelled",zo="popup_window_error",jo="empty_window_error",$o="user_cancelled",Jo="redirect_bridge_empty_response",Wo="redirect_in_iframe",Go="block_iframe_reload",Qo="block_nested_popups",Vo="silent_logout_unsupported",Xo="no_account_error",Yo="no_token_request_cache_error",Zo="unable_to_parse_token_request_cache_error",ei="non_browser_environment",ti="database_not_open",ri="no_network_connectivity",ni="post_request_failed",oi="get_request_failed",ii="failed_to_parse_response",si="unable_to_load_token",ai="crypto_key_not_found",ci="auth_code_required",hi="auth_code_or_nativeAccountId_required",li="spa_code_and_nativeAccountId_present",di="database_unavailable",ui="unable_to_acquire_token_from_native_platform",gi="native_handshake_timeout",pi="native_extension_not_installed",mi="native_connection_not_established",fi="uninitialized_public_client_application",yi="native_prompt_not_supported",wi="invalid_base64_string",Ii="invalid_pop_token_request",Ci="failed_to_build_headers",vi="failed_to_parse_headers",ki="failed_to_decrypt_ear_response",Ti="timed_out",bi="empty_response";var Ai=Object.freeze({__proto__:null,authCodeOrNativeAccountIdRequired:hi,authCodeRequired:ci,authRequestNotSetError:"auth_request_not_set_error",blockIframeReload:Go,blockNestedPopups:Qo,cryptoKeyNotFound:ai,cryptoNonExistent:qo,databaseNotOpen:ti,databaseUnavailable:di,earJweEmpty:xo,earJwkEmpty:Mo,emptyNavigateUri:No,emptyResponse:bi,emptyWindowError:jo,failedToBuildHeaders:Ci,failedToDecryptEarResponse:ki,failedToParseHeaders:vi,failedToParseResponse:ii,getRequestFailed:oi,hashDoesNotContainKnownProperties:Ho,hashEmptyError:Uo,iframeClosedPrematurely:"iframe_closed_prematurely",interactionInProgress:Ko,interactionInProgressCancelled:Bo,invalidBase64String:wi,invalidCacheType:"invalid_cache_type",invalidPopTokenRequest:Ii,nativeConnectionNotEstablished:mi,nativeExtensionNotInstalled:pi,nativeHandshakeTimeout:gi,nativePromptNotSupported:yi,noAccountError:Xo,noNetworkConnectivity:ri,noStateInHash:Lo,noTokenRequestCacheError:Yo,nonBrowserEnvironment:ei,pkceNotCreated:Oo,popupWindowError:zo,postRequestFailed:ni,redirectBridgeEmptyResponse:Jo,redirectInIframe:Wo,silentLogoutUnsupported:Vo,silentPromptValueError:"silent_prompt_value_error",spaCodeAndNativeAccountIdPresent:li,stateInteractionTypeMismatch:Fo,timedOut:Ti,unableToAcquireTokenFromNativePlatform:ui,unableToLoadToken:si,unableToParseState:Do,unableToParseTokenRequestCacheError:Zo,uninitializedPublicClientApplication:fi,userCancelled:$o});function Si(e){return`See https://aka.ms/msal.js.errors#${e} for details`}class _i extends we{constructor(e,t){super(e,Si(e),t),Object.setPrototypeOf(this,_i.prototype),this.name="BrowserAuthError"}}function Ei(e,t){return new _i(e,t)}const Pi="invalid_grant",Ri=483,Oi=600,Mi="msal",xi="msal.js.browser",qi="53ee284d-920a-4b59-9d30-a60315b26836",Ni="ppnbnpeolgkicgegkbkbjmhlideopiji",Ui="MATS",Li="MicrosoftEntra",Hi="DOM API",Di="get-token-and-sign-out",Fi="PlatformAuthDOMHandler",Ki="PlatformAuthExtensionHandler",Bi="Handshake",zi="HandshakeResponse",ji="GetToken",$i="Response",Ji={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},Wi="GET",Gi="POST",Qi="signin",Vi="signout",Xi="request.origin",Yi="urlHash",Zi="request.params",es="code.verifier",ts="interaction.status",rs="request.native",ns="wrapper.sku",os="wrapper.version",is={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var ss;e.InteractionType=void 0,(ss=e.InteractionType||(e.InteractionType={})).Redirect="redirect",ss.Popup="popup",ss.Silent="silent",ss.None="none";const as={Startup:"startup",Logout:"logout",AcquireToken:"acquireToken",HandleRedirect:"handleRedirect",None:"none"},cs={scopes:p},hs="msal.db",ls=`${hs}.keys`,ds={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},us=[ds.Default,ds.Skip,ds.RefreshTokenAndNetwork];function gs(e){return encodeURIComponent(ms(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function ps(e){return fs(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function ms(e){return fs((new TextEncoder).encode(e))}function fs(e){const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)}function ys(e){return(new TextDecoder).decode(ws(e))}function ws(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw Ei(wi)}const r=atob(t);return Uint8Array.from(r,(e=>e.codePointAt(0)||0))}const Is="AES-GCM",Cs="HKDF",vs="SHA-256",ks=new Uint8Array([1,0,1]),Ts="0123456789abcdef",bs=new Uint32Array(1),As="raw",Ss="encrypt",_s="decrypt",Es={name:"RSASSA-PKCS1-v1_5",hash:vs,modulusLength:2048,publicExponent:ks};async function Ps(e){const t=(new TextEncoder).encode(e);return window.crypto.subtle.digest(vs,t)}function Rs(e){return window.crypto.getRandomValues(e)}function Os(){return window.crypto.getRandomValues(bs),bs[0]}function Ms(){const e=Date.now(),t=1024*Os()+(1023&Os()),r=new Uint8Array(16),n=Math.trunc(t/2**30),o=t&2**30-1,i=Os();r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i;let s="";for(let e=0;e<r.length;e++)s+=Ts.charAt(r[e]>>>4),s+=Ts.charAt(15&r[e]),3!==e&&5!==e&&7!==e&&9!==e||(s+="-");return s}async function xs(e){return window.crypto.subtle.exportKey("jwk",e)}async function qs(){const e=await Us(),t={alg:"dir",kty:"oct",k:ps(new Uint8Array(e))};return ms(JSON.stringify(t))}async function Ns(e,t){const r=t.split(".");if(5!==r.length)throw Ei(ki,"jwe_length");const n=await async function(e){const t=ys(e),r=ws(JSON.parse(t).k);return window.crypto.subtle.importKey(As,r,Is,!1,[_s])}(e).catch((()=>{throw Ei(ki,"import_key")}));try{const e=(new TextEncoder).encode(r[0]),t=ws(r[2]),o=ws(r[3]),i=ws(r[4]),s=8*i.byteLength,a=new Uint8Array(o.length+i.length);a.set(o),a.set(i,o.length);const c=await window.crypto.subtle.decrypt({name:Is,iv:t,tagLength:s,additionalData:e},n,a);return(new TextDecoder).decode(c)}catch(e){throw Ei(ki,"decrypt")}}async function Us(){const e=await window.crypto.subtle.generateKey({name:Is,length:256},!0,[Ss,_s]);return window.crypto.subtle.exportKey(As,e)}async function Ls(e){return window.crypto.subtle.importKey(As,e,Cs,!1,["deriveKey"])}async function Hs(e,t,r){return window.crypto.subtle.deriveKey({name:Cs,salt:t,hash:vs,info:(new TextEncoder).encode(r)},e,{name:Is,length:256},!1,[Ss,_s])}async function Ds(e,t,r){const n=(new TextEncoder).encode(t),o=window.crypto.getRandomValues(new Uint8Array(16)),i=await Hs(e,o,r),s=await window.crypto.subtle.encrypt({name:Is,iv:new Uint8Array(12)},i,n);return{data:ps(new Uint8Array(s)),nonce:ps(o)}}async function Fs(e,t,r,n){const o=ws(n),i=await Hs(e,ws(t),r),s=await window.crypto.subtle.decrypt({name:Is,iv:new Uint8Array(12)},i,o);return(new TextDecoder).decode(s)}const Ks="storage_not_supported",Bs="stubbed_public_client_application_called",zs="in_mem_redirect_unavailable";var js=Object.freeze({__proto__:null,inMemRedirectUnavailable:zs,storageNotSupported:Ks,stubbedPublicClientApplicationCalled:Bs});class $s extends we{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,$s.prototype)}}function Js(e){return new $s(e,Si(e))}function Ws(){const e=window.location.hash,t=window.location.search;let r,n=!1,o=!1,i="";if(e&&e.length>1){const t="#"===e.charAt(0)?e.substring(1):e,o=new URLSearchParams(t);o.has("state")&&(n=!0,i=t,r=o)}if(t&&t.length>1){const e="?"===t.charAt(0)?t.substring(1):t,n=new URLSearchParams(e);n.has("state")&&(o=!0,i=e,r=n)}if(n&&o){i=`${"?"===t.charAt(0)?t.substring(1):t}${"#"===e.charAt(0)?e.substring(1):e}`,r=new URLSearchParams(i)}if(!i||!r)throw Ei(bi);const s=r.get("state");if(!s)throw Ei(Lo);const{libraryState:a}=Cn(ys,s),{id:c,meta:h}=a;if(!c||!h)throw Ei(Do,"missing_library_state");return{params:r,payload:i,urlHash:e,urlQuery:t,hasResponseInHash:n,hasResponseInQuery:o,libraryState:{id:c,meta:h}}}function Gs(e){e.location.hash="","function"==typeof e.history.replaceState&&e.history.replaceState(null,"",`${e.location.origin}${e.location.pathname}${e.location.search}`)}function Qs(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}function Vs(){return window.parent!==window}function Xs(){if(Vs())return!1;try{const{libraryState:t}=Ws(),{meta:r}=t;return r.interactionType===e.InteractionType.Popup}catch(e){return!1}}let Ys=null;function Zs(e,t){Ys&&(e.verbose("18y01k",t),clearTimeout(Ys.timeoutId),Ys.channel.close(),Ys.reject(Ei(Bo)),Ys=null)}async function ea(e,t,r,n){return new Promise(((o,i)=>{t.verbose("1rf6em",n.correlationId);const{libraryState:s}=Cn(r.base64Decode,n.state||""),a=new BroadcastChannel(s.id);let c;const h=window.setTimeout((()=>{Ys=null,a.close(),i(Ei(Ti,"redirect_bridge_timeout"))}),e);Ys={timeoutId:h,channel:a,reject:i},a.onmessage=e=>{c=e.data.payload,Ys=null,clearTimeout(h),a.close(),c?o(c):i(Ei(Jo))}}))}function ta(){return"undefined"!=typeof window&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function ra(){const e=new vr(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function na(){if(or(window.location.hash)&&Vs())throw Ei(Go)}function oa(e){if(Vs()&&!e)throw Ei(Wo)}function ia(){if(Xs())throw Ei(Qo)}function sa(){if("undefined"==typeof window)throw Ei(ei)}function aa(e){if(!e)throw Ei(fi)}function ca(e){sa(),na(),ia(),aa(e)}function ha(e,t){if(ca(e),oa(t.system.allowRedirectInIframe),t.cache.cacheLocation===Ji.MemoryStorage)throw Js(zs)}function la(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout((()=>{try{document.head.removeChild(t)}catch{}}),1e4)}function da(){return Ms()}const ua=Vt;var ga=Object.freeze({__proto__:null,addClientCapabilitiesToClaims:ua,blockAPICallsBeforeInitialize:aa,blockAcquireTokenInPopups:ia,blockNonBrowserEnvironment:sa,blockRedirectInIframe:oa,blockReloadInHiddenIframes:na,cancelPendingBridgeResponse:Zs,clearHash:Gs,createGuid:da,getCurrentUri:ta,getHomepage:ra,invoke:Nn,invokeAsync:Un,isInIframe:Vs,isInPopup:Xs,parseAuthResponseFromUrl:Ws,preconnect:la,preflightCheck:ca,redirectPreflightCheck:ha,replaceHash:Qs,waitForBridgeResponse:ea});const pa="standardInteractionClientGetDiscoveredAuthority",ma="nativeInteractionClientAcquireToken",fa="acquireTokenBySilentIframe",ya="initializeBaseRequest",wa="silentIframeClientTokenHelper",Ia="silentHandlerInitiateAuthRequest",Ca="silentHandlerMonitorIframeForHash",va="standardInteractionClientCreateAuthCodeClient",ka="standardInteractionClientGetClientConfiguration",Ta="standardInteractionClientInitializeAuthorizationRequest",ba="handleResponseEar",Aa="handleResponsePlatformBroker",Sa="handleResponseCode",_a="deserializeResponse",Ea="generatePkceCodes",Pa="generateHKDF",Ra="decrypt",Oa="generateEarKey";class Ma{constructor(){this.dbName=hs,this.version=1,this.tableName=ls,this.dbOpen=!1}async open(){return new Promise(((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",(e=>{e.target.result.createObjectStore(this.tableName)})),r.addEventListener("success",(t=>{const r=t;this.db=r.target.result,this.dbOpen=!0,e()})),r.addEventListener("error",(()=>t(Ei(di))))}))}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(Ei(ti));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async setItem(e,t){return await this.validateDbIsOpen(),new Promise(((r,n)=>{if(!this.db)return n(Ei(ti));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);o.addEventListener("success",(()=>{this.closeConnection(),r()})),o.addEventListener("error",(e=>{this.closeConnection(),n(e)}))}))}async removeItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(Ei(ti));const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.addEventListener("success",(()=>{this.closeConnection(),t()})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async getKeys(){return await this.validateDbIsOpen(),new Promise(((e,t)=>{if(!this.db)return t(Ei(ti));const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();r.addEventListener("success",(t=>{const r=t;this.closeConnection(),e(r.target.result)})),r.addEventListener("error",(e=>{this.closeConnection(),t(e)}))}))}async containsKey(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(Ei(ti));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(1===r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise(((e,t)=>{const r=window.indexedDB.deleteDatabase(hs),n=setTimeout((()=>t(!1)),200);r.addEventListener("success",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("blocked",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("error",(()=>(clearTimeout(n),t(!1))))}))}}class xa{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,t){this.cache.set(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach(((t,r)=>{e.push(r)})),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}class qa{constructor(e){this.inMemoryCache=new xa,this.indexedDBCache=new Ma,this.logger=e}handleDatabaseAccessError(e,t){if(!(e instanceof _i&&e.errorCode===di))throw e;this.logger.error("1wx7zz",t)}async getItem(e,t){const r=this.inMemoryCache.getItem(e);if(!r)try{return this.logger.verbose("0naxpl",t),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e,t)}return r}async setItem(e,t,r){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e,r)}}async removeItem(e,t){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e,t)}}async getKeys(e){const t=this.inMemoryCache.getKeys();if(0===t.length)try{return this.logger.verbose("1iqrbq",e),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t,e)}return t}async containsKey(e,t){const r=this.inMemoryCache.containsKey(e);if(!r)try{return this.logger.verbose("03zl2j",t),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e,t)}return r}clearInMemory(e){this.logger.verbose("03r21p",e),this.inMemoryCache.clear(),this.logger.verbose("0uksk1",e)}async clearPersistent(e){try{this.logger.verbose("0rdqut",e);const t=await this.indexedDBCache.deleteDatabase();return t&&this.logger.verbose("149ouc",e),t}catch(t){return this.handleDatabaseAccessError(t,e),!1}}}class Na{constructor(e,t,r){this.logger=e,function(e){if(!window)throw Ei(ei);if(!window.crypto)throw Ei(qo);if(!e&&!window.crypto.subtle)throw Ei(qo,"crypto_subtle_undefined")}(r??!1),this.cache=new qa(this.logger),this.performanceClient=t}createNewGuid(){return Ms()}base64Encode(e){return ms(e)}base64Decode(e){return ys(e)}base64UrlEncode(e){return gs(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement("cryptoOptsGetPublicKeyThumbprint",e.correlationId),r=await async function(e,t){return window.crypto.subtle.generateKey(Es,e,t)}(Na.EXTRACTABLE,Na.POP_KEY_USAGES),n=await xs(r.publicKey),o=Ua({e:n.e,kty:n.kty,n:n.n}),i=await this.hashString(o),s=await xs(r.privateKey),a=await async function(e,t,r){return window.crypto.subtle.importKey("jwk",e,Es,t,r)}(s,!1,["sign"]);return await this.cache.setItem(i,{privateKey:a,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri},e.correlationId),t&&t.end({success:!0}),i}async removeTokenBindingKey(e,t){await this.cache.removeItem(e,t);if(await this.cache.containsKey(e,t))throw be(It)}async clearKeystore(e){this.cache.clearInMemory(e);try{return await this.cache.clearPersistent(e),!0}catch(t){return t instanceof Error?this.logger.error("1owpn8",e):this.logger.error("0yrmwo",e),!1}}async signJwt(e,t,r,n){const o=this.performanceClient?.startMeasurement("cryptoOptsSignJwt",n),i=await this.cache.getItem(t,n||"");if(!i)throw Ei(ai);const s=await xs(i.publicKey),a=Ua(s),c=gs(JSON.stringify({kid:t})),h=gs(_o.getShrHeaderString({...r?.header,alg:s.alg,kid:c}));e.cnf={jwk:JSON.parse(a)};const l=`${h}.${gs(JSON.stringify(e))}`,d=(new TextEncoder).encode(l),u=await async function(e,t){return window.crypto.subtle.sign(Es,e,t)}(i.privateKey,d),g=`${l}.${ps(new Uint8Array(u))}`;return o&&o.end({success:!0}),g}async hashString(e){return async function(e){const t=await Ps(e);return ps(new Uint8Array(t))}(e)}}function Ua(e){return JSON.stringify(e,Object.keys(e).sort())}Na.POP_KEY_USAGES=["sign","verify"],Na.EXTRACTABLE=!0;const La="acquireTokenSilent",Ha="acquireTokenByCode",Da="acquireTokenPopup",Fa="acquireTokenPreRedirect",Ka="acquireTokenRedirect",Ba="ssoSilent",za="initializeClientApplication",ja="localStorageUpdated",$a="loadExternalTokens";var Ja=Object.freeze({__proto__:null,AcquireTokenByCode:Ha,AcquireTokenPopup:Da,AcquireTokenPreRedirect:Fa,AcquireTokenRedirect:Ka,AcquireTokenSilent:La,InitializeClientApplication:za,LoadExternalTokens:$a,LocalStorageUpdated:ja,SsoSilent:Ba});const Wa="msal",Ga="browser",Qa=`${Wa}.${Ga}.log.level`,Va=`${Wa}.${Ga}.log.pii`,Xa=`${Wa}.${Ga}.performance.enabled`,Ya=`${Wa}.${Ga}.platform.auth.dom`,Za=`${Wa}.version`,ec="account.keys",tc="token.keys";function rc(e=2){return e<1?`${Wa}.${ec}`:`${Wa}.${e}.${ec}`}function nc(e,t=2){return t<1?`${Wa}.${tc}.${e}`:`${Wa}.${t}.${tc}.${e}`}const oc=864e5,ic="Lax",sc="None";class ac{initialize(){return Promise.resolve()}getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let e=0;e<r.length;e++){const n=r[e],[o,...i]=decodeURIComponent(n).trim().split("="),s=i.join("=");if(o===t)return s}return""}getUserData(){throw be(bt)}setItem(e,t,r,n=!0,o=ic){let i=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=${o};`;if(r){const e=function(e){const t=new Date,r=new Date(t.getTime()+e*oc);return r.toUTCString()}(r);i+=`expires=${e};`}(n||o===sc)&&(i+="Secure;"),document.cookie=i}async setUserData(){return Promise.reject(be(bt))}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach((e=>{const r=decodeURIComponent(e).trim().split("=");t.push(r[0])})),t}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function cc(e,t){const r=e.getItem(rc(t));return r?JSON.parse(r):[]}function hc(e,t,r){const n=t.getItem(nc(e,r));if(n){const e=JSON.parse(n);if(e&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("accessToken")&&e.hasOwnProperty("refreshToken"))return e}return{idToken:[],accessToken:[],refreshToken:[]}}function lc(e){return e.hasOwnProperty("id")&&e.hasOwnProperty("nonce")&&e.hasOwnProperty("data")}const dc="msal.cache.encryption";class uc{constructor(e,t,r){if(!window.localStorage)throw Js(Ks);this.memoryStorage=new xa,this.initialized=!1,this.clientId=e,this.logger=t,this.performanceClient=r,this.broadcast=new BroadcastChannel("msal.broadcast.cache")}async initialize(e){const t=new ac,r=t.getItem(dc);let n={key:"",id:""};if(r)try{n=JSON.parse(r)}catch(e){}if(n.key&&n.id){const t=Nn(ws,"base64Decode",this.logger,this.performanceClient,e)(n.key);this.encryptionCookie={id:n.id,key:await Un(Ls,Pa,this.logger,this.performanceClient,e)(t)}}else{const r=Ms(),n=await Un(Us,"generateBaseKey",this.logger,this.performanceClient,e)(),o=Nn(ps,"urlEncodeArr",this.logger,this.performanceClient,e)(new Uint8Array(n));this.encryptionCookie={id:r,key:await Un(Ls,Pa,this.logger,this.performanceClient,e)(n)};const i={id:r,key:o};t.setItem(dc,JSON.stringify(i),0,!0,sc)}await Un(this.importExistingCache.bind(this),"importExistingCache",this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",(t=>{this.updateCache(t,e)})),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Ei(fi);return this.memoryStorage.getItem(e)}async decryptData(e,t,r){if(!this.initialized||!this.encryptionCookie)throw Ei(fi);if(t.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},r),null;const n=await Un(Fs,Ra,this.logger,this.performanceClient,r)(this.encryptionCookie.key,t.nonce,this.getContext(e),t.data);if(!n)return null;try{return{...JSON.parse(n),lastUpdatedAt:t.lastUpdatedAt}}catch(e){return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},r),null}}setItem(e,t){window.localStorage.setItem(e,t)}async setUserData(e,t,r,n,o){if(!this.initialized||!this.encryptionCookie)throw Ei(fi);if(o)this.setItem(e,t);else{const{data:o,nonce:i}=await Un(Ds,"encrypt",this.logger,this.performanceClient,r)(this.encryptionCookie.key,t,this.getContext(e)),s={id:this.encryptionCookie.id,nonce:i,data:o,lastUpdatedAt:n};this.setItem(e,JSON.stringify(s))}this.memoryStorage.setItem(e,t),this.broadcast.postMessage({key:e,value:t,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear();cc(this).forEach((e=>this.removeItem(e)));const e=hc(this.clientId,this);e.idToken.forEach((e=>this.removeItem(e))),e.accessToken.forEach((e=>this.removeItem(e))),e.refreshToken.forEach((e=>this.removeItem(e))),this.getKeys().forEach((e=>{(e.startsWith(Wa)||-1!==e.indexOf(this.clientId))&&this.removeItem(e)}))}async importExistingCache(e){if(!this.encryptionCookie)return;let t=cc(this);t=await this.importArray(t,e),t.length?this.setItem(rc(),JSON.stringify(t)):this.removeItem(rc());const r=hc(this.clientId,this);r.idToken=await this.importArray(r.idToken,e),r.accessToken=await this.importArray(r.accessToken,e),r.refreshToken=await this.importArray(r.refreshToken,e),r.idToken.length||r.accessToken.length||r.refreshToken.length?this.setItem(nc(this.clientId),JSON.stringify(r)):this.removeItem(nc(this.clientId))}async getItemFromEncryptedCache(e,t){if(!this.encryptionCookie)return null;const r=this.getItem(e);if(!r)return null;let n;try{n=JSON.parse(r)}catch(e){return null}return lc(n)?n.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},t),null):(this.performanceClient.incrementFields({encryptedCacheCount:1},t),Un(Fs,Ra,this.logger,this.performanceClient,t)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data)):(this.performanceClient.incrementFields({unencryptedCacheCount:1},t),r)}async importArray(e,t){const r=[],n=[];return e.forEach((e=>{const o=this.getItemFromEncryptedCache(e,t).then((t=>{t?(this.memoryStorage.setItem(e,t),r.push(e)):this.removeItem(e)}));n.push(o)})),await Promise.all(n),r}getContext(e){let t="";return e.includes(this.clientId)&&(t=this.clientId),t}updateCache(e,t){this.logger.trace("17cxcm",t);const r=this.performanceClient.startMeasurement(ja);r.add({isBackground:!0});const{key:n,value:o,context:i}=e.data;return n?i&&i!==this.clientId?(this.logger.trace("04rtdy",t),void r.end({success:!1,errorCode:"contextMismatch"})):(o?(this.memoryStorage.setItem(n,o),this.logger.verbose("1vzsgt",t)):(this.memoryStorage.removeItem(n),this.logger.verbose("04ypih",t)),void r.end({success:!0})):(this.logger.error("0e10qr",t),void r.end({success:!1,errorCode:"noKey"}))}}class gc{constructor(){if(!window.sessionStorage)throw Js(Ks)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}async setUserData(e,t){this.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}const pc={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_SUCCESS:"msal:loginSuccess",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",BROKERED_REQUEST_START:"msal:brokeredRequestStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",BROKERED_REQUEST_SUCCESS:"msal:brokeredRequestSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",BROKERED_REQUEST_FAILURE:"msal:brokeredRequestFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"},mc="@azure/msal-browser",fc="5.0.1";function yc(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class wc extends Br{constructor(e,t,r,n,o,i,s){super(e,r,n,o,s),this.cacheConfig=t,this.logger=n,this.internalStorage=new xa,this.browserStorage=Ic(e,t.cacheLocation,n,o),this.temporaryCacheStorage=Ic(e,Ji.SessionStorage,n,o),this.cookieStorage=new ac,this.eventHandler=i}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){let t=cc(this.browserStorage),r=hc(this.clientId,this.browserStorage);this.performanceClient.addFields({preMigrateAcntCount:t.length,preMigrateATCount:r.accessToken.length,preMigrateITCount:r.idToken.length,preMigrateRTCount:r.refreshToken.length},e);for(let t=0;t<2;t++){const r=t;await this.removeStaleAccounts(t,r,e)}for(let t=0;t<2;t++){const r=t;await this.migrateIdTokens(t,r,e)}const n=this.getKMSIValues();for(let t=0;t<2;t++)await this.migrateAccessTokens(t,n,e),await this.migrateRefreshTokens(t,n,e);t=cc(this.browserStorage),r=hc(this.clientId,this.browserStorage),this.performanceClient.addFields({postMigrateAcntCount:t.length,postMigrateATCount:r.accessToken.length,postMigrateITCount:r.idToken.length,postMigrateRTCount:r.refreshToken.length},e)}async updateOldEntry(e,t){const r=this.browserStorage.getItem(e),n=this.validateAndParseJson(r||"");if(!n)return this.browserStorage.removeItem(e),null;if(n.lastUpdatedAt){if(An(n.lastUpdatedAt,this.cacheConfig.cacheRetentionDays))return this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},t),null}else n.lastUpdatedAt=Date.now().toString(),this.setItem(e,JSON.stringify(n),t);const o=lc(n)?await this.browserStorage.decryptData(e,n,t):n;return o&&zn(o)?(jn(o)||$n(o))&&o.expiresOn&&bn(o.expiresOn,300)?(this.browserStorage.removeItem(e),this.performanceClient.incrementFields({expiredCacheRemovedCount:1},t),null):o:(this.performanceClient.incrementFields({invalidCacheCount:1},t),null)}async removeStaleAccounts(e,t,r){const n=cc(this.browserStorage,e);if(0!==n.length){for(const e of[...n]){this.performanceClient.incrementFields({oldAcntCount:1},r);const o=this.browserStorage.getItem(e),i=this.validateAndParseJson(o||"");i?i.lastUpdatedAt?An(i.lastUpdatedAt,this.cacheConfig.cacheRetentionDays)&&(await this.removeAccountOldSchema(e,i,t,r),yc(n,e)):(i.lastUpdatedAt=Date.now().toString(),this.setItem(e,JSON.stringify(i),r)):yc(n,e)}this.setAccountKeys(n,r,e)}}async removeAccountOldSchema(e,t,r,n){const o=lc(t)?await this.browserStorage.decryptData(e,t,n):t,i=o?.homeAccountId;if(i){const e=this.getTokenKeys(r);[...e.idToken].filter((e=>e.includes(i))).forEach((t=>{this.browserStorage.removeItem(t),yc(e.idToken,t)})),[...e.accessToken].filter((e=>e.includes(i))).forEach((t=>{this.browserStorage.removeItem(t),yc(e.accessToken,t)})),[...e.refreshToken].filter((e=>e.includes(i))).forEach((t=>{this.browserStorage.removeItem(t),yc(e.refreshToken,t)})),this.setTokenKeys(e,n,r)}this.performanceClient.incrementFields({expiredAcntRemovedCount:1},n),this.browserStorage.removeItem(e)}getKMSIValues(){const e={},t=this.getTokenKeys().idToken;for(const r of t){const t=this.browserStorage.getUserData(r);if(t){const r=JSON.parse(t),n=wr(r.secret,ys);n&&(e[r.homeAccountId]=Ir(n))}}return e}async migrateIdTokens(e,t,r){const n=hc(this.clientId,this.browserStorage,e);if(0===n.idToken.length)return;const o=hc(this.clientId,this.browserStorage,2),i=cc(this.browserStorage),s=cc(this.browserStorage,t);for(const e of[...n.idToken]){this.performanceClient.incrementFields({oldITCount:1},r);const t=await this.updateOldEntry(e,r);if(!t){yc(n.idToken,e);continue}const a=i.find((e=>e.includes(t.homeAccountId))),c=s.find((e=>e.includes(t.homeAccountId)));let h=null;if(a)h=this.getAccount(a,r);else if(c){const e=this.browserStorage.getItem(c),t=this.validateAndParseJson(e||"");h=t&&lc(t)?await this.browserStorage.decryptData(c,t,r):t}if(!h){this.performanceClient.incrementFields({skipITMigrateCount:1},r);continue}const l=wr(t.secret,ys),d=this.generateCredentialKey(t),u=this.getIdTokenCredential(d,r),g=Object.keys(l).includes("signin_state"),p=u&&Object.keys(wr(u.secret,ys)||{}).includes("signin_state");if(!u||t.lastUpdatedAt>u.lastUpdatedAt&&(g||!p)){const e=h.tenantProfiles||[],n=Lr(l)||h.realm;if(n&&!e.find((e=>e.tenantId===n))){const t=fr(h.homeAccountId,h.localAccountId,n,l);e.push(t)}h.tenantProfiles=e;const s=this.generateAccountKey(Dr(h)),a=Ir(l);await this.setUserData(s,JSON.stringify(h),r,h.lastUpdatedAt,a),i.includes(s)||i.push(s),await this.setUserData(d,JSON.stringify(t),r,t.lastUpdatedAt,a),this.performanceClient.incrementFields({migratedITCount:1},r),o.idToken.push(d)}}this.setTokenKeys(n,r,e),this.setTokenKeys(o,r),this.setAccountKeys(i,r)}async migrateAccessTokens(e,t,r){const n=hc(this.clientId,this.browserStorage,e);if(0===n.accessToken.length)return;const o=hc(this.clientId,this.browserStorage,2);for(const e of[...n.accessToken]){this.performanceClient.incrementFields({oldATCount:1},r);const i=await this.updateOldEntry(e,r);if(!i){yc(n.accessToken,e);continue}if(!(i.homeAccountId in t)){this.performanceClient.incrementFields({skipATMigrateCount:1},r);continue}const s=this.generateCredentialKey(i),a=t[i.homeAccountId];if(o.accessToken.includes(s)){const e=this.getAccessTokenCredential(s,r);(!e||i.lastUpdatedAt>e.lastUpdatedAt)&&(await this.setUserData(s,JSON.stringify(i),r,i.lastUpdatedAt,a),this.performanceClient.incrementFields({migratedATCount:1},r))}else await this.setUserData(s,JSON.stringify(i),r,i.lastUpdatedAt,a),this.performanceClient.incrementFields({migratedATCount:1},r),o.accessToken.push(s)}this.setTokenKeys(n,r,e),this.setTokenKeys(o,r)}async migrateRefreshTokens(e,t,r){const n=hc(this.clientId,this.browserStorage,e);if(0===n.refreshToken.length)return;const o=hc(this.clientId,this.browserStorage,2);for(const e of[...n.refreshToken]){this.performanceClient.incrementFields({oldRTCount:1},r);const i=await this.updateOldEntry(e,r);if(!i){yc(n.refreshToken,e);continue}if(!(i.homeAccountId in t)){this.performanceClient.incrementFields({skipRTMigrateCount:1},r);continue}const s=this.generateCredentialKey(i),a=t[i.homeAccountId];if(o.refreshToken.includes(s)){const e=this.getRefreshTokenCredential(s,r);(!e||i.lastUpdatedAt>e.lastUpdatedAt)&&(await this.setUserData(s,JSON.stringify(i),r,i.lastUpdatedAt,a),this.performanceClient.incrementFields({migratedRTCount:1},r))}else await this.setUserData(s,JSON.stringify(i),r,i.lastUpdatedAt,a),this.performanceClient.incrementFields({migratedRTCount:1},r),o.refreshToken.push(s)}this.setTokenKeys(n,r,e),this.setTokenKeys(o,r)}trackVersionChanges(e){const t=this.browserStorage.getItem(Za);t&&(this.logger.info("1wuc87",e),this.performanceClient.addFields({previousLibraryVersion:t},e)),t!==fc&&this.setItem(Za,fc,e)}validateAndParseJson(e){if(!e)return null;try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}setItem(e,t,r){const n=new Array(3).fill(0),o=[];for(let i=0;i<=20;i++)try{if(this.browserStorage.setItem(e,t),i>0)for(let e=0;e<=2;e++){const t=n.slice(0,e).reduce(((e,t)=>e+t),0);if(t>=i)break;const s=i>t+n[e]?t+n[e]:i;i>t&&n[e]>0&&this.removeAccessTokenKeys(o.slice(t,s),r,e)}break}catch(s){const a=Rr(s);if(!(a.errorCode===Er&&i<20))throw a;if(!o.length)for(let r=0;r<=2;r++)if(e===nc(this.clientId,r)){const e=JSON.parse(t).accessToken;o.push(...e),n[r]=e.length}else{const e=this.getTokenKeys(r).accessToken;o.push(...e),n[r]=e.length}if(o.length<=i)throw a;this.removeAccessToken(o[i],r,!1)}}async setUserData(e,t,r,n,o){const i=new Array(3).fill(0),s=[];for(let a=0;a<=20;a++)try{if(await Un(this.browserStorage.setUserData.bind(this.browserStorage),"setUserData",this.logger,this.performanceClient,r)(e,t,r,n,o),a>0)for(let e=0;e<=2;e++){const t=i.slice(0,e).reduce(((e,t)=>e+t),0);if(t>=a)break;const n=a>t+i[e]?t+i[e]:a;a>t&&i[e]>0&&this.removeAccessTokenKeys(s.slice(t,n),r,e)}break}catch(e){const t=Rr(e);if(!(t.errorCode===Er&&a<20))throw t;if(!s.length)for(let e=0;e<=2;e++){const t=this.getTokenKeys(e).accessToken;s.push(...t),i[e]=t.length}if(s.length<=a)throw t;this.removeAccessToken(s[a],r,!1)}}getAccount(e,t){this.logger.trace("1lfvm6",t);const r=this.browserStorage.getUserData(e);if(!r)return this.removeAccountKeyFromMap(e,t),null;const n=this.validateAndParseJson(r);return n&&((o=n)&&o.hasOwnProperty("homeAccountId")&&o.hasOwnProperty("environment")&&o.hasOwnProperty("realm")&&o.hasOwnProperty("localAccountId")&&o.hasOwnProperty("username")&&o.hasOwnProperty("authorityType"))?Br.toObject({},n):null;var o}async setAccount(e,t,r){this.logger.trace("1bz3wr",t);const n=this.generateAccountKey(Dr(e)),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(n,JSON.stringify(e),t,o,r),this.addAccountKeyToMap(n,t),this.performanceClient.addFields({kmsi:r},t)}setAccountKeys(e,t,r=2){0===e.length?this.removeItem(rc(r)):this.setItem(rc(r),JSON.stringify(e),t)}getAccountKeys(){return cc(this.browserStorage)}addAccountKeyToMap(e,t){this.logger.trace("0rb85k",t),this.logger.tracePii("1l9bdo",t);const r=this.getAccountKeys();return-1===r.indexOf(e)?(r.push(e),this.setItem(rc(),JSON.stringify(r),t),this.logger.verbose("0xia39",t),!0):(this.logger.verbose("0161kk",t),!1)}removeAccountKeyFromMap(e,t){this.logger.trace("1jpigu",t),this.logger.tracePii("1xzspl",t);const r=this.getAccountKeys(),n=r.indexOf(e);n>-1?(r.splice(n,1),this.setAccountKeys(r,t)):this.logger.trace("1dytu2",t)}removeAccount(e,t){const r=this.getActiveAccount(t);r?.homeAccountId===e.homeAccountId&&r?.environment===e.environment&&this.setActiveAccount(null,t),super.removeAccount(e,t),this.removeAccountKeyFromMap(this.generateAccountKey(e),t),this.browserStorage.getKeys().forEach((t=>{t.includes(e.homeAccountId)&&t.includes(e.environment)&&this.browserStorage.removeItem(t)}))}removeIdToken(e,t){super.removeIdToken(e,t);const r=this.getTokenKeys(),n=r.idToken.indexOf(e);n>-1&&(this.logger.info("05udv9",t),r.idToken.splice(n,1),this.setTokenKeys(r,t))}removeAccessToken(e,t,r=!0){super.removeAccessToken(e,t),r&&this.removeAccessTokenKeys([e],t)}removeAccessTokenKeys(e,t,r=2){this.logger.trace("17o18n",t);const n=this.getTokenKeys(r);let o=0;if(e.forEach((e=>{const t=n.accessToken.indexOf(e);t>-1&&(n.accessToken.splice(t,1),o++)})),o>0)return this.logger.info("15i5d5",t),void this.setTokenKeys(n,t,r)}removeRefreshToken(e,t){super.removeRefreshToken(e,t);const r=this.getTokenKeys(),n=r.refreshToken.indexOf(e);n>-1&&(this.logger.info("1f4fq3",t),r.refreshToken.splice(n,1),this.setTokenKeys(r,t))}getTokenKeys(e=2){return hc(this.clientId,this.browserStorage,e)}setTokenKeys(e,t,r=2){0!==e.idToken.length||0!==e.accessToken.length||0!==e.refreshToken.length?this.setItem(nc(this.clientId,r),JSON.stringify(e),t):this.removeItem(nc(this.clientId,r))}getIdTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("1jukz6",t),this.removeIdToken(e,t),null;const n=this.validateAndParseJson(r);return n&&((o=n)&&zn(o)&&o.hasOwnProperty("realm")&&o.credentialType===L.ID_TOKEN)?(this.logger.trace("01ju66",t),n):(this.logger.trace("1jukz6",t),null);var o}async setIdTokenCredential(e,t,r){this.logger.trace("13hjll",t);const n=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(n,JSON.stringify(e),t,o,r);const i=this.getTokenKeys();-1===i.idToken.indexOf(n)&&(this.logger.info("07jy92",t),i.idToken.push(n),this.setTokenKeys(i,t))}getAccessTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0bqvx8",t),this.removeAccessTokenKeys([e],t),null;const n=this.validateAndParseJson(r);return n&&jn(n)?(this.logger.trace("1o81rl",t),n):(this.logger.trace("0bqvx8",t),null)}async setAccessTokenCredential(e,t,r){this.logger.trace("1pondb",t);const n=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(n,JSON.stringify(e),t,o,r);const i=this.getTokenKeys(),s=i.accessToken.indexOf(n);-1!==s&&i.accessToken.splice(s,1),this.logger.trace("1onhey",t),i.accessToken.push(n),this.setTokenKeys(i,t)}getRefreshTokenCredential(e,t){const r=this.browserStorage.getUserData(e);if(!r)return this.logger.trace("0jlizt",t),this.removeRefreshToken(e,t),null;const n=this.validateAndParseJson(r);return n&&$n(n)?(this.logger.trace("0nokxi",t),n):(this.logger.trace("0jlizt",t),null)}async setRefreshTokenCredential(e,t,r){this.logger.trace("0tcg8d",t);const n=this.generateCredentialKey(e),o=Date.now().toString();e.lastUpdatedAt=o,await this.setUserData(n,JSON.stringify(e),t,o,r);const i=this.getTokenKeys();-1===i.refreshToken.indexOf(n)&&(this.logger.info("0eckjs",t),i.refreshToken.push(n),this.setTokenKeys(i,t))}getAppMetadata(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1q101h",t),null;const n=this.validateAndParseJson(r);return n&&(o=e,(i=n)&&0===o.indexOf(H)&&i.hasOwnProperty("clientId")&&i.hasOwnProperty("environment"))?(this.logger.trace("19pvg2",t),n):(this.logger.trace("1q101h",t),null);var o,i}setAppMetadata(e,t){this.logger.trace("0cyma6",t);const r=function({environment:e,clientId:t}){return[H,e,t].join("-").toLowerCase()}(e);this.setItem(r,JSON.stringify(e),t)}getServerTelemetry(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("0jk19c",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){const r=0===e.indexOf(J);let n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n}(e,n)?(this.logger.trace("12jguk",t),n):(this.logger.trace("0jk19c",t),null)}setServerTelemetry(e,t,r){this.logger.trace("1poh61",r),this.setItem(e,JSON.stringify(t),r)}getAuthorityMetadata(e,t){const r=this.internalStorage.getItem(e);if(!r)return this.logger.trace("1r39oe",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){return!!t&&0===e.indexOf(F)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,n)?(this.logger.trace("1ohvk3",t),n):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter((e=>this.isAuthorityMetadata(e)))}setWrapperMetadata(e,t){this.internalStorage.setItem(ns,e),this.internalStorage.setItem(os,t)}getWrapperMetadata(){return[this.internalStorage.getItem(ns)||"",this.internalStorage.getItem(os)||""]}setAuthorityMetadata(e,t,r){this.logger.trace("07w8n2",r),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(e){const t=this.generateCacheKey(b),r=this.browserStorage.getItem(t);if(!r)return this.logger.trace("08gw0e",e),null;const n=this.validateAndParseJson(r);return n?(this.logger.trace("1t3ch7",e),this.getAccountInfoFilteredBy({homeAccountId:n.homeAccountId,localAccountId:n.localAccountId,tenantId:n.tenantId},e)):(this.logger.trace("0me1up",e),null)}setActiveAccount(e,t){const r=this.generateCacheKey(b);if(e){this.logger.verbose("0rsj80",t);const n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.setItem(r,JSON.stringify(n),t)}else this.logger.verbose("1bp5z5",t),this.browserStorage.removeItem(r);this.eventHandler.emitEvent(pc.ACTIVE_ACCOUNT_CHANGED)}getThrottlingCache(e,t){const r=this.browserStorage.getItem(e);if(!r)return this.logger.trace("1h4wa6",t),null;const n=this.validateAndParseJson(r);return n&&function(e,t){let r=!1;e&&(r=0===e.indexOf(Q));let n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n}(e,n)?(this.logger.trace("0of6n8",t),n):(this.logger.trace("1h4wa6",t),null)}setThrottlingCache(e,t,r){this.logger.trace("0wfgh6",r),this.setItem(e,JSON.stringify(t),r)}getTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e,o=this.temporaryCacheStorage.getItem(n);if(!o){if(this.cacheConfig.cacheLocation===Ji.LocalStorage){const e=this.browserStorage.getItem(n);if(e)return this.logger.trace("1yt61y",t),e}return this.logger.trace("1qhy81",t),null}return o}setTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t)}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e)}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach((e=>{-1===e.indexOf(Wa)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)})),this.browserStorage.getKeys().forEach((e=>{-1===e.indexOf(Wa)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)})),this.internalStorage.clear()}generateCacheKey(e){return ke.startsWith(e,Wa)?e:`${Wa}.${this.clientId}.${e}`}generateCredentialKey(e){const t=e.credentialType===L.REFRESH_TOKEN&&e.familyId||e.clientId,r=e.tokenType&&e.tokenType.toLowerCase()!==G.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Wa}.2`,e.homeAccountId,e.environment,e.credentialType,t,e.realm||"",e.target||"",r].join("|").toLowerCase()}generateAccountKey(e){const t=e.homeAccountId.split(".")[1];return[`${Wa}.2`,e.homeAccountId,e.environment,t||e.tenantId||""].join("|").toLowerCase()}resetRequestCache(e){this.logger.trace("0h0ynu",e),this.removeTemporaryItem(this.generateCacheKey(Zi)),this.removeTemporaryItem(this.generateCacheKey(es)),this.removeTemporaryItem(this.generateCacheKey(Xi)),this.removeTemporaryItem(this.generateCacheKey(Yi)),this.removeTemporaryItem(this.generateCacheKey(rs)),this.setInteractionInProgress(!1,void 0)}cacheAuthorizeRequest(e,t,r){this.logger.trace("1tzef5",t);const n=ms(JSON.stringify(e));if(this.setTemporaryCache(Zi,n,!0),r){const e=ms(r);this.setTemporaryCache(es,e,!0)}}getCachedRequest(e){this.logger.trace("0uen20",e);const t=this.getTemporaryCache(Zi,e,!0);if(!t)throw Ei(Yo);const r=this.getTemporaryCache(es,e,!0);let n,o="";try{n=JSON.parse(ys(t)),r&&(o=ys(r))}catch(t){throw this.logger.errorPii("0ewsey",e),this.logger.error("0tvdic",e),Ei(Zo)}return[n,o]}getCachedNativeRequest(){this.logger.trace("1yxcdm","");const e=this.getTemporaryCache(rs,"",!0);if(!e)return this.logger.trace("0mnxd4",""),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("0rrkip",""),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress()?.clientId;return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${Wa}.${ts}`,t=this.getTemporaryCache(e,"",!1);try{return t?JSON.parse(t):null}catch(t){return this.logger.error("0jjyys",""),this.removeTemporaryItem(e),this.resetRequestCache(""),Gs(window),null}}setInteractionInProgress(e,t=Qi,r=!1,n=""){const o=`${Wa}.${ts}`;if(e){if(this.getInteractionInProgress()){if(!r)throw Ei(Ko);this.logger.warning("1pmscr",n),Zs(this.logger,n),this.removeTemporaryItem(o)}this.setTemporaryCache(o,JSON.stringify({clientId:this.clientId,type:t}),!1)}else e||this.getInteractionInProgress()?.clientId!==this.clientId||this.removeTemporaryItem(o)}async hydrateCache(e,t){const r={idToken:Fn(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId),accessToken:Kn(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?kn(e.expiresOn):0,e.extExpiresOn?kn(e.extExpiresOn):0,ys,void 0,e.tokenType,void 0,t.sshKid)};return this.saveCacheRecord(r,e.correlationId,Ir(wr(e.idToken,ys)))}async saveCacheRecord(e,t,r,n){try{await super.saveCacheRecord(e,t,r,n)}catch(e){if(e instanceof Pr&&this.performanceClient&&t)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},t)}catch(e){}throw e}}}function Ic(e,t,r,n){try{switch(t){case Ji.LocalStorage:return new uc(e,r,n);case Ji.SessionStorage:return new gc}}catch(e){r.error(e,"")}return new xa}const Cc=(e,t,r,n)=>new wc(e,{cacheLocation:Ji.MemoryStorage,cacheRetentionDays:5},ar,t,r,n);function vc(e,t,r,n,o){return e.verbose("1yd030",n),r?t.getAllAccounts(o,n):[]}function kc(e,t,r,n){if(t.trace("0u7b90",n),0===Object.keys(e).length)return t.warning("1kz0cu",n),null;const o=r.getAccountInfoFilteredBy(e,n);return o?(t.verbose("0btgll",n),o):(t.verbose("0ltaj5",n),null)}function Tc(e,t,r){t.setActiveAccount(e,r)}function bc(e,t){return e.getActiveAccount(t)}class Ac{constructor(e){this.eventCallbacks=new Map,this.logger=e||new dr({}),"undefined"!=typeof BroadcastChannel&&(this.broadcastChannel=new BroadcastChannel("msal.broadcast.event")),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,t,r){if("undefined"!=typeof window){const n=r||da();return this.eventCallbacks.has(n)?(this.logger.error("1578i0",""),null):(this.eventCallbacks.set(n,[e,t||[]]),this.logger.verbose("1cnec4",""),n)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose("12zotd","")}emitEvent(e,t,r,n){const o={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};switch(e){case pc.LOGIN_SUCCESS:case pc.LOGOUT_SUCCESS:case pc.ACTIVE_ACCOUNT_CHANGED:this.broadcastChannel?.postMessage(o)}this.invokeCallbacks(o)}invokeCallbacks(e){this.eventCallbacks.forEach((([t,r],n)=>{(0===r.length||r.includes(e.eventType))&&(this.logger.verbose("15jpwk",""),t.apply(null,[e]))}))}invokeCrossTabCallbacks(e){const t=e.data;this.invokeCallbacks(t)}subscribeCrossTab(){this.broadcastChannel?.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){this.broadcastChannel?.removeEventListener("message",this.invokeCrossTabCallbacks)}}class Sc{constructor(e,t,r,n,o,i,s,a,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.platformAuthProvider=c,this.correlationId=a,this.logger=n.clone(xi,fc),this.performanceClient=s}}function _c(e,t,r,n){r.verbose("0bd1la",n);const o=e||t||"";return vr.getAbsoluteUrl(o,ta())}function Ec(e,t,r,n,o,i){o.verbose("1p12tq",r);const s={clientId:t,correlationId:r,apiId:e,forceRefresh:!1,wrapperSKU:n.getWrapperMetadata()[0],wrapperVer:n.getWrapperMetadata()[1]};return new bo(s,n)}async function Pc(e,t,r,n,o,i,s,a,c){const h=a&&a.hasOwnProperty("instance_aware")?a.instance_aware:void 0,l={protocolMode:e.system.protocolMode,OIDCOptions:e.auth.OIDCOptions,knownAuthorities:e.auth.knownAuthorities,cloudDiscoveryMetadata:e.auth.cloudDiscoveryMetadata,authorityMetadata:e.auth.authorityMetadata},d=i||e.auth.authority,u=h?.length?"true"===h:e.auth.instanceAware,g=c&&u?e.auth.authority.replace(vr.getDomainFromUrl(d),c.environment):d,p=ho.generateAuthority(g,s||e.auth.azureCloudOptions),m=await Un(go,"authorityFactoryCreateDiscoveredInstance",o,r,t)(p,e.system.networkClient,n,l,o,t,r);if(c&&!m.isAlias(c.environment))throw ve(ze);return m}async function Rc(e,t,r,n,o){if(o)try{e.removeAccount(o,n),r.verbose("0s4z6h",n)}catch(e){r.error("0mgg1d",n)}else try{r.verbose("0zj631",n),e.clear(n),await t.clearKeystore(n)}catch(e){r.error("12ih0c",n)}}async function Oc(e,t,r,n,o){const i=e.authority||t.auth.authority,s=[...e&&e.scopes||[]],a={...e,correlationId:e.correlationId,authority:i,scopes:s};if(a.authenticationScheme){if(a.authenticationScheme===G.SSH){if(!e.sshJwk)throw ve(Le);if(!e.sshKid)throw ve(He)}n.verbose("1ecmns",o)}else a.authenticationScheme=G.BEARER,n.verbose("1l4fwv",o);return a}async function Mc(e,t,r,n,o){const i=await Un(Oc,ya,o,n,e.correlationId)(e,r,n,o,e.correlationId);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}}function xc(e,t){let r;const n=e.httpMethod;if(t===Hr.EAR){if(n&&n!==g)throw ve(je);r=g}else r=n||u;return r}class qc extends Sc{initializeLogoutRequest(e){this.logger.verbose("0546u4",this.correlationId);const t={correlationId:this.correlationId,...e};if(e)if(e.logoutHint)this.logger.verbose("12k4l4",this.correlationId);else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("0st5di",this.correlationId),t.logoutHint=r)}else this.logger.verbose("0pdtc3",this.correlationId);else this.logger.verbose("07ndze",this.correlationId);return e&&null===e.postLogoutRedirectUri?this.logger.verbose("0ljv63",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("1vamm6",t.correlationId),t.postLogoutRedirectUri=vr.getAbsoluteUrl(e.postLogoutRedirectUri,ta())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("15m5g7",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("1f4xlz",t.correlationId),t.postLogoutRedirectUri=vr.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,ta())):(this.logger.verbose("17s5rf",t.correlationId),t.postLogoutRedirectUri=vr.getAbsoluteUrl(ta(),ta())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("0mvp54",this.correlationId)}else this.logger.verbose("1e7bdp",this.correlationId);return null}async createAuthCodeClient(e){const t=await Un(this.getClientConfiguration.bind(this),ka,this.logger,this.performanceClient,this.correlationId)(e);return new po(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:n,requestExtraQueryParameters:o,account:i}=e,s=e.authority||await Un(Pc,pa,this.logger,this.performanceClient,this.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:s,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:a.loggerCallback,piiLoggingEnabled:a.piiLoggingEnabled,logLevel:a.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:xi,version:fc,cpu:"",os:""},telemetry:this.config.telemetry}}}async function Nc(e,t,r,n,o,i,s,a){const c=_c(e.redirectUri,r.auth.redirectUri,i,a),h={interactionType:t},l=In(n,e&&e.state||"",h),d={...await Un(Oc,ya,i,s,a)({...e,correlationId:a},r,s,i,a),redirectUri:c,state:l,nonce:e.nonce||Ms(),responseMode:r.auth.OIDCOptions.responseMode},u={...d,httpMethod:xc(d,r.system.protocolMode)};if(e.loginHint||e.sid)return u;const g=e.account||o.getActiveAccount(a);return g&&(i.verbose("1eqlb3",a),i.verbosePii("0tf99t",a),u.account=g),u}function Uc(e,t,r,n){const o=or(e);if(!o)throw nr(e)?(r.error("13pl0s",n),r.errorPii("1097vx",n),Ei(Ho)):(r.error("18h0l1",n),Ei(Uo));return o}function Lc(e,t,r){if(!e.state)throw Ei(Lo);const n=function(e,t){if(!t)return null;try{return Cn(e.base64Decode,t).libraryState.meta}catch(e){throw be(et)}}(t,e.state);if(!n)throw Ei(Do);if(n.interactionType!==r)throw Ei(Fo)}class Hc{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async handleCodeResponse(e,t){let r;try{r=function(e,t){if(Co(e,t),!e.code)throw be(wt);return e}(e,t.state)}catch(e){throw e instanceof nn&&e.subError===$o?Ei($o):e}return Un(this.handleCodeResponseFromServer.bind(this),Rn,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.logger.trace("0mf2hb",t.correlationId),this.authCodeRequest.code=e.code,r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await Un(this.authModule.acquireToken.bind(this.authModule),"authClientAcquireToken",this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Yn}:e.loginHint?{credential:e.loginHint,type:Zn}:null}}class Dc extends we{constructor(e,t,r){super(e,t||Si(e)),Object.setPrototypeOf(this,Dc.prototype),this.name="NativeAuthError",this.ext=r}}function Fc(e){if(e.ext&&e.ext.status&&("PERSISTENT_ERROR"===e.ext.status||"DISABLED"===e.ext.status))return!0;if(e.ext&&e.ext.error&&-2147186943===e.ext.error)return!0;switch(e.errorCode){case"ContentError":case"PageException":return!0;default:return!1}}function Kc(e,t,r){if(r&&r.status)switch(r.status){case"ACCOUNT_UNAVAILABLE":return wn(sn,Si(e));case"USER_INTERACTION_REQUIRED":return new fn(e,t);case"USER_CANCEL":return Ei($o);case"NO_NETWORK":return Ei(ri);case"UX_NOT_ALLOWED":return wn(cn)}return new Dc(e,t,r)}class Bc extends qc{async acquireToken(e){const t=Ec(is.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),r=await Un(this.getClientConfiguration.bind(this),ka,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),n=new fo(r,this.performanceClient);this.logger.verbose("0wa871",this.correlationId);try{const t=(await Un(n.acquireCachedToken.bind(n),"silentFlowClientAcquireCachedToken",this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof _i&&e.errorCode===ai&&this.logger.verbose("06wena",this.correlationId),e}}logout(e){this.logger.verbose("1rkurh",this.correlationId);const t=this.initializeLogoutRequest(e);return Rc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,t.account)}}class zc extends Sc{constructor(e,t,r,n,o,i,s,a,c,h,l,d){super(e,t,r,n,o,i,a,d,c),this.apiId=s,this.accountId=h,this.platformAuthProvider=c,this.nativeStorageManager=l,this.silentCacheClient=new Bc(e,this.nativeStorageManager,r,n,o,i,a,d,c);const u=this.platformAuthProvider.getExtensionName();this.skus=bo.makeExtraSkuString({libraryName:xi,libraryVersion:fc,extensionName:u,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[ge]:this.skus}}async acquireToken(e,t){this.logger.trace("03qeos",this.correlationId);const r=this.performanceClient.startMeasurement(ma,e.correlationId),n=vn(),o=Ec(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const i=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,i);return r.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){if(t===ds.AccessToken)throw this.logger.info("0eitbc",this.correlationId),e;this.logger.info("0957j1",this.correlationId)}const s=await this.platformAuthProvider.sendMessage(i);return await this.handleNativeResponse(s,i,n).then((e=>(r.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),o.clearNativeBrokerErrorCode(),e))).catch((e=>{throw r.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e}))}catch(e){throw e instanceof Dc&&o.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:_t.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("1ndf3e",this.correlationId),be(pt);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},t.correlationId);if(!r)throw be(pt);try{const e=this.createSilentCacheRequest(t,r),n=await this.silentCacheClient.acquireToken(e),o={...r,idTokenClaims:n?.idTokenClaims,idToken:n?.idToken};return{...n,account:o}}catch(e){throw e}}async acquireTokenRedirect(e,t,r){this.logger.trace("0luikq",this.correlationId);const n=await this.initializeNativeRequest(e),o=r?.navigateToLoginRequestUrl??!0;try{await this.platformAuthProvider.sendMessage(n)}catch(e){if(e instanceof Dc){if(Ec(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).setNativeBrokerErrorCode(e.errorCode),Fc(e))throw e}}this.browserStorage.setTemporaryCache(rs,JSON.stringify(n),!0);const i={apiId:is.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=o?window.location.href:_c(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId);t.end({success:!0}),await this.navigationClient.navigateExternal(s,i)}async handleRedirectPromise(e,t){if(this.logger.trace("1c5lhw",this.correlationId),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",this.correlationId),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("0a6zjb",this.correlationId),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:n,...o}=r;n&&this.logger.verbose("0ac34v",this.correlationId),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(rs));const i=vn();try{this.logger.verbose("003x5a",this.correlationId);const e=await this.platformAuthProvider.sendMessage(o),t=await this.handleNativeResponse(e,o,i);return Ec(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).clearNativeBrokerErrorCode(),t}catch(e){throw e}}logout(){return this.logger.trace("0u2sjm",this.correlationId),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){this.logger.trace("1bojln",this.correlationId);const n=wr(e.id_token,ys),o=this.createHomeAccountIdentifier(e,n),i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId},this.correlationId)?.homeAccountId;if(t.extraParameters?.child_client_id&&e.account.id!==t.accountId)this.logger.info("1ub1in",this.correlationId);else if(o!==i&&e.account.id!==t.accountId)throw Kc("user_switch");const s=await Pc(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,t.authority),a=Xn(this.browserStorage,s,o,ys,this.correlationId,n,e.client_info,void 0,n.tid,void 0,e.account.id);e.expires_in=Number(e.expires_in);const c=await this.generateAuthenticationResult(e,t,n,a,s.canonicalAuthority,r);return await this.cacheAccount(a,Ir(n)),await this.cacheNativeTokens(e,t,o,n,e.access_token,c.tenantId,r),c}createHomeAccountIdentifier(e,t){return Kr(e.client_info||"",xr,this.logger,this.browserCrypto,this.correlationId,t)}generateScopes(e,t){return t?_t.fromString(t):_t.fromString(e)}async generatePopAccessToken(e,t){if(t.tokenType===G.POP&&t.signPopToken){if(e.shr)return this.logger.trace("0coqhu",this.correlationId),e.shr;const r=new Hn(this.browserCrypto,this.performanceClient),n={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce,correlationId:this.correlationId};if(!t.keyId)throw be(vt);return r.signPopToken(e.access_token,t.keyId,n)}return e.access_token}async generateAuthenticationResult(e,t,r,n,o,i){const s=this.addTelemetryFromNativeResponse(e.properties.MATS),a=this.generateScopes(t.scope,e.scope),c=e.account.properties||{},h=c.UID||r.oid||r.sub||"",l=c.TenantId||r.tid||"",d=yr(Dr(n),void 0,r,e.id_token);d.nativeAccountId!==e.account.id&&(d.nativeAccountId=e.account.id);const u=await this.generatePopAccessToken(e,t),g=t.tokenType===G.POP?G.POP:G.BEARER;return{authority:o,uniqueId:h,tenantId:l,scopes:a.asArray(),account:d,idToken:e.id_token,idTokenClaims:r,accessToken:u,fromCache:!!s&&this.isResponseFromCache(s),expiresOn:Tn(i+e.expires_in),tokenType:g,correlationId:this.correlationId,state:e.state,fromPlatformBroker:!0}}async cacheAccount(e,t){await this.browserStorage.setAccount(e,this.correlationId,t),this.browserStorage.removeAccountContext(Dr(e),this.correlationId)}cacheNativeTokens(e,t,r,n,o,i,s){const a=Fn(r,t.authority,e.id_token||"",t.clientId,n.tid||""),c=s+(t.tokenType===G.POP?240:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),h=this.generateScopes(e.scope,t.scope),l={idToken:a,accessToken:Kn(r,t.authority,o,t.clientId,n.tid||i,h.printScopes(),c,0,ys,void 0,t.tokenType,void 0,t.keyId)};return this.nativeStorageManager.saveCacheRecord(l,this.correlationId,Ir(n),t.storeInCache)}getExpiresInValue(e,t){return e===G.POP?240:("string"==typeof t?parseInt(t,10):t)||0}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch(e){this.logger.error("0b3l57",this.correlationId)}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("1okqev",this.correlationId),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("04j6wj",this.correlationId);const t=await this.getCanonicalAuthority(e),{scopes:r,...n}=e,o=new _t(r||[]);o.appendScopes(p);const i={...n,accountId:this.accountId,clientId:this.config.auth.clientId,authority:t.urlString,scope:o.printScopes(),redirectUri:_c(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraParameters},extendedExpiryToken:!1,keyId:e.popKid};if(i.signPopToken&&e.popKid)throw Ei(Ii);if(this.handleExtraBrokerParams(i),i.extraParameters=i.extraParameters||{},i.extraParameters.telemetry=Ui,e.authenticationScheme===G.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce,correlationId:this.correlationId},r=new Hn(this.browserCrypto,this.performanceClient);let n;if(i.keyId)n=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:i.keyId})),i.signPopToken=!1;else{const e=await Un(r.generateCnf.bind(r),On,this.logger,this.performanceClient,this.correlationId)(t,this.logger);n=e.reqCnfString,i.keyId=e.kid,i.signPopToken=!0}i.reqCnf=n}return this.addRequestSKUs(i),i}async getCanonicalAuthority(e){const t=e.authority||this.config.auth.authority,{azureCloudOptions:r,account:n}=e;n&&await Pc(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,t,r,void 0,n);const o=new vr(t);return o.validateAsUri(),o}getPrompt(e){switch(this.apiId){case is.ssoSilent:case is.acquireTokenSilent_silentFlow:return this.logger.trace("1hiwaz",this.correlationId),R.NONE}if(e)switch(e){case R.NONE:case R.CONSENT:case R.LOGIN:return this.logger.trace("1ynje4",this.correlationId),e;default:throw this.logger.trace("0nkr6q",this.correlationId),Ei(yi)}else this.logger.trace("1qlu04",this.correlationId)}handleExtraBrokerParams(e){const t=e.extraParameters&&e.extraParameters.hasOwnProperty(pe)&&e.extraParameters.hasOwnProperty(me)&&e.extraParameters.hasOwnProperty(ce);if(!e.embeddedClientId&&!t)return;let r="";const n=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[me],r=e.extraParameters[ce]),e.extraParameters={child_client_id:r,child_redirect_uri:n},this.performanceClient?.addFields({embeddedClientId:r,embeddedRedirectUri:n},e.correlationId)}}async function jc(e,t,r,n,o){const i=wo({...e.auth,authority:t},r,n,o);if(Dt(i,{sku:xi,version:fc,os:"",cpu:""}),e.system.protocolMode!==Hr.OIDC&&Ft(i,e.telemetry.application),r.platformBroker&&(function(e){e.set("nativebroker","1")}(i),r.authenticationScheme===G.POP)){const e=new Na(n,o),t=new Hn(e,o);let s;if(r.popKid)s=e.encodeKid(r.popKid);else{s=(await Un(t.generateCnf.bind(t),On,n,o,r.correlationId)(r,n)).reqCnfString}Xt(i,s)}return Et(i,r.correlationId,o),i}async function $c(e,t,r,n,o){if(!r.codeChallenge)throw ve(xe);const i=await Un(jc,"getStandardParams",n,o,r.correlationId)(e,t,r,n,o);return Pt(i,O),Bt(i,r.codeChallenge,c),Qt(i,{...r.extraQueryParameters,...r.extraParameters}),Io(t,i)}async function Jc(e,t,r,n,o,i){if(!n.earJwk)throw Ei(Mo);const s=await jc(t,r,n,o,i);Pt(s,M),function(e,t){e.set("ear_jwk",encodeURIComponent(t)),e.set("ear_jwe_crypto","eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}(s,n.earJwk),Bt(s,n.codeChallenge,c),Qt(s,{...n.extraParameters});const a=new Map;Qt(a,n.extraQueryParameters||{});return Gc(e,Io(r,a),s)}async function Wc(e,t,r,n,o,i){const s=await jc(t,r,n,o,i);Pt(s,O),Bt(s,n.codeChallenge,n.codeChallengeMethod||c),Qt(s,{...n.extraParameters});const a=new Map;Qt(a,n.extraQueryParameters||{});return Gc(e,Io(r,a),s)}function Gc(e,t,r){const n=e.createElement("form");return n.method="post",n.action=t,r.forEach(((t,r)=>{const o=e.createElement("input");o.hidden=!0,o.name=r,o.value=t,n.appendChild(o)})),e.body.appendChild(n),n}async function Qc(e,t,r,n,o,i,s,a,c,h){if(a.verbose("11qcow",e.correlationId),!h)throw Ei(mi);const l=new Na(a,c),d=new zc(n,o,l,a,s,n.system.navigationClient,r,c,h,t,i,e.correlationId),{userRequestState:u}=Cn(l.base64Decode,e.state);return Un(d.acquireToken.bind(d),ma,a,c,e.correlationId)({...e,state:u,prompt:void 0})}async function Vc(e,t,r,n,o,i,s,a,c,h,l,d){if(ro.removeThrottle(s,o.auth.clientId,e),t.accountId)return Un(Qc,Aa,h,l,e.correlationId)(e,t.accountId,n,o,s,a,c,h,l,d);const u={...e,code:t.code||"",codeVerifier:r},g=new Hc(i,s,u,h,l);return await Un(g.handleCodeResponse.bind(g),"handleCodeResponse",h,l,e.correlationId)(t,e)}async function Xc(e,t,r,n,o,i,s,a,c,h,l){if(ro.removeThrottle(i,n.auth.clientId,e),Co(t,e.state),!t.ear_jwe)throw Ei(xo);if(!e.earJwk)throw Ei(Mo);const d=JSON.parse(await Un(Ns,"decryptEarResponse",c,h,e.correlationId)(e.earJwk,t.ear_jwe));if(d.accountId)return Un(Qc,Aa,c,h,e.correlationId)(e,d.accountId,r,n,i,s,a,c,h,l);const u=new Vn(n.auth.clientId,i,new Na(c,h),c,h,null,null);u.validateTokenResponse(d,e.correlationId);const g={code:"",state:e.state,nonce:e.nonce,client_info:d.client_info,cloud_graph_host_name:d.cloud_graph_host_name,cloud_instance_host_name:d.cloud_instance_host_name,cloud_instance_name:d.cloud_instance_name,msgraph_host:d.msgraph_host};return await Un(u.handleServerTokenResponse.bind(u),Mn,c,h,e.correlationId)(d,o,vn(),e,g,void 0,void 0,void 0,void 0)}async function Yc(e,t,r){const n=Nn(Zc,"generateCodeVerifier",t,e,r)(e,t,r);return{verifier:n,challenge:await Un(eh,"generateCodeChallengeFromVerifier",t,e,r)(n,e,t,r)}}function Zc(e,t,r){try{const n=new Uint8Array(32);Nn(Rs,"getRandomValues",t,e,r)(n);return ps(n)}catch(e){throw Ei(Oo)}}async function eh(e,t,r,n){try{const o=await Un(Ps,"sha256Digest",r,t,n)(e);return ps(new Uint8Array(o))}catch(e){throw Ei(Oo)}}class th{navigateInternal(e,t){return th.defaultNavigateWindow(e,t)}navigateExternal(e,t){return th.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(((e,r)=>{setTimeout((()=>{r(Ei(Ti,"failed_to_redirect"))}),t.timeout)}))}}class rh{async sendGetRequestAsync(e,t){let r,n={},o=0;const i=nh(t);try{r=await fetch(e,{method:Wi,headers:i})}catch(e){throw oo(Ei(window.navigator.onLine?oi:ri),void 0,void 0,e)}n=oh(r.headers);try{return o=r.status,{headers:n,body:await r.json(),status:o}}catch(e){throw oo(Ei(ii),o,n,e)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",n=nh(t);let o,i=0,s={};try{o=await fetch(e,{method:Gi,headers:n,body:r})}catch(e){throw oo(Ei(window.navigator.onLine?ni:ri),void 0,void 0,e)}s=oh(o.headers);try{return i=o.status,{headers:s,body:await o.json(),status:i}}catch(e){throw oo(Ei(ii),i,s,e)}}}function nh(e){try{const t=new Headers;if(!e||!e.headers)return t;const r=e.headers;return Object.entries(r).forEach((([e,r])=>{t.append(e,r)})),t}catch(e){throw oo(Ei(Ci),void 0,void 0,e)}}function oh(e){try{const t={};return e.forEach(((e,r)=>{t[r]=e})),t}catch(e){throw Ei(vi)}}function ih({auth:r,cache:n,system:o,telemetry:c},h){const l={clientId:"",authority:`${t}`,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:"undefined"!=typeof window&&window.location?window.location.href.split("?")[0].split("#")[0]:"",postLogoutRedirectUri:"",clientCapabilities:[],OIDCOptions:{responseMode:x.FRAGMENT,defaultScopes:[i,s,a]},azureCloudOptions:{azureCloudInstance:pr.None,tenant:""},instanceAware:!1},d={cacheLocation:Ji.SessionStorage,cacheRetentionDays:5},u={loggerCallback:()=>{},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},g={...{...Gr,loggerOptions:u,networkClient:h?new rh:yo,navigationClient:new th,popupBridgeTimeout:o?.popupBridgeTimeout||6e4,iframeBridgeTimeout:o?.iframeBridgeTimeout||1e4,redirectNavigationTimeout:3e4,allowRedirectInIframe:!1,navigatePopups:!0,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:o?.nativeBrokerHandshakeTimeout||2e3,protocolMode:Hr.AAD},...o,loggerOptions:o?.loggerOptions||u},p={application:{appName:"",appVersion:""},client:new Wr};if(o?.protocolMode!==Hr.OIDC&&r?.OIDCOptions){new dr(g.loggerOptions).warning(JSON.stringify(ve(Ke)),"")}if(o?.protocolMode&&o.protocolMode===Hr.OIDC&&g?.allowPlatformBroker)throw ve(Be);return{auth:{...l,...r,OIDCOptions:{...l.OIDCOptions,...r?.OIDCOptions}},cache:{...d,...n},system:g,telemetry:{...p,...c}}}class sh{constructor(e,t,r,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement("nativeMessageHandlerHandshake"),this.platformAuthType=Ki}async sendMessage(e){this.logger.trace("0on4p2",e.correlationId);const t={method:ji,request:e},r={channel:qi,extensionId:this.extensionId,responseId:Ms(),body:t};this.logger.trace("1qadfi",e.correlationId),this.logger.tracePii("1xm533",e.correlationId),this.messageChannel.port1.postMessage(r);const n=await new Promise(((e,t)=>{this.resolvers.set(r.responseId,{resolve:e,reject:t})}));return this.validatePlatformBrokerResponse(n)}static async createProvider(e,t,r,n){e.trace("15zfnw",n);try{const o=new sh(e,t,r,Ni);return await o.sendHandshakeRequest(n),o}catch(o){const i=new sh(e,t,r);return await i.sendHandshakeRequest(n),i}}async sendHandshakeRequest(e){this.logger.trace("1dpg9o",e),window.addEventListener("message",this.windowListener,!1);const t={channel:qi,extensionId:this.extensionId,responseId:Ms(),body:{method:Bi}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(t,window.origin,[this.messageChannel.port2]),new Promise(((e,r)=>{this.handshakeResolvers.set(t.responseId,{resolve:e,reject:r}),this.timeoutId=window.setTimeout((()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(Ei(gi)),this.handshakeResolvers.delete(t.responseId)}),this.handshakeTimeoutMs)}))}onWindowMessage(e){const t=da();if(this.logger.trace("0jpn5u",t),e.source!==window)return;const r=e.data;if(r.channel&&r.channel===qi&&(!r.extensionId||r.extensionId===this.extensionId)&&r.body.method===Bi){const e=this.handshakeResolvers.get(r.responseId);if(!e)return void this.logger.trace("07buhm",t);this.logger.verbose(r.extensionId?"0xrkug":"No extension installed",t),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject(Ei(pi))}}onChannelMessage(e){const t=da();this.logger.trace("1py8yf",t);const r=e.data,n=this.resolvers.get(r.responseId),o=this.handshakeResolvers.get(r.responseId);try{const e=r.body.method;if(e===$i){if(!n)return;const e=r.body.response;if(this.logger.trace("19hpgm",t),this.logger.tracePii("179a24",t),"Success"!==e.status)n.reject(Kc(e.code,e.description,e.ext));else{if(!e.result)throw Ie(vo,"Event does not contain result.");e.result.code&&e.result.description?n.reject(Kc(e.result.code,e.result.description,e.result.ext)):n.resolve(e.result)}this.resolvers.delete(r.responseId)}else if(e===zi){if(!o)return void this.logger.trace("082qnt",t);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=r.extensionId,this.extensionVersion=r.body.version,this.logger.verbose("0yf5ib",t),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(r.responseId)}}catch(e){this.logger.error("0xf978",t),this.logger.errorPii("04i99o",t),this.logger.errorPii("0xdvsy",t),n?n.reject(e):o&&o.reject(e)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Ie(vo,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.getExtensionId()===Ni?"chrome":this.getExtensionId()?.length?"unknown":void 0}}class ah{constructor(e,t,r){this.logger=e,this.performanceClient=t,this.correlationId=r,this.platformAuthType=Fi}static async createProvider(e,t,r){if(e.trace("12mj4a",r),window.navigator?.platformAuthentication){const n=await window.navigator.platformAuthentication.getSupportedContracts(Li);if(n?.includes(Di))return e.trace("1h5q1r",r),new ah(e,t,r)}}getExtensionId(){return Li}getExtensionVersion(){return""}getExtensionName(){return Hi}async sendMessage(e){this.logger.trace("02bcil",e.correlationId);try{const t=this.initializePlatformDOMRequest(e),r=await window.navigator.platformAuthentication.executeGetToken(t);return this.validatePlatformBrokerResponse(r,e.correlationId)}catch(t){throw this.logger.error("11im7g",e.correlationId),t}}initializePlatformDOMRequest(e){this.logger.trace("15d6yv",e.correlationId);const{accountId:t,clientId:r,authority:n,scope:o,redirectUri:i,correlationId:s,state:a,storeInCache:c,embeddedClientId:h,extraParameters:l,...d}=e,u=this.getDOMExtraParams(d);return{accountId:t,brokerId:this.getExtensionId(),authority:n,clientId:r,correlationId:s||this.correlationId,extraParameters:{...l,...u},isSecurityTokenService:!1,redirectUri:i,scope:o,state:a,storeInCache:c,embeddedClientId:h}}validatePlatformBrokerResponse(e,t){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace("0h4vei",t),this.convertToPlatformBrokerResponse(e,t);if(e.hasOwnProperty("error")){const r=e;if(!1===r.isSuccess&&r.error&&r.error.code)throw this.logger.trace("0g92vm",t),Kc(r.error.code,r.error.description,{error:parseInt(r.error.errorCode),protocol_error:r.error.protocolError,status:r.error.status,properties:r.error.properties})}}throw Ie(vo,"Response missing expected properties.")}convertToPlatformBrokerResponse(e,t){this.logger.trace("14913t",t);return{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce(((e,[t,r])=>(e[t]=String(r),e)),{})}}}async function ch(e,t,r,n){e.trace("134j0v",r);const o=function(){let e;try{return e=window[Ji.SessionStorage],"true"===e?.getItem(Ya)}catch(e){return!1}}();let i;e.trace("04c81g",r);try{o&&(i=await ah.createProvider(e,t,r)),i||(e.trace("0l3na8",r),i=await sh.createProvider(e,n||2e3,t,r))}catch(t){e.trace("0icbd7",t)}return i}function hh(e,t,r,n,o){if(t.trace("0uko3r",r),!e.system.allowPlatformBroker)return t.trace("04hozs",r),!1;if(!n)return t.trace("0kvv1r",r),!1;if(o)switch(o){case G.BEARER:case G.POP:return t.trace("18tev1",r),!0;default:return t.trace("1dd2nh",r),!1}return!0}class lh extends qc{constructor(e,t,r,n,o,i,s,a,c,h){super(e,t,r,n,o,i,s,c,h),this.nativeStorage=a,this.eventHandler=o}acquireToken(e,t){let r;try{if(r={popupName:this.generatePopupName(e.scopes||p,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:!this.config.system.navigatePopups},this.correlationId),this.config.system.navigatePopups){const n={...e,httpMethod:xc(e,this.config.system.protocolMode)};return this.logger.verbose("1f9ok3",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(n,r,t)}return this.logger.verbose("162h4u",this.correlationId),this.acquireTokenPopupAsync(e,r,t)}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("068rup",this.correlationId);const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},n=e&&e.authority,o=e&&e.mainWindowRedirectUri;return this.config.system.navigatePopups?(this.logger.verbose("1a28da",this.correlationId),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,n,o)):(this.logger.verbose("1phd8u",this.correlationId),this.logoutPopupAsync(t,r,n,o))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(t,r,n){this.logger.verbose("1g77pg",this.correlationId);const o=await Un(Nc,Ta,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Popup,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);r.popup&&la(o.authority);const i=hh(this.config,this.logger,this.correlationId,this.platformAuthProvider,t.authenticationScheme);return o.platformBroker=i,this.config.system.protocolMode===Hr.EAR?this.executeEarFlow(o,r,n):this.executeCodeFlow(o,r,n)}async executeCodeFlow(t,r,n){const o=t.correlationId,i=Ec(is.acquireTokenPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),s=n||await Un(Yc,Ea,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),a={...t,codeChallenge:s.challenge};try{const n=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,o)({serverTelemetryManager:i,requestAuthority:a.authority,requestAzureCloudOptions:a.azureCloudOptions,requestExtraQueryParameters:a.extraQueryParameters,account:a.account});if(a.httpMethod===g)return await this.executeCodeFlowWithPost(a,r,n,s.verifier);{const i=await Un($c,Pn,this.logger,this.performanceClient,o)(this.config,n.authority,a,this.logger,this.performanceClient),c=this.initiateAuthRequest(i,r);this.eventHandler.emitEvent(pc.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:c},null);const h=await ea(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,t),l=Nn(Uc,_a,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return await Un(Vc,Sa,this.logger,this.performanceClient,o)(t,l,s.verifier,is.acquireTokenPopup,this.config,n,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(e){throw r.popup?.close(),e instanceof we&&(e.setCorrelationId(this.correlationId),i.cacheFailedRequest(e)),e}}async executeEarFlow(e,t,r){const{correlationId:n,authority:o,azureCloudOptions:i,extraQueryParameters:s,account:a}=e,c=await Un(Pc,pa,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,i,s,a),h=await Un(qs,Oa,this.logger,this.performanceClient,n)(),l=r||await Un(Yc,Ea,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),d={...e,earJwk:h,codeChallenge:l.challenge},u=t.popup||this.openPopup("about:blank",t);(await Jc(u.document,this.config,c,d,this.logger,this.performanceClient)).submit();const g=await Un(ea,Ca,this.logger,this.performanceClient,n)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,d),p=Nn(Uc,_a,this.logger,this.performanceClient,this.correlationId)(g,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);if(!p.ear_jwe&&p.code){const t=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,n)({serverTelemetryManager:Ec(is.acquireTokenPopup,this.config.auth.clientId,n,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:c});return Un(Vc,Sa,this.logger,this.performanceClient,n)(d,p,l.verifier,is.acquireTokenPopup,this.config,t,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}return Un(Xc,ba,this.logger,this.performanceClient,n)(d,p,is.acquireTokenPopup,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,t,r,n){const o=e.correlationId,i=await Un(Pc,pa,this.logger,this.performanceClient,o)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger),s=t.popup||this.openPopup("about:blank",t);(await Wc(s.document,this.config,i,e,this.logger,this.performanceClient)).submit();const a=await Un(ea,Ca,this.logger,this.performanceClient,o)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e),c=Nn(Uc,_a,this.logger,this.performanceClient,this.correlationId)(a,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return Un(Vc,Sa,this.logger,this.performanceClient,o)(e,c,n,is.acquireTokenPopup,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(t,r,n,o){this.logger.verbose("0b7yrk",this.correlationId),this.eventHandler.emitEvent(pc.LOGOUT_START,e.InteractionType.Popup,t);const i=Ec(is.logoutPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{await Rc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,t.account);const s=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n,account:t.account||void 0});try{s.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId&&t.postLogoutRedirectUri&&s.authority.protocolMode===Hr.OIDC){if(this.eventHandler.emitEvent(pc.LOGOUT_SUCCESS,e.InteractionType.Popup,t),o){const e={apiId:is.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=vr.getAbsoluteUrl(o,ta());await this.navigationClient.navigateInternal(t,e)}return void r.popup?.close()}}const a=s.getLogoutUri(t);this.eventHandler.emitEvent(pc.LOGOUT_SUCCESS,e.InteractionType.Popup,t);const c=this.openPopup(a,r);if(this.eventHandler.emitEvent(pc.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:c},null),await ea(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,t).catch((()=>{})),o){const e={apiId:is.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=vr.getAbsoluteUrl(o,ta());this.logger.verbose("0qcur2",this.correlationId),this.logger.verbosePii("0oj7lk",this.correlationId),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("03zgcf",this.correlationId)}catch(t){throw r.popup?.close(),t instanceof we&&(t.setCorrelationId(this.correlationId),i.cacheFailedRequest(t)),this.eventHandler.emitEvent(pc.LOGOUT_FAILURE,e.InteractionType.Popup,null,t),this.eventHandler.emitEvent(pc.LOGOUT_END,e.InteractionType.Popup),t}this.eventHandler.emitEvent(pc.LOGOUT_END,e.InteractionType.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii("1kcr9k",this.correlationId),this.openPopup(e,t);throw this.logger.error("1l7hyp",this.correlationId),Ei(No)}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii("0cgeo7",this.correlationId),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("0c2awd",this.correlationId),r=this.openSizedPopup(e,t)),!r)throw Ei(jo);return r.focus&&r.focus(),this.currentWindow=r,r}catch(e){throw this.logger.error("0dxfb9",this.correlationId),Ei(zo)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:n}){const o=n.screenLeft?n.screenLeft:n.screenX,i=n.screenTop?n.screenTop:n.screenY,s=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,a=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=r.popupSize?.width,h=r.popupSize?.height,l=r.popupPosition?.top,d=r.popupPosition?.left;return(!c||c<0||c>s)&&(this.logger.verbose("08vfmo",this.correlationId),c=Ri),(!h||h<0||h>a)&&(this.logger.verbose("09cxa0",this.correlationId),h=Oi),(!l||l<0||l>a)&&(this.logger.verbose("1qh4wo",this.correlationId),l=Math.max(0,a/2-Oi/2+i)),(!d||d<0||d>s)&&(this.logger.verbose("1sz3en",this.correlationId),d=Math.max(0,s/2-Ri/2+o)),n.open(e,t,`width=${c}, height=${h}, top=${l}, left=${d}, scrollbars=yes`)}generatePopupName(e,t){return`${Mi}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Mi}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}class dh extends qc{constructor(e,t,r,n,o,i,s,a,c,h){super(e,t,r,n,o,i,s,c,h),this.nativeStorage=a}async acquireToken(t){const r=await Un(Nc,Ta,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Redirect,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);r.platformBroker=hh(this.config,this.logger,this.correlationId,this.platformAuthProvider,t.authenticationScheme);const n=t=>{t.persisted&&(this.logger.verbose("0udvtt",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),this.eventHandler.emitEvent(pc.RESTORE_FROM_BFCACHE,e.InteractionType.Redirect))},o=this.getRedirectStartPage(t.redirectStartPage);this.logger.verbosePii("0zao0a",this.correlationId),this.browserStorage.setTemporaryCache(Xi,o,!0),window.addEventListener("pageshow",n);try{this.config.system.protocolMode===Hr.EAR?await this.executeEarFlow(r):await this.executeCodeFlow(r)}catch(e){throw e instanceof we&&e.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",n),e}}async executeCodeFlow(e){const t=e.correlationId,r=Ec(is.acquireTokenRedirect,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),n=await Un(Yc,Ea,this.logger,this.performanceClient,t)(this.performanceClient,this.logger,t),o={...e,codeChallenge:n.challenge};this.browserStorage.cacheAuthorizeRequest(o,this.correlationId,n.verifier);try{if(o.httpMethod===g)return await this.executeCodeFlowWithPost(o);{const t=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),n=await Un($c,Pn,this.logger,this.performanceClient,e.correlationId)(this.config,t.authority,o,this.logger,this.performanceClient);return await this.initiateAuthRequest(n)}}catch(e){throw e instanceof we&&(e.setCorrelationId(this.correlationId),r.cacheFailedRequest(e)),e}}async executeEarFlow(e){const{correlationId:t,authority:r,azureCloudOptions:n,extraQueryParameters:o,account:i}=e,s=await Un(Pc,pa,this.logger,this.performanceClient,t)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=await Un(qs,Oa,this.logger,this.performanceClient,t)(),c=await Un(Yc,Ea,this.logger,this.performanceClient,t)(this.performanceClient,this.logger,t),h={...e,earJwk:a,codeChallenge:c.challenge};this.browserStorage.cacheAuthorizeRequest(h,this.correlationId,c.verifier);return(await Jc(document,this.config,s,h,this.logger,this.performanceClient)).submit(),new Promise(((e,t)=>{setTimeout((()=>{t(Ei(Ti,"failed_to_redirect"))}),this.config.system.redirectNavigationTimeout)}))}async executeCodeFlowWithPost(e){const t=e.correlationId,r=await Un(Pc,pa,this.logger,this.performanceClient,t)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger);this.browserStorage.cacheAuthorizeRequest(e,this.correlationId);return(await Wc(document,this.config,r,e,this.logger,this.performanceClient)).submit(),new Promise(((e,t)=>{setTimeout((()=>{t(Ei(Ti,"failed_to_redirect"))}),this.config.system.redirectNavigationTimeout)}))}async handleRedirectPromise(e,t,r,n){const o=Ec(is.handleRedirectPromise,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),i=n?.navigateToLoginRequestUrl??!0;try{const[s,a]=this.getRedirectResponse(n?.hash||"");if(!s)return this.logger.info("1qmv0q",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),"back_forward"!==function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?r.event.errorCode="no_server_response":this.logger.verbose("1eqegq",this.correlationId),null;const c=this.browserStorage.getTemporaryCache(Xi,this.correlationId,!0)||"",h=sr(c);if(h===sr(window.location.href)&&i){this.logger.verbose("11yred",this.correlationId),c.indexOf("#")>-1&&Qs(c);return await this.handleResponse(s,e,t,o)}if(!i)return this.logger.verbose("0v4sdv",this.correlationId),await this.handleResponse(s,e,t,o);if(!Vs()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Yi,a,!0);const r={apiId:is.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let n=!0;if(c&&"null"!==c)this.logger.verbose("08jpy1",this.correlationId),n=await this.navigationClient.navigateInternal(c,r);else{const e=ra();this.browserStorage.setTemporaryCache(Xi,e,!0),this.logger.warning("1dutq1",this.correlationId),n=await this.navigationClient.navigateInternal(e,r)}if(!n)return await this.handleResponse(s,e,t,o)}return null}catch(e){throw e instanceof we&&(e.setCorrelationId(this.correlationId),o.cacheFailedRequest(e)),e}}getRedirectResponse(t){this.logger.verbose("1c5i8m",this.correlationId);let r=t;r||(r=this.config.auth.OIDCOptions.responseMode===x.QUERY?window.location.search:window.location.hash);let n=or(r);if(n){try{Lc(n,this.browserCrypto,e.InteractionType.Redirect)}catch(e){return e instanceof we&&this.logger.error("0bkq6p",this.correlationId),[null,""]}return Gs(window),this.logger.verbose("00uvho",this.correlationId),[n,r]}const o=this.browserStorage.getTemporaryCache(Yi,this.correlationId,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Yi)),o&&(n=or(o),n)?(this.logger.verbose("001671",this.correlationId),[n,o]):[null,""]}async handleResponse(e,t,r,n){if(!e.state)throw Ei(Lo);const{authority:o,azureCloudOptions:i,extraQueryParameters:s,account:a}=t;if(e.ear_jwe){const r=await Un(Pc,pa,this.logger,this.performanceClient,t.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,i,s,a);return Un(Xc,ba,this.logger,this.performanceClient,t.correlationId)(t,e,is.acquireTokenRedirect,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const c=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority});return Un(Vc,Sa,this.logger,this.performanceClient,t.correlationId)(t,e,r,is.acquireTokenRedirect,this.config,c,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e){if(this.logger.verbose("0yaw2e",this.correlationId),e){this.logger.infoPii("1luf83",this.correlationId);const t={apiId:is.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},r=this.config.auth.onRedirectNavigate;if("function"==typeof r){this.logger.verbose("1nehvl",this.correlationId);return!1!==r(e)?(this.logger.verbose("1a0jxh",this.correlationId),void await this.navigationClient.navigateExternal(e,t)):void this.logger.verbose("09k5h5",this.correlationId)}return this.logger.verbose("0klwf7",this.correlationId),void await this.navigationClient.navigateExternal(e,t)}throw this.logger.info("0rlh4e",this.correlationId),Ei(No)}async logout(t){this.logger.verbose("1rkurh",this.correlationId);const r=this.initializeLogoutRequest(t),n=Ec(is.logout,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{this.eventHandler.emitEvent(pc.LOGOUT_START,e.InteractionType.Redirect,t),await Rc(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,r.account);const o={apiId:is.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},i=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t&&t.authority,requestExtraQueryParameters:t?.extraQueryParameters,account:t&&t.account||void 0});if(i.authority.protocolMode===Hr.OIDC)try{i.authority.endSessionEndpoint}catch{if(r.account?.homeAccountId)return void this.eventHandler.emitEvent(pc.LOGOUT_SUCCESS,e.InteractionType.Redirect,r)}const s=i.getLogoutUri(r);r.account?.homeAccountId&&this.eventHandler.emitEvent(pc.LOGOUT_SUCCESS,e.InteractionType.Redirect,r);const a=this.config.auth.onRedirectNavigate;if("function"!=typeof a)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,Vi),void await this.navigationClient.navigateExternal(s,o);if(!1!==a(s))return this.logger.verbose("06v57e",this.correlationId),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,Vi),void await this.navigationClient.navigateExternal(s,o);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("0xqes1",this.correlationId)}catch(t){throw t instanceof we&&(t.setCorrelationId(this.correlationId),n.cacheFailedRequest(t)),this.eventHandler.emitEvent(pc.LOGOUT_FAILURE,e.InteractionType.Redirect,null,t),this.eventHandler.emitEvent(pc.LOGOUT_END,e.InteractionType.Redirect),t}this.eventHandler.emitEvent(pc.LOGOUT_END,e.InteractionType.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return vr.getAbsoluteUrl(t,ta())}}async function uh(e,t,r,n){if(!e)throw r.info("1l7hyp",n),Ei(No);return Nn(mh,"silentHandlerLoadFrameSync",r,t,n)(e)}async function gh(e,t,r,n,o){const i=fh();if(!i.contentDocument)throw"No document associated with iframe!";return(await Wc(i.contentDocument,e,t,r,n,o)).submit(),i}async function ph(e,t,r,n,o){const i=fh();if(!i.contentDocument)throw"No document associated with iframe!";return(await Jc(i.contentDocument,e,t,r,n,o)).submit(),i}function mh(e){const t=fh();return t.src=e,t}function fh(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),e.setAttribute("allow","local-network-access *"),document.body.appendChild(e),e}class yh extends qc{constructor(e,t,r,n,o,i,s,a,c,h,l){super(e,t,r,n,o,i,a,h,l),this.apiId=s,this.nativeStorage=c}async acquireToken(t){t.loginHint||t.sid||t.account&&t.account.username||this.logger.warning("1kl318",this.correlationId);const r={...t};r.prompt?r.prompt!==R.NONE&&r.prompt!==R.NO_SESSION&&(this.logger.warning("0bmctg",this.correlationId),r.prompt=R.NONE):r.prompt=R.NONE;const n=await Un(Nc,Ta,this.logger,this.performanceClient,this.correlationId)(r,e.InteractionType.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);return n.platformBroker=hh(this.config,this.logger,this.correlationId,this.platformAuthProvider,n.authenticationScheme),la(n.authority),this.config.system.protocolMode===Hr.EAR?this.executeEarFlow(n):this.executeCodeFlow(n)}async executeCodeFlow(e){let t;const r=Ec(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{return t=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await Un(this.silentTokenHelper.bind(this),wa,this.logger,this.performanceClient,e.correlationId)(t,e)}catch(n){if(n instanceof we&&(n.setCorrelationId(this.correlationId),r.cacheFailedRequest(n)),!(t&&n instanceof we&&n.errorCode===Pi))throw n;return this.performanceClient.addFields({retryError:n.errorCode},this.correlationId),await Un(this.silentTokenHelper.bind(this),wa,this.logger,this.performanceClient,this.correlationId)(t,e)}}async executeEarFlow(e){const{correlationId:t,authority:r,azureCloudOptions:n,extraQueryParameters:o,account:i}=e,s=await Un(Pc,pa,this.logger,this.performanceClient,t)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,r,n,o,i),a=await Un(qs,Oa,this.logger,this.performanceClient,t)(),c=await Un(Yc,Ea,this.logger,this.performanceClient,t)(this.performanceClient,this.logger,t),h={...e,earJwk:a,codeChallenge:c.challenge};await Un(ph,Ia,this.logger,this.performanceClient,t)(this.config,s,h,this.logger,this.performanceClient);const l=this.config.auth.OIDCOptions.responseMode,d=await Un(ea,Ca,this.logger,this.performanceClient,t)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,e),u=Nn(Uc,_a,this.logger,this.performanceClient,t)(d,l,this.logger,this.correlationId);if(!u.ear_jwe&&u.code){const r=await Un(this.createAuthCodeClient.bind(this),va,this.logger,this.performanceClient,t)({serverTelemetryManager:Ec(this.apiId,this.config.auth.clientId,t,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:s});return Un(Vc,Sa,this.logger,this.performanceClient,t)(h,u,c.verifier,this.apiId,this.config,r,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}return Un(Xc,ba,this.logger,this.performanceClient,t)(h,u,this.apiId,this.config,s,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(Ei(Vo))}async silentTokenHelper(e,t){const r=t.correlationId,n=await Un(Yc,Ea,this.logger,this.performanceClient,r)(this.performanceClient,this.logger,r),o={...t,codeChallenge:n.challenge};if(t.httpMethod===g)await Un(gh,Ia,this.logger,this.performanceClient,r)(this.config,e.authority,o,this.logger,this.performanceClient);else{const t=await Un($c,Pn,this.logger,this.performanceClient,r)(this.config,e.authority,o,this.logger,this.performanceClient);await Un(uh,Ia,this.logger,this.performanceClient,r)(t,this.performanceClient,this.logger,r)}const i=this.config.auth.OIDCOptions.responseMode,s=await Un(ea,Ca,this.logger,this.performanceClient,r)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,t),a=Nn(Uc,_a,this.logger,this.performanceClient,r)(s,i,this.logger,this.correlationId);return Un(Vc,Sa,this.logger,this.performanceClient,r)(t,a,n.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}class wh extends qc{async acquireToken(e){const t=await Un(Oc,ya,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger,this.correlationId),r={...e,...t};e.redirectUri&&(r.redirectUri=_c(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId));const n=Ec(is.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=await this.createRefreshTokenClient({serverTelemetryManager:n,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Un(o.acquireTokenByRefreshToken.bind(o),"refreshTokenClientAcquireTokenByRefreshToken",this.logger,this.performanceClient,e.correlationId)(r).catch((e=>{throw e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e),e}))}logout(){return Promise.reject(Ei(Vo))}async createRefreshTokenClient(e){const t=await Un(this.getClientConfiguration.bind(this),ka,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new mo(t,this.performanceClient)}}class Ih extends po{constructor(e,t){super(e,t),this.includeRedirectUri=!1}}class Ch extends qc{constructor(e,t,r,n,o,i,s,a,c,h){super(e,t,r,n,o,i,a,c,h),this.apiId=s}async acquireToken(t){if(!t.code)throw Ei(ci);const r=await Un(Nc,Ta,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),n=Ec(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const e={...r,code:t.code},o=await Un(this.getClientConfiguration.bind(this),ka,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),i=new Ih(o,this.performanceClient);this.logger.verbose("1uic5e",this.correlationId);const s=new Hc(i,this.browserStorage,e,this.logger,this.performanceClient);return await Un(s.handleCodeResponseFromServer.bind(s),Rn,this.logger,this.performanceClient,this.correlationId)({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},r,!1)}catch(e){throw e instanceof we&&(e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e)),e}}logout(){return Promise.reject(Ei(Vo))}}function vh(e,t,r){try{ca(e)}catch(e){throw t.end({success:!1},e,r),e}}class kh{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Na(this.logger,this.performanceClient):ar,this.eventHandler=new Ac(this.logger),this.browserStorage=this.isBrowserEnvironment?new wc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,uo(this.config.auth)):Cc(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const t={cacheLocation:Ji.MemoryStorage,cacheRetentionDays:5};this.nativeInternalStorage=new wc(this.config.auth.clientId,t,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,t){const r=new kh(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("16v6hv",e),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){const t=this.getRequestCorrelationId(e);if(this.logger.trace("1f7joy",t),this.initialized)return void this.logger.info("061m5x",t);if(!this.isBrowserEnvironment)return this.logger.info("19fvpi",t),this.initialized=!0,void this.eventHandler.emitEvent(pc.INITIALIZE_END);const r=e?.correlationId||this.getRequestCorrelationId(),n=this.config.system.allowPlatformBroker,o=this.performanceClient.startMeasurement(za,r);if(this.eventHandler.emitEvent(pc.INITIALIZE_START),this.logMultipleInstances(o,r),await Un(this.browserStorage.initialize.bind(this.browserStorage),"initializeCache",this.logger,this.performanceClient,r)(r),n)try{this.platformAuthProvider=await ch(this.logger,this.performanceClient,r,this.config.system.nativeBrokerHandshakeTimeout)}catch(e){this.logger.verbose(e,r)}this.config.cache.cacheLocation===Ji.LocalStorage&&this.eventHandler.subscribeCrossTab(),!this.config.system.navigatePopups&&await this.preGeneratePkceCodes(r),this.initialized=!0,this.eventHandler.emitEvent(pc.INITIALIZE_END),o.end({allowPlatformBroker:n,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("02l8bm",""),aa(this.initialized),this.isBrowserEnvironment){const t=e?.hash||"";let r=this.redirectResponse.get(t);return void 0===r?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("1wn9kp","")):this.logger.verbose("0w0gm3",""),r}return this.logger.verbose("12xi63",""),null}async handleRedirectPromiseInternal(t){if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",""),null;const r=this.browserStorage.getInteractionInProgress()?.type;if(r===Vi)return this.logger.verbose("1ywcv2",""),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const n=this.getAllAccounts(),o=this.browserStorage.getCachedNativeRequest(),i=o&&this.platformAuthProvider&&!t?.hash;let s,a;this.eventHandler.emitEvent(pc.HANDLE_REDIRECT_START,e.InteractionType.Redirect);try{if(i&&this.platformAuthProvider){const e=o?.correlationId||"";s=this.performanceClient.startMeasurement(Ka,e),this.logger.trace("12v7is",e);const t=new zc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,is.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,o.accountId,this.nativeInternalStorage,o.correlationId);a=Un(t.handleRedirectPromise.bind(t),"handleNativeRedirectPromise",this.logger,this.performanceClient,s.event.correlationId)(this.performanceClient,s.event.correlationId)}else{const[e,r]=this.browserStorage.getCachedRequest(""),n=e.correlationId;s=this.performanceClient.startMeasurement(Ka,n),this.logger.trace("0znzs5",n);const o=this.createRedirectClient(n);a=Un(o.handleRedirectPromise.bind(o),"handleRedirectPromise",this.logger,this.performanceClient,s.event.correlationId)(e,r,s,t)}}catch(e){throw this.browserStorage.resetRequestCache(""),e}return a.then((t=>{if(t){this.browserStorage.resetRequestCache(t.correlationId),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),this.logger.verbose("0ui8f5",t.correlationId);n.length<this.getAllAccounts().length&&(this.eventHandler.emitEvent(pc.LOGIN_SUCCESS,e.InteractionType.Redirect,t.account),this.logger.verbose("16im3l",t.correlationId)),s.end({success:!0},void 0,t.account)}else s.event.errorCode?s.end({success:!1},void 0):s.discard();return this.eventHandler.emitEvent(pc.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((t=>{this.browserStorage.resetRequestCache(s.event.correlationId);const r=t;throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,r),this.eventHandler.emitEvent(pc.HANDLE_REDIRECT_END,e.InteractionType.Redirect),s.end({success:!1},r),t}))}async acquireTokenRedirect(t){const r=this.getRequestCorrelationId(t);this.logger.verbose("0os66p",r);const n=this.performanceClient.startMeasurement(Fa,r);n.add({scenarioId:t.scenarioId});const o=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=e=>{const r="function"==typeof o?o(e):void 0;return n.add({navigateCallbackResult:!1!==r}),n.event=n.end({success:!0},void 0,t.account)||n.event,r};try{let o;if(ha(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,Qi),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t),this.platformAuthProvider&&this.canUsePlatformBroker(t)){o=new zc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,is.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(t),this.nativeInternalStorage,r).acquireTokenRedirect(t,n).catch((e=>{if(e instanceof Dc&&Fc(e)){this.platformAuthProvider=void 0;return this.createRedirectClient(r).acquireToken(t)}if(e instanceof fn){this.logger.verbose("1ipyz4",r);return this.createRedirectClient(r).acquireToken(t)}throw e}))}else{o=this.createRedirectClient(r).acquireToken(t)}return await o}catch(o){throw this.browserStorage.resetRequestCache(r),2===n.event.status?this.performanceClient.startMeasurement(Ka,r).end({success:!1},o,t.account):n.end({success:!1},o,t.account),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,o),o}}acquireTokenPopup(t){const r=this.getRequestCorrelationId(t),n=this.performanceClient.startMeasurement(Da,r);n.add({scenarioId:t.scenarioId});try{this.logger.verbose("0ch87b",r),vh(this.initialized,n,t.account),this.browserStorage.setInteractionInProgress(!0,Qi,t.overrideInteractionInProgress,r)}catch(e){return Promise.reject(e)}const o=this.getAllAccounts();let i;this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t);const s=this.getPreGeneratedPkceCodes(r);if(this.canUsePlatformBroker(t))i=this.acquireTokenNative({...t,correlationId:r},is.acquireTokenPopup).then((e=>(n.end({success:!0,isNativeBroker:!0},void 0,e.account),e))).catch((e=>{if(e instanceof Dc&&Fc(e)){this.platformAuthProvider=void 0;return this.createPopupClient(r).acquireToken(t,s)}if(e instanceof fn){this.logger.verbose("0yy5fw",r);return this.createPopupClient(r).acquireToken(t,s)}throw e}));else{i=this.createPopupClient(r).acquireToken(t,s)}return i.then((t=>{const r=o.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),r&&this.eventHandler.emitEvent(pc.LOGIN_SUCCESS,e.InteractionType.Popup,t.account),n.end({success:!0,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length},void 0,t.account),t})).catch((r=>(this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,r),n.end({success:!1},r,t.account),Promise.reject(r)))).finally((async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.navigatePopups||await this.preGeneratePkceCodes(r)}))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&e.increment({visibilityChangeCount:1})}async ssoSilent(t){const r=this.getRequestCorrelationId(t),n={...t,prompt:t.prompt,correlationId:r};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(Ba,r),this.ssoSilentMeasurement?.add({scenarioId:t.scenarioId}),vh(this.initialized,this.ssoSilentMeasurement,t.account),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const o=this.getAllAccounts();let i;if(this.logger.verbose("0w1b45",r),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,n),this.canUsePlatformBroker(n))i=this.acquireTokenNative(n,is.ssoSilent).catch((e=>{if(e instanceof Dc&&Fc(e)){this.platformAuthProvider=void 0;return this.createSilentIframeClient(n.correlationId).acquireToken(n)}throw e}));else{i=this.createSilentIframeClient(n.correlationId).acquireToken(n)}return i.then((t=>{const r=o.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),r&&this.eventHandler.emitEvent(pc.LOGIN_SUCCESS,e.InteractionType.Silent,t.account),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:t.fromPlatformBroker,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length},void 0,t.account),t})).catch((r=>{throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,r),this.ssoSilentMeasurement?.end({success:!1},r,t.account),r})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenByCode(t){const r=this.getRequestCorrelationId(t);this.logger.trace("0ch6ga",r);const n=this.performanceClient.startMeasurement(Ha,r);vh(this.initialized,n),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),n.add({scenarioId:t.scenarioId});try{if(t.code&&t.nativeAccountId)throw Ei(li);if(t.code){const o=t.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("0qgp28",r),n.discard()):(this.logger.verbose("06eh73",r),i=this.acquireTokenByCodeAsync({...t,correlationId:r}).then((t=>(this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),this.hybridAuthCodeResponses.delete(o),n.end({success:!0,isNativeBroker:t.fromPlatformBroker,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length},void 0,t.account),t))).catch((t=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t})),this.hybridAuthCodeResponses.set(o,i)),await i}if(t.nativeAccountId){if(this.canUsePlatformBroker(t,t.nativeAccountId)){const e=await this.acquireTokenNative({...t,correlationId:r},is.acquireTokenByCode,t.nativeAccountId).catch((e=>{throw e instanceof Dc&&Fc(e)&&(this.platformAuthProvider=void 0),e}));return n.end({success:!0},void 0,e.account),e}throw Ei(ui)}throw Ei(hi)}catch(t){throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t}}async acquireTokenByCodeAsync(e){const t=this.getRequestCorrelationId(e);this.logger.trace("10d9hy",t),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement("acquireTokenByCodeAsync",t),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const r=this.createSilentAuthCodeClient(t);return await r.acquireToken(e).then((e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromPlatformBroker}),e))).catch((e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenFromCache(e,t){switch(t){case ds.Default:case ds.AccessToken:case ds.AccessTokenAndRefreshToken:const t=this.createSilentCacheClient(e.correlationId);return Un(t.acquireToken.bind(t),"silentCacheClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e);default:throw be(ft)}}async acquireTokenByRefreshToken(e,t){switch(t){case ds.Default:case ds.AccessTokenAndRefreshToken:case ds.RefreshToken:case ds.RefreshTokenAndNetwork:const t=this.createSilentRefreshClient(e.correlationId);return Un(t.acquireToken.bind(t),"silentRefreshClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e);default:throw be(ft)}}async acquireTokenBySilentIframe(e){const t=this.createSilentIframeClient(e.correlationId);return Un(t.acquireToken.bind(t),"silentIframeClientAcquireToken",this.logger,this.performanceClient,e.correlationId)(e)}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);ha(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,Vi);return this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);ca(this.initialized),this.browserStorage.setInteractionInProgress(!0,Vi);return this.createPopupClient(t).logout(e).finally((()=>{this.browserStorage.setInteractionInProgress(!1)}))}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return;const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return vc(this.logger,this.browserStorage,this.isBrowserEnvironment,this.getRequestCorrelationId(),e)}getAccount(e){return kc(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}setActiveAccount(e){Tc(e,this.browserStorage,this.getRequestCorrelationId())}getActiveAccount(){return bc(this.browserStorage,this.getRequestCorrelationId())}async hydrateCache(e,t){this.logger.verbose("16jycr",e.correlationId);const r=Fr(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId,Ir(e.idTokenClaims)),e.fromPlatformBroker?(this.logger.verbose("1fxyu8",e.correlationId),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r,n){const o=this.getRequestCorrelationId(e);if(this.logger.trace("0b9y3p",o),!this.platformAuthProvider)throw Ei(mi);return new zc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.platformAuthProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,o).acquireToken(e,n)}canUsePlatformBroker(e,t){const r=this.getRequestCorrelationId(e);if(this.logger.trace("1n9lbl",r),!this.platformAuthProvider)return this.logger.trace("0vnu11",r),!1;if(!hh(this.config,this.logger,r,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("1m4bzf",r),!1;if(e.prompt)switch(e.prompt){case R.NONE:case R.CONSENT:case R.LOGIN:this.logger.trace("0vdv8e",r);break;default:return this.logger.trace("0pdzw6",r),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("16lbtk",r),!1)}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new lh(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createRedirectClient(e){return new dh(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentIframeClient(e){return new yh(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,is.ssoSilent,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentCacheClient(e){return new Bc(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentRefreshClient(e){return new wh(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentAuthCodeClient(e){return new Ch(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,is.acquireTokenByCode,this.performanceClient,e,this.platformAuthProvider)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return sa(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?Ms():""}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("0lz9hf",t),this.acquireTokenRedirect({correlationId:t,...e||cs})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("0qw7v5",t),this.acquireTokenPopup({correlationId:t,...e||cs})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(La,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),vh(this.initialized,r,e.account),this.logger.verbose("0x1c4s",t);const n=e.account||this.getActiveAccount();if(!n)throw Ei(Xo);return this.acquireTokenSilentDeduped(e,n,t).then((n=>(r.end({success:!0,fromCache:n.fromCache,isNativeBroker:n.fromPlatformBroker,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length},void 0,n.account),{...n,state:e.state,correlationId:t}))).catch((e=>{throw e instanceof we&&e.setCorrelationId(t),r.end({success:!1},e,n),e}))}async acquireTokenSilentDeduped(e,t,r){const n=to(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},t.homeAccountId),o=JSON.stringify(n),i=this.activeSilentTokenRequests.get(o);if(void 0===i){this.logger.verbose("0fcjbk",r),this.performanceClient.addFields({deduped:!1},r);const n=Un(this.acquireTokenSilentAsync.bind(this),"acquireTokenSilentAsync",this.logger,this.performanceClient,r)({...e,correlationId:r},t);return this.activeSilentTokenRequests.set(o,n),n.finally((()=>{this.activeSilentTokenRequests.delete(o)}))}return this.logger.verbose("1yq7nb",r),this.performanceClient.addFields({deduped:!0},r),i}async acquireTokenSilentAsync(t,r){const n=()=>this.trackPageVisibility(t.correlationId);this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),t.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},t.correlationId),document.addEventListener("visibilitychange",n);const o=await Un(Mc,"initializeSilentRequest",this.logger,this.performanceClient,t.correlationId)(t,r,this.config,this.performanceClient,this.logger),i=t.cacheLookupPolicy||ds.Default;return this.acquireTokenSilentNoIframe(o,i).catch((async e=>{const t=function(e,t){const r=!(e instanceof fn&&e.subError!==un),n=e.errorCode===Pi||e.errorCode===ft,o=r&&n||e.errorCode===on||e.errorCode===an,i=us.includes(t);return o&&i}(e,i);if(t){if(this.activeIframeRequest){if(i!==ds.Skip){const[t,r]=this.activeIframeRequest;this.logger.verbose("1w8fso",o.correlationId);const n=this.performanceClient.startMeasurement("awaitConcurrentIframe",o.correlationId);n.add({awaitIframeCorrelationId:r});const s=await t;if(n.end({success:s}),s)return this.logger.verbose("0ywzzi",o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info("17y14q",o.correlationId),e}return this.logger.warning("1bd4p8",o.correlationId),Un(this.acquireTokenBySilentIframe.bind(this),fa,this.logger,this.performanceClient,o.correlationId)(o)}{let e;return this.activeIframeRequest=[new Promise((t=>{e=t})),o.correlationId],this.logger.verbose("0rh08z",o.correlationId),Un(this.acquireTokenBySilentIframe.bind(this),fa,this.logger,this.performanceClient,o.correlationId)(o).then((t=>(e(!0),t))).catch((t=>{throw e(!1),t})).finally((()=>{this.activeIframeRequest=void 0}))}}throw e})).then((r=>(this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,r),t.correlationId&&this.performanceClient.addFields({fromCache:r.fromCache,isNativeBroker:r.fromPlatformBroker},t.correlationId),r))).catch((t=>{throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),t})).finally((()=>{document.removeEventListener("visibilitychange",n)}))}async acquireTokenSilentNoIframe(t,r){return hh(this.config,this.logger,t.correlationId,this.platformAuthProvider,t.authenticationScheme)&&t.account.nativeAccountId?(this.logger.verbose("0sczo4",t.correlationId),this.acquireTokenNative(t,is.acquireTokenSilent_silentFlow,t.account.nativeAccountId,r).catch((async e=>{if(e instanceof Dc&&Fc(e))throw this.logger.verbose("07rkmb",t.correlationId),this.platformAuthProvider=void 0,be(ft);throw e}))):(this.logger.verbose("0ox81t",t.correlationId),r===ds.AccessToken&&this.logger.verbose("0fvwxe",t.correlationId),Un(this.acquireTokenFromCache.bind(this),"acquireTokenFromCache",this.logger,this.performanceClient,t.correlationId)(t,r).catch((n=>{if(r===ds.AccessToken)throw n;return this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),Un(this.acquireTokenByRefreshToken.bind(this),"acquireTokenByRefreshToken",this.logger,this.performanceClient,t.correlationId)(t,r)})))}async preGeneratePkceCodes(e){return this.logger.verbose("1x6uj6",e),this.pkceCode=await Un(Yc,Ea,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){const t=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,t?this.logger.verbose("12js1o",e):this.logger.verbose("1oe9ci",e),this.performanceClient.addFields({usePreGeneratedPkce:!!t},e),t}logMultipleInstances(e,t){const r=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[];window.msal.clientIds.length>0&&this.logger.verbose("1qtz3l",t),window.msal.clientIds.push(r),function(e,t,r,n){const o=window.msal?.clientIds||[],i=o.length,s=o.filter((t=>t===e)).length;s>1&&r.warning("1e88vg",n),t.add({msalInstanceCount:i,sameClientIdInstanceCount:s})}(r,e,this.logger,t)}}class Th{static loggerCallback(t,r){switch(t){case e.LogLevel.Error:return void console.error(r);case e.LogLevel.Info:return void console.info(r);case e.LogLevel.Verbose:return void console.debug(r);case e.LogLevel.Warning:return void console.warn(r);default:return void console.log(r)}}constructor(t){let r;this.browserEnvironment="undefined"!=typeof window,this.config=ih(t,this.browserEnvironment);try{r=window[Ji.SessionStorage]}catch(e){}const n=r?.getItem(Qa),o=r?.getItem(Va)?.toLowerCase(),i="true"===o||"false"!==o&&void 0,s={...this.config.system.loggerOptions},a=n&&Object.keys(e.LogLevel).includes(n)?e.LogLevel[n]:void 0;a&&(s.loggerCallback=Th.loggerCallback,s.logLevel=a),void 0!==i&&(s.piiLoggingEnabled=i),this.logger=new dr(s,mc,fc),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}class bh extends Th{getModuleName(){return bh.MODULE_NAME}getId(){return bh.ID}async initialize(e){return this.available="undefined"!=typeof window,this.available}}bh.MODULE_NAME="",bh.ID="StandardOperatingContext";const Ah="USER_INTERACTION_REQUIRED",Sh="USER_CANCEL",_h="NO_NETWORK",Eh="TRANSIENT_ERROR",Ph="PERSISTENT_ERROR",Rh="DISABLED",Oh="ACCOUNT_UNAVAILABLE",Mh="NESTED_APP_AUTH_UNAVAILABLE";class xh{constructor(e,t,r,n){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=n}toNaaTokenRequest(e){let t;t=void 0===e.extraQueryParameters?new Map:new Map(Object.entries(e.extraQueryParameters));const r=e.correlationId||this.crypto.createNewGuid(),n=Vt(e.claims,this.clientCapabilities),o=e.scopes||p;return{platformBrokerId:e.account?.homeAccountId,clientId:this.clientId,authority:e.authority,scope:o.join(" "),correlationId:r,claims:ke.isEmptyObj(n)?void 0:n,state:e.state,authenticationScheme:e.authenticationScheme||G.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw be(Qe);const n=Tn(r+(t.token.expires_in||0)),o=wr(t.token.id_token,this.crypto.base64Decode),i=this.fromNaaAccountInfo(t.account,t.token.id_token,o),s=t.token.scope||e.scope;return{authority:t.token.authority||i.environment,uniqueId:i.localAccountId,tenantId:i.tenantId,scopes:s.split(" "),account:i,idToken:t.token.id_token,idTokenClaims:o,accessToken:t.token.access_token,fromCache:!1,expiresOn:n,tokenType:e.authenticationScheme||G.BEARER,correlationId:e.correlationId,extExpiresOn:n,state:e.state}}fromNaaAccountInfo(e,t,r){const n=r||e.idTokenClaims,o=e.localAccountId||n?.oid||n?.sub||"",i=e.tenantId||n?.tid||"",s=e.homeAccountId||`${o}.${i}`,a=e.username||n?.preferred_username||"",c=e.name||n?.name,h=e.loginHint||n?.login_hint,l=new Map,d=fr(s,o,i,n);l.set(i,d);return{homeAccountId:s,environment:e.environment,tenantId:i,username:a,localAccountId:o,name:c,loginHint:h,idToken:t,idTokenClaims:n,tenantProfiles:l}}fromBridgeError(e){if(!function(e){return void 0!==e.status}(e))return new we("unknown_error","An unknown error occurred");switch(e.status){case Sh:return new Te(Tt);case _h:return new Te(kt);case Oh:return new Te(pt);case Rh:return new Te(At);case Mh:return new Te(e.code||At,e.description);case Eh:case Ph:return new nn(e.code,e.description);case Ah:return new fn(e.code,e.description);default:return new we(e.code,e.description)}}toAuthenticationResultFromCache(e,t,r,n,o){if(!t||!r)throw be(Qe);const i=wr(t.secret,this.crypto.base64Decode),s=r.target||n.scopes.join(" ");return{authority:r.environment||e.environment,uniqueId:e.localAccountId,tenantId:e.tenantId,scopes:s.split(" "),account:e,idToken:t.secret,idTokenClaims:i||{},accessToken:r.secret,fromCache:!0,expiresOn:Tn(r.expiresOn),extExpiresOn:Tn(r.extendedExpiresOn),tokenType:n.authenticationScheme||G.BEARER,correlationId:o,state:n.state}}}class qh extends we{constructor(e,t){super(e,t),Object.setPrototypeOf(this,qh.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new qh("unsupported_method")}}class Nh{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(void 0===t)throw new Error("unexpected: bridgeProxy is undefined");this.bridgeProxy=t,this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new Na(this.logger,this.performanceClient,!0):ar,this.eventHandler=new Ac(this.logger),this.browserStorage=this.operatingContext.isBrowserEnvironment()?new wc(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,uo(this.config.auth)):Cc(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler),this.nestedAppAuthAdapter=new xh(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger);const r=this.bridgeProxy.getAccountContext();this.currentAccountContext=r||null}static async createController(e){const t=new Nh(e);return Promise.resolve(t)}async initialize(e,t){const r=e?.correlationId||Ms();return await this.browserStorage.initialize(r),Promise.resolve()}ensureValidRequest(e){return e?.correlationId?e:{...e,correlationId:this.browserCrypto.createNewGuid()}}async acquireTokenInteractive(t){const r=this.ensureValidRequest(t),n=r.correlationId||Ms();this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Popup,r);const o=this.performanceClient.startMeasurement(Da,n);o.add({nestedAppAuthRequest:!0});try{const i=this.nestedAppAuthAdapter.toNaaTokenRequest(r),s=vn(),a=await this.bridgeProxy.getTokenInteractive(i),c={...this.nestedAppAuthAdapter.fromNaaTokenResponse(i,a,s)};try{await this.hydrateCache(c,t)}catch(e){this.logger.warningPii("1mwr91",n)}return this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,c),o.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),o.end({success:!0,requestId:c.requestId},void 0,c.account),c}catch(r){const n=r instanceof we?r:this.nestedAppAuthAdapter.fromBridgeError(r);throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,r),o.end({success:!1},r,t.account),n}}async acquireTokenSilentInternal(t){const r=this.ensureValidRequest(t),n=r.correlationId||Ms();this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_START,e.InteractionType.Silent,r);const o=await this.acquireTokenFromCache(r);if(o)return this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,o),o;const i=this.performanceClient.startMeasurement(Ba,n);i.increment({visibilityChangeCount:0}),i.add({nestedAppAuthRequest:!0});try{const o=this.nestedAppAuthAdapter.toNaaTokenRequest(r);o.forceRefresh=r.forceRefresh;const s=vn(),a=await this.bridgeProxy.getTokenSilent(o),c=this.nestedAppAuthAdapter.fromNaaTokenResponse(o,a,s);try{await this.hydrateCache(c,t)}catch(e){this.logger.warningPii("1mwr91",n)}return this.currentAccountContext={homeAccountId:c.account.homeAccountId,environment:c.account.environment,tenantId:c.account.tenantId},this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,c),i?.add({accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length}),i?.end({success:!0,requestId:c.requestId},void 0,c.account),c}catch(r){const n=r instanceof we?r:this.nestedAppAuthAdapter.fromBridgeError(r);throw this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,r),i?.end({success:!1},r,t.account),n}}async acquireTokenFromCache(t){const r=t.correlationId||Ms(),n=this.performanceClient.startMeasurement(La,r);if(n?.add({nestedAppAuthRequest:!0}),t.claims)return this.logger.verbose("11t57w",r),null;if(t.forceRefresh)return this.logger.verbose("1ovnmo",r),null;let o=null;switch(t.cacheLookupPolicy||(t.cacheLookupPolicy=ds.Default),t.cacheLookupPolicy){case ds.Default:case ds.AccessToken:case ds.AccessTokenAndRefreshToken:o=await this.acquireTokenFromCacheInternal(t);break;default:return null}return o?(this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,o),n.add({accessTokenSize:o.accessToken.length,idTokenSize:o.idToken.length}),n.end({success:!0},void 0,o.account),o):(this.logger.warning("1yb4fi",r),this.eventHandler.emitEvent(pc.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null),n.end({success:!1},void 0,t.account),null)}async acquireTokenFromCacheInternal(e){const t=this.bridgeProxy.getAccountContext()||this.currentAccountContext,r=e.correlationId||Ms();let n=null;if(t&&(n=kc(t,this.logger,this.browserStorage,r)),!n)return this.logger.verbose("10qnr0",r),Promise.resolve(null);this.logger.verbose("1u7hux",r);const o={...e,correlationId:r,authority:e.authority||n.environment,scopes:e.scopes?.length?e.scopes:[...p]},i=this.browserStorage.getTokenKeys(),s=this.browserStorage.getAccessToken(n,o,i,n.tenantId);if(!s)return this.logger.verbose("03vm49",r),Promise.resolve(null);if(Sn(s.cachedAt)||bn(s.expiresOn,this.config.system.tokenRenewalOffsetSeconds))return this.logger.verbose("18egye",r),Promise.resolve(null);const a=this.browserStorage.getIdToken(n,o.correlationId,i,n.tenantId);return a?this.nestedAppAuthAdapter.toAuthenticationResultFromCache(n,a,s,o,o.correlationId):(this.logger.verbose("0d68kd",r),Promise.resolve(null))}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw qh.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw qh.createUnsupportedError()}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw qh.createUnsupportedError()}removePerformanceCallback(e){throw qh.createUnsupportedError()}getAllAccounts(e){return vc(this.logger,this.browserStorage,this.isBrowserEnv(),Ms(),e)}getAccount(e){return kc(e,this.logger,this.browserStorage,Ms())}setActiveAccount(e){return Tc(e,this.browserStorage,Ms())}getActiveAccount(){return bc(this.browserStorage,Ms())}handleRedirectPromise(e){return Promise.resolve(null)}loginPopup(e){return this.acquireTokenInteractive(e||cs)}loginRedirect(e){throw qh.createUnsupportedError()}logoutRedirect(e){throw qh.createUnsupportedError()}logoutPopup(e){throw qh.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("1k8729","")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw qh.createUnsupportedError()}getRedirectResponse(){throw qh.createUnsupportedError()}async clearCache(e){throw qh.createUnsupportedError()}async hydrateCache(e,t){this.logger.verbose("16jycr",e.correlationId);const r=Fr(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(r,e.correlationId,Ir(e.idTokenClaims)),this.browserStorage.hydrateCache(e,t)}}class Uh{static async initializeNestedAppAuthBridge(){if(void 0===window)throw new Error("window is undefined");if(void 0===window.nestedAppAuthBridge)throw new Error("window.nestedAppAuthBridge is undefined");try{window.nestedAppAuthBridge.addEventListener("message",(e=>{const t="string"==typeof e?e:e.data,r=JSON.parse(t),n=Uh.bridgeRequests.find((e=>e.requestId===r.requestId));void 0!==n&&(Uh.bridgeRequests.splice(Uh.bridgeRequests.indexOf(n),1),r.success?n.resolve(r):n.reject(r.error))}));const e=await new Promise(((e,t)=>{const r=Uh.buildRequest("GetInitContext"),n={requestId:r.requestId,method:r.method,resolve:e,reject:t};Uh.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}));return Uh.validateBridgeResultOrThrow(e.initContext)}catch(e){throw window.console.log(e),e}}getTokenInteractive(e){return this.getToken("GetTokenPopup",e)}getTokenSilent(e){return this.getToken("GetToken",e)}async getToken(e,t){const r=await this.sendRequest(e,{tokenParams:t});return{token:Uh.validateBridgeResultOrThrow(r.token),account:Uh.validateBridgeResultOrThrow(r.account)}}getHostCapabilities(){return this.capabilities??null}getAccountContext(){return this.accountContext?this.accountContext:null}static buildRequest(e,t){return{messageType:"NestedAppAuthRequest",method:e,requestId:Ms(),sendTime:Date.now(),clientLibrary:xi,clientLibraryVersion:fc,...t}}sendRequest(e,t){const r=Uh.buildRequest(e,t);return new Promise(((e,t)=>{const n={requestId:r.requestId,method:r.method,resolve:e,reject:t};Uh.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}))}static validateBridgeResultOrThrow(e){if(void 0===e){throw{status:Mh}}return e}constructor(e,t,r,n){this.sdkName=e,this.sdkVersion=t,this.accountContext=r,this.capabilities=n}static async create(){const e=await Uh.initializeNestedAppAuthBridge();return new Uh(e.sdkName,e.sdkVersion,e.accountContext,e.capabilities)}}Uh.bridgeRequests=[];class Lh extends Th{constructor(){super(...arguments),this.bridgeProxy=void 0,this.accountContext=null}getModuleName(){return Lh.MODULE_NAME}getId(){return Lh.ID}getBridgeProxy(){return this.bridgeProxy}async initialize(e){try{if("undefined"!=typeof window){"function"==typeof window.__initializeNestedAppAuth&&await window.__initializeNestedAppAuth();const e=await Uh.create();this.accountContext=e.getAccountContext(),this.bridgeProxy=e,this.available=void 0!==e}}catch(t){this.logger.infoPii("1mdxyj",e)}return this.logger.info("12jy9a",e),this.available}}Lh.MODULE_NAME="",Lh.ID="NestedAppOperatingContext";class Hh{constructor(e,t){this.controller=t||new kh(new bh(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}async function Dh(e){const t=new Hh(e);return await t.initialize(),t}const Fh={initialize:()=>Promise.reject(Js(Bs)),acquireTokenPopup:()=>Promise.reject(Js(Bs)),acquireTokenRedirect:()=>Promise.reject(Js(Bs)),acquireTokenSilent:()=>Promise.reject(Js(Bs)),acquireTokenByCode:()=>Promise.reject(Js(Bs)),getAllAccounts:()=>[],getAccount:()=>null,handleRedirectPromise:()=>Promise.reject(Js(Bs)),loginPopup:()=>Promise.reject(Js(Bs)),loginRedirect:()=>Promise.reject(Js(Bs)),logoutRedirect:()=>Promise.reject(Js(Bs)),logoutPopup:()=>Promise.reject(Js(Bs)),ssoSilent:()=>Promise.reject(Js(Bs)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,getLogger:()=>{throw Js(Bs)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw Js(Bs)},hydrateCache:()=>Promise.reject(Js(Bs)),clearCache:()=>Promise.reject(Js(Bs))};async function Kh(e,t,r,n,o,i,s,a){if(o.verbose("0ke46k",r),e.account){const t=Fr(e.account);return await n.setAccount(t,r,Ir(s||{})),t}if(!a||!t&&!s)throw o.error("1ychpz",r),Ei(si);const c=Kr(t,a.authorityType,o,i,r,s),h=s?.tid,l=Xn(n,a,c,ys,r,s,t,a.hostnameAndPort,h,void 0,void 0,o);return await n.setAccount(l,r,Ir(s||{})),l}async function Bh(e,t,r,n,o,i,s,a,c){if(!e.id_token)return a.verbose("1pm7g1",i),null;a.verbose("168lyi",i);const h=Fn(t,r,e.id_token,c,n);return await s.setIdTokenCredential(h,i,o),h}async function zh(e,t,r,n,o,i,s,a,c,h,l){if(!t.access_token)return h.verbose("1ckp9e",a),null;if(!t.expires_in)return h.error("15mzx8",a),null;if(!(t.scope||e.scopes&&e.scopes.length))return h.error("1h7xse",a),null;h.verbose("01kmxb",a);const d=t.scope?_t.fromString(t.scope):new _t(e.scopes),u=s.expiresOn||t.expires_in+vn(),g=s.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+vn(),p=Kn(r,n,t.access_token,l,o,d.printScopes(),u,g,ys);return await c.setAccessTokenCredential(p,a,i),p}async function jh(e,t,r,n,o,i,s,a){if(!e.refresh_token)return s.verbose("1l7um5",o),null;s.verbose("0qy8ev",o);const c=Bn(t,r,e.refresh_token,a,e.foci,void 0,e.refresh_token_expires_in);return await i.setRefreshTokenCredential(c,o,n),c}function $h(){let e;try{e=window[Ji.SessionStorage];const t=e?.getItem(Xa);if(1===Number(t))return Promise.resolve().then((function(){return Qh}))}catch(e){}}function Jh(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.now}function Wh(e){if(e&&Jh())return Math.round(window.performance.now()-e)}class Gh{constructor(e,t){this.correlationId=t,this.measureName=Gh.makeMeasureName(e,t),this.startMark=Gh.makeStartMark(e,t),this.endMark=Gh.makeEndMark(e,t)}static makeMeasureName(e,t){return`msal.measure.${e}.${t}`}static makeStartMark(e,t){return`msal.start.${e}.${t}`}static makeEndMark(e,t){return`msal.end.${e}.${t}`}static supportsBrowserPerformance(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName}static flushMeasurements(e,t){if(Gh.supportsBrowserPerformance())try{t.forEach((t=>{const r=Gh.makeMeasureName(t.name,e);window.performance.getEntriesByName(r,"measure").length>0&&(window.performance.clearMeasures(r),window.performance.clearMarks(Gh.makeStartMark(r,e)),window.performance.clearMarks(Gh.makeEndMark(r,e)))}))}catch(e){}}startMeasurement(){if(Gh.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}}endMeasurement(){if(Gh.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}}flushMeasurement(){if(Gh.supportsBrowserPerformance())try{const e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){const t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null}}var Qh=Object.freeze({__proto__:null,BrowserPerformanceMeasurement:Gh});const Vh=G,Xh=x,Yh=R,Zh=ae,el=p;e.ApiId=is,e.AuthError=we,e.AuthErrorCodes=ko,e.AuthenticationHeaderParser=class{constructor(e){this.headers=e}getShrNonce(){const e=this.headers[v];if(e){const t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw ve(Fe)}const t=this.headers[C];if(t){const e=this.parseChallenges(t);if(e.nonce)return e.nonce;throw ve(Fe)}throw ve(De)}parseChallenges(e){const t=e.indexOf(" "),r=e.substr(t+1).split(","),n={};return r.forEach((e=>{const[t,r]=e.split("=");n[t]=unescape(r.replace(/['"]+/g,""))})),n}},e.AuthenticationScheme=Vh,e.AzureCloudInstance=pr,e.BrowserAuthError=_i,e.BrowserAuthErrorCodes=Ai,e.BrowserCacheLocation=Ji,e.BrowserConfigurationAuthError=$s,e.BrowserConfigurationAuthErrorCodes=js,e.BrowserPerformanceClient=class extends Ro{constructor(e,r){super(e.auth.clientId,e.auth.authority||`${t}`,new dr(e.system?.loggerOptions||{},mc,fc),mc,fc,e.telemetry?.application||{appName:"",appVersion:""},r)}generateId(){return Ms()}getPageVisibility(){return document.visibilityState?.toString()||null}deleteIncompleteSubMeasurements(e){$h()?.then((t=>{const r=this.eventsByCorrelationId.get(e.event.correlationId),n=r&&r.eventId===e.event.eventId,o=[];n&&r?.incompleteSubMeasurements&&r.incompleteSubMeasurements.forEach((e=>{o.push({...e})})),t.BrowserPerformanceMeasurement.flushMeasurements(e.event.correlationId,o)}))}startMeasurement(e,t){const r=this.getPageVisibility(),n=super.startMeasurement(e,t),o=Jh()?window.performance.now():void 0,i=$h()?.then((t=>new t.BrowserPerformanceMeasurement(e,n.event.correlationId)));return i?.then((e=>e.startMeasurement())),{...n,end:(e,t,s)=>{const a=n.end({...e,startPageVisibility:r,endPageVisibility:this.getPageVisibility(),durationMs:Wh(o)},t,s);return i?.then((e=>e.endMeasurement())),this.deleteIncompleteSubMeasurements(n),a},discard:()=>{n.discard(),i?.then((e=>e.flushMeasurement())),this.deleteIncompleteSubMeasurements(n)}}}},e.BrowserPerformanceMeasurement=Gh,e.BrowserRootPerformanceEvents=Ja,e.BrowserUtils=ga,e.CacheLookupPolicy=ds,e.ClientAuthError=Te,e.ClientAuthErrorCodes=St,e.ClientConfigurationError=Ce,e.ClientConfigurationErrorCodes=$e,e.DEFAULT_IFRAME_TIMEOUT_MS=1e4,e.EventHandler=Ac,e.EventMessageUtils=class{static getInteractionStatusFromEvent(t,r){switch(t.eventType){case pc.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return as.AcquireToken;break;case pc.HANDLE_REDIRECT_START:return as.HandleRedirect;case pc.LOGOUT_START:return as.Logout;case pc.LOGOUT_END:if(r&&r!==as.Logout)break;return as.None;case pc.HANDLE_REDIRECT_END:if(r&&r!==as.HandleRedirect)break;return as.None;case pc.ACQUIRE_TOKEN_SUCCESS:case pc.ACQUIRE_TOKEN_FAILURE:case pc.RESTORE_FROM_BFCACHE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==as.AcquireToken)break;return as.None}}return null}},e.EventType=pc,e.InteractionRequiredAuthError=fn,e.InteractionRequiredAuthErrorCodes=gn,e.InteractionStatus=as,e.JsonWebTokenTypes=Zh,e.LocalStorage=uc,e.Logger=dr,e.MemoryStorage=xa,e.NavigationClient=th,e.OIDC_DEFAULT_SCOPES=el,e.PromptValue=Yh,e.ProtocolMode=Hr,e.PublicClientApplication=Hh,e.ResponseMode=Xh,e.ServerError=nn,e.SessionStorage=gc,e.SignedHttpRequest=class{constructor(e,t){const r=t&&t.loggerOptions||{};this.logger=new dr(r,mc,fc),this.cryptoOps=new Na(this.logger),this.popTokenGenerator=new Hn(this.cryptoOps,new Wr),this.shrParameters=e}async generatePublicKeyThumbprint(){const{kid:e}=await this.popTokenGenerator.generateKid(this.shrParameters);return e}async signRequest(e,t,r){return this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)}async removeKeys(e,t){return this.cryptoOps.removeTokenBindingKey(e,t)}},e.StubPerformanceClient=Wr,e.WrapperSKU={React:"@azure/msal-react",Angular:"@azure/msal-angular"},e.createNestablePublicClientApplication=async function(e,t,r){const n=t||Ms(),o=new Lh(e);if(await o.initialize(n),o.isAvailable()){const t=new Nh(o),i=r?r(e,t):new Hh(e,t);return await i.initialize({correlationId:n}),i}return Dh(e)},e.createStandardPublicClientApplication=Dh,e.isPlatformBrokerAvailable=async function(e,t,r){const n=new dr(e||{},mc,fc),o=r||"";n.trace("07660b",o);const i=t||new Wr;return"undefined"==typeof window?(n.trace("082ed3",o),!1):!!await ch(n,i,o)},e.loadExternalTokens=async function(e,t,r,n,o=new Wr){sa();const i=ih(e,!0),s=t.correlationId||Ms(),a=o.startMeasurement($a,s);try{const c=r.id_token?wr(r.id_token,ys):void 0,h=Ir(c||{}),l={protocolMode:i.system.protocolMode,knownAuthorities:i.auth.knownAuthorities,cloudDiscoveryMetadata:i.auth.cloudDiscoveryMetadata,authorityMetadata:i.auth.authorityMetadata},d=new dr(i.system.loggerOptions||{}),u=new Na(d,i.telemetry.client),g=new wc(i.auth.clientId,i.cache,u,d,i.telemetry.client,new Ac(d),uo(i.auth)),p=t.authority?new ho(ho.generateAuthority(t.authority,t.azureCloudOptions),i.system.networkClient,g,l,d,t.correlationId||Ms(),i.telemetry.client):void 0,m=await Un(Kh,"loadAccount",d,o,s)(t,n.clientInfo||r.client_info||"",s,g,d,u,c,p),f=await Un(Bh,"loadIdToken",d,o,s)(r,m.homeAccountId,m.environment,m.realm,h,s,g,d,e.auth.clientId),y=await Un(zh,"loadAccessToken",d,o,s)(t,r,m.homeAccountId,m.environment,m.realm,h,n,s,g,d,e.auth.clientId),w=await Un(jh,"loadRefreshToken",d,o,s)(r,m.homeAccountId,m.environment,h,s,g,d,e.auth.clientId);return a.end({success:!0},void 0,Dr(m)),function(e,t,r,n){let o,i="",s=[],a=null;t?.accessToken&&(i=t.accessToken.secret,s=_t.fromString(t.accessToken.target).asArray(),a=Tn(t.accessToken.expiresOn),o=Tn(t.accessToken.extendedExpiresOn));const c=t.account;return{authority:n?n.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:s,account:Dr(c),idToken:t.idToken?.secret||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:a,correlationId:e.correlationId||"",requestId:"",extExpiresOn:o,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:c.cloudGraphHostName||"",msGraphHost:c.msGraphHost||"",fromPlatformBroker:!1}}(t,{account:m,idToken:f,accessToken:y,refreshToken:w},c,p)}catch(e){throw a.end({success:!1},e),e}},e.stubbedPublicClientApplication=Fh,e.version=fc}));
|