!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Implicit",[],t):"object"==typeof exports?exports.Implicit=t():e.Implicit=t()}(window,function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}({"./packages/Microsoft.Office.WebAuth.Implicit/lib/api.js":function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logUserAction=function(e,t,r,o,n,i,a){void 0===t&&(t=!0);void 0===r&&(r=c);void 0===o&&(o=c);void 0===n&&(n=c);void 0===i&&(i=0);void 0===a&&(a=[]);l({name:null,actionName:e,commandSurface:n,parentName:r,triggerMethod:o,durationMs:i,succeeded:t,dataFields:a})},t.logActivity=function(e,t,r,o){void 0===t&&(t=!0);void 0===r&&(r=0);void 0===o&&(o=[]);u({name:e,succeeded:t,durationMs:r,dataFields:o})},t.sendTelemetryEvent=function(e){h({kind:"event",event:e,timestamp:(new Date).getTime()})},t.sendActivityEvent=u,t.sendOtelEvent=function(e){h({kind:"otel",event:e})},t.sendUserActionEvent=l,t.addNamespaceMapping=function(e,t){h({kind:"addNamespaceMapping",namespace:e,ariaTenantToken:t})},t.setEnabledState=function(e){(n=e)||(i=[])},t.shutdown=function(){return h({kind:"shutdown"}),i.length+a},t.registerEventHandler=function(e){o=e,i.forEach(function(e){return h(e)}),i=[]};var o,n=!1,i=[],a=0,s=2e4,c="Unknown";function u(e){h({kind:"activity",event:e,timestamp:(new Date).getTime()})}function l(e){h({kind:"action",event:e,timestamp:(new Date).getTime()})}function h(e){n&&(o?o(e):i.length<=s?i.push(e):a+=1)}},"./packages/Microsoft.Office.WebAuth.Implicit/lib/msal.js":function(e,t,r){"use strict";
/*! msal v1.3.3 2020-07-14 */
/*! msal v1.3.3 2020-07-14 */
var o;window,o=function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=29)}([function(e,t,r){
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){return(o=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,t)};function n(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a}function a(e){return this instanceof a?(this.v=e,this):new a(e)}t.__extends=function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r},t.__decorate=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},t.__param=function(e,t){return function(r,o){t(r,o,e)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(e,t,r,o){return new(r||(r=Promise))(function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},t.__generator=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[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,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},t.__exportStar=function(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])},t.__values=n,t.__read=i,t.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e},t.__spreadArrays=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),n=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)o[n]=i[a];return o},t.__await=a,t.__asyncGenerator=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,n=r.apply(e,t||[]),i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(e){n[e]&&(o[e]=function(t){return new Promise(function(r,o){i.push([e,t,r,o])>1||c(e,t)})})}function c(e,t){try{(r=n[e](t)).value instanceof a?Promise.resolve(r.value.v).then(u,l):h(i[0][2],r)}catch(e){h(i[0][3],e)}var r}function u(e){c("next",e)}function l(e){c("throw",e)}function h(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}},t.__asyncDelegator=function(e){var t,r;return t={},o("next"),o("throw",function(e){throw e}),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,n){t[o]=e[o]?function(t){return(r=!r)?{value:a(e[o](t)),done:"return"===o}:n?n(t):t}:n}},t.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=n(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(r){t[r]=e[r]&&function(t){return new Promise(function(o,n){!function(e,t,r,o){Promise.resolve(o).then(function(t){e({value:t,done:r})},t)}(o,n,(t=e[r](t)).done,t.value)})}}},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},t.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n=function(){function e(){}return Object.defineProperty(e,"libraryName",{get:function(){return"Msal.js"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"claims",{get:function(){return"claims"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"clientId",{get:function(){return"clientId"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"adalIdToken",{get:function(){return"adal.idtoken"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cachePrefix",{get:function(){return"msal"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"scopes",{get:function(){return"scopes"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"no_account",{get:function(){return"NO_ACCOUNT"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"upn",{get:function(){return"upn"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"domain_hint",{get:function(){return"domain_hint"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"prompt_select_account",{get:function(){return"&prompt=select_account"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"prompt_none",{get:function(){return"&prompt=none"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"prompt",{get:function(){return"prompt"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"response_mode_fragment",{get:function(){return"&response_mode=fragment"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"resourceDelimiter",{get:function(){return"|"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cacheDelimiter",{get:function(){return"."},enumerable:!0,configurable:!0}),Object.defineProperty(e,"popUpWidth",{get:function(){return this._popUpWidth},set:function(e){this._popUpWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"popUpHeight",{get:function(){return this._popUpHeight},set:function(e){this._popUpHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"login",{get:function(){return"LOGIN"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"renewToken",{get:function(){return"RENEW_TOKEN"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"unknown",{get:function(){return"UNKNOWN"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"ADFS",{get:function(){return"adfs"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"homeAccountIdentifier",{get:function(){return"homeAccountIdentifier"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"common",{get:function(){return"common"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"openidScope",{get:function(){return"openid"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"profileScope",{get:function(){return"profile"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"interactionTypeRedirect",{get:function(){return"redirectInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"interactionTypePopup",{get:function(){return"popupInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"interactionTypeSilent",{get:function(){return"silentInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"inProgress",{get:function(){return"inProgress"},enumerable:!0,configurable:!0}),e._popUpWidth=483,e._popUpHeight=600,e}();t.Constants=n,function(e){e.SCOPE="scope",e.STATE="state",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ACCESS_TOKEN="access_token",e.ID_TOKEN="id_token",e.EXPIRES_IN="expires_in",e.SESSION_STATE="session_state",e.CLIENT_INFO="client_info"}(t.ServerHashParamKeys||(t.ServerHashParamKeys={})),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireTokenAccount",e.SESSION_STATE="session.state",e.STATE_LOGIN="state.login",e.STATE_ACQ_TOKEN="state.acquireToken",e.STATE_RENEW="state.renew",e.NONCE_IDTOKEN="nonce.idtoken",e.LOGIN_REQUEST="login.request",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.INTERACTION_STATUS="interaction_status",e.REDIRECT_REQUEST="redirect_request"}(t.TemporaryCacheKeys||(t.TemporaryCacheKeys={})),function(e){e.IDTOKEN="idtoken",e.CLIENT_INFO="client.info"}(t.PersistentCacheKeys||(t.PersistentCacheKeys={})),function(e){e.LOGIN_ERROR="login.error",e.ERROR="error",e.ERROR_DESC="error.description"}(t.ErrorCacheKeys||(t.ErrorCacheKeys={})),t.DEFAULT_AUTHORITY="https://login.microsoftonline.com/common/",t.AAD_INSTANCE_DISCOVERY_ENDPOINT=t.DEFAULT_AUTHORITY+"/discovery/instance?api-version=1.1&authorization_endpoint=",function(e){e.ACCOUNT="account",e.SID="sid",e.LOGIN_HINT="login_hint",e.ID_TOKEN="id_token",e.ACCOUNT_ID="accountIdentifier",e.HOMEACCOUNT_ID="homeAccountIdentifier"}(o=t.SSOTypes||(t.SSOTypes={})),t.BlacklistedEQParams=[o.SID,o.LOGIN_HINT],t.NetworkRequestType={GET:"GET",POST:"POST"},t.PromptState={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none"},t.FramePrefix={ID_TOKEN_FRAME:"msalIdTokenFrame",TOKEN_FRAME:"msalRenewFrame"},t.libraryVersion=function(){return"1.3.3"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.createNewGuid=function(){var t=window.crypto;if(t&&t.getRandomValues){var r=new Uint8Array(16);return t.getRandomValues(r),r[6]|=64,r[6]&=79,r[8]|=128,r[8]&=191,e.decimalToHex(r[0])+e.decimalToHex(r[1])+e.decimalToHex(r[2])+e.decimalToHex(r[3])+"-"+e.decimalToHex(r[4])+e.decimalToHex(r[5])+"-"+e.decimalToHex(r[6])+e.decimalToHex(r[7])+"-"+e.decimalToHex(r[8])+e.decimalToHex(r[9])+"-"+e.decimalToHex(r[10])+e.decimalToHex(r[11])+e.decimalToHex(r[12])+e.decimalToHex(r[13])+e.decimalToHex(r[14])+e.decimalToHex(r[15])}for(var o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",n="0123456789abcdef",i=0,a="",s=0;s<36;s++)"-"!==o[s]&&"4"!==o[s]&&(i=16*Math.random()|0),"x"===o[s]?a+=n[i]:"y"===o[s]?(i&=3,a+=n[i|=8]):a+=o[s];return a},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.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e.base64Encode=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(Number("0x"+t))}))},e.base64Decode=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")}return decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))},e.deserialize=function(e){var t,r=/\+/g,o=/([^&=]+)=([^&]*)/g,n=function(e){return decodeURIComponent(decodeURIComponent(e.replace(r," ")))},i={};for(t=o.exec(e);t;)i[n(t[1])]=n(t[2]),t=o.exec(e);return i},e}();t.CryptoUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.isEmpty=function(e){return void 0===e||!e||0===e.length},e}();t.StringUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=r(9),i=r(3),a=r(2),s=function(){function e(){}return e.createNavigateUrl=function(e){var t=this.createNavigationUrlString(e),r=e.authorityInstance.AuthorizationEndpoint;return r.indexOf("?")<0?r+="?":r+="&",""+r+t.join("&")},e.createNavigationUrlString=function(e){var t=e.scopes;-1===t.indexOf(e.clientId)&&t.push(e.clientId);var r=[];return r.push("response_type="+e.responseType),this.translateclientIdUsedInScope(t,e.clientId),r.push("scope="+encodeURIComponent(n.ScopeSet.parseScope(t))),r.push("client_id="+encodeURIComponent(e.clientId)),r.push("redirect_uri="+encodeURIComponent(e.redirectUri)),r.push("state="+encodeURIComponent(e.state)),r.push("nonce="+encodeURIComponent(e.nonce)),r.push("client_info=1"),r.push("x-client-SKU="+e.xClientSku),r.push("x-client-Ver="+e.xClientVer),e.promptValue&&r.push("prompt="+encodeURIComponent(e.promptValue)),e.claimsValue&&r.push("claims="+encodeURIComponent(e.claimsValue)),e.queryParameters&&r.push(e.queryParameters),e.extraQueryParameters&&r.push(e.extraQueryParameters),r.push("client-request-id="+encodeURIComponent(e.correlationId)),r},e.translateclientIdUsedInScope=function(e,t){var r=e.indexOf(t);r>=0&&(e.splice(r,1),-1===e.indexOf("openid")&&e.push("openid"),-1===e.indexOf("profile")&&e.push("profile"))},e.getCurrentUrl=function(){return window.location.href.split("?")[0].split("#")[0]},e.removeHashFromUrl=function(e){return e.split("#")[0]},e.replaceTenantPath=function(e,t){e=e.toLowerCase();var r=this.GetUrlComponents(e),n=r.PathSegments;return t&&0!==n.length&&n[0]===o.Constants.common&&(n[0]=t),this.constructAuthorityUriFromObject(r,n)},e.constructAuthorityUriFromObject=function(e,t){return this.CanonicalizeUri(e.Protocol+"//"+e.HostNameAndPort+"/"+t.join("/"))},e.GetUrlComponents=function(e){if(!e)throw"Url required";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=e.match(t);if(!r||r.length<6)throw"Valid url required";var o={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5]},n=o.AbsolutePath.split("/");return n=n.filter(function(e){return e&&e.length>0}),o.PathSegments=n,r[6]&&(o.Search=r[6]),r[8]&&(o.Hash=r[8]),o},e.CanonicalizeUri=function(t){return t&&(t=t.toLowerCase()),t&&!e.endsWith(t,"/")&&(t+="/"),t},e.endsWith=function(e,t){return!(!e||!t)&&-1!==e.indexOf(t,e.length-t.length)},e.urlRemoveQueryStringParameter=function(e,t){if(i.StringUtils.isEmpty(e))return e;var r=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+&"),e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+"),e=e.replace(r,"")},e.getHashFromUrl=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):e},e.urlContainsHash=function(t){var r=e.deserializeHash(t);return r.hasOwnProperty(o.ServerHashParamKeys.ERROR_DESCRIPTION)||r.hasOwnProperty(o.ServerHashParamKeys.ERROR)||r.hasOwnProperty(o.ServerHashParamKeys.ACCESS_TOKEN)||r.hasOwnProperty(o.ServerHashParamKeys.ID_TOKEN)},e.deserializeHash=function(t){var r=e.getHashFromUrl(t);return a.CryptoUtils.deserialize(r)},e.getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},e}();t.UrlUtils=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(6);t.ClientConfigurationErrorMessage={configurationNotSet:{code:"no_config_set",desc:"Configuration has not been set. Please call the UserAgentApplication constructor with a valid Configuration object."},storageNotSupported:{code:"storage_not_supported",desc:"The value for the cacheLocation is not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call handleRedirectCallback() 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."},scopesRequired:{code:"scopes_required",desc:"Scopes are required to obtain an access token."},emptyScopes:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as empty array."},nonArrayScopes:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientScope:{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' and 'none'"},invalidAuthorityType:{code:"invalid_authority_type",desc:"The given authority is not a valid type of authority supported by MSAL. Please see here for valid authorities: <insert URL here>."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https."},authorityUriInvalidPath:{code:"authority_uri_invalid_path",desc:"Given authority URI is invalid."},unsupportedAuthorityValidation:{code:"unsupported_authority_validation",desc:"The authority validation is not supported for this authority type."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter or set validateAuthority=false."},b2cAuthorityUriInvalidPath:{code:"b2c_authority_uri_invalid_path",desc:"The given URI for the B2C authority is invalid."},b2cKnownAuthoritiesNotSet:{code:"b2c_known_authorities_not_set",desc:"Must set known authorities when validateAuthority is set to True and using B2C"},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},emptyRequestError:{code:"empty_request_error",desc:"Request object is required."},invalidCorrelationIdError:{code:"invalid_guid_sent_as_correlationId",desc:"Please set the correlationId as a valid guid"},telemetryConfigError:{code:"telemetry_config_error",desc:"Telemetry config is not configured with required values"},ssoSilentError:{code:"sso_silent_error",desc:"request must contain either sid or login_hint"},invalidAuthorityMetadataError:{code:"authority_metadata_error",desc:"Invalid authorityMetadata. Must be a JSON object containing authorization_endpoint, end_session_endpoint, and issuer fields."}};var i=function(e){function r(t,o){var n=e.call(this,t,o)||this;return n.name="ClientConfigurationError",Object.setPrototypeOf(n,r.prototype),n}return o.__extends(r,e),r.createNoSetConfigurationError=function(){return new r(t.ClientConfigurationErrorMessage.configurationNotSet.code,""+t.ClientConfigurationErrorMessage.configurationNotSet.desc)},r.createStorageNotSupportedError=function(e){return new r(t.ClientConfigurationErrorMessage.storageNotSupported.code,t.ClientConfigurationErrorMessage.storageNotSupported.desc+" Given location: "+e)},r.createRedirectCallbacksNotSetError=function(){return new r(t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.code,t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc)},r.createInvalidCallbackObjectError=function(e){return new r(t.ClientConfigurationErrorMessage.invalidCallbackObject.code,t.ClientConfigurationErrorMessage.invalidCallbackObject.desc+" Given value for callback function: "+e)},r.createEmptyScopesArrayError=function(e){return new r(t.ClientConfigurationErrorMessage.emptyScopes.code,t.ClientConfigurationErrorMessage.emptyScopes.desc+" Given value: "+e+".")},r.createScopesNonArrayError=function(e){return new r(t.ClientConfigurationErrorMessage.nonArrayScopes.code,t.ClientConfigurationErrorMessage.nonArrayScopes.desc+" Given value: "+e+".")},r.createClientIdSingleScopeError=function(e){return new r(t.ClientConfigurationErrorMessage.clientScope.code,t.ClientConfigurationErrorMessage.clientScope.desc+" Given value: "+e+".")},r.createScopesRequiredError=function(e){return new r(t.ClientConfigurationErrorMessage.scopesRequired.code,t.ClientConfigurationErrorMessage.scopesRequired.desc+" Given value: "+e)},r.createInvalidPromptError=function(e){return new r(t.ClientConfigurationErrorMessage.invalidPrompt.code,t.ClientConfigurationErrorMessage.invalidPrompt.desc+" Given value: "+e)},r.createClaimsRequestParsingError=function(e){return new r(t.ClientConfigurationErrorMessage.claimsRequestParsingError.code,t.ClientConfigurationErrorMessage.claimsRequestParsingError.desc+" Given value: "+e)},r.createEmptyRequestError=function(){var e=t.ClientConfigurationErrorMessage.emptyRequestError;return new r(e.code,e.desc)},r.createInvalidCorrelationIdError=function(){return new r(t.ClientConfigurationErrorMessage.invalidCorrelationIdError.code,t.ClientConfigurationErrorMessage.invalidCorrelationIdError.desc)},r.createKnownAuthoritiesNotSetError=function(){return new r(t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code,t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc)},r.createInvalidAuthorityTypeError=function(){return new r(t.ClientConfigurationErrorMessage.invalidAuthorityType.code,t.ClientConfigurationErrorMessage.invalidAuthorityType.desc)},r.createUntrustedAuthorityError=function(e){return new r(t.ClientConfigurationErrorMessage.untrustedAuthority.code,t.ClientConfigurationErrorMessage.untrustedAuthority.desc+" Provided Authority: "+e)},r.createTelemetryConfigError=function(e){var o=t.ClientConfigurationErrorMessage.telemetryConfigError,n=o.code,i=o.desc,a={applicationName:"string",applicationVersion:"string",telemetryEmitter:"function"};return new r(n,i+" mising values: "+Object.keys(a).reduce(function(t,r){return e[r]?t:t.concat([r+" ("+a[r]+")"])},[]).join(","))},r.createSsoSilentError=function(){return new r(t.ClientConfigurationErrorMessage.ssoSilentError.code,t.ClientConfigurationErrorMessage.ssoSilentError.desc)},r.createInvalidAuthorityMetadataError=function(){return new r(t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code,t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc)},r}(n.ClientAuthError);t.ClientConfigurationError=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(7),i=r(3);t.ClientAuthErrorMessage={multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority."},multipleCacheAuthorities:{code:"multiple_authorities",desc:"Multiple authorities found in the cache. Pass authority in the API overload."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},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."},tokenRenewalError:{code:"token_renewal_error",desc:"Token renewal operation failed due to timeout."},invalidIdToken:{code:"invalid_id_token",desc:"Invalid ID token format."},invalidStateError:{code:"invalid_state_error",desc:"Invalid state."},nonceMismatchError:{code:"nonce_mismatch_error",desc:"Nonce is not matching, Nonce received: "},loginProgressError:{code:"login_progress_error",desc:"Login_In_Progress: Error during login call - login is already in progress."},acquireTokenProgressError:{code:"acquiretoken_progress_error",desc:"AcquireToken_In_Progress: Error during login call - login is already in progress."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},callbackError:{code:"callback_error",desc:"Error occurred in token received callback function."},userLoginRequiredError:{code:"user_login_error",desc:"User login is required. For silent calls, request must contain either sid or login_hint"},userDoesNotExistError:{code:"user_non_existent",desc:"User object does not exist. Please call a login API."},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."},clientInfoNotPopulatedError:{code:"client_info_not_populated_error",desc:"The service did not populate client_info in the response, Please verify with the service team"},nullOrEmptyIdToken:{code:"null_or_empty_id_token",desc:"The idToken is null or empty. Please review the trace to determine the root cause."},idTokenNotParsed:{code:"id_token_parsing_error",desc:"ID token cannot be parsed. Please review stack trace to determine root cause."},tokenEncodingError:{code:"token_encoding_error",desc:"The token to be decoded is not encoded correctly."},invalidInteractionType:{code:"invalid_interaction_type",desc:"The interaction type passed to the handler was incorrect or unknown"},cacheParseError:{code:"cannot_parse_cache",desc:"The cached token key is not a valid JSON and cannot be parsed"},blockTokenRequestsInHiddenIframe:{code:"block_token_requests",desc:"Token calls are blocked in hidden iframes"}};var a=function(e){function r(t,o){var n=e.call(this,t,o)||this;return n.name="ClientAuthError",Object.setPrototypeOf(n,r.prototype),n}return o.__extends(r,e),r.createEndpointResolutionError=function(e){var o=t.ClientAuthErrorMessage.endpointResolutionError.desc;return e&&!i.StringUtils.isEmpty(e)&&(o+=" Details: "+e),new r(t.ClientAuthErrorMessage.endpointResolutionError.code,o)},r.createMultipleMatchingTokensInCacheError=function(e){return new r(t.ClientAuthErrorMessage.multipleMatchingTokens.code,"Cache error for scope "+e+": "+t.ClientAuthErrorMessage.multipleMatchingTokens.desc+".")},r.createMultipleAuthoritiesInCacheError=function(e){return new r(t.ClientAuthErrorMessage.multipleCacheAuthorities.code,"Cache error for scope "+e+": "+t.ClientAuthErrorMessage.multipleCacheAuthorities.desc+".")},r.createPopupWindowError=function(e){var o=t.ClientAuthErrorMessage.popUpWindowError.desc;return e&&!i.StringUtils.isEmpty(e)&&(o+=" Details: "+e),new r(t.ClientAuthErrorMessage.popUpWindowError.code,o)},r.createTokenRenewalTimeoutError=function(){return new r(t.ClientAuthErrorMessage.tokenRenewalError.code,t.ClientAuthErrorMessage.tokenRenewalError.desc)},r.createInvalidIdTokenError=function(e){return new r(t.ClientAuthErrorMessage.invalidIdToken.code,t.ClientAuthErrorMessage.invalidIdToken.desc+" Given token: "+e)},r.createInvalidStateError=function(e,o){return new r(t.ClientAuthErrorMessage.invalidStateError.code,t.ClientAuthErrorMessage.invalidStateError.desc+" "+e+", state expected : "+o+".")},r.createNonceMismatchError=function(e,o){return new r(t.ClientAuthErrorMessage.nonceMismatchError.code,t.ClientAuthErrorMessage.nonceMismatchError.desc+" "+e+", nonce expected : "+o+".")},r.createLoginInProgressError=function(){return new r(t.ClientAuthErrorMessage.loginProgressError.code,t.ClientAuthErrorMessage.loginProgressError.desc)},r.createAcquireTokenInProgressError=function(){return new r(t.ClientAuthErrorMessage.acquireTokenProgressError.code,t.ClientAuthErrorMessage.acquireTokenProgressError.desc)},r.createUserCancelledError=function(){return new r(t.ClientAuthErrorMessage.userCancelledError.code,t.ClientAuthErrorMessage.userCancelledError.desc)},r.createErrorInCallbackFunction=function(e){return new r(t.ClientAuthErrorMessage.callbackError.code,t.ClientAuthErrorMessage.callbackError.desc+" "+e+".")},r.createUserLoginRequiredError=function(){return new r(t.ClientAuthErrorMessage.userLoginRequiredError.code,t.ClientAuthErrorMessage.userLoginRequiredError.desc)},r.createUserDoesNotExistError=function(){return new r(t.ClientAuthErrorMessage.userDoesNotExistError.code,t.ClientAuthErrorMessage.userDoesNotExistError.desc)},r.createClientInfoDecodingError=function(e){return new r(t.ClientAuthErrorMessage.clientInfoDecodingError.code,t.ClientAuthErrorMessage.clientInfoDecodingError.desc+" Failed with error: "+e)},r.createClientInfoNotPopulatedError=function(e){return new r(t.ClientAuthErrorMessage.clientInfoNotPopulatedError.code,t.ClientAuthErrorMessage.clientInfoNotPopulatedError.desc+" Failed with error: "+e)},r.createIdTokenNullOrEmptyError=function(e){return new r(t.ClientAuthErrorMessage.nullOrEmptyIdToken.code,t.ClientAuthErrorMessage.nullOrEmptyIdToken.desc+" Raw ID Token Value: "+e)},r.createIdTokenParsingError=function(e){return new r(t.ClientAuthErrorMessage.idTokenNotParsed.code,t.ClientAuthErrorMessage.idTokenNotParsed.desc+" Failed with error: "+e)},r.createTokenEncodingError=function(e){return new r(t.ClientAuthErrorMessage.tokenEncodingError.code,t.ClientAuthErrorMessage.tokenEncodingError.desc+" Attempted to decode: "+e)},r.createInvalidInteractionTypeError=function(){return new r(t.ClientAuthErrorMessage.invalidInteractionType.code,t.ClientAuthErrorMessage.invalidInteractionType.desc)},r.createCacheParseError=function(e){var o="invalid key: "+e+", "+t.ClientAuthErrorMessage.cacheParseError.desc;return new r(t.ClientAuthErrorMessage.cacheParseError.code,o)},r.createBlockTokenRequestsInHiddenIframeError=function(){return new r(t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code,t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc)},r}(n.AuthError);t.ClientAuthError=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0);t.AuthErrorMessage={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},noWindowObjectError:{code:"no_window_object",desc:"No window object available. Details:"}};var n=function(e){function r(t,o){var n=e.call(this,o)||this;return Object.setPrototypeOf(n,r.prototype),n.errorCode=t,n.errorMessage=o,n.name="AuthError",n}return o.__extends(r,e),r.createUnexpectedError=function(e){return new r(t.AuthErrorMessage.unexpectedError.code,t.AuthErrorMessage.unexpectedError.desc+": "+e)},r.createNoWindowObjectError=function(e){return new r(t.AuthErrorMessage.noWindowObjectError.code,t.AuthErrorMessage.noWindowObjectError.desc+" "+e)},r}(Error);t.AuthError=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_NAME_PREFIX="msal.",t.EVENT_NAME_KEY="event_name",t.START_TIME_KEY="start_time",t.ELAPSED_TIME_KEY="elapsed_time",t.TELEMETRY_BLOB_EVENT_NAMES={MsalCorrelationIdConstStrKey:"Microsoft.MSAL.correlation_id",ApiTelemIdConstStrKey:"msal.api_telem_id",ApiIdConstStrKey:"msal.api_id",BrokerAppConstStrKey:"Microsoft_MSAL_broker_app",CacheEventCountConstStrKey:"Microsoft_MSAL_cache_event_count",HttpEventCountTelemetryBatchKey:"Microsoft_MSAL_http_event_count",IdpConstStrKey:"Microsoft_MSAL_idp",IsSilentTelemetryBatchKey:"",IsSuccessfulConstStrKey:"Microsoft_MSAL_is_successful",ResponseTimeConstStrKey:"Microsoft_MSAL_response_time",TenantIdConstStrKey:"Microsoft_MSAL_tenant_id",UiEventCountTelemetryBatchKey:"Microsoft_MSAL_ui_event_count"},t.TENANT_PLACEHOLDER="<tenant>"},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=r(1),i=function(){function e(){}return e.isIntersectingScopes=function(e,t){for(var r=this.trimAndConvertArrayToLowerCase(e.slice()),o=this.trimAndConvertArrayToLowerCase(t.slice()),n=0;n<o.length;n++)if(r.indexOf(o[n].toLowerCase())>-1)return!0;return!1},e.containsScope=function(e,t){var r=this.trimAndConvertArrayToLowerCase(e.slice());return this.trimAndConvertArrayToLowerCase(t.slice()).every(function(e){return r.indexOf(e.toString().toLowerCase())>=0})},e.trimAndConvertToLowerCase=function(e){return e.trim().toLowerCase()},e.trimAndConvertArrayToLowerCase=function(e){var t=this;return e.map(function(e){return t.trimAndConvertToLowerCase(e)})},e.removeElement=function(e,t){var r=this.trimAndConvertToLowerCase(t);return e.filter(function(e){return e!==r})},e.parseScope=function(e){var t="";if(e)for(var r=0;r<e.length;++r)t+=r!==e.length-1?e[r]+" ":e[r];return t},e.validateInputScope=function(e,t,r){if(e){if(!Array.isArray(e))throw o.ClientConfigurationError.createScopesNonArrayError(e);if(e.length<1)throw o.ClientConfigurationError.createEmptyScopesArrayError(e.toString());if(e.indexOf(r)>-1&&e.length>1)throw o.ClientConfigurationError.createClientIdSingleScopeError(e.toString())}else if(t)throw o.ClientConfigurationError.createScopesRequiredError(e)},e.getScopeFromState=function(e){if(e){var t=e.indexOf(n.Constants.resourceDelimiter);if(t>-1&&t+1<e.length)return e.substring(t+1)}return""},e.appendScopes=function(e,t){if(e){var r=t?this.trimAndConvertArrayToLowerCase(t.slice()):null,o=this.trimAndConvertArrayToLowerCase(e.slice());return r?o.concat(r):o}return null},e}();t.ScopeSet=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),n=r(2),i=r(4),a=r(21);t.scrubTenantFromUri=function(e){var t=i.UrlUtils.GetUrlComponents(e);if(a.AuthorityFactory.isAdfs(e))return e;var r=t.PathSegments;if(r&&r.length>=2){var n="tfp"===r[1]?2:1;n<r.length&&(r[n]=o.TENANT_PLACEHOLDER)}return t.Protocol+"//"+t.HostNameAndPort+"/"+r.join("/")},t.hashPersonalIdentifier=function(e){return n.CryptoUtils.base64Encode(e)},t.prependEventNamePrefix=function(e){return""+o.EVENT_NAME_PREFIX+(e||"")},t.supportsBrowserPerformance=function(){return!!("undefined"!=typeof window&&"performance"in window&&window.performance.mark&&window.performance.measure)},t.endBrowserPerformanceMeasurement=function(e,r,o){t.supportsBrowserPerformance()&&(window.performance.mark(o),window.performance.measure(e,r,o),window.performance.clearMeasures(e),window.performance.clearMarks(r),window.performance.clearMarks(o))},t.startBrowserPerformanceMeasurement=function(e){t.supportsBrowserPerformance()&&window.performance.mark(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.parseExpiresIn=function(e){return e||(e="3599"),parseInt(e,10)},e.now=function(){return Math.round((new Date).getTime()/1e3)},e.relativeNowMs=function(){return window.performance.now()},e}();t.TimeUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n=r(3),i=r(1);!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Verbose=3]="Verbose"}(o=t.LogLevel||(t.LogLevel={}));var a=function(){function e(e,t){void 0===t&&(t={}),this.level=o.Info;var r=t.correlationId,n=void 0===r?"":r,i=t.level,a=void 0===i?o.Info:i,s=t.piiLoggingEnabled,c=void 0!==s&&s;this.localCallback=e,this.correlationId=n,this.level=a,this.piiLoggingEnabled=c}return e.prototype.logMessage=function(e,t,r){if(!(e>this.level||!this.piiLoggingEnabled&&r)){var a,s=(new Date).toUTCString();a=n.StringUtils.isEmpty(this.correlationId)?s+":"+i.libraryVersion()+"-"+o[e]+(r?"-pii":"")+" "+t:s+":"+this.correlationId+"-"+i.libraryVersion()+"-"+o[e]+(r?"-pii":"")+" "+t,this.executeCallback(e,a,r)}},e.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},e.prototype.error=function(e){this.logMessage(o.Error,e,!1)},e.prototype.errorPii=function(e){this.logMessage(o.Error,e,!0)},e.prototype.warning=function(e){this.logMessage(o.Warning,e,!1)},e.prototype.warningPii=function(e){this.logMessage(o.Warning,e,!0)},e.prototype.info=function(e){this.logMessage(o.Info,e,!1)},e.prototype.infoPii=function(e){this.logMessage(o.Info,e,!0)},e.prototype.verbose=function(e){this.logMessage(o.Verbose,e,!1)},e.prototype.verbosePii=function(e){this.logMessage(o.Verbose,e,!0)},e.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled},e}();t.Logger=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(7);t.ServerErrorMessage={serverUnavailable:{code:"server_unavailable",desc:"Server is temporarily unavailable."},unknownServerError:{code:"unknown_server_error"}};var i=function(e){function r(t,o){var n=e.call(this,t,o)||this;return n.name="ServerError",Object.setPrototypeOf(n,r.prototype),n}return o.__extends(r,e),r.createServerUnavailableError=function(){return new r(t.ServerErrorMessage.serverUnavailable.code,t.ServerErrorMessage.serverUnavailable.desc)},r.createUnknownServerError=function(e){return new r(t.ServerErrorMessage.unknownServerError.code,e)},r}(n.AuthError);t.ServerError=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(8),i=r(8),a=r(10),s=r(2),c=function(){function e(e,t,r){var o;this.eventId=s.CryptoUtils.createNewGuid(),this.label=r,this.event=((o={})[a.prependEventNamePrefix(i.EVENT_NAME_KEY)]=e,o[a.prependEventNamePrefix(i.ELAPSED_TIME_KEY)]=-1,o[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=t,o)}return e.prototype.setElapsedTime=function(e){this.event[a.prependEventNamePrefix(i.ELAPSED_TIME_KEY)]=e},e.prototype.stop=function(){this.setElapsedTime(+Date.now()-+this.startTimestamp),a.endBrowserPerformanceMeasurement(this.displayName,this.perfStartMark,this.perfEndMark)},e.prototype.start=function(){this.startTimestamp=Date.now(),this.event[a.prependEventNamePrefix(i.START_TIME_KEY)]=this.startTimestamp,a.startBrowserPerformanceMeasurement(this.perfStartMark)},Object.defineProperty(e.prototype,"telemetryCorrelationId",{get:function(){return this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]},set:function(e){this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventName",{get:function(){return this.event[a.prependEventNamePrefix(i.EVENT_NAME_KEY)]},enumerable:!0,configurable:!0}),e.prototype.get=function(){return o.__assign({},this.event,{eventId:this.eventId})},Object.defineProperty(e.prototype,"key",{get:function(){return this.telemetryCorrelationId+"_"+this.eventId+"-"+this.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"displayName",{get:function(){return"Msal-"+this.label+"-"+this.telemetryCorrelationId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"perfStartMark",{get:function(){return"start-"+this.key},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"perfEndMark",{get:function(){return"end-"+this.key},enumerable:!0,configurable:!0}),e}();t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(31),i=r(32),a=r(16),s=r(33),c=r(34),u=r(35),l=r(19),h=r(9),d=r(3),p=r(20),g=r(17),f=r(11),y=r(4),m=r(18),v=r(38),E=r(21),C=r(25),T=r(5),I=r(7),b=r(6),S=r(13),_=r(26),A=r(27),w=o.__importDefault(r(39)),P=r(28),k=r(1),R=r(2),O=r(24),N="https://login.microsoftonline.com/common",U="id_token",M="token",L="id_token token",K=function(){function e(e){this.authResponseCallback=null,this.tokenReceivedCallback=null,this.errorReceivedCallback=null,this.config=C.buildConfiguration(e),this.logger=this.config.system.logger,this.clientId=this.config.auth.clientId,this.inCookie=this.config.cache.storeAuthStateInCookie,this.telemetryManager=this.getTelemetryManagerFromConfig(this.config.system.telemetry,this.clientId),O.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.validateAuthority,this.config.auth.knownAuthorities),E.AuthorityFactory.saveMetadataFromConfig(this.config.auth.authority,this.config.auth.authorityMetadata),this.authority=this.config.auth.authority||N,this.cacheStorage=new u.AuthCache(this.clientId,this.config.cache.cacheLocation,this.inCookie),window.activeRenewals={},window.renewStates=[],window.callbackMappedToRenewStates={},window.promiseMappedToRenewStates={},window.msal=this;var t=window.location.hash,r=y.UrlUtils.urlContainsHash(t);(p.WindowUtils.checkIfBackButtonIsPressed(this.cacheStorage),r)&&(this.getResponseState(t).method===k.Constants.interactionTypeRedirect&&this.handleRedirectAuthenticationResponse(t))}return Object.defineProperty(e.prototype,"authority",{get:function(){return this.authorityInstance.CanonicalAuthority},set:function(e){this.authorityInstance=E.AuthorityFactory.CreateInstance(e,this.config.auth.validateAuthority)},enumerable:!0,configurable:!0}),e.prototype.getAuthorityInstance=function(){return this.authorityInstance},e.prototype.handleRedirectCallback=function(e,t){if(!e)throw T.ClientConfigurationError.createInvalidCallbackObjectError(e);t?(this.tokenReceivedCallback=e,this.errorReceivedCallback=t,this.logger.warning("This overload for callback is deprecated - please change the format of the callbacks to a single callback as shown: (err: AuthError, response: AuthResponse).")):this.authResponseCallback=e,this.redirectError?this.authErrorHandler(k.Constants.interactionTypeRedirect,this.redirectError,this.redirectResponse):this.redirectResponse&&this.authResponseHandler(k.Constants.interactionTypeRedirect,this.redirectResponse)},e.prototype.urlContainsHash=function(e){return this.logger.verbose("UrlContainsHash has been called"),y.UrlUtils.urlContainsHash(e)},e.prototype.authResponseHandler=function(e,t,r){if(this.logger.verbose("AuthResponseHandler has been called"),e===k.Constants.interactionTypeRedirect)this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback?(this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling success callback with response"),this.tokenReceivedCallback(t)):this.authResponseCallback&&(this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with response"),this.authResponseCallback(null,t));else{if(e!==k.Constants.interactionTypePopup)throw b.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, resolving"),r(t)}},e.prototype.authErrorHandler=function(e,t,r,o){if(this.logger.verbose("AuthErrorHandler has been called"),this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),e===k.Constants.interactionTypeRedirect)this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback?(this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling error callback"),this.errorReceivedCallback(t,r.accountState)):(this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with error"),this.authResponseCallback(t,r));else{if(e!==k.Constants.interactionTypePopup)throw b.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, rejecting"),o(t)}},e.prototype.loginRedirect=function(e){this.logger.verbose("LoginRedirect has been called");var t=m.RequestUtils.validateRequest(e,!0,this.clientId,k.Constants.interactionTypeRedirect);this.acquireTokenInteractive(k.Constants.interactionTypeRedirect,!0,t,null,null)},e.prototype.acquireTokenRedirect=function(e){this.logger.verbose("AcquireTokenRedirect has been called");var t=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypeRedirect);this.acquireTokenInteractive(k.Constants.interactionTypeRedirect,!1,t,null,null)},e.prototype.loginPopup=function(e){var t=this;this.logger.verbose("LoginPopup has been called");var r=m.RequestUtils.validateRequest(e,!0,this.clientId,k.Constants.interactionTypePopup),o=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.LoginPopup);return new Promise(function(e,o){t.acquireTokenInteractive(k.Constants.interactionTypePopup,!0,r,e,o)}).then(function(e){return t.logger.verbose("Successfully logged in"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!1,e.errorCode),e})},e.prototype.acquireTokenPopup=function(e){var t=this;this.logger.verbose("AcquireTokenPopup has been called");var r=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypePopup),o=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.AcquireTokenPopup);return new Promise(function(e,o){t.acquireTokenInteractive(k.Constants.interactionTypePopup,!1,r,e,o)}).then(function(e){return t.logger.verbose("Successfully acquired token"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!1,e.errorCode),e})},e.prototype.acquireTokenInteractive=function(e,t,r,o,n){var i=this;this.logger.verbose("AcquireTokenInteractive has been called"),p.WindowUtils.blockReloadInHiddenIframes();var s,c=this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS);if(e===k.Constants.interactionTypeRedirect&&this.cacheStorage.setItem(k.TemporaryCacheKeys.REDIRECT_REQUEST,""+k.Constants.inProgress+k.Constants.resourceDelimiter+r.state),c===k.Constants.inProgress){var u=t?b.ClientAuthError.createLoginInProgressError():b.ClientAuthError.createAcquireTokenInProgressError(),l=A.buildResponseStateOnly(this.getAccountState(r.state));return this.cacheStorage.resetTempCacheItems(r.state),void this.authErrorHandler(e,u,l,n)}if(r&&r.account&&!t?(s=r.account,this.logger.verbose("Account set from request")):(s=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),s||a.ServerRequestParameters.isSSOParam(r))this.logger.verbose("User session exists, login not required"),this.acquireTokenHelper(s,e,t,r,o,n);else{if(!t){this.logger.verbose("AcquireToken call, no context or account given"),this.logger.info("User login is required");l=A.buildResponseStateOnly(this.getAccountState(r.state));return this.cacheStorage.resetTempCacheItems(r.state),void this.authErrorHandler(e,b.ClientAuthError.createUserLoginRequiredError(),l,n)}if(this.extractADALIdToken()&&!r.scopes){this.logger.info("ADAL's idToken exists. Extracting login information from ADAL's idToken");var h=this.buildIDTokenRequest(r);this.silentLogin=!0,this.acquireTokenSilent(h).then(function(t){i.silentLogin=!1,i.logger.info("Unified cache call is successful"),i.authResponseHandler(e,t,o)},function(a){i.silentLogin=!1,i.logger.error("Error occurred during unified cache ATS: "+a),i.acquireTokenHelper(null,e,t,r,o,n)})}else this.logger.verbose("Login call but no token found, proceed to login"),this.acquireTokenHelper(null,e,t,r,o,n)}},e.prototype.acquireTokenHelper=function(e,t,r,n,i,s){return o.__awaiter(this,void 0,Promise,function(){var c,l,h,d,g,f,m,v,C,T;return o.__generator(this,function(o){switch(o.label){case 0:this.logger.verbose("AcquireTokenHelper has been called"),this.logger.verbose("Interaction type: "+t+". isLoginCall: "+r),this.cacheStorage.setItem(k.TemporaryCacheKeys.INTERACTION_STATUS,k.Constants.inProgress),c=n.scopes?n.scopes.join(" ").toLowerCase():this.clientId.toLowerCase(),this.logger.verbosePii("Serialized scopes: "+c),h=n&&n.authority?E.AuthorityFactory.CreateInstance(n.authority,this.config.auth.validateAuthority,n.authorityMetadata):this.authorityInstance,o.label=1;case 1:return o.trys.push([1,11,,12]),h.hasCachedMetadata()?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(h,this.telemetryManager,n.correlationId)]);case 2:return o.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority"),o.label=4;case 4:if(g=r?U:this.getTokenType(e,n.scopes,!1),f=n.redirectStartPage||window.location.href,l=new a.ServerRequestParameters(h,this.clientId,g,this.getRedirectUri(n&&n.redirectUri),n.scopes,n.state,n.correlationId),this.logger.verbose("Finished building server authentication request"),this.updateCacheEntries(l,e,r,f),this.logger.verbose("Updating cache entries"),l.populateQueryParams(e,n),this.logger.verbose("Query parameters populated from account"),m=y.UrlUtils.createNavigateUrl(l)+k.Constants.response_mode_fragment,t===k.Constants.interactionTypeRedirect)r?this.logger.verbose("Interaction type redirect but login call is true. State not cached"):(this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_ACQ_TOKEN,n.state),l.state,this.inCookie),this.logger.verbose("State cached for redirect"),this.logger.verbosePii("State cached: "+l.state));else{if(t!==k.Constants.interactionTypePopup)throw this.logger.verbose("Invalid interaction error. State not cached"),b.ClientAuthError.createInvalidInteractionTypeError();window.renewStates.push(l.state),window.requestType=r?k.Constants.login:k.Constants.renewToken,this.logger.verbose("State saved to window"),this.logger.verbosePii("State saved: "+l.state),this.registerCallback(l.state,c,i,s)}if(t!==k.Constants.interactionTypePopup)return[3,9];this.logger.verbose("Interaction type is popup. Generating popup window");try{d=this.openPopup(m,"msal",k.Constants.popUpWidth,k.Constants.popUpHeight),p.WindowUtils.trackPopup(d)}catch(e){if(this.logger.info(b.ClientAuthErrorMessage.popUpWindowError.code+":"+b.ClientAuthErrorMessage.popUpWindowError.desc),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,b.ClientAuthErrorMessage.popUpWindowError.code),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,b.ClientAuthErrorMessage.popUpWindowError.desc),s)return s(b.ClientAuthError.createPopupWindowError()),[2]}if(!d)return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,p.WindowUtils.monitorPopupForHash(d,this.config.system.loadFrameTimeout,m,this.logger)];case 6:return v=o.sent(),this.handleAuthenticationResponse(v),this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),this.logger.info("Closing popup window"),this.config.framework.isAngular&&(this.broadcast("msal:popUpHashChanged",v),p.WindowUtils.closePopups()),[3,8];case 7:return C=o.sent(),s&&s(C),this.config.framework.isAngular?this.broadcast("msal:popUpClosed",C.errorCode+k.Constants.resourceDelimiter+C.errorMessage):(this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),d.close()),[3,8];case 8:return[3,10];case 9:n.onRedirectNavigate?(this.logger.verbose("Invoking onRedirectNavigate callback"),!1!==n.onRedirectNavigate(m)?(this.logger.verbose("onRedirectNavigate did not return false, navigating"),this.navigateWindow(m)):this.logger.verbose("onRedirectNavigate returned false, stopping navigation")):(this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(m)),o.label=10;case 10:return[3,12];case 11:return T=o.sent(),this.logger.error(T),this.cacheStorage.resetTempCacheItems(n.state),this.authErrorHandler(t,b.ClientAuthError.createEndpointResolutionError(T.toString),A.buildResponseStateOnly(n.state),s),d&&d.close(),[3,12];case 12:return[2]}})})},e.prototype.ssoSilent=function(e){if(this.logger.verbose("ssoSilent has been called"),!e)throw T.ClientConfigurationError.createEmptyRequestError();if(!e.sid&&!e.loginHint)throw T.ClientConfigurationError.createSsoSilentError();return this.acquireTokenSilent(o.__assign({},e,{scopes:[this.clientId]}))},e.prototype.acquireTokenSilent=function(e){var t=this;this.logger.verbose("AcquireTokenSilent has been called");var r=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypeSilent),n=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.AcquireTokenSilent),i=m.RequestUtils.createRequestSignature(r);return new Promise(function(e,n){return o.__awaiter(t,void 0,void 0,function(){var t,s,c,u,l,h,f,y,m,v,C;return o.__generator(this,function(o){switch(o.label){case 0:if(p.WindowUtils.blockReloadInHiddenIframes(),t=r.scopes.join(" ").toLowerCase(),this.logger.verbosePii("Serialized scopes: "+t),r.account?(s=r.account,this.logger.verbose("Account set from request")):(s=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),c=this.cacheStorage.getItem(k.Constants.adalIdToken),!s&&!r.sid&&!r.loginHint&&d.StringUtils.isEmpty(c))return this.logger.info("User login is required"),[2,n(b.ClientAuthError.createUserLoginRequiredError())];if(u=this.getTokenType(s,r.scopes,!0),this.logger.verbose("Response type: "+u),l=new a.ServerRequestParameters(E.AuthorityFactory.CreateInstance(r.authority,this.config.auth.validateAuthority,r.authorityMetadata),this.clientId,u,this.getRedirectUri(r.redirectUri),r.scopes,r.state,r.correlationId),this.logger.verbose("Finished building server authentication request"),a.ServerRequestParameters.isSSOParam(r)||s?(l.populateQueryParams(s,r,null,!0),this.logger.verbose("Query parameters populated from existing SSO or account")):s||d.StringUtils.isEmpty(c)?this.logger.verbose("No additional query parameters added"):(h=g.TokenUtils.extractIdToken(c),this.logger.verbose("ADAL's idToken exists. Extracting login information from ADAL's idToken to populate query parameters"),l.populateQueryParams(s,null,h,!0)),!(f=r.claimsRequest||l.claimsValue)&&!r.forceRefresh)try{m=this.getCachedToken(l,s)}catch(e){y=e}return m?(this.logger.verbose("Token found in cache lookup"),this.logger.verbosePii("Scopes found: "+JSON.stringify(m.scopes)),e(m),[2,null]):[3,1];case 1:return y?(this.logger.infoPii(y.errorCode+":"+y.errorMessage),n(y),[2,null]):[3,2];case 2:v=void 0,v=f?"Skipped cache lookup since claims were given":r.forceRefresh?"Skipped cache lookup since request.forceRefresh option was set to true":"No token found in cache lookup",this.logger.verbose(v),l.authorityInstance||(l.authorityInstance=r.authority?E.AuthorityFactory.CreateInstance(r.authority,this.config.auth.validateAuthority,r.authorityMetadata):this.authorityInstance),this.logger.verbosePii("Authority instance: "+l.authority),o.label=3;case 3:return o.trys.push([3,7,,8]),l.authorityInstance.hasCachedMetadata()?[3,5]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(l.authorityInstance,this.telemetryManager,r.correlationId)]);case 4:return o.sent(),this.logger.verbose("Authority has been updated with endpoint discovery response"),[3,6];case 5:this.logger.verbose("Cached metadata found for authority"),o.label=6;case 6:return window.activeRenewals[i]?(this.logger.verbose("Renewing token in progress. Registering callback"),this.registerCallback(window.activeRenewals[i],i,e,n)):r.scopes&&r.scopes.indexOf(this.clientId)>-1&&1===r.scopes.length?(this.logger.verbose("ClientId is the only scope, renewing idToken"),this.silentLogin=!0,this.renewIdToken(i,e,n,s,l)):(this.logger.verbose("Renewing access token"),this.renewToken(i,e,n,s,l)),[3,8];case 7:return C=o.sent(),this.logger.error(C),n(b.ClientAuthError.createEndpointResolutionError(C.toString())),[2,null];case 8:return[2]}})})}).then(function(e){return t.logger.verbose("Successfully acquired token"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,n,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,n,!1,e.errorCode),e})},e.prototype.openPopup=function(e,t,r,o){this.logger.verbose("OpenPopup has been called");try{var n=window.screenLeft?window.screenLeft:window.screenX,i=window.screenTop?window.screenTop:window.screenY,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=a/2-r/2+n,u=s/2-o/2+i,l=window.open(e,t,"width="+r+", height="+o+", top="+u+", left="+c+", scrollbars=yes");if(!l)throw b.ClientAuthError.createPopupWindowError();return l.focus&&l.focus(),l}catch(e){throw this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),b.ClientAuthError.createPopupWindowError(e.toString())}},e.prototype.loadIframeTimeout=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var n,i,a,s,c;return o.__generator(this,function(o){switch(o.label){case 0:return n=window.activeRenewals[r],this.logger.verbosePii("Set loading state to pending for: "+r+":"+n),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n),k.Constants.inProgress),this.config.system.navigateFrameWait?[4,p.WindowUtils.loadFrame(e,t,this.config.system.navigateFrameWait,this.logger)]:[3,2];case 1:return a=o.sent(),[3,3];case 2:a=p.WindowUtils.loadFrameSync(e,t,this.logger),o.label=3;case 3:i=a,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,p.WindowUtils.monitorIframeForHash(i.contentWindow,this.config.system.loadFrameTimeout,e,this.logger)];case 5:return(s=o.sent())&&this.handleAuthenticationResponse(s),[3,7];case 6:throw c=o.sent(),this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n))===k.Constants.inProgress&&(this.logger.verbose("Loading frame has timed out after: "+this.config.system.loadFrameTimeout/1e3+" seconds for scope/authority "+r+":"+n),n&&window.callbackMappedToRenewStates[n]&&window.callbackMappedToRenewStates[n](null,c),this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n))),p.WindowUtils.removeHiddenIframe(i),c;case 7:return p.WindowUtils.removeHiddenIframe(i),[2]}})})},e.prototype.navigateWindow=function(e,t){if(!e||d.StringUtils.isEmpty(e))throw this.logger.info("Navigate url is empty"),I.AuthError.createUnexpectedError("Navigate url is empty");var r=t||window,o=t?"Navigated Popup window to:"+e:"Navigate to:"+e;this.logger.infoPii(o),r.location.assign(e)},e.prototype.registerCallback=function(e,t,r,o){var n=this;window.activeRenewals[t]=e,window.promiseMappedToRenewStates[e]||(window.promiseMappedToRenewStates[e]=[]),window.promiseMappedToRenewStates[e].push({resolve:r,reject:o}),window.callbackMappedToRenewStates[e]||(window.callbackMappedToRenewStates[e]=function(r,o){window.activeRenewals[t]=null;for(var i=0;i<window.promiseMappedToRenewStates[e].length;++i)try{if(o)window.promiseMappedToRenewStates[e][i].reject(o);else{if(!r)throw n.cacheStorage.resetTempCacheItems(e),I.AuthError.createUnexpectedError("Error and response are both null");window.promiseMappedToRenewStates[e][i].resolve(r)}}catch(e){n.logger.warning(e)}window.promiseMappedToRenewStates[e]=null,window.callbackMappedToRenewStates[e]=null})},e.prototype.logout=function(e){this.logger.verbose("Logout has been called"),this.logoutAsync(e)},e.prototype.logoutAsync=function(e){return o.__awaiter(this,void 0,Promise,function(){var t,r,n,i,a,s;return o.__generator(this,function(o){switch(o.label){case 0:t=e||R.CryptoUtils.createNewGuid(),r=this.telemetryManager.createAndStartApiEvent(t,P.API_EVENT_IDENTIFIER.Logout),this.clearCache(),this.account=null,o.label=1;case 1:return o.trys.push([1,5,,6]),this.authorityInstance.hasCachedMetadata()?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(this.authorityInstance,this.telemetryManager,e)]);case 2:return o.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority"),o.label=4;case 4:return n="client-request-id="+t,i=void 0,this.getPostLogoutRedirectUri()?(i="&post_logout_redirect_uri="+encodeURIComponent(this.getPostLogoutRedirectUri()),this.logger.verbose("redirectUri found and set")):(i="",this.logger.verbose("No redirectUri set for app. postLogoutQueryParam is empty")),a=void 0,this.authorityInstance.EndSessionEndpoint?(a=this.authorityInstance.EndSessionEndpoint+"?"+n+i,this.logger.verbose("EndSessionEndpoint found and urlNavigate set"),this.logger.verbosePii("urlNavigate set to: "+this.authorityInstance.EndSessionEndpoint)):(a=this.authority+"oauth2/v2.0/logout?"+n+i,this.logger.verbose("No endpoint, urlNavigate set to default")),this.telemetryManager.stopAndFlushApiEvent(t,r,!0),this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(a),[3,6];case 5:return s=o.sent(),this.telemetryManager.stopAndFlushApiEvent(t,r,!1,s.errorCode),[3,6];case 6:return[2]}})})},e.prototype.clearCache=function(){this.logger.verbose("Clearing cache"),window.renewStates=[];for(var e=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),t=0;t<e.length;t++)this.cacheStorage.removeItem(JSON.stringify(e[t].key));this.cacheStorage.resetCacheItems(),this.cacheStorage.clearMsalCookie(),this.logger.verbose("Cache cleared")},e.prototype.clearCacheForScope=function(e){this.logger.verbose("Clearing access token from cache");for(var t=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),r=0;r<t.length;r++){var o=t[r];o.value.accessToken===e&&(this.cacheStorage.removeItem(JSON.stringify(o.key)),this.logger.verbosePii("Access token removed: "+o.key))}},e.prototype.isCallback=function(e){return this.logger.info("isCallback will be deprecated in favor of urlContainsHash in MSAL.js v2.0."),this.logger.verbose("isCallback has been called"),y.UrlUtils.urlContainsHash(e)},e.prototype.processCallBack=function(e,t,r){var o,n;this.logger.info("ProcessCallBack has been called. Processing callback from redirect response"),t||(this.logger.verbose("StateInfo is null, getting stateInfo from hash"),t=this.getResponseState(e));try{o=this.saveTokenFromHash(e,t)}catch(e){n=e}try{this.cacheStorage.clearMsalCookie(t.state);var i=this.getAccountState(t.state);if(o){if(t.requestType===k.Constants.renewToken||o.accessToken?(window.parent!==window?this.logger.verbose("Window is in iframe, acquiring token silently"):this.logger.verbose("Acquiring token interactive in progress"),this.logger.verbose("Response tokenType set to "+k.ServerHashParamKeys.ACCESS_TOKEN),o.tokenType=k.ServerHashParamKeys.ACCESS_TOKEN):t.requestType===k.Constants.login&&(this.logger.verbose("Response tokenType set to "+k.ServerHashParamKeys.ID_TOKEN),o.tokenType=k.ServerHashParamKeys.ID_TOKEN),!r)return this.logger.verbose("Setting redirectResponse"),void(this.redirectResponse=o)}else if(!r)return this.logger.verbose("Response is null, setting redirectResponse with state"),this.redirectResponse=A.buildResponseStateOnly(i),this.redirectError=n,void this.cacheStorage.resetTempCacheItems(t.state);this.logger.verbose("Calling callback provided to processCallback"),r(o,n)}catch(e){throw this.logger.error("Error occurred in token received callback function: "+e),b.ClientAuthError.createErrorInCallbackFunction(e.toString())}},e.prototype.handleAuthenticationResponse=function(e){this.logger.verbose("HandleAuthenticationResponse has been called");var t=e||window.location.hash,r=this.getResponseState(t);this.logger.verbose("Obtained state from response");var o=window.callbackMappedToRenewStates[r.state];this.processCallBack(t,r,o),p.WindowUtils.closePopups()},e.prototype.handleRedirectAuthenticationResponse=function(e){this.logger.info("Returned from redirect url"),this.logger.verbose("HandleRedirectAuthenticationResponse has been called"),window.location.hash="",this.logger.verbose("Window.location.hash cleared");var t=this.getResponseState(e);if(this.config.auth.navigateToLoginRequestUrl&&window.parent===window){this.logger.verbose("Window.parent is equal to window, not in popup or iframe. Navigation to login request url after login turned on");var r=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.LOGIN_REQUEST,t.state),this.inCookie);if(!r||"null"===r)return this.logger.error("Unable to get valid login request url from cache, redirecting to home page"),void window.location.assign("/");this.logger.verbose("Valid login request url obtained from cache");var o=y.UrlUtils.removeHashFromUrl(window.location.href),n=y.UrlUtils.removeHashFromUrl(r);if(o!==n)return this.logger.verbose("Current url is not login request url, navigating"),this.logger.verbosePii("CurrentUrl: "+o+", finalRedirectUrl: "+n),void window.location.assign(""+n+e);this.logger.verbose("Current url matches login request url");var i=y.UrlUtils.GetUrlComponents(r);i.Hash&&(this.logger.verbose("Login request url contains hash, resetting non-msal hash"),window.location.hash=i.Hash)}else this.config.auth.navigateToLoginRequestUrl||this.logger.verbose("Default navigation to start page after login turned off");this.processCallBack(e,t,null)},e.prototype.getResponseState=function(e){this.logger.verbose("GetResponseState has been called");var t,r=y.UrlUtils.deserializeHash(e);if(!r)throw I.AuthError.createUnexpectedError("Hash was not parsed correctly.");if(!r.hasOwnProperty(k.ServerHashParamKeys.STATE))throw I.AuthError.createUnexpectedError("Hash does not contain state.");this.logger.verbose("Hash contains state. Creating stateInfo object");var o=m.RequestUtils.parseLibraryState(r.state);if((t={requestType:k.Constants.unknown,state:r.state,timestamp:o.ts,method:o.method,stateMatch:!1}).state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie)||t.state===this.silentAuthenticationState)return this.logger.verbose("State matches cached state, setting requestType to login"),t.requestType=k.Constants.login,t.stateMatch=!0,t;if(t.state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_ACQ_TOKEN,t.state),this.inCookie))return this.logger.verbose("State matches cached state, setting requestType to renewToken"),t.requestType=k.Constants.renewToken,t.stateMatch=!0,t;if(!t.stateMatch){this.logger.verbose("State does not match cached state, setting requestType to type from window"),t.requestType=window.requestType;for(var n=window.renewStates,i=0;i<n.length;i++)if(n[i]===t.state){this.logger.verbose("Matching state found for request"),t.stateMatch=!0;break}t.stateMatch||this.logger.verbose("Matching state not found for request")}return t},e.prototype.getCachedToken=function(e,t){this.logger.verbose("GetCachedToken has been called");var r=null,o=e.scopes,n=this.cacheStorage.getAllAccessTokens(this.clientId,t?t.homeAccountIdentifier:null);if(this.logger.verbose("Getting all cached access tokens"),0===n.length)return this.logger.verbose("No matching tokens found when filtered by clientId and account"),null;var i=[];if(e.authority){this.logger.verbose("Authority passed, filtering by authority and scope");for(a=0;a<n.length;a++){u=(s=n[a]).key.scopes.split(" ");h.ScopeSet.containsScope(u,o)&&y.UrlUtils.CanonicalizeUri(s.key.authority)===e.authority&&i.push(s)}if(0===i.length)return this.logger.verbose("No matching tokens found"),null;if(1!==i.length)throw b.ClientAuthError.createMultipleMatchingTokensInCacheError(o.toString());this.logger.verbose("Single token found"),r=i[0]}else{this.logger.verbose("No authority passed, filtering tokens by scope");for(var a=0;a<n.length;a++){var s,u=(s=n[a]).key.scopes.split(" ");h.ScopeSet.containsScope(u,o)&&i.push(s)}if(1===i.length)this.logger.verbose("One matching token found, setting authorityInstance"),r=i[0],e.authorityInstance=E.AuthorityFactory.CreateInstance(r.key.authority,this.config.auth.validateAuthority);else{if(i.length>1)throw b.ClientAuthError.createMultipleMatchingTokensInCacheError(o.toString());this.logger.verbose("No matching token found when filtering by scope");var l=this.getUniqueAuthority(n,"authority");if(l.length>1)throw b.ClientAuthError.createMultipleAuthoritiesInCacheError(o.toString());this.logger.verbose("Single authority used, setting authorityInstance"),e.authorityInstance=E.AuthorityFactory.CreateInstance(l[0],this.config.auth.validateAuthority)}}if(null!=r){this.logger.verbose("Evaluating access token found");var d=Number(r.value.expiresIn),p=this.config.system.tokenRenewalOffsetSeconds||300;if(d&&d>f.TimeUtils.now()+p){this.logger.verbose("Token expiration is within offset, renewing token");var g=new c.IdToken(r.value.idToken);if(!t&&!(t=this.getAccount()))throw I.AuthError.createUnexpectedError("Account should not be null here.");var m=this.getAccountState(e.state),C={uniqueId:"",tenantId:"",tokenType:r.value.idToken===r.value.accessToken?k.ServerHashParamKeys.ID_TOKEN:k.ServerHashParamKeys.ACCESS_TOKEN,idToken:g,idTokenClaims:g.claims,accessToken:r.value.accessToken,scopes:r.key.scopes.split(" "),expiresOn:new Date(1e3*d),account:t,accountState:m,fromCache:!0};return v.ResponseUtils.setResponseIdToken(C,g),this.logger.verbose("Response generated and token set"),C}return this.logger.verbose("Token expired, removing from cache"),this.cacheStorage.removeItem(JSON.stringify(i[0].key)),null}return this.logger.verbose("No tokens found"),null},e.prototype.getUniqueAuthority=function(e,t){this.logger.verbose("GetUniqueAuthority has been called");var r=[],o=[];return e.forEach(function(e){e.key.hasOwnProperty(t)&&-1===o.indexOf(e.key[t])&&(o.push(e.key[t]),r.push(e.key[t]))}),r},e.prototype.extractADALIdToken=function(){this.logger.verbose("ExtractADALIdToken has been called");var e=this.cacheStorage.getItem(k.Constants.adalIdToken);return d.StringUtils.isEmpty(e)?null:g.TokenUtils.extractIdToken(e)},e.prototype.renewToken=function(e,t,r,o,n){this.logger.verbose("RenewToken has been called"),this.logger.verbosePii("RenewToken scope and authority: "+e);var i=p.WindowUtils.generateFrameName(k.FramePrefix.TOKEN_FRAME,e);p.WindowUtils.addHiddenIFrame(i,this.logger),this.updateCacheEntries(n,o,!1),this.logger.verbosePii("RenewToken expected state: "+n.state);var a=y.UrlUtils.urlRemoveQueryStringParameter(y.UrlUtils.createNavigateUrl(n),k.Constants.prompt)+k.Constants.prompt_none+k.Constants.response_mode_fragment;window.renewStates.push(n.state),window.requestType=k.Constants.renewToken,this.logger.verbose("Set window.renewState and requestType"),this.registerCallback(n.state,e,t,r),this.logger.infoPii("Navigate to: "+a),this.loadIframeTimeout(a,i,e).catch(function(e){return r(e)})},e.prototype.renewIdToken=function(e,t,r,o,n){this.logger.info("RenewIdToken has been called");var i=p.WindowUtils.generateFrameName(k.FramePrefix.ID_TOKEN_FRAME,e);p.WindowUtils.addHiddenIFrame(i,this.logger),this.updateCacheEntries(n,o,!1),this.logger.verbose("RenewIdToken expected state: "+n.state);var a=y.UrlUtils.urlRemoveQueryStringParameter(y.UrlUtils.createNavigateUrl(n),k.Constants.prompt)+k.Constants.prompt_none+k.Constants.response_mode_fragment;this.silentLogin?(this.logger.verbose("Silent login is true, set silentAuthenticationState"),window.requestType=k.Constants.login,this.silentAuthenticationState=n.state):(this.logger.verbose("Not silent login, set window.renewState and requestType"),window.requestType=k.Constants.renewToken,window.renewStates.push(n.state)),this.registerCallback(n.state,e,t,r),this.logger.infoPii('Navigate to:" '+a),this.loadIframeTimeout(a,i,e).catch(function(e){return r(e)})},e.prototype.saveAccessToken=function(e,t,r,a,c){var u;this.logger.verbose("SaveAccessToken has been called");var l,d=o.__assign({},e),p=new s.ClientInfo(a);if(r.hasOwnProperty(k.ServerHashParamKeys.SCOPE)){this.logger.verbose("Response parameters contains scope");var g=(u=r[k.ServerHashParamKeys.SCOPE]).split(" "),y=this.cacheStorage.getAllAccessTokens(this.clientId,t);this.logger.verbose("Retrieving all access tokens from cache and removing duplicates");for(var v=0;v<y.length;v++){var E=y[v];if(E.key.homeAccountIdentifier===e.account.homeAccountIdentifier){var C=E.key.scopes.split(" ");h.ScopeSet.isIntersectingScopes(C,g)&&this.cacheStorage.removeItem(JSON.stringify(E.key))}}var T=f.TimeUtils.parseExpiresIn(r[k.ServerHashParamKeys.EXPIRES_IN]);l=m.RequestUtils.parseLibraryState(r[k.ServerHashParamKeys.STATE]).ts+T;var I=new n.AccessTokenKey(t,this.clientId,u,p.uid,p.utid),b=new i.AccessTokenValue(r[k.ServerHashParamKeys.ACCESS_TOKEN],c.rawIdToken,l.toString(),a);this.cacheStorage.setItem(JSON.stringify(I),JSON.stringify(b)),this.logger.verbose("Saving token to cache"),d.accessToken=r[k.ServerHashParamKeys.ACCESS_TOKEN],d.scopes=g}else{this.logger.verbose("Response parameters does not contain scope, clientId set as scope"),u=this.clientId;I=new n.AccessTokenKey(t,this.clientId,u,p.uid,p.utid);l=Number(c.expiration);b=new i.AccessTokenValue(r[k.ServerHashParamKeys.ID_TOKEN],r[k.ServerHashParamKeys.ID_TOKEN],l.toString(),a);this.cacheStorage.setItem(JSON.stringify(I),JSON.stringify(b)),this.logger.verbose("Saving token to cache"),d.scopes=[u],d.accessToken=r[k.ServerHashParamKeys.ID_TOKEN]}return l?(this.logger.verbose("New expiration set"),d.expiresOn=new Date(1e3*l)):this.logger.error("Could not parse expiresIn parameter"),d},e.prototype.saveTokenFromHash=function(e,t){this.logger.verbose("SaveTokenFromHash has been called"),this.logger.info("State status: "+t.stateMatch+"; Request type: "+t.requestType);var r,o={uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:null,scopes:[],expiresOn:null,account:null,accountState:"",fromCache:!1},n=y.UrlUtils.deserializeHash(e),i="",a="",h=null;if(n.hasOwnProperty(k.ServerHashParamKeys.ERROR_DESCRIPTION)||n.hasOwnProperty(k.ServerHashParamKeys.ERROR)){if(this.logger.verbose("Server returned an error"),this.logger.infoPii("Error : "+n[k.ServerHashParamKeys.ERROR]+"; Error description: "+n[k.ServerHashParamKeys.ERROR_DESCRIPTION]),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,n[k.ServerHashParamKeys.ERROR]),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,n[k.ServerHashParamKeys.ERROR_DESCRIPTION]),t.requestType===k.Constants.login&&(this.logger.verbose("RequestType is login, caching login error, generating authorityKey"),this.cacheStorage.setItem(k.ErrorCacheKeys.LOGIN_ERROR,n[k.ServerHashParamKeys.ERROR_DESCRIPTION]+":"+n[k.ServerHashParamKeys.ERROR]),i=u.AuthCache.generateAuthorityKey(t.state)),t.requestType===k.Constants.renewToken){this.logger.verbose("RequestType is renewToken, generating acquireTokenAccountKey"),i=u.AuthCache.generateAuthorityKey(t.state);var p=this.getAccount(),g=void 0;p&&!d.StringUtils.isEmpty(p.homeAccountIdentifier)?(g=p.homeAccountIdentifier,this.logger.verbose("AccountId is set")):(g=k.Constants.no_account,this.logger.verbose("AccountId is set as no_account")),a=u.AuthCache.generateAcquireTokenAccountKey(g,t.state)}var f=n[k.ServerHashParamKeys.ERROR],m=n[k.ServerHashParamKeys.ERROR_DESCRIPTION];r=_.InteractionRequiredAuthError.isInteractionRequiredError(f)||_.InteractionRequiredAuthError.isInteractionRequiredError(m)?new _.InteractionRequiredAuthError(n[k.ServerHashParamKeys.ERROR],n[k.ServerHashParamKeys.ERROR_DESCRIPTION]):new S.ServerError(n[k.ServerHashParamKeys.ERROR],n[k.ServerHashParamKeys.ERROR_DESCRIPTION])}else if(this.logger.verbose("Server returns success"),t.stateMatch){this.logger.info("State is right"),n.hasOwnProperty(k.ServerHashParamKeys.SESSION_STATE)&&(this.logger.verbose("Fragment has session state, caching"),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.SESSION_STATE,t.state),n[k.ServerHashParamKeys.SESSION_STATE])),o.accountState=this.getAccountState(t.state);var E="";if(n.hasOwnProperty(k.ServerHashParamKeys.ACCESS_TOKEN)){this.logger.info("Fragment has access token"),o.accessToken=n[k.ServerHashParamKeys.ACCESS_TOKEN],n.hasOwnProperty(k.ServerHashParamKeys.SCOPE)&&(o.scopes=n[k.ServerHashParamKeys.SCOPE].split(" ")),n.hasOwnProperty(k.ServerHashParamKeys.ID_TOKEN)?(this.logger.verbose("Fragment has id_token"),h=new c.IdToken(n[k.ServerHashParamKeys.ID_TOKEN]),o.idToken=h,o.idTokenClaims=h.claims):(this.logger.verbose("No idToken on fragment, getting idToken from cache"),h=new c.IdToken(this.cacheStorage.getItem(k.PersistentCacheKeys.IDTOKEN)),o=v.ResponseUtils.setResponseIdToken(o,h));var C=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,h);if(this.logger.verbose("Got authority from cache"),!n.hasOwnProperty(k.ServerHashParamKeys.CLIENT_INFO))throw this.logger.warning("ClientInfo not received in the response from AAD"),b.ClientAuthError.createClientInfoNotPopulatedError("ClientInfo not received in the response from the server");this.logger.verbose("Fragment has clientInfo"),E=n[k.ServerHashParamKeys.CLIENT_INFO],o.account=l.Account.createAccount(h,new s.ClientInfo(E)),this.logger.verbose("Account object created from response");var T=void 0;o.account&&!d.StringUtils.isEmpty(o.account.homeAccountIdentifier)?(this.logger.verbose("AccountKey set"),T=o.account.homeAccountIdentifier):(this.logger.verbose("AccountKey set as no_account"),T=k.Constants.no_account),a=u.AuthCache.generateAcquireTokenAccountKey(T,t.state);var A=u.AuthCache.generateAcquireTokenAccountKey(k.Constants.no_account,t.state);this.logger.verbose("AcquireTokenAccountKey generated");var w=this.cacheStorage.getItem(a),P=void 0;d.StringUtils.isEmpty(w)?d.StringUtils.isEmpty(this.cacheStorage.getItem(A))||(this.logger.verbose("No acquireToken account retrieved from cache"),o=this.saveAccessToken(o,C,n,E,h)):(P=JSON.parse(w),this.logger.verbose("AcquireToken request account retrieved from cache"),o.account&&P&&l.Account.compareAccounts(o.account,P)?(o=this.saveAccessToken(o,C,n,E,h),this.logger.info("The user object received in the response is the same as the one passed in the acquireToken request")):this.logger.warning("The account object created from the response is not the same as the one passed in the acquireToken request"))}if(n.hasOwnProperty(k.ServerHashParamKeys.ID_TOKEN)){this.logger.info("Fragment has idToken"),h=new c.IdToken(n[k.ServerHashParamKeys.ID_TOKEN]),o=v.ResponseUtils.setResponseIdToken(o,h),n.hasOwnProperty(k.ServerHashParamKeys.CLIENT_INFO)?(this.logger.verbose("Fragment has clientInfo"),E=n[k.ServerHashParamKeys.CLIENT_INFO]):this.logger.warning("ClientInfo not received in the response from AAD");C=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,h);if(this.account=l.Account.createAccount(h,new s.ClientInfo(E)),o.account=this.account,this.logger.verbose("Account object created from response"),h&&h.nonce){this.logger.verbose("IdToken has nonce");var R=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.NONCE_IDTOKEN,t.state),this.inCookie);h.nonce!==R?(this.account=null,this.cacheStorage.setItem(k.ErrorCacheKeys.LOGIN_ERROR,"Nonce Mismatch. Expected Nonce: "+R+",Actual Nonce: "+h.nonce),this.logger.error("Nonce Mismatch. Expected Nonce: "+R+", Actual Nonce: "+h.nonce),r=b.ClientAuthError.createNonceMismatchError(R,h.nonce)):(this.logger.verbose("Nonce matches, saving idToken to cache"),this.cacheStorage.setItem(k.PersistentCacheKeys.IDTOKEN,n[k.ServerHashParamKeys.ID_TOKEN],this.inCookie),this.cacheStorage.setItem(k.PersistentCacheKeys.CLIENT_INFO,E,this.inCookie),this.saveAccessToken(o,C,n,E,h))}else this.logger.verbose("No idToken or no nonce. Cache key for Authority set as state"),i=t.state,a=t.state,this.logger.error("Invalid id_token received in the response"),r=b.ClientAuthError.createInvalidIdTokenError(h),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,r.errorCode),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,r.errorMessage)}}else{this.logger.verbose("State mismatch"),i=t.state,a=t.state;var O=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie);this.logger.error("State Mismatch. Expected State: "+O+", Actual State: "+t.state),r=b.ClientAuthError.createInvalidStateError(t.state,O),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,r.errorCode),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,r.errorMessage)}if(this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,t.state)),this.cacheStorage.resetTempCacheItems(t.state),this.logger.verbose("Status set to complete, temporary cache cleared"),this.inCookie&&(this.logger.verbose("InCookie is true, setting authorityKey in cookie"),this.cacheStorage.setItemCookie(i,"",-1),this.cacheStorage.clearMsalCookie(t.state)),r)throw r;if(!o)throw I.AuthError.createUnexpectedError("Response is null");return o},e.prototype.populateAuthority=function(e,t,r,o){this.logger.verbose("PopulateAuthority has been called");var n=u.AuthCache.generateAuthorityKey(e),i=r.getItem(n,t);return d.StringUtils.isEmpty(i)?i:y.UrlUtils.replaceTenantPath(i,o.tenantId)},e.prototype.getAccount=function(){if(this.account)return this.account;var e=this.cacheStorage.getItem(k.PersistentCacheKeys.IDTOKEN,this.inCookie),t=this.cacheStorage.getItem(k.PersistentCacheKeys.CLIENT_INFO,this.inCookie);if(!d.StringUtils.isEmpty(e)&&!d.StringUtils.isEmpty(t)){var r=new c.IdToken(e),o=new s.ClientInfo(t);return this.account=l.Account.createAccount(r,o),this.account}return null},e.prototype.getAccountState=function(e){if(e){var t=e.indexOf(k.Constants.resourceDelimiter);if(t>-1&&t+1<e.length)return e.substring(t+1)}return e},e.prototype.getAllAccounts=function(){for(var e=[],t=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),r=0;r<t.length;r++){var o=new c.IdToken(t[r].value.idToken),n=new s.ClientInfo(t[r].value.homeAccountIdentifier),i=l.Account.createAccount(o,n);e.push(i)}return this.getUniqueAccounts(e)},e.prototype.getUniqueAccounts=function(e){if(!e||e.length<=1)return e;for(var t=[],r=[],o=0;o<e.length;++o)e[o].homeAccountIdentifier&&-1===t.indexOf(e[o].homeAccountIdentifier)&&(t.push(e[o].homeAccountIdentifier),r.push(e[o]));return r},e.prototype.broadcast=function(e,t){var r=new CustomEvent(e,{detail:t});window.dispatchEvent(r)},e.prototype.getCachedTokenInternal=function(e,t,r,o){var n=t||this.getAccount();if(!n)return null;var i=this.authorityInstance?this.authorityInstance:E.AuthorityFactory.CreateInstance(this.authority,this.config.auth.validateAuthority),s=this.getTokenType(n,e,!0),c=new a.ServerRequestParameters(i,this.clientId,s,this.getRedirectUri(),e,r,o);return this.getCachedToken(c,t)},e.prototype.getScopesForEndpoint=function(e){if(this.config.framework.unprotectedResources.length>0)for(var t=0;t<this.config.framework.unprotectedResources.length;t++)if(e.indexOf(this.config.framework.unprotectedResources[t])>-1)return null;if(this.config.framework.protectedResourceMap.size>0)for(var r=0,o=Array.from(this.config.framework.protectedResourceMap.keys());r<o.length;r++){var n=o[r];if(e.indexOf(n)>-1)return this.config.framework.protectedResourceMap.get(n)}return e.indexOf("http://")>-1||e.indexOf("https://")>-1?y.UrlUtils.getHostFromUri(e)===y.UrlUtils.getHostFromUri(this.getRedirectUri())?new Array(this.clientId):null:new Array(this.clientId)},e.prototype.getLoginInProgress=function(){return this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS)===k.Constants.inProgress},e.prototype.setInteractionInProgress=function(e){e?this.cacheStorage.setItem(k.TemporaryCacheKeys.INTERACTION_STATUS,k.Constants.inProgress):this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS)},e.prototype.setloginInProgress=function(e){this.setInteractionInProgress(e)},e.prototype.getAcquireTokenInProgress=function(){return this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS)===k.Constants.inProgress},e.prototype.setAcquireTokenInProgress=function(e){this.setInteractionInProgress(e)},e.prototype.getLogger=function(){return this.logger},e.prototype.setLogger=function(e){this.logger=e},e.prototype.getRedirectUri=function(e){return e||("function"==typeof this.config.auth.redirectUri?this.config.auth.redirectUri():this.config.auth.redirectUri)},e.prototype.getPostLogoutRedirectUri=function(){return"function"==typeof this.config.auth.postLogoutRedirectUri?this.config.auth.postLogoutRedirectUri():this.config.auth.postLogoutRedirectUri},e.prototype.getCurrentConfiguration=function(){if(!this.config)throw T.ClientConfigurationError.createNoSetConfigurationError();return this.config},e.prototype.getTokenType=function(e,t,r){return r?l.Account.compareAccounts(e,this.getAccount())?t.indexOf(this.config.auth.clientId)>-1?U:M:t.indexOf(this.config.auth.clientId)>-1?U:L:l.Account.compareAccounts(e,this.getAccount())?t.indexOf(this.clientId)>-1?U:M:L},e.prototype.setAccountCache=function(e,t){var r=e?this.getAccountId(e):k.Constants.no_account,o=u.AuthCache.generateAcquireTokenAccountKey(r,t);this.cacheStorage.setItem(o,JSON.stringify(e))},e.prototype.setAuthorityCache=function(e,t){var r=u.AuthCache.generateAuthorityKey(e);this.cacheStorage.setItem(r,y.UrlUtils.CanonicalizeUri(t),this.inCookie)},e.prototype.updateCacheEntries=function(e,t,r,o){o&&this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.LOGIN_REQUEST,e.state),o,this.inCookie),r?this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,e.state),e.state,this.inCookie):this.setAccountCache(t,e.state),this.setAuthorityCache(e.state,e.authority),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.NONCE_IDTOKEN,e.state),e.nonce,this.inCookie)},e.prototype.getAccountId=function(e){return d.StringUtils.isEmpty(e.homeAccountIdentifier)?k.Constants.no_account:e.homeAccountIdentifier},e.prototype.buildIDTokenRequest=function(e){return{scopes:[this.clientId],authority:this.authority,account:this.getAccount(),extraQueryParameters:e.extraQueryParameters,correlationId:e.correlationId}},e.prototype.getTelemetryManagerFromConfig=function(e,t){if(!e)return w.default.getTelemetrymanagerStub(t,this.logger);var r=e.applicationName,o=e.applicationVersion,n=e.telemetryEmitter;if(!r||!o||!n)throw T.ClientConfigurationError.createTelemetryConfigError(e);var i={platform:{applicationName:r,applicationVersion:o},clientId:t};return new w.default(i,n,this.logger)},e}();t.UserAgentApplication=K},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(1),i=r(3),a=r(9),s=function(){function e(e,t,r,i,s,c,u){this.authorityInstance=e,this.clientId=t,this.nonce=o.CryptoUtils.createNewGuid(),this.scopes=s?s.slice():[t],this.scopes=a.ScopeSet.trimAndConvertArrayToLowerCase(this.scopes),this.state=c,this.correlationId=u,this.xClientSku="MSAL.JS",this.xClientVer=n.libraryVersion(),this.responseType=r,this.redirectUri=i}return Object.defineProperty(e.prototype,"authority",{get:function(){return this.authorityInstance?this.authorityInstance.CanonicalAuthority:null},enumerable:!0,configurable:!0}),e.prototype.populateQueryParams=function(t,r,o,n){var i={};r&&(r.prompt&&(this.promptValue=r.prompt),r.claimsRequest&&(this.claimsValue=r.claimsRequest),e.isSSOParam(r)&&(i=this.constructUnifiedCacheQueryParameter(r,null))),o&&(i=this.constructUnifiedCacheQueryParameter(null,o)),i=this.addHintParameters(t,i);var a=r?r.extraQueryParameters:null;this.queryParameters=e.generateQueryParametersString(i),this.extraQueryParameters=e.generateQueryParametersString(a,n)},e.prototype.constructUnifiedCacheQueryParameter=function(e,t){var r,o;if(e)if(e.account){var i=e.account;i.sid?(r=n.SSOTypes.SID,o=i.sid):i.userName&&(r=n.SSOTypes.LOGIN_HINT,o=i.userName)}else e.sid?(r=n.SSOTypes.SID,o=e.sid):e.loginHint&&(r=n.SSOTypes.LOGIN_HINT,o=e.loginHint);else t&&t.hasOwnProperty(n.Constants.upn)&&(r=n.SSOTypes.ID_TOKEN,o=t.upn);return this.addSSOParameter(r,o)},e.prototype.addHintParameters=function(e,t){e&&!t[n.SSOTypes.SID]&&(!t[n.SSOTypes.LOGIN_HINT]&&e.sid&&this.promptValue===n.PromptState.NONE?t=this.addSSOParameter(n.SSOTypes.SID,e.sid,t):!t[n.SSOTypes.LOGIN_HINT]&&e.userName&&!i.StringUtils.isEmpty(e.userName)&&(t=this.addSSOParameter(n.SSOTypes.LOGIN_HINT,e.userName,t)));return t},e.prototype.addSSOParameter=function(e,t,r){if(r||(r={}),!t)return r;switch(e){case n.SSOTypes.SID:r[n.SSOTypes.SID]=t;break;case n.SSOTypes.ID_TOKEN:case n.SSOTypes.LOGIN_HINT:r[n.SSOTypes.LOGIN_HINT]=t}return r},e.generateQueryParametersString=function(e,t){var r=null;return e&&Object.keys(e).forEach(function(o){o===n.Constants.domain_hint&&(t||e[n.SSOTypes.SID])||(null==r?r=o+"="+encodeURIComponent(e[o]):r+="&"+o+"="+encodeURIComponent(e[o]))}),r},e.isSSOParam=function(e){return e&&(e.account||e.sid||e.loginHint)},e}();t.ServerRequestParameters=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(3),i=function(){function e(){}return e.decodeJwt=function(e){if(n.StringUtils.isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);return!t||t.length<4?null:{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},e.extractIdToken=function(e){var t=this.decodeJwt(e);if(!t)return null;try{var r=t.JWSPayload,n=o.CryptoUtils.base64Decode(r);return n?JSON.parse(n):null}catch(e){}return null},e}();t.TokenUtils=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(1),i=r(5),a=r(9),s=r(3),c=r(2),u=r(11),l=r(6),h=function(){function e(){}return e.validateRequest=function(e,t,r,n){if(!t&&!e)throw i.ClientConfigurationError.createEmptyRequestError();var s,c;e&&(s=t?a.ScopeSet.appendScopes(e.scopes,e.extraScopesToConsent):e.scopes,a.ScopeSet.validateInputScope(s,!t,r),this.validatePromptParameter(e.prompt),c=this.validateEQParameters(e.extraQueryParameters,e.claimsRequest),this.validateClaimsRequest(e.claimsRequest));var u=this.validateAndGenerateState(e&&e.state,n),l=this.validateAndGenerateCorrelationId(e&&e.correlationId);return o.__assign({},e,{extraQueryParameters:c,scopes:s,state:u,correlationId:l})},e.validatePromptParameter=function(e){if(e&&[n.PromptState.LOGIN,n.PromptState.SELECT_ACCOUNT,n.PromptState.CONSENT,n.PromptState.NONE].indexOf(e)<0)throw i.ClientConfigurationError.createInvalidPromptError(e)},e.validateEQParameters=function(e,t){var r=o.__assign({},e);return r?(t&&delete r[n.Constants.claims],n.BlacklistedEQParams.forEach(function(e){r[e]&&delete r[e]}),r):null},e.validateClaimsRequest=function(e){if(e)try{JSON.parse(e)}catch(e){throw i.ClientConfigurationError.createClaimsRequestParsingError(e)}},e.validateAndGenerateState=function(t,r){return s.StringUtils.isEmpty(t)?e.generateLibraryState(r):""+e.generateLibraryState(r)+n.Constants.resourceDelimiter+t},e.generateLibraryState=function(e){var t={id:c.CryptoUtils.createNewGuid(),ts:u.TimeUtils.now(),method:e},r=JSON.stringify(t);return c.CryptoUtils.base64Encode(r)},e.parseLibraryState=function(e){var t=decodeURIComponent(e).split(n.Constants.resourceDelimiter)[0];if(c.CryptoUtils.isGuid(t))return{id:t,ts:u.TimeUtils.now(),method:n.Constants.interactionTypeRedirect};try{var r=c.CryptoUtils.base64Decode(t);return JSON.parse(r)}catch(t){throw l.ClientAuthError.createInvalidStateError(e,null)}},e.validateAndGenerateCorrelationId=function(e){if(e&&!c.CryptoUtils.isGuid(e))throw i.ClientConfigurationError.createInvalidCorrelationIdError();return c.CryptoUtils.isGuid(e)?e:c.CryptoUtils.createNewGuid()},e.createRequestSignature=function(e){return""+e.scopes.join(" ").toLowerCase()+n.Constants.resourceDelimiter+e.authority},e}();t.RequestUtils=h},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(3),i=function(){function e(e,t,r,o,n,i,a){this.accountIdentifier=e,this.homeAccountIdentifier=t,this.userName=r,this.name=o,this.idToken=n,this.idTokenClaims=n,this.sid=i,this.environment=a}return e.createAccount=function(t,r){var i,a=t.objectId||t.subject,s=r?r.uid:"",c=r?r.utid:"";return n.StringUtils.isEmpty(s)||n.StringUtils.isEmpty(c)||(i=o.CryptoUtils.base64Encode(s)+"."+o.CryptoUtils.base64Encode(c)),new e(a,i,t.preferredName,t.name,t.claims,t.sid,t.issuer)},e.compareAccounts=function(e,t){return!(!e||!t)&&!(!e.homeAccountIdentifier||!t.homeAccountIdentifier||e.homeAccountIdentifier!==t.homeAccountIdentifier)},e}();t.Account=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),n=r(4),i=r(1),a=r(11),s=function(){function e(){}return e.isInIframe=function(){return window.parent!==window},e.isInPopup=function(){return!(!window.opener||window.opener===window)},e.generateFrameName=function(e,t){return""+e+i.Constants.resourceDelimiter+t},e.monitorIframeForHash=function(t,r,i,s){return new Promise(function(c,u){var l=a.TimeUtils.relativeNowMs()+r;s.verbose("monitorWindowForIframe polling started");var h=setInterval(function(){if(a.TimeUtils.relativeNowMs()>l)return s.error("monitorIframeForHash unable to find hash in url, timing out"),s.errorPii("monitorIframeForHash polling timed out for url: "+i),clearInterval(h),void u(o.ClientAuthError.createTokenRenewalTimeoutError());var e;try{e=t.location.href}catch(e){}e&&n.UrlUtils.urlContainsHash(e)&&(s.verbose("monitorIframeForHash found url in hash"),clearInterval(h),c(t.location.hash))},e.POLLING_INTERVAL_MS)})},e.monitorPopupForHash=function(t,r,i,a){return new Promise(function(s,c){var u=r/e.POLLING_INTERVAL_MS,l=0;a.verbose("monitorWindowForHash polling started");var h=setInterval(function(){if(t.closed)return a.error("monitorWindowForHash window closed"),clearInterval(h),void c(o.ClientAuthError.createUserCancelledError());var e;try{e=t.location.href}catch(e){}e&&"about:blank"!==e&&(l++,e&&n.UrlUtils.urlContainsHash(e)?(a.verbose("monitorPopupForHash found url in hash"),clearInterval(h),s(t.location.hash)):l>u&&(a.error("monitorPopupForHash unable to find hash in url, timing out"),a.errorPii("monitorPopupForHash polling timed out for url: "+i),clearInterval(h),c(o.ClientAuthError.createTokenRenewalTimeoutError())))},e.POLLING_INTERVAL_MS)})},e.loadFrame=function(e,t,r,o){var n=this;return o.infoPii("LoadFrame: "+t),new Promise(function(i,a){setTimeout(function(){var r=n.loadFrameSync(e,t,o);r?i(r):a("Unable to load iframe with name: "+t)},r)})},e.loadFrameSync=function(t,r,o){var n=e.addHiddenIFrame(r,o);return n?(""!==n.src&&"about:blank"!==n.src||(n.src=t,o.infoPii("Frame Name : "+r+" Navigated to: "+t)),n):null},e.addHiddenIFrame=function(e,t){if(void 0===e)return null;t.infoPii("Add msal frame to document:"+e);var r=document.getElementById(e);if(!r){if(document.createElement&&document.documentElement&&-1===window.navigator.userAgent.indexOf("MSIE 5.0")){var o=document.createElement("iframe");o.setAttribute("id",e),o.setAttribute("aria-hidden","true"),o.style.visibility="hidden",o.style.position="absolute",o.style.width=o.style.height="0",o.style.border="0",o.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),r=document.getElementsByTagName("body")[0].appendChild(o)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeend","<iframe name='"+e+"' id='"+e+"' style='display:none'></iframe>");window.frames&&window.frames[e]&&(r=window.frames[e])}return r},e.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},e.getIframeWithHash=function(e){var t=document.getElementsByTagName("iframe");return Array.apply(null,Array(t.length)).map(function(e,r){return t.item(r)}).filter(function(t){try{return t.contentWindow.location.hash===e}catch(e){return!1}})[0]},e.getPopups=function(){return window.openedWindows||(window.openedWindows=[]),window.openedWindows},e.getPopUpWithHash=function(t){return e.getPopups().filter(function(e){try{return e.location.hash===t}catch(e){return!1}})[0]},e.trackPopup=function(t){e.getPopups().push(t)},e.closePopups=function(){e.getPopups().forEach(function(e){return e.close()})},e.blockReloadInHiddenIframes=function(){if(n.UrlUtils.urlContainsHash(window.location.hash)&&e.isInIframe())throw o.ClientAuthError.createBlockTokenRequestsInHiddenIframeError()},e.checkIfBackButtonIsPressed=function(e){var t=e.getItem(i.TemporaryCacheKeys.REDIRECT_REQUEST);if(t&&!n.UrlUtils.urlContainsHash(window.location.hash)){var r=t.split(i.Constants.resourceDelimiter),o=r.length>1?r[r.length-1]:null;e.resetTempCacheItems(o)}},e.POLLING_INTERVAL_MS=50,e}();t.WindowUtils=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(22),i=r(3),a=r(5),s=r(1),c=r(4),u=function(){function e(){}return e.saveMetadataFromNetwork=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var n;return o.__generator(this,function(o){switch(o.label){case 0:return[4,e.resolveEndpointsAsync(t,r)];case 1:return n=o.sent(),this.metadataMap.set(e.CanonicalAuthority,n),[2,n]}})})},e.getMetadata=function(e){return this.metadataMap.get(e)},e.saveMetadataFromConfig=function(e,t){try{if(t){var r=JSON.parse(t);if(!r.authorization_endpoint||!r.end_session_endpoint||!r.issuer)throw a.ClientConfigurationError.createInvalidAuthorityMetadataError();this.metadataMap.set(e,{AuthorizationEndpoint:r.authorization_endpoint,EndSessionEndpoint:r.end_session_endpoint,Issuer:r.issuer})}}catch(e){throw a.ClientConfigurationError.createInvalidAuthorityMetadataError()}},e.CreateInstance=function(e,t,r){return i.StringUtils.isEmpty(e)?null:(r&&this.saveMetadataFromConfig(e,r),new n.Authority(e,t,this.metadataMap.get(e)))},e.isAdfs=function(e){var t=c.UrlUtils.GetUrlComponents(e).PathSegments;return!(!t.length||t[0].toLowerCase()!==s.Constants.ADFS)},e.metadataMap=new Map,e}();t.AuthorityFactory=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(5),i=r(23),a=r(4),s=r(24),c=r(1);!function(e){e[e.Default=0]="Default",e[e.Adfs=1]="Adfs"}(t.AuthorityType||(t.AuthorityType={}));var u=function(){function e(e,t,r){this.IsValidationEnabled=t,this.CanonicalAuthority=e,this.validateAsUri(),this.tenantDiscoveryResponse=r}return Object.defineProperty(e.prototype,"Tenant",{get:function(){return this.CanonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"AuthorizationEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"EndSessionEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"SelfSignedJwtAudience",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),e.prototype.validateResolved=function(){if(!this.hasCachedMetadata())throw"Please call ResolveEndpointsAsync first"},Object.defineProperty(e.prototype,"CanonicalAuthority",{get:function(){return this.canonicalAuthority},set:function(e){this.canonicalAuthority=a.UrlUtils.CanonicalizeUri(e),this.canonicalAuthorityUrlComponents=null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CanonicalAuthorityUrlComponents",{get:function(){return this.canonicalAuthorityUrlComponents||(this.canonicalAuthorityUrlComponents=a.UrlUtils.GetUrlComponents(this.CanonicalAuthority)),this.canonicalAuthorityUrlComponents},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"DefaultOpenIdConfigurationEndpoint",{get:function(){return this.CanonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!0,configurable:!0}),e.prototype.validateAsUri=function(){var e;try{e=this.CanonicalAuthorityUrlComponents}catch(e){throw n.ClientConfigurationErrorMessage.invalidAuthorityType}if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw n.ClientConfigurationErrorMessage.authorityUriInsecure;if(!e.PathSegments||e.PathSegments.length<1)throw n.ClientConfigurationErrorMessage.authorityUriInvalidPath},e.prototype.DiscoverEndpoints=function(e,t,r){var o=new i.XhrClient,n=c.NetworkRequestType.GET,a=t.createAndStartHttpEvent(r,n,e,"openIdConfigurationEndpoint");return o.sendRequestAsync(e,n,!0).then(function(e){return a.httpResponseStatus=e.statusCode,t.stopEvent(a),{AuthorizationEndpoint:e.body.authorization_endpoint,EndSessionEndpoint:e.body.end_session_endpoint,Issuer:e.body.issuer}}).catch(function(e){throw a.serverErrorCode=e,t.stopEvent(a),e})},e.prototype.resolveEndpointsAsync=function(e,t){return o.__awaiter(this,void 0,Promise,function(){var r,i,a;return o.__generator(this,function(o){switch(o.label){case 0:return this.IsValidationEnabled?(r=this.canonicalAuthorityUrlComponents.HostNameAndPort,0!==s.TrustedAuthority.getTrustedHostList().length?[3,2]:[4,s.TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority,e,t)]):[3,3];case 1:o.sent(),o.label=2;case 2:if(!s.TrustedAuthority.IsInTrustedHostList(r))throw n.ClientConfigurationError.createUntrustedAuthorityError(r);o.label=3;case 3:return i=this.GetOpenIdConfigurationEndpoint(),a=this,[4,this.DiscoverEndpoints(i,e,t)];case 4:return a.tenantDiscoveryResponse=o.sent(),[2,this.tenantDiscoveryResponse]}})})},e.prototype.hasCachedMetadata=function(){return!!(this.tenantDiscoveryResponse&&this.tenantDiscoveryResponse.AuthorizationEndpoint&&this.tenantDiscoveryResponse.EndSessionEndpoint&&this.tenantDiscoveryResponse.Issuer)},e.prototype.GetOpenIdConfigurationEndpoint=function(){return this.DefaultOpenIdConfigurationEndpoint},e}();t.Authority=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=function(){function e(){}return e.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise(function(r,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),a.onload=function(e){var t;(a.status<200||a.status>=300)&&i(n.handleError(a.responseText));try{t=JSON.parse(a.responseText)}catch(e){i(n.handleError(a.responseText))}var o={statusCode:a.status,body:t};r(o)},a.onerror=function(e){i(a.status)},t!==o.NetworkRequestType.GET)throw"not implemented";a.send()})},e.prototype.handleError=function(e){var t;try{if((t=JSON.parse(e)).error)return t.error;throw e}catch(t){return e}},e}();t.XhrClient=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(23),i=r(1),a=r(4),s=function(){function e(){}return e.setTrustedAuthoritiesFromConfig=function(t,r){t&&!this.getTrustedHostList().length&&r.forEach(function(t){e.TrustedHostList.push(t.toLowerCase())})},e.getAliases=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var a,s,c,u;return o.__generator(this,function(o){return a=new n.XhrClient,s=i.NetworkRequestType.GET,c=""+i.AAD_INSTANCE_DISCOVERY_ENDPOINT+e+"oauth2/v2.0/authorize",u=t.createAndStartHttpEvent(r,s,c,"getAliases"),[2,a.sendRequestAsync(c,s,!0).then(function(e){return u.httpResponseStatus=e.statusCode,t.stopEvent(u),e.body.metadata}).catch(function(e){throw u.serverErrorCode=e,t.stopEvent(u),e})]})})},e.setTrustedAuthoritiesFromNetwork=function(t,r,n){return o.__awaiter(this,void 0,Promise,function(){var i;return o.__generator(this,function(o){switch(o.label){case 0:return[4,this.getAliases(t,r,n)];case 1:return o.sent().forEach(function(t){t.aliases.forEach(function(t){e.TrustedHostList.push(t.toLowerCase())})}),i=a.UrlUtils.GetUrlComponents(t).HostNameAndPort,e.getTrustedHostList().length&&!e.IsInTrustedHostList(i)&&e.TrustedHostList.push(i.toLowerCase()),[2]}})})},e.getTrustedHostList=function(){return this.TrustedHostList},e.IsInTrustedHostList=function(e){return this.TrustedHostList.indexOf(e.toLowerCase())>-1},e.TrustedHostList=[],e}();t.TrustedAuthority=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(12),i=r(4),a={clientId:"",authority:null,validateAuthority:!0,authorityMetadata:"",knownAuthorities:[],redirectUri:function(){return i.UrlUtils.getCurrentUrl()},postLogoutRedirectUri:function(){return i.UrlUtils.getCurrentUrl()},navigateToLoginRequestUrl:!0},s={cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},c={logger:new n.Logger(null),loadFrameTimeout:6e3,tokenRenewalOffsetSeconds:300,navigateFrameWait:500},u={isAngular:!1,unprotectedResources:new Array,protectedResourceMap:new Map};t.buildConfiguration=function(e){var t=e.auth,r=e.cache,n=void 0===r?{}:r,i=e.system,l=void 0===i?{}:i,h=e.framework,d=void 0===h?{}:h;return{auth:o.__assign({},a,t),cache:o.__assign({},s,n),system:o.__assign({},c,l),framework:o.__assign({},u,d)}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(13);t.InteractionRequiredAuthErrorMessage={interactionRequired:{code:"interaction_required"},consentRequired:{code:"consent_required"},loginRequired:{code:"login_required"}};var i=function(e){function r(t,o){var n=e.call(this,t,o)||this;return n.name="InteractionRequiredAuthError",Object.setPrototypeOf(n,r.prototype),n}return o.__extends(r,e),r.isInteractionRequiredError=function(e){var r=[t.InteractionRequiredAuthErrorMessage.interactionRequired.code,t.InteractionRequiredAuthErrorMessage.consentRequired.code,t.InteractionRequiredAuthErrorMessage.loginRequired.code];return e&&r.indexOf(e)>-1},r.createLoginRequiredAuthError=function(e){return new r(t.InteractionRequiredAuthErrorMessage.loginRequired.code,e)},r.createInteractionRequiredAuthError=function(e){return new r(t.InteractionRequiredAuthErrorMessage.interactionRequired.code,e)},r.createConsentRequiredAuthError=function(e){return new r(t.InteractionRequiredAuthErrorMessage.consentRequired.code,e)},r}(n.ServerError);t.InteractionRequiredAuthError=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.buildResponseStateOnly=function(e){return{uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:"",scopes:null,expiresOn:null,account:null,accountState:e,fromCache:!1}}},function(e,t,r){var o;Object.defineProperty(t,"__esModule",{value:!0});var n,i,a=r(0),s=a.__importDefault(r(14)),c=r(8),u=r(10);t.EVENT_KEYS={AUTHORITY:u.prependEventNamePrefix("authority"),AUTHORITY_TYPE:u.prependEventNamePrefix("authority_type"),PROMPT:u.prependEventNamePrefix("ui_behavior"),TENANT_ID:u.prependEventNamePrefix("tenant_id"),USER_ID:u.prependEventNamePrefix("user_id"),WAS_SUCESSFUL:u.prependEventNamePrefix("was_successful"),API_ERROR_CODE:u.prependEventNamePrefix("api_error_code"),LOGIN_HINT:u.prependEventNamePrefix("login_hint")},function(e){e[e.AcquireTokenRedirect=2001]="AcquireTokenRedirect",e[e.AcquireTokenSilent=2002]="AcquireTokenSilent",e[e.AcquireTokenPopup=2003]="AcquireTokenPopup",e[e.LoginRedirect=2004]="LoginRedirect",e[e.LoginPopup=2005]="LoginPopup",e[e.Logout=2006]="Logout"}(n=t.API_CODE||(t.API_CODE={})),function(e){e.AcquireTokenRedirect="AcquireTokenRedirect",e.AcquireTokenSilent="AcquireTokenSilent",e.AcquireTokenPopup="AcquireTokenPopup",e.LoginRedirect="LoginRedirect",e.LoginPopup="LoginPopup",e.Logout="Logout"}(i=t.API_EVENT_IDENTIFIER||(t.API_EVENT_IDENTIFIER={}));var l=((o={})[i.AcquireTokenSilent]=n.AcquireTokenSilent,o[i.AcquireTokenPopup]=n.AcquireTokenPopup,o[i.AcquireTokenRedirect]=n.AcquireTokenRedirect,o[i.LoginPopup]=n.LoginPopup,o[i.LoginRedirect]=n.LoginRedirect,o[i.Logout]=n.Logout,o),h=function(e){function r(t,r,o){var n=e.call(this,u.prependEventNamePrefix("api_event"),t,o)||this;return o&&(n.apiCode=l[o],n.apiEventIdentifier=o),n.piiEnabled=r,n}return a.__extends(r,e),Object.defineProperty(r.prototype,"apiEventIdentifier",{set:function(e){this.event[c.TELEMETRY_BLOB_EVENT_NAMES.ApiTelemIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"apiCode",{set:function(e){this.event[c.TELEMETRY_BLOB_EVENT_NAMES.ApiIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"authority",{set:function(e){this.event[t.EVENT_KEYS.AUTHORITY]=u.scrubTenantFromUri(e).toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"apiErrorCode",{set:function(e){this.event[t.EVENT_KEYS.API_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"tenantId",{set:function(e){this.event[t.EVENT_KEYS.TENANT_ID]=this.piiEnabled&&e?u.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"accountId",{set:function(e){this.event[t.EVENT_KEYS.USER_ID]=this.piiEnabled&&e?u.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"wasSuccessful",{get:function(){return!0===this.event[t.EVENT_KEYS.WAS_SUCESSFUL]},set:function(e){this.event[t.EVENT_KEYS.WAS_SUCESSFUL]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"loginHint",{set:function(e){this.event[t.EVENT_KEYS.LOGIN_HINT]=this.piiEnabled&&e?u.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"authorityType",{set:function(e){this.event[t.EVENT_KEYS.AUTHORITY_TYPE]=e.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"promptType",{set:function(e){this.event[t.EVENT_KEYS.PROMPT]=e.toLowerCase()},enumerable:!0,configurable:!0}),r}(s.default);t.default=h},function(e,t,r){e.exports=r(30)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(15);t.UserAgentApplication=o.UserAgentApplication,t.authResponseCallback=o.authResponseCallback,t.errorReceivedCallback=o.errorReceivedCallback,t.tokenReceivedCallback=o.tokenReceivedCallback;var n=r(12);t.Logger=n.Logger;var i=r(12);t.LogLevel=i.LogLevel;var a=r(19);t.Account=a.Account;var s=r(1);t.Constants=s.Constants,t.ServerHashParamKeys=s.ServerHashParamKeys;var c=r(22);t.Authority=c.Authority;var u=r(15);t.CacheResult=u.CacheResult;var l=r(25);t.CacheLocation=l.CacheLocation,t.Configuration=l.Configuration;var h=r(42);t.AuthenticationParameters=h.AuthenticationParameters;var d=r(27);t.AuthResponse=d.AuthResponse;var p=r(2);t.CryptoUtils=p.CryptoUtils;var g=r(4);t.UrlUtils=g.UrlUtils;var f=r(20);t.WindowUtils=f.WindowUtils;var y=r(7);t.AuthError=y.AuthError;var m=r(6);t.ClientAuthError=m.ClientAuthError;var v=r(13);t.ServerError=v.ServerError;var E=r(5);t.ClientConfigurationError=E.ClientConfigurationError;var C=r(26);t.InteractionRequiredAuthError=C.InteractionRequiredAuthError},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(4),i=function(){return function(e,t,r,i,a){this.authority=n.UrlUtils.CanonicalizeUri(e),this.clientId=t,this.scopes=r,this.homeAccountIdentifier=o.CryptoUtils.base64Encode(i)+"."+o.CryptoUtils.base64Encode(a)}}();t.AccessTokenKey=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){return function(e,t,r,o){this.accessToken=e,this.idToken=t,this.expiresIn=r,this.homeAccountIdentifier=o}}();t.AccessTokenValue=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(6),i=r(3),a=function(){function e(e){if(!e||i.StringUtils.isEmpty(e))return this.uid="",void(this.utid="");try{var t=o.CryptoUtils.base64Decode(e),r=JSON.parse(t);r&&(r.hasOwnProperty("uid")&&(this.uid=r.uid),r.hasOwnProperty("utid")&&(this.utid=r.utid))}catch(e){throw n.ClientAuthError.createClientInfoDecodingError(e)}}return Object.defineProperty(e.prototype,"uid",{get:function(){return this._uid?this._uid:""},set:function(e){this._uid=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"utid",{get:function(){return this._utid?this._utid:""},set:function(e){this._utid=e},enumerable:!0,configurable:!0}),e}();t.ClientInfo=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),n=r(17),i=r(3),a=function(){return function(e){if(i.StringUtils.isEmpty(e))throw o.ClientAuthError.createIdTokenNullOrEmptyError(e);try{this.rawIdToken=e,this.claims=n.TokenUtils.extractIdToken(e),this.claims&&(this.claims.hasOwnProperty("iss")&&(this.issuer=this.claims.iss),this.claims.hasOwnProperty("oid")&&(this.objectId=this.claims.oid),this.claims.hasOwnProperty("sub")&&(this.subject=this.claims.sub),this.claims.hasOwnProperty("tid")&&(this.tenantId=this.claims.tid),this.claims.hasOwnProperty("ver")&&(this.version=this.claims.ver),this.claims.hasOwnProperty("preferred_username")&&(this.preferredName=this.claims.preferred_username),this.claims.hasOwnProperty("name")&&(this.name=this.claims.name),this.claims.hasOwnProperty("nonce")&&(this.nonce=this.claims.nonce),this.claims.hasOwnProperty("exp")&&(this.expiration=this.claims.exp),this.claims.hasOwnProperty("home_oid")&&(this.homeObjectId=this.claims.home_oid),this.claims.hasOwnProperty("sid")&&(this.sid=this.claims.sid),this.claims.hasOwnProperty("cloud_instance_host_name")&&(this.cloudInstance=this.claims.cloud_instance_host_name))}catch(e){throw o.ClientAuthError.createIdTokenParsingError(e)}}}();t.IdToken=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(1),i=r(36),a=r(37),s=r(6),c=r(18),u=function(e){function t(t,r,o){var n=e.call(this,r)||this;return n.clientId=t,n.rollbackEnabled=!0,n.migrateCacheEntries(o),n}return o.__extends(t,e),t.prototype.migrateCacheEntries=function(t){var r=this,o=n.Constants.cachePrefix+"."+n.PersistentCacheKeys.IDTOKEN,i=n.Constants.cachePrefix+"."+n.PersistentCacheKeys.CLIENT_INFO,a=n.Constants.cachePrefix+"."+n.ErrorCacheKeys.ERROR,s=n.Constants.cachePrefix+"."+n.ErrorCacheKeys.ERROR_DESC,c=[e.prototype.getItem.call(this,o),e.prototype.getItem.call(this,i),e.prototype.getItem.call(this,a),e.prototype.getItem.call(this,s)];[n.PersistentCacheKeys.IDTOKEN,n.PersistentCacheKeys.CLIENT_INFO,n.ErrorCacheKeys.ERROR,n.ErrorCacheKeys.ERROR_DESC].forEach(function(e,o){return r.duplicateCacheEntry(e,c[o],t)})},t.prototype.duplicateCacheEntry=function(e,t,r){t&&this.setItem(e,t,r)},t.prototype.generateCacheKey=function(e,t){try{return JSON.parse(e),e}catch(r){return 0===e.indexOf(""+n.Constants.cachePrefix)||0===e.indexOf(n.Constants.adalIdToken)?e:t?n.Constants.cachePrefix+"."+this.clientId+"."+e:n.Constants.cachePrefix+"."+e}},t.prototype.setItem=function(t,r,o){e.prototype.setItem.call(this,this.generateCacheKey(t,!0),r,o),this.rollbackEnabled&&!o&&e.prototype.setItem.call(this,this.generateCacheKey(t,!1),r,o)},t.prototype.getItem=function(t,r){return e.prototype.getItem.call(this,this.generateCacheKey(t,!0),r)},t.prototype.removeItem=function(t){e.prototype.removeItem.call(this,this.generateCacheKey(t,!0)),this.rollbackEnabled&&e.prototype.removeItem.call(this,this.generateCacheKey(t,!1))},t.prototype.resetCacheItems=function(){var t,r=window[this.cacheLocation];for(t in r)r.hasOwnProperty(t)&&-1!==t.indexOf(n.Constants.cachePrefix)&&e.prototype.removeItem.call(this,t)},t.prototype.resetTempCacheItems=function(t){var r=this,o=t&&c.RequestUtils.parseLibraryState(t).id,i=this.tokenRenewalInProgress(t),a=window[this.cacheLocation];o&&!i&&Object.keys(a).forEach(function(t){-1!==t.indexOf(o)&&(r.removeItem(t),e.prototype.clearItemCookie.call(r,t))}),this.removeItem(n.TemporaryCacheKeys.INTERACTION_STATUS),this.removeItem(n.TemporaryCacheKeys.REDIRECT_REQUEST)},t.prototype.setItemCookie=function(t,r,o){e.prototype.setItemCookie.call(this,this.generateCacheKey(t,!0),r,o),this.rollbackEnabled&&e.prototype.setItemCookie.call(this,this.generateCacheKey(t,!1),r,o)},t.prototype.clearItemCookie=function(t){e.prototype.clearItemCookie.call(this,this.generateCacheKey(t,!0)),this.rollbackEnabled&&e.prototype.clearItemCookie.call(this,this.generateCacheKey(t,!1))},t.prototype.getItemCookie=function(t){return e.prototype.getItemCookie.call(this,this.generateCacheKey(t,!0))},t.prototype.getAllAccessTokens=function(e,t){var r=this;return Object.keys(window[this.cacheLocation]).reduce(function(o,a){if(a.match(e)&&a.match(t)&&a.match(n.Constants.scopes)){var c=r.getItem(a);if(c)try{var u=JSON.parse(a),l=new i.AccessTokenCacheItem(u,JSON.parse(c));return o.concat([l])}catch(e){throw s.ClientAuthError.createCacheParseError(a)}}return o},[])},t.prototype.tokenRenewalInProgress=function(e){var r=this.getItem(t.generateTemporaryCacheKey(n.TemporaryCacheKeys.RENEW_STATUS,e));return!(!r||r!==n.Constants.inProgress)},t.prototype.clearMsalCookie=function(r){var o=this;r?(this.clearItemCookie(t.generateTemporaryCacheKey(n.TemporaryCacheKeys.NONCE_IDTOKEN,r)),this.clearItemCookie(t.generateTemporaryCacheKey(n.TemporaryCacheKeys.STATE_LOGIN,r)),this.clearItemCookie(t.generateTemporaryCacheKey(n.TemporaryCacheKeys.LOGIN_REQUEST,r)),this.clearItemCookie(t.generateTemporaryCacheKey(n.TemporaryCacheKeys.STATE_ACQ_TOKEN,r))):document.cookie.split(";").forEach(function(t){var r=t.trim().split("=")[0];r.indexOf(n.Constants.cachePrefix)>-1&&e.prototype.clearItemCookie.call(o,r)})},t.generateAcquireTokenAccountKey=function(e,t){var r=c.RequestUtils.parseLibraryState(t).id;return""+n.TemporaryCacheKeys.ACQUIRE_TOKEN_ACCOUNT+n.Constants.resourceDelimiter+e+n.Constants.resourceDelimiter+r},t.generateAuthorityKey=function(e){return t.generateTemporaryCacheKey(n.TemporaryCacheKeys.AUTHORITY,e)},t.generateTemporaryCacheKey=function(e,t){var r=c.RequestUtils.parseLibraryState(t).id;return""+e+n.Constants.resourceDelimiter+r},t}(a.BrowserStorage);t.AuthCache=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=function(){return function(e,t){this.key=e,this.value=t}}();t.AccessTokenCacheItem=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=r(7),i=function(){function e(e){if(!window)throw n.AuthError.createNoWindowObjectError("Browser storage class could not find window object");if(!(void 0!==window[e]&&null!=window[e]))throw o.ClientConfigurationError.createStorageNotSupportedError(e);this.cacheLocation=e}return e.prototype.setItem=function(e,t,r){window[this.cacheLocation].setItem(e,t),r&&this.setItemCookie(e,t)},e.prototype.getItem=function(e,t){return t&&this.getItemCookie(e)?this.getItemCookie(e):window[this.cacheLocation].getItem(e)},e.prototype.removeItem=function(e){return window[this.cacheLocation].removeItem(e)},e.prototype.clear=function(){return window[this.cacheLocation].clear()},e.prototype.setItemCookie=function(e,t,r){var o=e+"="+t+";path=/;";r&&(o+="expires="+this.getCookieExpirationTime(r)+";");document.cookie=o},e.prototype.getItemCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),o=0;o<r.length;o++){for(var n=r[o];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return""},e.prototype.clearItemCookie=function(e){this.setItemCookie(e,"",-1)},e.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+24*e*60*60*1e3).toUTCString()},e}();t.BrowserStorage=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=function(){function e(){}return e.setResponseIdToken=function(e,t){if(!e)return null;if(!t)return e;var r=Number(t.expiration);return r&&!e.expiresOn&&(e.expiresOn=new Date(1e3*r)),o.__assign({},e,{idToken:t,idTokenClaims:t.claims,uniqueId:t.objectId||t.subject,tenantId:t.tenantId})},e}();t.ResponseUtils=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=o.__importDefault(r(40)),i=r(1),a=o.__importDefault(r(28)),s=o.__importDefault(r(41)),c=function(){function e(e,t,r){this.completedEvents={},this.inProgressEvents={},this.eventCountByCorrelationId={},this.onlySendFailureTelemetry=!1,this.telemetryPlatform=o.__assign({sdk:i.Constants.libraryName,sdkVersion:i.libraryVersion(),networkInformation:{connectionSpeed:"undefined"!=typeof navigator&&navigator.connection&&navigator.connection.effectiveType}},e.platform),this.clientId=e.clientId,this.onlySendFailureTelemetry=e.onlySendFailureTelemetry,this.telemetryEmitter=t,this.logger=r}return e.getTelemetrymanagerStub=function(e,t){return new this({platform:{applicationName:"UnSetStub",applicationVersion:"0.0"},clientId:e},function(){},t)},e.prototype.startEvent=function(e){this.logger.verbose("Telemetry Event started: "+e.key),this.telemetryEmitter&&(e.start(),this.inProgressEvents[e.key]=e)},e.prototype.stopEvent=function(e){if(this.logger.verbose("Telemetry Event stopped: "+e.key),this.telemetryEmitter&&this.inProgressEvents[e.key]){e.stop(),this.incrementEventCount(e);var t=this.completedEvents[e.telemetryCorrelationId];this.completedEvents[e.telemetryCorrelationId]=(t||[]).concat([e]),delete this.inProgressEvents[e.key]}},e.prototype.flush=function(e){var t=this;if(this.logger.verbose("Flushing telemetry events: "+e),this.telemetryEmitter&&this.completedEvents[e]){var r=this.getOrphanedEvents(e);r.forEach(function(e){return t.incrementEventCount(e)});var o=this.completedEvents[e].concat(r);delete this.completedEvents[e];var i=this.eventCountByCorrelationId[e];if(delete this.eventCountByCorrelationId[e],o&&o.length){var a=new n.default(this.telemetryPlatform,e,this.clientId,i),s=o.concat([a]);this.telemetryEmitter(s.map(function(e){return e.get()}))}}},e.prototype.createAndStartApiEvent=function(e,t){var r=new a.default(e,this.logger.isPiiLoggingEnabled(),t);return this.startEvent(r),r},e.prototype.stopAndFlushApiEvent=function(e,t,r,o){t.wasSuccessful=r,o&&(t.apiErrorCode=o),this.stopEvent(t),this.flush(e)},e.prototype.createAndStartHttpEvent=function(e,t,r,o){var n=new s.default(e,o);return n.url=r,n.httpMethod=t,this.startEvent(n),n},e.prototype.incrementEventCount=function(e){var t,r=e.eventName,o=this.eventCountByCorrelationId[e.telemetryCorrelationId];o?o[r]=o[r]?o[r]+1:1:this.eventCountByCorrelationId[e.telemetryCorrelationId]=((t={})[r]=1,t)},e.prototype.getOrphanedEvents=function(e){var t=this;return Object.keys(this.inProgressEvents).reduce(function(r,o){if(-1!==o.indexOf(e)){var n=t.inProgressEvents[o];return delete t.inProgressEvents[o],r.concat([n])}return r},[])},e}();t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(8),i=o.__importDefault(r(14)),a=r(10),s=function(e){function t(t,r,o,i){var s=e.call(this,a.prependEventNamePrefix("default_event"),r,"DefaultEvent")||this;return s.event[a.prependEventNamePrefix("client_id")]=o,s.event[a.prependEventNamePrefix("sdk_plaform")]=t.sdk,s.event[a.prependEventNamePrefix("sdk_version")]=t.sdkVersion,s.event[a.prependEventNamePrefix("application_name")]=t.applicationName,s.event[a.prependEventNamePrefix("application_version")]=t.applicationVersion,s.event[a.prependEventNamePrefix("effective_connection_speed")]=t.networkInformation&&t.networkInformation.connectionSpeed,s.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey]=s.getEventCount(a.prependEventNamePrefix("ui_event"),i),s.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey]=s.getEventCount(a.prependEventNamePrefix("http_event"),i),s.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey]=s.getEventCount(a.prependEventNamePrefix("cache_event"),i),s}return o.__extends(t,e),t.prototype.getEventCount=function(e,t){return t[e]?t[e]:0},t}(i.default);t.default=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=o.__importDefault(r(14)),i=r(10),a=r(16);t.EVENT_KEYS={HTTP_PATH:i.prependEventNamePrefix("http_path"),USER_AGENT:i.prependEventNamePrefix("user_agent"),QUERY_PARAMETERS:i.prependEventNamePrefix("query_parameters"),API_VERSION:i.prependEventNamePrefix("api_version"),RESPONSE_CODE:i.prependEventNamePrefix("response_code"),O_AUTH_ERROR_CODE:i.prependEventNamePrefix("oauth_error_code"),HTTP_METHOD:i.prependEventNamePrefix("http_method"),REQUEST_ID_HEADER:i.prependEventNamePrefix("request_id_header"),SPE_INFO:i.prependEventNamePrefix("spe_info"),SERVER_ERROR_CODE:i.prependEventNamePrefix("server_error_code"),SERVER_SUB_ERROR_CODE:i.prependEventNamePrefix("server_sub_error_code"),URL:i.prependEventNamePrefix("url")};var s=function(e){function r(t,r){return e.call(this,i.prependEventNamePrefix("http_event"),t,r)||this}return o.__extends(r,e),Object.defineProperty(r.prototype,"url",{set:function(e){var r=i.scrubTenantFromUri(e);this.event[t.EVENT_KEYS.URL]=r&&r.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"httpPath",{set:function(e){this.event[t.EVENT_KEYS.HTTP_PATH]=i.scrubTenantFromUri(e).toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"userAgent",{set:function(e){this.event[t.EVENT_KEYS.USER_AGENT]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"queryParams",{set:function(e){this.event[t.EVENT_KEYS.QUERY_PARAMETERS]=a.ServerRequestParameters.generateQueryParametersString(e)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"apiVersion",{set:function(e){this.event[t.EVENT_KEYS.API_VERSION]=e.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"httpResponseStatus",{set:function(e){this.event[t.EVENT_KEYS.RESPONSE_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"oAuthErrorCode",{set:function(e){this.event[t.EVENT_KEYS.O_AUTH_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"httpMethod",{set:function(e){this.event[t.EVENT_KEYS.HTTP_METHOD]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"requestIdHeader",{set:function(e){this.event[t.EVENT_KEYS.REQUEST_ID_HEADER]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"speInfo",{set:function(e){this.event[t.EVENT_KEYS.SPE_INFO]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"serverErrorCode",{set:function(e){this.event[t.EVENT_KEYS.SERVER_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"serverSubErrorCode",{set:function(e){this.event[t.EVENT_KEYS.SERVER_SUB_ERROR_CODE]=e},enumerable:!0,configurable:!0}),r}(n.default);t.default=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5);t.validateClaimsRequest=function(e){if(e.claimsRequest)try{JSON.parse(e.claimsRequest)}catch(e){throw o.ClientConfigurationError.createClaimsRequestParsingError(e)}}}])},e.exports=o()},"./packages/Microsoft.Office.WebAuth.Implicit/lib/msal.min.js":function(e,t,r){"use strict";
/*! msal v1.3.3 2020-07-14 */window,e.exports=function(){return r={},e.m=t=[function(e,t,r){
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0

THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.

See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
Object.defineProperty(t,"__esModule",{value:!0});var o=function(e,t){return(o=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,t)};function n(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function i(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,n,i=r.call(e),a=[];try{for(;(void 0===t||0<t--)&&!(o=i.next()).done;)a.push(o.value)}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return a}function a(e){return this instanceof a?(this.v=e,this):new a(e)}t.__extends=function(e,t){function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)},t.__assign=function(){return t.__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},t.__assign.apply(this,arguments)},t.__rest=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r},t.__decorate=function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;0<=s;s--)(n=e[s])&&(a=(i<3?n(a):3<i?n(t,r,a):n(t,r))||a);return 3<i&&a&&Object.defineProperty(t,r,a),a},t.__param=function(e,t){return function(r,o){t(r,o,e)}},t.__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},t.__awaiter=function(e,t,r,o){return new(r=r||Promise)(function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},t.__generator=function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[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,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(n=0<(n=a.trys).length&&n[n.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){a.label=i[1];break}if(6===i[0]&&a.label<n[1]){a.label=n[1],n=i;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(i);break}n[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},t.__exportStar=function(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])},t.__values=n,t.__read=i,t.__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(i(arguments[t]));return e},t.__spreadArrays=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var o=Array(e),n=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,n++)o[n]=i[a];return o},t.__await=a,t.__asyncGenerator=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o,n=r.apply(e,t||[]),i=[];return o={},s("next"),s("throw"),s("return"),o[Symbol.asyncIterator]=function(){return this},o;function s(e){n[e]&&(o[e]=function(t){return new Promise(function(r,o){1<i.push([e,t,r,o])||c(e,t)})})}function c(e,t){try{!function(e){e.value instanceof a?Promise.resolve(e.value.v).then(u,l):h(i[0][2],e)}(n[e](t))}catch(e){h(i[0][3],e)}}function u(e){c("next",e)}function l(e){c("throw",e)}function h(e,t){e(t),i.shift(),i.length&&c(i[0][0],i[0][1])}},t.__asyncDelegator=function(e){var t,r;return t={},o("next"),o("throw",function(e){throw e}),o("return"),t[Symbol.iterator]=function(){return this},t;function o(o,n){t[o]=e[o]?function(t){return(r=!r)?{value:a(e[o](t)),done:"return"===o}:n?n(t):t}:n}},t.__asyncValues=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=n(e),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(r){t[r]=e[r]&&function(t){return new Promise(function(o,n){!function(e,t,r,o){Promise.resolve(o).then(function(t){e({value:t,done:r})},t)}(o,n,(t=e[r](t)).done,t.value)})}}},t.__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},t.__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},t.__importDefault=function(e){return e&&e.__esModule?e:{default:e}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n,i,a,s,c,u=(Object.defineProperty(l,"libraryName",{get:function(){return"Msal.js"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"claims",{get:function(){return"claims"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"clientId",{get:function(){return"clientId"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"adalIdToken",{get:function(){return"adal.idtoken"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cachePrefix",{get:function(){return"msal"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"scopes",{get:function(){return"scopes"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"no_account",{get:function(){return"NO_ACCOUNT"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"upn",{get:function(){return"upn"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"domain_hint",{get:function(){return"domain_hint"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt_select_account",{get:function(){return"&prompt=select_account"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt_none",{get:function(){return"&prompt=none"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"prompt",{get:function(){return"prompt"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"response_mode_fragment",{get:function(){return"&response_mode=fragment"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"resourceDelimiter",{get:function(){return"|"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"cacheDelimiter",{get:function(){return"."},enumerable:!0,configurable:!0}),Object.defineProperty(l,"popUpWidth",{get:function(){return this._popUpWidth},set:function(e){this._popUpWidth=e},enumerable:!0,configurable:!0}),Object.defineProperty(l,"popUpHeight",{get:function(){return this._popUpHeight},set:function(e){this._popUpHeight=e},enumerable:!0,configurable:!0}),Object.defineProperty(l,"login",{get:function(){return"LOGIN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"renewToken",{get:function(){return"RENEW_TOKEN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"unknown",{get:function(){return"UNKNOWN"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"ADFS",{get:function(){return"adfs"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"homeAccountIdentifier",{get:function(){return"homeAccountIdentifier"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"common",{get:function(){return"common"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"openidScope",{get:function(){return"openid"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"profileScope",{get:function(){return"profile"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypeRedirect",{get:function(){return"redirectInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypePopup",{get:function(){return"popupInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"interactionTypeSilent",{get:function(){return"silentInteraction"},enumerable:!0,configurable:!0}),Object.defineProperty(l,"inProgress",{get:function(){return"inProgress"},enumerable:!0,configurable:!0}),l._popUpWidth=483,l._popUpHeight=600,l);function l(){}t.Constants=u,(o=t.ServerHashParamKeys||(t.ServerHashParamKeys={})).SCOPE="scope",o.STATE="state",o.ERROR="error",o.ERROR_DESCRIPTION="error_description",o.ACCESS_TOKEN="access_token",o.ID_TOKEN="id_token",o.EXPIRES_IN="expires_in",o.SESSION_STATE="session_state",o.CLIENT_INFO="client_info",(n=t.TemporaryCacheKeys||(t.TemporaryCacheKeys={})).AUTHORITY="authority",n.ACQUIRE_TOKEN_ACCOUNT="acquireTokenAccount",n.SESSION_STATE="session.state",n.STATE_LOGIN="state.login",n.STATE_ACQ_TOKEN="state.acquireToken",n.STATE_RENEW="state.renew",n.NONCE_IDTOKEN="nonce.idtoken",n.LOGIN_REQUEST="login.request",n.RENEW_STATUS="token.renew.status",n.URL_HASH="urlHash",n.INTERACTION_STATUS="interaction_status",n.REDIRECT_REQUEST="redirect_request",(i=t.PersistentCacheKeys||(t.PersistentCacheKeys={})).IDTOKEN="idtoken",i.CLIENT_INFO="client.info",(a=t.ErrorCacheKeys||(t.ErrorCacheKeys={})).LOGIN_ERROR="login.error",a.ERROR="error",a.ERROR_DESC="error.description",t.DEFAULT_AUTHORITY="https://login.microsoftonline.com/common/",t.AAD_INSTANCE_DISCOVERY_ENDPOINT=t.DEFAULT_AUTHORITY+"/discovery/instance?api-version=1.1&authorization_endpoint=",(c=s=t.SSOTypes||(t.SSOTypes={})).ACCOUNT="account",c.SID="sid",c.LOGIN_HINT="login_hint",c.ID_TOKEN="id_token",c.ACCOUNT_ID="accountIdentifier",c.HOMEACCOUNT_ID="homeAccountIdentifier",t.BlacklistedEQParams=[s.SID,s.LOGIN_HINT],t.NetworkRequestType={GET:"GET",POST:"POST"},t.PromptState={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none"},t.FramePrefix={ID_TOKEN_FRAME:"msalIdTokenFrame",TOKEN_FRAME:"msalRenewFrame"},t.libraryVersion=function(){return"1.3.3"}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(n.createNewGuid=function(){var e=window.crypto;if(e&&e.getRandomValues){var t=new Uint8Array(16);return e.getRandomValues(t),t[6]|=64,t[6]&=79,t[8]|=128,t[8]&=191,n.decimalToHex(t[0])+n.decimalToHex(t[1])+n.decimalToHex(t[2])+n.decimalToHex(t[3])+"-"+n.decimalToHex(t[4])+n.decimalToHex(t[5])+"-"+n.decimalToHex(t[6])+n.decimalToHex(t[7])+"-"+n.decimalToHex(t[8])+n.decimalToHex(t[9])+"-"+n.decimalToHex(t[10])+n.decimalToHex(t[11])+n.decimalToHex(t[12])+n.decimalToHex(t[13])+n.decimalToHex(t[14])+n.decimalToHex(t[15])}for(var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",o="0123456789abcdef",i=0,a="",s=0;s<36;s++)"-"!==r[s]&&"4"!==r[s]&&(i=16*Math.random()|0),"x"===r[s]?a+=o[i]:"y"===r[s]?(i&=3,a+=o[i|=8]):a+=r[s];return a},n.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)},n.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},n.base64Encode=function(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode(Number("0x"+t))}))},n.base64Decode=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")}return decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))},n.deserialize=function(e){function t(e){return decodeURIComponent(decodeURIComponent(e.replace(o," ")))}var r,o=/\+/g,n=/([^&=]+)=([^&]*)/g,i={};for(r=n.exec(e);r;)i[t(r[1])]=t(r[2]),r=n.exec(e);return i},n);function n(){}t.CryptoUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(n.isEmpty=function(e){return void 0===e||!e||0===e.length},n);function n(){}t.StringUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=r(9),i=r(3),a=r(2),s=(c.createNavigateUrl=function(e){var t=this.createNavigationUrlString(e),r=e.authorityInstance.AuthorizationEndpoint;return r.indexOf("?")<0?r+="?":r+="&",""+r+t.join("&")},c.createNavigationUrlString=function(e){var t=e.scopes;-1===t.indexOf(e.clientId)&&t.push(e.clientId);var r=[];return r.push("response_type="+e.responseType),this.translateclientIdUsedInScope(t,e.clientId),r.push("scope="+encodeURIComponent(n.ScopeSet.parseScope(t))),r.push("client_id="+encodeURIComponent(e.clientId)),r.push("redirect_uri="+encodeURIComponent(e.redirectUri)),r.push("state="+encodeURIComponent(e.state)),r.push("nonce="+encodeURIComponent(e.nonce)),r.push("client_info=1"),r.push("x-client-SKU="+e.xClientSku),r.push("x-client-Ver="+e.xClientVer),e.promptValue&&r.push("prompt="+encodeURIComponent(e.promptValue)),e.claimsValue&&r.push("claims="+encodeURIComponent(e.claimsValue)),e.queryParameters&&r.push(e.queryParameters),e.extraQueryParameters&&r.push(e.extraQueryParameters),r.push("client-request-id="+encodeURIComponent(e.correlationId)),r},c.translateclientIdUsedInScope=function(e,t){var r=e.indexOf(t);0<=r&&(e.splice(r,1),-1===e.indexOf("openid")&&e.push("openid"),-1===e.indexOf("profile")&&e.push("profile"))},c.getCurrentUrl=function(){return window.location.href.split("?")[0].split("#")[0]},c.removeHashFromUrl=function(e){return e.split("#")[0]},c.replaceTenantPath=function(e,t){e=e.toLowerCase();var r=this.GetUrlComponents(e),n=r.PathSegments;return t&&0!==n.length&&n[0]===o.Constants.common&&(n[0]=t),this.constructAuthorityUriFromObject(r,n)},c.constructAuthorityUriFromObject=function(e,t){return this.CanonicalizeUri(e.Protocol+"//"+e.HostNameAndPort+"/"+t.join("/"))},c.GetUrlComponents=function(e){if(!e)throw"Url required";var t=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),r=e.match(t);if(!r||r.length<6)throw"Valid url required";var o={Protocol:r[1],HostNameAndPort:r[4],AbsolutePath:r[5]},n=o.AbsolutePath.split("/");return n=n.filter(function(e){return e&&0<e.length}),o.PathSegments=n,r[6]&&(o.Search=r[6]),r[8]&&(o.Hash=r[8]),o},c.CanonicalizeUri=function(e){return(e=e&&e.toLowerCase())&&!c.endsWith(e,"/")&&(e+="/"),e},c.endsWith=function(e,t){return!(!e||!t)&&-1!==e.indexOf(t,e.length-t.length)},c.urlRemoveQueryStringParameter=function(e,t){if(i.StringUtils.isEmpty(e))return e;var r=new RegExp("(\\&"+t+"=)[^&]+");return e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+&"),e=e.replace(r,""),r=new RegExp("("+t+"=)[^&]+"),e=e.replace(r,"")},c.getHashFromUrl=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return-1<r?e.substring(r+2):-1<t?e.substring(t+1):e},c.urlContainsHash=function(e){var t=c.deserializeHash(e);return t.hasOwnProperty(o.ServerHashParamKeys.ERROR_DESCRIPTION)||t.hasOwnProperty(o.ServerHashParamKeys.ERROR)||t.hasOwnProperty(o.ServerHashParamKeys.ACCESS_TOKEN)||t.hasOwnProperty(o.ServerHashParamKeys.ID_TOKEN)},c.deserializeHash=function(e){var t=c.getHashFromUrl(e);return a.CryptoUtils.deserialize(t)},c.getHostFromUri=function(e){var t=String(e).replace(/^(https?:)\/\//,"");return t=t.split("/")[0]},c);function c(){}t.UrlUtils=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(6);t.ClientConfigurationErrorMessage={configurationNotSet:{code:"no_config_set",desc:"Configuration has not been set. Please call the UserAgentApplication constructor with a valid Configuration object."},storageNotSupported:{code:"storage_not_supported",desc:"The value for the cacheLocation is not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call handleRedirectCallback() 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."},scopesRequired:{code:"scopes_required",desc:"Scopes are required to obtain an access token."},emptyScopes:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as empty array."},nonArrayScopes:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientScope:{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' and 'none'"},invalidAuthorityType:{code:"invalid_authority_type",desc:"The given authority is not a valid type of authority supported by MSAL. Please see here for valid authorities: <insert URL here>."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https."},authorityUriInvalidPath:{code:"authority_uri_invalid_path",desc:"Given authority URI is invalid."},unsupportedAuthorityValidation:{code:"unsupported_authority_validation",desc:"The authority validation is not supported for this authority type."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter or set validateAuthority=false."},b2cAuthorityUriInvalidPath:{code:"b2c_authority_uri_invalid_path",desc:"The given URI for the B2C authority is invalid."},b2cKnownAuthoritiesNotSet:{code:"b2c_known_authorities_not_set",desc:"Must set known authorities when validateAuthority is set to True and using B2C"},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},emptyRequestError:{code:"empty_request_error",desc:"Request object is required."},invalidCorrelationIdError:{code:"invalid_guid_sent_as_correlationId",desc:"Please set the correlationId as a valid guid"},telemetryConfigError:{code:"telemetry_config_error",desc:"Telemetry config is not configured with required values"},ssoSilentError:{code:"sso_silent_error",desc:"request must contain either sid or login_hint"},invalidAuthorityMetadataError:{code:"authority_metadata_error",desc:"Invalid authorityMetadata. Must be a JSON object containing authorization_endpoint, end_session_endpoint, and issuer fields."}};var i,a=(i=n.ClientAuthError,o.__extends(s,i),s.createNoSetConfigurationError=function(){return new s(t.ClientConfigurationErrorMessage.configurationNotSet.code,""+t.ClientConfigurationErrorMessage.configurationNotSet.desc)},s.createStorageNotSupportedError=function(e){return new s(t.ClientConfigurationErrorMessage.storageNotSupported.code,t.ClientConfigurationErrorMessage.storageNotSupported.desc+" Given location: "+e)},s.createRedirectCallbacksNotSetError=function(){return new s(t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.code,t.ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc)},s.createInvalidCallbackObjectError=function(e){return new s(t.ClientConfigurationErrorMessage.invalidCallbackObject.code,t.ClientConfigurationErrorMessage.invalidCallbackObject.desc+" Given value for callback function: "+e)},s.createEmptyScopesArrayError=function(e){return new s(t.ClientConfigurationErrorMessage.emptyScopes.code,t.ClientConfigurationErrorMessage.emptyScopes.desc+" Given value: "+e+".")},s.createScopesNonArrayError=function(e){return new s(t.ClientConfigurationErrorMessage.nonArrayScopes.code,t.ClientConfigurationErrorMessage.nonArrayScopes.desc+" Given value: "+e+".")},s.createClientIdSingleScopeError=function(e){return new s(t.ClientConfigurationErrorMessage.clientScope.code,t.ClientConfigurationErrorMessage.clientScope.desc+" Given value: "+e+".")},s.createScopesRequiredError=function(e){return new s(t.ClientConfigurationErrorMessage.scopesRequired.code,t.ClientConfigurationErrorMessage.scopesRequired.desc+" Given value: "+e)},s.createInvalidPromptError=function(e){return new s(t.ClientConfigurationErrorMessage.invalidPrompt.code,t.ClientConfigurationErrorMessage.invalidPrompt.desc+" Given value: "+e)},s.createClaimsRequestParsingError=function(e){return new s(t.ClientConfigurationErrorMessage.claimsRequestParsingError.code,t.ClientConfigurationErrorMessage.claimsRequestParsingError.desc+" Given value: "+e)},s.createEmptyRequestError=function(){var e=t.ClientConfigurationErrorMessage.emptyRequestError;return new s(e.code,e.desc)},s.createInvalidCorrelationIdError=function(){return new s(t.ClientConfigurationErrorMessage.invalidCorrelationIdError.code,t.ClientConfigurationErrorMessage.invalidCorrelationIdError.desc)},s.createKnownAuthoritiesNotSetError=function(){return new s(t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code,t.ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc)},s.createInvalidAuthorityTypeError=function(){return new s(t.ClientConfigurationErrorMessage.invalidAuthorityType.code,t.ClientConfigurationErrorMessage.invalidAuthorityType.desc)},s.createUntrustedAuthorityError=function(e){return new s(t.ClientConfigurationErrorMessage.untrustedAuthority.code,t.ClientConfigurationErrorMessage.untrustedAuthority.desc+" Provided Authority: "+e)},s.createTelemetryConfigError=function(e){var r=t.ClientConfigurationErrorMessage.telemetryConfigError,o=r.code,n=r.desc,i={applicationName:"string",applicationVersion:"string",telemetryEmitter:"function"};return new s(o,n+" mising values: "+Object.keys(i).reduce(function(t,r){return e[r]?t:t.concat([r+" ("+i[r]+")"])},[]).join(","))},s.createSsoSilentError=function(){return new s(t.ClientConfigurationErrorMessage.ssoSilentError.code,t.ClientConfigurationErrorMessage.ssoSilentError.desc)},s.createInvalidAuthorityMetadataError=function(){return new s(t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code,t.ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc)},s);function s(e,t){var r=i.call(this,e,t)||this;return r.name="ClientConfigurationError",Object.setPrototypeOf(r,s.prototype),r}t.ClientConfigurationError=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(7),i=r(3);t.ClientAuthErrorMessage={multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements like authority."},multipleCacheAuthorities:{code:"multiple_authorities",desc:"Multiple authorities found in the cache. Pass authority in the API overload."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},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."},tokenRenewalError:{code:"token_renewal_error",desc:"Token renewal operation failed due to timeout."},invalidIdToken:{code:"invalid_id_token",desc:"Invalid ID token format."},invalidStateError:{code:"invalid_state_error",desc:"Invalid state."},nonceMismatchError:{code:"nonce_mismatch_error",desc:"Nonce is not matching, Nonce received: "},loginProgressError:{code:"login_progress_error",desc:"Login_In_Progress: Error during login call - login is already in progress."},acquireTokenProgressError:{code:"acquiretoken_progress_error",desc:"AcquireToken_In_Progress: Error during login call - login is already in progress."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},callbackError:{code:"callback_error",desc:"Error occurred in token received callback function."},userLoginRequiredError:{code:"user_login_error",desc:"User login is required. For silent calls, request must contain either sid or login_hint"},userDoesNotExistError:{code:"user_non_existent",desc:"User object does not exist. Please call a login API."},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."},clientInfoNotPopulatedError:{code:"client_info_not_populated_error",desc:"The service did not populate client_info in the response, Please verify with the service team"},nullOrEmptyIdToken:{code:"null_or_empty_id_token",desc:"The idToken is null or empty. Please review the trace to determine the root cause."},idTokenNotParsed:{code:"id_token_parsing_error",desc:"ID token cannot be parsed. Please review stack trace to determine root cause."},tokenEncodingError:{code:"token_encoding_error",desc:"The token to be decoded is not encoded correctly."},invalidInteractionType:{code:"invalid_interaction_type",desc:"The interaction type passed to the handler was incorrect or unknown"},cacheParseError:{code:"cannot_parse_cache",desc:"The cached token key is not a valid JSON and cannot be parsed"},blockTokenRequestsInHiddenIframe:{code:"block_token_requests",desc:"Token calls are blocked in hidden iframes"}};var a,s=(a=n.AuthError,o.__extends(c,a),c.createEndpointResolutionError=function(e){var r=t.ClientAuthErrorMessage.endpointResolutionError.desc;return e&&!i.StringUtils.isEmpty(e)&&(r+=" Details: "+e),new c(t.ClientAuthErrorMessage.endpointResolutionError.code,r)},c.createMultipleMatchingTokensInCacheError=function(e){return new c(t.ClientAuthErrorMessage.multipleMatchingTokens.code,"Cache error for scope "+e+": "+t.ClientAuthErrorMessage.multipleMatchingTokens.desc+".")},c.createMultipleAuthoritiesInCacheError=function(e){return new c(t.ClientAuthErrorMessage.multipleCacheAuthorities.code,"Cache error for scope "+e+": "+t.ClientAuthErrorMessage.multipleCacheAuthorities.desc+".")},c.createPopupWindowError=function(e){var r=t.ClientAuthErrorMessage.popUpWindowError.desc;return e&&!i.StringUtils.isEmpty(e)&&(r+=" Details: "+e),new c(t.ClientAuthErrorMessage.popUpWindowError.code,r)},c.createTokenRenewalTimeoutError=function(){return new c(t.ClientAuthErrorMessage.tokenRenewalError.code,t.ClientAuthErrorMessage.tokenRenewalError.desc)},c.createInvalidIdTokenError=function(e){return new c(t.ClientAuthErrorMessage.invalidIdToken.code,t.ClientAuthErrorMessage.invalidIdToken.desc+" Given token: "+e)},c.createInvalidStateError=function(e,r){return new c(t.ClientAuthErrorMessage.invalidStateError.code,t.ClientAuthErrorMessage.invalidStateError.desc+" "+e+", state expected : "+r+".")},c.createNonceMismatchError=function(e,r){return new c(t.ClientAuthErrorMessage.nonceMismatchError.code,t.ClientAuthErrorMessage.nonceMismatchError.desc+" "+e+", nonce expected : "+r+".")},c.createLoginInProgressError=function(){return new c(t.ClientAuthErrorMessage.loginProgressError.code,t.ClientAuthErrorMessage.loginProgressError.desc)},c.createAcquireTokenInProgressError=function(){return new c(t.ClientAuthErrorMessage.acquireTokenProgressError.code,t.ClientAuthErrorMessage.acquireTokenProgressError.desc)},c.createUserCancelledError=function(){return new c(t.ClientAuthErrorMessage.userCancelledError.code,t.ClientAuthErrorMessage.userCancelledError.desc)},c.createErrorInCallbackFunction=function(e){return new c(t.ClientAuthErrorMessage.callbackError.code,t.ClientAuthErrorMessage.callbackError.desc+" "+e+".")},c.createUserLoginRequiredError=function(){return new c(t.ClientAuthErrorMessage.userLoginRequiredError.code,t.ClientAuthErrorMessage.userLoginRequiredError.desc)},c.createUserDoesNotExistError=function(){return new c(t.ClientAuthErrorMessage.userDoesNotExistError.code,t.ClientAuthErrorMessage.userDoesNotExistError.desc)},c.createClientInfoDecodingError=function(e){return new c(t.ClientAuthErrorMessage.clientInfoDecodingError.code,t.ClientAuthErrorMessage.clientInfoDecodingError.desc+" Failed with error: "+e)},c.createClientInfoNotPopulatedError=function(e){return new c(t.ClientAuthErrorMessage.clientInfoNotPopulatedError.code,t.ClientAuthErrorMessage.clientInfoNotPopulatedError.desc+" Failed with error: "+e)},c.createIdTokenNullOrEmptyError=function(e){return new c(t.ClientAuthErrorMessage.nullOrEmptyIdToken.code,t.ClientAuthErrorMessage.nullOrEmptyIdToken.desc+" Raw ID Token Value: "+e)},c.createIdTokenParsingError=function(e){return new c(t.ClientAuthErrorMessage.idTokenNotParsed.code,t.ClientAuthErrorMessage.idTokenNotParsed.desc+" Failed with error: "+e)},c.createTokenEncodingError=function(e){return new c(t.ClientAuthErrorMessage.tokenEncodingError.code,t.ClientAuthErrorMessage.tokenEncodingError.desc+" Attempted to decode: "+e)},c.createInvalidInteractionTypeError=function(){return new c(t.ClientAuthErrorMessage.invalidInteractionType.code,t.ClientAuthErrorMessage.invalidInteractionType.desc)},c.createCacheParseError=function(e){var r="invalid key: "+e+", "+t.ClientAuthErrorMessage.cacheParseError.desc;return new c(t.ClientAuthErrorMessage.cacheParseError.code,r)},c.createBlockTokenRequestsInHiddenIframeError=function(){return new c(t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code,t.ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc)},c);function c(e,t){var r=a.call(this,e,t)||this;return r.name="ClientAuthError",Object.setPrototypeOf(r,c.prototype),r}t.ClientAuthError=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0);t.AuthErrorMessage={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},noWindowObjectError:{code:"no_window_object",desc:"No window object available. Details:"}};var n,i=(n=Error,o.__extends(a,n),a.createUnexpectedError=function(e){return new a(t.AuthErrorMessage.unexpectedError.code,t.AuthErrorMessage.unexpectedError.desc+": "+e)},a.createNoWindowObjectError=function(e){return new a(t.AuthErrorMessage.noWindowObjectError.code,t.AuthErrorMessage.noWindowObjectError.desc+" "+e)},a);function a(e,t){var r=n.call(this,t)||this;return Object.setPrototypeOf(r,a.prototype),r.errorCode=e,r.errorMessage=t,r.name="AuthError",r}t.AuthError=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.EVENT_NAME_PREFIX="msal.",t.EVENT_NAME_KEY="event_name",t.START_TIME_KEY="start_time",t.ELAPSED_TIME_KEY="elapsed_time",t.TELEMETRY_BLOB_EVENT_NAMES={MsalCorrelationIdConstStrKey:"Microsoft.MSAL.correlation_id",ApiTelemIdConstStrKey:"msal.api_telem_id",ApiIdConstStrKey:"msal.api_id",BrokerAppConstStrKey:"Microsoft_MSAL_broker_app",CacheEventCountConstStrKey:"Microsoft_MSAL_cache_event_count",HttpEventCountTelemetryBatchKey:"Microsoft_MSAL_http_event_count",IdpConstStrKey:"Microsoft_MSAL_idp",IsSilentTelemetryBatchKey:"",IsSuccessfulConstStrKey:"Microsoft_MSAL_is_successful",ResponseTimeConstStrKey:"Microsoft_MSAL_response_time",TenantIdConstStrKey:"Microsoft_MSAL_tenant_id",UiEventCountTelemetryBatchKey:"Microsoft_MSAL_ui_event_count"},t.TENANT_PLACEHOLDER="<tenant>"},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=r(1),i=(a.isIntersectingScopes=function(e,t){for(var r=this.trimAndConvertArrayToLowerCase(e.slice()),o=this.trimAndConvertArrayToLowerCase(t.slice()),n=0;n<o.length;n++)if(-1<r.indexOf(o[n].toLowerCase()))return!0;return!1},a.containsScope=function(e,t){var r=this.trimAndConvertArrayToLowerCase(e.slice());return this.trimAndConvertArrayToLowerCase(t.slice()).every(function(e){return 0<=r.indexOf(e.toString().toLowerCase())})},a.trimAndConvertToLowerCase=function(e){return e.trim().toLowerCase()},a.trimAndConvertArrayToLowerCase=function(e){var t=this;return e.map(function(e){return t.trimAndConvertToLowerCase(e)})},a.removeElement=function(e,t){var r=this.trimAndConvertToLowerCase(t);return e.filter(function(e){return e!==r})},a.parseScope=function(e){var t="";if(e)for(var r=0;r<e.length;++r)t+=r!==e.length-1?e[r]+" ":e[r];return t},a.validateInputScope=function(e,t,r){if(e){if(!Array.isArray(e))throw o.ClientConfigurationError.createScopesNonArrayError(e);if(e.length<1)throw o.ClientConfigurationError.createEmptyScopesArrayError(e.toString());if(-1<e.indexOf(r)&&1<e.length)throw o.ClientConfigurationError.createClientIdSingleScopeError(e.toString())}else if(t)throw o.ClientConfigurationError.createScopesRequiredError(e)},a.getScopeFromState=function(e){if(e){var t=e.indexOf(n.Constants.resourceDelimiter);if(-1<t&&t+1<e.length)return e.substring(t+1)}return""},a.appendScopes=function(e,t){if(e){var r=t?this.trimAndConvertArrayToLowerCase(t.slice()):null,o=this.trimAndConvertArrayToLowerCase(e.slice());return r?o.concat(r):o}return null},a);function a(){}t.ScopeSet=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(8),n=r(2),i=r(4),a=r(21);t.scrubTenantFromUri=function(e){var t=i.UrlUtils.GetUrlComponents(e);if(a.AuthorityFactory.isAdfs(e))return e;var r=t.PathSegments;if(r&&2<=r.length){var n="tfp"===r[1]?2:1;n<r.length&&(r[n]=o.TENANT_PLACEHOLDER)}return t.Protocol+"//"+t.HostNameAndPort+"/"+r.join("/")},t.hashPersonalIdentifier=function(e){return n.CryptoUtils.base64Encode(e)},t.prependEventNamePrefix=function(e){return""+o.EVENT_NAME_PREFIX+(e||"")},t.supportsBrowserPerformance=function(){return!!("undefined"!=typeof window&&"performance"in window&&window.performance.mark&&window.performance.measure)},t.endBrowserPerformanceMeasurement=function(e,r,o){t.supportsBrowserPerformance()&&(window.performance.mark(o),window.performance.measure(e,r,o),window.performance.clearMeasures(e),window.performance.clearMarks(r),window.performance.clearMarks(o))},t.startBrowserPerformanceMeasurement=function(e){t.supportsBrowserPerformance()&&window.performance.mark(e)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=(n.parseExpiresIn=function(e){return e=e||"3599",parseInt(e,10)},n.now=function(){return Math.round((new Date).getTime()/1e3)},n.relativeNowMs=function(){return window.performance.now()},n);function n(){}t.TimeUtils=o},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n,i=r(3),a=r(1);(n=o=t.LogLevel||(t.LogLevel={}))[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Info=2]="Info",n[n.Verbose=3]="Verbose";var s=(c.prototype.logMessage=function(e,t,r){if(!(e>this.level||!this.piiLoggingEnabled&&r)){var n,s=(new Date).toUTCString();n=i.StringUtils.isEmpty(this.correlationId)?s+":"+a.libraryVersion()+"-"+o[e]+(r?"-pii":"")+" "+t:s+":"+this.correlationId+"-"+a.libraryVersion()+"-"+o[e]+(r?"-pii":"")+" "+t,this.executeCallback(e,n,r)}},c.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},c.prototype.error=function(e){this.logMessage(o.Error,e,!1)},c.prototype.errorPii=function(e){this.logMessage(o.Error,e,!0)},c.prototype.warning=function(e){this.logMessage(o.Warning,e,!1)},c.prototype.warningPii=function(e){this.logMessage(o.Warning,e,!0)},c.prototype.info=function(e){this.logMessage(o.Info,e,!1)},c.prototype.infoPii=function(e){this.logMessage(o.Info,e,!0)},c.prototype.verbose=function(e){this.logMessage(o.Verbose,e,!1)},c.prototype.verbosePii=function(e){this.logMessage(o.Verbose,e,!0)},c.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled},c);function c(e,t){void 0===t&&(t={}),this.level=o.Info;var r=t.correlationId,n=void 0===r?"":r,i=t.level,a=void 0===i?o.Info:i,s=t.piiLoggingEnabled,c=void 0!==s&&s;this.localCallback=e,this.correlationId=n,this.level=a,this.piiLoggingEnabled=c}t.Logger=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(7);t.ServerErrorMessage={serverUnavailable:{code:"server_unavailable",desc:"Server is temporarily unavailable."},unknownServerError:{code:"unknown_server_error"}};var i,a=(i=n.AuthError,o.__extends(s,i),s.createServerUnavailableError=function(){return new s(t.ServerErrorMessage.serverUnavailable.code,t.ServerErrorMessage.serverUnavailable.desc)},s.createUnknownServerError=function(e){return new s(t.ServerErrorMessage.unknownServerError.code,e)},s);function s(e,t){var r=i.call(this,e,t)||this;return r.name="ServerError",Object.setPrototypeOf(r,s.prototype),r}t.ServerError=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(8),i=r(8),a=r(10),s=r(2),c=(u.prototype.setElapsedTime=function(e){this.event[a.prependEventNamePrefix(i.ELAPSED_TIME_KEY)]=e},u.prototype.stop=function(){this.setElapsedTime(+Date.now()-+this.startTimestamp),a.endBrowserPerformanceMeasurement(this.displayName,this.perfStartMark,this.perfEndMark)},u.prototype.start=function(){this.startTimestamp=Date.now(),this.event[a.prependEventNamePrefix(i.START_TIME_KEY)]=this.startTimestamp,a.startBrowserPerformanceMeasurement(this.perfStartMark)},Object.defineProperty(u.prototype,"telemetryCorrelationId",{get:function(){return this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]},set:function(e){this.event[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"eventName",{get:function(){return this.event[a.prependEventNamePrefix(i.EVENT_NAME_KEY)]},enumerable:!0,configurable:!0}),u.prototype.get=function(){return o.__assign({},this.event,{eventId:this.eventId})},Object.defineProperty(u.prototype,"key",{get:function(){return this.telemetryCorrelationId+"_"+this.eventId+"-"+this.eventName},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"displayName",{get:function(){return"Msal-"+this.label+"-"+this.telemetryCorrelationId},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"perfStartMark",{get:function(){return"start-"+this.key},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"perfEndMark",{get:function(){return"end-"+this.key},enumerable:!0,configurable:!0}),u);function u(e,t,r){var o;this.eventId=s.CryptoUtils.createNewGuid(),this.label=r,this.event=((o={})[a.prependEventNamePrefix(i.EVENT_NAME_KEY)]=e,o[a.prependEventNamePrefix(i.ELAPSED_TIME_KEY)]=-1,o[""+n.TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey]=t,o)}t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(31),i=r(32),a=r(16),s=r(33),c=r(34),u=r(35),l=r(19),h=r(9),d=r(3),p=r(20),g=r(17),f=r(11),y=r(4),m=r(18),v=r(38),E=r(21),C=r(25),T=r(5),I=r(7),b=r(6),S=r(13),_=r(26),A=r(27),w=o.__importDefault(r(39)),P=r(28),k=r(1),R=r(2),O=r(24),N="id_token",U="token",M="id_token token",L=(Object.defineProperty(K.prototype,"authority",{get:function(){return this.authorityInstance.CanonicalAuthority},set:function(e){this.authorityInstance=E.AuthorityFactory.CreateInstance(e,this.config.auth.validateAuthority)},enumerable:!0,configurable:!0}),K.prototype.getAuthorityInstance=function(){return this.authorityInstance},K.prototype.handleRedirectCallback=function(e,t){if(!e)throw T.ClientConfigurationError.createInvalidCallbackObjectError(e);t?(this.tokenReceivedCallback=e,this.errorReceivedCallback=t,this.logger.warning("This overload for callback is deprecated - please change the format of the callbacks to a single callback as shown: (err: AuthError, response: AuthResponse).")):this.authResponseCallback=e,this.redirectError?this.authErrorHandler(k.Constants.interactionTypeRedirect,this.redirectError,this.redirectResponse):this.redirectResponse&&this.authResponseHandler(k.Constants.interactionTypeRedirect,this.redirectResponse)},K.prototype.urlContainsHash=function(e){return this.logger.verbose("UrlContainsHash has been called"),y.UrlUtils.urlContainsHash(e)},K.prototype.authResponseHandler=function(e,t,r){if(this.logger.verbose("AuthResponseHandler has been called"),e===k.Constants.interactionTypeRedirect)this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback?(this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling success callback with response"),this.tokenReceivedCallback(t)):this.authResponseCallback&&(this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with response"),this.authResponseCallback(null,t));else{if(e!==k.Constants.interactionTypePopup)throw b.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, resolving"),r(t)}},K.prototype.authErrorHandler=function(e,t,r,o){if(this.logger.verbose("AuthErrorHandler has been called"),this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),e===k.Constants.interactionTypeRedirect)this.logger.verbose("Interaction type is redirect"),this.errorReceivedCallback?(this.logger.verbose("Two callbacks were provided to handleRedirectCallback, calling error callback"),this.errorReceivedCallback(t,r.accountState)):(this.logger.verbose("One callback was provided to handleRedirectCallback, calling authResponseCallback with error"),this.authResponseCallback(t,r));else{if(e!==k.Constants.interactionTypePopup)throw b.ClientAuthError.createInvalidInteractionTypeError();this.logger.verbose("Interaction type is popup, rejecting"),o(t)}},K.prototype.loginRedirect=function(e){this.logger.verbose("LoginRedirect has been called");var t=m.RequestUtils.validateRequest(e,!0,this.clientId,k.Constants.interactionTypeRedirect);this.acquireTokenInteractive(k.Constants.interactionTypeRedirect,!0,t,null,null)},K.prototype.acquireTokenRedirect=function(e){this.logger.verbose("AcquireTokenRedirect has been called");var t=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypeRedirect);this.acquireTokenInteractive(k.Constants.interactionTypeRedirect,!1,t,null,null)},K.prototype.loginPopup=function(e){var t=this;this.logger.verbose("LoginPopup has been called");var r=m.RequestUtils.validateRequest(e,!0,this.clientId,k.Constants.interactionTypePopup),o=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.LoginPopup);return new Promise(function(e,o){t.acquireTokenInteractive(k.Constants.interactionTypePopup,!0,r,e,o)}).then(function(e){return t.logger.verbose("Successfully logged in"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!1,e.errorCode),e})},K.prototype.acquireTokenPopup=function(e){var t=this;this.logger.verbose("AcquireTokenPopup has been called");var r=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypePopup),o=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.AcquireTokenPopup);return new Promise(function(e,o){t.acquireTokenInteractive(k.Constants.interactionTypePopup,!1,r,e,o)}).then(function(e){return t.logger.verbose("Successfully acquired token"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,o,!1,e.errorCode),e})},K.prototype.acquireTokenInteractive=function(e,t,r,o,n){var i=this;this.logger.verbose("AcquireTokenInteractive has been called"),p.WindowUtils.blockReloadInHiddenIframes();var s,c=this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS);if(e===k.Constants.interactionTypeRedirect&&this.cacheStorage.setItem(k.TemporaryCacheKeys.REDIRECT_REQUEST,""+k.Constants.inProgress+k.Constants.resourceDelimiter+r.state),c===k.Constants.inProgress){var u=t?b.ClientAuthError.createLoginInProgressError():b.ClientAuthError.createAcquireTokenInProgressError(),l=A.buildResponseStateOnly(this.getAccountState(r.state));return this.cacheStorage.resetTempCacheItems(r.state),void this.authErrorHandler(e,u,l,n)}if(r&&r.account&&!t?(s=r.account,this.logger.verbose("Account set from request")):(s=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),s||a.ServerRequestParameters.isSSOParam(r))this.logger.verbose("User session exists, login not required"),this.acquireTokenHelper(s,e,t,r,o,n);else{if(!t)return this.logger.verbose("AcquireToken call, no context or account given"),this.logger.info("User login is required"),l=A.buildResponseStateOnly(this.getAccountState(r.state)),this.cacheStorage.resetTempCacheItems(r.state),void this.authErrorHandler(e,b.ClientAuthError.createUserLoginRequiredError(),l,n);if(this.extractADALIdToken()&&!r.scopes){this.logger.info("ADAL's idToken exists. Extracting login information from ADAL's idToken");var h=this.buildIDTokenRequest(r);this.silentLogin=!0,this.acquireTokenSilent(h).then(function(t){i.silentLogin=!1,i.logger.info("Unified cache call is successful"),i.authResponseHandler(e,t,o)},function(a){i.silentLogin=!1,i.logger.error("Error occurred during unified cache ATS: "+a),i.acquireTokenHelper(null,e,t,r,o,n)})}else this.logger.verbose("Login call but no token found, proceed to login"),this.acquireTokenHelper(null,e,t,r,o,n)}},K.prototype.acquireTokenHelper=function(e,t,r,n,i,s){return o.__awaiter(this,void 0,Promise,function(){var c,l,h,d,g,f,m,v,C,T;return o.__generator(this,function(o){switch(o.label){case 0:this.logger.verbose("AcquireTokenHelper has been called"),this.logger.verbose("Interaction type: "+t+". isLoginCall: "+r),this.cacheStorage.setItem(k.TemporaryCacheKeys.INTERACTION_STATUS,k.Constants.inProgress),c=n.scopes?n.scopes.join(" ").toLowerCase():this.clientId.toLowerCase(),this.logger.verbosePii("Serialized scopes: "+c),h=n&&n.authority?E.AuthorityFactory.CreateInstance(n.authority,this.config.auth.validateAuthority,n.authorityMetadata):this.authorityInstance,o.label=1;case 1:return o.trys.push([1,11,,12]),h.hasCachedMetadata()?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(h,this.telemetryManager,n.correlationId)]);case 2:return o.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority"),o.label=4;case 4:if(g=r?N:this.getTokenType(e,n.scopes,!1),f=n.redirectStartPage||window.location.href,l=new a.ServerRequestParameters(h,this.clientId,g,this.getRedirectUri(n&&n.redirectUri),n.scopes,n.state,n.correlationId),this.logger.verbose("Finished building server authentication request"),this.updateCacheEntries(l,e,r,f),this.logger.verbose("Updating cache entries"),l.populateQueryParams(e,n),this.logger.verbose("Query parameters populated from account"),m=y.UrlUtils.createNavigateUrl(l)+k.Constants.response_mode_fragment,t===k.Constants.interactionTypeRedirect)r?this.logger.verbose("Interaction type redirect but login call is true. State not cached"):(this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_ACQ_TOKEN,n.state),l.state,this.inCookie),this.logger.verbose("State cached for redirect"),this.logger.verbosePii("State cached: "+l.state));else{if(t!==k.Constants.interactionTypePopup)throw this.logger.verbose("Invalid interaction error. State not cached"),b.ClientAuthError.createInvalidInteractionTypeError();window.renewStates.push(l.state),window.requestType=r?k.Constants.login:k.Constants.renewToken,this.logger.verbose("State saved to window"),this.logger.verbosePii("State saved: "+l.state),this.registerCallback(l.state,c,i,s)}if(t!==k.Constants.interactionTypePopup)return[3,9];this.logger.verbose("Interaction type is popup. Generating popup window");try{d=this.openPopup(m,"msal",k.Constants.popUpWidth,k.Constants.popUpHeight),p.WindowUtils.trackPopup(d)}catch(o){if(this.logger.info(b.ClientAuthErrorMessage.popUpWindowError.code+":"+b.ClientAuthErrorMessage.popUpWindowError.desc),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,b.ClientAuthErrorMessage.popUpWindowError.code),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,b.ClientAuthErrorMessage.popUpWindowError.desc),s)return s(b.ClientAuthError.createPopupWindowError()),[2]}if(!d)return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,p.WindowUtils.monitorPopupForHash(d,this.config.system.loadFrameTimeout,m,this.logger)];case 6:return v=o.sent(),this.handleAuthenticationResponse(v),this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),this.logger.info("Closing popup window"),this.config.framework.isAngular&&(this.broadcast("msal:popUpHashChanged",v),p.WindowUtils.closePopups()),[3,8];case 7:return C=o.sent(),s&&s(C),this.config.framework.isAngular?this.broadcast("msal:popUpClosed",C.errorCode+k.Constants.resourceDelimiter+C.errorMessage):(this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),d.close()),[3,8];case 8:return[3,10];case 9:n.onRedirectNavigate?(this.logger.verbose("Invoking onRedirectNavigate callback"),!1!==n.onRedirectNavigate(m)?(this.logger.verbose("onRedirectNavigate did not return false, navigating"),this.navigateWindow(m)):this.logger.verbose("onRedirectNavigate returned false, stopping navigation")):(this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(m)),o.label=10;case 10:return[3,12];case 11:return T=o.sent(),this.logger.error(T),this.cacheStorage.resetTempCacheItems(n.state),this.authErrorHandler(t,b.ClientAuthError.createEndpointResolutionError(T.toString),A.buildResponseStateOnly(n.state),s),d&&d.close(),[3,12];case 12:return[2]}})})},K.prototype.ssoSilent=function(e){if(this.logger.verbose("ssoSilent has been called"),!e)throw T.ClientConfigurationError.createEmptyRequestError();if(!e.sid&&!e.loginHint)throw T.ClientConfigurationError.createSsoSilentError();return this.acquireTokenSilent(o.__assign({},e,{scopes:[this.clientId]}))},K.prototype.acquireTokenSilent=function(e){var t=this;this.logger.verbose("AcquireTokenSilent has been called");var r=m.RequestUtils.validateRequest(e,!1,this.clientId,k.Constants.interactionTypeSilent),n=this.telemetryManager.createAndStartApiEvent(r.correlationId,P.API_EVENT_IDENTIFIER.AcquireTokenSilent),i=m.RequestUtils.createRequestSignature(r);return new Promise(function(e,n){return o.__awaiter(t,void 0,void 0,function(){var t,s,c,u,l,h,f,y,m,v,C;return o.__generator(this,function(o){switch(o.label){case 0:if(p.WindowUtils.blockReloadInHiddenIframes(),t=r.scopes.join(" ").toLowerCase(),this.logger.verbosePii("Serialized scopes: "+t),r.account?(s=r.account,this.logger.verbose("Account set from request")):(s=this.getAccount(),this.logger.verbose("Account set from MSAL Cache")),c=this.cacheStorage.getItem(k.Constants.adalIdToken),!s&&!r.sid&&!r.loginHint&&d.StringUtils.isEmpty(c))return this.logger.info("User login is required"),[2,n(b.ClientAuthError.createUserLoginRequiredError())];if(u=this.getTokenType(s,r.scopes,!0),this.logger.verbose("Response type: "+u),l=new a.ServerRequestParameters(E.AuthorityFactory.CreateInstance(r.authority,this.config.auth.validateAuthority,r.authorityMetadata),this.clientId,u,this.getRedirectUri(r.redirectUri),r.scopes,r.state,r.correlationId),this.logger.verbose("Finished building server authentication request"),a.ServerRequestParameters.isSSOParam(r)||s?(l.populateQueryParams(s,r,null,!0),this.logger.verbose("Query parameters populated from existing SSO or account")):s||d.StringUtils.isEmpty(c)?this.logger.verbose("No additional query parameters added"):(h=g.TokenUtils.extractIdToken(c),this.logger.verbose("ADAL's idToken exists. Extracting login information from ADAL's idToken to populate query parameters"),l.populateQueryParams(s,null,h,!0)),!(f=r.claimsRequest||l.claimsValue)&&!r.forceRefresh)try{m=this.getCachedToken(l,s)}catch(o){y=o}return m?(this.logger.verbose("Token found in cache lookup"),this.logger.verbosePii("Scopes found: "+JSON.stringify(m.scopes)),e(m),[2,null]):[3,1];case 1:return y?(this.logger.infoPii(y.errorCode+":"+y.errorMessage),n(y),[2,null]):[3,2];case 2:v=void 0,v=f?"Skipped cache lookup since claims were given":r.forceRefresh?"Skipped cache lookup since request.forceRefresh option was set to true":"No token found in cache lookup",this.logger.verbose(v),l.authorityInstance||(l.authorityInstance=r.authority?E.AuthorityFactory.CreateInstance(r.authority,this.config.auth.validateAuthority,r.authorityMetadata):this.authorityInstance),this.logger.verbosePii("Authority instance: "+l.authority),o.label=3;case 3:return o.trys.push([3,7,,8]),l.authorityInstance.hasCachedMetadata()?[3,5]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(l.authorityInstance,this.telemetryManager,r.correlationId)]);case 4:return o.sent(),this.logger.verbose("Authority has been updated with endpoint discovery response"),[3,6];case 5:this.logger.verbose("Cached metadata found for authority"),o.label=6;case 6:return window.activeRenewals[i]?(this.logger.verbose("Renewing token in progress. Registering callback"),this.registerCallback(window.activeRenewals[i],i,e,n)):r.scopes&&-1<r.scopes.indexOf(this.clientId)&&1===r.scopes.length?(this.logger.verbose("ClientId is the only scope, renewing idToken"),this.silentLogin=!0,this.renewIdToken(i,e,n,s,l)):(this.logger.verbose("Renewing access token"),this.renewToken(i,e,n,s,l)),[3,8];case 7:return C=o.sent(),this.logger.error(C),n(b.ClientAuthError.createEndpointResolutionError(C.toString())),[2,null];case 8:return[2]}})})}).then(function(e){return t.logger.verbose("Successfully acquired token"),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,n,!0),e}).catch(function(e){throw t.cacheStorage.resetTempCacheItems(r.state),t.telemetryManager.stopAndFlushApiEvent(r.correlationId,n,!1,e.errorCode),e})},K.prototype.openPopup=function(e,t,r,o){this.logger.verbose("OpenPopup has been called");try{var n=window.screenLeft?window.screenLeft:window.screenX,i=window.screenTop?window.screenTop:window.screenY,a=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,c=a/2-r/2+n,u=s/2-o/2+i,l=window.open(e,t,"width="+r+", height="+o+", top="+u+", left="+c+", scrollbars=yes");if(!l)throw b.ClientAuthError.createPopupWindowError();return l.focus&&l.focus(),l}catch(e){throw this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS),b.ClientAuthError.createPopupWindowError(e.toString())}},K.prototype.loadIframeTimeout=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var n,i,a,s,c;return o.__generator(this,function(o){switch(o.label){case 0:return n=window.activeRenewals[r],this.logger.verbosePii("Set loading state to pending for: "+r+":"+n),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n),k.Constants.inProgress),this.config.system.navigateFrameWait?[4,p.WindowUtils.loadFrame(e,t,this.config.system.navigateFrameWait,this.logger)]:[3,2];case 1:return a=o.sent(),[3,3];case 2:a=p.WindowUtils.loadFrameSync(e,t,this.logger),o.label=3;case 3:i=a,o.label=4;case 4:return o.trys.push([4,6,,7]),[4,p.WindowUtils.monitorIframeForHash(i.contentWindow,this.config.system.loadFrameTimeout,e,this.logger)];case 5:return(s=o.sent())&&this.handleAuthenticationResponse(s),[3,7];case 6:throw c=o.sent(),this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n))===k.Constants.inProgress&&(this.logger.verbose("Loading frame has timed out after: "+this.config.system.loadFrameTimeout/1e3+" seconds for scope/authority "+r+":"+n),n&&window.callbackMappedToRenewStates[n]&&window.callbackMappedToRenewStates[n](null,c),this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,n))),p.WindowUtils.removeHiddenIframe(i),c;case 7:return p.WindowUtils.removeHiddenIframe(i),[2]}})})},K.prototype.navigateWindow=function(e,t){if(!e||d.StringUtils.isEmpty(e))throw this.logger.info("Navigate url is empty"),I.AuthError.createUnexpectedError("Navigate url is empty");var r=t||window,o=t?"Navigated Popup window to:"+e:"Navigate to:"+e;this.logger.infoPii(o),r.location.assign(e)},K.prototype.registerCallback=function(e,t,r,o){var n=this;window.activeRenewals[t]=e,window.promiseMappedToRenewStates[e]||(window.promiseMappedToRenewStates[e]=[]),window.promiseMappedToRenewStates[e].push({resolve:r,reject:o}),window.callbackMappedToRenewStates[e]||(window.callbackMappedToRenewStates[e]=function(r,o){window.activeRenewals[t]=null;for(var i=0;i<window.promiseMappedToRenewStates[e].length;++i)try{if(o)window.promiseMappedToRenewStates[e][i].reject(o);else{if(!r)throw n.cacheStorage.resetTempCacheItems(e),I.AuthError.createUnexpectedError("Error and response are both null");window.promiseMappedToRenewStates[e][i].resolve(r)}}catch(r){n.logger.warning(r)}window.promiseMappedToRenewStates[e]=null,window.callbackMappedToRenewStates[e]=null})},K.prototype.logout=function(e){this.logger.verbose("Logout has been called"),this.logoutAsync(e)},K.prototype.logoutAsync=function(e){return o.__awaiter(this,void 0,Promise,function(){var t,r,n,i,a,s;return o.__generator(this,function(o){switch(o.label){case 0:t=e||R.CryptoUtils.createNewGuid(),r=this.telemetryManager.createAndStartApiEvent(t,P.API_EVENT_IDENTIFIER.Logout),this.clearCache(),this.account=null,o.label=1;case 1:return o.trys.push([1,5,,6]),this.authorityInstance.hasCachedMetadata()?[3,3]:(this.logger.verbose("No cached metadata for authority"),[4,E.AuthorityFactory.saveMetadataFromNetwork(this.authorityInstance,this.telemetryManager,e)]);case 2:return o.sent(),[3,4];case 3:this.logger.verbose("Cached metadata found for authority"),o.label=4;case 4:return n="client-request-id="+t,i=void 0,this.getPostLogoutRedirectUri()?(i="&post_logout_redirect_uri="+encodeURIComponent(this.getPostLogoutRedirectUri()),this.logger.verbose("redirectUri found and set")):(i="",this.logger.verbose("No redirectUri set for app. postLogoutQueryParam is empty")),a=void 0,this.authorityInstance.EndSessionEndpoint?(a=this.authorityInstance.EndSessionEndpoint+"?"+n+i,this.logger.verbose("EndSessionEndpoint found and urlNavigate set"),this.logger.verbosePii("urlNavigate set to: "+this.authorityInstance.EndSessionEndpoint)):(a=this.authority+"oauth2/v2.0/logout?"+n+i,this.logger.verbose("No endpoint, urlNavigate set to default")),this.telemetryManager.stopAndFlushApiEvent(t,r,!0),this.logger.verbose("Navigating window to urlNavigate"),this.navigateWindow(a),[3,6];case 5:return s=o.sent(),this.telemetryManager.stopAndFlushApiEvent(t,r,!1,s.errorCode),[3,6];case 6:return[2]}})})},K.prototype.clearCache=function(){this.logger.verbose("Clearing cache"),window.renewStates=[];for(var e=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),t=0;t<e.length;t++)this.cacheStorage.removeItem(JSON.stringify(e[t].key));this.cacheStorage.resetCacheItems(),this.cacheStorage.clearMsalCookie(),this.logger.verbose("Cache cleared")},K.prototype.clearCacheForScope=function(e){this.logger.verbose("Clearing access token from cache");for(var t=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),r=0;r<t.length;r++){var o=t[r];o.value.accessToken===e&&(this.cacheStorage.removeItem(JSON.stringify(o.key)),this.logger.verbosePii("Access token removed: "+o.key))}},K.prototype.isCallback=function(e){return this.logger.info("isCallback will be deprecated in favor of urlContainsHash in MSAL.js v2.0."),this.logger.verbose("isCallback has been called"),y.UrlUtils.urlContainsHash(e)},K.prototype.processCallBack=function(e,t,r){var o,n;this.logger.info("ProcessCallBack has been called. Processing callback from redirect response"),t||(this.logger.verbose("StateInfo is null, getting stateInfo from hash"),t=this.getResponseState(e));try{o=this.saveTokenFromHash(e,t)}catch(e){n=e}try{this.cacheStorage.clearMsalCookie(t.state);var i=this.getAccountState(t.state);if(o){if(t.requestType===k.Constants.renewToken||o.accessToken?(window.parent!==window?this.logger.verbose("Window is in iframe, acquiring token silently"):this.logger.verbose("Acquiring token interactive in progress"),this.logger.verbose("Response tokenType set to "+k.ServerHashParamKeys.ACCESS_TOKEN),o.tokenType=k.ServerHashParamKeys.ACCESS_TOKEN):t.requestType===k.Constants.login&&(this.logger.verbose("Response tokenType set to "+k.ServerHashParamKeys.ID_TOKEN),o.tokenType=k.ServerHashParamKeys.ID_TOKEN),!r)return this.logger.verbose("Setting redirectResponse"),void(this.redirectResponse=o)}else if(!r)return this.logger.verbose("Response is null, setting redirectResponse with state"),this.redirectResponse=A.buildResponseStateOnly(i),this.redirectError=n,void this.cacheStorage.resetTempCacheItems(t.state);this.logger.verbose("Calling callback provided to processCallback"),r(o,n)}catch(e){throw this.logger.error("Error occurred in token received callback function: "+e),b.ClientAuthError.createErrorInCallbackFunction(e.toString())}},K.prototype.handleAuthenticationResponse=function(e){this.logger.verbose("HandleAuthenticationResponse has been called");var t=e||window.location.hash,r=this.getResponseState(t);this.logger.verbose("Obtained state from response");var o=window.callbackMappedToRenewStates[r.state];this.processCallBack(t,r,o),p.WindowUtils.closePopups()},K.prototype.handleRedirectAuthenticationResponse=function(e){this.logger.info("Returned from redirect url"),this.logger.verbose("HandleRedirectAuthenticationResponse has been called"),window.location.hash="",this.logger.verbose("Window.location.hash cleared");var t=this.getResponseState(e);if(this.config.auth.navigateToLoginRequestUrl&&window.parent===window){this.logger.verbose("Window.parent is equal to window, not in popup or iframe. Navigation to login request url after login turned on");var r=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.LOGIN_REQUEST,t.state),this.inCookie);if(!r||"null"===r)return this.logger.error("Unable to get valid login request url from cache, redirecting to home page"),void window.location.assign("/");this.logger.verbose("Valid login request url obtained from cache");var o=y.UrlUtils.removeHashFromUrl(window.location.href),n=y.UrlUtils.removeHashFromUrl(r);if(o!==n)return this.logger.verbose("Current url is not login request url, navigating"),this.logger.verbosePii("CurrentUrl: "+o+", finalRedirectUrl: "+n),void window.location.assign(""+n+e);this.logger.verbose("Current url matches login request url");var i=y.UrlUtils.GetUrlComponents(r);i.Hash&&(this.logger.verbose("Login request url contains hash, resetting non-msal hash"),window.location.hash=i.Hash)}else this.config.auth.navigateToLoginRequestUrl||this.logger.verbose("Default navigation to start page after login turned off");this.processCallBack(e,t,null)},K.prototype.getResponseState=function(e){this.logger.verbose("GetResponseState has been called");var t,r=y.UrlUtils.deserializeHash(e);if(!r)throw I.AuthError.createUnexpectedError("Hash was not parsed correctly.");if(!r.hasOwnProperty(k.ServerHashParamKeys.STATE))throw I.AuthError.createUnexpectedError("Hash does not contain state.");this.logger.verbose("Hash contains state. Creating stateInfo object");var o=m.RequestUtils.parseLibraryState(r.state);if((t={requestType:k.Constants.unknown,state:r.state,timestamp:o.ts,method:o.method,stateMatch:!1}).state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie)||t.state===this.silentAuthenticationState)return this.logger.verbose("State matches cached state, setting requestType to login"),t.requestType=k.Constants.login,t.stateMatch=!0,t;if(t.state===this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_ACQ_TOKEN,t.state),this.inCookie))return this.logger.verbose("State matches cached state, setting requestType to renewToken"),t.requestType=k.Constants.renewToken,t.stateMatch=!0,t;if(!t.stateMatch){this.logger.verbose("State does not match cached state, setting requestType to type from window"),t.requestType=window.requestType;for(var n=window.renewStates,i=0;i<n.length;i++)if(n[i]===t.state){this.logger.verbose("Matching state found for request"),t.stateMatch=!0;break}t.stateMatch||this.logger.verbose("Matching state not found for request")}return t},K.prototype.getCachedToken=function(e,t){this.logger.verbose("GetCachedToken has been called");var r=null,o=e.scopes,n=this.cacheStorage.getAllAccessTokens(this.clientId,t?t.homeAccountIdentifier:null);if(this.logger.verbose("Getting all cached access tokens"),0===n.length)return this.logger.verbose("No matching tokens found when filtered by clientId and account"),null;var i=[];if(e.authority){for(this.logger.verbose("Authority passed, filtering by authority and scope"),a=0;a<n.length;a++)u=(s=n[a]).key.scopes.split(" "),h.ScopeSet.containsScope(u,o)&&y.UrlUtils.CanonicalizeUri(s.key.authority)===e.authority&&i.push(s);if(0===i.length)return this.logger.verbose("No matching tokens found"),null;if(1!==i.length)throw b.ClientAuthError.createMultipleMatchingTokensInCacheError(o.toString());this.logger.verbose("Single token found"),r=i[0]}else{this.logger.verbose("No authority passed, filtering tokens by scope");for(var a=0;a<n.length;a++){var s,u=(s=n[a]).key.scopes.split(" ");h.ScopeSet.containsScope(u,o)&&i.push(s)}if(1===i.length)this.logger.verbose("One matching token found, setting authorityInstance"),r=i[0],e.authorityInstance=E.AuthorityFactory.CreateInstance(r.key.authority,this.config.auth.validateAuthority);else{if(1<i.length)throw b.ClientAuthError.createMultipleMatchingTokensInCacheError(o.toString());this.logger.verbose("No matching token found when filtering by scope");var l=this.getUniqueAuthority(n,"authority");if(1<l.length)throw b.ClientAuthError.createMultipleAuthoritiesInCacheError(o.toString());this.logger.verbose("Single authority used, setting authorityInstance"),e.authorityInstance=E.AuthorityFactory.CreateInstance(l[0],this.config.auth.validateAuthority)}}if(null==r)return this.logger.verbose("No tokens found"),null;this.logger.verbose("Evaluating access token found");var d=Number(r.value.expiresIn),p=this.config.system.tokenRenewalOffsetSeconds||300;if(d&&d>f.TimeUtils.now()+p){this.logger.verbose("Token expiration is within offset, renewing token");var g=new c.IdToken(r.value.idToken);if(!t&&!(t=this.getAccount()))throw I.AuthError.createUnexpectedError("Account should not be null here.");var m=this.getAccountState(e.state),C={uniqueId:"",tenantId:"",tokenType:r.value.idToken===r.value.accessToken?k.ServerHashParamKeys.ID_TOKEN:k.ServerHashParamKeys.ACCESS_TOKEN,idToken:g,idTokenClaims:g.claims,accessToken:r.value.accessToken,scopes:r.key.scopes.split(" "),expiresOn:new Date(1e3*d),account:t,accountState:m,fromCache:!0};return v.ResponseUtils.setResponseIdToken(C,g),this.logger.verbose("Response generated and token set"),C}return this.logger.verbose("Token expired, removing from cache"),this.cacheStorage.removeItem(JSON.stringify(i[0].key)),null},K.prototype.getUniqueAuthority=function(e,t){this.logger.verbose("GetUniqueAuthority has been called");var r=[],o=[];return e.forEach(function(e){e.key.hasOwnProperty(t)&&-1===o.indexOf(e.key[t])&&(o.push(e.key[t]),r.push(e.key[t]))}),r},K.prototype.extractADALIdToken=function(){this.logger.verbose("ExtractADALIdToken has been called");var e=this.cacheStorage.getItem(k.Constants.adalIdToken);return d.StringUtils.isEmpty(e)?null:g.TokenUtils.extractIdToken(e)},K.prototype.renewToken=function(e,t,r,o,n){this.logger.verbose("RenewToken has been called"),this.logger.verbosePii("RenewToken scope and authority: "+e);var i=p.WindowUtils.generateFrameName(k.FramePrefix.TOKEN_FRAME,e);p.WindowUtils.addHiddenIFrame(i,this.logger),this.updateCacheEntries(n,o,!1),this.logger.verbosePii("RenewToken expected state: "+n.state);var a=y.UrlUtils.urlRemoveQueryStringParameter(y.UrlUtils.createNavigateUrl(n),k.Constants.prompt)+k.Constants.prompt_none+k.Constants.response_mode_fragment;window.renewStates.push(n.state),window.requestType=k.Constants.renewToken,this.logger.verbose("Set window.renewState and requestType"),this.registerCallback(n.state,e,t,r),this.logger.infoPii("Navigate to: "+a),this.loadIframeTimeout(a,i,e).catch(function(e){return r(e)})},K.prototype.renewIdToken=function(e,t,r,o,n){this.logger.info("RenewIdToken has been called");var i=p.WindowUtils.generateFrameName(k.FramePrefix.ID_TOKEN_FRAME,e);p.WindowUtils.addHiddenIFrame(i,this.logger),this.updateCacheEntries(n,o,!1),this.logger.verbose("RenewIdToken expected state: "+n.state);var a=y.UrlUtils.urlRemoveQueryStringParameter(y.UrlUtils.createNavigateUrl(n),k.Constants.prompt)+k.Constants.prompt_none+k.Constants.response_mode_fragment;this.silentLogin?(this.logger.verbose("Silent login is true, set silentAuthenticationState"),window.requestType=k.Constants.login,this.silentAuthenticationState=n.state):(this.logger.verbose("Not silent login, set window.renewState and requestType"),window.requestType=k.Constants.renewToken,window.renewStates.push(n.state)),this.registerCallback(n.state,e,t,r),this.logger.infoPii('Navigate to:" '+a),this.loadIframeTimeout(a,i,e).catch(function(e){return r(e)})},K.prototype.saveAccessToken=function(e,t,r,a,c){var u;this.logger.verbose("SaveAccessToken has been called");var l,d=o.__assign({},e),p=new s.ClientInfo(a);if(r.hasOwnProperty(k.ServerHashParamKeys.SCOPE)){this.logger.verbose("Response parameters contains scope");var g=(u=r[k.ServerHashParamKeys.SCOPE]).split(" "),y=this.cacheStorage.getAllAccessTokens(this.clientId,t);this.logger.verbose("Retrieving all access tokens from cache and removing duplicates");for(var v=0;v<y.length;v++){var E=y[v];if(E.key.homeAccountIdentifier===e.account.homeAccountIdentifier){var C=E.key.scopes.split(" ");h.ScopeSet.isIntersectingScopes(C,g)&&this.cacheStorage.removeItem(JSON.stringify(E.key))}}var T=f.TimeUtils.parseExpiresIn(r[k.ServerHashParamKeys.EXPIRES_IN]);l=m.RequestUtils.parseLibraryState(r[k.ServerHashParamKeys.STATE]).ts+T;var I=new n.AccessTokenKey(t,this.clientId,u,p.uid,p.utid),b=new i.AccessTokenValue(r[k.ServerHashParamKeys.ACCESS_TOKEN],c.rawIdToken,l.toString(),a);this.cacheStorage.setItem(JSON.stringify(I),JSON.stringify(b)),this.logger.verbose("Saving token to cache"),d.accessToken=r[k.ServerHashParamKeys.ACCESS_TOKEN],d.scopes=g}else this.logger.verbose("Response parameters does not contain scope, clientId set as scope"),u=this.clientId,I=new n.AccessTokenKey(t,this.clientId,u,p.uid,p.utid),l=Number(c.expiration),b=new i.AccessTokenValue(r[k.ServerHashParamKeys.ID_TOKEN],r[k.ServerHashParamKeys.ID_TOKEN],l.toString(),a),this.cacheStorage.setItem(JSON.stringify(I),JSON.stringify(b)),this.logger.verbose("Saving token to cache"),d.scopes=[u],d.accessToken=r[k.ServerHashParamKeys.ID_TOKEN];return l?(this.logger.verbose("New expiration set"),d.expiresOn=new Date(1e3*l)):this.logger.error("Could not parse expiresIn parameter"),d},K.prototype.saveTokenFromHash=function(e,t){this.logger.verbose("SaveTokenFromHash has been called"),this.logger.info("State status: "+t.stateMatch+"; Request type: "+t.requestType);var r,o={uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:null,scopes:[],expiresOn:null,account:null,accountState:"",fromCache:!1},n=y.UrlUtils.deserializeHash(e),i="",a="",h=null;if(n.hasOwnProperty(k.ServerHashParamKeys.ERROR_DESCRIPTION)||n.hasOwnProperty(k.ServerHashParamKeys.ERROR)){if(this.logger.verbose("Server returned an error"),this.logger.infoPii("Error : "+n[k.ServerHashParamKeys.ERROR]+"; Error description: "+n[k.ServerHashParamKeys.ERROR_DESCRIPTION]),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,n[k.ServerHashParamKeys.ERROR]),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,n[k.ServerHashParamKeys.ERROR_DESCRIPTION]),t.requestType===k.Constants.login&&(this.logger.verbose("RequestType is login, caching login error, generating authorityKey"),this.cacheStorage.setItem(k.ErrorCacheKeys.LOGIN_ERROR,n[k.ServerHashParamKeys.ERROR_DESCRIPTION]+":"+n[k.ServerHashParamKeys.ERROR]),i=u.AuthCache.generateAuthorityKey(t.state)),t.requestType===k.Constants.renewToken){this.logger.verbose("RequestType is renewToken, generating acquireTokenAccountKey"),i=u.AuthCache.generateAuthorityKey(t.state);var p=this.getAccount(),g=void 0;p&&!d.StringUtils.isEmpty(p.homeAccountIdentifier)?(g=p.homeAccountIdentifier,this.logger.verbose("AccountId is set")):(g=k.Constants.no_account,this.logger.verbose("AccountId is set as no_account")),a=u.AuthCache.generateAcquireTokenAccountKey(g,t.state)}var f=n[k.ServerHashParamKeys.ERROR],m=n[k.ServerHashParamKeys.ERROR_DESCRIPTION];r=_.InteractionRequiredAuthError.isInteractionRequiredError(f)||_.InteractionRequiredAuthError.isInteractionRequiredError(m)?new _.InteractionRequiredAuthError(n[k.ServerHashParamKeys.ERROR],n[k.ServerHashParamKeys.ERROR_DESCRIPTION]):new S.ServerError(n[k.ServerHashParamKeys.ERROR],n[k.ServerHashParamKeys.ERROR_DESCRIPTION])}else if(this.logger.verbose("Server returns success"),t.stateMatch){this.logger.info("State is right"),n.hasOwnProperty(k.ServerHashParamKeys.SESSION_STATE)&&(this.logger.verbose("Fragment has session state, caching"),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.SESSION_STATE,t.state),n[k.ServerHashParamKeys.SESSION_STATE])),o.accountState=this.getAccountState(t.state);var E="";if(n.hasOwnProperty(k.ServerHashParamKeys.ACCESS_TOKEN)){this.logger.info("Fragment has access token"),o.accessToken=n[k.ServerHashParamKeys.ACCESS_TOKEN],n.hasOwnProperty(k.ServerHashParamKeys.SCOPE)&&(o.scopes=n[k.ServerHashParamKeys.SCOPE].split(" ")),n.hasOwnProperty(k.ServerHashParamKeys.ID_TOKEN)?(this.logger.verbose("Fragment has id_token"),h=new c.IdToken(n[k.ServerHashParamKeys.ID_TOKEN]),o.idToken=h,o.idTokenClaims=h.claims):(this.logger.verbose("No idToken on fragment, getting idToken from cache"),h=new c.IdToken(this.cacheStorage.getItem(k.PersistentCacheKeys.IDTOKEN)),o=v.ResponseUtils.setResponseIdToken(o,h));var C=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,h);if(this.logger.verbose("Got authority from cache"),!n.hasOwnProperty(k.ServerHashParamKeys.CLIENT_INFO))throw this.logger.warning("ClientInfo not received in the response from AAD"),b.ClientAuthError.createClientInfoNotPopulatedError("ClientInfo not received in the response from the server");this.logger.verbose("Fragment has clientInfo"),E=n[k.ServerHashParamKeys.CLIENT_INFO],o.account=l.Account.createAccount(h,new s.ClientInfo(E)),this.logger.verbose("Account object created from response");var T=void 0;T=o.account&&!d.StringUtils.isEmpty(o.account.homeAccountIdentifier)?(this.logger.verbose("AccountKey set"),o.account.homeAccountIdentifier):(this.logger.verbose("AccountKey set as no_account"),k.Constants.no_account),a=u.AuthCache.generateAcquireTokenAccountKey(T,t.state);var A=u.AuthCache.generateAcquireTokenAccountKey(k.Constants.no_account,t.state);this.logger.verbose("AcquireTokenAccountKey generated");var w=this.cacheStorage.getItem(a),P=void 0;d.StringUtils.isEmpty(w)?d.StringUtils.isEmpty(this.cacheStorage.getItem(A))||(this.logger.verbose("No acquireToken account retrieved from cache"),o=this.saveAccessToken(o,C,n,E,h)):(P=JSON.parse(w),this.logger.verbose("AcquireToken request account retrieved from cache"),o.account&&P&&l.Account.compareAccounts(o.account,P)?(o=this.saveAccessToken(o,C,n,E,h),this.logger.info("The user object received in the response is the same as the one passed in the acquireToken request")):this.logger.warning("The account object created from the response is not the same as the one passed in the acquireToken request"))}if(n.hasOwnProperty(k.ServerHashParamKeys.ID_TOKEN))if(this.logger.info("Fragment has idToken"),h=new c.IdToken(n[k.ServerHashParamKeys.ID_TOKEN]),o=v.ResponseUtils.setResponseIdToken(o,h),n.hasOwnProperty(k.ServerHashParamKeys.CLIENT_INFO)?(this.logger.verbose("Fragment has clientInfo"),E=n[k.ServerHashParamKeys.CLIENT_INFO]):this.logger.warning("ClientInfo not received in the response from AAD"),C=this.populateAuthority(t.state,this.inCookie,this.cacheStorage,h),this.account=l.Account.createAccount(h,new s.ClientInfo(E)),o.account=this.account,this.logger.verbose("Account object created from response"),h&&h.nonce){this.logger.verbose("IdToken has nonce");var R=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.NONCE_IDTOKEN,t.state),this.inCookie);h.nonce!==R?(this.account=null,this.cacheStorage.setItem(k.ErrorCacheKeys.LOGIN_ERROR,"Nonce Mismatch. Expected Nonce: "+R+",Actual Nonce: "+h.nonce),this.logger.error("Nonce Mismatch. Expected Nonce: "+R+", Actual Nonce: "+h.nonce),r=b.ClientAuthError.createNonceMismatchError(R,h.nonce)):(this.logger.verbose("Nonce matches, saving idToken to cache"),this.cacheStorage.setItem(k.PersistentCacheKeys.IDTOKEN,n[k.ServerHashParamKeys.ID_TOKEN],this.inCookie),this.cacheStorage.setItem(k.PersistentCacheKeys.CLIENT_INFO,E,this.inCookie),this.saveAccessToken(o,C,n,E,h))}else this.logger.verbose("No idToken or no nonce. Cache key for Authority set as state"),i=t.state,a=t.state,this.logger.error("Invalid id_token received in the response"),r=b.ClientAuthError.createInvalidIdTokenError(h),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,r.errorCode),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,r.errorMessage)}else{this.logger.verbose("State mismatch"),i=t.state,a=t.state;var O=this.cacheStorage.getItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,t.state),this.inCookie);this.logger.error("State Mismatch. Expected State: "+O+", Actual State: "+t.state),r=b.ClientAuthError.createInvalidStateError(t.state,O),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR,r.errorCode),this.cacheStorage.setItem(k.ErrorCacheKeys.ERROR_DESC,r.errorMessage)}if(this.cacheStorage.removeItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.RENEW_STATUS,t.state)),this.cacheStorage.resetTempCacheItems(t.state),this.logger.verbose("Status set to complete, temporary cache cleared"),this.inCookie&&(this.logger.verbose("InCookie is true, setting authorityKey in cookie"),this.cacheStorage.setItemCookie(i,"",-1),this.cacheStorage.clearMsalCookie(t.state)),r)throw r;if(!o)throw I.AuthError.createUnexpectedError("Response is null");return o},K.prototype.populateAuthority=function(e,t,r,o){this.logger.verbose("PopulateAuthority has been called");var n=u.AuthCache.generateAuthorityKey(e),i=r.getItem(n,t);return d.StringUtils.isEmpty(i)?i:y.UrlUtils.replaceTenantPath(i,o.tenantId)},K.prototype.getAccount=function(){if(this.account)return this.account;var e=this.cacheStorage.getItem(k.PersistentCacheKeys.IDTOKEN,this.inCookie),t=this.cacheStorage.getItem(k.PersistentCacheKeys.CLIENT_INFO,this.inCookie);if(d.StringUtils.isEmpty(e)||d.StringUtils.isEmpty(t))return null;var r=new c.IdToken(e),o=new s.ClientInfo(t);return this.account=l.Account.createAccount(r,o),this.account},K.prototype.getAccountState=function(e){if(e){var t=e.indexOf(k.Constants.resourceDelimiter);if(-1<t&&t+1<e.length)return e.substring(t+1)}return e},K.prototype.getAllAccounts=function(){for(var e=[],t=this.cacheStorage.getAllAccessTokens(k.Constants.clientId,k.Constants.homeAccountIdentifier),r=0;r<t.length;r++){var o=new c.IdToken(t[r].value.idToken),n=new s.ClientInfo(t[r].value.homeAccountIdentifier),i=l.Account.createAccount(o,n);e.push(i)}return this.getUniqueAccounts(e)},K.prototype.getUniqueAccounts=function(e){if(!e||e.length<=1)return e;for(var t=[],r=[],o=0;o<e.length;++o)e[o].homeAccountIdentifier&&-1===t.indexOf(e[o].homeAccountIdentifier)&&(t.push(e[o].homeAccountIdentifier),r.push(e[o]));return r},K.prototype.broadcast=function(e,t){var r=new CustomEvent(e,{detail:t});window.dispatchEvent(r)},K.prototype.getCachedTokenInternal=function(e,t,r,o){var n=t||this.getAccount();if(!n)return null;var i=this.authorityInstance?this.authorityInstance:E.AuthorityFactory.CreateInstance(this.authority,this.config.auth.validateAuthority),s=this.getTokenType(n,e,!0),c=new a.ServerRequestParameters(i,this.clientId,s,this.getRedirectUri(),e,r,o);return this.getCachedToken(c,t)},K.prototype.getScopesForEndpoint=function(e){if(0<this.config.framework.unprotectedResources.length)for(var t=0;t<this.config.framework.unprotectedResources.length;t++)if(-1<e.indexOf(this.config.framework.unprotectedResources[t]))return null;if(0<this.config.framework.protectedResourceMap.size)for(var r=0,o=Array.from(this.config.framework.protectedResourceMap.keys());r<o.length;r++){var n=o[r];if(-1<e.indexOf(n))return this.config.framework.protectedResourceMap.get(n)}return-1<e.indexOf("http://")||-1<e.indexOf("https://")?y.UrlUtils.getHostFromUri(e)===y.UrlUtils.getHostFromUri(this.getRedirectUri())?new Array(this.clientId):null:new Array(this.clientId)},K.prototype.getLoginInProgress=function(){return this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS)===k.Constants.inProgress},K.prototype.setInteractionInProgress=function(e){e?this.cacheStorage.setItem(k.TemporaryCacheKeys.INTERACTION_STATUS,k.Constants.inProgress):this.cacheStorage.removeItem(k.TemporaryCacheKeys.INTERACTION_STATUS)},K.prototype.setloginInProgress=function(e){this.setInteractionInProgress(e)},K.prototype.getAcquireTokenInProgress=function(){return this.cacheStorage.getItem(k.TemporaryCacheKeys.INTERACTION_STATUS)===k.Constants.inProgress},K.prototype.setAcquireTokenInProgress=function(e){this.setInteractionInProgress(e)},K.prototype.getLogger=function(){return this.logger},K.prototype.setLogger=function(e){this.logger=e},K.prototype.getRedirectUri=function(e){return e||("function"==typeof this.config.auth.redirectUri?this.config.auth.redirectUri():this.config.auth.redirectUri)},K.prototype.getPostLogoutRedirectUri=function(){return"function"==typeof this.config.auth.postLogoutRedirectUri?this.config.auth.postLogoutRedirectUri():this.config.auth.postLogoutRedirectUri},K.prototype.getCurrentConfiguration=function(){if(!this.config)throw T.ClientConfigurationError.createNoSetConfigurationError();return this.config},K.prototype.getTokenType=function(e,t,r){return r?l.Account.compareAccounts(e,this.getAccount())?-1<t.indexOf(this.config.auth.clientId)?N:U:-1<t.indexOf(this.config.auth.clientId)?N:M:l.Account.compareAccounts(e,this.getAccount())?-1<t.indexOf(this.clientId)?N:U:M},K.prototype.setAccountCache=function(e,t){var r=e?this.getAccountId(e):k.Constants.no_account,o=u.AuthCache.generateAcquireTokenAccountKey(r,t);this.cacheStorage.setItem(o,JSON.stringify(e))},K.prototype.setAuthorityCache=function(e,t){var r=u.AuthCache.generateAuthorityKey(e);this.cacheStorage.setItem(r,y.UrlUtils.CanonicalizeUri(t),this.inCookie)},K.prototype.updateCacheEntries=function(e,t,r,o){o&&this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.LOGIN_REQUEST,e.state),o,this.inCookie),r?this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.STATE_LOGIN,e.state),e.state,this.inCookie):this.setAccountCache(t,e.state),this.setAuthorityCache(e.state,e.authority),this.cacheStorage.setItem(u.AuthCache.generateTemporaryCacheKey(k.TemporaryCacheKeys.NONCE_IDTOKEN,e.state),e.nonce,this.inCookie)},K.prototype.getAccountId=function(e){return d.StringUtils.isEmpty(e.homeAccountIdentifier)?k.Constants.no_account:e.homeAccountIdentifier},K.prototype.buildIDTokenRequest=function(e){return{scopes:[this.clientId],authority:this.authority,account:this.getAccount(),extraQueryParameters:e.extraQueryParameters,correlationId:e.correlationId}},K.prototype.getTelemetryManagerFromConfig=function(e,t){if(!e)return w.default.getTelemetrymanagerStub(t,this.logger);var r=e.applicationName,o=e.applicationVersion,n=e.telemetryEmitter;if(!r||!o||!n)throw T.ClientConfigurationError.createTelemetryConfigError(e);var i={platform:{applicationName:r,applicationVersion:o},clientId:t};return new w.default(i,n,this.logger)},K);function K(e){this.authResponseCallback=null,this.tokenReceivedCallback=null,this.errorReceivedCallback=null,this.config=C.buildConfiguration(e),this.logger=this.config.system.logger,this.clientId=this.config.auth.clientId,this.inCookie=this.config.cache.storeAuthStateInCookie,this.telemetryManager=this.getTelemetryManagerFromConfig(this.config.system.telemetry,this.clientId),O.TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.validateAuthority,this.config.auth.knownAuthorities),E.AuthorityFactory.saveMetadataFromConfig(this.config.auth.authority,this.config.auth.authorityMetadata),this.authority=this.config.auth.authority||"https://login.microsoftonline.com/common",this.cacheStorage=new u.AuthCache(this.clientId,this.config.cache.cacheLocation,this.inCookie),window.activeRenewals={},window.renewStates=[],window.callbackMappedToRenewStates={},window.promiseMappedToRenewStates={},window.msal=this;var t=window.location.hash,r=y.UrlUtils.urlContainsHash(t);p.WindowUtils.checkIfBackButtonIsPressed(this.cacheStorage),!r||this.getResponseState(t).method===k.Constants.interactionTypeRedirect&&this.handleRedirectAuthenticationResponse(t)}t.UserAgentApplication=L},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(1),i=r(3),a=r(9),s=(Object.defineProperty(c.prototype,"authority",{get:function(){return this.authorityInstance?this.authorityInstance.CanonicalAuthority:null},enumerable:!0,configurable:!0}),c.prototype.populateQueryParams=function(e,t,r,o){var n={};t&&(t.prompt&&(this.promptValue=t.prompt),t.claimsRequest&&(this.claimsValue=t.claimsRequest),c.isSSOParam(t)&&(n=this.constructUnifiedCacheQueryParameter(t,null))),r&&(n=this.constructUnifiedCacheQueryParameter(null,r)),n=this.addHintParameters(e,n);var i=t?t.extraQueryParameters:null;this.queryParameters=c.generateQueryParametersString(n),this.extraQueryParameters=c.generateQueryParametersString(i,o)},c.prototype.constructUnifiedCacheQueryParameter=function(e,t){var r,o;if(e)if(e.account){var i=e.account;i.sid?(r=n.SSOTypes.SID,o=i.sid):i.userName&&(r=n.SSOTypes.LOGIN_HINT,o=i.userName)}else e.sid?(r=n.SSOTypes.SID,o=e.sid):e.loginHint&&(r=n.SSOTypes.LOGIN_HINT,o=e.loginHint);else t&&t.hasOwnProperty(n.Constants.upn)&&(r=n.SSOTypes.ID_TOKEN,o=t.upn);return this.addSSOParameter(r,o)},c.prototype.addHintParameters=function(e,t){return e&&!t[n.SSOTypes.SID]&&(!t[n.SSOTypes.LOGIN_HINT]&&e.sid&&this.promptValue===n.PromptState.NONE?t=this.addSSOParameter(n.SSOTypes.SID,e.sid,t):t[n.SSOTypes.LOGIN_HINT]||!e.userName||i.StringUtils.isEmpty(e.userName)||(t=this.addSSOParameter(n.SSOTypes.LOGIN_HINT,e.userName,t))),t},c.prototype.addSSOParameter=function(e,t,r){if(r=r||{},!t)return r;switch(e){case n.SSOTypes.SID:r[n.SSOTypes.SID]=t;break;case n.SSOTypes.ID_TOKEN:case n.SSOTypes.LOGIN_HINT:r[n.SSOTypes.LOGIN_HINT]=t}return r},c.generateQueryParametersString=function(e,t){var r=null;return e&&Object.keys(e).forEach(function(o){o===n.Constants.domain_hint&&(t||e[n.SSOTypes.SID])||(null==r?r=o+"="+encodeURIComponent(e[o]):r+="&"+o+"="+encodeURIComponent(e[o]))}),r},c.isSSOParam=function(e){return e&&(e.account||e.sid||e.loginHint)},c);function c(e,t,r,i,s,c,u){this.authorityInstance=e,this.clientId=t,this.nonce=o.CryptoUtils.createNewGuid(),this.scopes=s?s.slice():[t],this.scopes=a.ScopeSet.trimAndConvertArrayToLowerCase(this.scopes),this.state=c,this.correlationId=u,this.xClientSku="MSAL.JS",this.xClientVer=n.libraryVersion(),this.responseType=r,this.redirectUri=i}t.ServerRequestParameters=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(3),i=(a.decodeJwt=function(e){if(n.StringUtils.isEmpty(e))return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);return!t||t.length<4?null:{header:t[1],JWSPayload:t[2],JWSSig:t[3]}},a.extractIdToken=function(e){var t=this.decodeJwt(e);if(!t)return null;try{var r=t.JWSPayload,n=o.CryptoUtils.base64Decode(r);return n?JSON.parse(n):null}catch(e){}return null},a);function a(){}t.TokenUtils=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(1),i=r(5),a=r(9),s=r(3),c=r(2),u=r(11),l=r(6),h=(d.validateRequest=function(e,t,r,n){if(!t&&!e)throw i.ClientConfigurationError.createEmptyRequestError();var s,c;e&&(s=t?a.ScopeSet.appendScopes(e.scopes,e.extraScopesToConsent):e.scopes,a.ScopeSet.validateInputScope(s,!t,r),this.validatePromptParameter(e.prompt),c=this.validateEQParameters(e.extraQueryParameters,e.claimsRequest),this.validateClaimsRequest(e.claimsRequest));var u=this.validateAndGenerateState(e&&e.state,n),l=this.validateAndGenerateCorrelationId(e&&e.correlationId);return o.__assign({},e,{extraQueryParameters:c,scopes:s,state:u,correlationId:l})},d.validatePromptParameter=function(e){if(e&&[n.PromptState.LOGIN,n.PromptState.SELECT_ACCOUNT,n.PromptState.CONSENT,n.PromptState.NONE].indexOf(e)<0)throw i.ClientConfigurationError.createInvalidPromptError(e)},d.validateEQParameters=function(e,t){var r=o.__assign({},e);return r?(t&&delete r[n.Constants.claims],n.BlacklistedEQParams.forEach(function(e){r[e]&&delete r[e]}),r):null},d.validateClaimsRequest=function(e){if(e)try{JSON.parse(e)}catch(e){throw i.ClientConfigurationError.createClaimsRequestParsingError(e)}},d.validateAndGenerateState=function(e,t){return s.StringUtils.isEmpty(e)?d.generateLibraryState(t):""+d.generateLibraryState(t)+n.Constants.resourceDelimiter+e},d.generateLibraryState=function(e){var t={id:c.CryptoUtils.createNewGuid(),ts:u.TimeUtils.now(),method:e},r=JSON.stringify(t);return c.CryptoUtils.base64Encode(r)},d.parseLibraryState=function(e){var t=decodeURIComponent(e).split(n.Constants.resourceDelimiter)[0];if(c.CryptoUtils.isGuid(t))return{id:t,ts:u.TimeUtils.now(),method:n.Constants.interactionTypeRedirect};try{var r=c.CryptoUtils.base64Decode(t);return JSON.parse(r)}catch(t){throw l.ClientAuthError.createInvalidStateError(e,null)}},d.validateAndGenerateCorrelationId=function(e){if(e&&!c.CryptoUtils.isGuid(e))throw i.ClientConfigurationError.createInvalidCorrelationIdError();return c.CryptoUtils.isGuid(e)?e:c.CryptoUtils.createNewGuid()},d.createRequestSignature=function(e){return""+e.scopes.join(" ").toLowerCase()+n.Constants.resourceDelimiter+e.authority},d);function d(){}t.RequestUtils=h},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(3),i=(a.createAccount=function(e,t){var r,i=e.objectId||e.subject,s=t?t.uid:"",c=t?t.utid:"";return n.StringUtils.isEmpty(s)||n.StringUtils.isEmpty(c)||(r=o.CryptoUtils.base64Encode(s)+"."+o.CryptoUtils.base64Encode(c)),new a(i,r,e.preferredName,e.name,e.claims,e.sid,e.issuer)},a.compareAccounts=function(e,t){return!!(e&&t&&e.homeAccountIdentifier&&t.homeAccountIdentifier&&e.homeAccountIdentifier===t.homeAccountIdentifier)},a);function a(e,t,r,o,n,i,a){this.accountIdentifier=e,this.homeAccountIdentifier=t,this.userName=r,this.name=o,this.idToken=n,this.idTokenClaims=n,this.sid=i,this.environment=a}t.Account=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),n=r(4),i=r(1),a=r(11),s=(c.isInIframe=function(){return window.parent!==window},c.isInPopup=function(){return!(!window.opener||window.opener===window)},c.generateFrameName=function(e,t){return""+e+i.Constants.resourceDelimiter+t},c.monitorIframeForHash=function(e,t,r,i){return new Promise(function(s,u){var l=a.TimeUtils.relativeNowMs()+t;i.verbose("monitorWindowForIframe polling started");var h=setInterval(function(){if(a.TimeUtils.relativeNowMs()>l)return i.error("monitorIframeForHash unable to find hash in url, timing out"),i.errorPii("monitorIframeForHash polling timed out for url: "+r),clearInterval(h),void u(o.ClientAuthError.createTokenRenewalTimeoutError());var t;try{t=e.location.href}catch(t){}t&&n.UrlUtils.urlContainsHash(t)&&(i.verbose("monitorIframeForHash found url in hash"),clearInterval(h),s(e.location.hash))},c.POLLING_INTERVAL_MS)})},c.monitorPopupForHash=function(e,t,r,i){return new Promise(function(a,s){var u=t/c.POLLING_INTERVAL_MS,l=0;i.verbose("monitorWindowForHash polling started");var h=setInterval(function(){if(e.closed)return i.error("monitorWindowForHash window closed"),clearInterval(h),void s(o.ClientAuthError.createUserCancelledError());var t;try{t=e.location.href}catch(t){}t&&"about:blank"!==t&&(l++,t&&n.UrlUtils.urlContainsHash(t)?(i.verbose("monitorPopupForHash found url in hash"),clearInterval(h),a(e.location.hash)):u<l&&(i.error("monitorPopupForHash unable to find hash in url, timing out"),i.errorPii("monitorPopupForHash polling timed out for url: "+r),clearInterval(h),s(o.ClientAuthError.createTokenRenewalTimeoutError())))},c.POLLING_INTERVAL_MS)})},c.loadFrame=function(e,t,r,o){var n=this;return o.infoPii("LoadFrame: "+t),new Promise(function(i,a){setTimeout(function(){var r=n.loadFrameSync(e,t,o);r?i(r):a("Unable to load iframe with name: "+t)},r)})},c.loadFrameSync=function(e,t,r){var o=c.addHiddenIFrame(t,r);return o?(""!==o.src&&"about:blank"!==o.src||(o.src=e,r.infoPii("Frame Name : "+t+" Navigated to: "+e)),o):null},c.addHiddenIFrame=function(e,t){if(void 0===e)return null;t.infoPii("Add msal frame to document:"+e);var r=document.getElementById(e);if(!r){if(document.createElement&&document.documentElement&&-1===window.navigator.userAgent.indexOf("MSIE 5.0")){var o=document.createElement("iframe");o.setAttribute("id",e),o.setAttribute("aria-hidden","true"),o.style.visibility="hidden",o.style.position="absolute",o.style.width=o.style.height="0",o.style.border="0",o.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),r=document.getElementsByTagName("body")[0].appendChild(o)}else document.body&&document.body.insertAdjacentHTML&&document.body.insertAdjacentHTML("beforeend","<iframe name='"+e+"' id='"+e+"' style='display:none'></iframe>");window.frames&&window.frames[e]&&(r=window.frames[e])}return r},c.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},c.getIframeWithHash=function(e){var t=document.getElementsByTagName("iframe");return Array.apply(null,Array(t.length)).map(function(e,r){return t.item(r)}).filter(function(t){try{return t.contentWindow.location.hash===e}catch(t){return!1}})[0]},c.getPopups=function(){return window.openedWindows||(window.openedWindows=[]),window.openedWindows},c.getPopUpWithHash=function(e){return c.getPopups().filter(function(t){try{return t.location.hash===e}catch(t){return!1}})[0]},c.trackPopup=function(e){c.getPopups().push(e)},c.closePopups=function(){c.getPopups().forEach(function(e){return e.close()})},c.blockReloadInHiddenIframes=function(){if(n.UrlUtils.urlContainsHash(window.location.hash)&&c.isInIframe())throw o.ClientAuthError.createBlockTokenRequestsInHiddenIframeError()},c.checkIfBackButtonIsPressed=function(e){var t=e.getItem(i.TemporaryCacheKeys.REDIRECT_REQUEST);if(t&&!n.UrlUtils.urlContainsHash(window.location.hash)){var r=t.split(i.Constants.resourceDelimiter),o=1<r.length?r[r.length-1]:null;e.resetTempCacheItems(o)}},c.POLLING_INTERVAL_MS=50,c);function c(){}t.WindowUtils=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(22),i=r(3),a=r(5),s=r(1),c=r(4),u=(l.saveMetadataFromNetwork=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var n;return o.__generator(this,function(o){switch(o.label){case 0:return[4,e.resolveEndpointsAsync(t,r)];case 1:return n=o.sent(),this.metadataMap.set(e.CanonicalAuthority,n),[2,n]}})})},l.getMetadata=function(e){return this.metadataMap.get(e)},l.saveMetadataFromConfig=function(e,t){try{if(t){var r=JSON.parse(t);if(!r.authorization_endpoint||!r.end_session_endpoint||!r.issuer)throw a.ClientConfigurationError.createInvalidAuthorityMetadataError();this.metadataMap.set(e,{AuthorizationEndpoint:r.authorization_endpoint,EndSessionEndpoint:r.end_session_endpoint,Issuer:r.issuer})}}catch(e){throw a.ClientConfigurationError.createInvalidAuthorityMetadataError()}},l.CreateInstance=function(e,t,r){return i.StringUtils.isEmpty(e)?null:(r&&this.saveMetadataFromConfig(e,r),new n.Authority(e,t,this.metadataMap.get(e)))},l.isAdfs=function(e){var t=c.UrlUtils.GetUrlComponents(e).PathSegments;return!(!t.length||t[0].toLowerCase()!==s.Constants.ADFS)},l.metadataMap=new Map,l);function l(){}t.AuthorityFactory=u},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n=r(0),i=r(5),a=r(23),s=r(4),c=r(24),u=r(1);(o=t.AuthorityType||(t.AuthorityType={}))[o.Default=0]="Default",o[o.Adfs=1]="Adfs";var l=(Object.defineProperty(h.prototype,"Tenant",{get:function(){return this.CanonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"AuthorizationEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"EndSessionEndpoint",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"SelfSignedJwtAudience",{get:function(){return this.validateResolved(),this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g,this.Tenant)},enumerable:!0,configurable:!0}),h.prototype.validateResolved=function(){if(!this.hasCachedMetadata())throw"Please call ResolveEndpointsAsync first"},Object.defineProperty(h.prototype,"CanonicalAuthority",{get:function(){return this.canonicalAuthority},set:function(e){this.canonicalAuthority=s.UrlUtils.CanonicalizeUri(e),this.canonicalAuthorityUrlComponents=null},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"CanonicalAuthorityUrlComponents",{get:function(){return this.canonicalAuthorityUrlComponents||(this.canonicalAuthorityUrlComponents=s.UrlUtils.GetUrlComponents(this.CanonicalAuthority)),this.canonicalAuthorityUrlComponents},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"DefaultOpenIdConfigurationEndpoint",{get:function(){return this.CanonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!0,configurable:!0}),h.prototype.validateAsUri=function(){var e;try{e=this.CanonicalAuthorityUrlComponents}catch(e){throw i.ClientConfigurationErrorMessage.invalidAuthorityType}if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw i.ClientConfigurationErrorMessage.authorityUriInsecure;if(!e.PathSegments||e.PathSegments.length<1)throw i.ClientConfigurationErrorMessage.authorityUriInvalidPath},h.prototype.DiscoverEndpoints=function(e,t,r){var o=new a.XhrClient,n=u.NetworkRequestType.GET,i=t.createAndStartHttpEvent(r,n,e,"openIdConfigurationEndpoint");return o.sendRequestAsync(e,n,!0).then(function(e){return i.httpResponseStatus=e.statusCode,t.stopEvent(i),{AuthorizationEndpoint:e.body.authorization_endpoint,EndSessionEndpoint:e.body.end_session_endpoint,Issuer:e.body.issuer}}).catch(function(e){throw i.serverErrorCode=e,t.stopEvent(i),e})},h.prototype.resolveEndpointsAsync=function(e,t){return n.__awaiter(this,void 0,Promise,function(){var r,o,a;return n.__generator(this,function(n){switch(n.label){case 0:return this.IsValidationEnabled?(r=this.canonicalAuthorityUrlComponents.HostNameAndPort,0!==c.TrustedAuthority.getTrustedHostList().length?[3,2]:[4,c.TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority,e,t)]):[3,3];case 1:n.sent(),n.label=2;case 2:if(!c.TrustedAuthority.IsInTrustedHostList(r))throw i.ClientConfigurationError.createUntrustedAuthorityError(r);n.label=3;case 3:return o=this.GetOpenIdConfigurationEndpoint(),[4,(a=this).DiscoverEndpoints(o,e,t)];case 4:return a.tenantDiscoveryResponse=n.sent(),[2,this.tenantDiscoveryResponse]}})})},h.prototype.hasCachedMetadata=function(){return!!(this.tenantDiscoveryResponse&&this.tenantDiscoveryResponse.AuthorizationEndpoint&&this.tenantDiscoveryResponse.EndSessionEndpoint&&this.tenantDiscoveryResponse.Issuer)},h.prototype.GetOpenIdConfigurationEndpoint=function(){return this.DefaultOpenIdConfigurationEndpoint},h);function h(e,t,r){this.IsValidationEnabled=t,this.CanonicalAuthority=e,this.validateAsUri(),this.tenantDiscoveryResponse=r}t.Authority=l},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),n=(i.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise(function(r,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),a.onload=function(e){var t;(a.status<200||300<=a.status)&&i(n.handleError(a.responseText));try{t=JSON.parse(a.responseText)}catch(e){i(n.handleError(a.responseText))}var o={statusCode:a.status,body:t};r(o)},a.onerror=function(e){i(a.status)},t!==o.NetworkRequestType.GET)throw"not implemented";a.send()})},i.prototype.handleError=function(e){var t;try{if((t=JSON.parse(e)).error)return t.error;throw e}catch(t){return e}},i);function i(){}t.XhrClient=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(23),i=r(1),a=r(4),s=(c.setTrustedAuthoritiesFromConfig=function(e,t){e&&!this.getTrustedHostList().length&&t.forEach(function(e){c.TrustedHostList.push(e.toLowerCase())})},c.getAliases=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var a,s,c,u;return o.__generator(this,function(o){return a=new n.XhrClient,s=i.NetworkRequestType.GET,c=""+i.AAD_INSTANCE_DISCOVERY_ENDPOINT+e+"oauth2/v2.0/authorize",u=t.createAndStartHttpEvent(r,s,c,"getAliases"),[2,a.sendRequestAsync(c,s,!0).then(function(e){return u.httpResponseStatus=e.statusCode,t.stopEvent(u),e.body.metadata}).catch(function(e){throw u.serverErrorCode=e,t.stopEvent(u),e})]})})},c.setTrustedAuthoritiesFromNetwork=function(e,t,r){return o.__awaiter(this,void 0,Promise,function(){var n;return o.__generator(this,function(o){switch(o.label){case 0:return[4,this.getAliases(e,t,r)];case 1:return o.sent().forEach(function(e){e.aliases.forEach(function(e){c.TrustedHostList.push(e.toLowerCase())})}),n=a.UrlUtils.GetUrlComponents(e).HostNameAndPort,c.getTrustedHostList().length&&!c.IsInTrustedHostList(n)&&c.TrustedHostList.push(n.toLowerCase()),[2]}})})},c.getTrustedHostList=function(){return this.TrustedHostList},c.IsInTrustedHostList=function(e){return-1<this.TrustedHostList.indexOf(e.toLowerCase())},c.TrustedHostList=[],c);function c(){}t.TrustedAuthority=s},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(12),i=r(4),a={clientId:"",authority:null,validateAuthority:!0,authorityMetadata:"",knownAuthorities:[],redirectUri:function(){return i.UrlUtils.getCurrentUrl()},postLogoutRedirectUri:function(){return i.UrlUtils.getCurrentUrl()},navigateToLoginRequestUrl:!0},s={cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},c={logger:new n.Logger(null),loadFrameTimeout:6e3,tokenRenewalOffsetSeconds:300,navigateFrameWait:500},u={isAngular:!1,unprotectedResources:new Array,protectedResourceMap:new Map};t.buildConfiguration=function(e){var t=e.auth,r=e.cache,n=void 0===r?{}:r,i=e.system,l=void 0===i?{}:i,h=e.framework,d=void 0===h?{}:h;return{auth:o.__assign({},a,t),cache:o.__assign({},s,n),system:o.__assign({},c,l),framework:o.__assign({},u,d)}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=r(13);t.InteractionRequiredAuthErrorMessage={interactionRequired:{code:"interaction_required"},consentRequired:{code:"consent_required"},loginRequired:{code:"login_required"}};var i,a=(i=n.ServerError,o.__extends(s,i),s.isInteractionRequiredError=function(e){var r=[t.InteractionRequiredAuthErrorMessage.interactionRequired.code,t.InteractionRequiredAuthErrorMessage.consentRequired.code,t.InteractionRequiredAuthErrorMessage.loginRequired.code];return e&&-1<r.indexOf(e)},s.createLoginRequiredAuthError=function(e){return new s(t.InteractionRequiredAuthErrorMessage.loginRequired.code,e)},s.createInteractionRequiredAuthError=function(e){return new s(t.InteractionRequiredAuthErrorMessage.interactionRequired.code,e)},s.createConsentRequiredAuthError=function(e){return new s(t.InteractionRequiredAuthErrorMessage.consentRequired.code,e)},s);function s(e,t){var r=i.call(this,e,t)||this;return r.name="InteractionRequiredAuthError",Object.setPrototypeOf(r,s.prototype),r}t.InteractionRequiredAuthError=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.buildResponseStateOnly=function(e){return{uniqueId:"",tenantId:"",tokenType:"",idToken:null,idTokenClaims:null,accessToken:"",scopes:null,expiresOn:null,account:null,accountState:e,fromCache:!1}}},function(e,t,r){var o;Object.defineProperty(t,"__esModule",{value:!0});var n,i,a,s,c=r(0),u=c.__importDefault(r(14)),l=r(8),h=r(10);t.EVENT_KEYS={AUTHORITY:h.prependEventNamePrefix("authority"),AUTHORITY_TYPE:h.prependEventNamePrefix("authority_type"),PROMPT:h.prependEventNamePrefix("ui_behavior"),TENANT_ID:h.prependEventNamePrefix("tenant_id"),USER_ID:h.prependEventNamePrefix("user_id"),WAS_SUCESSFUL:h.prependEventNamePrefix("was_successful"),API_ERROR_CODE:h.prependEventNamePrefix("api_error_code"),LOGIN_HINT:h.prependEventNamePrefix("login_hint")},(i=n=t.API_CODE||(t.API_CODE={}))[i.AcquireTokenRedirect=2001]="AcquireTokenRedirect",i[i.AcquireTokenSilent=2002]="AcquireTokenSilent",i[i.AcquireTokenPopup=2003]="AcquireTokenPopup",i[i.LoginRedirect=2004]="LoginRedirect",i[i.LoginPopup=2005]="LoginPopup",i[i.Logout=2006]="Logout",(s=a=t.API_EVENT_IDENTIFIER||(t.API_EVENT_IDENTIFIER={})).AcquireTokenRedirect="AcquireTokenRedirect",s.AcquireTokenSilent="AcquireTokenSilent",s.AcquireTokenPopup="AcquireTokenPopup",s.LoginRedirect="LoginRedirect",s.LoginPopup="LoginPopup",s.Logout="Logout";var d,p=((o={})[a.AcquireTokenSilent]=n.AcquireTokenSilent,o[a.AcquireTokenPopup]=n.AcquireTokenPopup,o[a.AcquireTokenRedirect]=n.AcquireTokenRedirect,o[a.LoginPopup]=n.LoginPopup,o[a.LoginRedirect]=n.LoginRedirect,o[a.Logout]=n.Logout,o),g=(d=u.default,c.__extends(f,d),Object.defineProperty(f.prototype,"apiEventIdentifier",{set:function(e){this.event[l.TELEMETRY_BLOB_EVENT_NAMES.ApiTelemIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"apiCode",{set:function(e){this.event[l.TELEMETRY_BLOB_EVENT_NAMES.ApiIdConstStrKey]=e},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"authority",{set:function(e){this.event[t.EVENT_KEYS.AUTHORITY]=h.scrubTenantFromUri(e).toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"apiErrorCode",{set:function(e){this.event[t.EVENT_KEYS.API_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"tenantId",{set:function(e){this.event[t.EVENT_KEYS.TENANT_ID]=this.piiEnabled&&e?h.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"accountId",{set:function(e){this.event[t.EVENT_KEYS.USER_ID]=this.piiEnabled&&e?h.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"wasSuccessful",{get:function(){return!0===this.event[t.EVENT_KEYS.WAS_SUCESSFUL]},set:function(e){this.event[t.EVENT_KEYS.WAS_SUCESSFUL]=e},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"loginHint",{set:function(e){this.event[t.EVENT_KEYS.LOGIN_HINT]=this.piiEnabled&&e?h.hashPersonalIdentifier(e):null},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"authorityType",{set:function(e){this.event[t.EVENT_KEYS.AUTHORITY_TYPE]=e.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"promptType",{set:function(e){this.event[t.EVENT_KEYS.PROMPT]=e.toLowerCase()},enumerable:!0,configurable:!0}),f);function f(e,t,r){var o=d.call(this,h.prependEventNamePrefix("api_event"),e,r)||this;return r&&(o.apiCode=p[r],o.apiEventIdentifier=r),o.piiEnabled=t,o}t.default=g},function(e,t,r){e.exports=r(30)},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(15);t.UserAgentApplication=o.UserAgentApplication,t.authResponseCallback=o.authResponseCallback,t.errorReceivedCallback=o.errorReceivedCallback,t.tokenReceivedCallback=o.tokenReceivedCallback;var n=r(12);t.Logger=n.Logger;var i=r(12);t.LogLevel=i.LogLevel;var a=r(19);t.Account=a.Account;var s=r(1);t.Constants=s.Constants,t.ServerHashParamKeys=s.ServerHashParamKeys;var c=r(22);t.Authority=c.Authority;var u=r(15);t.CacheResult=u.CacheResult;var l=r(25);t.CacheLocation=l.CacheLocation,t.Configuration=l.Configuration;var h=r(42);t.AuthenticationParameters=h.AuthenticationParameters;var d=r(27);t.AuthResponse=d.AuthResponse;var p=r(2);t.CryptoUtils=p.CryptoUtils;var g=r(4);t.UrlUtils=g.UrlUtils;var f=r(20);t.WindowUtils=f.WindowUtils;var y=r(7);t.AuthError=y.AuthError;var m=r(6);t.ClientAuthError=m.ClientAuthError;var v=r(13);t.ServerError=v.ServerError;var E=r(5);t.ClientConfigurationError=E.ClientConfigurationError;var C=r(26);t.InteractionRequiredAuthError=C.InteractionRequiredAuthError},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(4);t.AccessTokenKey=function(e,t,r,i,a){this.authority=n.UrlUtils.CanonicalizeUri(e),this.clientId=t,this.scopes=r,this.homeAccountIdentifier=o.CryptoUtils.base64Encode(i)+"."+o.CryptoUtils.base64Encode(a)}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenValue=function(e,t,r,o){this.accessToken=e,this.idToken=t,this.expiresIn=r,this.homeAccountIdentifier=o}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),n=r(6),i=r(3),a=(Object.defineProperty(s.prototype,"uid",{get:function(){return this._uid?this._uid:""},set:function(e){this._uid=e},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"utid",{get:function(){return this._utid?this._utid:""},set:function(e){this._utid=e},enumerable:!0,configurable:!0}),s);function s(e){if(!e||i.StringUtils.isEmpty(e))return this.uid="",void(this.utid="");try{var t=o.CryptoUtils.base64Decode(e),r=JSON.parse(t);r&&(r.hasOwnProperty("uid")&&(this.uid=r.uid),r.hasOwnProperty("utid")&&(this.utid=r.utid))}catch(e){throw n.ClientAuthError.createClientInfoDecodingError(e)}}t.ClientInfo=a},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),n=r(17),i=r(3);t.IdToken=function(e){if(i.StringUtils.isEmpty(e))throw o.ClientAuthError.createIdTokenNullOrEmptyError(e);try{this.rawIdToken=e,this.claims=n.TokenUtils.extractIdToken(e),this.claims&&(this.claims.hasOwnProperty("iss")&&(this.issuer=this.claims.iss),this.claims.hasOwnProperty("oid")&&(this.objectId=this.claims.oid),this.claims.hasOwnProperty("sub")&&(this.subject=this.claims.sub),this.claims.hasOwnProperty("tid")&&(this.tenantId=this.claims.tid),this.claims.hasOwnProperty("ver")&&(this.version=this.claims.ver),this.claims.hasOwnProperty("preferred_username")&&(this.preferredName=this.claims.preferred_username),this.claims.hasOwnProperty("name")&&(this.name=this.claims.name),this.claims.hasOwnProperty("nonce")&&(this.nonce=this.claims.nonce),this.claims.hasOwnProperty("exp")&&(this.expiration=this.claims.exp),this.claims.hasOwnProperty("home_oid")&&(this.homeObjectId=this.claims.home_oid),this.claims.hasOwnProperty("sid")&&(this.sid=this.claims.sid),this.claims.hasOwnProperty("cloud_instance_host_name")&&(this.cloudInstance=this.claims.cloud_instance_host_name))}catch(e){throw o.ClientAuthError.createIdTokenParsingError(e)}}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n=r(0),i=r(1),a=r(36),s=r(37),c=r(6),u=r(18),l=(o=s.BrowserStorage,n.__extends(h,o),h.prototype.migrateCacheEntries=function(e){var t=this,r=i.Constants.cachePrefix+"."+i.PersistentCacheKeys.IDTOKEN,n=i.Constants.cachePrefix+"."+i.PersistentCacheKeys.CLIENT_INFO,a=i.Constants.cachePrefix+"."+i.ErrorCacheKeys.ERROR,s=i.Constants.cachePrefix+"."+i.ErrorCacheKeys.ERROR_DESC,c=[o.prototype.getItem.call(this,r),o.prototype.getItem.call(this,n),o.prototype.getItem.call(this,a),o.prototype.getItem.call(this,s)];[i.PersistentCacheKeys.IDTOKEN,i.PersistentCacheKeys.CLIENT_INFO,i.ErrorCacheKeys.ERROR,i.ErrorCacheKeys.ERROR_DESC].forEach(function(r,o){return t.duplicateCacheEntry(r,c[o],e)})},h.prototype.duplicateCacheEntry=function(e,t,r){t&&this.setItem(e,t,r)},h.prototype.generateCacheKey=function(e,t){try{return JSON.parse(e),e}catch(r){return 0===e.indexOf(""+i.Constants.cachePrefix)||0===e.indexOf(i.Constants.adalIdToken)?e:t?i.Constants.cachePrefix+"."+this.clientId+"."+e:i.Constants.cachePrefix+"."+e}},h.prototype.setItem=function(e,t,r){o.prototype.setItem.call(this,this.generateCacheKey(e,!0),t,r),this.rollbackEnabled&&!r&&o.prototype.setItem.call(this,this.generateCacheKey(e,!1),t,r)},h.prototype.getItem=function(e,t){return o.prototype.getItem.call(this,this.generateCacheKey(e,!0),t)},h.prototype.removeItem=function(e){o.prototype.removeItem.call(this,this.generateCacheKey(e,!0)),this.rollbackEnabled&&o.prototype.removeItem.call(this,this.generateCacheKey(e,!1))},h.prototype.resetCacheItems=function(){var e,t=window[this.cacheLocation];for(e in t)t.hasOwnProperty(e)&&-1!==e.indexOf(i.Constants.cachePrefix)&&o.prototype.removeItem.call(this,e)},h.prototype.resetTempCacheItems=function(e){var t=this,r=e&&u.RequestUtils.parseLibraryState(e).id,n=this.tokenRenewalInProgress(e),a=window[this.cacheLocation];r&&!n&&Object.keys(a).forEach(function(e){-1!==e.indexOf(r)&&(t.removeItem(e),o.prototype.clearItemCookie.call(t,e))}),this.removeItem(i.TemporaryCacheKeys.INTERACTION_STATUS),this.removeItem(i.TemporaryCacheKeys.REDIRECT_REQUEST)},h.prototype.setItemCookie=function(e,t,r){o.prototype.setItemCookie.call(this,this.generateCacheKey(e,!0),t,r),this.rollbackEnabled&&o.prototype.setItemCookie.call(this,this.generateCacheKey(e,!1),t,r)},h.prototype.clearItemCookie=function(e){o.prototype.clearItemCookie.call(this,this.generateCacheKey(e,!0)),this.rollbackEnabled&&o.prototype.clearItemCookie.call(this,this.generateCacheKey(e,!1))},h.prototype.getItemCookie=function(e){return o.prototype.getItemCookie.call(this,this.generateCacheKey(e,!0))},h.prototype.getAllAccessTokens=function(e,t){var r=this;return Object.keys(window[this.cacheLocation]).reduce(function(o,n){if(n.match(e)&&n.match(t)&&n.match(i.Constants.scopes)){var s=r.getItem(n);if(s)try{var u=JSON.parse(n),l=new a.AccessTokenCacheItem(u,JSON.parse(s));return o.concat([l])}catch(o){throw c.ClientAuthError.createCacheParseError(n)}}return o},[])},h.prototype.tokenRenewalInProgress=function(e){var t=this.getItem(h.generateTemporaryCacheKey(i.TemporaryCacheKeys.RENEW_STATUS,e));return!(!t||t!==i.Constants.inProgress)},h.prototype.clearMsalCookie=function(e){var t=this;e?(this.clearItemCookie(h.generateTemporaryCacheKey(i.TemporaryCacheKeys.NONCE_IDTOKEN,e)),this.clearItemCookie(h.generateTemporaryCacheKey(i.TemporaryCacheKeys.STATE_LOGIN,e)),this.clearItemCookie(h.generateTemporaryCacheKey(i.TemporaryCacheKeys.LOGIN_REQUEST,e)),this.clearItemCookie(h.generateTemporaryCacheKey(i.TemporaryCacheKeys.STATE_ACQ_TOKEN,e))):document.cookie.split(";").forEach(function(e){var r=e.trim().split("=")[0];-1<r.indexOf(i.Constants.cachePrefix)&&o.prototype.clearItemCookie.call(t,r)})},h.generateAcquireTokenAccountKey=function(e,t){var r=u.RequestUtils.parseLibraryState(t).id;return""+i.TemporaryCacheKeys.ACQUIRE_TOKEN_ACCOUNT+i.Constants.resourceDelimiter+e+i.Constants.resourceDelimiter+r},h.generateAuthorityKey=function(e){return h.generateTemporaryCacheKey(i.TemporaryCacheKeys.AUTHORITY,e)},h.generateTemporaryCacheKey=function(e,t){var r=u.RequestUtils.parseLibraryState(t).id;return""+e+i.Constants.resourceDelimiter+r},h);function h(e,t,r){var n=o.call(this,t)||this;return n.clientId=e,n.rollbackEnabled=!0,n.migrateCacheEntries(r),n}t.AuthCache=l},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0}),t.AccessTokenCacheItem=function(e,t){this.key=e,this.value=t}},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5),n=r(7),i=(a.prototype.setItem=function(e,t,r){window[this.cacheLocation].setItem(e,t),r&&this.setItemCookie(e,t)},a.prototype.getItem=function(e,t){return t&&this.getItemCookie(e)?this.getItemCookie(e):window[this.cacheLocation].getItem(e)},a.prototype.removeItem=function(e){return window[this.cacheLocation].removeItem(e)},a.prototype.clear=function(){return window[this.cacheLocation].clear()},a.prototype.setItemCookie=function(e,t,r){var o=e+"="+t+";path=/;";r&&(o+="expires="+this.getCookieExpirationTime(r)+";"),document.cookie=o},a.prototype.getItemCookie=function(e){for(var t=e+"=",r=document.cookie.split(";"),o=0;o<r.length;o++){for(var n=r[o];" "===n.charAt(0);)n=n.substring(1);if(0===n.indexOf(t))return n.substring(t.length,n.length)}return""},a.prototype.clearItemCookie=function(e){this.setItemCookie(e,"",-1)},a.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+24*e*60*60*1e3).toUTCString()},a);function a(e){if(!window)throw n.AuthError.createNoWindowObjectError("Browser storage class could not find window object");if(void 0===window[e]||null==window[e])throw o.ClientConfigurationError.createStorageNotSupportedError(e);this.cacheLocation=e}t.BrowserStorage=i},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=(i.setResponseIdToken=function(e,t){if(!e)return null;if(!t)return e;var r=Number(t.expiration);return r&&!e.expiresOn&&(e.expiresOn=new Date(1e3*r)),o.__assign({},e,{idToken:t,idTokenClaims:t.claims,uniqueId:t.objectId||t.subject,tenantId:t.tenantId})},i);function i(){}t.ResponseUtils=n},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=o.__importDefault(r(40)),i=r(1),a=o.__importDefault(r(28)),s=o.__importDefault(r(41)),c=(u.getTelemetrymanagerStub=function(e,t){return new this({platform:{applicationName:"UnSetStub",applicationVersion:"0.0"},clientId:e},function(){},t)},u.prototype.startEvent=function(e){this.logger.verbose("Telemetry Event started: "+e.key),this.telemetryEmitter&&(e.start(),this.inProgressEvents[e.key]=e)},u.prototype.stopEvent=function(e){if(this.logger.verbose("Telemetry Event stopped: "+e.key),this.telemetryEmitter&&this.inProgressEvents[e.key]){e.stop(),this.incrementEventCount(e);var t=this.completedEvents[e.telemetryCorrelationId];this.completedEvents[e.telemetryCorrelationId]=(t||[]).concat([e]),delete this.inProgressEvents[e.key]}},u.prototype.flush=function(e){var t=this;if(this.logger.verbose("Flushing telemetry events: "+e),this.telemetryEmitter&&this.completedEvents[e]){var r=this.getOrphanedEvents(e);r.forEach(function(e){return t.incrementEventCount(e)});var o=this.completedEvents[e].concat(r);delete this.completedEvents[e];var i=this.eventCountByCorrelationId[e];if(delete this.eventCountByCorrelationId[e],o&&o.length){var a=new n.default(this.telemetryPlatform,e,this.clientId,i),s=o.concat([a]);this.telemetryEmitter(s.map(function(e){return e.get()}))}}},u.prototype.createAndStartApiEvent=function(e,t){var r=new a.default(e,this.logger.isPiiLoggingEnabled(),t);return this.startEvent(r),r},u.prototype.stopAndFlushApiEvent=function(e,t,r,o){t.wasSuccessful=r,o&&(t.apiErrorCode=o),this.stopEvent(t),this.flush(e)},u.prototype.createAndStartHttpEvent=function(e,t,r,o){var n=new s.default(e,o);return n.url=r,n.httpMethod=t,this.startEvent(n),n},u.prototype.incrementEventCount=function(e){var t,r=e.eventName,o=this.eventCountByCorrelationId[e.telemetryCorrelationId];o?o[r]=o[r]?o[r]+1:1:this.eventCountByCorrelationId[e.telemetryCorrelationId]=((t={})[r]=1,t)},u.prototype.getOrphanedEvents=function(e){var t=this;return Object.keys(this.inProgressEvents).reduce(function(r,o){if(-1===o.indexOf(e))return r;var n=t.inProgressEvents[o];return delete t.inProgressEvents[o],r.concat([n])},[])},u);function u(e,t,r){this.completedEvents={},this.inProgressEvents={},this.eventCountByCorrelationId={},this.onlySendFailureTelemetry=!1,this.telemetryPlatform=o.__assign({sdk:i.Constants.libraryName,sdkVersion:i.libraryVersion(),networkInformation:{connectionSpeed:"undefined"!=typeof navigator&&navigator.connection&&navigator.connection.effectiveType}},e.platform),this.clientId=e.clientId,this.onlySendFailureTelemetry=e.onlySendFailureTelemetry,this.telemetryEmitter=t,this.logger=r}t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o,n=r(0),i=r(8),a=n.__importDefault(r(14)),s=r(10),c=(o=a.default,n.__extends(u,o),u.prototype.getEventCount=function(e,t){return t[e]?t[e]:0},u);function u(e,t,r,n){var a=o.call(this,s.prependEventNamePrefix("default_event"),t,"DefaultEvent")||this;return a.event[s.prependEventNamePrefix("client_id")]=r,a.event[s.prependEventNamePrefix("sdk_plaform")]=e.sdk,a.event[s.prependEventNamePrefix("sdk_version")]=e.sdkVersion,a.event[s.prependEventNamePrefix("application_name")]=e.applicationName,a.event[s.prependEventNamePrefix("application_version")]=e.applicationVersion,a.event[s.prependEventNamePrefix("effective_connection_speed")]=e.networkInformation&&e.networkInformation.connectionSpeed,a.event[""+i.TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey]=a.getEventCount(s.prependEventNamePrefix("ui_event"),n),a.event[""+i.TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey]=a.getEventCount(s.prependEventNamePrefix("http_event"),n),a.event[""+i.TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey]=a.getEventCount(s.prependEventNamePrefix("cache_event"),n),a}t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),n=o.__importDefault(r(14)),i=r(10),a=r(16);t.EVENT_KEYS={HTTP_PATH:i.prependEventNamePrefix("http_path"),USER_AGENT:i.prependEventNamePrefix("user_agent"),QUERY_PARAMETERS:i.prependEventNamePrefix("query_parameters"),API_VERSION:i.prependEventNamePrefix("api_version"),RESPONSE_CODE:i.prependEventNamePrefix("response_code"),O_AUTH_ERROR_CODE:i.prependEventNamePrefix("oauth_error_code"),HTTP_METHOD:i.prependEventNamePrefix("http_method"),REQUEST_ID_HEADER:i.prependEventNamePrefix("request_id_header"),SPE_INFO:i.prependEventNamePrefix("spe_info"),SERVER_ERROR_CODE:i.prependEventNamePrefix("server_error_code"),SERVER_SUB_ERROR_CODE:i.prependEventNamePrefix("server_sub_error_code"),URL:i.prependEventNamePrefix("url")};var s,c=(s=n.default,o.__extends(u,s),Object.defineProperty(u.prototype,"url",{set:function(e){var r=i.scrubTenantFromUri(e);this.event[t.EVENT_KEYS.URL]=r&&r.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"httpPath",{set:function(e){this.event[t.EVENT_KEYS.HTTP_PATH]=i.scrubTenantFromUri(e).toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"userAgent",{set:function(e){this.event[t.EVENT_KEYS.USER_AGENT]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"queryParams",{set:function(e){this.event[t.EVENT_KEYS.QUERY_PARAMETERS]=a.ServerRequestParameters.generateQueryParametersString(e)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"apiVersion",{set:function(e){this.event[t.EVENT_KEYS.API_VERSION]=e.toLowerCase()},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"httpResponseStatus",{set:function(e){this.event[t.EVENT_KEYS.RESPONSE_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"oAuthErrorCode",{set:function(e){this.event[t.EVENT_KEYS.O_AUTH_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"httpMethod",{set:function(e){this.event[t.EVENT_KEYS.HTTP_METHOD]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"requestIdHeader",{set:function(e){this.event[t.EVENT_KEYS.REQUEST_ID_HEADER]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"speInfo",{set:function(e){this.event[t.EVENT_KEYS.SPE_INFO]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"serverErrorCode",{set:function(e){this.event[t.EVENT_KEYS.SERVER_ERROR_CODE]=e},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"serverSubErrorCode",{set:function(e){this.event[t.EVENT_KEYS.SERVER_SUB_ERROR_CODE]=e},enumerable:!0,configurable:!0}),u);function u(e,t){return s.call(this,i.prependEventNamePrefix("http_event"),e,t)||this}t.default=c},function(e,t,r){Object.defineProperty(t,"__esModule",{value:!0});var o=r(5);t.validateClaimsRequest=function(e){if(e.claimsRequest)try{JSON.parse(e.claimsRequest)}catch(e){throw o.ClientConfigurationError.createClaimsRequestParsingError(e)}}}],e.c=r,e.d=function(t,r,o){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:o})},e.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(e.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var n in t)e.d(o,n,function(e){return t[e]}.bind(null,n));return o},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e.p="",e(e.s=29);function e(o){if(r[o])return r[o].exports;var n=r[o]={i:o,l:!1,exports:{}};return t[o].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var t,r}()},"./packages/Microsoft.Office.WebAuth.Implicit/scripts/Implicit.ts":function(e,t,r){"use strict";var o=this&&this.__assign||function(){return(o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var n,i,a=r("./packages/Microsoft.Office.WebAuth.Implicit/lib/msal.js"),s=r("./packages/Microsoft.Office.WebAuth.Implicit/lib/api.js");s.addNamespaceMapping("Office.Identity.WebAuth.Implicit","5c65bbc4edbf480d9637ace04d62bd98-12844893-8ab9-4dde-b850-5612cb12e0f2-7822");var c,u,l,h,d=!1;function p(e){e.isCallback(window.location.hash)?(u.log("Hash: "+window.location.hash,d),e.handleAuthenticationResponse(),u.log("Completed Hash Handling",d)):e.clearCache()}function g(e,t,r,o,n,a,u,l){var h=[{name:c.Telemetry.Duration,int64:n.ms},{name:c.Telemetry.Succeeded,bool:!u},{name:c.Telemetry.IdentityProvider,string:i.idp.toLowerCase()},{name:c.Telemetry.ApplicationId,string:r},{name:c.Telemetry.TokenScope,string:a&&!o?a.toString():"unknown"},{name:c.Telemetry.CorrelationId,string:t||"unknown"},{name:c.Telemetry.ErrorCodeForGetToken,string:u||"unknown"},{name:c.Telemetry.ErrorMessageForGetToken,string:l&&!o?l:"unknown"}];i.telemetryInstance||"undefined"!=typeof OTel||s.sendTelemetryEvent({name:c.Telemetry.GetTokenTelemetryName,dataFields:h}),e.Telemetry={timeToGetToken:n.ms,succeeded:!u,idp:i.idp.toLowerCase(),applicationId:r,tokenScope:a?a.toString():void 0,correlationId:t,errorCodeForGetToken:u||void 0,errorMessageForGetToken:l||void 0}}function f(e){var t=void 0;if(n.some(function(r){return!(!e||!r.applicationId||e.toUpperCase()!==r.applicationId.toUpperCase())&&(t=r.application,!0)}),!t){t=new a.UserAgentApplication({auth:{clientId:e,authority:i.authority,redirectUri:i.redirectUri?i.redirectUri.split("?")[0]:location.href.split("?")[0],navigateToLoginRequestUrl:!i.navigateToLoginRequestUrl||i.navigateToLoginRequestUrl},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loadFrameTimeout:i.timeout?i.timeout:6e3}});var r={applicationId:e,application:t};n.push(r)}return t}function y(e){return["HTTPS:","API:"].some(function(t){return e.toLocaleUpperCase().startsWith(t)})||m(e)?e+"/.default":e}function m(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)}function v(e,t,r,o,n,a,u){var l=[{name:c.Telemetry.Duration,int64:o.ms},{name:c.Telemetry.Succeeded,bool:!a},{name:c.Telemetry.IdentityProvider,string:i.idp.toLowerCase()},{name:c.Telemetry.ApplicationId,string:r},{name:c.Telemetry.TokenScope,string:n?n.toString():"unknown"},{name:c.Telemetry.CorrelationId,string:t||"unknown"},{name:c.Telemetry.ErrorCodeForCheckUpn,string:a||"unknown"},{name:c.Telemetry.ErrorMessageForCheckUpn,string:u||"unknown"}];i.telemetryInstance||"undefined"!=typeof OTel||s.sendTelemetryEvent({name:c.Telemetry.CheckUpnTelemetryName,dataFields:l}),e.Telemetry={timeToCheckUPN:o.ms,succeeded:!a,idp:i.idp.toLowerCase(),applicationId:r,tokenScope:n?n.toString():void 0,correlationId:t,errorCodeForCheckUPN:a,errorMessageForCheckUPN:u}}function E(e){return i&&i.upn?!(!e||!e.userName||e.userName.toLowerCase()!==i.upn.toLowerCase())||(u.log("Upn in config does not match cached user upn",d),!1):(u.log("Upn does not exist in the configuration, returning true",d),!0)}!function(e){var t=function(){function e(){}return e.Aad="aad",e.Msa="msa",e}();e.IdentityProvider=t;var r=function(){function e(){}return e.RequestAuthConfig="RequestAuthConfig",e.ResponseAuthConfig="ResponseAuthConfig",e.iFramePrefix="msalRenewFrame",e.iFrameIdTokenPrefix="msalIdTokenFrame",e}();e.PostMessageType=r;var o=function(){function e(){}return e.Prod="https://login.microsoftonline.com/",e.ProdLegacy="https://login.windows.net/",e.Ppe="https://login.windows-ppe.net/",e.AadSuffix="common",e.MsaSuffix="consumers",e}();e.Authority=o;var n=function(){function e(){}return e.OtelInstance="otel",e.LoadTelemetryName="Office.Identity.WebAuth.Implicit.Load",e.GetTokenTelemetryName="Office.Identity.WebAuth.Implicit.GetToken",e.CheckUpnTelemetryName="Office.Identity.WebAuth.Implicit.CheckUpn",e.Duration="Duration",e.Succeeded="Succeeded",e.IdentityProvider="IdentityProvider",e.ApplicationId="ApplicationId",e.TokenScope="TokenScope",e.CorrelationId="CorrelationId",e.loadedApplicationCount="LoadedApplicationCount",e.ErrorCodeForGetToken="ErrorCodeForGetToken",e.ErrorMessageForGetToken="ErrorMessageForGetToken",e.ErrorCodeForCheckUpn="ErrorCodeForCheckUpn",e.ErrorMessageForCheckUpn="ErrorMessageForCheckUpn",e}();e.Telemetry=n}(c||(c={})),function(e){function t(e){return!(null!=e&&void 0!==e&&!e)}e.log=function(e,r){return!!t(r)&&(console.log(e),!0)},e.warn=function(e,r){return!!t(r)&&(console.warn(e),!0)},e.error=function(e,r){return!!t(r)&&(console.error(e),!0)}}(u||(u={})),function(e){e.extractAccessToken=function(e){var t=function(e){if("undefined"===e||!e||0===e.length)return null;var t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);return!t||t.length<4?(u.warn("The returned access_token is not parseable."),null):{header:t[1],JWSPayload:t[2],JWSSig:t[3]}}(e);if(!t)return null;try{var r=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")}return decodeURIComponent(atob(t).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}(t.JWSPayload);return r?JSON.parse(r):(u.log("The returned access_token could not be base64 url safe decoded."),null)}catch(e){u.error("The returned access_token could not be decoded"+e)}return null}}(l||(l={})),function(e){e.timer=function(){var e=(new Date).getTime();return{get seconds(){return Math.ceil(((new Date).getTime()-e)/1e3)},get ms(){return(new Date).getTime()-e},get formattedSeconds(){return Math.ceil(this.seconds/1e3)+"s"},get formattedMs(){return this.ms+"ms"}}}}(h||(h={})),t.Load=function(e,t){var r=h.timer();(i=e).enableConsoleLogging&&(d=i.enableConsoleLogging),i.authority&&(i.authority=i.authority.replace(c.Authority.ProdLegacy,c.Authority.Prod)),n||window.addEventListener("message",function(e){if(e.origin&&e.origin==location.origin&&e.data&&e.data.iframe&&e.data.request&&e.data.request==c.PostMessageType.RequestAuthConfig){var t=c.PostMessageType.iFramePrefix+e.data.iframe;if(null===(r=document.getElementById(t.replace("+"," ")))){t=c.PostMessageType.iFrameIdTokenPrefix;var r=document.getElementById(t.replace("+"," "))}if(u.log("received from "+t,d),null===r)return void u.log("targetiFrame is null",d);var o=r.contentWindow;null!=o&&(u.log("returning to "+e.data.iframe,d),o.postMessage({request:c.PostMessageType.ResponseAuthConfig,config:i},location.origin))}},!1),i.idp.toLowerCase()===c.IdentityProvider.Msa.toLowerCase()?i.authority=c.Authority.Prod+c.Authority.MsaSuffix:(i.authority||(i.authority=c.Authority.Prod+c.Authority.AadSuffix),i.authority.indexOf(c.Authority.AadSuffix)<0&&("/"==i.authority.charAt(i.authority.length-1)?i.authority+=c.Authority.AadSuffix:i.authority+="/"+c.Authority.AadSuffix)),n=new Array;for(var o=0,l=i.appIds;o<l.length;o++){var g=l[o];if(g&&m(g)){var f=new a.UserAgentApplication({auth:{clientId:g,authority:i.authority,redirectUri:i.redirectUri?i.redirectUri.split("?")[0]:location.href.split("?")[0],navigateToLoginRequestUrl:!i.navigateToLoginRequestUrl||i.navigateToLoginRequestUrl},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loadFrameTimeout:i.timeout?i.timeout:6e3}}),y={applicationId:g,application:f};n.push(y),p(f)}}var v=[{name:c.Telemetry.Duration,int64:r.ms},{name:c.Telemetry.Succeeded,bool:!0},{name:c.Telemetry.IdentityProvider,string:i.idp.toLowerCase()},{name:c.Telemetry.CorrelationId,string:t||"unknown"},{name:c.Telemetry.loadedApplicationCount,int64:n.length}];return i.telemetryInstance||"undefined"!=typeof OTel||s.sendTelemetryEvent({name:c.Telemetry.LoadTelemetryName,dataFields:v}),{Telemetry:{timeToLoad:r.ms,succeeded:!0,idp:i.idp.toLowerCase(),correlationId:t||"",loadedApplicationCount:n.length}}},t.GetToken=function(e,t,r,n,a,s,v){void 0===s&&(s=!1);var C=h.timer(),T=f(t);r&&m(r)||(r=void 0);var I={};if(!e)return I.ErrorCode="missing_target",I.ErrorMessage="The provided target for Implicit.GetToken is null, blank or empty",g(I,r,t,s,C,void 0,I.ErrorCode,I.ErrorMessage),Promise.reject(I);var b=[y(e)];if(!t||!m(t))return I.ErrorCode="invalid_application_ID",I.ErrorMessage="The provided application ID for Implicit.GetToken is null, blank, empty or with invalid format",g(I,r,t,s,C,b,I.ErrorCode,I.ErrorMessage),Promise.reject(I);var S=i.idp.toLowerCase()===c.IdentityProvider.Msa.toLowerCase(),_=function(){return new Promise(function(e,n){u.log("Config: "+JSON.stringify(T),d),u.log("application calls acquireTokenSilent",d);var c=o({scopes:b,loginHint:i.upn,correlationId:r},v&&{claimsRequest:v});(a?T.acquireTokenPopup(c):T.acquireTokenSilent(c)).then(function(o){var a=o.accessToken;return a&&E(o.account)&&(s||S||function(e){if(!i||!i.upn)return u.log("Upn does not exist in the configuration, returning true",d),!0;var t=l.extractAccessToken(e);return!!(!t||t&&t.upn&&t.upn.toLowerCase()===i.upn.toLowerCase())||(u.log("provided Upn does not match Upn extracted from token",d),!1)}(a))?(u.log("acquireToken->token: "+a,d),I.Token=a,g(I,r,t,s,C,b),e(I)):(I.ErrorCode="upn_mismatch",I.ErrorMessage="upn doesn't match with given upn in config",g(I,r,t,s,C,b,I.ErrorCode,I.ErrorMessage),u.log("acquireToken->error: "+I.ErrorMessage,d),T.clearCache(),n(I))}).catch(function(e){return I.ErrorCode=e.errorCode,I.ErrorMessage=e.errorMessage,g(I,r,t,s,C,b,e.errorCode,e.errorMessage),u.log("acquireToken->error: "+I.ErrorMessage,d),T.clearCache(),n(I)})})};return n?(u.log("Logging in",d),T.authResponseCallback=function(){p(T)},T.loginPopup({scopes:b,loginHint:i.upn,correlationId:r}).catch(function(e){return T.clearCache(),Promise.reject(e)})).catch(function(e){return u.log("loginPopup->error: "+e.errorMessage,d),I.ErrorCode=e.errorCode,I.ErrorMessage=e.errorMessage,g(I,r,t,s,C,b,e.errorCode,e.errorMessage),Promise.reject(I)}).then(_):_()},t.CheckUpnMatchIdToken=function(e,t){var r=h.timer();t&&m(t)||(t=void 0);var o={};if(!e||!m(e))return o.ErrorCode="invalid_application_ID",o.ErrorMessage="The provided application ID for Implicit.CheckUpnMatchIdToken is null, blank, empty or with invalid format",v(o,t,e,r,void 0,o.ErrorCode,o.ErrorMessage),Promise.reject(o);var n=f(e),a=[n.config.auth.clientId];return new Promise(function(s,c){u.log("Config: "+JSON.stringify(n),d),u.log("application calls acquireTokenSilent",d),n.acquireTokenSilent({scopes:a,loginHint:i.upn,correlationId:t}).then(function(n){if(o.IsUpnMatch=E(n.account),o.IsUpnMatch)return v(o,t,e,r,a),s(o)}).catch(function(n){return o.ErrorCode=n.errorCode,o.ErrorMessage=n.errorMessage,u.log("acquireToken->error: "+o.ErrorMessage,d),o.IsUpnMatch=!1,v(o,t,e,r,a,n.errorCode,n.errorMessage),c(o)})})},t.GetAuthConfig=function(){return new Promise(function(e,t){new Promise(function(e,t){if(window.location.hash){var r=window.location.hash;r.indexOf("#/")>-1?r=r.substring(r.indexOf("#/")+2):r.indexOf("#")>-1&&(r=r.substring(1));for(var o=r.split("&"),n=0;n<o.length;n++){var i=o[n].split("=");if("state"==decodeURIComponent(i[0])){var a=decodeURIComponent(i[i.length-1]).split("|");2==a.length&&e(a[1])}}}t()}).then(function(t){window.addEventListener("message",function(t){t.origin&&t.origin==location.origin&&t.data&&t.data.config&&t.data.request&&t.data.request==c.PostMessageType.ResponseAuthConfig&&e(t.data.config)},!1),parent.postMessage({request:c.PostMessageType.RequestAuthConfig,iframe:t},location.origin)},function(){t({})})})},t.Logout=function(){n.forEach(function(e){u.log("application calls logOut",d),e.application.logOut()}),n=new Array}},0:function(e,t,r){r("./packages/Microsoft.Office.WebAuth.Implicit/lib/msal.min.js"),r("./packages/Microsoft.Office.WebAuth.Implicit/lib/api.js"),e.exports=r("./packages/Microsoft.Office.WebAuth.Implicit/scripts/Implicit.ts")}})});