@azure/msal-browser 2.18.0 → 2.19.2
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 +212 -212
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +4 -0
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +9 -3
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.d.ts +2 -0
- package/dist/app/IPublicClientApplication.d.ts.map +1 -1
- package/dist/app/IPublicClientApplication.js +4 -1
- package/dist/app/IPublicClientApplication.js.map +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +5 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
- package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/AsyncMemoryStorage.js +195 -0
- package/dist/cache/AsyncMemoryStorage.js.map +1 -0
- package/dist/cache/BrowserCacheManager.d.ts +5 -1
- package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
- package/dist/cache/BrowserCacheManager.js +20 -1
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.d.ts +1 -1
- package/dist/cache/BrowserStorage.d.ts.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/BrowserStorage.js.map +1 -1
- package/dist/cache/DatabaseStorage.d.ts +25 -6
- package/dist/cache/DatabaseStorage.d.ts.map +1 -1
- package/dist/cache/DatabaseStorage.js +127 -81
- package/dist/cache/DatabaseStorage.js.map +1 -1
- package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
- package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
- package/dist/cache/IWindowStorage.d.ts +3 -3
- package/dist/cache/IWindowStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.d.ts +3 -3
- package/dist/cache/MemoryStorage.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/MemoryStorage.js.map +1 -1
- package/dist/cache/TokenCache.js +1 -1
- package/dist/config/Configuration.js +1 -1
- package/dist/crypto/BrowserCrypto.d.ts +3 -1
- package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
- package/dist/crypto/BrowserCrypto.js +3 -2
- package/dist/crypto/BrowserCrypto.js.map +1 -1
- package/dist/crypto/CryptoOps.d.ts +11 -5
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +37 -13
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.d.ts +6 -2
- package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
- package/dist/crypto/SignedHttpRequest.js +11 -5
- package/dist/crypto/SignedHttpRequest.js.map +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.d.ts +8 -0
- package/dist/error/BrowserAuthError.d.ts.map +1 -1
- package/dist/error/BrowserAuthError.js +12 -2
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +2259 -1735
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +10 -2
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +1 -1
- package/dist/interaction_client/RedirectClient.js +2 -2
- package/dist/interaction_client/RedirectClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/PopupHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.js +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/RedirectRequest.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.d.ts +3 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +7 -3
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/dist/utils/PopupUtils.js +1 -1
- package/lib/msal-browser.js +2259 -1735
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +31 -31
- package/package.json +3 -2
- package/CHANGELOG.json +0 -1548
- package/CHANGELOG.md +0 -491
package/lib/msal-browser.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.19.2 2022-08-03 */
|
|
2
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
3
|
/*! *****************************************************************************
|
|
4
4
|
Copyright (c) Microsoft Corporation.
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
PERFORMANCE OF THIS SOFTWARE.
|
|
16
16
|
***************************************************************************** */
|
|
17
17
|
var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,r)};function r(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function i(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}
|
|
18
|
-
/*! @azure/msal-common v5.
|
|
18
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
19
19
|
/*! *****************************************************************************
|
|
20
20
|
Copyright (c) Microsoft Corporation.
|
|
21
21
|
|
|
@@ -29,32 +29,32 @@ var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Arr
|
|
|
29
29
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
30
30
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
31
31
|
PERFORMANCE OF THIS SOFTWARE.
|
|
32
|
-
***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function u(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function
|
|
33
|
-
/*! @azure/msal-common v5.
|
|
34
|
-
/*! @azure/msal-common v5.
|
|
35
|
-
var J,X={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."}},Z=function(e){function t(r,n,o){var i=this,a=n?r+": "+n:r;return i=e.call(this,a)||this,Object.setPrototypeOf(i,t.prototype),i.errorCode=r||v.EMPTY_STRING,i.errorMessage=n||"",i.subError=o||"",i.name="AuthError",i}return u(t,e),t.prototype.setCorrelationId=function(e){this.correlationId=e},t.createUnexpectedError=function(e){return new t(X.unexpectedError.code,X.unexpectedError.desc+": "+e)},t}(Error),$={createNewGuid:function(){throw Z.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw Z.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw Z.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Crypto interface - generatePkceCodes() has not been implemented",Z.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")}))}))},getPublicKeyThumbprint:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Crypto interface - getPublicKeyThumbprint() has not been implemented",Z.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")}))}))},removeTokenBindingKey:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Crypto interface - removeTokenBindingKey() has not been implemented",Z.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")}))}))},clearKeystore:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Crypto interface - clearKeystore() has not been implemented",Z.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")}))}))},signJwt:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Crypto interface - signJwt() has not been implemented",Z.createUnexpectedError("Crypto interface - signJwt() has not been implemented")}))}))}},ee={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},tokenRefreshRequired:{code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."}},te=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientAuthError",Object.setPrototypeOf(o,t.prototype),o}return u(t,e),t.createClientInfoDecodingError=function(e){return new t(ee.clientInfoDecodingError.code,ee.clientInfoDecodingError.desc+" Failed with error: "+e)},t.createClientInfoEmptyError=function(){return new t(ee.clientInfoEmptyError.code,""+ee.clientInfoEmptyError.desc)},t.createTokenParsingError=function(e){return new t(ee.tokenParsingError.code,ee.tokenParsingError.desc+" Failed with error: "+e)},t.createTokenNullOrEmptyError=function(e){return new t(ee.nullOrEmptyToken.code,ee.nullOrEmptyToken.desc+" Raw Token Value: "+e)},t.createEndpointDiscoveryIncompleteError=function(e){return new t(ee.endpointResolutionError.code,ee.endpointResolutionError.desc+" Detail: "+e)},t.createNetworkError=function(e,r){return new t(ee.networkError.code,ee.networkError.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToGetOpenidConfigError=function(e){return new t(ee.unableToGetOpenidConfigError.code,ee.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+e)},t.createHashNotDeserializedError=function(e){return new t(ee.hashNotDeserialized.code,ee.hashNotDeserialized.desc+" Given Object: "+e)},t.createInvalidStateError=function(e,r){return new t(ee.invalidStateError.code,ee.invalidStateError.desc+" Invalid State: "+e+", Root Err: "+r)},t.createStateMismatchError=function(){return new t(ee.stateMismatchError.code,ee.stateMismatchError.desc)},t.createStateNotFoundError=function(e){return new t(ee.stateNotFoundError.code,ee.stateNotFoundError.desc+": "+e)},t.createNonceMismatchError=function(){return new t(ee.nonceMismatchError.code,ee.nonceMismatchError.desc)},t.createNonceNotFoundError=function(e){return new t(ee.nonceNotFoundError.code,ee.nonceNotFoundError.desc+": "+e)},t.createMultipleMatchingTokensInCacheError=function(){return new t(ee.multipleMatchingTokens.code,ee.multipleMatchingTokens.desc+".")},t.createMultipleMatchingAccountsInCacheError=function(){return new t(ee.multipleMatchingAccounts.code,ee.multipleMatchingAccounts.desc)},t.createMultipleMatchingAppMetadataInCacheError=function(){return new t(ee.multipleMatchingAppMetadata.code,ee.multipleMatchingAppMetadata.desc)},t.createTokenRequestCannotBeMadeError=function(){return new t(ee.tokenRequestCannotBeMade.code,ee.tokenRequestCannotBeMade.desc)},t.createAppendEmptyScopeToSetError=function(e){return new t(ee.appendEmptyScopeError.code,ee.appendEmptyScopeError.desc+" Given Scope: "+e)},t.createRemoveEmptyScopeFromSetError=function(e){return new t(ee.removeEmptyScopeError.code,ee.removeEmptyScopeError.desc+" Given Scope: "+e)},t.createAppendScopeSetError=function(e){return new t(ee.appendScopeSetError.code,ee.appendScopeSetError.desc+" Detail Error: "+e)},t.createEmptyInputScopeSetError=function(){return new t(ee.emptyInputScopeSetError.code,""+ee.emptyInputScopeSetError.desc)},t.createDeviceCodeCancelledError=function(){return new t(ee.DeviceCodePollingCancelled.code,""+ee.DeviceCodePollingCancelled.desc)},t.createDeviceCodeExpiredError=function(){return new t(ee.DeviceCodeExpired.code,""+ee.DeviceCodeExpired.desc)},t.createDeviceCodeUnknownError=function(){return new t(ee.DeviceCodeUnknownError.code,""+ee.DeviceCodeUnknownError.desc)},t.createNoAccountInSilentRequestError=function(){return new t(ee.NoAccountInSilentRequest.code,""+ee.NoAccountInSilentRequest.desc)},t.createNullOrUndefinedCacheRecord=function(){return new t(ee.invalidCacheRecord.code,ee.invalidCacheRecord.desc)},t.createInvalidCacheEnvironmentError=function(){return new t(ee.invalidCacheEnvironment.code,ee.invalidCacheEnvironment.desc)},t.createNoAccountFoundError=function(){return new t(ee.noAccountFound.code,ee.noAccountFound.desc)},t.createCachePluginError=function(){return new t(ee.CachePluginError.code,""+ee.CachePluginError.desc)},t.createNoCryptoObjectError=function(e){return new t(ee.noCryptoObj.code,""+ee.noCryptoObj.desc+e)},t.createInvalidCacheTypeError=function(){return new t(ee.invalidCacheType.code,""+ee.invalidCacheType.desc)},t.createUnexpectedAccountTypeError=function(){return new t(ee.unexpectedAccountType.code,""+ee.unexpectedAccountType.desc)},t.createUnexpectedCredentialTypeError=function(){return new t(ee.unexpectedCredentialType.code,""+ee.unexpectedCredentialType.desc)},t.createInvalidAssertionError=function(){return new t(ee.invalidAssertion.code,""+ee.invalidAssertion.desc)},t.createInvalidCredentialError=function(){return new t(ee.invalidClientCredential.code,""+ee.invalidClientCredential.desc)},t.createRefreshRequiredError=function(){return new t(ee.tokenRefreshRequired.code,ee.tokenRefreshRequired.desc)},t.createUserTimeoutReachedError=function(){return new t(ee.userTimeoutReached.code,ee.userTimeoutReached.desc)},t.createTokenClaimsRequiredError=function(){return new t(ee.tokenClaimsRequired.code,ee.tokenClaimsRequired.desc)},t.createNoAuthCodeInServerResponseError=function(){return new t(ee.noAuthorizationCodeFromServer.code,ee.noAuthorizationCodeFromServer.desc)},t.createBindingKeyNotRemovedError=function(){return new t(ee.bindingKeyNotRemovedError.code,ee.bindingKeyNotRemovedError.desc)},t}(Z),re=function(){function e(){}return e.decodeAuthToken=function(t){if(e.isEmpty(t))throw te.createTokenNullOrEmptyError(t);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw te.createTokenParsingError("Given token is malformed: "+JSON.stringify(t));return{header:r[1],JWSPayload:r[2],JWSSig:r[3]}},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.isEmptyObj=function(t){if(t&&!e.isEmpty(t))try{var r=JSON.parse(t);return 0===Object.keys(r).length}catch(e){}return!0},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){var t={},r=e.split("&"),n=function(e){return decodeURIComponent(e.replace(/\+/g," "))};return r.forEach((function(e){if(e.trim()){var r=e.split(/=(.+)/g,2),o=r[0],i=r[1];o&&i&&(t[n(o)]=n(i))}})),t},e.trimArrayEntries=function(e){return e.map((function(e){return e.trim()}))},e.removeEmptyStringsFromArray=function(t){return t.filter((function(t){return!e.isEmpty(t)}))},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}();
|
|
36
|
-
/*! @azure/msal-common v5.
|
|
37
|
-
e.LogLevel=void 0,(J=e.LogLevel||(e.LogLevel={}))[J.Error=0]="Error",J[J.Warning=1]="Warning",J[J.Info=2]="Info",J[J.Verbose=3]="Verbose",J[J.Trace=4]="Trace";var ne,oe=function(){function t(t,r,n){this.level=e.LogLevel.Info;this.localCallback=t.loggerCallback||function(){},this.piiLoggingEnabled=t.piiLoggingEnabled||!1,this.level="number"==typeof t.logLevel?t.logLevel:e.LogLevel.Info,this.correlationId=t.correlationId||"",this.packageName=r||v.EMPTY_STRING,this.packageVersion=n||v.EMPTY_STRING}return t.prototype.clone=function(e,r,n){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},e,r)},t.prototype.logMessage=function(t,r){if(!(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)){var n=(new Date).toUTCString(),o=(re.isEmpty(r.correlationId)?re.isEmpty(this.correlationId)?"["+n+"]":"["+n+"] : ["+this.correlationId+"]":"["+n+"] : ["+r.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+e.LogLevel[r.logLevel]+" - "+t;this.executeCallback(r.logLevel,o,r.containsPii||!1)}},t.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},t.prototype.error=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:r||""})},t.prototype.errorPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:r||""})},t.prototype.warning=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:r||""})},t.prototype.warningPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:r||""})},t.prototype.info=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:r||""})},t.prototype.infoPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:r||""})},t.prototype.verbose=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:r||""})},t.prototype.verbosePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:r||""})},t.prototype.trace=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:r||""})},t.prototype.tracePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:r||""})},t.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},t}(),ie="5.0.1",ae=function(){function t(){}return t.prototype.generateAccountId=function(){return t.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},t.prototype.generateCredentialId=function(){return t.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},t.prototype.generateTarget=function(){return t.generateTargetForCacheKey(this.target)},t.prototype.generateCredentialKey=function(){return t.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType)},t.prototype.generateType=function(){switch(this.credentialType){case b.ID_TOKEN:return k.ID_TOKEN;case b.ACCESS_TOKEN:case b.ACCESS_TOKEN_WITH_AUTH_SCHEME:return k.ACCESS_TOKEN;case b.REFRESH_TOKEN:return k.REFRESH_TOKEN;default:throw te.createUnexpectedCredentialTypeError()}},t.getCredentialType=function(e){return-1!==e.indexOf(b.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(b.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?b.ACCESS_TOKEN_WITH_AUTH_SCHEME:b.ACCESS_TOKEN:-1!==e.indexOf(b.ID_TOKEN.toLowerCase())?b.ID_TOKEN:-1!==e.indexOf(b.REFRESH_TOKEN.toLowerCase())?b.REFRESH_TOKEN:v.NOT_DEFINED},t.generateCredentialCacheKey=function(t,r,n,o,i,a,s,c){var u=[this.generateAccountIdForCacheKey(t,r),this.generateCredentialIdForCacheKey(n,o,i,s),this.generateTargetForCacheKey(a)];return c===e.AuthenticationScheme.POP&&u.push(c.toLowerCase()),u.join(R.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateAccountIdForCacheKey=function(e,t){return[e,t].join(R.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateCredentialIdForCacheKey=function(e,t,r,n){return[e,e===b.REFRESH_TOKEN&&n||t,r||""].join(R.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateTargetForCacheKey=function(e){return(e||"").toLowerCase()},t}(),se={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a JSON object containing authorization_endpoint, token_endpoint, end_session_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."}},ce=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientConfigurationError",Object.setPrototypeOf(o,t.prototype),o}return u(t,e),t.createRedirectUriEmptyError=function(){return new t(se.redirectUriNotSet.code,se.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(se.postLogoutUriNotSet.code,se.postLogoutUriNotSet.desc)},t.createClaimsRequestParsingError=function(e){return new t(se.claimsRequestParsingError.code,se.claimsRequestParsingError.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(se.authorityUriInsecure.code,se.authorityUriInsecure.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(se.urlParseError.code,se.urlParseError.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(se.urlEmptyError.code,se.urlEmptyError.desc)},t.createEmptyScopesArrayError=function(){return new t(se.emptyScopesError.code,""+se.emptyScopesError.desc)},t.createClientIdSingleScopeError=function(e){return new t(se.clientIdSingleScopeError.code,se.clientIdSingleScopeError.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(se.invalidPrompt.code,se.invalidPrompt.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(se.invalidClaimsRequest.code,se.invalidClaimsRequest.desc)},t.createEmptyLogoutRequestError=function(){return new t(se.logoutRequestEmptyError.code,se.logoutRequestEmptyError.desc)},t.createEmptyTokenRequestError=function(){return new t(se.tokenRequestEmptyError.code,se.tokenRequestEmptyError.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(se.invalidCodeChallengeMethod.code,se.invalidCodeChallengeMethod.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(se.invalidCodeChallengeParams.code,se.invalidCodeChallengeParams.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(se.invalidCloudDiscoveryMetadata.code,se.invalidCloudDiscoveryMetadata.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(se.invalidAuthorityMetadata.code,se.invalidAuthorityMetadata.desc)},t.createUntrustedAuthorityError=function(){return new t(se.untrustedAuthority.code,se.untrustedAuthority.desc)},t}(te),ue=function(){function e(e){var t=this,r=e?re.trimArrayEntries(p(e)):[],n=r?re.removeEmptyStringsFromArray(r):[];this.validateInputScopes(n),this.scopes=new Set,n.forEach((function(e){return t.scopes.add(e)}))}return e.fromString=function(t){return new e((t||"").split(" "))},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw ce.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var r=new e(this.printScopesLowerCase().split(" "));return!re.isEmpty(t)&&r.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((function(e){return t.containsScope(e)})))},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return T.forEach((function(r){e.containsScope(r)&&(t+=1)})),this.scopes.size===t},e.prototype.appendScope=function(e){re.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach((function(e){return t.appendScope(e)}))}catch(e){throw te.createAppendScopeSetError(e)}},e.prototype.removeScope=function(e){if(re.isEmpty(e))throw te.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;T.forEach((function(t){e.scopes.delete(t)}))},e.prototype.unionScopeSets=function(e){if(!e)throw te.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach((function(e){return t.add(e.toLowerCase())})),this.scopes.forEach((function(e){return t.add(e.toLowerCase())})),t},e.prototype.intersectingScopeSets=function(e){if(!e)throw te.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r},e.prototype.getScopeCount=function(){return this.scopes.size},e.prototype.asArray=function(){var e=[];return this.scopes.forEach((function(t){return e.push(t)})),e},e.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):""},e.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},e}();
|
|
38
|
-
/*! @azure/msal-common v5.
|
|
39
|
-
/*! @azure/msal-common v5.
|
|
40
|
-
function de(e,t){if(re.isEmpty(e))throw te.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw te.createClientInfoDecodingError(e)}}function
|
|
41
|
-
/*! @azure/msal-common v5.
|
|
42
|
-
/*! @azure/msal-common v5.
|
|
43
|
-
var he=function(){function e(){}return e.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(R.CACHE_KEY_SEPARATOR).toLowerCase()},e.prototype.generateAccountKey=function(){return e.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},e.prototype.generateType=function(){switch(this.authorityType){case _.ADFS_ACCOUNT_TYPE:return k.ADFS;case _.MSAV1_ACCOUNT_TYPE:return k.MSA;case _.MSSTS_ACCOUNT_TYPE:return k.MSSTS;case _.GENERIC_ACCOUNT_TYPE:return k.GENERIC;default:throw te.createUnexpectedAccountTypeError()}},e.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims}},e.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||"",e.tenantId||""].join(R.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAccount=function(t,r,n,o,i,a,s,c){var u,d,l,h,p,g,f=new e;f.authorityType=_.MSSTS_ACCOUNT_TYPE,f.clientInfo=t,f.homeAccountId=r;var y=c||o&&o.getPreferredCache();if(!y)throw te.createInvalidCacheEnvironmentError();return f.environment=y,f.realm=(null===(u=null==n?void 0:n.claims)||void 0===u?void 0:u.tid)||"",f.oboAssertion=i,n&&(f.idTokenClaims=n.claims,f.localAccountId=(null===(d=null==n?void 0:n.claims)||void 0===d?void 0:d.oid)||(null===(l=null==n?void 0:n.claims)||void 0===l?void 0:l.sub)||"",f.username=(null===(h=null==n?void 0:n.claims)||void 0===h?void 0:h.preferred_username)||((null===(p=null==n?void 0:n.claims)||void 0===p?void 0:p.emails)?n.claims.emails[0]:""),f.name=null===(g=null==n?void 0:n.claims)||void 0===g?void 0:g.name),f.cloudGraphHostName=a,f.msGraphHost=s,f},e.createGenericAccount=function(t,r,n,o,i,a,s){var c,u,d,l,h=new e;h.authorityType=n&&n.authorityType===ne.Adfs?_.ADFS_ACCOUNT_TYPE:_.GENERIC_ACCOUNT_TYPE,h.homeAccountId=t,h.realm="",h.oboAssertion=o;var p=s||n&&n.getPreferredCache();if(!p)throw te.createInvalidCacheEnvironmentError();return r&&(h.localAccountId=(null===(c=null==r?void 0:r.claims)||void 0===c?void 0:c.oid)||(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.sub)||"",h.username=(null===(d=null==r?void 0:r.claims)||void 0===d?void 0:d.upn)||"",h.name=(null===(l=null==r?void 0:r.claims)||void 0===l?void 0:l.name)||"",h.idTokenClaims=null==r?void 0:r.claims),h.environment=p,h.cloudGraphHostName=i,h.msGraphHost=a,h},e.generateHomeAccountId=function(e,t,r,n,o){var i,a=(null===(i=null==o?void 0:o.claims)||void 0===i?void 0:i.sub)?o.claims.sub:v.EMPTY_STRING;if(t===ne.Adfs)return a;if(e)try{var s=de(e,n);if(!re.isEmpty(s.uid)&&!re.isEmpty(s.utid))return""+s.uid+R.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),a},e.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},e.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var n=!0;if(r){var o=e.idTokenClaims||{},i=t.idTokenClaims||{};n=o.iat===i.iat&&o.nonce===i.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&n},e}(),pe=function(){function e(t,r){if(re.isEmpty(t))throw te.createTokenNullOrEmptyError(t);this.rawToken=t,this.claims=e.extractTokenClaims(t,r)}return e.extractTokenClaims=function(e,t){var r=re.decodeAuthToken(e);try{var n=r.JWSPayload,o=t.base64Decode(n);return JSON.parse(o)}catch(e){throw te.createTokenParsingError(e)}},e}(),ge=function(){function t(e,t){this.clientId=e,this.cryptoImpl=t}return t.prototype.getAllAccounts=function(){var e=this,r=this.getAccountsFilteredBy(),n=Object.keys(r).map((function(e){return r[e]}));return n.length<1?[]:n.map((function(r){var n=t.toObject(new he,r).getAccountInfo(),o=e.readIdTokenFromCache(e.clientId,n);return o&&!n.idTokenClaims&&(n.idTokenClaims=new pe(o.secret,e.cryptoImpl).claims),n}))},t.prototype.saveCacheRecord=function(e){return l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:if(!e)throw te.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}}))}))},t.prototype.saveAccessToken=function(e){return l(this,void 0,void 0,(function(){var t,r,n,o,i=this;return h(this,(function(a){switch(a.label){case 0:return t=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType}),r=ue.fromString(e.target),(n=Object.keys(t.accessTokens).map((function(e){return t.accessTokens[e]})))?(o=[],n.forEach((function(e){ue.fromString(e.target).intersectingScopeSets(r)&&o.push(i.removeCredential(e))})),[4,Promise.all(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return this.setAccessTokenCredential(e),[2]}}))}))},t.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:"",e?e.environment:"",e?e.realm:"")},t.prototype.getAccountsFilteredByInternal=function(e,t,r){var n=this,o=this.getKeys(),i={};return o.forEach((function(o){var a=n.getAccount(o);a&&(e&&!n.matchHomeAccountId(a,e)||t&&!n.matchEnvironment(a,t)||r&&!n.matchRealm(a,r)||(i[o]=a))})),i},t.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.oboAssertion,e.tokenType)},t.prototype.getCredentialsFilteredByInternal=function(t,r,n,o,i,a,s,c,u){var d=this,l=this.getKeys(),h={idTokens:{},accessTokens:{},refreshTokens:{}};return l.forEach((function(l){var p=ae.getCredentialType(l);if(p!==v.NOT_DEFINED){var g=d.getSpecificCredential(l,p);if(g&&(!c||d.matchOboAssertion(g,c))&&(!t||d.matchHomeAccountId(g,t))&&(!r||d.matchEnvironment(g,r))&&(!a||d.matchRealm(g,a))&&(!n||d.matchCredentialType(g,n))&&(!o||d.matchClientId(g,o))&&(!i||d.matchFamilyId(g,i))&&(!s||d.matchTarget(g,s))){if(n===b.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(u&&!d.matchTokenType(g,u))return;if(-1===l.indexOf(e.AuthenticationScheme.POP))return void d.removeItem(l,O.CREDENTIAL)}switch(p){case b.ID_TOKEN:h.idTokens[l]=g;break;case b.ACCESS_TOKEN:case b.ACCESS_TOKEN_WITH_AUTH_SCHEME:h.accessTokens[l]=g;break;case b.REFRESH_TOKEN:h.refreshTokens[l]=g}}}})),h},t.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},t.prototype.getAppMetadataFilteredByInternal=function(e,t){var r=this,n=this.getKeys(),o={};return n.forEach((function(n){if(r.isAppMetadata(n)){var i=r.getAppMetadata(n);i&&(e&&!r.matchEnvironment(i,e)||t&&!r.matchClientId(i,t)||(o[n]=i))}})),o},t.prototype.getAuthorityMetadataByAlias=function(e){var t=this,r=this.getAuthorityMetadataKeys(),n=null;return r.forEach((function(r){if(t.isAuthorityMetadata(r)&&-1!==r.indexOf(t.clientId)){var o=t.getAuthorityMetadata(r);o&&-1!==o.aliases.indexOf(e)&&(n=o)}})),n},t.prototype.removeAllAccounts=function(){return l(this,void 0,void 0,(function(){var e,t,r=this;return h(this,(function(n){switch(n.label){case 0:return e=this.getKeys(),t=[],e.forEach((function(e){r.getAccount(e)&&t.push(r.removeAccount(e))})),[4,Promise.all(t)];case 1:return n.sent(),[2,!0]}}))}))},t.prototype.removeAccount=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:if(!(t=this.getAccount(e)))throw te.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,r.sent()&&this.removeItem(e,O.ACCOUNT)]}}))}))},t.prototype.removeAccountContext=function(e){return l(this,void 0,void 0,(function(){var t,r,n,o=this;return h(this,(function(i){switch(i.label){case 0:return t=this.getKeys(),r=e.generateAccountId(),n=[],t.forEach((function(e){var t=ae.getCredentialType(e);if(t!==v.NOT_DEFINED){var i=o.getSpecificCredential(e,t);i&&r===i.generateAccountId()&&n.push(o.removeCredential(i))}})),[4,Promise.all(n)];case 1:return i.sent(),[2,!0]}}))}))},t.prototype.removeCredential=function(e){return l(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){switch(n.label){case 0:if(t=e.generateCredentialKey(),e.credentialType.toLowerCase()!==b.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(!(r=e.keyId))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(r)];case 2:return n.sent(),[3,4];case 3:throw n.sent(),te.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t,O.CREDENTIAL)]}}))}))},t.prototype.removeAppMetadata=function(){var e=this;return this.getKeys().forEach((function(t){e.isAppMetadata(t)&&e.removeItem(t,O.APP_METADATA)})),!0},t.prototype.readCacheRecord=function(e,t,r,n,o){var i=this.readAccountFromCache(e),a=this.readIdTokenFromCache(t,e),s=this.readAccessTokenFromCache(t,e,r,o),c=this.readRefreshTokenFromCache(t,e,!1),u=this.readAppMetadataFromCache(n,t);return i&&a&&(i.idTokenClaims=new pe(a.secret,this.cryptoImpl).claims),{account:i,idToken:a,accessToken:s,refreshToken:c,appMetadata:u}},t.prototype.readAccountFromCache=function(e){var t=he.generateAccountCacheKey(e);return this.getAccount(t)},t.prototype.readIdTokenFromCache=function(e,t){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:b.ID_TOKEN,clientId:e,realm:t.tenantId},n=this.getCredentialsFilteredBy(r),o=Object.keys(n.idTokens).map((function(e){return n.idTokens[e]})),i=o.length;if(i<1)return null;if(i>1)throw te.createMultipleMatchingTokensInCacheError();return o[0]},t.prototype.readAccessTokenFromCache=function(t,r,n,o){var i=o===e.AuthenticationScheme.POP?b.ACCESS_TOKEN_WITH_AUTH_SCHEME:b.ACCESS_TOKEN,a={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:i,clientId:t,realm:r.tenantId,target:n.printScopesLowerCase(),tokenType:o},s=this.getCredentialsFilteredBy(a),c=Object.keys(s.accessTokens).map((function(e){return s.accessTokens[e]})),u=c.length;if(u<1)return null;if(u>1)throw te.createMultipleMatchingTokensInCacheError();return c[0]},t.prototype.readRefreshTokenFromCache=function(e,t,r){var n=r?M:void 0,o={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:b.REFRESH_TOKEN,clientId:e,familyId:n},i=this.getCredentialsFilteredBy(o),a=Object.keys(i.refreshTokens).map((function(e){return i.refreshTokens[e]}));return a.length<1?null:a[0]},t.prototype.readAppMetadataFromCache=function(e,t){var r={environment:e,clientId:t},n=this.getAppMetadataFilteredBy(r),o=Object.keys(n).map((function(e){return n[e]})),i=o.length;if(i<1)return null;if(i>1)throw te.createMultipleMatchingAppMetadataInCacheError();return o[0]},t.prototype.isAppMetadataFOCI=function(e,t){var r=this.readAppMetadataFromCache(e,t);return!(!r||r.familyId!==M)},t.prototype.matchHomeAccountId=function(e,t){return!(!e.homeAccountId||t!==e.homeAccountId)},t.prototype.matchOboAssertion=function(e,t){return!(!e.oboAssertion||t!==e.oboAssertion)},t.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},t.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},t.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},t.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},t.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},t.prototype.matchTarget=function(e,t){if(e.credentialType!==b.ACCESS_TOKEN&&e.credentialType!==b.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;var r=ue.fromString(e.target),n=ue.fromString(t);return n.containsOnlyOIDCScopes()?n.removeScope(v.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),r.containsScopeSet(n)},t.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},t.prototype.isAppMetadata=function(e){return-1!==e.indexOf(U)},t.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(L)},t.prototype.generateAuthorityMetadataCacheKey=function(e){return L+"-"+this.clientId+"-"+e},t.prototype.getSpecificCredential=function(e,t){switch(t){case b.ID_TOKEN:return this.getIdTokenCredential(e);case b.ACCESS_TOKEN:case b.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case b.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},t.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},t}(),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.setAccount=function(){throw Z.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},t.prototype.getAccount=function(){throw Z.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},t.prototype.setIdTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getIdTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAccessTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getAccessTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setRefreshTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getRefreshTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAppMetadata=function(){throw Z.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAppMetadata=function(){throw Z.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.setServerTelemetry=function(){throw Z.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.getServerTelemetry=function(){throw Z.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.setAuthorityMetadata=function(){throw Z.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadata=function(){throw Z.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadataKeys=function(){throw Z.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},t.prototype.setThrottlingCache=function(){throw Z.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.getThrottlingCache=function(){throw Z.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.removeItem=function(){throw Z.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},t.prototype.containsKey=function(){throw Z.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},t.prototype.getKeys=function(){throw Z.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},t.prototype.clear=function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Storage interface - clear() has not been implemented for the cacheStorage interface.",Z.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")}))}))},t}(ge),ye={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},me={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:""},Ee={sendGetRequestAsync:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Network interface - sendGetRequestAsync() has not been implemented",Z.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")}))}))},sendPostRequestAsync:function(){return l(this,void 0,void 0,(function(){return h(this,(function(e){throw"Network interface - sendPostRequestAsync() has not been implemented",Z.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")}))}))}},ve={sku:v.SKU,version:ie,cpu:"",os:""},Ce={clientSecret:"",clientAssertion:void 0};
|
|
44
|
-
/*! @azure/msal-common v5.
|
|
45
|
-
/*! @azure/msal-common v5.
|
|
46
|
-
var Te,Se=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="ServerError",Object.setPrototypeOf(i,t.prototype),i}return u(t,e),t}(Z),we=function(){function e(){}return e.generateThrottlingStorageKey=function(e){return W+"."+JSON.stringify(e)},e.preProcess=function(t,r){var n,o=e.generateThrottlingStorageKey(r),i=t.getThrottlingCache(o);if(i){if(i.throttleTime<Date.now())return void t.removeItem(o,O.THROTTLING);throw new Se((null===(n=i.errorCodes)||void 0===n?void 0:n.join(" "))||v.EMPTY_STRING,i.errorMessage,i.subError)}},e.postProcess=function(t,r,n){if(e.checkResponseStatus(n)||e.checkResponseForRetryAfter(n)){var o={throttleTime:e.calculateThrottleTime(parseInt(n.headers[g.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};t.setThrottlingCache(e.generateThrottlingStorageKey(r),o)}},e.checkResponseStatus=function(e){return 429===e.status||e.status>=500&&e.status<600},e.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(g.RETRY_AFTER)&&(e.status<200||e.status>=300))},e.calculateThrottleTime=function(e){var t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||j),r+z))},e.removeThrottle=function(e,t,r,n){var o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims},i=this.generateThrottlingStorageKey(o);return e.removeItem(i,O.THROTTLING)},e}(),Ie=function(){function e(e,t){this.networkClient=e,this.cacheManager=t}return e.prototype.sendPostRequest=function(e,t,r){return
|
|
47
|
-
/*! @azure/msal-common v5.
|
|
48
|
-
/*! @azure/msal-common v5.
|
|
49
|
-
var Ae,_e=function(){function e(e){var t,r,n,o,i,a,s,c,u,l,h,p,g,f;this.config=(n=(t=e).authOptions,o=t.systemOptions,i=t.loggerOptions,a=t.storageInterface,s=t.networkInterface,c=t.cryptoInterface,u=t.clientCredentials,l=t.libraryInfo,h=t.serverTelemetryManager,p=t.persistencePlugin,g=t.serializableCache,f=d(d({},me),i),{authOptions:(r=n,d({clientCapabilities:[]},r)),systemOptions:d(d({},ye),o),loggerOptions:f,storageInterface:a||new fe(n.clientId,$),networkInterface:s||Ee,cryptoInterface:c||$,clientCredentials:u||Ce,libraryInfo:d(d({},ve),l),serverTelemetryManager:h||null,persistencePlugin:p||null,serializableCache:g||null}),this.logger=new oe(this.config.loggerOptions,"@azure/msal-common",ie),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Ie(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority}return e.prototype.createTokenRequestHeaders=function(e){var t={};if(t[g.CONTENT_TYPE]=v.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Te.HOME_ACCOUNT_ID:try{var r=le(e.credential);t[g.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:t[g.CCS_HEADER]="UPN: "+e.credential}return t},e.prototype.executePostToTokenEndpoint=function(e,t,r,n){return l(this,void 0,void 0,(function(){var o;return h(this,(function(i){switch(i.label){case 0:return[4,this.networkManager.sendPostRequest(n,e,{body:t,headers:r})];case 1:return o=i.sent(),this.config.serverTelemetryManager&&o.status<500&&429!==o.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}}))}))},e.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw te.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},e}(),Re=function(){function e(){}return e.validateRedirectUri=function(e){if(re.isEmpty(e))throw ce.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in w)t.push(w[r]);if(t.indexOf(e)<0)throw ce.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw ce.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(re.isEmpty(e)||re.isEmpty(t))throw ce.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if([N.PLAIN,N.S256].indexOf(e)<0)throw ce.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach((function(t,r){e[r]&&delete e[r]})),e):{}},e}(),be=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(m.RESPONSE_TYPE,encodeURIComponent(v.CODE_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(m.RESPONSE_MODE,encodeURIComponent(e||I.QUERY))},t.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=t?p(e||[],C):e||[],n=new ue(r);this.parameters.set(m.SCOPE,encodeURIComponent(n.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(m.CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e){Re.validateRedirectUri(e),this.parameters.set(m.REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){Re.validateRedirectUri(e),this.parameters.set(m.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(m.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(S.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(S.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(g.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(g.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(S.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);Re.validateClaims(r),this.parameters.set(m.CLAIMS,encodeURIComponent(r))},t.prototype.addCorrelationId=function(e){this.parameters.set(m.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(m.X_CLIENT_SKU,e.sku),this.parameters.set(m.X_CLIENT_VER,e.version),this.parameters.set(m.X_CLIENT_OS,e.os),this.parameters.set(m.X_CLIENT_CPU,e.cpu)},t.prototype.addPrompt=function(e){Re.validatePrompt(e),this.parameters.set(""+m.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){re.isEmpty(e)||this.parameters.set(m.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(m.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,t){if(Re.validateCodeChallengeParams(e,t),!e||!t)throw ce.createInvalidCodeChallengeParamsError();this.parameters.set(m.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(m.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},t.prototype.addAuthorizationCode=function(e){this.parameters.set(m.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(m.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(m.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(m.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(m.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){this.parameters.set(m.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){this.parameters.set(m.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(m.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(m.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(m.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},t.prototype.addExtraQueryParameters=function(e){var t=this;Re.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach((function(r){t.parameters.set(r,e[r])}))},t.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw ce.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(E.ACCESS_TOKEN)||(r[E.ACCESS_TOKEN]={}),r[E.ACCESS_TOKEN][E.XMS_CC]={values:t}),JSON.stringify(r)},t.prototype.addUsername=function(e){this.parameters.set(F.username,e)},t.prototype.addPassword=function(e){this.parameters.set(F.password,e)},t.prototype.addPopToken=function(t){re.isEmpty(t)||(this.parameters.set(m.TOKEN_TYPE,e.AuthenticationScheme.POP),this.parameters.set(m.REQ_CNF,encodeURIComponent(t)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(m.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(m.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(m.X_MS_LIB_CAPABILITY,Y)},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach((function(t,r){e.push(r+"="+t)})),e.join("&")},t}(),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.createIdTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.credentialType=b.ID_TOKEN,s.homeAccountId=e,s.environment=r,s.clientId=o,s.secret=n,s.realm=i,s.oboAssertion=a,s},t.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===b.ID_TOKEN)},t}(ae),ke=function(){function e(){}return e.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},e.isTokenExpired=function(t,r){var n=Number(t)||0;return e.nowSeconds()+r>n},e.wasClockTurnedBack=function(t){return Number(t)>e.nowSeconds()},e.delay=function(e,t){return new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))},e}(),Ne=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return u(r,t),r.createAccessTokenEntity=function(t,n,o,i,a,s,c,u,d,l,h,p){var g,f=new r;f.homeAccountId=t,f.credentialType=b.ACCESS_TOKEN,f.secret=o;var y=ke.nowSeconds();if(f.cachedAt=y.toString(),f.expiresOn=c.toString(),f.extendedExpiresOn=u.toString(),l&&(f.refreshOn=l.toString()),f.environment=n,f.clientId=i,f.realm=a,f.target=s,f.oboAssertion=p,f.tokenType=re.isEmpty(h)?e.AuthenticationScheme.BEARER:h,f.tokenType===e.AuthenticationScheme.POP){f.credentialType=b.ACCESS_TOKEN_WITH_AUTH_SCHEME;var m=pe.extractTokenClaims(o,d);if(!(null===(g=null==m?void 0:m.cnf)||void 0===g?void 0:g.kid))throw te.createTokenClaimsRequiredError();f.keyId=m.cnf.kid}return f},r.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===b.ACCESS_TOKEN||e.credentialType===b.ACCESS_TOKEN_WITH_AUTH_SCHEME))},r}(ae),Pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.createRefreshTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.clientId=o,s.credentialType=b.REFRESH_TOKEN,s.environment=r,s.homeAccountId=e,s.secret=n,s.oboAssertion=a,i&&(s.familyId=i),s},t.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===b.REFRESH_TOKEN)},t}(ae),Ue=["interaction_required","consent_required","login_required"],Me=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Le={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."}},qe=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="InteractionRequiredAuthError",Object.setPrototypeOf(i,t.prototype),i}return u(t,e),t.isInteractionRequiredError=function(e,t,r){var n=!!e&&Ue.indexOf(e)>-1,o=!!r&&Me.indexOf(r)>-1,i=!!t&&Ue.some((function(e){return t.indexOf(e)>-1}));return n||i||o},t.createNoTokensFoundError=function(){return new t(Le.noTokensFoundError.code,Le.noTokensFoundError.desc)},t}(Z),De=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null},He=function(){function e(){}return e.setRequestState=function(t,r,n){var o=e.generateLibraryState(t,n);return re.isEmpty(r)?o:""+o+v.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t){if(!e)throw te.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var n=JSON.stringify(r);return e.base64Encode(n)},e.parseRequestState=function(e,t){if(!e)throw te.createNoCryptoObjectError("parseRequestState");if(re.isEmpty(t))throw te.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(v.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(v.RESOURCE_DELIM):"",i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:re.isEmpty(o)?"":o,libraryState:a}}catch(e){throw te.createInvalidStateError(t,e)}},e}(),Fe=function(){function e(t){if(this._urlString=t,re.isEmpty(this._urlString))throw ce.createUrlEmptyError();re.isEmpty(this.getHash())&&(this._urlString=e.canonicalizeUri(t))}return Object.defineProperty(e.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),e.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return re.endsWith(t,"?")?t=t.slice(0,-1):re.endsWith(t,"?/")&&(t=t.slice(0,-2)),re.endsWith(t,"/")||(t+="/"),t}return e},e.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw ce.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw ce.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw ce.createInsecureAuthorityUriError(this.urlString)},e.appendQueryString=function(e,t){return re.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},e.removeHashFromUrl=function(t){return e.canonicalizeUri(t.split("#")[0])},e.prototype.replaceTenantPath=function(t){var r=this.getUrlComponents(),n=r.PathSegments;return!t||0===n.length||n[0]!==y.COMMON&&n[0]!==y.ORGANIZATIONS||(n[0]=t),e.constructAuthorityUriFromObject(r)},e.prototype.getHash=function(){return e.parseHash(this.urlString)},e.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw ce.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},n=r.AbsolutePath.split("/");return n=n.filter((function(e){return e&&e.length>0})),r.PathSegments=n,!re.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},e.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw ce.createUrlParseError("Given url string: "+e);return r[2]},e.getAbsoluteUrl=function(t,r){if(t[0]===v.FORWARD_SLASH){var n=new e(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t},e.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):""},e.constructAuthorityUriFromObject=function(t){return new e(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"))},e.getDeserializedHash=function(t){if(re.isEmpty(t))return{};var r=e.parseHash(t),n=re.queryStringToObject(re.isEmpty(r)?t:r);if(!n)throw te.createHashNotDeserializedError(JSON.stringify(n));return n},e.hashContainsKnownProperties=function(t){if(re.isEmpty(t)||t.indexOf("=")<0)return!1;var r=e.getDeserializedHash(t);return!!(r.code||r.error_description||r.error||r.state)},e}();
|
|
50
|
-
/*! @azure/msal-common v5.0.1 2021-10-05 */!function(e){e.SW="sw",e.UHW="uhw"}(Ae||(Ae={}));var Ke,xe=function(){function e(e){this.cryptoUtils=e}return e.prototype.generateCnf=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return[4,this.generateKid(e)];case 1:return t=r.sent(),[2,this.cryptoUtils.base64Encode(JSON.stringify(t))]}}))}))},e.prototype.generateKid=function(e){return l(this,void 0,void 0,(function(){return h(this,(function(t){switch(t.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return[2,{kid:t.sent(),xms_ksl:Ae.SW}]}}))}))},e.prototype.signPopToken=function(e,t){var r;return l(this,void 0,void 0,(function(){var n;return h(this,(function(o){if(n=pe.extractTokenClaims(e,this.cryptoUtils),!(null===(r=null==n?void 0:n.cnf)||void 0===r?void 0:r.kid))throw te.createTokenClaimsRequiredError();return[2,this.signPayload(e,n.cnf.kid,t)]}))}))},e.prototype.signPayload=function(e,t,r,n){return l(this,void 0,void 0,(function(){var o,i,a,s,c;return h(this,(function(u){switch(u.label){case 0:return o=r.resourceRequestMethod,i=r.resourceRequestUri,a=r.shrClaims,s=i?new Fe(i):void 0,c=null==s?void 0:s.getUrlComponents(),[4,this.cryptoUtils.signJwt(d({at:e,ts:ke.nowSeconds(),m:null==o?void 0:o.toUpperCase(),u:null==c?void 0:c.HostNameAndPort,nonce:this.cryptoUtils.createNewGuid(),p:null==c?void 0:c.AbsolutePath,q:(null==c?void 0:c.QueryString)?[[],c.QueryString]:void 0,client_claims:a||void 0},n),t)];case 1:return[2,u.sent()]}}))}))},e}(),Be=function(){function e(){}return e.prototype.generateAppMetadataKey=function(){return e.generateAppMetadataCacheKey(this.environment,this.clientId)},e.generateAppMetadataCacheKey=function(e,t){return[U,e,t].join(R.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAppMetadataEntity=function(t,r,n){var o=new e;return o.clientId=t,o.environment=r,n&&(o.familyId=n),o},e.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(U)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},e}(),Ge=function(){function e(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(e.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),e}(),je=function(){function t(e,t,r,n,o,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i}return t.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?te.createStateNotFoundError("Cached State"):te.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw te.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(qe.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new qe(e.error||v.EMPTY_STRING,e.error_description,e.suberror);throw new Se(e.error||v.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&de(e.client_info,r)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(qe.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new qe(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Se(e.error,t,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,o,i,a,s){return l(this,void 0,void 0,(function(){var c,u,d,l,p;return h(this,(function(h){switch(h.label){case 0:if(e.id_token&&(c=new pe(e.id_token||v.EMPTY_STRING,this.cryptoObj),i&&!re.isEmpty(i.nonce)&&c.claims.nonce!==i.nonce))throw te.createNonceMismatchError();this.homeAccountIdentifier=he.generateHomeAccountId(e.client_info||v.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,c),i&&i.state&&(u=He.parseRequestState(this.cryptoObj,i.state)),d=this.generateCacheRecord(e,r,n,c,o.scopes,a,i),h.label=1;case 1:return h.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),l=new Ge(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(l)]):[3,3];case 2:h.sent(),h.label=3;case 3:return!s||!d.account||(p=d.account.generateAccountKey(),this.cacheStorage.getAccount(p))?[4,this.cacheStorage.saveCacheRecord(d)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,c,u)]);case 4:return h.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&l?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(l)]):[3,7];case 6:h.sent(),h.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,c,u)]}}))}))},t.prototype.generateCacheRecord=function(e,t,r,n,o,i,a){var s,c,u=t.getPreferredCache();if(re.isEmpty(u))throw te.createInvalidCacheEnvironmentError();!re.isEmpty(e.id_token)&&n&&(s=Oe.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||v.EMPTY_STRING,this.clientId,n.claims.tid||v.EMPTY_STRING,i),c=this.generateAccountEntity(e,n,t,i,a));var d=null;if(!re.isEmpty(e.access_token)){var l=e.scope?ue.fromString(e.scope):new ue(o||[]),h=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,p=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,g=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,f=r+h,y=f+p,m=g&&g>0?r+g:void 0;d=Ne.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||v.EMPTY_STRING,this.clientId,n?n.claims.tid||v.EMPTY_STRING:t.tenant,l.printScopes(),f,y,this.cryptoObj,m,e.token_type,i)}var E=null;re.isEmpty(e.refresh_token)||(E=Pe.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||v.EMPTY_STRING,this.clientId,e.foci,i));var C=null;return re.isEmpty(e.foci)||(C=Be.createAppMetadataEntity(this.clientId,u,e.foci)),new De(c,s,d,E,C)},t.prototype.generateAccountEntity=function(e,t,r,n,o){var i=r.authorityType,a=o?o.cloud_graph_host_name:"",s=o?o.msgraph_host:"";if(i===ne.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),he.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s);if(re.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw te.createClientInfoEmptyError();return e.client_info?he.createAccount(e.client_info,this.homeAccountIdentifier,t,r,n,a,s):he.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s)},t.generateAuthenticationResult=function(t,r,n,o,i,a,s){var c,u,d;return l(this,void 0,void 0,(function(){var l,p,g,f,y,m,E;return h(this,(function(h){switch(h.label){case 0:return l="",p=[],g=null,y=v.EMPTY_STRING,n.accessToken?n.accessToken.tokenType!==e.AuthenticationScheme.POP?[3,2]:[4,new xe(t).signPopToken(n.accessToken.secret,i)]:[3,4];case 1:return l=h.sent(),[3,3];case 2:l=n.accessToken.secret,h.label=3;case 3:p=ue.fromString(n.accessToken.target).asArray(),g=new Date(1e3*Number(n.accessToken.expiresOn)),f=new Date(1e3*Number(n.accessToken.extendedExpiresOn)),h.label=4;case 4:return n.appMetadata&&(y=n.appMetadata.familyId===M?M:v.EMPTY_STRING),m=(null==a?void 0:a.claims.oid)||(null==a?void 0:a.claims.sub)||v.EMPTY_STRING,E=(null==a?void 0:a.claims.tid)||v.EMPTY_STRING,[2,{authority:r.canonicalAuthority,uniqueId:m,tenantId:E,scopes:p,account:n.account?n.account.getAccountInfo():null,idToken:a?a.rawToken:v.EMPTY_STRING,idTokenClaims:a?a.claims:{},accessToken:l,fromCache:o,expiresOn:g,correlationId:i.correlationId,extExpiresOn:f,familyId:y,tokenType:(null===(c=n.accessToken)||void 0===c?void 0:c.tokenType)||v.EMPTY_STRING,state:s?s.userRequestState:v.EMPTY_STRING,cloudGraphHostName:(null===(u=n.account)||void 0===u?void 0:u.cloudGraphHostName)||v.EMPTY_STRING,msGraphHost:(null===(d=n.account)||void 0===d?void 0:d.msGraphHost)||v.EMPTY_STRING}]}}))}))},t}(),ze=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.getAuthCodeUrl=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){return t=this.createAuthCodeUrlQueryString(e),[2,Fe.appendQueryString(this.authority.authorizationEndpoint,t)]}))}))},r.prototype.acquireToken=function(e,t){return l(this,void 0,void 0,(function(){var r,n,o;return h(this,(function(i){switch(i.label){case 0:if(this.logger.info("in acquireToken call"),!e||re.isEmpty(e.code))throw te.createTokenRequestCannotBeMadeError();return r=ke.nowSeconds(),[4,this.executeTokenRequest(this.authority,e)];case 1:return n=i.sent(),(o=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(n.body),[4,o.handleServerTokenResponse(n.body,this.authority,r,e,t)];case 2:return[2,i.sent()]}}))}))},r.prototype.handleFragmentResponse=function(e,t){var r=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new Fe(e),o=Fe.getDeserializedHash(n.getHash());if(r.validateServerAuthorizationCodeResponse(o,t,this.cryptoUtils),!o.code)throw te.createNoAuthCodeInServerResponseError();return d(d({},o),{code:o.code})},r.prototype.getLogoutUri=function(e){if(!e)throw ce.createEmptyLogoutRequestError();var t=this.createLogoutUrlQueryString(e);return Fe.appendQueryString(this.authority.endSessionEndpoint,t)},r.prototype.executeTokenRequest=function(e,t){return l(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return h(this,(function(u){switch(u.label){case 0:return r={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims},[4,this.createTokenRequestBody(t)];case 1:if(n=u.sent(),o=this.createTokenQueryParameters(t),i=void 0,t.clientInfo)try{a=de(t.clientInfo,this.cryptoUtils),i={credential:""+a.uid+R.CLIENT_INFO_SEPARATOR+a.utid,type:Te.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return s=this.createTokenRequestHeaders(i||t.ccsCredential),c=re.isEmpty(o)?e.tokenEndpoint:e.tokenEndpoint+"?"+o,[2,this.executePostToTokenEndpoint(c,n,s,r)]}}))}))},r.prototype.createTokenQueryParameters=function(e){var t=new be;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r.prototype.createTokenRequestBody=function(t){return l(this,void 0,void 0,(function(){var r,n,o,i,a,s;return h(this,(function(c){switch(c.label){case 0:return(r=new be).addClientId(this.config.authOptions.clientId),r.addRedirectUri(t.redirectUri),r.addScopes(t.scopes),r.addAuthorizationCode(t.code),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&r.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(n=this.config.clientCredentials.clientAssertion,r.addClientAssertion(n.assertion),r.addClientAssertionType(n.assertionType)),r.addGrantType(A.AUTHORIZATION_CODE_GRANT),r.addClientInfo(),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:[4,new xe(this.cryptoUtils).generateCnf(t)];case 1:o=c.sent(),r.addPopToken(o),c.label=2;case 2:if(i=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(i),(!re.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),a=void 0,t.clientInfo)try{s=de(t.clientInfo,this.cryptoUtils),a={credential:""+s.uid+R.CLIENT_INFO_SEPARATOR+s.utid,type:Te.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else a=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&a)switch(a.type){case Te.HOME_ACCOUNT_ID:try{s=le(a.credential),r.addCcsOid(s)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:r.addCcsUpn(a.credential)}return[2,r.createQueryString()]}}))}))},r.prototype.createAuthCodeUrlQueryString=function(e){var t=new be;t.addClientId(this.config.authOptions.clientId);var r=p(e.scopes||[],e.extraScopesToConsent||[]);t.addScopes(r),t.addRedirectUri(e.redirectUri);var n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==w.SELECT_ACCOUNT)if(e.sid&&e.prompt===w.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){var o=this.extractAccountSid(e.account);if(o&&e.prompt===w.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(o);try{var i=le(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{i=le(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(!re.isEmpty(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},r.prototype.createLogoutUrlQueryString=function(e){var t=new be;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},r.prototype.extractAccountSid=function(e){return e.idTokenClaims&&e.idTokenClaims.sid||null},r}(_e),We=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.acquireToken=function(e){return l(this,void 0,void 0,(function(){var t,r,n;return h(this,(function(o){switch(o.label){case 0:return t=ke.nowSeconds(),[4,this.executeTokenRequest(e,this.authority)];case 1:return r=o.sent(),(n=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[2,n.handleServerTokenResponse(r.body,this.authority,t,e,void 0,void 0,!0)]}}))}))},r.prototype.acquireTokenByRefreshToken=function(e){return l(this,void 0,void 0,(function(){var t,r;return h(this,(function(n){if(!e)throw ce.createEmptyTokenRequestError();if(!e.account)throw te.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(e,!0)]}catch(n){if(t=n instanceof qe&&n.errorCode===Le.noTokensFoundError.code,r=n instanceof Se&&n.errorCode===V&&n.subError===Q,t||r)return[2,this.acquireTokenWithCachedRefreshToken(e,!1)];throw n}return[2,this.acquireTokenWithCachedRefreshToken(e,!1)]}))}))},r.prototype.acquireTokenWithCachedRefreshToken=function(t,r){return l(this,void 0,void 0,(function(){var n,o;return h(this,(function(i){if(!(n=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,t.account,r)))throw qe.createNoTokensFoundError();return o=d(d({},t),{refreshToken:n.secret,authenticationScheme:t.authenticationScheme||e.AuthenticationScheme.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:Te.HOME_ACCOUNT_ID}}),[2,this.acquireToken(o)]}))}))},r.prototype.executeTokenRequest=function(e,t){return l(this,void 0,void 0,(function(){var r,n,o,i,a;return h(this,(function(s){switch(s.label){case 0:return[4,this.createTokenRequestBody(e)];case 1:return r=s.sent(),n=this.createTokenQueryParameters(e),o=this.createTokenRequestHeaders(e.ccsCredential),i={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims},a=Fe.appendQueryString(t.tokenEndpoint,n),[2,this.executePostToTokenEndpoint(a,r,o,i)]}}))}))},r.prototype.createTokenQueryParameters=function(e){var t=new be;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r.prototype.createTokenRequestBody=function(t){return l(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return h(this,(function(u){switch(u.label){case 0:return(r=new be).addClientId(this.config.authOptions.clientId),r.addScopes(t.scopes),r.addGrantType(A.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),n=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(n),r.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(o=this.config.clientCredentials.clientAssertion,r.addClientAssertion(o.assertion),r.addClientAssertionType(o.assertionType)),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:(i=new xe(this.cryptoUtils),s=(a=r).addPopToken,[4,i.generateCnf(t)]);case 1:s.apply(a,[u.sent()]),u.label=2;case 2:if((!re.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case Te.HOME_ACCOUNT_ID:try{c=le(t.ccsCredential.credential),r.addCcsOid(c)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:r.addCcsUpn(t.ccsCredential.credential)}return[2,r.createQueryString()]}}))}))},r}(_e),Ye=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.acquireToken=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.acquireCachedToken(e)];case 1:return[2,r.sent()];case 2:if((t=r.sent())instanceof te&&t.errorCode===ee.tokenRefreshRequired.code)return[2,new We(this.config).acquireTokenByRefreshToken(e)];throw t;case 3:return[2]}}))}))},r.prototype.acquireCachedToken=function(t){var r,n,o,i;return l(this,void 0,void 0,(function(){var a,s,c,u;return h(this,(function(d){switch(d.label){case 0:if(!t)throw ce.createEmptyTokenRequestError();if(!t.account)throw te.createNoAccountInSilentRequestError();if(a=new ue(t.scopes||[]),s=t.authority||this.authority.getPreferredCache(),c=t.authenticationScheme||e.AuthenticationScheme.BEARER,u=this.cacheManager.readCacheRecord(t.account,this.config.authOptions.clientId,a,s,c),t.forceRefresh)throw null===(r=this.serverTelemetryManager)||void 0===r||r.setCacheOutcome(G.FORCE_REFRESH),te.createRefreshRequiredError();if(!u.accessToken)throw null===(n=this.serverTelemetryManager)||void 0===n||n.setCacheOutcome(G.NO_CACHED_ACCESS_TOKEN),te.createRefreshRequiredError();if(ke.wasClockTurnedBack(u.accessToken.cachedAt)||ke.isTokenExpired(u.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null===(o=this.serverTelemetryManager)||void 0===o||o.setCacheOutcome(G.CACHED_ACCESS_TOKEN_EXPIRED),te.createRefreshRequiredError();if(u.accessToken.refreshOn&&ke.isTokenExpired(u.accessToken.refreshOn,0))throw null===(i=this.serverTelemetryManager)||void 0===i||i.setCacheOutcome(G.REFRESH_CACHED_ACCESS_TOKEN),te.createRefreshRequiredError();if(!re.isEmptyObj(t.claims))throw te.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(u,t)];case 1:return[2,d.sent()]}}))}))},r.prototype.generateResultFromCacheRecord=function(e,t){return l(this,void 0,void 0,(function(){var r;return h(this,(function(n){switch(n.label){case 0:return e.idToken&&(r=new pe(e.idToken.secret,this.config.cryptoInterface)),[4,je.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)];case 1:return[2,n.sent()]}}))}))},r}(_e);
|
|
51
|
-
/*! @azure/msal-common v5.
|
|
52
|
-
/*! @azure/msal-common v5.
|
|
53
|
-
function
|
|
54
|
-
/*! @azure/msal-common v5.
|
|
55
|
-
/*! @azure/msal-common v5.
|
|
56
|
-
var Qe=function(){function e(){this.expiresAt=ke.nowSeconds()+
|
|
57
|
-
/*! @azure/msal-common v5.
|
|
58
|
-
/*! @azure/msal-common v5.
|
|
59
|
-
var Je,Xe,Ze,$e,et,tt,rt,nt=function(){function e(e){this.networkInterface=e}return e.prototype.detectRegion=function(e,t){return l(this,void 0,void 0,(function(){var r,n,o,i;return h(this,(function(a){switch(a.label){case 0:if(r=e)return[3,8];a.label=1;case 1:return a.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(v.IMDS_VERSION)];case 2:return(n=a.sent()).status===K.httpSuccess&&(r=n.body,t.region_source=x.IMDS),n.status!==K.httpBadRequest?[3,5]:[4,this.getCurrentVersion()];case 3:return(o=a.sent())?[4,this.getRegionFromIMDS(o)]:(t.region_source=x.FAILED_AUTO_DETECTION,[2,null]);case 4:(i=a.sent()).status===K.httpSuccess&&(r=i.body,t.region_source=x.IMDS),a.label=5;case 5:return[3,7];case 6:return a.sent(),t.region_source=x.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:t.region_source=x.ENVIRONMENT_VARIABLE,a.label=9;case 9:return r||(t.region_source=x.FAILED_AUTO_DETECTION),[2,r||null]}}))}))},e.prototype.getRegionFromIMDS=function(t){return l(this,void 0,void 0,(function(){return h(this,(function(r){return[2,this.networkInterface.sendGetRequestAsync(v.IMDS_ENDPOINT+"?api-version="+t+"&format=text",e.IMDS_OPTIONS,v.IMDS_TIMEOUT)]}))}))},e.prototype.getCurrentVersion=function(){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(v.IMDS_ENDPOINT+"?format=json",e.IMDS_OPTIONS)];case 1:return(t=r.sent()).status===K.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?[2,t.body["newest-versions"][0]]:[2,null];case 2:return r.sent(),[2,null];case 3:return[2]}}))}))},e.IMDS_OPTIONS={headers:{Metadata:"true"}},e}(),ot=function(){function t(e,t,r,n){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscovery=new nt(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0}}return Object.defineProperty(t.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;return e.length&&e[0].toLowerCase()===v.ADFS?ne.Adfs:ne.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Fe(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),t.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},t.prototype.replacePath=function(e){var t=e,r=new Fe(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((function(e,n){var o=r[n];e!==o&&(t=t.replace("/"+o+"/","/"+e+"/"))})),t},Object.defineProperty(t.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===ne.Adfs||this.protocolMode===e.ProtocolMode.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),t.prototype.discoveryComplete=function(){return!!this.metadata},t.prototype.resolveEndpointsAsync=function(){return l(this,void 0,void 0,(function(){var e,t,r,n;return h(this,(function(o){switch(o.label){case 0:return(e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(e=new Qe).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return t=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return r=o.sent(),t!==P.CACHE&&r!==P.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e,[2]}}))}))},t.prototype.updateEndpointMetadata=function(e){var r;return l(this,void 0,void 0,(function(){var n,o,i;return h(this,(function(a){switch(a.label){case 0:return(n=this.getEndpointMetadataFromConfig())?(e.updateEndpointMetadata(n,!1),[2,P.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,P.CACHE]:[4,this.getEndpointMetadataFromNetwork()];case 1:return(n=a.sent())?(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.azureRegion)?[4,this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion,this.regionDiscoveryMetadata)]:[3,3]:[3,4];case 2:o=a.sent(),i=this.authorityOptions.azureRegionConfiguration.azureRegion===v.AZURE_REGION_AUTO_DISCOVER_FLAG?o:this.authorityOptions.azureRegionConfiguration.azureRegion,this.authorityOptions.azureRegionConfiguration.azureRegion===v.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=o?B.AUTO_DETECTION_REQUESTED_SUCCESSFUL:B.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=o?this.authorityOptions.azureRegionConfiguration.azureRegion===o?B.CONFIGURED_MATCHES_DETECTED:B.CONFIGURED_NOT_DETECTED:B.CONFIGURED_NO_AUTO_DETECTION,i&&(this.regionDiscoveryMetadata.region_used=i,n=t.replaceWithRegionalInformation(n,i)),a.label=3;case 3:return e.updateEndpointMetadata(n,!0),[2,P.NETWORK];case 4:throw te.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}}))}))},t.prototype.isAuthoritySameType=function(e){return new Fe(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},t.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw ce.createInvalidAuthorityMetadataError()}return null},t.prototype.getEndpointMetadataFromNetwork=function(){return l(this,void 0,void 0,(function(){var e;return h(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint)];case 1:return[2,Ve((e=t.sent()).body)?e.body:null];case 2:return t.sent(),[2,null];case 3:return[2]}}))}))},t.prototype.updateCloudDiscoveryMetadata=function(e){return l(this,void 0,void 0,(function(){var t;return h(this,(function(r){switch(r.label){case 0:return(t=this.getCloudDiscoveryMetadataFromConfig())?(e.updateCloudDiscoveryMetadata(t,!1),[2,P.CONFIG]):this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!e.isExpired()?[2,P.CACHE]:[4,this.getCloudDiscoveryMetadataFromNetwork()];case 1:if(t=r.sent())return e.updateCloudDiscoveryMetadata(t,!0),[2,P.NETWORK];throw ce.createUntrustedAuthorityError()}}))}))},t.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata)try{var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=t.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(r)return r}catch(e){throw ce.createInvalidCloudDiscoveryMetadataError()}return this.isInKnownAuthorities()?t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort):null},t.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return l(this,void 0,void 0,(function(){var e,r,n,o;return h(this,(function(i){switch(i.label){case 0:e=""+v.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(e)];case 2:return n=i.sent(),0===(o=function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(n.body)?n.body.metadata:[]).length?[2,null]:(r=t.getCloudDiscoveryMetadataFromNetworkResponse(o,this.hostnameAndPort),[3,4]);case 3:return i.sent(),[2,null];case 4:return r||(r=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,r]}}))}))},t.prototype.isInKnownAuthorities=function(){var e=this;return this.authorityOptions.knownAuthorities.filter((function(t){return Fe.getDomainFromUrl(t).toLowerCase()===e.hostnameAndPort})).length>0},t.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},t.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.aliases.indexOf(t)>-1)return n}return null},t.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},t.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},t.isPublicCloudAuthority=function(e){return v.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},t.buildRegionalAuthorityString=function(e,t,r){var n=new Fe(e);n.validateAsUri();var o=n.getUrlComponents(),i=t+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=t+"."+v.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=Fe.constructAuthorityUriFromObject(d(d({},n.getUrlComponents()),{HostNameAndPort:i})).urlString;return r?a+"?"+r:a},t.replaceWithRegionalInformation=function(e,r){return e.authorization_endpoint=t.buildRegionalAuthorityString(e.authorization_endpoint,r),e.token_endpoint=t.buildRegionalAuthorityString(e.token_endpoint,r,"allowestsrnonmsi=true"),e.end_session_endpoint=t.buildRegionalAuthorityString(e.end_session_endpoint,r),e},t}(),it=function(){function e(){}return e.createDiscoveredInstance=function(t,r,n,o){return l(this,void 0,void 0,(function(){var i,a;return h(this,(function(s){switch(s.label){case 0:i=e.createInstance(t,r,n,o),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.resolveEndpointsAsync()];case 2:return s.sent(),[2,i];case 3:throw a=s.sent(),te.createEndpointDiscoveryIncompleteError(a);case 4:return[2]}}))}))},e.createInstance=function(e,t,r,n){if(re.isEmpty(e))throw ce.createUrlEmptyError();return new ot(e,t,r,n)},e}(),at=function(){function e(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return e.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(H.CACHE_KEY),n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n},e}(),st=function(){function e(){}return e.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(W));var n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n},e}(),ct={sendGetRequestAsync:function(){return Promise.reject(Z.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(Z.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},ut=function(){function e(e,t){this.cacheOutcome=G.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||v.EMPTY_STRING,this.wrapperVer=e.wrapperVer||v.EMPTY_STRING,this.telemetryCacheKey=H.CACHE_KEY+R.CACHE_KEY_SEPARATOR+e.clientId}return e.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+H.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(H.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(H.VALUE_SEPARATOR);return[H.SCHEMA_VERSION,r,t].join(H.CATEGORY_SEPARATOR)},e.prototype.generateLastRequestHeaderValue=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t),n=t.failedRequests.slice(0,2*r).join(H.VALUE_SEPARATOR),o=t.errors.slice(0,r).join(H.VALUE_SEPARATOR),i=t.errors.length,a=[i,r<i?H.OVERFLOW_TRUE:H.OVERFLOW_FALSE].join(H.VALUE_SEPARATOR);return[H.SCHEMA_VERSION,t.cacheHits,n,o,a].join(H.CATEGORY_SEPARATOR)},e.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=H.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),re.isEmpty(e.subError)?re.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(H.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new at;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t);if(r===t.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{var n=new at;n.failedRequests=t.failedRequests.slice(2*r),n.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}},e.maxErrorsToSend=function(e){var t,r=0,n=0,o=e.errors.length;for(t=0;t<o;t++){var i=e.failedRequests[2*t]||v.EMPTY_STRING,a=e.failedRequests[2*t+1]||v.EMPTY_STRING,s=e.errors[t]||v.EMPTY_STRING;if(!((n+=i.toString().length+a.toString().length+s.length+3)<H.MAX_LAST_HEADER_BYTES))break;r+=1}return r},e.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),e.join(",")},e.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},e.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},e}(),dt="invalid_grant",lt=483,ht=600,pt="msal",gt=50,ft="msal.js.browser";
|
|
60
|
-
/*! @azure/msal-common v5.0.1 2021-10-05 */e.BrowserCacheLocation=void 0,(Je=e.BrowserCacheLocation||(e.BrowserCacheLocation={})).LocalStorage="localStorage",Je.SessionStorage="sessionStorage",Je.MemoryStorage="memoryStorage",function(e){e.GET="GET",e.POST="POST"}(Xe||(Xe={})),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",e.SESSION_STATE="session.state",e.REQUEST_STATE="request.state",e.NONCE_IDTOKEN="nonce.id_token",e.ORIGIN_URI="request.origin",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.REQUEST_PARAMS="request.params",e.SCOPES="scopes",e.INTERACTION_STATUS_KEY="interaction.status",e.CCS_CREDENTIAL="ccs.credential",e.CORRELATION_ID="request.correlationId"}(Ze||(Ze={})),function(e){e.WRAPPER_SKU="wrapper.sku",e.WRAPPER_VER="wrapper.version"}($e||($e={})),e.ApiId=void 0,(et=e.ApiId||(e.ApiId={}))[et.acquireTokenRedirect=861]="acquireTokenRedirect",et[et.acquireTokenPopup=862]="acquireTokenPopup",et[et.ssoSilent=863]="ssoSilent",et[et.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",et[et.handleRedirectPromise=865]="handleRedirectPromise",et[et.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",et[et.logout=961]="logout",et[et.logoutPopup=962]="logoutPopup",e.InteractionType=void 0,(tt=e.InteractionType||(e.InteractionType={})).Redirect="redirect",tt.Popup="popup",tt.Silent="silent",e.InteractionStatus=void 0,(rt=e.InteractionStatus||(e.InteractionStatus={})).Startup="startup",rt.Login="login",rt.Logout="logout",rt.AcquireToken="acquireToken",rt.SsoSilent="ssoSilent",rt.HandleRedirect="handleRedirect",rt.None="none";var yt,mt={scopes:C},Et="jwk";e.WrapperSKU=void 0,(yt=e.WrapperSKU||(e.WrapperSKU={})).React="@azure/msal-react",yt.Angular="@azure/msal-angular";var vt=function(){function e(){}return e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e}(),Ct=function(){function e(e){this.cryptoObj=e}return e.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,vt.decimalToHex(e[0])+vt.decimalToHex(e[1])+vt.decimalToHex(e[2])+vt.decimalToHex(e[3])+"-"+vt.decimalToHex(e[4])+vt.decimalToHex(e[5])+"-"+vt.decimalToHex(e[6])+vt.decimalToHex(e[7])+"-"+vt.decimalToHex(e[8])+vt.decimalToHex(e[9])+"-"+vt.decimalToHex(e[10])+vt.decimalToHex(e[11])+vt.decimalToHex(e[12])+vt.decimalToHex(e[13])+vt.decimalToHex(e[14])+vt.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",n=0,o="",i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(n=16*Math.random()|0),"x"===t[i]?o+=r[n]:"y"===t[i]?(n&=3,o+=r[n|=8]):o+=t[i];return o}},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),Tt=function(){function e(){}return e.stringToUtf8Arr=function(e){for(var t,r=0,n=e.length,o=0;o<n;o++)r+=(t=e.charCodeAt(o))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(r),a=0,s=0;a<r;s++)(t=e.charCodeAt(s))<128?i[a++]=t:t<2048?(i[a++]=192+(t>>>6),i[a++]=128+(63&t)):t<65536?(i[a++]=224+(t>>>12),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<2097152?(i[a++]=240+(t>>>18),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<67108864?(i[a++]=248+(t>>>24),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t));return i},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return t},e.utf8ArrToString=function(e){for(var t="",r=void 0,n=e.length,o=0;o<n;o++)r=e[o],t+=String.fromCharCode(r>251&&r<254&&o+5<n?1073741824*(r-252)+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>247&&r<252&&o+4<n?(r-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>239&&r<248&&o+3<n?(r-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>223&&r<240&&o+2<n?(r-224<<12)+(e[++o]-128<<6)+e[++o]-128:r>191&&r<224&&o+1<n?(r-192<<6)+e[++o]-128:r);return t},e}(),St=function(){function e(){}return e.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))},e.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype.encode=function(e){var t=Tt.stringToUtf8Arr(e);return this.base64EncArr(t)},e.prototype.base64EncArr=function(e){for(var t=(3-e.length%3)%3,r="",n=void 0,o=e.length,i=0,a=0;a<o;a++)n=a%3,i|=e[a]<<(16>>>n&24),2!==n&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0===t?r:r.substring(0,r.length-t)+(1===t?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),wt=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var r=this.base64DecToArr(t);return Tt.utf8ArrToString(r)},e.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,""),n=r.length,o=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,i=new Uint8Array(o),a=void 0,s=void 0,c=0,u=0,d=0;d<n;d++)if(s=3&d,c|=this.b64ToUint6(r.charCodeAt(d))<<18-6*s,3===s||n-d==1){for(a=0;a<3&&u<o;a++,u++)i[u]=c>>>(16>>>a&24)&255;c=0}return i},e.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e}(),It={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Code flow is not supported inside an iframe. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request in found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."}},At=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name="BrowserAuthError",o}return r(t,e),t.createPkceNotGeneratedError=function(e){return new t(It.pkceNotGenerated.code,It.pkceNotGenerated.desc+" Detail:"+e)},t.createCryptoNotAvailableError=function(e){return new t(It.cryptoDoesNotExist.code,It.cryptoDoesNotExist.desc+" Detail:"+e)},t.createHttpMethodNotImplementedError=function(e){return new t(It.httpMethodNotImplementedError.code,It.httpMethodNotImplementedError.desc+" Given Method: "+e)},t.createEmptyNavigationUriError=function(){return new t(It.emptyNavigateUriError.code,It.emptyNavigateUriError.desc)},t.createEmptyHashError=function(e){return new t(It.hashEmptyError.code,It.hashEmptyError.desc+" Given Url: "+e)},t.createHashDoesNotContainStateError=function(){return new t(It.hashDoesNotContainStateError.code,It.hashDoesNotContainStateError.desc)},t.createHashDoesNotContainKnownPropertiesError=function(){return new t(It.hashDoesNotContainKnownPropertiesError.code,It.hashDoesNotContainKnownPropertiesError.desc)},t.createUnableToParseStateError=function(){return new t(It.unableToParseStateError.code,It.unableToParseStateError.desc)},t.createStateInteractionTypeMismatchError=function(){return new t(It.stateInteractionTypeMismatchError.code,It.stateInteractionTypeMismatchError.desc)},t.createInteractionInProgressError=function(){return new t(It.interactionInProgress.code,It.interactionInProgress.desc)},t.createPopupWindowError=function(e){var r=It.popupWindowError.desc;return r=re.isEmpty(e)?r:r+" Details: "+e,new t(It.popupWindowError.code,r)},t.createEmptyWindowCreatedError=function(){return new t(It.emptyWindowError.code,It.emptyWindowError.desc)},t.createUserCancelledError=function(){return new t(It.userCancelledError.code,It.userCancelledError.desc)},t.createMonitorPopupTimeoutError=function(){return new t(It.monitorPopupTimeoutError.code,It.monitorPopupTimeoutError.desc)},t.createMonitorIframeTimeoutError=function(){return new t(It.monitorIframeTimeoutError.code,It.monitorIframeTimeoutError.desc)},t.createRedirectInIframeError=function(e){return new t(It.redirectInIframeError.code,It.redirectInIframeError.desc+" (window.parent !== window) => "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(It.blockTokenRequestsInHiddenIframeError.code,It.blockTokenRequestsInHiddenIframeError.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(It.blockAcquireTokenInPopupsError.code,It.blockAcquireTokenInPopupsError.desc)},t.createIframeClosedPrematurelyError=function(){return new t(It.iframeClosedPrematurelyError.code,It.iframeClosedPrematurelyError.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(It.silentLogoutUnsupportedError.code,It.silentLogoutUnsupportedError.desc)},t.createNoAccountError=function(){return new t(It.noAccountError.code,It.noAccountError.desc)},t.createSilentPromptValueError=function(e){return new t(It.silentPromptValueError.code,It.silentPromptValueError.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(It.unableToParseTokenRequestCacheError.code,It.unableToParseTokenRequestCacheError.desc)},t.createNoTokenRequestCacheError=function(){return new t(It.noTokenRequestCacheError.code,It.noTokenRequestCacheError.desc)},t.createAuthRequestNotSetError=function(){return new t(It.authRequestNotSet.code,It.authRequestNotSet.desc)},t.createNoCachedAuthorityError=function(){return new t(It.noCachedAuthorityError.code,It.noCachedAuthorityError.desc)},t.createInvalidCacheTypeError=function(){return new t(It.invalidCacheType.code,""+It.invalidCacheType.desc)},t.createNonBrowserEnvironmentError=function(){return new t(It.notInBrowserEnvironment.code,It.notInBrowserEnvironment.desc)},t.createDatabaseNotOpenError=function(){return new t(It.databaseNotOpen.code,It.databaseNotOpen.desc)},t.createNoNetworkConnectivityError=function(){return new t(It.noNetworkConnectivity.code,It.noNetworkConnectivity.desc)},t.createPostRequestFailedError=function(e,r){return new t(It.postRequestFailed.code,It.postRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createGetRequestFailedError=function(e,r){return new t(It.getRequestFailed.code,It.getRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(It.failedToParseNetworkResponse.code,It.failedToParseNetworkResponse.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(It.unableToLoadTokenError.code,It.unableToLoadTokenError.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(It.signingKeyNotFoundInStorage.code,It.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+e)},t}(Z),_t=function(){function e(e){this.base64Encode=new St,this.cryptoObj=e}return e.prototype.generateCodes=function(){return o(this,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}}))}))},e.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw At.createPkceNotGeneratedError(e)}},e.prototype.generateCodeChallengeFromVerifier=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=n.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=n.sent(),At.createPkceNotGeneratedError(r);case 3:return[2]}}))}))},e}(),Rt="SHA-256",bt=new Uint8Array([1,0,1]),Ot=function(){function e(){if(!this.hasCryptoAPI())throw At.createCryptoNotAvailableError("Browser crypto or msCrypto object not available.");this._keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:Rt,modulusLength:2048,publicExponent:bt}}return e.prototype.sha256Digest=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=Tt.stringToUtf8Arr(e),[2,this.hasIECrypto()?this.getMSCryptoDigest(Rt,t):this.getSubtleCryptoDigest(Rt,t)]}))}))},e.prototype.getRandomValues=function(e){var t=window.msCrypto||window.crypto;if(!t.getRandomValues)throw At.createCryptoNotAvailableError("getRandomValues does not exist.");t.getRandomValues(e)},e.prototype.generateKeyPair=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoGenerateKey(e,t):window.crypto.subtle.generateKey(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.exportJwk=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.hasIECrypto()?this.msCryptoExportJwk(e):window.crypto.subtle.exportKey(Et,e)]}))}))},e.prototype.importJwk=function(t,r,n){return o(this,void 0,void 0,(function(){var o,a;return i(this,(function(i){return o=e.getJwkString(t),a=Tt.stringToArrayBuffer(o),[2,this.hasIECrypto()?this.msCryptoImportKey(a,r,n):window.crypto.subtle.importKey(Et,t,this._keygenAlgorithmOptions,r,n)]}))}))},e.prototype.sign=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoSign(e,t):window.crypto.subtle.sign(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.hasCryptoAPI=function(){return this.hasIECrypto()||this.hasBrowserCrypto()},e.prototype.hasIECrypto=function(){return"msCrypto"in window},e.prototype.hasBrowserCrypto=function(){return"crypto"in window},e.prototype.getSubtleCryptoDigest=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,window.crypto.subtle.digest(e,t)]}))}))},e.prototype.getMSCryptoDigest=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new Promise((function(r,n){var o=window.msCrypto.subtle.digest(e,t.buffer);o.addEventListener("complete",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){n(e)}))}))]}))}))},e.prototype.msCryptoGenerateKey=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.generateKey(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.msCryptoExportJwk=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t,r){var n=window.msCrypto.subtle.exportKey(Et,e);n.addEventListener("complete",(function(e){var n=e.target.result,o=Tt.utf8ArrToString(new Uint8Array(n)).replace(/\r/g,"").replace(/\n/g,"").replace(/\t/g,"").split(" ").join("").replace("\0","");try{t(JSON.parse(o))}catch(e){r(e)}})),n.addEventListener("error",(function(e){r(e)}))}))]}))}))},e.prototype.msCryptoImportKey=function(e,t,r){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(o){return[2,new Promise((function(o,i){var a=window.msCrypto.subtle.importKey(Et,e,n._keygenAlgorithmOptions,t,r);a.addEventListener("complete",(function(e){o(e.target.result)})),a.addEventListener("error",(function(e){i(e)}))}))]}))}))},e.prototype.msCryptoSign=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.sign(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.getJwkString=function(e){return JSON.stringify(e,Object.keys(e).sort())},e}(),kt=function(){function e(e,t,r){this.dbName=e,this.tableName=t,this.version=r,this.dbOpen=!1}return e.prototype.open=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){return[2,new Promise((function(t,r){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",(function(t){t.target.result.createObjectStore(e.tableName)})),n.addEventListener("success",(function(r){var n=r;e.db=n.target.result,e.dbOpen=!0,t()})),n.addEventListener("error",(function(e){return r(e)}))}))]}))}))},e.prototype.get=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){if(!t.db)return n(At.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);o.addEventListener("success",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){return n(e)}))}))]}}))}))},e.prototype.put=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){switch(n.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:n.sent(),n.label=2;case 2:return[2,new Promise((function(n,o){if(!r.db)return o(At.createDatabaseNotOpenError());var i=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(t,e);i.addEventListener("success",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){return o(e)}))}))]}}))}))},e.prototype.delete=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:r.sent(),r.label=2;case 2:return[2,new Promise((function(r,n){if(!t.db)return n(At.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);o.addEventListener("success",(function(e){r(void 0===e.target.result)})),o.addEventListener("error",(function(e){return n(e)}))}))]}}))}))},e.prototype.clear=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:t.sent(),t.label=2;case 2:return[2,new Promise((function(t,r){if(!e.db)return r(At.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readwrite").objectStore(e.tableName).clear();n.addEventListener("success",(function(e){t(void 0===e.target.result)})),n.addEventListener("error",(function(e){return r(e)}))}))]}}))}))},e}(),Nt=function(){function e(){this.browserCrypto=new Ot,this.b64Encode=new St,this.b64Decode=new wt,this.guidGenerator=new Ct(this.browserCrypto),this.pkceGenerator=new _t(this.browserCrypto),this.cache=new kt(e.DB_NAME,e.TABLE_NAME,e.DB_VERSION)}return e.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},e.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},e.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},e.prototype.generatePkceCodes=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.pkceGenerator.generateCodes()]}))}))},e.prototype.getPublicKeyThumbprint=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d;return i(this,(function(i){switch(i.label){case 0:return[4,this.browserCrypto.generateKeyPair(e.EXTRACTABLE,e.POP_KEY_USAGES)];case 1:return r=i.sent(),[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=i.sent(),o={e:n.e,kty:n.kty,n:n.n},a=Ot.getJwkString(o),[4,this.browserCrypto.sha256Digest(a)];case 3:return s=i.sent(),c=this.b64Encode.urlEncodeArr(new Uint8Array(s)),[4,this.browserCrypto.exportJwk(r.privateKey)];case 4:return u=i.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return d=i.sent(),[4,this.cache.put(c,{privateKey:d,publicKey:r.publicKey,requestMethod:t.resourceRequestMethod,requestUri:t.resourceRequestUri})];case 6:return i.sent(),[2,c]}}))}))},e.prototype.removeTokenBindingKey=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.cache.delete(e)]}))}))},e.prototype.clearKeystore=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.cache.clear()]}))}))},e.prototype.signJwt=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:return[4,this.cache.get(t)];case 1:if(!(r=i.sent()))throw At.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=i.sent(),o=Ot.getJwkString(n),a={alg:n.alg,type:Et},s=this.b64Encode.urlEncode(JSON.stringify(a)),e.cnf={jwk:JSON.parse(o)},c=this.b64Encode.urlEncode(JSON.stringify(e)),u=s+"."+c,d=Tt.stringToArrayBuffer(u),[4,this.browserCrypto.sign(r.privateKey,d)];case 3:return l=i.sent(),h=this.b64Encode.urlEncodeArr(new Uint8Array(l)),[2,u+"."+h]}}))}))},e.POP_KEY_USAGES=["sign","verify"],e.EXTRACTABLE=!0,e.DB_VERSION=1,e.DB_NAME="msal.db",e.TABLE_NAME=e.DB_NAME+".keys",e}(),Pt={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."}},Ut=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="BrowserConfigurationAuthError",Object.setPrototypeOf(o,t.prototype),o}return r(t,e),t.createRedirectUriEmptyError=function(){return new t(Pt.redirectUriNotSet.code,Pt.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(Pt.postLogoutUriNotSet.code,Pt.postLogoutUriNotSet.desc)},t.createStorageNotSupportedError=function(e){return new t(Pt.storageNotSupportedError.code,Pt.storageNotSupportedError.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(Pt.noRedirectCallbacksSet.code,Pt.noRedirectCallbacksSet.desc)},t.createStubPcaInstanceCalledError=function(){return new t(Pt.stubPcaInstanceCalled.code,Pt.stubPcaInstanceCalled.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(Pt.inMemRedirectUnavailable.code,Pt.inMemRedirectUnavailable.desc)},t}(Z),Mt=function(){function t(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return t.prototype.validateWindowStorage=function(t){if(t!==e.BrowserCacheLocation.LocalStorage&&t!==e.BrowserCacheLocation.SessionStorage)throw Ut.createStorageNotSupportedError(t);if(!!!window[t])throw Ut.createStorageNotSupportedError(t)},t.prototype.getItem=function(e){return this.windowStorage.getItem(e)},t.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},t.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},t.prototype.getKeys=function(){return Object.keys(this.windowStorage)},t.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},t}(),Lt=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach((function(t,r){e.push(r)})),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),qt=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(re.isEmpty(t))return null;try{return He.parseRequestState(e,t).libraryState.meta}catch(e){throw te.createInvalidStateError(t,e)}},e.parseServerResponseFromHash=function(e){if(!e)return{};var t=new Fe(e);return Fe.getDeserializedHash(t.getHash())},e}(),Dt=function(t){function n(e,r,n,o){var i=t.call(this,e,n)||this;return i.COOKIE_LIFE_MULTIPLIER=864e5,i.cacheConfig=r,i.logger=o,i.internalStorage=new Lt,i.browserStorage=i.setupBrowserStorage(i.cacheConfig.cacheLocation),i.temporaryCacheStorage=i.setupTemporaryCacheStorage(i.cacheConfig.cacheLocation),i.migrateCacheEntries(),i}return r(n,t),n.prototype.setupBrowserStorage=function(t){switch(t){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new Mt(t)}catch(e){this.logger.verbose(e);break}case e.BrowserCacheLocation.MemoryStorage:}return this.cacheConfig.cacheLocation=e.BrowserCacheLocation.MemoryStorage,new Lt},n.prototype.setupTemporaryCacheStorage=function(t){switch(t){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new Mt(e.BrowserCacheLocation.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case e.BrowserCacheLocation.MemoryStorage:default:return this.internalStorage}},n.prototype.migrateCacheEntries=function(){var e=this,t=v.CACHE_PREFIX+"."+f.ID_TOKEN,r=v.CACHE_PREFIX+"."+f.CLIENT_INFO,n=v.CACHE_PREFIX+"."+f.ERROR,o=v.CACHE_PREFIX+"."+f.ERROR_DESC,i=[this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];[f.ID_TOKEN,f.CLIENT_INFO,f.ERROR,f.ERROR_DESC].forEach((function(t,r){return e.migrateCacheEntry(t,i[r])}))},n.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},n.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},n.prototype.getItem=function(e){return this.browserStorage.getItem(e)},n.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},n.prototype.getAccount=function(e){var t=this.getItem(e);if(!t)return null;var r=this.validateAndParseJson(t);return r&&he.isAccountEntity(r)?ge.toObject(new he,r):null},n.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},n.prototype.getIdTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Oe.isIdTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),ge.toObject(new Oe,r)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},n.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getAccessTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Ne.isAccessTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),ge.toObject(new Ne,r)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},n.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getRefreshTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Pe.isRefreshTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),ge.toObject(new Pe,r)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},n.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Be.isAppMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),ge.toObject(new Be,r)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},n.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},n.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&at.isServerTelemetryEntity(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),ge.toObject(new at,r)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},n.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},n.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Qe.isAuthorityMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),ge.toObject(new Qe,r)):null},n.prototype.getAuthorityMetadataKeys=function(){var e=this;return this.internalStorage.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},n.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem($e.WRAPPER_SKU,e),this.internalStorage.setItem($e.WRAPPER_VER,t)},n.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem($e.WRAPPER_SKU)||"",this.internalStorage.getItem($e.WRAPPER_VER)||""]},n.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},n.prototype.getActiveAccount=function(){var e=this.generateCacheKey(f.ACTIVE_ACCOUNT),t=this.browserStorage.getItem(e);return t&&this.getAccountInfoByFilter({localAccountId:t})[0]||null},n.prototype.setActiveAccount=function(e){var t=this.generateCacheKey(f.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),this.browserStorage.setItem(t,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t))},n.prototype.getAccountInfoByFilter=function(e){return this.getAllAccounts().filter((function(t){return(!e.username||e.username.toLowerCase()===t.username.toLowerCase())&&((!e.homeAccountId||e.homeAccountId===t.homeAccountId)&&((!e.localAccountId||e.localAccountId===t.localAccountId)&&((!e.tenantId||e.tenantId===t.tenantId)&&(!e.environment||e.environment===t.environment))))}))},n.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&st.isThrottlingEntity(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),ge.toObject(new st,r)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},n.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},n.prototype.getTemporaryCache=function(t,r){var n=r?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(n);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}var i=this.temporaryCacheStorage.getItem(n);if(!i){if(this.cacheConfig.cacheLocation===e.BrowserCacheLocation.LocalStorage){var a=this.browserStorage.getItem(n);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),i},n.prototype.setTemporaryCache=function(e,t,r){var n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))},n.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},n.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},n.prototype.getKeys=function(){return s(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},n.prototype.clear=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.removeAllAccounts()];case 1:return t.sent(),this.removeAppMetadata(),this.getKeys().forEach((function(t){!e.browserStorage.containsKey(t)&&!e.temporaryCacheStorage.containsKey(t)||-1===t.indexOf(v.CACHE_PREFIX)&&-1===t.indexOf(e.clientId)||e.removeItem(t)})),this.internalStorage.clear(),[2]}}))}))},n.prototype.setItemCookie=function(e,t,r){var n=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;";r&&(n+="expires="+this.getCookieExpirationTime(r)+";");this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},n.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return""},n.prototype.clearMsalCookies=function(){var e=this,t=v.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach((function(r){for(;" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t)){var n=r.split("=")[0];e.clearItemCookie(n)}}))},n.prototype.clearItemCookie=function(e){this.setItemCookie(e,"",-1)},n.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},n.prototype.getCache=function(){return this.browserStorage},n.prototype.setCache=function(){},n.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):re.startsWith(e,v.CACHE_PREFIX)||re.startsWith(e,f.ADAL_ID_TOKEN)?e:v.CACHE_PREFIX+"."+this.clientId+"."+e},n.prototype.generateAuthorityKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.AUTHORITY+"."+t)},n.prototype.generateNonceKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.NONCE_IDTOKEN+"."+t)},n.prototype.generateStateKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.REQUEST_STATE+"."+t)},n.prototype.getCachedAuthority=function(e){var t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;var n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)},n.prototype.updateCacheEntries=function(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);var a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);var s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){var c={credential:o.homeAccountId,type:Te.HOME_ACCOUNT_ID};this.setTemporaryCache(Ze.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(!re.isEmpty(n)){c={credential:n,type:Te.UPN};this.setTemporaryCache(Ze.CCS_CREDENTIAL,JSON.stringify(c),!0)}},n.prototype.resetRequestCache=function(e){var t=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),re.isEmpty(e)||this.getKeys().forEach((function(r){-1!==r.indexOf(e)&&t.removeItem(r)})),e&&(this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(Ze.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(Ze.ORIGIN_URI)),this.removeItem(this.generateCacheKey(Ze.URL_HASH)),this.removeItem(this.generateCacheKey(Ze.CORRELATION_ID)),this.removeItem(this.generateCacheKey(Ze.CCS_CREDENTIAL)),this.setInteractionInProgress(!1)},n.prototype.cleanRequestByState=function(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){var t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+r),this.resetRequestCache(r||"")}this.clearMsalCookies()},n.prototype.cleanRequestByInteractionType=function(e){var t=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach((function(r){if(-1!==r.indexOf(Ze.REQUEST_STATE)){var n=t.temporaryCacheStorage.getItem(r);if(n){var o=qt.extractBrowserRequestState(t.cryptoImpl,n);o&&o.interactionType===e&&(t.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+n),t.resetRequestCache(n))}}})),this.clearMsalCookies()},n.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var r=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(Ze.REQUEST_PARAMS,r,!0)},n.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(Ze.REQUEST_PARAMS,!0);if(!r)throw At.createNoTokenRequestCacheError();var n=this.validateAndParseJson(t.base64Decode(r));if(!n)throw At.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(Ze.REQUEST_PARAMS)),re.isEmpty(n.authority)){var o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw At.createNoCachedAuthorityError();n.authority=i}return n},n.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},n.prototype.getInteractionInProgress=function(){var e=v.CACHE_PREFIX+"."+Ze.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},n.prototype.setInteractionInProgress=function(e){var t=this.getInteractionInProgress(),r=v.CACHE_PREFIX+"."+Ze.INTERACTION_STATUS_KEY;e&&!t?this.setTemporaryCache(r,this.clientId,!1):e||t!==this.clientId||this.removeItem(r)},n.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(f.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(f.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(f.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(f.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var r=t||e;if(r){var n=new pe(r,this.cryptoImpl);if(n.claims&&n.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),n.claims.preferred_username;if(n.claims&&n.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),n.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},n}(ge),Ht=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(e,{method:Xe.GET,headers:this.getFetchHeaders(t)})];case 1:return r=i.sent(),[3,3];case 2:throw n=i.sent(),window.navigator.onLine?At.createGetRequestFailedError(n,e):At.createNoNetworkConnectivityError();case 3:return i.trys.push([3,5,,6]),o={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 4:return[2,(o.body=i.sent(),o.status=r.status,o)];case 5:throw i.sent(),At.createFailedToParseNetworkResponseError(e);case 6:return[2]}}))}))},e.prototype.sendPostRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:r=t&&t.body||"",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,fetch(e,{method:Xe.POST,headers:this.getFetchHeaders(t),body:r})];case 2:return n=i.sent(),[3,4];case 3:throw o=i.sent(),window.navigator.onLine?At.createPostRequestFailedError(o,e):At.createNoNetworkConnectivityError();case 4:return i.trys.push([4,6,,7]),a={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 5:return[2,(a.body=i.sent(),a.status=n.status,a)];case 6:throw i.sent(),At.createFailedToParseNetworkResponseError(e);case 7:return[2]}}))}))},e.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var r=e.headers;return Object.keys(r).forEach((function(e){t.append(e,r[e])})),t},e.prototype.getHeaderDict=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t},e}(),Ft=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.sendRequestAsync(e,Xe.GET,t)]}))}))},e.prototype.sendPostRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.sendRequestAsync(e,Xe.POST,t)]}))}))},e.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise((function(o,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),n.setXhrHeaders(a,r),a.onload=function(){(a.status<200||a.status>=300)&&(t===Xe.POST?i(At.createPostRequestFailedError("Failed with status "+a.status,e)):i(At.createGetRequestFailedError("Failed with status "+a.status,e)));try{var r=JSON.parse(a.responseText),s={headers:n.getHeaderDict(a),body:r,status:a.status};o(s)}catch(t){i(At.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===Xe.POST?i(At.createPostRequestFailedError("Failed with status "+a.status,e)):i(At.createGetRequestFailedError("Failed with status "+a.status,e)):i(At.createNoNetworkConnectivityError())},t===Xe.POST&&r&&r.body)a.send(r.body);else{if(t!==Xe.GET)throw At.createHttpMethodNotImplementedError(t);a.send()}}))},e.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach((function(t){e.setRequestHeader(t,r[t])}))}},e.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return t.forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&o&&(r[n]=o)})),r},e}(),Kt=function(){function t(){}return t.clearHash=function(e){e.location.hash=v.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,v.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},t.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""},t.isInIframe=function(){return window.parent!==window},t.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(pt+".")},t.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},t.getHomepage=function(){var e=new Fe(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},t.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new Ht:new Ft},t.blockReloadInHiddenIframes=function(){if(Fe.hashContainsKnownProperties(window.location.hash)&&t.isInIframe())throw At.createBlockReloadInHiddenIframeError()},t.blockRedirectInIframe=function(r,n){var o=t.isInIframe();if(r===e.InteractionType.Redirect&&o&&!n)throw At.createRedirectInIframeError(o)},t.blockAcquireTokenInPopups=function(){if(t.isInPopup())throw At.createBlockAcquireTokenInPopupsError()},t.blockNonBrowserEnvironment=function(e){if(!e)throw At.createNonBrowserEnvironmentError()},t.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),n=e.indexOf("Edge/");return t>0||r>0||n>0},t}(),xt=function(){function e(){}return e.prototype.navigateInternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.prototype.navigateExternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((function(e){setTimeout((function(){e(!0)}),t.timeout)}))},e}(),Bt=6e3;var Gt,jt="2.18.0";e.EventType=void 0,(Gt=e.EventType||(e.EventType={})).ACCOUNT_ADDED="msal:accountAdded",Gt.ACCOUNT_REMOVED="msal:accountRemoved",Gt.LOGIN_START="msal:loginStart",Gt.LOGIN_SUCCESS="msal:loginSuccess",Gt.LOGIN_FAILURE="msal:loginFailure",Gt.ACQUIRE_TOKEN_START="msal:acquireTokenStart",Gt.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",Gt.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",Gt.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",Gt.SSO_SILENT_START="msal:ssoSilentStart",Gt.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",Gt.SSO_SILENT_FAILURE="msal:ssoSilentFailure",Gt.HANDLE_REDIRECT_START="msal:handleRedirectStart",Gt.HANDLE_REDIRECT_END="msal:handleRedirectEnd",Gt.POPUP_OPENED="msal:popupOpened",Gt.LOGOUT_START="msal:logoutStart",Gt.LOGOUT_SUCCESS="msal:logoutSuccess",Gt.LOGOUT_FAILURE="msal:logoutFailure",Gt.LOGOUT_END="msal:logoutEnd";var zt=function(){function t(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return t.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},t.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},t.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},t.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},t.prototype.emitEvent=function(e,t,r,n){var o=this;if("undefined"!=typeof window){var i={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,r){o.logger.verbose("Emitting event to callback "+r+": "+e),t.apply(null,[i])}))}},t.prototype.handleAccountCacheChange=function(t){try{var r=t.newValue||t.oldValue;if(!r)return;var n=JSON.parse(r);if("object"!=typeof n||!he.isAccountEntity(n))return;var o=ge.toObject(new he,n).getAccountInfo();!t.oldValue&&t.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_ADDED,void 0,o)):!t.newValue&&t.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_REMOVED,void 0,o))}catch(t){return}},t}(),Wt=function(e){function t(t,r,n,o,i,a,s){var c=e.call(this,t,r,n,o,i,s)||this;return c.navigationClient=a,c}return r(t,e),t.prototype.initializeAuthorizationCodeRequest=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",e.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=o.sent(),r=n(n({},e),{redirectUri:e.redirectUri,code:"",codeVerifier:t.verifier}),e.codeChallenge=t.challenge,e.codeChallengeMethod=v.S256_CODE_CHALLENGE_METHOD,[2,r]}}))}))},t.prototype.initializeLogoutRequest=function(e){if(this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId),this.browserStorage.isInteractionInProgress())throw At.createInteractionInProgressError();var t=n({correlationId:this.browserCrypto.createNewGuid()},e);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=Fe.getAbsoluteUrl(e.postLogoutRedirectUri,Kt.getCurrentUri())):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=Fe.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Kt.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Fe.getAbsoluteUrl(Kt.getCurrentUri(),Kt.getCurrentUri())),t},t.prototype.createAuthCodeClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new ze(r)]}}))}))},t.prototype.getClientConfiguration=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return this.logger.verbose("getClientConfiguration called"),[4,this.getDiscoveredAuthority(t)];case 1:return r=n.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:r,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:ft,version:jt,cpu:"",os:""}}]}}))}))},t.prototype.validateAndExtractStateFromHash=function(e,t,r){this.logger.verbose("validateAndExtractStateFromHash called",r);var n=Fe.getDeserializedHash(e);if(!n.state)throw At.createHashDoesNotContainStateError();var o=qt.extractBrowserRequestState(this.browserCrypto,n.state);if(!o)throw At.createUnableToParseStateError();if(o.interactionType!==t)throw At.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),n.state},t.prototype.getDiscoveredAuthority=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e?(this.logger.verbose("Creating discovered authority with request authority"),[4,it.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t)]):[3,2];case 1:return[2,r.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,it.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t)];case 3:return[2,r.sent()]}}))}))},t.prototype.preflightInteractiveRequest=function(e,t){if(this.logger.verbose("preflightInteractiveRequest called, validating app environment",null==e?void 0:e.correlationId),Kt.blockReloadInHiddenIframes(),this.browserStorage.isInteractionInProgress(!1))throw At.createInteractionInProgressError();return this.initializeAuthorizationRequest(e,t)},t.prototype.initializeAuthorizationRequest=function(e,t){this.logger.verbose("initializeAuthorizationRequest called");var r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=He.setRequestState(this.browserCrypto,e&&e.state||"",o),a=n(n({},this.initializeBaseRequest(e)),{redirectUri:r,state:i,nonce:e.nonce||this.browserCrypto.createNewGuid(),responseMode:I.FRAGMENT}),s=e.account||this.browserStorage.getActiveAccount();if(s&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+s),a.account=s),re.isEmpty(a.loginHint)&&!s){var c=this.browserStorage.getLegacyLoginHint();c&&(a.loginHint=c)}return this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||"",a.account||null),a},t}(function(){function t(e,t,r,n,o,i){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.correlationId=i||this.browserCrypto.createNewGuid(),this.logger=n.clone(ft,jt,this.correlationId)}return t.prototype.clearCacheOnLogout=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:if(!e)return[3,5];he.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(he.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),this.logger.verbose("No account provided in logout request, clearing all cache items."),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}}))}))},t.prototype.initializeBaseRequest=function(t){this.logger.verbose("Initializing BaseAuthRequest");var r=t.authority||this.config.auth.authority,o=s(t&&t.scopes||[]);return t.authenticationScheme?this.logger.verbose('Authentication Scheme set to "'+t.authenticationScheme+'" as configured in Auth request'):(t.authenticationScheme=e.AuthenticationScheme.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request')),n(n({},t),{correlationId:this.correlationId,authority:r,scopes:o})},t.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||Kt.getCurrentUri();return Fe.getAbsoluteUrl(t,Kt.getCurrentUri())},t.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ut(r,this.browserStorage)},t}()),Yt=function(){function t(e,t){this.browserStorage=e,this.logger=t,this.unloadWindow=this.unloadWindow.bind(this)}return t.prototype.openPopup=function(e,r){try{var n=void 0;if(r.popup?(n=r.popup,this.logger.verbosePii("Navigating popup window to: "+e),n.location.assign(e)):void 0===r.popup&&(this.logger.verbosePii("Opening popup window to: "+e),n=t.openSizedPopup(e,r.popupName,r.popupWindowAttributes,this.logger)),!n)throw At.createEmptyWindowCreatedError();return n.focus&&n.focus(),this.currentWindow=n,window.addEventListener("beforeunload",this.unloadWindow),n}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),At.createPopupWindowError(e.toString())}},t.openSizedPopup=function(e,t,r,n){var o,i,a,s,c=window.screenLeft?window.screenLeft:window.screenX,u=window.screenTop?window.screenTop:window.screenY,d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,h=null===(o=r.popupSize)||void 0===o?void 0:o.width,p=null===(i=r.popupSize)||void 0===i?void 0:i.height,g=null===(a=r.popupPosition)||void 0===a?void 0:a.top,f=null===(s=r.popupPosition)||void 0===s?void 0:s.left;return(!h||h<0||h>d)&&(n.verbose("Default popup window width used. Window width not configured or invalid."),h=lt),(!p||p<0||p>l)&&(n.verbose("Default popup window height used. Window height not configured or invalid."),p=ht),(!g||g<0||g>l)&&(n.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,l/2-ht/2+u)),(!f||f<0||f>d)&&(n.verbose("Default popup window left position used. Window left not configured or invalid."),f=Math.max(0,d/2-lt/2+c)),window.open(e,t,"width="+h+", height="+p+", top="+g+", left="+f+", scrollbars=yes")},t.prototype.unloadWindow=function(t){this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()},t.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},t.prototype.monitorPopupForSameOrigin=function(e){var t=this;return new Promise((function(r,n){var o=setInterval((function(){if(e.closed)return t.cleanPopup(),clearInterval(o),void n(At.createUserCancelledError());var i=v.EMPTY_STRING;try{i=e.location.href}catch(e){}re.isEmpty(i)||"about:blank"===i||(clearInterval(o),r())}),gt)}))},t.generatePopupName=function(e,t){return pt+"."+e+"."+t.scopes.join("-")+"."+t.authority+"."+t.correlationId},t.generateLogoutPopupName=function(e,t){var r=t.account&&t.account.homeAccountId;return pt+"."+e+"."+r+"."+t.correlationId},t}(),Vt=function(){function e(e,t,r,n){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.browserRequestLogger=n}return e.prototype.handleCodeResponse=function(e,t,r,n){return o(this,void 0,void 0,(function(){var o,a,s,c,u,d,l;return i(this,(function(i){switch(i.label){case 0:if(this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called"),re.isEmpty(e))throw At.createEmptyHashError(e);if(o=this.browserStorage.generateStateKey(t),!(a=this.browserStorage.getTemporaryCache(o)))throw te.createStateNotFoundError("Cached State");return s=this.authModule.handleFragmentResponse(e,a),c=this.browserStorage.generateNonceKey(a),u=this.browserStorage.getTemporaryCache(c),this.authCodeRequest.code=s.code,s.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(s.cloud_instance_host_name,r,n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return s.nonce=u||void 0,s.state=a,s.client_info?this.authCodeRequest.clientInfo=s.client_info:(d=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=d),[4,this.authModule.acquireToken(this.authCodeRequest,s)];case 3:return l=i.sent(),this.browserStorage.cleanRequestByState(t),[2,l]}}))}))},e.prototype.updateTokenEndpointAuthority=function(e,t,r){return o(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n="https://"+e+"/"+t.tenant+"/",[4,it.createDiscoveredInstance(n,r,this.browserStorage,t.options)];case 1:return o=i.sent(),this.authModule.updateAuthority(o),[2]}}))}))},e.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(Ze.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},e}(),Qt=function(e){function t(t,r,n,o){var i=e.call(this,t,r,n,o)||this;return i.popupUtils=new Yt(r,o),i}return r(t,e),t.prototype.initiateAuthRequest=function(e,t){if(re.isEmpty(e))throw this.browserRequestLogger.error("Navigate url is empty"),At.createEmptyNavigationUriError();return this.browserStorage.setInteractionInProgress(!0),this.browserRequestLogger.infoPii("Navigate to: "+e),this.popupUtils.openPopup(e,t)},t.prototype.monitorPopupForHash=function(e){var t=this;return this.popupUtils.monitorPopupForSameOrigin(e).then((function(){var r=e.location.hash;if(Kt.clearHash(e),t.popupUtils.cleanPopup(e),!r)throw At.createEmptyHashError(e.location.href);if(Fe.hashContainsKnownProperties(r))return r;throw At.createHashDoesNotContainKnownPropertiesError()}))},t}(Vt),Jt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.acquireToken=function(t){try{var r=this.preflightInteractiveRequest(t,e.InteractionType.Popup),n=Yt.generatePopupName(this.config.auth.clientId,r),o=t.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(r,n,o);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var i=Yt.openSizedPopup("about:blank",n,o,this.logger);return this.acquireTokenPopupAsync(r,n,o,i)}catch(e){return Promise.reject(e)}},n.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=Yt.generateLogoutPopupName(this.config.auth.clientId,t),n=e&&e.authority,o=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,n,void 0,o);this.logger.verbose("asyncPopup set to false, opening popup");var a=Yt.openSizedPopup("about:blank",r,i,this.logger);return this.logoutPopupAsync(t,r,i,n,a,o)}catch(e){return Promise.reject(e)}},n.prototype.acquireTokenPopupAsync=function(t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u,d,l,h,p,g,f;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("acquireTokenPopupAsync called"),o=this.initializeServerTelemetryManager(e.ApiId.acquireTokenPopup),i.label=1;case 1:return i.trys.push([1,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 2:return s=i.sent(),[4,this.createAuthCodeClient(o,t.authority)];case 3:return c=i.sent(),this.logger.verbose("Auth code client created"),[4,c.getAuthCodeUrl(t)];case 4:return u=i.sent(),d=new Qt(c,this.browserStorage,s,this.logger),l={popup:a,popupName:r,popupWindowAttributes:n},h=d.initiateAuthRequest(u,l),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:h},null),[4,d.monitorPopupForHash(h)];case 5:return p=i.sent(),g=this.validateAndExtractStateFromHash(p,e.InteractionType.Popup,t.correlationId),we.removeThrottle(this.browserStorage,this.config.auth.clientId,s),[4,d.handleCodeResponse(p,g,c.authority,this.networkClient)];case 6:return[2,i.sent()];case 7:throw f=i.sent(),a&&a.close(),f instanceof Z&&f.setCorrelationId(this.correlationId),o.cacheFailedRequest(f),this.browserStorage.cleanRequestByState(t.state),f;case 8:return[2]}}))}))},n.prototype.logoutPopupAsync=function(t,r,n,a,s,c){return o(this,void 0,void 0,(function(){var o,u,d,l,h,p,g,f,y;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Popup,t),o=this.initializeServerTelemetryManager(e.ApiId.logoutPopup),i.label=1;case 1:return i.trys.push([1,8,,9]),[4,this.clearCacheOnLogout(t.account)];case 2:return i.sent(),this.browserStorage.setInteractionInProgress(!0),[4,this.createAuthCodeClient(o,a)];case 3:u=i.sent(),this.logger.verbose("Auth code client created"),d=u.getLogoutUri(t),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Popup,t),l=new Yt(this.browserStorage,this.logger),h=l.openPopup(d,{popupName:r,popupWindowAttributes:n,popup:s}),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:h},null),i.label=4;case 4:return i.trys.push([4,6,,7]),[4,l.monitorPopupForSameOrigin(h)];case 5:return i.sent(),this.logger.verbose("Popup successfully redirected to postLogoutRedirectUri"),[3,7];case 6:return p=i.sent(),this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: "+p),[3,7];case 7:return l.cleanPopup(h),c?(g={apiId:e.ApiId.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Fe.getAbsoluteUrl(c,Kt.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecing main window to: "+f),this.navigationClient.navigateInternal(f,g)):this.logger.verbose("No main window navigation requested"),[3,9];case 8:throw y=i.sent(),s&&s.close(),y instanceof Z&&y.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Popup,null,y),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),o.cacheFailedRequest(y),y;case 9:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),[2]}}))}))},n}(Wt),Xt=function(t){function n(e,r,n,o,i){var a=t.call(this,e,r,n,o)||this;return a.browserCrypto=i,a}return r(n,t),n.prototype.initiateAuthRequest=function(t,r){return o(this,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest called"),re.isEmpty(t)?[3,7]:(r.redirectStartPage&&(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ze.ORIGIN_URI,r.redirectStartPage,!0)),this.browserStorage.setInteractionInProgress(!0),this.browserStorage.setTemporaryCache(Ze.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.browserRequestLogger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),n={apiId:e.ApiId.acquireTokenRedirect,timeout:r.redirectTimeout,noHistory:!1},"function"!=typeof r.onRedirectNavigate?[3,4]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===r.onRedirectNavigate(t)?[3,2]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,r.navigationClient.navigateExternal(t,n)])));case 1:return o.sent(),[2];case 2:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,r.navigationClient.navigateExternal(t,n)];case 5:return o.sent(),[2];case 6:return[3,8];case 7:throw this.browserRequestLogger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),At.createEmptyNavigationUriError();case 8:return[2]}}))}))},n.prototype.handleCodeResponse=function(e,t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u,d,l,h;return i(this,(function(i){switch(i.label){case 0:if(this.browserRequestLogger.verbose("RedirectHandler.handleCodeResponse called"),re.isEmpty(e))throw At.createEmptyHashError(e);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(t),!(s=this.browserStorage.getTemporaryCache(o)))throw te.createStateNotFoundError("Cached State");return c=this.authModule.handleFragmentResponse(e,s),u=this.browserStorage.generateNonceKey(s),d=this.browserStorage.getTemporaryCache(u),this.authCodeRequest.code=c.code,c.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(c.cloud_instance_host_name,r,n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return c.nonce=d||void 0,c.state=s,c.client_info?this.authCodeRequest.clientInfo=c.client_info:(l=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=l),a&&we.removeThrottle(this.browserStorage,a,this.authCodeRequest),[4,this.authModule.acquireToken(this.authCodeRequest,c)];case 3:return h=i.sent(),this.browserStorage.cleanRequestByState(t),[2,h]}}))}))},n}(Vt),Zt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d;return i(this,(function(i){switch(i.label){case 0:r=this.preflightInteractiveRequest(t,e.InteractionType.Redirect),n=this.initializeServerTelemetryManager(e.ApiId.acquireTokenRedirect),i.label=1;case 1:return i.trys.push([1,6,,7]),[4,this.initializeAuthorizationCodeRequest(r)];case 2:return o=i.sent(),[4,this.createAuthCodeClient(n,r.authority)];case 3:return a=i.sent(),this.logger.verbose("Auth code client created"),s=new Xt(a,this.browserStorage,o,this.logger,this.browserCrypto),[4,a.getAuthCodeUrl(r)];case 4:return c=i.sent(),u=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+u),[4,s.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:u,onRedirectNavigate:t.onRedirectNavigate})];case 5:return[2,i.sent()];case 6:throw(d=i.sent())instanceof Z&&d.setCorrelationId(this.correlationId),n.cacheFailedRequest(d),this.browserStorage.cleanRequestByState(r.state),d;case 7:return[2]}}))}))},n.prototype.handleRedirectPromise=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d,l,h,p;return i(this,(function(i){switch(i.label){case 0:r=this.initializeServerTelemetryManager(e.ApiId.handleRedirectPromise),i.label=1;case 1:if(i.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(n=this.getRedirectResponseHash(t||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null];o=void 0;try{o=this.validateAndExtractStateFromHash(n,e.InteractionType.Redirect),Kt.clearHash(window),this.logger.verbose("State extracted from hash")}catch(t){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+t),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null]}return a=this.browserStorage.getTemporaryCache(Ze.ORIGIN_URI,!0)||"",s=Fe.removeHashFromUrl(a),c=Fe.removeHashFromUrl(window.location.href),s===c&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(n,o,r)]):[3,3];case 2:return u=i.sent(),a.indexOf("#")>-1&&Kt.replaceHash(a),[2,u];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(n,o,r)]);case 4:return Kt.isInIframe()?[3,9]:(this.browserStorage.setTemporaryCache(Ze.URL_HASH,n,!0),d={apiId:e.ApiId.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},l=!0,a&&"null"!==a?[3,6]:(h=Kt.getHomepage(),this.browserStorage.setTemporaryCache(Ze.ORIGIN_URI,h,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(h,d)]));case 5:return l=i.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+a),[4,this.navigationClient.navigateInternal(a,d)];case 7:l=i.sent(),i.label=8;case 8:if(!l)return[2,this.handleHash(n,o,r)];i.label=9;case 9:return[2,null];case 10:throw(p=i.sent())instanceof Z&&p.setCorrelationId(this.correlationId),r.cacheFailedRequest(p),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),p;case 11:return[2]}}))}))},n.prototype.getRedirectResponseHash=function(e){this.logger.verbose("getRedirectResponseHash called");var t=Fe.hashContainsKnownProperties(e),r=this.browserStorage.getTemporaryCache(Ze.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ze.URL_HASH)),t?(this.logger.verbose("Hash contains known properties, returning response hash"),e):(this.logger.verbose("Hash does not contain known properties, returning cached hash"),r)},n.prototype.handleHash=function(e,t,r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:if(n=this.browserStorage.getCachedRequest(t,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),!(o=this.browserStorage.getCachedAuthority(t)))throw At.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(r,o)];case 1:return a=i.sent(),this.logger.verbose("Auth code client created"),[4,new Xt(a,this.browserStorage,n,this.logger,this.browserCrypto).handleCodeResponse(e,t,a.authority,this.networkClient,this.config.auth.clientId)];case 2:return[2,i.sent()]}}))}))},n.prototype.logout=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("logoutRedirect called"),r=this.initializeLogoutRequest(t),n=this.initializeServerTelemetryManager(e.ApiId.logout),i.label=1;case 1:return i.trys.push([1,10,,11]),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Redirect,t),[4,this.clearCacheOnLogout(r.account)];case 2:return i.sent(),o={apiId:e.ApiId.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(n,t&&t.authority)];case 3:return a=i.sent(),this.logger.verbose("Auth code client created"),s=a.getLogoutUri(r),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Redirect,r),t&&"function"==typeof t.onRedirectNavigate?!1===t.onRedirectNavigate(s)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),[4,this.navigationClient.navigateExternal(s,o)]):[3,7];case 4:return i.sent(),[2];case 5:this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),i.label=6;case 6:return[3,9];case 7:return[4,this.navigationClient.navigateExternal(s,o)];case 8:return i.sent(),[2];case 9:return[3,11];case 10:throw(c=i.sent())instanceof Z&&c.setCorrelationId(this.correlationId),n.cacheFailedRequest(c),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Redirect,null,c),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),c;case 11:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),[2]}}))}))},n.prototype.getRedirectStartPage=function(e){var t=e||window.location.href;return Fe.getAbsoluteUrl(t,Kt.getCurrentUri())},n}(Wt),$t=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.navigateFrameWait=i,a}return r(t,e),t.prototype.initiateAuthRequest=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:if(re.isEmpty(e))throw this.browserRequestLogger.info("Navigate url is empty"),At.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(e)]:[3,2];case 1:return t=r.sent(),[3,3];case 2:t=this.loadFrameSync(e),r.label=3;case 3:return[2,t]}}))}))},t.prototype.monitorIframeForHash=function(e,t){var r=this;return new Promise((function(n,o){t<Bt&&r.browserRequestLogger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+t+"ms) than the default ("+"6000ms). This may result in timeouts.");var i=window.performance.now()+t,a=setInterval((function(){if(window.performance.now()>i)return r.removeHiddenIframe(e),clearInterval(a),void o(At.createMonitorIframeTimeoutError());var t=v.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:v.EMPTY_STRING}catch(e){}if(!re.isEmpty(t)){var c=s?s.location.hash:v.EMPTY_STRING;return Fe.hashContainsKnownProperties(c)?(r.removeHiddenIframe(e),clearInterval(a),void n(c)):void 0}}),gt)}))},t.prototype.loadFrame=function(e){var t=this;return new Promise((function(r,n){var o=t.createHiddenIframe();setTimeout((function(){o?(o.src=e,r(o)):n("Unable to load iframe")}),t.navigateFrameWait)}))},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return 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.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(Vt),er=function(t){function a(e,r,n,o,i,a,s,c){var u=t.call(this,e,r,n,o,i,a,c)||this;return u.apiId=s,u}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),re.isEmpty(t.loginHint)&&re.isEmpty(t.sid)&&(!t.account||re.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==w.NONE)throw At.createSilentPromptValueError(t.prompt);r=this.initializeAuthorizationRequest(n(n({},t),{prompt:w.NONE}),e.InteractionType.Silent),o=this.initializeServerTelemetryManager(this.apiId),i.label=1;case 1:return i.trys.push([1,6,,7]),[4,this.initializeAuthorizationCodeRequest(r)];case 2:return a=i.sent(),[4,this.createAuthCodeClient(o,r.authority)];case 3:return s=i.sent(),this.logger.verbose("Auth code client created"),[4,s.getAuthCodeUrl(r)];case 4:return c=i.sent(),[4,this.silentTokenHelper(c,a,s,this.logger)];case 5:return[2,i.sent()];case 6:throw(u=i.sent())instanceof Z&&u.setCorrelationId(this.correlationId),o.cacheFailedRequest(u),this.browserStorage.cleanRequestByState(r.state),u;case 7:return[2]}}))}))},a.prototype.logout=function(){return Promise.reject(At.createSilentLogoutUnsupportedError())},a.prototype.silentTokenHelper=function(t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return[4,(o=new $t(n,this.browserStorage,r,a,this.config.system.navigateFrameWait)).initiateAuthRequest(t)];case 1:return s=i.sent(),[4,o.monitorIframeForHash(s,this.config.system.iframeHashTimeout)];case 2:return c=i.sent(),u=this.validateAndExtractStateFromHash(c,e.InteractionType.Silent,r.correlationId),[2,o.handleCodeResponse(c,u,n.authority,this.networkClient)]}}))}))},a}(Wt),tr=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:return r=n(n({},t),this.initializeBaseRequest(t)),o=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(o,r.authority)];case 1:return a=i.sent(),this.logger.verbose("Refresh token client created"),[2,a.acquireTokenByRefreshToken(r).catch((function(e){throw e instanceof Z&&e.setCorrelationId(s.correlationId),o.cacheFailedRequest(e),e}))]}}))}))},a.prototype.logout=function(){return Promise.reject(At.createSilentLogoutUnsupportedError())},a.prototype.createRefreshTokenClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new We(r)]}}))}))},a}(Wt),rr=function(){function e(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}return e.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw At.createUnableToLoadTokenError("Please ensure server response includes id token.");if(e.account)this.loadIdToken(t.id_token,e.account.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadAccessToken(e,t,e.account.homeAccountId,e.account.environment,e.account.tenantId,r);else{if(!e.authority)throw At.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var n={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},o=new ot(e.authority,this.config.system.networkClient,this.storage,n);if(r.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),this.loadIdToken(t.id_token,r.clientInfo,o.hostnameAndPort,o.tenant,r),this.loadAccessToken(e,t,r.clientInfo,o.hostnameAndPort,o.tenant,r);else{if(!t.client_info)throw At.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response"),this.loadIdToken(t.id_token,t.client_info,o.hostnameAndPort,o.tenant,r),this.loadAccessToken(e,t,t.client_info,o.hostnameAndPort,o.tenant,r)}}},e.prototype.loadIdToken=function(e,t,r,n,o){var i=Oe.createIdTokenEntity(t,r,e,this.config.auth.clientId,n),a=new pe(e,this.cryptoObj),s=o.clientInfo?he.createAccount(o.clientInfo,t,a,void 0,void 0,void 0,void 0,r):he.createGenericAccount(t,a,void 0,void 0,void 0,void 0,r);if(!this.isBrowserEnvironment)throw At.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading id token"),this.storage.setAccount(s),this.storage.setIdTokenCredential(i)},e.prototype.loadAccessToken=function(e,t,r,n,o,i){if(t.access_token){if(!t.expires_in)throw At.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw At.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new ue(e.scopes).printScopes(),s=t.expires_in,c=i.extendedExpiresOn,u=Ne.createAccessTokenEntity(r,n,t.access_token,this.config.auth.clientId,o,a,s,c,this.cryptoObj);if(!this.isBrowserEnvironment)throw At.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u)}else this.logger.verbose("TokenCache - No access token provided for caching")},e}(),nr=function(){function t(t){var r,o,i,a,s,c,u,d,l,h,p,g;this.isBrowserEnvironment="undefined"!=typeof window,this.config=(r=t,o=this.isBrowserEnvironment,i=r.auth,a=r.cache,s=r.system,c={clientId:"",authority:""+v.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:"",postLogoutRedirectUri:"",navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:e.ProtocolMode.AAD},u={cacheLocation:e.BrowserCacheLocation.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},d={loggerCallback:function(){},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},l=n(n({},ye),{loggerOptions:d,networkClient:o?Kt.getBrowserNetworkClient():ct,navigationClient:new xt,loadFrameTimeout:0,windowHashTimeout:s&&s.loadFrameTimeout||6e4,iframeHashTimeout:s&&s.loadFrameTimeout||Bt,navigateFrameWait:o&&Kt.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1}),{auth:n(n({},c),i),cache:n(n({},u),a),system:n(n({},l),s)}),this.logger=new oe(this.config.system.loggerOptions,"@azure/msal-browser",jt),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.browserCrypto=this.isBrowserEnvironment?new Nt:$,this.eventHandler=new zt(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Dt(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(h=this.config.auth.clientId,p=this.logger,g={cacheLocation:e.BrowserCacheLocation.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new Dt(h,g,$,p)),this.tokenCache=new rr(this.config,this.browserStorage,this.logger,this.browserCrypto)}return t.prototype.handleRedirectPromise=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c=this;return i(this,(function(i){return this.logger.verbose("handleRedirectPromise called"),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=t||v.EMPTY_STRING,void 0===(o=this.redirectResponse.get(n))?(this.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_START,e.InteractionType.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),a=this.browserStorage.getTemporaryCache(Ze.CORRELATION_ID,!0)||"",s=new Zt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,a),o=s.handleRedirectPromise(t).then((function(t){t&&(r.length<c.getAllAccounts().length?(c.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Redirect,t),c.logger.verbose("handleRedirectResponse returned result, login success")):(c.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),c.logger.verbose("handleRedirectResponse returned result, acquire token success")));return c.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((function(t){throw r.length>0?c.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):c.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),c.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})),this.redirectResponse.set(n,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},t.prototype.acquireTokenRedirect=function(t){return o(this,void 0,void 0,(function(){var r,n=this;return i(this,(function(o){return this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),this.logger.verbose("acquireTokenRedirect called"),(r=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Redirect,t),[2,new Zt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).catch((function(t){throw r?n.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):n.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),t}))]}))}))},t.prototype.acquireTokenPopup=function(t){var r=this;try{this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup),this.logger.verbose("acquireTokenPopup called",t.correlationId)}catch(e){return Promise.reject(e)}var n=this.getAllAccounts();return n.length>0?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Popup,t),new Jt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).then((function(t){return n.length<r.getAllAccounts().length?r.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Popup,t):r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),t})).catch((function(t){return n.length>0?r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t):r.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Popup,null,t),Promise.reject(t)}))},t.prototype.ssoSilent=function(t){return o(this,void 0,void 0,(function(){var r,n;return i(this,(function(o){switch(o.label){case 0:this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.verbose("ssoSilent called",t.correlationId),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_START,e.InteractionType.Silent,t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new er(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,t.correlationId).acquireToken(t)];case 2:return r=o.sent(),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_SUCCESS,e.InteractionType.Silent,r),[2,r];case 3:throw n=o.sent(),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,n),n;case 4:return[2]}}))}))},t.prototype.acquireTokenByRefreshToken=function(t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),Kt.blockReloadInHiddenIframes(),[2,new tr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).catch((function(n){var o=n instanceof Se,i=n instanceof qe,a=n.errorCode===dt;if(o&&a&&!i)return r.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe",t.correlationId),new er(r.config,r.browserStorage,r.browserCrypto,r.logger,r.eventHandler,r.navigationClient,e.ApiId.acquireTokenSilent_authCode).acquireToken(t);throw n}))]}))}))},t.prototype.logout=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead."),[2,this.logoutRedirect(e)]}))}))},t.prototype.logoutRedirect=function(t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),[2,new Zt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,null==t?void 0:t.correlationId).logout(t)]}))}))},t.prototype.logoutPopup=function(t){try{return this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup),new Jt(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,null==t?void 0:t.correlationId).logout(t)}catch(e){return Promise.reject(e)}},t.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},t.prototype.getAccountByUsername=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),t.filter((function(t){return t.username.toLowerCase()===e.toLowerCase()}))[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},t.prototype.getAccountByHomeId=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),t.filter((function(t){return t.homeAccountId===e}))[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},t.prototype.getAccountByLocalId=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),t.filter((function(t){return t.localAccountId===e}))[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},t.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},t.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},t.prototype.preflightBrowserEnvironmentCheck=function(t){if(this.logger.verbose("preflightBrowserEnvironmentCheck started"),Kt.blockNonBrowserEnvironment(this.isBrowserEnvironment),Kt.blockRedirectInIframe(t,this.config.system.allowRedirectInIframe),Kt.blockReloadInHiddenIframes(),Kt.blockAcquireTokenInPopups(),t===e.InteractionType.Redirect&&this.config.cache.cacheLocation===e.BrowserCacheLocation.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw Ut.createInMemoryRedirectUnavailableError()},t.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},t.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},t.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},t.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},t.prototype.getTokenCache=function(){return this.tokenCache},t.prototype.getLogger=function(){return this.logger},t.prototype.setLogger=function(e){this.logger=e},t.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},t.prototype.setNavigationClient=function(e){this.navigationClient=e},t}(),or=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return r=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,t.authority)];case 1:n=i.sent(),this.logger.verbose("Silent auth client created"),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.acquireCachedToken(t)];case 3:return o=i.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,o),[2,o];case 4:throw(a=i.sent())instanceof At&&a.errorCode===It.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a;case 5:return[2]}}))}))},a.prototype.logout=function(){return Promise.reject(At.createSilentLogoutUnsupportedError())},a.prototype.createSilentFlowClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new Ye(r)]}}))}))},a.prototype.initializeSilentRequest=function(e,t){return n(n(n({},e),this.initializeBaseRequest(e)),{account:t,forceRefresh:e.forceRefresh||!1})},a}(Wt),ir=function(t){function n(e){var r=t.call(this,e)||this;return r.activeSilentTokenRequests=new Map,r}return r(n,t),n.prototype.loginRedirect=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.logger.verbose("loginRedirect called"),[2,this.acquireTokenRedirect(e||mt)]}))}))},n.prototype.loginPopup=function(e){return this.logger.verbose("loginPopup called"),this.acquireTokenPopup(e||mt)},n.prototype.acquireTokenSilent=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c=this;return i(this,(function(i){if(this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.verbose("acquireTokenSilent called",t.correlationId),!(r=t.account||this.getActiveAccount()))throw At.createNoAccountError();return n={clientId:this.config.auth.clientId,authority:t.authority||"",scopes:t.scopes,homeAccountIdentifier:r.homeAccountId,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims},o=JSON.stringify(n),void 0===(a=this.activeSilentTokenRequests.get(o))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t.correlationId),s=this.acquireTokenSilentAsync(t,r).then((function(e){return c.activeSilentTokenRequests.delete(o),e})).catch((function(e){throw c.activeSilentTokenRequests.delete(o),e})),this.activeSilentTokenRequests.set(o,s),[2,s]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t.correlationId),[2,a])}))}))},n.prototype.acquireTokenSilentAsync=function(t,r){return o(this,void 0,void 0,(function(){var n,a,s=this;return i(this,(function(c){return n=new or(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient),a=n.initializeSilentRequest(t,r),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),[2,n.acquireToken(a).catch((function(){return o(s,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.acquireTokenByRefreshToken(a)];case 1:return t=n.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),[2,t];case 2:throw r=n.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,r),r;case 3:return[2]}}))}))}))]}))}))},n}(nr),ar={acquireTokenPopup:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},acquireTokenRedirect:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},acquireTokenSilent:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},getAllAccounts:function(){return[]},getAccountByHomeId:function(){return null},getAccountByUsername:function(){return null},getAccountByLocalId:function(){return null},handleRedirectPromise:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},loginPopup:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},loginRedirect:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},logout:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},logoutRedirect:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},logoutPopup:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},ssoSilent:function(){return Promise.reject(Ut.createStubPcaInstanceCalledError())},addEventCallback:function(){return null},removeEventCallback:function(){},enableAccountStorageEvents:function(){},disableAccountStorageEvents:function(){},getTokenCache:function(){throw Ut.createStubPcaInstanceCalledError()},getLogger:function(){throw Ut.createStubPcaInstanceCalledError()},setLogger:function(){},setActiveAccount:function(){},getActiveAccount:function(){return null},initializeWrapperLibrary:function(){},setNavigationClient:function(){}},sr=function(){function t(){}return t.getInteractionStatusFromEvent=function(t,r){switch(t.eventType){case e.EventType.LOGIN_START:return e.InteractionStatus.Login;case e.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case e.EventType.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case e.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case e.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case e.EventType.SSO_SILENT_SUCCESS:case e.EventType.SSO_SILENT_FAILURE:if(r&&r!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case e.EventType.LOGOUT_END:if(r&&r!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case e.EventType.HANDLE_REDIRECT_END:if(r&&r!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case e.EventType.LOGIN_SUCCESS:case e.EventType.LOGIN_FAILURE:case e.EventType.ACQUIRE_TOKEN_SUCCESS:case e.EventType.ACQUIRE_TOKEN_FAILURE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==e.InteractionStatus.Login&&r!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}}return null},t}(),cr=function(){function e(e){this.cryptoOps=new Nt,this.popTokenGenerator=new xe(this.cryptoOps),this.shrParameters=e}return e.prototype.generatePublicKeyThumbprint=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return[2,e.sent().kid]}}))}))},e.prototype.signRequest=function(e,t,r){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)]}))}))},e.prototype.removeKeys=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.cryptoOps.removeTokenBindingKey(e)]}))}))},e}();e.AccountEntity=he,e.AuthError=Z,e.AuthErrorMessage=X,e.BrowserAuthError=At,e.BrowserAuthErrorMessage=It,e.BrowserConfigurationAuthError=Ut,e.BrowserConfigurationAuthErrorMessage=Pt,e.BrowserUtils=Kt,e.ClientAuthError=te,e.ClientAuthErrorMessage=ee,e.ClientConfigurationError=ce,e.ClientConfigurationErrorMessage=se,e.EventMessageUtils=sr,e.InteractionRequiredAuthError=qe,e.InteractionRequiredAuthErrorMessage=Le,e.Logger=oe,e.NavigationClient=xt,e.PublicClientApplication=ir,e.ServerError=Se,e.SignedHttpRequest=cr,e.StringUtils=re,e.UrlString=Fe,e.stubbedPublicClientApplication=ar,e.version=jt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
32
|
+
***************************************************************************** */var c=function(e,t){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function u(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function h(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function l(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function p(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}
|
|
33
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */var g,f,y,m,E,v={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",ADFS:"adfs",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},C=[v.OPENID_SCOPE,v.PROFILE_SCOPE,v.OFFLINE_ACCESS_SCOPE],T=p(C,[v.EMAIL_SCOPE]);!function(e){e.CONTENT_TYPE="Content-Type",e.RETRY_AFTER="Retry-After",e.CCS_HEADER="X-AnchorMailbox",e.WWWAuthenticate="WWW-Authenticate",e.AuthenticationInfo="Authentication-Info"}(g||(g={})),function(e){e.ID_TOKEN="idtoken",e.CLIENT_INFO="client.info",e.ADAL_ID_TOKEN="adal.idtoken",e.ERROR="error",e.ERROR_DESC="error.description",e.ACTIVE_ACCOUNT="active-account"}(f||(f={})),function(e){e.COMMON="common",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers"}(y||(y={})),function(e){e.CLIENT_ID="client_id",e.REDIRECT_URI="redirect_uri",e.RESPONSE_TYPE="response_type",e.RESPONSE_MODE="response_mode",e.GRANT_TYPE="grant_type",e.CLAIMS="claims",e.SCOPE="scope",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ACCESS_TOKEN="access_token",e.ID_TOKEN="id_token",e.REFRESH_TOKEN="refresh_token",e.EXPIRES_IN="expires_in",e.STATE="state",e.NONCE="nonce",e.PROMPT="prompt",e.SESSION_STATE="session_state",e.CLIENT_INFO="client_info",e.CODE="code",e.CODE_CHALLENGE="code_challenge",e.CODE_CHALLENGE_METHOD="code_challenge_method",e.CODE_VERIFIER="code_verifier",e.CLIENT_REQUEST_ID="client-request-id",e.X_CLIENT_SKU="x-client-SKU",e.X_CLIENT_VER="x-client-VER",e.X_CLIENT_OS="x-client-OS",e.X_CLIENT_CPU="x-client-CPU",e.X_CLIENT_CURR_TELEM="x-client-current-telemetry",e.X_CLIENT_LAST_TELEM="x-client-last-telemetry",e.X_MS_LIB_CAPABILITY="x-ms-lib-capability",e.POST_LOGOUT_URI="post_logout_redirect_uri",e.ID_TOKEN_HINT="id_token_hint",e.DEVICE_CODE="device_code",e.CLIENT_SECRET="client_secret",e.CLIENT_ASSERTION="client_assertion",e.CLIENT_ASSERTION_TYPE="client_assertion_type",e.TOKEN_TYPE="token_type",e.REQ_CNF="req_cnf",e.OBO_ASSERTION="assertion",e.REQUESTED_TOKEN_USE="requested_token_use",e.ON_BEHALF_OF="on_behalf_of",e.FOCI="foci",e.CCS_HEADER="X-AnchorMailbox"}(m||(m={})),function(e){e.ACCESS_TOKEN="access_token",e.XMS_CC="xms_cc"}(E||(E={}));var S,w={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create"};!function(e){e.ACCOUNT="account",e.SID="sid",e.LOGIN_HINT="login_hint",e.ID_TOKEN="id_token",e.DOMAIN_HINT="domain_hint",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers",e.ACCOUNT_ID="accountIdentifier",e.HOMEACCOUNT_ID="homeAccountIdentifier"}(S||(S={}));var I,A,_,b,R,O,k,N={PLAIN:"plain",S256:"S256"};!function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(I||(I={})),function(e){e.IMPLICIT_GRANT="implicit",e.AUTHORIZATION_CODE_GRANT="authorization_code",e.CLIENT_CREDENTIALS_GRANT="client_credentials",e.RESOURCE_OWNER_PASSWORD_GRANT="password",e.REFRESH_TOKEN_GRANT="refresh_token",e.DEVICE_CODE_GRANT="device_code",e.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"}(A||(A={})),function(e){e.MSSTS_ACCOUNT_TYPE="MSSTS",e.ADFS_ACCOUNT_TYPE="ADFS",e.MSAV1_ACCOUNT_TYPE="MSA",e.GENERIC_ACCOUNT_TYPE="Generic"}(_||(_={})),function(e){e.CACHE_KEY_SEPARATOR="-",e.CLIENT_INFO_SEPARATOR="."}(b||(b={})),function(e){e.ID_TOKEN="IdToken",e.ACCESS_TOKEN="AccessToken",e.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",e.REFRESH_TOKEN="RefreshToken"}(R||(R={})),function(e){e.ACCOUNT="Account",e.CREDENTIAL="Credential",e.ID_TOKEN="IdToken",e.ACCESS_TOKEN="AccessToken",e.REFRESH_TOKEN="RefreshToken",e.APP_METADATA="AppMetadata",e.TEMPORARY="TempCache",e.TELEMETRY="Telemetry",e.UNDEFINED="Undefined",e.THROTTLING="Throttling"}(O||(O={})),function(e){e[e.ADFS=1001]="ADFS",e[e.MSA=1002]="MSA",e[e.MSSTS=1003]="MSSTS",e[e.GENERIC=1004]="GENERIC",e[e.ACCESS_TOKEN=2001]="ACCESS_TOKEN",e[e.REFRESH_TOKEN=2002]="REFRESH_TOKEN",e[e.ID_TOKEN=2003]="ID_TOKEN",e[e.APP_METADATA=3001]="APP_METADATA",e[e.UNDEFINED=9999]="UNDEFINED"}(k||(k={}));var P,U="appmetadata",M="1",L="authority-metadata",D=86400;!function(e){e.CONFIG="config",e.CACHE="cache",e.NETWORK="network"}(P||(P={}));var q,H={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};e.AuthenticationScheme=void 0,(q=e.AuthenticationScheme||(e.AuthenticationScheme={})).BEARER="Bearer",q.POP="pop",q.SSH="ssh-cert";var K,F,x,B,G,j=60,z=3600,W="throttling",Y="retry-after, h429",J="invalid_grant",Q="client_mismatch";!function(e){e.username="username",e.password="password"}(K||(K={})),function(e){e[e.httpSuccess=200]="httpSuccess",e[e.httpBadRequest=400]="httpBadRequest"}(F||(F={})),function(e){e.FAILED_AUTO_DETECTION="1",e.INTERNAL_CACHE="2",e.ENVIRONMENT_VARIABLE="3",e.IMDS="4"}(x||(x={})),function(e){e.CONFIGURED_MATCHES_DETECTED="1",e.CONFIGURED_NO_AUTO_DETECTION="2",e.CONFIGURED_NOT_DETECTED="3",e.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",e.AUTO_DETECTION_REQUESTED_FAILED="5"}(B||(B={})),function(e){e.NO_CACHE_HIT="0",e.FORCE_REFRESH="1",e.NO_CACHED_ACCESS_TOKEN="2",e.CACHED_ACCESS_TOKEN_EXPIRED="3",e.REFRESH_CACHED_ACCESS_TOKEN="4"}(G||(G={}));
|
|
34
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
35
|
+
var V,X={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."}},Z=function(e){function t(r,n,o){var i=this,a=n?r+": "+n:r;return i=e.call(this,a)||this,Object.setPrototypeOf(i,t.prototype),i.errorCode=r||v.EMPTY_STRING,i.errorMessage=n||"",i.subError=o||"",i.name="AuthError",i}return u(t,e),t.prototype.setCorrelationId=function(e){this.correlationId=e},t.createUnexpectedError=function(e){return new t(X.unexpectedError.code,X.unexpectedError.desc+": "+e)},t}(Error),$={createNewGuid:function(){throw Z.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw Z.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw Z.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Crypto interface - generatePkceCodes() has not been implemented",Z.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")}))}))},getPublicKeyThumbprint:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Crypto interface - getPublicKeyThumbprint() has not been implemented",Z.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")}))}))},removeTokenBindingKey:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Crypto interface - removeTokenBindingKey() has not been implemented",Z.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")}))}))},clearKeystore:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Crypto interface - clearKeystore() has not been implemented",Z.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")}))}))},signJwt:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Crypto interface - signJwt() has not been implemented",Z.createUnexpectedError("Crypto interface - signJwt() has not been implemented")}))}))}},ee={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},tokenRefreshRequired:{code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."}},te=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientAuthError",Object.setPrototypeOf(o,t.prototype),o}return u(t,e),t.createClientInfoDecodingError=function(e){return new t(ee.clientInfoDecodingError.code,ee.clientInfoDecodingError.desc+" Failed with error: "+e)},t.createClientInfoEmptyError=function(){return new t(ee.clientInfoEmptyError.code,""+ee.clientInfoEmptyError.desc)},t.createTokenParsingError=function(e){return new t(ee.tokenParsingError.code,ee.tokenParsingError.desc+" Failed with error: "+e)},t.createTokenNullOrEmptyError=function(e){return new t(ee.nullOrEmptyToken.code,ee.nullOrEmptyToken.desc+" Raw Token Value: "+e)},t.createEndpointDiscoveryIncompleteError=function(e){return new t(ee.endpointResolutionError.code,ee.endpointResolutionError.desc+" Detail: "+e)},t.createNetworkError=function(e,r){return new t(ee.networkError.code,ee.networkError.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToGetOpenidConfigError=function(e){return new t(ee.unableToGetOpenidConfigError.code,ee.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+e)},t.createHashNotDeserializedError=function(e){return new t(ee.hashNotDeserialized.code,ee.hashNotDeserialized.desc+" Given Object: "+e)},t.createInvalidStateError=function(e,r){return new t(ee.invalidStateError.code,ee.invalidStateError.desc+" Invalid State: "+e+", Root Err: "+r)},t.createStateMismatchError=function(){return new t(ee.stateMismatchError.code,ee.stateMismatchError.desc)},t.createStateNotFoundError=function(e){return new t(ee.stateNotFoundError.code,ee.stateNotFoundError.desc+": "+e)},t.createNonceMismatchError=function(){return new t(ee.nonceMismatchError.code,ee.nonceMismatchError.desc)},t.createNonceNotFoundError=function(e){return new t(ee.nonceNotFoundError.code,ee.nonceNotFoundError.desc+": "+e)},t.createMultipleMatchingTokensInCacheError=function(){return new t(ee.multipleMatchingTokens.code,ee.multipleMatchingTokens.desc+".")},t.createMultipleMatchingAccountsInCacheError=function(){return new t(ee.multipleMatchingAccounts.code,ee.multipleMatchingAccounts.desc)},t.createMultipleMatchingAppMetadataInCacheError=function(){return new t(ee.multipleMatchingAppMetadata.code,ee.multipleMatchingAppMetadata.desc)},t.createTokenRequestCannotBeMadeError=function(){return new t(ee.tokenRequestCannotBeMade.code,ee.tokenRequestCannotBeMade.desc)},t.createAppendEmptyScopeToSetError=function(e){return new t(ee.appendEmptyScopeError.code,ee.appendEmptyScopeError.desc+" Given Scope: "+e)},t.createRemoveEmptyScopeFromSetError=function(e){return new t(ee.removeEmptyScopeError.code,ee.removeEmptyScopeError.desc+" Given Scope: "+e)},t.createAppendScopeSetError=function(e){return new t(ee.appendScopeSetError.code,ee.appendScopeSetError.desc+" Detail Error: "+e)},t.createEmptyInputScopeSetError=function(){return new t(ee.emptyInputScopeSetError.code,""+ee.emptyInputScopeSetError.desc)},t.createDeviceCodeCancelledError=function(){return new t(ee.DeviceCodePollingCancelled.code,""+ee.DeviceCodePollingCancelled.desc)},t.createDeviceCodeExpiredError=function(){return new t(ee.DeviceCodeExpired.code,""+ee.DeviceCodeExpired.desc)},t.createDeviceCodeUnknownError=function(){return new t(ee.DeviceCodeUnknownError.code,""+ee.DeviceCodeUnknownError.desc)},t.createNoAccountInSilentRequestError=function(){return new t(ee.NoAccountInSilentRequest.code,""+ee.NoAccountInSilentRequest.desc)},t.createNullOrUndefinedCacheRecord=function(){return new t(ee.invalidCacheRecord.code,ee.invalidCacheRecord.desc)},t.createInvalidCacheEnvironmentError=function(){return new t(ee.invalidCacheEnvironment.code,ee.invalidCacheEnvironment.desc)},t.createNoAccountFoundError=function(){return new t(ee.noAccountFound.code,ee.noAccountFound.desc)},t.createCachePluginError=function(){return new t(ee.CachePluginError.code,""+ee.CachePluginError.desc)},t.createNoCryptoObjectError=function(e){return new t(ee.noCryptoObj.code,""+ee.noCryptoObj.desc+e)},t.createInvalidCacheTypeError=function(){return new t(ee.invalidCacheType.code,""+ee.invalidCacheType.desc)},t.createUnexpectedAccountTypeError=function(){return new t(ee.unexpectedAccountType.code,""+ee.unexpectedAccountType.desc)},t.createUnexpectedCredentialTypeError=function(){return new t(ee.unexpectedCredentialType.code,""+ee.unexpectedCredentialType.desc)},t.createInvalidAssertionError=function(){return new t(ee.invalidAssertion.code,""+ee.invalidAssertion.desc)},t.createInvalidCredentialError=function(){return new t(ee.invalidClientCredential.code,""+ee.invalidClientCredential.desc)},t.createRefreshRequiredError=function(){return new t(ee.tokenRefreshRequired.code,ee.tokenRefreshRequired.desc)},t.createUserTimeoutReachedError=function(){return new t(ee.userTimeoutReached.code,ee.userTimeoutReached.desc)},t.createTokenClaimsRequiredError=function(){return new t(ee.tokenClaimsRequired.code,ee.tokenClaimsRequired.desc)},t.createNoAuthCodeInServerResponseError=function(){return new t(ee.noAuthorizationCodeFromServer.code,ee.noAuthorizationCodeFromServer.desc)},t.createBindingKeyNotRemovedError=function(){return new t(ee.bindingKeyNotRemovedError.code,ee.bindingKeyNotRemovedError.desc)},t.createLogoutNotSupportedError=function(){return new t(ee.logoutNotSupported.code,ee.logoutNotSupported.desc)},t}(Z),re=function(){function e(){}return e.decodeAuthToken=function(t){if(e.isEmpty(t))throw te.createTokenNullOrEmptyError(t);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw te.createTokenParsingError("Given token is malformed: "+JSON.stringify(t));return{header:r[1],JWSPayload:r[2],JWSSig:r[3]}},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.isEmptyObj=function(t){if(t&&!e.isEmpty(t))try{var r=JSON.parse(t);return 0===Object.keys(r).length}catch(e){}return!0},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){var t={},r=e.split("&"),n=function(e){return decodeURIComponent(e.replace(/\+/g," "))};return r.forEach((function(e){if(e.trim()){var r=e.split(/=(.+)/g,2),o=r[0],i=r[1];o&&i&&(t[n(o)]=n(i))}})),t},e.trimArrayEntries=function(e){return e.map((function(e){return e.trim()}))},e.removeEmptyStringsFromArray=function(t){return t.filter((function(t){return!e.isEmpty(t)}))},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}();
|
|
36
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
37
|
+
e.LogLevel=void 0,(V=e.LogLevel||(e.LogLevel={}))[V.Error=0]="Error",V[V.Warning=1]="Warning",V[V.Info=2]="Info",V[V.Verbose=3]="Verbose",V[V.Trace=4]="Trace";var ne,oe=function(){function t(t,r,n){this.level=e.LogLevel.Info;this.localCallback=t.loggerCallback||function(){},this.piiLoggingEnabled=t.piiLoggingEnabled||!1,this.level="number"==typeof t.logLevel?t.logLevel:e.LogLevel.Info,this.correlationId=t.correlationId||"",this.packageName=r||v.EMPTY_STRING,this.packageVersion=n||v.EMPTY_STRING}return t.prototype.clone=function(e,r,n){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},e,r)},t.prototype.logMessage=function(t,r){if(!(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)){var n=(new Date).toUTCString(),o=(re.isEmpty(r.correlationId)?re.isEmpty(this.correlationId)?"["+n+"]":"["+n+"] : ["+this.correlationId+"]":"["+n+"] : ["+r.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+e.LogLevel[r.logLevel]+" - "+t;this.executeCallback(r.logLevel,o,r.containsPii||!1)}},t.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},t.prototype.error=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:r||""})},t.prototype.errorPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:r||""})},t.prototype.warning=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:r||""})},t.prototype.warningPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:r||""})},t.prototype.info=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:r||""})},t.prototype.infoPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:r||""})},t.prototype.verbose=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:r||""})},t.prototype.verbosePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:r||""})},t.prototype.trace=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:r||""})},t.prototype.tracePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:r||""})},t.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},t}(),ie="5.1.2",ae=function(){function t(){}return t.prototype.generateAccountId=function(){return t.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},t.prototype.generateCredentialId=function(){return t.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},t.prototype.generateTarget=function(){return t.generateTargetForCacheKey(this.target)},t.prototype.generateCredentialKey=function(){return t.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType)},t.prototype.generateType=function(){switch(this.credentialType){case R.ID_TOKEN:return k.ID_TOKEN;case R.ACCESS_TOKEN:case R.ACCESS_TOKEN_WITH_AUTH_SCHEME:return k.ACCESS_TOKEN;case R.REFRESH_TOKEN:return k.REFRESH_TOKEN;default:throw te.createUnexpectedCredentialTypeError()}},t.getCredentialType=function(e){return-1!==e.indexOf(R.ACCESS_TOKEN.toLowerCase())?-1!==e.indexOf(R.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())?R.ACCESS_TOKEN_WITH_AUTH_SCHEME:R.ACCESS_TOKEN:-1!==e.indexOf(R.ID_TOKEN.toLowerCase())?R.ID_TOKEN:-1!==e.indexOf(R.REFRESH_TOKEN.toLowerCase())?R.REFRESH_TOKEN:v.NOT_DEFINED},t.generateCredentialCacheKey=function(t,r,n,o,i,a,s,c){var u=[this.generateAccountIdForCacheKey(t,r),this.generateCredentialIdForCacheKey(n,o,i,s),this.generateTargetForCacheKey(a)];return c&&c!==e.AuthenticationScheme.BEARER&&u.push(c.toLowerCase()),u.join(b.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateAccountIdForCacheKey=function(e,t){return[e,t].join(b.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateCredentialIdForCacheKey=function(e,t,r,n){return[e,e===R.REFRESH_TOKEN&&n||t,r||""].join(b.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateTargetForCacheKey=function(e){return(e||"").toLowerCase()},t}(),se={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create' and 'none'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},ce=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientConfigurationError",Object.setPrototypeOf(o,t.prototype),o}return u(t,e),t.createRedirectUriEmptyError=function(){return new t(se.redirectUriNotSet.code,se.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(se.postLogoutUriNotSet.code,se.postLogoutUriNotSet.desc)},t.createClaimsRequestParsingError=function(e){return new t(se.claimsRequestParsingError.code,se.claimsRequestParsingError.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(se.authorityUriInsecure.code,se.authorityUriInsecure.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(se.urlParseError.code,se.urlParseError.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(se.urlEmptyError.code,se.urlEmptyError.desc)},t.createEmptyScopesArrayError=function(){return new t(se.emptyScopesError.code,""+se.emptyScopesError.desc)},t.createClientIdSingleScopeError=function(e){return new t(se.clientIdSingleScopeError.code,se.clientIdSingleScopeError.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(se.invalidPrompt.code,se.invalidPrompt.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(se.invalidClaimsRequest.code,se.invalidClaimsRequest.desc)},t.createEmptyLogoutRequestError=function(){return new t(se.logoutRequestEmptyError.code,se.logoutRequestEmptyError.desc)},t.createEmptyTokenRequestError=function(){return new t(se.tokenRequestEmptyError.code,se.tokenRequestEmptyError.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(se.invalidCodeChallengeMethod.code,se.invalidCodeChallengeMethod.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(se.invalidCodeChallengeParams.code,se.invalidCodeChallengeParams.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(se.invalidCloudDiscoveryMetadata.code,se.invalidCloudDiscoveryMetadata.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(se.invalidAuthorityMetadata.code,se.invalidAuthorityMetadata.desc)},t.createUntrustedAuthorityError=function(){return new t(se.untrustedAuthority.code,se.untrustedAuthority.desc)},t.createMissingSshJwkError=function(){return new t(se.missingSshJwk.code,se.missingSshJwk.desc)},t.createMissingSshKidError=function(){return new t(se.missingSshKid.code,se.missingSshKid.desc)},t.createMissingNonceAuthenticationHeadersError=function(){return new t(se.missingNonceAuthenticationHeader.code,se.missingNonceAuthenticationHeader.desc)},t.createInvalidAuthenticationHeaderError=function(e,r){return new t(se.invalidAuthenticationHeader.code,se.invalidAuthenticationHeader.desc+". Invalid header: "+e+". Details: "+r)},t}(te),ue=function(){function e(e){var t=this,r=e?re.trimArrayEntries(p(e)):[],n=r?re.removeEmptyStringsFromArray(r):[];this.validateInputScopes(n),this.scopes=new Set,n.forEach((function(e){return t.scopes.add(e)}))}return e.fromString=function(t){return new e((t||"").split(" "))},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw ce.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var r=new e(this.printScopesLowerCase().split(" "));return!re.isEmpty(t)&&r.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((function(e){return t.containsScope(e)})))},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return T.forEach((function(r){e.containsScope(r)&&(t+=1)})),this.scopes.size===t},e.prototype.appendScope=function(e){re.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach((function(e){return t.appendScope(e)}))}catch(e){throw te.createAppendScopeSetError(e)}},e.prototype.removeScope=function(e){if(re.isEmpty(e))throw te.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;T.forEach((function(t){e.scopes.delete(t)}))},e.prototype.unionScopeSets=function(e){if(!e)throw te.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach((function(e){return t.add(e.toLowerCase())})),this.scopes.forEach((function(e){return t.add(e.toLowerCase())})),t},e.prototype.intersectingScopeSets=function(e){if(!e)throw te.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r},e.prototype.getScopeCount=function(){return this.scopes.size},e.prototype.asArray=function(){var e=[];return this.scopes.forEach((function(t){return e.push(t)})),e},e.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):""},e.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},e}();
|
|
38
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
39
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
40
|
+
function de(e,t){if(re.isEmpty(e))throw te.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw te.createClientInfoDecodingError(e)}}function he(e){if(re.isEmpty(e))throw te.createClientInfoDecodingError("Home account ID was empty.");var t=e.split(b.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?v.EMPTY_STRING:t[1]}}
|
|
41
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */!function(e){e[e.Default=0]="Default",e[e.Adfs=1]="Adfs"}(ne||(ne={}));
|
|
42
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
43
|
+
var le=function(){function e(){}return e.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(b.CACHE_KEY_SEPARATOR).toLowerCase()},e.prototype.generateAccountKey=function(){return e.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},e.prototype.generateType=function(){switch(this.authorityType){case _.ADFS_ACCOUNT_TYPE:return k.ADFS;case _.MSAV1_ACCOUNT_TYPE:return k.MSA;case _.MSSTS_ACCOUNT_TYPE:return k.MSSTS;case _.GENERIC_ACCOUNT_TYPE:return k.GENERIC;default:throw te.createUnexpectedAccountTypeError()}},e.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims}},e.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||"",e.tenantId||""].join(b.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAccount=function(t,r,n,o,i,a,s,c){var u,d,h,l,p,g,f=new e;f.authorityType=_.MSSTS_ACCOUNT_TYPE,f.clientInfo=t,f.homeAccountId=r;var y=c||o&&o.getPreferredCache();if(!y)throw te.createInvalidCacheEnvironmentError();return f.environment=y,f.realm=(null===(u=null==n?void 0:n.claims)||void 0===u?void 0:u.tid)||"",f.oboAssertion=i,n&&(f.idTokenClaims=n.claims,f.localAccountId=(null===(d=null==n?void 0:n.claims)||void 0===d?void 0:d.oid)||(null===(h=null==n?void 0:n.claims)||void 0===h?void 0:h.sub)||"",f.username=(null===(l=null==n?void 0:n.claims)||void 0===l?void 0:l.preferred_username)||((null===(p=null==n?void 0:n.claims)||void 0===p?void 0:p.emails)?n.claims.emails[0]:""),f.name=null===(g=null==n?void 0:n.claims)||void 0===g?void 0:g.name),f.cloudGraphHostName=a,f.msGraphHost=s,f},e.createGenericAccount=function(t,r,n,o,i,a,s){var c,u,d,h,l=new e;l.authorityType=n&&n.authorityType===ne.Adfs?_.ADFS_ACCOUNT_TYPE:_.GENERIC_ACCOUNT_TYPE,l.homeAccountId=t,l.realm="",l.oboAssertion=o;var p=s||n&&n.getPreferredCache();if(!p)throw te.createInvalidCacheEnvironmentError();return r&&(l.localAccountId=(null===(c=null==r?void 0:r.claims)||void 0===c?void 0:c.oid)||(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.sub)||"",l.username=(null===(d=null==r?void 0:r.claims)||void 0===d?void 0:d.upn)||"",l.name=(null===(h=null==r?void 0:r.claims)||void 0===h?void 0:h.name)||"",l.idTokenClaims=null==r?void 0:r.claims),l.environment=p,l.cloudGraphHostName=i,l.msGraphHost=a,l},e.generateHomeAccountId=function(e,t,r,n,o){var i,a=(null===(i=null==o?void 0:o.claims)||void 0===i?void 0:i.sub)?o.claims.sub:v.EMPTY_STRING;if(t===ne.Adfs)return a;if(e)try{var s=de(e,n);if(!re.isEmpty(s.uid)&&!re.isEmpty(s.utid))return""+s.uid+b.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),a},e.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},e.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var n=!0;if(r){var o=e.idTokenClaims||{},i=t.idTokenClaims||{};n=o.iat===i.iat&&o.nonce===i.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&n},e}(),pe=function(){function e(t,r){if(re.isEmpty(t))throw te.createTokenNullOrEmptyError(t);this.rawToken=t,this.claims=e.extractTokenClaims(t,r)}return e.extractTokenClaims=function(e,t){var r=re.decodeAuthToken(e);try{var n=r.JWSPayload,o=t.base64Decode(n);return JSON.parse(o)}catch(e){throw te.createTokenParsingError(e)}},e}(),ge=function(){function t(e,t){this.clientId=e,this.cryptoImpl=t}return t.prototype.getAllAccounts=function(){var e=this,r=this.getAccountsFilteredBy(),n=Object.keys(r).map((function(e){return r[e]}));return n.length<1?[]:n.map((function(r){var n=t.toObject(new le,r).getAccountInfo(),o=e.readIdTokenFromCache(e.clientId,n);return o&&!n.idTokenClaims&&(n.idTokenClaims=new pe(o.secret,e.cryptoImpl).claims),n}))},t.prototype.saveCacheRecord=function(e){return h(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:if(!e)throw te.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}}))}))},t.prototype.saveAccessToken=function(e){return h(this,void 0,void 0,(function(){var t,r,n,o,i=this;return l(this,(function(a){switch(a.label){case 0:return t=this.getCredentialsFilteredBy({clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType}),r=ue.fromString(e.target),(n=Object.keys(t.accessTokens).map((function(e){return t.accessTokens[e]})))?(o=[],n.forEach((function(e){ue.fromString(e.target).intersectingScopeSets(r)&&o.push(i.removeCredential(e))})),[4,Promise.all(o)]):[3,2];case 1:a.sent(),a.label=2;case 2:return this.setAccessTokenCredential(e),[2]}}))}))},t.prototype.getAccountsFilteredBy=function(e){return this.getAccountsFilteredByInternal(e?e.homeAccountId:"",e?e.environment:"",e?e.realm:"")},t.prototype.getAccountsFilteredByInternal=function(e,t,r){var n=this,o=this.getKeys(),i={};return o.forEach((function(o){var a=n.getAccount(o);a&&(e&&!n.matchHomeAccountId(a,e)||t&&!n.matchEnvironment(a,t)||r&&!n.matchRealm(a,r)||(i[o]=a))})),i},t.prototype.getCredentialsFilteredBy=function(e){return this.getCredentialsFilteredByInternal(e.homeAccountId,e.environment,e.credentialType,e.clientId,e.familyId,e.realm,e.target,e.oboAssertion,e.tokenType,e.keyId)},t.prototype.getCredentialsFilteredByInternal=function(t,r,n,o,i,a,s,c,u,d){var h=this,l=this.getKeys(),p={idTokens:{},accessTokens:{},refreshTokens:{}};return l.forEach((function(l){var g=ae.getCredentialType(l);if(g!==v.NOT_DEFINED){var f=h.getSpecificCredential(l,g);if(f&&(!c||h.matchOboAssertion(f,c))&&(!t||h.matchHomeAccountId(f,t))&&(!r||h.matchEnvironment(f,r))&&(!a||h.matchRealm(f,a))&&(!n||h.matchCredentialType(f,n))&&(!o||h.matchClientId(f,o))&&(!i||h.matchFamilyId(f,i))&&(!s||h.matchTarget(f,s))){if(n===R.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(u&&!h.matchTokenType(f,u))return;switch(u){case e.AuthenticationScheme.POP:if(-1===l.indexOf(e.AuthenticationScheme.POP))return void h.removeItem(l,O.CREDENTIAL);break;case e.AuthenticationScheme.SSH:if(d&&!h.matchKeyId(f,d))return}}var y=h.updateCredentialCacheKey(l,f);switch(g){case R.ID_TOKEN:p.idTokens[y]=f;break;case R.ACCESS_TOKEN:case R.ACCESS_TOKEN_WITH_AUTH_SCHEME:p.accessTokens[y]=f;break;case R.REFRESH_TOKEN:p.refreshTokens[y]=f}}}})),p},t.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},t.prototype.getAppMetadataFilteredByInternal=function(e,t){var r=this,n=this.getKeys(),o={};return n.forEach((function(n){if(r.isAppMetadata(n)){var i=r.getAppMetadata(n);i&&(e&&!r.matchEnvironment(i,e)||t&&!r.matchClientId(i,t)||(o[n]=i))}})),o},t.prototype.getAuthorityMetadataByAlias=function(e){var t=this,r=this.getAuthorityMetadataKeys(),n=null;return r.forEach((function(r){if(t.isAuthorityMetadata(r)&&-1!==r.indexOf(t.clientId)){var o=t.getAuthorityMetadata(r);o&&-1!==o.aliases.indexOf(e)&&(n=o)}})),n},t.prototype.removeAllAccounts=function(){return h(this,void 0,void 0,(function(){var e,t,r=this;return l(this,(function(n){switch(n.label){case 0:return e=this.getKeys(),t=[],e.forEach((function(e){r.getAccount(e)&&t.push(r.removeAccount(e))})),[4,Promise.all(t)];case 1:return n.sent(),[2,!0]}}))}))},t.prototype.removeAccount=function(e){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:if(!(t=this.getAccount(e)))throw te.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return[2,r.sent()&&this.removeItem(e,O.ACCOUNT)]}}))}))},t.prototype.removeAccountContext=function(e){return h(this,void 0,void 0,(function(){var t,r,n,o=this;return l(this,(function(i){switch(i.label){case 0:return t=this.getKeys(),r=e.generateAccountId(),n=[],t.forEach((function(e){var t=ae.getCredentialType(e);if(t!==v.NOT_DEFINED){var i=o.getSpecificCredential(e,t);i&&r===i.generateAccountId()&&n.push(o.removeCredential(i))}})),[4,Promise.all(n)];case 1:return i.sent(),[2,!0]}}))}))},t.prototype.removeCredential=function(t){return h(this,void 0,void 0,(function(){var r,n;return l(this,(function(o){switch(o.label){case 0:if(r=t.generateCredentialKey(),t.credentialType.toLowerCase()!==R.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(t.tokenType!==e.AuthenticationScheme.POP)return[3,4];if(!(n=t.keyId))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(n)];case 2:return o.sent(),[3,4];case 3:throw o.sent(),te.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(r,O.CREDENTIAL)]}}))}))},t.prototype.removeAppMetadata=function(){var e=this;return this.getKeys().forEach((function(t){e.isAppMetadata(t)&&e.removeItem(t,O.APP_METADATA)})),!0},t.prototype.readCacheRecord=function(e,t,r,n,o,i){var a=this.readAccountFromCache(e),s=this.readIdTokenFromCache(t,e),c=this.readAccessTokenFromCache(t,e,r,o,i),u=this.readRefreshTokenFromCache(t,e,!1),d=this.readAppMetadataFromCache(n,t);return a&&s&&(a.idTokenClaims=new pe(s.secret,this.cryptoImpl).claims),{account:a,idToken:s,accessToken:c,refreshToken:u,appMetadata:d}},t.prototype.readAccountFromCache=function(e){var t=le.generateAccountCacheKey(e);return this.getAccount(t)},t.prototype.readIdTokenFromCache=function(e,t){var r={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:R.ID_TOKEN,clientId:e,realm:t.tenantId},n=this.getCredentialsFilteredBy(r),o=Object.keys(n.idTokens).map((function(e){return n.idTokens[e]})),i=o.length;if(i<1)return null;if(i>1)throw te.createMultipleMatchingTokensInCacheError();return o[0]},t.prototype.readAccessTokenFromCache=function(t,r,n,o,i){var a=o&&o!==e.AuthenticationScheme.BEARER?R.ACCESS_TOKEN_WITH_AUTH_SCHEME:R.ACCESS_TOKEN,s={homeAccountId:r.homeAccountId,environment:r.environment,credentialType:a,clientId:t,realm:r.tenantId,target:n.printScopesLowerCase(),tokenType:o,keyId:i},c=this.getCredentialsFilteredBy(s),u=Object.keys(c.accessTokens).map((function(e){return c.accessTokens[e]})),d=u.length;if(d<1)return null;if(d>1)throw te.createMultipleMatchingTokensInCacheError();return u[0]},t.prototype.readRefreshTokenFromCache=function(e,t,r){var n=r?M:void 0,o={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:R.REFRESH_TOKEN,clientId:e,familyId:n},i=this.getCredentialsFilteredBy(o),a=Object.keys(i.refreshTokens).map((function(e){return i.refreshTokens[e]}));return a.length<1?null:a[0]},t.prototype.readAppMetadataFromCache=function(e,t){var r={environment:e,clientId:t},n=this.getAppMetadataFilteredBy(r),o=Object.keys(n).map((function(e){return n[e]})),i=o.length;if(i<1)return null;if(i>1)throw te.createMultipleMatchingAppMetadataInCacheError();return o[0]},t.prototype.isAppMetadataFOCI=function(e,t){var r=this.readAppMetadataFromCache(e,t);return!(!r||r.familyId!==M)},t.prototype.matchHomeAccountId=function(e,t){return!(!e.homeAccountId||t!==e.homeAccountId)},t.prototype.matchOboAssertion=function(e,t){return!(!e.oboAssertion||t!==e.oboAssertion)},t.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},t.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},t.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},t.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},t.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},t.prototype.matchTarget=function(e,t){if(e.credentialType!==R.ACCESS_TOKEN&&e.credentialType!==R.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;var r=ue.fromString(e.target),n=ue.fromString(t);return n.containsOnlyOIDCScopes()?n.removeScope(v.OFFLINE_ACCESS_SCOPE):n.removeOIDCScopes(),r.containsScopeSet(n)},t.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},t.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},t.prototype.isAppMetadata=function(e){return-1!==e.indexOf(U)},t.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(L)},t.prototype.generateAuthorityMetadataCacheKey=function(e){return L+"-"+this.clientId+"-"+e},t.prototype.getSpecificCredential=function(e,t){switch(t){case R.ID_TOKEN:return this.getIdTokenCredential(e);case R.ACCESS_TOKEN:case R.ACCESS_TOKEN_WITH_AUTH_SCHEME:return this.getAccessTokenCredential(e);case R.REFRESH_TOKEN:return this.getRefreshTokenCredential(e);default:return null}},t.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},t}(),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.setAccount=function(){throw Z.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},t.prototype.getAccount=function(){throw Z.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},t.prototype.setIdTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getIdTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAccessTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getAccessTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setRefreshTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getRefreshTokenCredential=function(){throw Z.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAppMetadata=function(){throw Z.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAppMetadata=function(){throw Z.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.setServerTelemetry=function(){throw Z.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.getServerTelemetry=function(){throw Z.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.setAuthorityMetadata=function(){throw Z.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadata=function(){throw Z.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadataKeys=function(){throw Z.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},t.prototype.setThrottlingCache=function(){throw Z.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.getThrottlingCache=function(){throw Z.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.removeItem=function(){throw Z.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},t.prototype.containsKey=function(){throw Z.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},t.prototype.getKeys=function(){throw Z.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},t.prototype.clear=function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Storage interface - clear() has not been implemented for the cacheStorage interface.",Z.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")}))}))},t.prototype.updateCredentialCacheKey=function(){throw Z.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},t}(ge),ye={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},me={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:""},Ee={sendGetRequestAsync:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Network interface - sendGetRequestAsync() has not been implemented",Z.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")}))}))},sendPostRequestAsync:function(){return h(this,void 0,void 0,(function(){return l(this,(function(e){throw"Network interface - sendPostRequestAsync() has not been implemented",Z.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")}))}))}},ve={sku:v.SKU,version:ie,cpu:"",os:""},Ce={clientSecret:"",clientAssertion:void 0};
|
|
44
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
45
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
46
|
+
var Te,Se=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="ServerError",Object.setPrototypeOf(i,t.prototype),i}return u(t,e),t}(Z),we=function(){function e(){}return e.generateThrottlingStorageKey=function(e){return W+"."+JSON.stringify(e)},e.preProcess=function(t,r){var n,o=e.generateThrottlingStorageKey(r),i=t.getThrottlingCache(o);if(i){if(i.throttleTime<Date.now())return void t.removeItem(o,O.THROTTLING);throw new Se((null===(n=i.errorCodes)||void 0===n?void 0:n.join(" "))||v.EMPTY_STRING,i.errorMessage,i.subError)}},e.postProcess=function(t,r,n){if(e.checkResponseStatus(n)||e.checkResponseForRetryAfter(n)){var o={throttleTime:e.calculateThrottleTime(parseInt(n.headers[g.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};t.setThrottlingCache(e.generateThrottlingStorageKey(r),o)}},e.checkResponseStatus=function(e){return 429===e.status||e.status>=500&&e.status<600},e.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(g.RETRY_AFTER)&&(e.status<200||e.status>=300))},e.calculateThrottleTime=function(e){var t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||j),r+z))},e.removeThrottle=function(e,t,r,n){var o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshJwk:r.sshJwk,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);return e.removeItem(i,O.THROTTLING)},e}(),Ie=function(){function e(e,t){this.networkClient=e,this.cacheManager=t}return e.prototype.sendPostRequest=function(e,t,r){return h(this,void 0,void 0,(function(){var n,o;return l(this,(function(i){switch(i.label){case 0:we.preProcess(this.cacheManager,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,r)];case 2:return n=i.sent(),[3,4];case 3:throw(o=i.sent())instanceof Z?o:te.createNetworkError(t,o);case 4:return we.postProcess(this.cacheManager,e,n),[2,n]}}))}))},e}();
|
|
47
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */!function(e){e.HOME_ACCOUNT_ID="home_account_id",e.UPN="UPN"}(Te||(Te={}));
|
|
48
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
49
|
+
var Ae,_e=function(){function e(e){var t,r,n,o,i,a,s,c,u,h,l,p,g,f;this.config=(n=(t=e).authOptions,o=t.systemOptions,i=t.loggerOptions,a=t.storageInterface,s=t.networkInterface,c=t.cryptoInterface,u=t.clientCredentials,h=t.libraryInfo,l=t.serverTelemetryManager,p=t.persistencePlugin,g=t.serializableCache,f=d(d({},me),i),{authOptions:(r=n,d({clientCapabilities:[]},r)),systemOptions:d(d({},ye),o),loggerOptions:f,storageInterface:a||new fe(n.clientId,$),networkInterface:s||Ee,cryptoInterface:c||$,clientCredentials:u||Ce,libraryInfo:d(d({},ve),h),serverTelemetryManager:l||null,persistencePlugin:p||null,serializableCache:g||null}),this.logger=new oe(this.config.loggerOptions,"@azure/msal-common",ie),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Ie(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority}return e.prototype.createTokenRequestHeaders=function(e){var t={};if(t[g.CONTENT_TYPE]=v.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Te.HOME_ACCOUNT_ID:try{var r=he(e.credential);t[g.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:t[g.CCS_HEADER]="UPN: "+e.credential}return t},e.prototype.executePostToTokenEndpoint=function(e,t,r,n){return h(this,void 0,void 0,(function(){var o;return l(this,(function(i){switch(i.label){case 0:return[4,this.networkManager.sendPostRequest(n,e,{body:t,headers:r})];case 1:return o=i.sent(),this.config.serverTelemetryManager&&o.status<500&&429!==o.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}}))}))},e.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw te.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},e}(),be=function(){function e(){}return e.validateRedirectUri=function(e){if(re.isEmpty(e))throw ce.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in w)t.push(w[r]);if(t.indexOf(e)<0)throw ce.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw ce.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(re.isEmpty(e)||re.isEmpty(t))throw ce.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if([N.PLAIN,N.S256].indexOf(e)<0)throw ce.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach((function(t,r){e[r]&&delete e[r]})),e):{}},e}(),Re=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(m.RESPONSE_TYPE,encodeURIComponent(v.CODE_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(m.RESPONSE_MODE,encodeURIComponent(e||I.QUERY))},t.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=t?p(e||[],C):e||[],n=new ue(r);this.parameters.set(m.SCOPE,encodeURIComponent(n.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(m.CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e){be.validateRedirectUri(e),this.parameters.set(m.REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){be.validateRedirectUri(e),this.parameters.set(m.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(m.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(S.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(S.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(g.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(g.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(S.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);be.validateClaims(r),this.parameters.set(m.CLAIMS,encodeURIComponent(r))},t.prototype.addCorrelationId=function(e){this.parameters.set(m.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(m.X_CLIENT_SKU,e.sku),this.parameters.set(m.X_CLIENT_VER,e.version),this.parameters.set(m.X_CLIENT_OS,e.os),this.parameters.set(m.X_CLIENT_CPU,e.cpu)},t.prototype.addPrompt=function(e){be.validatePrompt(e),this.parameters.set(""+m.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){re.isEmpty(e)||this.parameters.set(m.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(m.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,t){if(be.validateCodeChallengeParams(e,t),!e||!t)throw ce.createInvalidCodeChallengeParamsError();this.parameters.set(m.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(m.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},t.prototype.addAuthorizationCode=function(e){this.parameters.set(m.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(m.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(m.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(m.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(m.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){this.parameters.set(m.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){this.parameters.set(m.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(m.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(m.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(m.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},t.prototype.addExtraQueryParameters=function(e){var t=this;be.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach((function(r){t.parameters.set(r,e[r])}))},t.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw ce.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(E.ACCESS_TOKEN)||(r[E.ACCESS_TOKEN]={}),r[E.ACCESS_TOKEN][E.XMS_CC]={values:t}),JSON.stringify(r)},t.prototype.addUsername=function(e){this.parameters.set(K.username,e)},t.prototype.addPassword=function(e){this.parameters.set(K.password,e)},t.prototype.addPopToken=function(t){re.isEmpty(t)||(this.parameters.set(m.TOKEN_TYPE,e.AuthenticationScheme.POP),this.parameters.set(m.REQ_CNF,encodeURIComponent(t)))},t.prototype.addSshJwk=function(t){re.isEmpty(t)||(this.parameters.set(m.TOKEN_TYPE,e.AuthenticationScheme.SSH),this.parameters.set(m.REQ_CNF,encodeURIComponent(t)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(m.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(m.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(m.X_MS_LIB_CAPABILITY,Y)},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach((function(t,r){e.push(r+"="+t)})),e.join("&")},t}(),Oe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.createIdTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.credentialType=R.ID_TOKEN,s.homeAccountId=e,s.environment=r,s.clientId=o,s.secret=n,s.realm=i,s.oboAssertion=a,s},t.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===R.ID_TOKEN)},t}(ae),ke=function(){function e(){}return e.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},e.isTokenExpired=function(t,r){var n=Number(t)||0;return e.nowSeconds()+r>n},e.wasClockTurnedBack=function(t){return Number(t)>e.nowSeconds()},e.delay=function(e,t){return new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))},e}(),Ne=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return u(r,t),r.createAccessTokenEntity=function(t,n,o,i,a,s,c,u,d,h,l,p,g){var f,y=new r;y.homeAccountId=t,y.credentialType=R.ACCESS_TOKEN,y.secret=o;var m=ke.nowSeconds();if(y.cachedAt=m.toString(),y.expiresOn=c.toString(),y.extendedExpiresOn=u.toString(),h&&(y.refreshOn=h.toString()),y.environment=n,y.clientId=i,y.realm=a,y.target=s,y.oboAssertion=p,y.tokenType=re.isEmpty(l)?e.AuthenticationScheme.BEARER:l,y.tokenType!==e.AuthenticationScheme.BEARER)switch(y.credentialType=R.ACCESS_TOKEN_WITH_AUTH_SCHEME,y.tokenType){case e.AuthenticationScheme.POP:var E=pe.extractTokenClaims(o,d);if(!(null===(f=null==E?void 0:E.cnf)||void 0===f?void 0:f.kid))throw te.createTokenClaimsRequiredError();y.keyId=E.cnf.kid;break;case e.AuthenticationScheme.SSH:y.keyId=g}return y},r.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===R.ACCESS_TOKEN||e.credentialType===R.ACCESS_TOKEN_WITH_AUTH_SCHEME))},r}(ae),Pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.createRefreshTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.clientId=o,s.credentialType=R.REFRESH_TOKEN,s.environment=r,s.homeAccountId=e,s.secret=n,s.oboAssertion=a,i&&(s.familyId=i),s},t.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===R.REFRESH_TOKEN)},t}(ae),Ue=["interaction_required","consent_required","login_required"],Me=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Le={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."}},De=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="InteractionRequiredAuthError",Object.setPrototypeOf(i,t.prototype),i}return u(t,e),t.isInteractionRequiredError=function(e,t,r){var n=!!e&&Ue.indexOf(e)>-1,o=!!r&&Me.indexOf(r)>-1,i=!!t&&Ue.some((function(e){return t.indexOf(e)>-1}));return n||i||o},t.createNoTokensFoundError=function(){return new t(Le.noTokensFoundError.code,Le.noTokensFoundError.desc)},t}(Z),qe=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null},He=function(){function e(){}return e.setRequestState=function(t,r,n){var o=e.generateLibraryState(t,n);return re.isEmpty(r)?o:""+o+v.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t){if(!e)throw te.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var n=JSON.stringify(r);return e.base64Encode(n)},e.parseRequestState=function(e,t){if(!e)throw te.createNoCryptoObjectError("parseRequestState");if(re.isEmpty(t))throw te.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(v.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(v.RESOURCE_DELIM):"",i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:re.isEmpty(o)?"":o,libraryState:a}}catch(e){throw te.createInvalidStateError(t,e)}},e}(),Ke=function(){function e(t){if(this._urlString=t,re.isEmpty(this._urlString))throw ce.createUrlEmptyError();re.isEmpty(this.getHash())&&(this._urlString=e.canonicalizeUri(t))}return Object.defineProperty(e.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),e.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return re.endsWith(t,"?")?t=t.slice(0,-1):re.endsWith(t,"?/")&&(t=t.slice(0,-2)),re.endsWith(t,"/")||(t+="/"),t}return e},e.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw ce.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw ce.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw ce.createInsecureAuthorityUriError(this.urlString)},e.appendQueryString=function(e,t){return re.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},e.removeHashFromUrl=function(t){return e.canonicalizeUri(t.split("#")[0])},e.prototype.replaceTenantPath=function(t){var r=this.getUrlComponents(),n=r.PathSegments;return!t||0===n.length||n[0]!==y.COMMON&&n[0]!==y.ORGANIZATIONS||(n[0]=t),e.constructAuthorityUriFromObject(r)},e.prototype.getHash=function(){return e.parseHash(this.urlString)},e.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw ce.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},n=r.AbsolutePath.split("/");return n=n.filter((function(e){return e&&e.length>0})),r.PathSegments=n,!re.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},e.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw ce.createUrlParseError("Given url string: "+e);return r[2]},e.getAbsoluteUrl=function(t,r){if(t[0]===v.FORWARD_SLASH){var n=new e(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t},e.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):""},e.constructAuthorityUriFromObject=function(t){return new e(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"))},e.getDeserializedHash=function(t){if(re.isEmpty(t))return{};var r=e.parseHash(t),n=re.queryStringToObject(re.isEmpty(r)?t:r);if(!n)throw te.createHashNotDeserializedError(JSON.stringify(n));return n},e.hashContainsKnownProperties=function(t){if(re.isEmpty(t)||t.indexOf("=")<0)return!1;var r=e.getDeserializedHash(t);return!!(r.code||r.error_description||r.error||r.state)},e}();
|
|
50
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */!function(e){e.SW="sw",e.UHW="uhw"}(Ae||(Ae={}));var Fe,xe=function(){function e(e){this.cryptoUtils=e}return e.prototype.generateCnf=function(e){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return[4,this.generateKid(e)];case 1:return t=r.sent(),[2,this.cryptoUtils.base64Encode(JSON.stringify(t))]}}))}))},e.prototype.generateKid=function(e){return h(this,void 0,void 0,(function(){return l(this,(function(t){switch(t.label){case 0:return[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return[2,{kid:t.sent(),xms_ksl:Ae.SW}]}}))}))},e.prototype.signPopToken=function(e,t){var r;return h(this,void 0,void 0,(function(){var n;return l(this,(function(o){if(n=pe.extractTokenClaims(e,this.cryptoUtils),!(null===(r=null==n?void 0:n.cnf)||void 0===r?void 0:r.kid))throw te.createTokenClaimsRequiredError();return[2,this.signPayload(e,n.cnf.kid,t)]}))}))},e.prototype.signPayload=function(e,t,r,n){return h(this,void 0,void 0,(function(){var o,i,a,s,c,u;return l(this,(function(h){switch(h.label){case 0:return o=r.resourceRequestMethod,i=r.resourceRequestUri,a=r.shrClaims,s=r.shrNonce,c=i?new Ke(i):void 0,u=null==c?void 0:c.getUrlComponents(),[4,this.cryptoUtils.signJwt(d({at:e,ts:ke.nowSeconds(),m:null==o?void 0:o.toUpperCase(),u:null==u?void 0:u.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:null==u?void 0:u.AbsolutePath,q:(null==u?void 0:u.QueryString)?[[],u.QueryString]:void 0,client_claims:a||void 0},n),t)];case 1:return[2,h.sent()]}}))}))},e}(),Be=function(){function e(){}return e.prototype.generateAppMetadataKey=function(){return e.generateAppMetadataCacheKey(this.environment,this.clientId)},e.generateAppMetadataCacheKey=function(e,t){return[U,e,t].join(b.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAppMetadataEntity=function(t,r,n){var o=new e;return o.clientId=t,o.environment=r,n&&(o.familyId=n),o},e.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(U)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},e}(),Ge=function(){function e(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(e.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),e}(),je=function(){function t(e,t,r,n,o,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i}return t.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?te.createStateNotFoundError("Cached State"):te.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw te.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(De.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new De(e.error||v.EMPTY_STRING,e.error_description,e.suberror);throw new Se(e.error||v.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&de(e.client_info,r)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(De.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new De(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Se(e.error,t,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,o,i,a,s){return h(this,void 0,void 0,(function(){var c,u,d,h,p;return l(this,(function(l){switch(l.label){case 0:if(e.id_token&&(c=new pe(e.id_token||v.EMPTY_STRING,this.cryptoObj),i&&!re.isEmpty(i.nonce)&&c.claims.nonce!==i.nonce))throw te.createNonceMismatchError();this.homeAccountIdentifier=le.generateHomeAccountId(e.client_info||v.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,c),i&&i.state&&(u=He.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0,d=this.generateCacheRecord(e,r,n,c,o.scopes,a,i),l.label=1;case 1:return l.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),h=new Ge(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(h)]):[3,3];case 2:l.sent(),l.label=3;case 3:return!s||!d.account||(p=d.account.generateAccountKey(),this.cacheStorage.getAccount(p))?[4,this.cacheStorage.saveCacheRecord(d)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,c,u)]);case 4:return l.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&h?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(h)]):[3,7];case 6:l.sent(),l.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,o,c,u)]}}))}))},t.prototype.generateCacheRecord=function(e,t,r,n,o,i,a){var s,c,u=t.getPreferredCache();if(re.isEmpty(u))throw te.createInvalidCacheEnvironmentError();!re.isEmpty(e.id_token)&&n&&(s=Oe.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||v.EMPTY_STRING,this.clientId,n.claims.tid||v.EMPTY_STRING,i),c=this.generateAccountEntity(e,n,t,i,a));var d=null;if(!re.isEmpty(e.access_token)){var h=e.scope?ue.fromString(e.scope):new ue(o||[]),l=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,p=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,g=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,f=r+l,y=f+p,m=g&&g>0?r+g:void 0;d=Ne.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||v.EMPTY_STRING,this.clientId,n?n.claims.tid||v.EMPTY_STRING:t.tenant,h.printScopes(),f,y,this.cryptoObj,m,e.token_type,i,e.key_id)}var E=null;re.isEmpty(e.refresh_token)||(E=Pe.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||v.EMPTY_STRING,this.clientId,e.foci,i));var C=null;return re.isEmpty(e.foci)||(C=Be.createAppMetadataEntity(this.clientId,u,e.foci)),new qe(c,s,d,E,C)},t.prototype.generateAccountEntity=function(e,t,r,n,o){var i=r.authorityType,a=o?o.cloud_graph_host_name:"",s=o?o.msgraph_host:"";if(i===ne.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),le.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s);if(re.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw te.createClientInfoEmptyError();return e.client_info?le.createAccount(e.client_info,this.homeAccountIdentifier,t,r,n,a,s):le.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s)},t.generateAuthenticationResult=function(t,r,n,o,i,a,s){var c,u,d;return h(this,void 0,void 0,(function(){var h,p,g,f,y,m,E;return l(this,(function(l){switch(l.label){case 0:return h="",p=[],g=null,y=v.EMPTY_STRING,n.accessToken?n.accessToken.tokenType!==e.AuthenticationScheme.POP?[3,2]:[4,new xe(t).signPopToken(n.accessToken.secret,i)]:[3,4];case 1:return h=l.sent(),[3,3];case 2:h=n.accessToken.secret,l.label=3;case 3:p=ue.fromString(n.accessToken.target).asArray(),g=new Date(1e3*Number(n.accessToken.expiresOn)),f=new Date(1e3*Number(n.accessToken.extendedExpiresOn)),l.label=4;case 4:return n.appMetadata&&(y=n.appMetadata.familyId===M?M:v.EMPTY_STRING),m=(null==a?void 0:a.claims.oid)||(null==a?void 0:a.claims.sub)||v.EMPTY_STRING,E=(null==a?void 0:a.claims.tid)||v.EMPTY_STRING,[2,{authority:r.canonicalAuthority,uniqueId:m,tenantId:E,scopes:p,account:n.account?n.account.getAccountInfo():null,idToken:a?a.rawToken:v.EMPTY_STRING,idTokenClaims:a?a.claims:{},accessToken:h,fromCache:o,expiresOn:g,correlationId:i.correlationId,extExpiresOn:f,familyId:y,tokenType:(null===(c=n.accessToken)||void 0===c?void 0:c.tokenType)||v.EMPTY_STRING,state:s?s.userRequestState:v.EMPTY_STRING,cloudGraphHostName:(null===(u=n.account)||void 0===u?void 0:u.cloudGraphHostName)||v.EMPTY_STRING,msGraphHost:(null===(d=n.account)||void 0===d?void 0:d.msGraphHost)||v.EMPTY_STRING}]}}))}))},t}(),ze=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.getAuthCodeUrl=function(e){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){return t=this.createAuthCodeUrlQueryString(e),[2,Ke.appendQueryString(this.authority.authorizationEndpoint,t)]}))}))},r.prototype.acquireToken=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o;return l(this,(function(i){switch(i.label){case 0:if(this.logger.info("in acquireToken call"),!e||re.isEmpty(e.code))throw te.createTokenRequestCannotBeMadeError();return r=ke.nowSeconds(),[4,this.executeTokenRequest(this.authority,e)];case 1:return n=i.sent(),(o=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(n.body),[4,o.handleServerTokenResponse(n.body,this.authority,r,e,t)];case 2:return[2,i.sent()]}}))}))},r.prototype.handleFragmentResponse=function(e,t){var r=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new Ke(e),o=Ke.getDeserializedHash(n.getHash());if(r.validateServerAuthorizationCodeResponse(o,t,this.cryptoUtils),!o.code)throw te.createNoAuthCodeInServerResponseError();return d(d({},o),{code:o.code})},r.prototype.getLogoutUri=function(e){if(!e)throw ce.createEmptyLogoutRequestError();var t=this.createLogoutUrlQueryString(e);return Ke.appendQueryString(this.authority.endSessionEndpoint,t)},r.prototype.executeTokenRequest=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return l(this,(function(u){switch(u.label){case 0:return r={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshJwk:t.sshJwk,sshKid:t.sshKid},[4,this.createTokenRequestBody(t)];case 1:if(n=u.sent(),o=this.createTokenQueryParameters(t),i=void 0,t.clientInfo)try{a=de(t.clientInfo,this.cryptoUtils),i={credential:""+a.uid+b.CLIENT_INFO_SEPARATOR+a.utid,type:Te.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return s=this.createTokenRequestHeaders(i||t.ccsCredential),c=re.isEmpty(o)?e.tokenEndpoint:e.tokenEndpoint+"?"+o,[2,this.executePostToTokenEndpoint(c,n,s,r)]}}))}))},r.prototype.createTokenQueryParameters=function(e){var t=new Re;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r.prototype.createTokenRequestBody=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s;return l(this,(function(c){switch(c.label){case 0:return(r=new Re).addClientId(this.config.authOptions.clientId),r.addRedirectUri(t.redirectUri),r.addScopes(t.scopes),r.addAuthorizationCode(t.code),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&r.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(n=this.config.clientCredentials.clientAssertion,r.addClientAssertion(n.assertion),r.addClientAssertionType(n.assertionType)),r.addGrantType(A.AUTHORIZATION_CODE_GRANT),r.addClientInfo(),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:[4,new xe(this.cryptoUtils).generateCnf(t)];case 1:return o=c.sent(),r.addPopToken(o),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ce.createMissingSshJwkError();r.addSshJwk(t.sshJwk)}c.label=3;case 3:if(i=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(i),(!re.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),a=void 0,t.clientInfo)try{s=de(t.clientInfo,this.cryptoUtils),a={credential:""+s.uid+b.CLIENT_INFO_SEPARATOR+s.utid,type:Te.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else a=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&a)switch(a.type){case Te.HOME_ACCOUNT_ID:try{s=he(a.credential),r.addCcsOid(s)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:r.addCcsUpn(a.credential)}return[2,r.createQueryString()]}}))}))},r.prototype.createAuthCodeUrlQueryString=function(e){var t=new Re;t.addClientId(this.config.authOptions.clientId);var r=p(e.scopes||[],e.extraScopesToConsent||[]);t.addScopes(r),t.addRedirectUri(e.redirectUri);var n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==w.SELECT_ACCOUNT)if(e.sid&&e.prompt===w.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){var o=this.extractAccountSid(e.account),i=this.extractLoginHint(e.account);if(i){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(i);try{var a=he(e.account.homeAccountId);t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(o&&e.prompt===w.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(o);try{a=he(e.account.homeAccountId);t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{a=he(e.account.homeAccountId);t.addCcsOid(a)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(!re.isEmpty(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},r.prototype.createLogoutUrlQueryString=function(e){var t=new Re;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},r.prototype.extractAccountSid=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.sid)||null},r.prototype.extractLoginHint=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.login_hint)||null},r}(_e),We=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.acquireToken=function(e){return h(this,void 0,void 0,(function(){var t,r,n;return l(this,(function(o){switch(o.label){case 0:return t=ke.nowSeconds(),[4,this.executeTokenRequest(e,this.authority)];case 1:return r=o.sent(),(n=new je(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),[2,n.handleServerTokenResponse(r.body,this.authority,t,e,void 0,void 0,!0)]}}))}))},r.prototype.acquireTokenByRefreshToken=function(e){return h(this,void 0,void 0,(function(){var t,r;return l(this,(function(n){if(!e)throw ce.createEmptyTokenRequestError();if(!e.account)throw te.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment,this.config.authOptions.clientId))try{return[2,this.acquireTokenWithCachedRefreshToken(e,!0)]}catch(n){if(t=n instanceof De&&n.errorCode===Le.noTokensFoundError.code,r=n instanceof Se&&n.errorCode===J&&n.subError===Q,t||r)return[2,this.acquireTokenWithCachedRefreshToken(e,!1)];throw n}return[2,this.acquireTokenWithCachedRefreshToken(e,!1)]}))}))},r.prototype.acquireTokenWithCachedRefreshToken=function(t,r){return h(this,void 0,void 0,(function(){var n,o;return l(this,(function(i){if(!(n=this.cacheManager.readRefreshTokenFromCache(this.config.authOptions.clientId,t.account,r)))throw De.createNoTokensFoundError();return o=d(d({},t),{refreshToken:n.secret,authenticationScheme:t.authenticationScheme||e.AuthenticationScheme.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:Te.HOME_ACCOUNT_ID}}),[2,this.acquireToken(o)]}))}))},r.prototype.executeTokenRequest=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o,i,a;return l(this,(function(s){switch(s.label){case 0:return[4,this.createTokenRequestBody(e)];case 1:return r=s.sent(),n=this.createTokenQueryParameters(e),o=this.createTokenRequestHeaders(e.ccsCredential),i={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshJwk:e.sshJwk,sshKid:e.sshKid},a=Ke.appendQueryString(t.tokenEndpoint,n),[2,this.executePostToTokenEndpoint(a,r,o,i)]}}))}))},r.prototype.createTokenQueryParameters=function(e){var t=new Re;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},r.prototype.createTokenRequestBody=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a;return l(this,(function(s){switch(s.label){case 0:return(r=new Re).addClientId(this.config.authOptions.clientId),r.addScopes(t.scopes),r.addGrantType(A.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),n=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(n),r.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(o=this.config.clientCredentials.clientAssertion,r.addClientAssertion(o.assertion),r.addClientAssertionType(o.assertionType)),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:[4,new xe(this.cryptoUtils).generateCnf(t)];case 1:return i=s.sent(),r.addPopToken(i),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ce.createMissingSshJwkError();r.addSshJwk(t.sshJwk)}s.label=3;case 3:if((!re.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case Te.HOME_ACCOUNT_ID:try{a=he(t.ccsCredential.credential),r.addCcsOid(a)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Te.UPN:r.addCcsUpn(t.ccsCredential.credential)}return[2,r.createQueryString()]}}))}))},r}(_e),Ye=function(t){function r(e){return t.call(this,e)||this}return u(r,t),r.prototype.acquireToken=function(e){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.acquireCachedToken(e)];case 1:return[2,r.sent()];case 2:if((t=r.sent())instanceof te&&t.errorCode===ee.tokenRefreshRequired.code)return[2,new We(this.config).acquireTokenByRefreshToken(e)];throw t;case 3:return[2]}}))}))},r.prototype.acquireCachedToken=function(t){var r,n,o,i;return h(this,void 0,void 0,(function(){var a,s,c,u;return l(this,(function(d){switch(d.label){case 0:if(!t)throw ce.createEmptyTokenRequestError();if(t.forceRefresh)throw null===(r=this.serverTelemetryManager)||void 0===r||r.setCacheOutcome(G.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),te.createRefreshRequiredError();if(!re.isEmptyObj(t.claims))throw this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because claims are requested."),te.createRefreshRequiredError();if(!t.account)throw te.createNoAccountInSilentRequestError();if(a=new ue(t.scopes||[]),s=t.authority||this.authority.getPreferredCache(),c=t.authenticationScheme||e.AuthenticationScheme.BEARER,!(u=this.cacheManager.readCacheRecord(t.account,this.config.authOptions.clientId,a,s,c,t.sshKid)).accessToken)throw null===(n=this.serverTelemetryManager)||void 0===n||n.setCacheOutcome(G.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),te.createRefreshRequiredError();if(ke.wasClockTurnedBack(u.accessToken.cachedAt)||ke.isTokenExpired(u.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null===(o=this.serverTelemetryManager)||void 0===o||o.setCacheOutcome(G.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),te.createRefreshRequiredError();if(u.accessToken.refreshOn&&ke.isTokenExpired(u.accessToken.refreshOn,0))throw null===(i=this.serverTelemetryManager)||void 0===i||i.setCacheOutcome(G.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),te.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(u,t)];case 1:return[2,d.sent()]}}))}))},r.prototype.generateResultFromCacheRecord=function(e,t){return h(this,void 0,void 0,(function(){var r;return l(this,(function(n){switch(n.label){case 0:return e.idToken&&(r=new pe(e.idToken.secret,this.config.cryptoInterface)),[4,je.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)];case 1:return[2,n.sent()]}}))}))},r}(_e);
|
|
51
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
52
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
53
|
+
function Je(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")}
|
|
54
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */e.ProtocolMode=void 0,(Fe=e.ProtocolMode||(e.ProtocolMode={})).AAD="AAD",Fe.OIDC="OIDC";
|
|
55
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
56
|
+
var Qe=function(){function e(){this.expiresAt=ke.nowSeconds()+D}return e.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},e.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t},e.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},e.prototype.resetExpiresAt=function(){this.expiresAt=ke.nowSeconds()+D},e.prototype.isExpired=function(){return this.expiresAt<=ke.nowSeconds()},e.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(L)&&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"))},e}();
|
|
57
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
58
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */
|
|
59
|
+
var Ve,Xe,Ze,$e,et,tt,rt,nt=function(){function e(e){this.networkInterface=e}return e.prototype.detectRegion=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o,i;return l(this,(function(a){switch(a.label){case 0:if(r=e)return[3,8];a.label=1;case 1:return a.trys.push([1,6,,7]),[4,this.getRegionFromIMDS(v.IMDS_VERSION)];case 2:return(n=a.sent()).status===F.httpSuccess&&(r=n.body,t.region_source=x.IMDS),n.status!==F.httpBadRequest?[3,5]:[4,this.getCurrentVersion()];case 3:return(o=a.sent())?[4,this.getRegionFromIMDS(o)]:(t.region_source=x.FAILED_AUTO_DETECTION,[2,null]);case 4:(i=a.sent()).status===F.httpSuccess&&(r=i.body,t.region_source=x.IMDS),a.label=5;case 5:return[3,7];case 6:return a.sent(),t.region_source=x.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:t.region_source=x.ENVIRONMENT_VARIABLE,a.label=9;case 9:return r||(t.region_source=x.FAILED_AUTO_DETECTION),[2,r||null]}}))}))},e.prototype.getRegionFromIMDS=function(t){return h(this,void 0,void 0,(function(){return l(this,(function(r){return[2,this.networkInterface.sendGetRequestAsync(v.IMDS_ENDPOINT+"?api-version="+t+"&format=text",e.IMDS_OPTIONS,v.IMDS_TIMEOUT)]}))}))},e.prototype.getCurrentVersion=function(){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(v.IMDS_ENDPOINT+"?format=json",e.IMDS_OPTIONS)];case 1:return(t=r.sent()).status===F.httpBadRequest&&t.body&&t.body["newest-versions"]&&t.body["newest-versions"].length>0?[2,t.body["newest-versions"][0]]:[2,null];case 2:return r.sent(),[2,null];case 3:return[2]}}))}))},e.IMDS_OPTIONS={headers:{Metadata:"true"}},e}(),ot=function(){function t(e,t,r,n){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscovery=new nt(t),this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0}}return Object.defineProperty(t.prototype,"authorityType",{get:function(){var e=this.canonicalAuthorityUrlComponents.PathSegments;return e.length&&e[0].toLowerCase()===v.ADFS?ne.Adfs:ne.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Ke(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw te.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),t.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},t.prototype.replacePath=function(e){var t=e,r=new Ke(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((function(e,n){var o=r[n];e!==o&&(t=t.replace("/"+o+"/","/"+e+"/"))})),t},Object.defineProperty(t.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===ne.Adfs||this.protocolMode===e.ProtocolMode.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),t.prototype.discoveryComplete=function(){return!!this.metadata},t.prototype.resolveEndpointsAsync=function(){return h(this,void 0,void 0,(function(){var e,t,r,n;return l(this,(function(o){switch(o.label){case 0:return(e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(e=new Qe).updateCanonicalAuthority(this.canonicalAuthority),[4,this.updateCloudDiscoveryMetadata(e)];case 1:return t=o.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network),[4,this.updateEndpointMetadata(e)];case 2:return r=o.sent(),t!==P.CACHE&&r!==P.CACHE&&(e.resetExpiresAt(),e.updateCanonicalAuthority(this.canonicalAuthority)),n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache),this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e,[2]}}))}))},t.prototype.updateEndpointMetadata=function(e){var r;return h(this,void 0,void 0,(function(){var n,o,i;return l(this,(function(a){switch(a.label){case 0:return(n=this.getEndpointMetadataFromConfig())?(e.updateEndpointMetadata(n,!1),[2,P.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,P.CACHE]:[4,this.getEndpointMetadataFromNetwork()];case 1:return(n=a.sent())?(null===(r=this.authorityOptions.azureRegionConfiguration)||void 0===r?void 0:r.azureRegion)?[4,this.regionDiscovery.detectRegion(this.authorityOptions.azureRegionConfiguration.environmentRegion,this.regionDiscoveryMetadata)]:[3,3]:[3,4];case 2:o=a.sent(),i=this.authorityOptions.azureRegionConfiguration.azureRegion===v.AZURE_REGION_AUTO_DISCOVER_FLAG?o:this.authorityOptions.azureRegionConfiguration.azureRegion,this.authorityOptions.azureRegionConfiguration.azureRegion===v.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=o?B.AUTO_DETECTION_REQUESTED_SUCCESSFUL:B.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=o?this.authorityOptions.azureRegionConfiguration.azureRegion===o?B.CONFIGURED_MATCHES_DETECTED:B.CONFIGURED_NOT_DETECTED:B.CONFIGURED_NO_AUTO_DETECTION,i&&(this.regionDiscoveryMetadata.region_used=i,n=t.replaceWithRegionalInformation(n,i)),a.label=3;case 3:return e.updateEndpointMetadata(n,!0),[2,P.NETWORK];case 4:throw te.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}}))}))},t.prototype.isAuthoritySameType=function(e){return new Ke(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},t.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw ce.createInvalidAuthorityMetadataError()}return null},t.prototype.getEndpointMetadataFromNetwork=function(){return h(this,void 0,void 0,(function(){var e;return l(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint)];case 1:return[2,Je((e=t.sent()).body)?e.body:null];case 2:return t.sent(),[2,null];case 3:return[2]}}))}))},t.prototype.updateCloudDiscoveryMetadata=function(e){return h(this,void 0,void 0,(function(){var t;return l(this,(function(r){switch(r.label){case 0:return(t=this.getCloudDiscoveryMetadataFromConfig())?(e.updateCloudDiscoveryMetadata(t,!1),[2,P.CONFIG]):this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!e.isExpired()?[2,P.CACHE]:[4,this.getCloudDiscoveryMetadataFromNetwork()];case 1:if(t=r.sent())return e.updateCloudDiscoveryMetadata(t,!0),[2,P.NETWORK];throw ce.createUntrustedAuthorityError()}}))}))},t.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityOptions.cloudDiscoveryMetadata)try{var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=t.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(r)return r}catch(e){throw ce.createInvalidCloudDiscoveryMetadataError()}return this.isInKnownAuthorities()?t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort):null},t.prototype.getCloudDiscoveryMetadataFromNetwork=function(){return h(this,void 0,void 0,(function(){var e,r,n,o;return l(this,(function(i){switch(i.label){case 0:e=""+v.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",r=null,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(e)];case 2:return n=i.sent(),0===(o=function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")}(n.body)?n.body.metadata:[]).length?[2,null]:(r=t.getCloudDiscoveryMetadataFromNetworkResponse(o,this.hostnameAndPort),[3,4]);case 3:return i.sent(),[2,null];case 4:return r||(r=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,r]}}))}))},t.prototype.isInKnownAuthorities=function(){var e=this;return this.authorityOptions.knownAuthorities.filter((function(t){return Ke.getDomainFromUrl(t).toLowerCase()===e.hostnameAndPort})).length>0},t.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},t.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.aliases.indexOf(t)>-1)return n}return null},t.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw te.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},t.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},t.isPublicCloudAuthority=function(e){return v.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},t.buildRegionalAuthorityString=function(e,t,r){var n=new Ke(e);n.validateAsUri();var o=n.getUrlComponents(),i=t+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=t+"."+v.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=Ke.constructAuthorityUriFromObject(d(d({},n.getUrlComponents()),{HostNameAndPort:i})).urlString;return r?a+"?"+r:a},t.replaceWithRegionalInformation=function(e,r){return e.authorization_endpoint=t.buildRegionalAuthorityString(e.authorization_endpoint,r),e.token_endpoint=t.buildRegionalAuthorityString(e.token_endpoint,r,"allowestsrnonmsi=true"),e.end_session_endpoint&&(e.end_session_endpoint=t.buildRegionalAuthorityString(e.end_session_endpoint,r)),e},t}(),it=function(){function e(){}return e.createDiscoveredInstance=function(t,r,n,o){return h(this,void 0,void 0,(function(){var i,a;return l(this,(function(s){switch(s.label){case 0:i=e.createInstance(t,r,n,o),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,i.resolveEndpointsAsync()];case 2:return s.sent(),[2,i];case 3:throw a=s.sent(),te.createEndpointDiscoveryIncompleteError(a);case 4:return[2]}}))}))},e.createInstance=function(e,t,r,n){if(re.isEmpty(e))throw ce.createUrlEmptyError();return new ot(e,t,r,n)},e}(),at=function(){function e(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return e.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(H.CACHE_KEY),n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n},e}(),st=function(){function e(){}return e.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(W));var n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n},e}(),ct={sendGetRequestAsync:function(){return Promise.reject(Z.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(Z.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},ut=function(){function e(e){this.headers=e}return e.prototype.getShrNonce=function(){var e=this.headers[g.AuthenticationInfo];if(e){var t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw ce.createInvalidAuthenticationHeaderError(g.AuthenticationInfo,"nextnonce challenge is missing.")}var r=this.headers[g.WWWAuthenticate];if(r){var n=this.parseChallenges(r);if(n.nonce)return n.nonce;throw ce.createInvalidAuthenticationHeaderError(g.WWWAuthenticate,"nonce challenge is missing.")}throw ce.createMissingNonceAuthenticationHeadersError()},e.prototype.parseChallenges=function(e){var t=e.indexOf(" "),r=e.substr(t+1).split(","),n={};return r.forEach((function(e){var t=e.split("="),r=t[0],o=t[1];n[r]=unescape(o.replace(/['"]+/g,""))})),n},e}(),dt=function(){function e(e,t){this.cacheOutcome=G.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||v.EMPTY_STRING,this.wrapperVer=e.wrapperVer||v.EMPTY_STRING,this.telemetryCacheKey=H.CACHE_KEY+b.CACHE_KEY_SEPARATOR+e.clientId}return e.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+H.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(H.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(H.VALUE_SEPARATOR);return[H.SCHEMA_VERSION,r,t].join(H.CATEGORY_SEPARATOR)},e.prototype.generateLastRequestHeaderValue=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t),n=t.failedRequests.slice(0,2*r).join(H.VALUE_SEPARATOR),o=t.errors.slice(0,r).join(H.VALUE_SEPARATOR),i=t.errors.length,a=[i,r<i?H.OVERFLOW_TRUE:H.OVERFLOW_FALSE].join(H.VALUE_SEPARATOR);return[H.SCHEMA_VERSION,t.cacheHits,n,o,a].join(H.CATEGORY_SEPARATOR)},e.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=H.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),re.isEmpty(e.subError)?re.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(H.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new at;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t);if(r===t.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{var n=new at;n.failedRequests=t.failedRequests.slice(2*r),n.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}},e.maxErrorsToSend=function(e){var t,r=0,n=0,o=e.errors.length;for(t=0;t<o;t++){var i=e.failedRequests[2*t]||v.EMPTY_STRING,a=e.failedRequests[2*t+1]||v.EMPTY_STRING,s=e.errors[t]||v.EMPTY_STRING;if(!((n+=i.toString().length+a.toString().length+s.length+3)<H.MAX_LAST_HEADER_BYTES))break;r+=1}return r},e.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||""),e.push(this.regionSource||""),e.push(this.regionOutcome||""),e.join(",")},e.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},e.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},e}(),ht="invalid_grant",lt=483,pt=600,gt="msal",ft=50,yt="msal.js.browser";
|
|
60
|
+
/*! @azure/msal-common v5.1.2 2022-08-03 */e.BrowserCacheLocation=void 0,(Ve=e.BrowserCacheLocation||(e.BrowserCacheLocation={})).LocalStorage="localStorage",Ve.SessionStorage="sessionStorage",Ve.MemoryStorage="memoryStorage",function(e){e.GET="GET",e.POST="POST"}(Xe||(Xe={})),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",e.SESSION_STATE="session.state",e.REQUEST_STATE="request.state",e.NONCE_IDTOKEN="nonce.id_token",e.ORIGIN_URI="request.origin",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.REQUEST_PARAMS="request.params",e.SCOPES="scopes",e.INTERACTION_STATUS_KEY="interaction.status",e.CCS_CREDENTIAL="ccs.credential",e.CORRELATION_ID="request.correlationId"}(Ze||(Ze={})),function(e){e.WRAPPER_SKU="wrapper.sku",e.WRAPPER_VER="wrapper.version"}($e||($e={})),e.ApiId=void 0,(et=e.ApiId||(e.ApiId={}))[et.acquireTokenRedirect=861]="acquireTokenRedirect",et[et.acquireTokenPopup=862]="acquireTokenPopup",et[et.ssoSilent=863]="ssoSilent",et[et.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",et[et.handleRedirectPromise=865]="handleRedirectPromise",et[et.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",et[et.logout=961]="logout",et[et.logoutPopup=962]="logoutPopup",e.InteractionType=void 0,(tt=e.InteractionType||(e.InteractionType={})).Redirect="redirect",tt.Popup="popup",tt.Silent="silent",e.InteractionStatus=void 0,(rt=e.InteractionStatus||(e.InteractionStatus={})).Startup="startup",rt.Login="login",rt.Logout="logout",rt.AcquireToken="acquireToken",rt.SsoSilent="ssoSilent",rt.HandleRedirect="handleRedirect",rt.None="none";var mt,Et={scopes:C},vt="jwk";e.WrapperSKU=void 0,(mt=e.WrapperSKU||(e.WrapperSKU={})).React="@azure/msal-react",mt.Angular="@azure/msal-angular";var Ct,Tt="msal.db",St=function(){function e(){}return e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e}(),wt=function(){function e(e){this.cryptoObj=e}return e.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,St.decimalToHex(e[0])+St.decimalToHex(e[1])+St.decimalToHex(e[2])+St.decimalToHex(e[3])+"-"+St.decimalToHex(e[4])+St.decimalToHex(e[5])+"-"+St.decimalToHex(e[6])+St.decimalToHex(e[7])+"-"+St.decimalToHex(e[8])+St.decimalToHex(e[9])+"-"+St.decimalToHex(e[10])+St.decimalToHex(e[11])+St.decimalToHex(e[12])+St.decimalToHex(e[13])+St.decimalToHex(e[14])+St.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",n=0,o="",i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(n=16*Math.random()|0),"x"===t[i]?o+=r[n]:"y"===t[i]?(n&=3,o+=r[n|=8]):o+=t[i];return o}},e.isGuid=function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)},e}(),It=function(){function e(){}return e.stringToUtf8Arr=function(e){for(var t,r=0,n=e.length,o=0;o<n;o++)r+=(t=e.charCodeAt(o))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(r),a=0,s=0;a<r;s++)(t=e.charCodeAt(s))<128?i[a++]=t:t<2048?(i[a++]=192+(t>>>6),i[a++]=128+(63&t)):t<65536?(i[a++]=224+(t>>>12),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<2097152?(i[a++]=240+(t>>>18),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<67108864?(i[a++]=248+(t>>>24),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t));return i},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return t},e.utf8ArrToString=function(e){for(var t="",r=void 0,n=e.length,o=0;o<n;o++)r=e[o],t+=String.fromCharCode(r>251&&r<254&&o+5<n?1073741824*(r-252)+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>247&&r<252&&o+4<n?(r-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>239&&r<248&&o+3<n?(r-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>223&&r<240&&o+2<n?(r-224<<12)+(e[++o]-128<<6)+e[++o]-128:r>191&&r<224&&o+1<n?(r-192<<6)+e[++o]-128:r);return t},e}(),At=function(){function e(){}return e.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))},e.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")},e.prototype.encode=function(e){var t=It.stringToUtf8Arr(e);return this.base64EncArr(t)},e.prototype.base64EncArr=function(e){for(var t=(3-e.length%3)%3,r="",n=void 0,o=e.length,i=0,a=0;a<o;a++)n=a%3,i|=e[a]<<(16>>>n&24),2!==n&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0===t?r:r.substring(0,r.length-t)+(1===t?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),_t=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var r=this.base64DecToArr(t);return It.utf8ArrToString(r)},e.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,""),n=r.length,o=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,i=new Uint8Array(o),a=void 0,s=void 0,c=0,u=0,d=0;d<n;d++)if(s=3&d,c|=this.b64ToUint6(r.charCodeAt(d))<<18-6*s,3===s||n-d==1){for(a=0;a<3&&u<o;a++,u++)i[u]=c>>>(16>>>a&24)&255;c=0}return i},e.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e}(),bt={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Code flow is not supported inside an iframe. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."}},Rt=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name="BrowserAuthError",o}return r(t,e),t.createPkceNotGeneratedError=function(e){return new t(bt.pkceNotGenerated.code,bt.pkceNotGenerated.desc+" Detail:"+e)},t.createCryptoNotAvailableError=function(e){return new t(bt.cryptoDoesNotExist.code,bt.cryptoDoesNotExist.desc+" Detail:"+e)},t.createHttpMethodNotImplementedError=function(e){return new t(bt.httpMethodNotImplementedError.code,bt.httpMethodNotImplementedError.desc+" Given Method: "+e)},t.createEmptyNavigationUriError=function(){return new t(bt.emptyNavigateUriError.code,bt.emptyNavigateUriError.desc)},t.createEmptyHashError=function(e){return new t(bt.hashEmptyError.code,bt.hashEmptyError.desc+" Given Url: "+e)},t.createHashDoesNotContainStateError=function(){return new t(bt.hashDoesNotContainStateError.code,bt.hashDoesNotContainStateError.desc)},t.createHashDoesNotContainKnownPropertiesError=function(){return new t(bt.hashDoesNotContainKnownPropertiesError.code,bt.hashDoesNotContainKnownPropertiesError.desc)},t.createUnableToParseStateError=function(){return new t(bt.unableToParseStateError.code,bt.unableToParseStateError.desc)},t.createStateInteractionTypeMismatchError=function(){return new t(bt.stateInteractionTypeMismatchError.code,bt.stateInteractionTypeMismatchError.desc)},t.createInteractionInProgressError=function(){return new t(bt.interactionInProgress.code,bt.interactionInProgress.desc)},t.createPopupWindowError=function(e){var r=bt.popupWindowError.desc;return r=re.isEmpty(e)?r:r+" Details: "+e,new t(bt.popupWindowError.code,r)},t.createEmptyWindowCreatedError=function(){return new t(bt.emptyWindowError.code,bt.emptyWindowError.desc)},t.createUserCancelledError=function(){return new t(bt.userCancelledError.code,bt.userCancelledError.desc)},t.createMonitorPopupTimeoutError=function(){return new t(bt.monitorPopupTimeoutError.code,bt.monitorPopupTimeoutError.desc)},t.createMonitorIframeTimeoutError=function(){return new t(bt.monitorIframeTimeoutError.code,bt.monitorIframeTimeoutError.desc)},t.createRedirectInIframeError=function(e){return new t(bt.redirectInIframeError.code,bt.redirectInIframeError.desc+" (window.parent !== window) => "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(bt.blockTokenRequestsInHiddenIframeError.code,bt.blockTokenRequestsInHiddenIframeError.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(bt.blockAcquireTokenInPopupsError.code,bt.blockAcquireTokenInPopupsError.desc)},t.createIframeClosedPrematurelyError=function(){return new t(bt.iframeClosedPrematurelyError.code,bt.iframeClosedPrematurelyError.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(bt.silentLogoutUnsupportedError.code,bt.silentLogoutUnsupportedError.desc)},t.createNoAccountError=function(){return new t(bt.noAccountError.code,bt.noAccountError.desc)},t.createSilentPromptValueError=function(e){return new t(bt.silentPromptValueError.code,bt.silentPromptValueError.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(bt.unableToParseTokenRequestCacheError.code,bt.unableToParseTokenRequestCacheError.desc)},t.createNoTokenRequestCacheError=function(){return new t(bt.noTokenRequestCacheError.code,bt.noTokenRequestCacheError.desc)},t.createAuthRequestNotSetError=function(){return new t(bt.authRequestNotSet.code,bt.authRequestNotSet.desc)},t.createNoCachedAuthorityError=function(){return new t(bt.noCachedAuthorityError.code,bt.noCachedAuthorityError.desc)},t.createInvalidCacheTypeError=function(){return new t(bt.invalidCacheType.code,""+bt.invalidCacheType.desc)},t.createNonBrowserEnvironmentError=function(){return new t(bt.notInBrowserEnvironment.code,bt.notInBrowserEnvironment.desc)},t.createDatabaseNotOpenError=function(){return new t(bt.databaseNotOpen.code,bt.databaseNotOpen.desc)},t.createNoNetworkConnectivityError=function(){return new t(bt.noNetworkConnectivity.code,bt.noNetworkConnectivity.desc)},t.createPostRequestFailedError=function(e,r){return new t(bt.postRequestFailed.code,bt.postRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createGetRequestFailedError=function(e,r){return new t(bt.getRequestFailed.code,bt.getRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(bt.failedToParseNetworkResponse.code,bt.failedToParseNetworkResponse.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(bt.unableToLoadTokenError.code,bt.unableToLoadTokenError.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(bt.signingKeyNotFoundInStorage.code,bt.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+e)},t.createDatabaseUnavailableError=function(){return new t(bt.databaseUnavailable.code,bt.databaseUnavailable.desc)},t}(Z),Ot=function(){function e(e){this.base64Encode=new At,this.cryptoObj=e}return e.prototype.generateCodes=function(){return o(this,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}}))}))},e.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw Rt.createPkceNotGeneratedError(e)}},e.prototype.generateCodeChallengeFromVerifier=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=n.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=n.sent(),Rt.createPkceNotGeneratedError(r);case 3:return[2]}}))}))},e}(),kt="SHA-256",Nt=new Uint8Array([1,0,1]),Pt=function(){function e(e){if(this.logger=e,!this.hasCryptoAPI())throw Rt.createCryptoNotAvailableError("Browser crypto or msCrypto object not available.");this._keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:kt,modulusLength:2048,publicExponent:Nt}}return e.prototype.sha256Digest=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=It.stringToUtf8Arr(e),[2,this.hasIECrypto()?this.getMSCryptoDigest(kt,t):this.getSubtleCryptoDigest(kt,t)]}))}))},e.prototype.getRandomValues=function(e){var t=window.msCrypto||window.crypto;if(!t.getRandomValues)throw Rt.createCryptoNotAvailableError("getRandomValues does not exist.");t.getRandomValues(e)},e.prototype.generateKeyPair=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoGenerateKey(e,t):window.crypto.subtle.generateKey(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.exportJwk=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,this.hasIECrypto()?this.msCryptoExportJwk(e):window.crypto.subtle.exportKey(vt,e)]}))}))},e.prototype.importJwk=function(t,r,n){return o(this,void 0,void 0,(function(){var o,a;return i(this,(function(i){return o=e.getJwkString(t),a=It.stringToArrayBuffer(o),[2,this.hasIECrypto()?this.msCryptoImportKey(a,r,n):window.crypto.subtle.importKey(vt,t,this._keygenAlgorithmOptions,r,n)]}))}))},e.prototype.sign=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.hasIECrypto()?this.msCryptoSign(e,t):window.crypto.subtle.sign(this._keygenAlgorithmOptions,e,t)]}))}))},e.prototype.hasCryptoAPI=function(){return this.hasIECrypto()||this.hasBrowserCrypto()},e.prototype.hasIECrypto=function(){return"msCrypto"in window},e.prototype.hasBrowserCrypto=function(){return"crypto"in window},e.prototype.getSubtleCryptoDigest=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,window.crypto.subtle.digest(e,t)]}))}))},e.prototype.getMSCryptoDigest=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,new Promise((function(r,n){var o=window.msCrypto.subtle.digest(e,t.buffer);o.addEventListener("complete",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){n(e)}))}))]}))}))},e.prototype.msCryptoGenerateKey=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.generateKey(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.msCryptoExportJwk=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return[2,new Promise((function(t,r){var n=window.msCrypto.subtle.exportKey(vt,e);n.addEventListener("complete",(function(e){var n=e.target.result,o=It.utf8ArrToString(new Uint8Array(n)).replace(/\r/g,"").replace(/\n/g,"").replace(/\t/g,"").split(" ").join("").replace("\0","");try{t(JSON.parse(o))}catch(e){r(e)}})),n.addEventListener("error",(function(e){r(e)}))}))]}))}))},e.prototype.msCryptoImportKey=function(e,t,r){return o(this,void 0,void 0,(function(){var n=this;return i(this,(function(o){return[2,new Promise((function(o,i){var a=window.msCrypto.subtle.importKey(vt,e,n._keygenAlgorithmOptions,t,r);a.addEventListener("complete",(function(e){o(e.target.result)})),a.addEventListener("error",(function(e){i(e)}))}))]}))}))},e.prototype.msCryptoSign=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.sign(r._keygenAlgorithmOptions,e,t);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.getJwkString=function(e){return JSON.stringify(e,Object.keys(e).sort())},e}(),Ut=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(e,{method:Xe.GET,headers:this.getFetchHeaders(t)})];case 1:return r=i.sent(),[3,3];case 2:throw n=i.sent(),window.navigator.onLine?Rt.createGetRequestFailedError(n,e):Rt.createNoNetworkConnectivityError();case 3:return i.trys.push([3,5,,6]),o={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 4:return[2,(o.body=i.sent(),o.status=r.status,o)];case 5:throw i.sent(),Rt.createFailedToParseNetworkResponseError(e);case 6:return[2]}}))}))},e.prototype.sendPostRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:r=t&&t.body||"",i.label=1;case 1:return i.trys.push([1,3,,4]),[4,fetch(e,{method:Xe.POST,headers:this.getFetchHeaders(t),body:r})];case 2:return n=i.sent(),[3,4];case 3:throw o=i.sent(),window.navigator.onLine?Rt.createPostRequestFailedError(o,e):Rt.createNoNetworkConnectivityError();case 4:return i.trys.push([4,6,,7]),a={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 5:return[2,(a.body=i.sent(),a.status=n.status,a)];case 6:throw i.sent(),Rt.createFailedToParseNetworkResponseError(e);case 7:return[2]}}))}))},e.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var r=e.headers;return Object.keys(r).forEach((function(e){t.append(e,r[e])})),t},e.prototype.getHeaderDict=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t},e}(),Mt=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.sendRequestAsync(e,Xe.GET,t)]}))}))},e.prototype.sendPostRequestAsync=function(e,t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return[2,this.sendRequestAsync(e,Xe.POST,t)]}))}))},e.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise((function(o,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),n.setXhrHeaders(a,r),a.onload=function(){(a.status<200||a.status>=300)&&(t===Xe.POST?i(Rt.createPostRequestFailedError("Failed with status "+a.status,e)):i(Rt.createGetRequestFailedError("Failed with status "+a.status,e)));try{var r=JSON.parse(a.responseText),s={headers:n.getHeaderDict(a),body:r,status:a.status};o(s)}catch(t){i(Rt.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===Xe.POST?i(Rt.createPostRequestFailedError("Failed with status "+a.status,e)):i(Rt.createGetRequestFailedError("Failed with status "+a.status,e)):i(Rt.createNoNetworkConnectivityError())},t===Xe.POST&&r&&r.body)a.send(r.body);else{if(t!==Xe.GET)throw Rt.createHttpMethodNotImplementedError(t);a.send()}}))},e.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach((function(t){e.setRequestHeader(t,r[t])}))}},e.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return t.forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&o&&(r[n]=o)})),r},e}(),Lt=function(){function t(){}return t.clearHash=function(e){e.location.hash=v.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,v.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},t.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""},t.isInIframe=function(){return window.parent!==window},t.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(gt+".")},t.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},t.getHomepage=function(){var e=new Ke(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},t.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new Ut:new Mt},t.blockReloadInHiddenIframes=function(){if(Ke.hashContainsKnownProperties(window.location.hash)&&t.isInIframe())throw Rt.createBlockReloadInHiddenIframeError()},t.blockRedirectInIframe=function(r,n){var o=t.isInIframe();if(r===e.InteractionType.Redirect&&o&&!n)throw Rt.createRedirectInIframeError(o)},t.blockAcquireTokenInPopups=function(){if(t.isInPopup())throw Rt.createBlockAcquireTokenInPopupsError()},t.blockNonBrowserEnvironment=function(e){if(!e)throw Rt.createNonBrowserEnvironmentError()},t.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),n=e.indexOf("Edge/");return t>0||r>0||n>0},t}(),Dt={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."}},qt=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="BrowserConfigurationAuthError",Object.setPrototypeOf(o,t.prototype),o}return r(t,e),t.createRedirectUriEmptyError=function(){return new t(Dt.redirectUriNotSet.code,Dt.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(Dt.postLogoutUriNotSet.code,Dt.postLogoutUriNotSet.desc)},t.createStorageNotSupportedError=function(e){return new t(Dt.storageNotSupportedError.code,Dt.storageNotSupportedError.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(Dt.noRedirectCallbacksSet.code,Dt.noRedirectCallbacksSet.desc)},t.createStubPcaInstanceCalledError=function(){return new t(Dt.stubPcaInstanceCalled.code,Dt.stubPcaInstanceCalled.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(Dt.inMemRedirectUnavailable.code,Dt.inMemRedirectUnavailable.desc)},t}(Z),Ht={acquireTokenPopup:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},acquireTokenRedirect:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},acquireTokenSilent:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},getAllAccounts:function(){return[]},getAccountByHomeId:function(){return null},getAccountByUsername:function(){return null},getAccountByLocalId:function(){return null},handleRedirectPromise:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},loginPopup:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},loginRedirect:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},logout:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},logoutRedirect:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},logoutPopup:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},ssoSilent:function(){return Promise.reject(qt.createStubPcaInstanceCalledError())},addEventCallback:function(){return null},removeEventCallback:function(){},enableAccountStorageEvents:function(){},disableAccountStorageEvents:function(){},getTokenCache:function(){throw qt.createStubPcaInstanceCalledError()},getLogger:function(){throw qt.createStubPcaInstanceCalledError()},setLogger:function(){},setActiveAccount:function(){},getActiveAccount:function(){return null},initializeWrapperLibrary:function(){},setNavigationClient:function(){},getConfiguration:function(){throw qt.createStubPcaInstanceCalledError()}},Kt=function(){function e(){}return e.prototype.navigateInternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.prototype.navigateExternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((function(e){setTimeout((function(){e(!0)}),t.timeout)}))},e}();e.EventType=void 0,(Ct=e.EventType||(e.EventType={})).ACCOUNT_ADDED="msal:accountAdded",Ct.ACCOUNT_REMOVED="msal:accountRemoved",Ct.LOGIN_START="msal:loginStart",Ct.LOGIN_SUCCESS="msal:loginSuccess",Ct.LOGIN_FAILURE="msal:loginFailure",Ct.ACQUIRE_TOKEN_START="msal:acquireTokenStart",Ct.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",Ct.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",Ct.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",Ct.SSO_SILENT_START="msal:ssoSilentStart",Ct.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",Ct.SSO_SILENT_FAILURE="msal:ssoSilentFailure",Ct.HANDLE_REDIRECT_START="msal:handleRedirectStart",Ct.HANDLE_REDIRECT_END="msal:handleRedirectEnd",Ct.POPUP_OPENED="msal:popupOpened",Ct.LOGOUT_START="msal:logoutStart",Ct.LOGOUT_SUCCESS="msal:logoutSuccess",Ct.LOGOUT_FAILURE="msal:logoutFailure",Ct.LOGOUT_END="msal:logoutEnd";var Ft=function(){function t(){}return t.getInteractionStatusFromEvent=function(t,r){switch(t.eventType){case e.EventType.LOGIN_START:return e.InteractionStatus.Login;case e.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case e.EventType.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case e.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case e.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case e.EventType.SSO_SILENT_SUCCESS:case e.EventType.SSO_SILENT_FAILURE:if(r&&r!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case e.EventType.LOGOUT_END:if(r&&r!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case e.EventType.HANDLE_REDIRECT_END:if(r&&r!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case e.EventType.LOGIN_SUCCESS:case e.EventType.LOGIN_FAILURE:case e.EventType.ACQUIRE_TOKEN_SUCCESS:case e.EventType.ACQUIRE_TOKEN_FAILURE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==e.InteractionStatus.Login&&r!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}}return null},t}(),xt="@azure/msal-browser",Bt="2.19.2",Gt=function(){function e(e,t){var r=t&&t.loggerOptions||{};this.logger=new oe(r,xt,Bt),this.cryptoOps=new Yt(this.logger),this.popTokenGenerator=new xe(this.cryptoOps),this.shrParameters=e}return e.prototype.generatePublicKeyThumbprint=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return[2,e.sent().kid]}}))}))},e.prototype.signRequest=function(e,t,r){return o(this,void 0,void 0,(function(){return i(this,(function(n){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)]}))}))},e.prototype.removeKeys=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.cryptoOps.removeTokenBindingKey(e)];case 1:return[2,t.sent()]}}))}))},e}(),jt=function(){function e(){this.dbName=Tt,this.version=1,this.tableName="msal.db.keys",this.dbOpen=!1}return e.prototype.open=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){return[2,new Promise((function(t,r){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",(function(t){t.target.result.createObjectStore(e.tableName)})),n.addEventListener("success",(function(r){var n=r;e.db=n.target.result,e.dbOpen=!0,t()})),n.addEventListener("error",(function(){return r(Rt.createDatabaseUnavailableError())}))}))]}))}))},e.prototype.validateDbIsOpen=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}}))}))},e.prototype.getItem=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Rt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);o.addEventListener("success",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){return n(e)}))}))]}}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise((function(n,o){if(!r.db)return o(Rt.createDatabaseNotOpenError());var i=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(t,e);i.addEventListener("success",(function(){return n()})),i.addEventListener("error",(function(e){return o(e)}))}))]}}))}))},e.prototype.removeItem=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Rt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);o.addEventListener("success",(function(){return r()})),o.addEventListener("error",(function(e){return n(e)}))}))]}}))}))},e.prototype.getKeys=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise((function(t,r){if(!e.db)return r(Rt.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly").objectStore(e.tableName).getAllKeys();n.addEventListener("success",(function(e){t(e.target.result)})),n.addEventListener("error",(function(e){return r(e)}))}))]}}))}))},e.prototype.containsKey=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Rt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).count(e);o.addEventListener("success",(function(e){r(1===e.target.result)})),o.addEventListener("error",(function(e){return n(e)}))}))]}}))}))},e.prototype.deleteDatabase=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,new Promise((function(e,t){var r=window.indexedDB.deleteDatabase(Tt);r.addEventListener("success",(function(){return e(!0)})),r.addEventListener("error",(function(){return t(!1)}))}))]}))}))},e}(),zt=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach((function(t,r){e.push(r)})),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),Wt=function(){function e(e){this.inMemoryCache=new zt,this.indexedDBCache=new jt,this.logger=e}return e.prototype.handleDatabaseAccessError=function(e){e instanceof Rt&&e.errorCode===bt.databaseUnavailable.code&&this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},e.prototype.getItem=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.getItem(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.setItem=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:this.inMemoryCache.setItem(e,t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}}))}))},e.prototype.removeItem=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:this.inMemoryCache.removeItem(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}}))}))},e.prototype.getKeys=function(){return o(this,void 0,void 0,(function(){var e,t;return i(this,(function(r){switch(r.label){case 0:if(0!==(e=this.inMemoryCache.getKeys()).length)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}}))}))},e.prototype.containsKey=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.containsKey(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.clear=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:this.inMemoryCache.clear(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.indexedDBCache.deleteDatabase()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.handleDatabaseAccessError(e),[3,4];case 4:return[2]}}))}))},e}(),Yt=function(){function e(e){this.logger=e,this.browserCrypto=new Pt(this.logger),this.b64Encode=new At,this.b64Decode=new _t,this.guidGenerator=new wt(this.browserCrypto),this.pkceGenerator=new Ot(this.browserCrypto),this.cache={asymmetricKeys:new Wt(this.logger),symmetricKeys:new Wt(this.logger)}}return e.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},e.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},e.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},e.prototype.generatePkceCodes=function(){return o(this,void 0,void 0,(function(){return i(this,(function(e){return[2,this.pkceGenerator.generateCodes()]}))}))},e.prototype.getPublicKeyThumbprint=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d;return i(this,(function(i){switch(i.label){case 0:return[4,this.browserCrypto.generateKeyPair(e.EXTRACTABLE,e.POP_KEY_USAGES)];case 1:return r=i.sent(),[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=i.sent(),o={e:n.e,kty:n.kty,n:n.n},a=Pt.getJwkString(o),[4,this.browserCrypto.sha256Digest(a)];case 3:return s=i.sent(),c=this.b64Encode.urlEncodeArr(new Uint8Array(s)),[4,this.browserCrypto.exportJwk(r.privateKey)];case 4:return u=i.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return d=i.sent(),[4,this.cache.asymmetricKeys.setItem(c,{privateKey:d,publicKey:r.publicKey,requestMethod:t.resourceRequestMethod,requestUri:t.resourceRequestUri})];case 6:return i.sent(),[2,c]}}))}))},e.prototype.removeTokenBindingKey=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return t.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return[2,!t.sent()]}}))}))},e.prototype.clearKeystore=function(){return o(this,void 0,void 0,(function(){var e,t,r;return i(this,(function(n){switch(n.label){case 0:return e=Object.keys(this.cache),(t=this.cache[e[0]])?[4,t.deleteDatabase()]:[3,2];case 1:return r=n.sent(),[3,3];case 2:r=!1,n.label=3;case 3:return[2,r]}}))}))},e.prototype.signJwt=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d,h,l;return i(this,(function(i){switch(i.label){case 0:return[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(!(r=i.sent()))throw Rt.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(r.publicKey)];case 2:return n=i.sent(),o=Pt.getJwkString(n),a={alg:n.alg,type:vt},s=this.b64Encode.urlEncode(JSON.stringify(a)),e.cnf={jwk:JSON.parse(o)},c=this.b64Encode.urlEncode(JSON.stringify(e)),u=s+"."+c,d=It.stringToArrayBuffer(u),[4,this.browserCrypto.sign(r.privateKey,d)];case 3:return h=i.sent(),l=this.b64Encode.urlEncodeArr(new Uint8Array(h)),[2,u+"."+l]}}))}))},e.POP_KEY_USAGES=["sign","verify"],e.EXTRACTABLE=!0,e}(),Jt=function(){function t(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return t.prototype.validateWindowStorage=function(t){if(t!==e.BrowserCacheLocation.LocalStorage&&t!==e.BrowserCacheLocation.SessionStorage)throw qt.createStorageNotSupportedError(t);if(!!!window[t])throw qt.createStorageNotSupportedError(t)},t.prototype.getItem=function(e){return this.windowStorage.getItem(e)},t.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},t.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},t.prototype.getKeys=function(){return Object.keys(this.windowStorage)},t.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},t}(),Qt=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(re.isEmpty(t))return null;try{return He.parseRequestState(e,t).libraryState.meta}catch(e){throw te.createInvalidStateError(t,e)}},e.parseServerResponseFromHash=function(e){if(!e)return{};var t=new Ke(e);return Ke.getDeserializedHash(t.getHash())},e}(),Vt=function(t){function n(e,r,n,o){var i=t.call(this,e,n)||this;return i.COOKIE_LIFE_MULTIPLIER=864e5,i.cacheConfig=r,i.logger=o,i.internalStorage=new zt,i.browserStorage=i.setupBrowserStorage(i.cacheConfig.cacheLocation),i.temporaryCacheStorage=i.setupTemporaryCacheStorage(i.cacheConfig.cacheLocation),i.migrateCacheEntries(),i}return r(n,t),n.prototype.setupBrowserStorage=function(t){switch(t){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new Jt(t)}catch(e){this.logger.verbose(e);break}case e.BrowserCacheLocation.MemoryStorage:}return this.cacheConfig.cacheLocation=e.BrowserCacheLocation.MemoryStorage,new zt},n.prototype.setupTemporaryCacheStorage=function(t){switch(t){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new Jt(e.BrowserCacheLocation.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case e.BrowserCacheLocation.MemoryStorage:default:return this.internalStorage}},n.prototype.migrateCacheEntries=function(){var e=this,t=v.CACHE_PREFIX+"."+f.ID_TOKEN,r=v.CACHE_PREFIX+"."+f.CLIENT_INFO,n=v.CACHE_PREFIX+"."+f.ERROR,o=v.CACHE_PREFIX+"."+f.ERROR_DESC,i=[this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];[f.ID_TOKEN,f.CLIENT_INFO,f.ERROR,f.ERROR_DESC].forEach((function(t,r){return e.migrateCacheEntry(t,i[r])}))},n.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},n.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},n.prototype.getItem=function(e){return this.browserStorage.getItem(e)},n.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},n.prototype.getAccount=function(e){var t=this.getItem(e);if(!t)return null;var r=this.validateAndParseJson(t);return r&&le.isAccountEntity(r)?ge.toObject(new le,r):null},n.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e))},n.prototype.getIdTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Oe.isIdTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),ge.toObject(new Oe,r)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),null)},n.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getAccessTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Ne.isAccessTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),ge.toObject(new Ne,r)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),null)},n.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getRefreshTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Pe.isRefreshTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),ge.toObject(new Pe,r)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),null)},n.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e))},n.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Be.isAppMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),ge.toObject(new Be,r)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},n.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},n.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&at.isServerTelemetryEntity(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),ge.toObject(new at,r)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},n.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},n.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&Qe.isAuthorityMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),ge.toObject(new Qe,r)):null},n.prototype.getAuthorityMetadataKeys=function(){var e=this;return this.internalStorage.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},n.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem($e.WRAPPER_SKU,e),this.internalStorage.setItem($e.WRAPPER_VER,t)},n.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem($e.WRAPPER_SKU)||"",this.internalStorage.getItem($e.WRAPPER_VER)||""]},n.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},n.prototype.getActiveAccount=function(){var e=this.generateCacheKey(f.ACTIVE_ACCOUNT),t=this.browserStorage.getItem(e);return t&&this.getAccountInfoByFilter({localAccountId:t})[0]||null},n.prototype.setActiveAccount=function(e){var t=this.generateCacheKey(f.ACTIVE_ACCOUNT);e?(this.logger.verbose("setActiveAccount: Active account set"),this.browserStorage.setItem(t,e.localAccountId)):(this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t))},n.prototype.getAccountInfoByFilter=function(e){return this.getAllAccounts().filter((function(t){return(!e.username||e.username.toLowerCase()===t.username.toLowerCase())&&((!e.homeAccountId||e.homeAccountId===t.homeAccountId)&&((!e.localAccountId||e.localAccountId===t.localAccountId)&&((!e.tenantId||e.tenantId===t.tenantId)&&(!e.environment||e.environment===t.environment))))}))},n.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&st.isThrottlingEntity(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),ge.toObject(new st,r)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},n.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},n.prototype.getTemporaryCache=function(t,r){var n=r?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(n);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}var i=this.temporaryCacheStorage.getItem(n);if(!i){if(this.cacheConfig.cacheLocation===e.BrowserCacheLocation.LocalStorage){var a=this.browserStorage.getItem(n);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),i},n.prototype.setTemporaryCache=function(e,t,r){var n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))},n.prototype.removeItem=function(e){return this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e)),!0},n.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},n.prototype.getKeys=function(){return s(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},n.prototype.clear=function(){return o(this,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return[4,this.removeAllAccounts()];case 1:return t.sent(),this.removeAppMetadata(),this.getKeys().forEach((function(t){!e.browserStorage.containsKey(t)&&!e.temporaryCacheStorage.containsKey(t)||-1===t.indexOf(v.CACHE_PREFIX)&&-1===t.indexOf(e.clientId)||e.removeItem(t)})),this.internalStorage.clear(),[2]}}))}))},n.prototype.setItemCookie=function(e,t,r){var n=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;";r&&(n+="expires="+this.getCookieExpirationTime(r)+";");this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},n.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return""},n.prototype.clearMsalCookies=function(){var e=this,t=v.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach((function(r){for(;" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t)){var n=r.split("=")[0];e.clearItemCookie(n)}}))},n.prototype.clearItemCookie=function(e){this.setItemCookie(e,"",-1)},n.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},n.prototype.getCache=function(){return this.browserStorage},n.prototype.setCache=function(){},n.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):re.startsWith(e,v.CACHE_PREFIX)||re.startsWith(e,f.ADAL_ID_TOKEN)?e:v.CACHE_PREFIX+"."+this.clientId+"."+e},n.prototype.generateAuthorityKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.AUTHORITY+"."+t)},n.prototype.generateNonceKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.NONCE_IDTOKEN+"."+t)},n.prototype.generateStateKey=function(e){var t=He.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(Ze.REQUEST_STATE+"."+t)},n.prototype.getCachedAuthority=function(e){var t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;var n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)},n.prototype.updateCacheEntries=function(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);var a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);var s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){var c={credential:o.homeAccountId,type:Te.HOME_ACCOUNT_ID};this.setTemporaryCache(Ze.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(!re.isEmpty(n)){c={credential:n,type:Te.UPN};this.setTemporaryCache(Ze.CCS_CREDENTIAL,JSON.stringify(c),!0)}},n.prototype.resetRequestCache=function(e){var t=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),re.isEmpty(e)||this.getKeys().forEach((function(r){-1!==r.indexOf(e)&&t.removeItem(r)})),e&&(this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(Ze.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(Ze.ORIGIN_URI)),this.removeItem(this.generateCacheKey(Ze.URL_HASH)),this.removeItem(this.generateCacheKey(Ze.CORRELATION_ID)),this.removeItem(this.generateCacheKey(Ze.CCS_CREDENTIAL)),this.setInteractionInProgress(!1)},n.prototype.cleanRequestByState=function(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){var t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+r),this.resetRequestCache(r||"")}this.clearMsalCookies()},n.prototype.cleanRequestByInteractionType=function(e){var t=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach((function(r){if(-1!==r.indexOf(Ze.REQUEST_STATE)){var n=t.temporaryCacheStorage.getItem(r);if(n){var o=Qt.extractBrowserRequestState(t.cryptoImpl,n);o&&o.interactionType===e&&(t.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+n),t.resetRequestCache(n))}}})),this.clearMsalCookies()},n.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var r=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(Ze.REQUEST_PARAMS,r,!0)},n.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(Ze.REQUEST_PARAMS,!0);if(!r)throw Rt.createNoTokenRequestCacheError();var n=this.validateAndParseJson(t.base64Decode(r));if(!n)throw Rt.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(Ze.REQUEST_PARAMS)),re.isEmpty(n.authority)){var o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw Rt.createNoCachedAuthorityError();n.authority=i}return n},n.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},n.prototype.getInteractionInProgress=function(){var e=v.CACHE_PREFIX+"."+Ze.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},n.prototype.setInteractionInProgress=function(e){var t=this.getInteractionInProgress(),r=v.CACHE_PREFIX+"."+Ze.INTERACTION_STATUS_KEY;e&&!t?this.setTemporaryCache(r,this.clientId,!1):e||t!==this.clientId||this.removeItem(r)},n.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(f.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(f.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(f.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(f.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var r=t||e;if(r){var n=new pe(r,this.cryptoImpl);if(n.claims&&n.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),n.claims.preferred_username;if(n.claims&&n.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),n.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},n.prototype.updateCredentialCacheKey=function(e,t){var r=t.generateCredentialKey();if(e!==r){var n=this.getItem(e);if(n)return this.removeItem(e),this.setItem(r,n),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),r;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},n}(ge),Xt=6e3;var Zt=function(){function t(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return t.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},t.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},t.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},t.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},t.prototype.emitEvent=function(e,t,r,n){var o=this;if("undefined"!=typeof window){var i={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,r){o.logger.verbose("Emitting event to callback "+r+": "+e),t.apply(null,[i])}))}},t.prototype.handleAccountCacheChange=function(t){try{var r=t.newValue||t.oldValue;if(!r)return;var n=JSON.parse(r);if("object"!=typeof n||!le.isAccountEntity(n))return;var o=ge.toObject(new le,n).getAccountInfo();!t.oldValue&&t.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_ADDED,void 0,o)):!t.newValue&&t.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_REMOVED,void 0,o))}catch(t){return}},t}(),$t=function(e){function t(t,r,n,o,i,a,s){var c=e.call(this,t,r,n,o,i,s)||this;return c.navigationClient=a,c}return r(t,e),t.prototype.initializeAuthorizationCodeRequest=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(o){switch(o.label){case 0:return this.logger.verbose("initializeAuthorizationRequest called",e.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=o.sent(),r=n(n({},e),{redirectUri:e.redirectUri,code:"",codeVerifier:t.verifier}),e.codeChallenge=t.challenge,e.codeChallengeMethod=v.S256_CODE_CHALLENGE_METHOD,[2,r]}}))}))},t.prototype.initializeLogoutRequest=function(e){if(this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId),this.browserStorage.isInteractionInProgress())throw Rt.createInteractionInProgressError();var t=n({correlationId:this.browserCrypto.createNewGuid()},e);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=Ke.getAbsoluteUrl(e.postLogoutRedirectUri,Lt.getCurrentUri())):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=Ke.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Lt.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Ke.getAbsoluteUrl(Lt.getCurrentUri(),Lt.getCurrentUri())),t},t.prototype.createAuthCodeClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new ze(r)]}}))}))},t.prototype.getClientConfiguration=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return this.logger.verbose("getClientConfiguration called"),[4,this.getDiscoveredAuthority(t)];case 1:return r=n.sent(),[2,{authOptions:{clientId:this.config.auth.clientId,authority:r,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:this.config.system.loggerOptions.loggerCallback,piiLoggingEnabled:this.config.system.loggerOptions.piiLoggingEnabled,logLevel:this.config.system.loggerOptions.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:yt,version:Bt,cpu:"",os:""}}]}}))}))},t.prototype.validateAndExtractStateFromHash=function(e,t,r){this.logger.verbose("validateAndExtractStateFromHash called",r);var n=Ke.getDeserializedHash(e);if(!n.state)throw Rt.createHashDoesNotContainStateError();var o=Qt.extractBrowserRequestState(this.browserCrypto,n.state);if(!o)throw Rt.createUnableToParseStateError();if(o.interactionType!==t)throw Rt.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),n.state},t.prototype.getDiscoveredAuthority=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e?(this.logger.verbose("Creating discovered authority with request authority"),[4,it.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t)]):[3,2];case 1:return[2,r.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,it.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t)];case 3:return[2,r.sent()]}}))}))},t.prototype.preflightInteractiveRequest=function(e,t){if(this.logger.verbose("preflightInteractiveRequest called, validating app environment",null==e?void 0:e.correlationId),Lt.blockReloadInHiddenIframes(),this.browserStorage.isInteractionInProgress(!1))throw Rt.createInteractionInProgressError();return this.initializeAuthorizationRequest(e,t)},t.prototype.initializeAuthorizationRequest=function(e,t){this.logger.verbose("initializeAuthorizationRequest called");var r=this.getRedirectUri(e.redirectUri),o={interactionType:t},i=He.setRequestState(this.browserCrypto,e&&e.state||"",o),a=n(n({},this.initializeBaseRequest(e)),{redirectUri:r,state:i,nonce:e.nonce||this.browserCrypto.createNewGuid(),responseMode:I.FRAGMENT}),s=e.account||this.browserStorage.getActiveAccount();if(s&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+s),a.account=s),re.isEmpty(a.loginHint)&&!s){var c=this.browserStorage.getLegacyLoginHint();c&&(a.loginHint=c)}return this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||"",a.account||null),a},t}(function(){function t(e,t,r,n,o,i){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.correlationId=i||this.browserCrypto.createNewGuid(),this.logger=n.clone(yt,Bt,this.correlationId)}return t.prototype.clearCacheOnLogout=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:if(!e)return[3,5];le.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(le.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),this.logger.verbose("No account provided in logout request, clearing all cache items."),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}}))}))},t.prototype.initializeBaseRequest=function(t){this.logger.verbose("Initializing BaseAuthRequest");var r=t.authority||this.config.auth.authority,o=s(t&&t.scopes||[]);if(t.authenticationScheme){if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ce.createMissingSshJwkError();if(!t.sshKid)throw ce.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+t.authenticationScheme+'" as configured in Auth request')}else t.authenticationScheme=e.AuthenticationScheme.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return n(n({},t),{correlationId:this.correlationId,authority:r,scopes:o})},t.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||Lt.getCurrentUri();return Ke.getAbsoluteUrl(t,Lt.getCurrentUri())},t.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new dt(r,this.browserStorage)},t}()),er=function(){function t(e,t){this.browserStorage=e,this.logger=t,this.unloadWindow=this.unloadWindow.bind(this)}return t.prototype.openPopup=function(e,r){try{var n=void 0;if(r.popup?(n=r.popup,this.logger.verbosePii("Navigating popup window to: "+e),n.location.assign(e)):void 0===r.popup&&(this.logger.verbosePii("Opening popup window to: "+e),n=t.openSizedPopup(e,r.popupName,r.popupWindowAttributes,this.logger)),!n)throw Rt.createEmptyWindowCreatedError();return n.focus&&n.focus(),this.currentWindow=n,window.addEventListener("beforeunload",this.unloadWindow),n}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),Rt.createPopupWindowError(e.toString())}},t.openSizedPopup=function(e,t,r,n){var o,i,a,s,c=window.screenLeft?window.screenLeft:window.screenX,u=window.screenTop?window.screenTop:window.screenY,d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,l=null===(o=r.popupSize)||void 0===o?void 0:o.width,p=null===(i=r.popupSize)||void 0===i?void 0:i.height,g=null===(a=r.popupPosition)||void 0===a?void 0:a.top,f=null===(s=r.popupPosition)||void 0===s?void 0:s.left;return(!l||l<0||l>d)&&(n.verbose("Default popup window width used. Window width not configured or invalid."),l=lt),(!p||p<0||p>h)&&(n.verbose("Default popup window height used. Window height not configured or invalid."),p=pt),(!g||g<0||g>h)&&(n.verbose("Default popup window top position used. Window top not configured or invalid."),g=Math.max(0,h/2-pt/2+u)),(!f||f<0||f>d)&&(n.verbose("Default popup window left position used. Window left not configured or invalid."),f=Math.max(0,d/2-lt/2+c)),window.open(e,t,"width="+l+", height="+p+", top="+g+", left="+f+", scrollbars=yes")},t.prototype.unloadWindow=function(t){this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()},t.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},t.prototype.monitorPopupForSameOrigin=function(e){var t=this;return new Promise((function(r,n){var o=setInterval((function(){if(e.closed)return t.cleanPopup(),clearInterval(o),void n(Rt.createUserCancelledError());var i=v.EMPTY_STRING;try{i=e.location.href}catch(e){}re.isEmpty(i)||"about:blank"===i||(clearInterval(o),r())}),ft)}))},t.generatePopupName=function(e,t){return gt+"."+e+"."+t.scopes.join("-")+"."+t.authority+"."+t.correlationId},t.generateLogoutPopupName=function(e,t){var r=t.account&&t.account.homeAccountId;return gt+"."+e+"."+r+"."+t.correlationId},t}(),tr=function(){function e(e,t,r,n){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.browserRequestLogger=n}return e.prototype.handleCodeResponse=function(e,t,r,n){return o(this,void 0,void 0,(function(){var o,a,s,c,u,d,h;return i(this,(function(i){switch(i.label){case 0:if(this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called"),re.isEmpty(e))throw Rt.createEmptyHashError(e);if(o=this.browserStorage.generateStateKey(t),!(a=this.browserStorage.getTemporaryCache(o)))throw te.createStateNotFoundError("Cached State");return s=this.authModule.handleFragmentResponse(e,a),c=this.browserStorage.generateNonceKey(a),u=this.browserStorage.getTemporaryCache(c),this.authCodeRequest.code=s.code,s.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(s.cloud_instance_host_name,r,n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return s.nonce=u||void 0,s.state=a,s.client_info?this.authCodeRequest.clientInfo=s.client_info:(d=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=d),[4,this.authModule.acquireToken(this.authCodeRequest,s)];case 3:return h=i.sent(),this.browserStorage.cleanRequestByState(t),[2,h]}}))}))},e.prototype.updateTokenEndpointAuthority=function(e,t,r){return o(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n="https://"+e+"/"+t.tenant+"/",[4,it.createDiscoveredInstance(n,r,this.browserStorage,t.options)];case 1:return o=i.sent(),this.authModule.updateAuthority(o),[2]}}))}))},e.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(Ze.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},e}(),rr=function(e){function t(t,r,n,o){var i=e.call(this,t,r,n,o)||this;return i.popupUtils=new er(r,o),i}return r(t,e),t.prototype.initiateAuthRequest=function(e,t){if(re.isEmpty(e))throw this.browserRequestLogger.error("Navigate url is empty"),Rt.createEmptyNavigationUriError();return this.browserStorage.setInteractionInProgress(!0),this.browserRequestLogger.infoPii("Navigate to: "+e),this.popupUtils.openPopup(e,t)},t.prototype.monitorPopupForHash=function(e){var t=this;return this.popupUtils.monitorPopupForSameOrigin(e).then((function(){var r=e.location.hash;if(Lt.clearHash(e),t.popupUtils.cleanPopup(e),!r)throw Rt.createEmptyHashError(e.location.href);if(Ke.hashContainsKnownProperties(r))return r;throw Rt.createHashDoesNotContainKnownPropertiesError()}))},t}(tr),nr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.acquireToken=function(t){try{var r=this.preflightInteractiveRequest(t,e.InteractionType.Popup),n=er.generatePopupName(this.config.auth.clientId,r),o=t.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(r,n,o);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var i=er.openSizedPopup("about:blank",n,o,this.logger);return this.acquireTokenPopupAsync(r,n,o,i)}catch(e){return Promise.reject(e)}},n.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=er.generateLogoutPopupName(this.config.auth.clientId,t),n=e&&e.authority,o=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,n,void 0,o);this.logger.verbose("asyncPopup set to false, opening popup");var a=er.openSizedPopup("about:blank",r,i,this.logger);return this.logoutPopupAsync(t,r,i,n,a,o)}catch(e){return Promise.reject(e)}},n.prototype.acquireTokenPopupAsync=function(t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u,d,h,l,p,g,f;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("acquireTokenPopupAsync called"),o=this.initializeServerTelemetryManager(e.ApiId.acquireTokenPopup),i.label=1;case 1:return i.trys.push([1,7,,8]),[4,this.initializeAuthorizationCodeRequest(t)];case 2:return s=i.sent(),[4,this.createAuthCodeClient(o,t.authority)];case 3:return c=i.sent(),this.logger.verbose("Auth code client created"),[4,c.getAuthCodeUrl(t)];case 4:return u=i.sent(),d=new rr(c,this.browserStorage,s,this.logger),h={popup:a,popupName:r,popupWindowAttributes:n},l=d.initiateAuthRequest(u,h),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:l},null),[4,d.monitorPopupForHash(l)];case 5:return p=i.sent(),g=this.validateAndExtractStateFromHash(p,e.InteractionType.Popup,t.correlationId),we.removeThrottle(this.browserStorage,this.config.auth.clientId,s),[4,d.handleCodeResponse(p,g,c.authority,this.networkClient)];case 6:return[2,i.sent()];case 7:throw f=i.sent(),a&&a.close(),f instanceof Z&&f.setCorrelationId(this.correlationId),o.cacheFailedRequest(f),this.browserStorage.cleanRequestByState(t.state),f;case 8:return[2]}}))}))},n.prototype.logoutPopupAsync=function(t,r,n,a,s,c){return o(this,void 0,void 0,(function(){var o,u,d,h,l,p,g,f,y;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Popup,t),o=this.initializeServerTelemetryManager(e.ApiId.logoutPopup),i.label=1;case 1:return i.trys.push([1,8,,9]),[4,this.clearCacheOnLogout(t.account)];case 2:return i.sent(),this.browserStorage.setInteractionInProgress(!0),[4,this.createAuthCodeClient(o,a)];case 3:u=i.sent(),this.logger.verbose("Auth code client created"),d=u.getLogoutUri(t),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Popup,t),h=new er(this.browserStorage,this.logger),l=h.openPopup(d,{popupName:r,popupWindowAttributes:n,popup:s}),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:l},null),i.label=4;case 4:return i.trys.push([4,6,,7]),[4,h.monitorPopupForSameOrigin(l)];case 5:return i.sent(),this.logger.verbose("Popup successfully redirected to postLogoutRedirectUri"),[3,7];case 6:return p=i.sent(),this.logger.verbose("Error occurred while monitoring popup for same origin. Session on server may remain active. Error: "+p),[3,7];case 7:return h.cleanPopup(l),c?(g={apiId:e.ApiId.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},f=Ke.getAbsoluteUrl(c,Lt.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecing main window to: "+f),this.navigationClient.navigateInternal(f,g)):this.logger.verbose("No main window navigation requested"),[3,9];case 8:throw y=i.sent(),s&&s.close(),y instanceof Z&&y.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Popup,null,y),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),o.cacheFailedRequest(y),y;case 9:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),[2]}}))}))},n}($t),or=function(t){function n(e,r,n,o,i){var a=t.call(this,e,r,n,o)||this;return a.browserCrypto=i,a}return r(n,t),n.prototype.initiateAuthRequest=function(t,r){return o(this,void 0,void 0,(function(){var n;return i(this,(function(o){switch(o.label){case 0:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest called"),re.isEmpty(t)?[3,7]:(r.redirectStartPage&&(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ze.ORIGIN_URI,r.redirectStartPage,!0)),this.browserStorage.setInteractionInProgress(!0),this.browserStorage.setTemporaryCache(Ze.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.browserRequestLogger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),n={apiId:e.ApiId.acquireTokenRedirect,timeout:r.redirectTimeout,noHistory:!1},"function"!=typeof r.onRedirectNavigate?[3,4]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===r.onRedirectNavigate(t)?[3,2]:(this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,r.navigationClient.navigateExternal(t,n)])));case 1:return o.sent(),[2];case 2:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.browserRequestLogger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,r.navigationClient.navigateExternal(t,n)];case 5:return o.sent(),[2];case 6:return[3,8];case 7:throw this.browserRequestLogger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Rt.createEmptyNavigationUriError();case 8:return[2]}}))}))},n.prototype.handleCodeResponse=function(e,t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u,d,h,l;return i(this,(function(i){switch(i.label){case 0:if(this.browserRequestLogger.verbose("RedirectHandler.handleCodeResponse called"),re.isEmpty(e))throw Rt.createEmptyHashError(e);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(t),!(s=this.browserStorage.getTemporaryCache(o)))throw te.createStateNotFoundError("Cached State");return c=this.authModule.handleFragmentResponse(e,s),u=this.browserStorage.generateNonceKey(s),d=this.browserStorage.getTemporaryCache(u),this.authCodeRequest.code=c.code,c.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(c.cloud_instance_host_name,r,n)]:[3,2];case 1:i.sent(),i.label=2;case 2:return c.nonce=d||void 0,c.state=s,c.client_info?this.authCodeRequest.clientInfo=c.client_info:(h=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=h),a&&we.removeThrottle(this.browserStorage,a,this.authCodeRequest),[4,this.authModule.acquireToken(this.authCodeRequest,c)];case 3:return l=i.sent(),this.browserStorage.cleanRequestByState(t),[2,l]}}))}))},n}(tr),ir=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d;return i(this,(function(i){switch(i.label){case 0:r=this.preflightInteractiveRequest(t,e.InteractionType.Redirect),n=this.initializeServerTelemetryManager(e.ApiId.acquireTokenRedirect),i.label=1;case 1:return i.trys.push([1,6,,7]),[4,this.initializeAuthorizationCodeRequest(r)];case 2:return o=i.sent(),[4,this.createAuthCodeClient(n,r.authority)];case 3:return a=i.sent(),this.logger.verbose("Auth code client created"),s=new or(a,this.browserStorage,o,this.logger,this.browserCrypto),[4,a.getAuthCodeUrl(r)];case 4:return c=i.sent(),u=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+u),[4,s.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:u,onRedirectNavigate:t.onRedirectNavigate})];case 5:return[2,i.sent()];case 6:throw(d=i.sent())instanceof Z&&d.setCorrelationId(this.correlationId),n.cacheFailedRequest(d),this.browserStorage.cleanRequestByState(r.state),d;case 7:return[2]}}))}))},n.prototype.handleRedirectPromise=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,d,h,l,p;return i(this,(function(i){switch(i.label){case 0:r=this.initializeServerTelemetryManager(e.ApiId.handleRedirectPromise),i.label=1;case 1:if(i.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(n=this.getRedirectResponseHash(t||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null];o=void 0;try{o=this.validateAndExtractStateFromHash(n,e.InteractionType.Redirect),Lt.clearHash(window),this.logger.verbose("State extracted from hash")}catch(t){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+t),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null]}return a=this.browserStorage.getTemporaryCache(Ze.ORIGIN_URI,!0)||"",s=Ke.removeHashFromUrl(a),c=Ke.removeHashFromUrl(window.location.href),s===c&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(n,o,r)]):[3,3];case 2:return u=i.sent(),a.indexOf("#")>-1&&Lt.replaceHash(a),[2,u];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(n,o,r)]);case 4:return Lt.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(Ze.URL_HASH,n,!0),d={apiId:e.ApiId.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},h=!0,a&&"null"!==a?[3,6]:(l=Lt.getHomepage(),this.browserStorage.setTemporaryCache(Ze.ORIGIN_URI,l,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(l,d)]));case 5:return h=i.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+a),[4,this.navigationClient.navigateInternal(a,d)];case 7:h=i.sent(),i.label=8;case 8:if(!h)return[2,this.handleHash(n,o,r)];i.label=9;case 9:return[2,null];case 10:throw(p=i.sent())instanceof Z&&p.setCorrelationId(this.correlationId),r.cacheFailedRequest(p),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),p;case 11:return[2]}}))}))},n.prototype.getRedirectResponseHash=function(e){this.logger.verbose("getRedirectResponseHash called");var t=Ke.hashContainsKnownProperties(e),r=this.browserStorage.getTemporaryCache(Ze.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ze.URL_HASH)),t?(this.logger.verbose("Hash contains known properties, returning response hash"),e):(this.logger.verbose("Hash does not contain known properties, returning cached hash"),r)},n.prototype.handleHash=function(e,t,r){return o(this,void 0,void 0,(function(){var n,o,a;return i(this,(function(i){switch(i.label){case 0:if(n=this.browserStorage.getCachedRequest(t,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),!(o=this.browserStorage.getCachedAuthority(t)))throw Rt.createNoCachedAuthorityError();return[4,this.createAuthCodeClient(r,o)];case 1:return a=i.sent(),this.logger.verbose("Auth code client created"),[4,new or(a,this.browserStorage,n,this.logger,this.browserCrypto).handleCodeResponse(e,t,a.authority,this.networkClient,this.config.auth.clientId)];case 2:return[2,i.sent()]}}))}))},n.prototype.logout=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("logoutRedirect called"),r=this.initializeLogoutRequest(t),n=this.initializeServerTelemetryManager(e.ApiId.logout),i.label=1;case 1:return i.trys.push([1,10,,11]),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Redirect,t),[4,this.clearCacheOnLogout(r.account)];case 2:return i.sent(),o={apiId:e.ApiId.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},[4,this.createAuthCodeClient(n,t&&t.authority)];case 3:return a=i.sent(),this.logger.verbose("Auth code client created"),s=a.getLogoutUri(r),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Redirect,r),t&&"function"==typeof t.onRedirectNavigate?!1===t.onRedirectNavigate(s)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),[4,this.navigationClient.navigateExternal(s,o)]):[3,7];case 4:return i.sent(),[2];case 5:this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),i.label=6;case 6:return[3,9];case 7:return[4,this.navigationClient.navigateExternal(s,o)];case 8:return i.sent(),[2];case 9:return[3,11];case 10:throw(c=i.sent())instanceof Z&&c.setCorrelationId(this.correlationId),n.cacheFailedRequest(c),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Redirect,null,c),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),c;case 11:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),[2]}}))}))},n.prototype.getRedirectStartPage=function(e){var t=e||window.location.href;return Ke.getAbsoluteUrl(t,Lt.getCurrentUri())},n}($t),ar=function(e){function t(t,r,n,o,i){var a=e.call(this,t,r,n,o)||this;return a.navigateFrameWait=i,a}return r(t,e),t.prototype.initiateAuthRequest=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:if(re.isEmpty(e))throw this.browserRequestLogger.info("Navigate url is empty"),Rt.createEmptyNavigationUriError();return this.navigateFrameWait?[4,this.loadFrame(e)]:[3,2];case 1:return t=r.sent(),[3,3];case 2:t=this.loadFrameSync(e),r.label=3;case 3:return[2,t]}}))}))},t.prototype.monitorIframeForHash=function(e,t){var r=this;return new Promise((function(n,o){t<Xt&&r.browserRequestLogger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+t+"ms) than the default ("+"6000ms). This may result in timeouts.");var i=window.performance.now()+t,a=setInterval((function(){if(window.performance.now()>i)return r.removeHiddenIframe(e),clearInterval(a),void o(Rt.createMonitorIframeTimeoutError());var t=v.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:v.EMPTY_STRING}catch(e){}if(!re.isEmpty(t)){var c=s?s.location.hash:v.EMPTY_STRING;return Ke.hashContainsKnownProperties(c)?(r.removeHiddenIframe(e),clearInterval(a),void n(c)):void 0}}),ft)}))},t.prototype.loadFrame=function(e){var t=this;return new Promise((function(r,n){var o=t.createHiddenIframe();setTimeout((function(){o?(o.src=e,r(o)):n("Unable to load iframe")}),t.navigateFrameWait)}))},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return 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.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(tr),sr=function(t){function a(e,r,n,o,i,a,s,c){var u=t.call(this,e,r,n,o,i,a,c)||this;return u.apiId=s,u}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),re.isEmpty(t.loginHint)&&re.isEmpty(t.sid)&&(!t.account||re.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==w.NONE)throw Rt.createSilentPromptValueError(t.prompt);r=this.initializeAuthorizationRequest(n(n({},t),{prompt:w.NONE}),e.InteractionType.Silent),o=this.initializeServerTelemetryManager(this.apiId),i.label=1;case 1:return i.trys.push([1,6,,7]),[4,this.initializeAuthorizationCodeRequest(r)];case 2:return a=i.sent(),[4,this.createAuthCodeClient(o,r.authority)];case 3:return s=i.sent(),this.logger.verbose("Auth code client created"),[4,s.getAuthCodeUrl(r)];case 4:return c=i.sent(),[4,this.silentTokenHelper(c,a,s,this.logger)];case 5:return[2,i.sent()];case 6:throw(u=i.sent())instanceof Z&&u.setCorrelationId(this.correlationId),o.cacheFailedRequest(u),this.browserStorage.cleanRequestByState(r.state),u;case 7:return[2]}}))}))},a.prototype.logout=function(){return Promise.reject(Rt.createSilentLogoutUnsupportedError())},a.prototype.silentTokenHelper=function(t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c,u;return i(this,(function(i){switch(i.label){case 0:return[4,(o=new ar(n,this.browserStorage,r,a,this.config.system.navigateFrameWait)).initiateAuthRequest(t)];case 1:return s=i.sent(),[4,o.monitorIframeForHash(s,this.config.system.iframeHashTimeout)];case 2:return c=i.sent(),u=this.validateAndExtractStateFromHash(c,e.InteractionType.Silent,r.correlationId),[2,o.handleCodeResponse(c,u,n.authority,this.networkClient)]}}))}))},a}($t),cr=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:return r=n(n({},t),this.initializeBaseRequest(t)),o=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(o,r.authority)];case 1:return a=i.sent(),this.logger.verbose("Refresh token client created"),[2,a.acquireTokenByRefreshToken(r).catch((function(e){throw e instanceof Z&&e.setCorrelationId(s.correlationId),o.cacheFailedRequest(e),e}))]}}))}))},a.prototype.logout=function(){return Promise.reject(Rt.createSilentLogoutUnsupportedError())},a.prototype.createRefreshTokenClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new We(r)]}}))}))},a}($t),ur=function(){function e(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}return e.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw Rt.createUnableToLoadTokenError("Please ensure server response includes id token.");if(e.account)this.loadIdToken(t.id_token,e.account.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadAccessToken(e,t,e.account.homeAccountId,e.account.environment,e.account.tenantId,r);else{if(!e.authority)throw Rt.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var n={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},o=new ot(e.authority,this.config.system.networkClient,this.storage,n);if(r.clientInfo)this.logger.trace("TokenCache - homeAccountId from options"),this.loadIdToken(t.id_token,r.clientInfo,o.hostnameAndPort,o.tenant,r),this.loadAccessToken(e,t,r.clientInfo,o.hostnameAndPort,o.tenant,r);else{if(!t.client_info)throw Rt.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response"),this.loadIdToken(t.id_token,t.client_info,o.hostnameAndPort,o.tenant,r),this.loadAccessToken(e,t,t.client_info,o.hostnameAndPort,o.tenant,r)}}},e.prototype.loadIdToken=function(e,t,r,n,o){var i=Oe.createIdTokenEntity(t,r,e,this.config.auth.clientId,n),a=new pe(e,this.cryptoObj),s=o.clientInfo?le.createAccount(o.clientInfo,t,a,void 0,void 0,void 0,void 0,r):le.createGenericAccount(t,a,void 0,void 0,void 0,void 0,r);if(!this.isBrowserEnvironment)throw Rt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading id token"),this.storage.setAccount(s),this.storage.setIdTokenCredential(i)},e.prototype.loadAccessToken=function(e,t,r,n,o,i){if(t.access_token){if(!t.expires_in)throw Rt.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw Rt.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new ue(e.scopes).printScopes(),s=t.expires_in,c=i.extendedExpiresOn,u=Ne.createAccessTokenEntity(r,n,t.access_token,this.config.auth.clientId,o,a,s,c,this.cryptoObj);if(!this.isBrowserEnvironment)throw Rt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.");this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u)}else this.logger.verbose("TokenCache - No access token provided for caching")},e}(),dr=function(){function t(t){var r,o,i,a,s,c,u,d,h,l,p,g;this.isBrowserEnvironment="undefined"!=typeof window,this.config=(r=t,o=this.isBrowserEnvironment,i=r.auth,a=r.cache,s=r.system,c={clientId:"",authority:""+v.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:"",postLogoutRedirectUri:"",navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:e.ProtocolMode.AAD},u={cacheLocation:e.BrowserCacheLocation.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1},d={loggerCallback:function(){},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},h=n(n({},ye),{loggerOptions:d,networkClient:o?Lt.getBrowserNetworkClient():ct,navigationClient:new Kt,loadFrameTimeout:0,windowHashTimeout:s&&s.loadFrameTimeout||6e4,iframeHashTimeout:s&&s.loadFrameTimeout||Xt,navigateFrameWait:o&&Lt.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1}),{auth:n(n({},c),i),cache:n(n({},u),a),system:n(n({},h),s)}),this.logger=new oe(this.config.system.loggerOptions,xt,Bt),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.browserCrypto=this.isBrowserEnvironment?new Yt(this.logger):$,this.eventHandler=new Zt(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new Vt(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(l=this.config.auth.clientId,p=this.logger,g={cacheLocation:e.BrowserCacheLocation.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1},new Vt(l,g,$,p)),this.tokenCache=new ur(this.config,this.browserStorage,this.logger,this.browserCrypto)}return t.prototype.handleRedirectPromise=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c=this;return i(this,(function(i){return this.logger.verbose("handleRedirectPromise called"),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=t||v.EMPTY_STRING,void 0===(o=this.redirectResponse.get(n))?(this.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_START,e.InteractionType.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),a=this.browserStorage.getTemporaryCache(Ze.CORRELATION_ID,!0)||"",s=new ir(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,a),o=s.handleRedirectPromise(t).then((function(t){t&&(r.length<c.getAllAccounts().length?(c.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Redirect,t),c.logger.verbose("handleRedirectResponse returned result, login success")):(c.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),c.logger.verbose("handleRedirectResponse returned result, acquire token success")));return c.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((function(t){throw r.length>0?c.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):c.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),c.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})),this.redirectResponse.set(n,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},t.prototype.acquireTokenRedirect=function(t){return o(this,void 0,void 0,(function(){var r,n=this;return i(this,(function(o){return this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),this.logger.verbose("acquireTokenRedirect called"),(r=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Redirect,t),[2,new ir(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).catch((function(t){throw r?n.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):n.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),t}))]}))}))},t.prototype.acquireTokenPopup=function(t){var r=this;try{this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup),this.logger.verbose("acquireTokenPopup called",t.correlationId)}catch(e){return Promise.reject(e)}var n=this.getAllAccounts();return n.length>0?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Popup,t),new nr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).then((function(t){return n.length<r.getAllAccounts().length?r.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Popup,t):r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),t})).catch((function(t){return n.length>0?r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t):r.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Popup,null,t),Promise.reject(t)}))},t.prototype.ssoSilent=function(t){return o(this,void 0,void 0,(function(){var r,n;return i(this,(function(o){switch(o.label){case 0:this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.verbose("ssoSilent called",t.correlationId),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_START,e.InteractionType.Silent,t),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,new sr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,t.correlationId).acquireToken(t)];case 2:return r=o.sent(),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_SUCCESS,e.InteractionType.Silent,r),[2,r];case 3:throw n=o.sent(),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,n),n;case 4:return[2]}}))}))},t.prototype.acquireTokenByRefreshToken=function(t){return o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),Lt.blockReloadInHiddenIframes(),[2,new cr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId).acquireToken(t).catch((function(n){var o=n instanceof Se,i=n instanceof De,a=n.errorCode===ht;if(o&&a&&!i)return r.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe",t.correlationId),new sr(r.config,r.browserStorage,r.browserCrypto,r.logger,r.eventHandler,r.navigationClient,e.ApiId.acquireTokenSilent_authCode,t.correlationId).acquireToken(t);throw n}))]}))}))},t.prototype.logout=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead."),[2,this.logoutRedirect(e)]}))}))},t.prototype.logoutRedirect=function(t){return o(this,void 0,void 0,(function(){return i(this,(function(r){return this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),[2,new ir(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,null==t?void 0:t.correlationId).logout(t)]}))}))},t.prototype.logoutPopup=function(t){try{return this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup),new nr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,null==t?void 0:t.correlationId).logout(t)}catch(e){return Promise.reject(e)}},t.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},t.prototype.getAccountByUsername=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching username found, returning"),this.logger.verbosePii("Returning signed-in accounts matching username: "+e),t.filter((function(t){return t.username.toLowerCase()===e.toLowerCase()}))[0]||null):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},t.prototype.getAccountByHomeId=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching homeAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching homeAccountId: "+e),t.filter((function(t){return t.homeAccountId===e}))[0]||null):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},t.prototype.getAccountByLocalId=function(e){var t=this.getAllAccounts();return!re.isEmpty(e)&&t&&t.length?(this.logger.verbose("Account matching localAccountId found, returning"),this.logger.verbosePii("Returning signed-in accounts matching localAccountId: "+e),t.filter((function(t){return t.localAccountId===e}))[0]||null):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},t.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},t.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},t.prototype.preflightBrowserEnvironmentCheck=function(t){if(this.logger.verbose("preflightBrowserEnvironmentCheck started"),Lt.blockNonBrowserEnvironment(this.isBrowserEnvironment),Lt.blockRedirectInIframe(t,this.config.system.allowRedirectInIframe),Lt.blockReloadInHiddenIframes(),Lt.blockAcquireTokenInPopups(),t===e.InteractionType.Redirect&&this.config.cache.cacheLocation===e.BrowserCacheLocation.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw qt.createInMemoryRedirectUnavailableError()},t.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},t.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},t.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},t.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},t.prototype.getTokenCache=function(){return this.tokenCache},t.prototype.getLogger=function(){return this.logger},t.prototype.setLogger=function(e){this.logger=e},t.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},t.prototype.setNavigationClient=function(e){this.navigationClient=e},t.prototype.getConfiguration=function(){return this.config},t}(),hr=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return r=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(r,t.authority)];case 1:n=i.sent(),this.logger.verbose("Silent auth client created"),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,n.acquireCachedToken(t)];case 3:return o=i.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,o),[2,o];case 4:throw(a=i.sent())instanceof Rt&&a.errorCode===bt.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a;case 5:return[2]}}))}))},a.prototype.logout=function(){return Promise.reject(Rt.createSilentLogoutUnsupportedError())},a.prototype.createSilentFlowClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new Ye(r)]}}))}))},a.prototype.initializeSilentRequest=function(e,t){return n(n(n({},e),this.initializeBaseRequest(e)),{account:t,forceRefresh:e.forceRefresh||!1})},a}($t),lr=function(t){function n(e){var r=t.call(this,e)||this;return r.activeSilentTokenRequests=new Map,r}return r(n,t),n.prototype.loginRedirect=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.logger.verbose("loginRedirect called"),[2,this.acquireTokenRedirect(e||Et)]}))}))},n.prototype.loginPopup=function(e){return this.logger.verbose("loginPopup called"),this.acquireTokenPopup(e||Et)},n.prototype.acquireTokenSilent=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c=this;return i(this,(function(i){if(this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.verbose("acquireTokenSilent called",t.correlationId),!(r=t.account||this.getActiveAccount()))throw Rt.createNoAccountError();return n={clientId:this.config.auth.clientId,authority:t.authority||"",scopes:t.scopes,homeAccountIdentifier:r.homeAccountId,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshJwk:t.sshJwk,sshKid:t.sshKid},o=JSON.stringify(n),void 0===(a=this.activeSilentTokenRequests.get(o))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t.correlationId),s=this.acquireTokenSilentAsync(t,r).then((function(e){return c.activeSilentTokenRequests.delete(o),e})).catch((function(e){throw c.activeSilentTokenRequests.delete(o),e})),this.activeSilentTokenRequests.set(o,s),[2,s]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t.correlationId),[2,a])}))}))},n.prototype.acquireTokenSilentAsync=function(t,r){return o(this,void 0,void 0,(function(){var n,a,s=this;return i(this,(function(c){return n=new hr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t.correlationId),a=n.initializeSilentRequest(t,r),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),[2,n.acquireToken(a).catch((function(){return o(s,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.acquireTokenByRefreshToken(a)];case 1:return t=n.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),[2,t];case 2:throw r=n.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,r),r;case 3:return[2]}}))}))}))]}))}))},n}(dr);e.AccountEntity=le,e.AuthError=Z,e.AuthErrorMessage=X,e.AuthenticationHeaderParser=ut,e.BrowserAuthError=Rt,e.BrowserAuthErrorMessage=bt,e.BrowserConfigurationAuthError=qt,e.BrowserConfigurationAuthErrorMessage=Dt,e.BrowserUtils=Lt,e.ClientAuthError=te,e.ClientAuthErrorMessage=ee,e.ClientConfigurationError=ce,e.ClientConfigurationErrorMessage=se,e.EventMessageUtils=Ft,e.InteractionRequiredAuthError=De,e.InteractionRequiredAuthErrorMessage=Le,e.Logger=oe,e.NavigationClient=Kt,e.PublicClientApplication=lr,e.ServerError=Se,e.SignedHttpRequest=Gt,e.StringUtils=re,e.UrlString=Ke,e.stubbedPublicClientApplication=Ht,e.version=Bt,Object.defineProperty(e,"__esModule",{value:!0})}));
|