CINXE.COM

Microsoft Azure

<!DOCTYPE html><html><head><meta charset='utf-8'/><title>Microsoft Azure</title></head><body><script>"use strict";var FxImpl,__extends,__assign,__rest,__decorate,__param,__esDecorate,__runInitializers,__propKey,__setFunctionName,__metadata,__awaiter,__generator,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__createBinding,__addDisposableResource,__disposeResources,MsPortalImpl;!function(e){let t,r;try{t=window.localStorage,r=window.sessionStorage}catch(e){}e.localStorage=t,e.sessionStorage=r}(MsPortalImpl||(MsPortalImpl={})),function(e){e.getOrSetBootParameters=function(e,t){if(1===arguments.length)return e.sessionStorage.getItem("Redirect_BootParameters")||e.localStorage.getItem("Redirect_BootParameters");e.sessionStorage.setItem("Redirect_BootParameters",t),e.localStorage.setItem("Redirect_BootParameters",t)}}(MsPortalImpl||(MsPortalImpl={})),function(e){e.getTenantFromPath=function(e,t){const r=e.split("/").filter((e=>e));let n="";if(1===r.length?n=r[0]:e.startsWith("/auth/login")&&3===r.length&&(n=r[2]),n){const e=n.replace(/^@*/,""),r=/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/i;if(/^@?(?:(?:[a-z0-9]|[a-z0-9][a-z0-9-]{0,61}[a-z0-9])\.)+[a-z0-9]+|common$/i.test(e)||r.test(e))return t?"@"+e:e}return""}}(MsPortalImpl||(MsPortalImpl={})),function(e){var t=new Uint8Array(20),r=new Array(20);function n(e,r,n){var o=t[e]&r;t[e]=o|n}var o=window.crypto||window.msCrypto,i="0123456789abcdef".split(""),a=new Array(256),s=0;function c(){var e=function(e){for(var t,r=new Array(e);e;){t=4294967296*Math.random()|0;for(var n=8;n--;){if(r[--e]=i[15&t],e<0)return r;t>>>=4}}}(36);return e[8]=e[13]=e[18]=e[23]="-",e[14]="4",e[19]=i[8+(3&i.indexOf(e[19]))],e.join("")}i.forEach((function(e){i.forEach((function(t){a[s++]=e+t}))})),e.createGuid=function(e,i){void 0===i&&(i=!1);var s=o?function(){o.getRandomValues(t),n(8,15,64),n(11,63,128);for(var e=0;e<20;e++)r[e]=a[t[e]];return r[4]=r[7]=r[10]=r[13]="-",r.join("")}():c();return s=i?s.split("-").join("").substring(0,32):s.substring(0,36),(e?"".concat(e,"_"):"")+s}}(FxImpl||(FxImpl={})),function(e){e.supportedLanguagesNeutralLocales={de:"de-de",en:"en-us",es:"es-es",fr:"fr-fr",it:"it-it",id:"id-id",hu:"hu-hu",nl:"nl-nl",pl:"pl-pl","pt-br":"pt-br","pt-pt":"pt-pt",sv:"sv-se",tr:"tr-tr",cs:"cs-cz",ru:"ru-ru","zh-hans":"zh-cn","zh-hant":"zh-hk",ja:"ja-jp",ko:"ko-kr"};const t={"zh-hk":"zh-hant","zh-tw":"zh-hant","zh-cht":"zh-hant","zh-mo":"zh-hant",zh:"zh-hans",pt:"pt-br"};function r(e){const t=[];for(let r=(e=e||"").length;r>0;r=e.lastIndexOf("-",r-1))t.push(e.substring(0,r));return t}e.sanitizeLanguage=function(t,r){const n=(t||"").toLowerCase().split(".");if(r.includes(n[0])||(n[0]=r[0]),n.length<2){const t=e.supportedLanguagesNeutralLocales[n[0]];t&&(n[1]=t)}return n.join(".")},e.getBrowserLanguage=function(n){const o=(n||navigator.languages||[]).map((e=>e?.toLowerCase?.()));for(const n of o){const o=r(n);for(const r of o){const o=t[r]||r;if(o in e.supportedLanguagesNeutralLocales){const t=o;return`${t}.${n.split("-").length>1?n:e.supportedLanguagesNeutralLocales[t]}`}}}}}(MsPortalImpl||(MsPortalImpl={})),function(e){let t=window;function r(e){return e&&e.replace(/^\?/,"")}function n(e){return e&&r(e).split("&").map((e=>e.split("=")))||[]}function o(e,t){const r=e.map((e=>e[0]&&e.join("=")));return t&&r.sort(),r.join("&")}function i(e,t,r){if(t=t.toUpperCase(),e)for(let n=0;n<e.length;n++)if(e[n][0].toUpperCase()===t)return r?e.splice(n,1)[0][1]:e[n][1]}function a(){return JSON.parse(e.getOrSetBootParameters(e)||"{}")}function s(e){return i(n(a().userQuery),e)}function c(e){if(!e||e.startsWith("/"))return c(`${t.location.protocol}//${t.location.host}`);const r=/^(\w+:\/\/)([^:/?]+)([^/?]+)?/.exec(e),n=r[3]||("https://"===r[1]?":443":":80");return r[2]+n}function u(t,a,u,l){u=u||"",l=l||{};let d="";if(t&&c()===c(t))d=function(t,r,a){const c=n(t),u=e=>{Object.keys(e).forEach((t=>{t&&e[t]&&"string"!=typeof i(c,t)&&c.push([t,e[t]])}))};if(u(JSON.parse(e.localStorage.getItem("Redirect_LocaleQuery")||"{}")),u({l:e.localStorage.getItem("Redirect_LastUsedLocale")}),r.env){const t={},n=(n,o,i)=>{o=o||["true","false"];const a=n+(i||"");let c=s(n)||r[n];c||(c=e.localStorage.getItem(a)+"",o.includes(c)||(c=o[Math.floor(Math.random()*o.length)],e.localStorage.setItem(a,c))),t[n]=c},o=new Array(100);o.fill("DefaultPartitioner",0,100),n("bundlingKind",o,"12"),u(t)}u(r),["signIn","clearedStorage"].forEach((e=>{i(c,e,!0)}));const l=i(c,"l",!0)||e.getBrowserLanguage();return u({l:e.sanitizeLanguage(l,a)}),o(c,!0)}(u,l,a);else{const e=l.loginHint;e&&(u+=u?"&":"",u+=`loginHint=${e}`),d=r(u)}return d&&(t+=t.includes("?")?"&":"?",t+=d),t}e.parseQuery=n,e.extractValueFromQueryString=function(e,t){return i(e,t,!1)},e.getFirstQueryValue=i,e.getBootParameters=a,e.trySaveAllowedState=function(r,n,s,c){if(!e.getOrSetBootParameters(e)||s){["selectAccount","loginHint","signInParameters","forcesignin","nonceErrorSeen","signIn","slice","mfalogin"].forEach((e=>{i(n,e,!0)}));const s=/#.*|$/.exec(t.location.href)[0];let u;s.startsWith("#code=")?(u=a(),u.msalHash=s):u={environment:r,userQuery:o(n),portalQuery:c,hash:s,msalHash:void 0},e.getOrSetBootParameters(e,JSON.stringify(u))}},e.savePageTelemetry=function(r){const n=t.performance&&t.performance.timing;if(n){const t={id:r,fetchStart:n.fetchStart,requestStart:n.requestStart,responseStart:n.responseStart,responseEnd:n.responseEnd,domComplete:n.domComplete};e.sessionStorage.setItem(`PageTelemetry_${r}`,JSON.stringify(t))}},e.getUserQueryValue=s,e.getPortalUri=function(e,t,r){r=r||{};const n=a(),o=n.hash||"";return u(e,t,r.userQuery||n.userQuery,r.portalQuery||n.portalQuery)+o},e.getPortalEnv=function(){return location.hostname.split(".")[0].toLowerCase()}}(MsPortalImpl||(MsPortalImpl={})),function(e){var t="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};function r(e,r){return e!==t&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(t,n){return e[t]=r?r(t,n):n}}"function"==typeof define&&define.amd?( define("tslib",["exports"],(function(n){e(r(t,r(n)))})),require(["tslib"])):"object"==typeof module&&"object"==typeof module.exports?e(r(t,r(module.exports))):e(r(t))}((function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};__extends=function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){Object.defineProperty(this,"constructor",{configurable:!0,value:e,writable:!0})}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)},__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},__rest=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r},__decorate=function(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},__param=function(e,t){return function(r,n){t(r,n,e)}},__esDecorate=function(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,c=n.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?n.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),h=!1,p=r.length-1;p>=0;p--){var g={};for(var f in n)g[f]="access"===f?{}:n[f];for(var f in n.access)g.access[f]=n.access[f];g.addInitializer=function(e){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,r[p])("accessor"===c?{get:d.get,set:d.set}:d[u],g);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(d.get=s),(s=a(m.set))&&(d.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===c?o.unshift(s):d[u]=s)}l&&Object.defineProperty(l,n.name,d),h=!0},__runInitializers=function(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0},__propKey=function(e){return"symbol"==typeof e?e:"".concat(e)},__setFunctionName=function(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})},__metadata=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},__awaiter=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},__generator=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},__exportStar=function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||__createBinding(t,e,r)},__createBinding=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},__values=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},__read=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},__spread=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e},__spreadArrays=function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n},__spreadArray=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},__await=function(e){return this instanceof __await?(this.v=e,this):new __await(e)},__asyncGenerator=function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return",(function(e){return function(t){return Promise.resolve(t).then(e,u)}})),n[Symbol.asyncIterator]=function(){return this},n;function a(e,t){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||s(e,t)}))},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=o[e](t)).value instanceof __await?Promise.resolve(r.value.v).then(c,u):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function c(e){s("next",e)}function u(e){s("throw",e)}function l(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}},__asyncDelegator=function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:__await(e[n](t)),done:!1}:o?o(t):t}:o}},__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="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}},__makeTemplateObject=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};var r=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};__importStar=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return r(t,e),t},__importDefault=function(e){return e&&e.__esModule?e:{default:e}},__classPrivateFieldGet=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},__classPrivateFieldSet=function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r},__classPrivateFieldIn=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)},__addDisposableResource=function(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t};var n="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};__disposeResources=function(e){function t(t){e.error=e.hasError?new n(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()},e("__extends",__extends),e("__assign",__assign),e("__rest",__rest),e("__decorate",__decorate),e("__param",__param),e("__esDecorate",__esDecorate),e("__runInitializers",__runInitializers),e("__propKey",__propKey),e("__setFunctionName",__setFunctionName),e("__metadata",__metadata),e("__awaiter",__awaiter),e("__generator",__generator),e("__exportStar",__exportStar),e("__createBinding",__createBinding),e("__values",__values),e("__read",__read),e("__spread",__spread),e("__spreadArrays",__spreadArrays),e("__spreadArray",__spreadArray),e("__await",__await),e("__asyncGenerator",__asyncGenerator),e("__asyncDelegator",__asyncDelegator),e("__asyncValues",__asyncValues),e("__makeTemplateObject",__makeTemplateObject),e("__importStar",__importStar),e("__importDefault",__importDefault),e("__classPrivateFieldGet",__classPrivateFieldGet),e("__classPrivateFieldSet",__classPrivateFieldSet),e("__classPrivateFieldIn",__classPrivateFieldIn),e("__addDisposableResource",__addDisposableResource),e("__disposeResources",__disposeResources)})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msalv2={})}(this,(function(e){ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},t(e,r)};function r(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function o(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function i(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function s(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e} /*! @azure/msal-browser v2.37.0 2023-05-02 */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var c=function(e,t){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},c(e,t)};function u(e,t){function r(){this.constructor=e}c(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var l=function(){return l=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},l.apply(this,arguments)};function d(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function h(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function p(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function f(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e} /*! @azure/msal-common v13.0.0 2023-05-02 */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var m=function(e,t){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},m(e,t)};function v(e,t){function r(){this.constructor=e}m(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var y=function(){return y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},y.apply(this,arguments)};function C(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))}function T(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function I(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n} /*! @azure/msal-common v13.0.0 2023-05-02 */var w,E,k,S,b,A={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",REGIONAL_AUTH_NON_MSI_QUERY_STRING:"allowestsrnonmsi=true",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},_=[A.OPENID_SCOPE,A.PROFILE_SCOPE,A.OFFLINE_ACCESS_SCOPE],R=I(_,[A.EMAIL_SCOPE]);!function(e){e.CONTENT_TYPE="Content-Type",e.RETRY_AFTER="Retry-After",e.CCS_HEADER="X-AnchorMailbox",e.WWWAuthenticate="WWW-Authenticate",e.AuthenticationInfo="Authentication-Info",e.X_MS_REQUEST_ID="x-ms-request-id",e.X_MS_HTTP_VERSION="x-ms-httpver"}(w||(w={})),function(e){e.ID_TOKEN="idtoken",e.CLIENT_INFO="client.info",e.ADAL_ID_TOKEN="adal.idtoken",e.ERROR="error",e.ERROR_DESC="error.description",e.ACTIVE_ACCOUNT="active-account",e.ACTIVE_ACCOUNT_FILTERS="active-account-filters"}(E||(E={})),function(e){e.COMMON="common",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers"}(k||(k={})),function(e){e.CLIENT_ID="client_id",e.REDIRECT_URI="redirect_uri",e.RESPONSE_TYPE="response_type",e.RESPONSE_MODE="response_mode",e.GRANT_TYPE="grant_type",e.CLAIMS="claims",e.SCOPE="scope",e.ERROR="error",e.ERROR_DESCRIPTION="error_description",e.ACCESS_TOKEN="access_token",e.ID_TOKEN="id_token",e.REFRESH_TOKEN="refresh_token",e.EXPIRES_IN="expires_in",e.STATE="state",e.NONCE="nonce",e.PROMPT="prompt",e.SESSION_STATE="session_state",e.CLIENT_INFO="client_info",e.CODE="code",e.CODE_CHALLENGE="code_challenge",e.CODE_CHALLENGE_METHOD="code_challenge_method",e.CODE_VERIFIER="code_verifier",e.CLIENT_REQUEST_ID="client-request-id",e.X_CLIENT_SKU="x-client-SKU",e.X_CLIENT_VER="x-client-VER",e.X_CLIENT_OS="x-client-OS",e.X_CLIENT_CPU="x-client-CPU",e.X_CLIENT_CURR_TELEM="x-client-current-telemetry",e.X_CLIENT_LAST_TELEM="x-client-last-telemetry",e.X_MS_LIB_CAPABILITY="x-ms-lib-capability",e.X_APP_NAME="x-app-name",e.X_APP_VER="x-app-ver",e.POST_LOGOUT_URI="post_logout_redirect_uri",e.ID_TOKEN_HINT="id_token_hint",e.DEVICE_CODE="device_code",e.CLIENT_SECRET="client_secret",e.CLIENT_ASSERTION="client_assertion",e.CLIENT_ASSERTION_TYPE="client_assertion_type",e.TOKEN_TYPE="token_type",e.REQ_CNF="req_cnf",e.OBO_ASSERTION="assertion",e.REQUESTED_TOKEN_USE="requested_token_use",e.ON_BEHALF_OF="on_behalf_of",e.FOCI="foci",e.CCS_HEADER="X-AnchorMailbox",e.RETURN_SPA_CODE="return_spa_code",e.NATIVE_BROKER="nativebroker",e.LOGOUT_HINT="logout_hint"}(S||(S={})),function(e){e.ACCESS_TOKEN="access_token",e.XMS_CC="xms_cc"}(b||(b={}));var P,M={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"};!function(e){e.ACCOUNT="account",e.SID="sid",e.LOGIN_HINT="login_hint",e.ID_TOKEN="id_token",e.DOMAIN_HINT="domain_hint",e.ORGANIZATIONS="organizations",e.CONSUMERS="consumers",e.ACCOUNT_ID="accountIdentifier",e.HOMEACCOUNT_ID="homeAccountIdentifier"}(P||(P={}));var N,O,q,U,x,L,B={PLAIN:"plain",S256:"S256"};!function(e){e.QUERY="query",e.FRAGMENT="fragment",e.FORM_POST="form_post"}(N||(N={})),function(e){e.IMPLICIT_GRANT="implicit",e.AUTHORIZATION_CODE_GRANT="authorization_code",e.CLIENT_CREDENTIALS_GRANT="client_credentials",e.RESOURCE_OWNER_PASSWORD_GRANT="password",e.REFRESH_TOKEN_GRANT="refresh_token",e.DEVICE_CODE_GRANT="device_code",e.JWT_BEARER="urn:ietf:params:oauth:grant-type:jwt-bearer"}(O||(O={})),function(e){e.MSSTS_ACCOUNT_TYPE="MSSTS",e.ADFS_ACCOUNT_TYPE="ADFS",e.MSAV1_ACCOUNT_TYPE="MSA",e.GENERIC_ACCOUNT_TYPE="Generic"}(q||(q={})),function(e){e.CACHE_KEY_SEPARATOR="-",e.CLIENT_INFO_SEPARATOR="."}(U||(U={})),function(e){e.ID_TOKEN="IdToken",e.ACCESS_TOKEN="AccessToken",e.ACCESS_TOKEN_WITH_AUTH_SCHEME="AccessToken_With_AuthScheme",e.REFRESH_TOKEN="RefreshToken"}(x||(x={})),function(e){e[e.ADFS=1001]="ADFS",e[e.MSA=1002]="MSA",e[e.MSSTS=1003]="MSSTS",e[e.GENERIC=1004]="GENERIC",e[e.ACCESS_TOKEN=2001]="ACCESS_TOKEN",e[e.REFRESH_TOKEN=2002]="REFRESH_TOKEN",e[e.ID_TOKEN=2003]="ID_TOKEN",e[e.APP_METADATA=3001]="APP_METADATA",e[e.UNDEFINED=9999]="UNDEFINED"}(L||(L={}));var H,D="appmetadata",F="1",K="authority-metadata",z=86400;!function(e){e.CONFIG="config",e.CACHE="cache",e.NETWORK="network",e.HARDCODED_VALUES="hardcoded_values"}(H||(H={}));var G,Q={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"};e.AuthenticationScheme=void 0,(G=e.AuthenticationScheme||(e.AuthenticationScheme={})).BEARER="Bearer",G.POP="pop",G.SSH="ssh-cert";var j,W,V,Y,$,J,X=60,Z=3600,ee="throttling",te="retry-after, h429",re="invalid_grant",ne="client_mismatch";!function(e){e.username="username",e.password="password"}(j||(j={})),function(e){e[e.httpSuccess=200]="httpSuccess",e[e.httpBadRequest=400]="httpBadRequest"}(W||(W={})),function(e){e.FAILED_AUTO_DETECTION="1",e.INTERNAL_CACHE="2",e.ENVIRONMENT_VARIABLE="3",e.IMDS="4"}(V||(V={})),function(e){e.CONFIGURED_MATCHES_DETECTED="1",e.CONFIGURED_NO_AUTO_DETECTION="2",e.CONFIGURED_NOT_DETECTED="3",e.AUTO_DETECTION_REQUESTED_SUCCESSFUL="4",e.AUTO_DETECTION_REQUESTED_FAILED="5"}(Y||(Y={})),function(e){e.NO_CACHE_HIT="0",e.FORCE_REFRESH="1",e.NO_CACHED_ACCESS_TOKEN="2",e.CACHED_ACCESS_TOKEN_EXPIRED="3",e.REFRESH_CACHED_ACCESS_TOKEN="4"}($||($={})),function(e){e.Jwt="JWT",e.Jwk="JWK",e.Pop="pop"}(J||(J={})); /*! @azure/msal-common v13.0.0 2023-05-02 */ var oe,ie={unexpectedError:{code:"unexpected_error",desc:"Unexpected error in authentication."},postRequestFailed:{code:"post_request_failed",desc:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."}},ae=function(e){function t(r,n,o){var i=this,a=n?r+": "+n:r;return i=e.call(this,a)||this,Object.setPrototypeOf(i,t.prototype),i.errorCode=r||A.EMPTY_STRING,i.errorMessage=n||A.EMPTY_STRING,i.subError=o||A.EMPTY_STRING,i.name="AuthError",i}return v(t,e),t.prototype.setCorrelationId=function(e){this.correlationId=e},t.createUnexpectedError=function(e){return new t(ie.unexpectedError.code,ie.unexpectedError.desc+": "+e)},t.createPostRequestFailed=function(e){return new t(ie.postRequestFailed.code,ie.postRequestFailed.desc+": "+e)},t}(Error),se={createNewGuid:function(){throw ae.createUnexpectedError("Crypto interface - createNewGuid() has not been implemented")},base64Decode:function(){throw ae.createUnexpectedError("Crypto interface - base64Decode() has not been implemented")},base64Encode:function(){throw ae.createUnexpectedError("Crypto interface - base64Encode() has not been implemented")},generatePkceCodes:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - generatePkceCodes() has not been implemented",ae.createUnexpectedError("Crypto interface - generatePkceCodes() has not been implemented")}))}))},getPublicKeyThumbprint:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - getPublicKeyThumbprint() has not been implemented",ae.createUnexpectedError("Crypto interface - getPublicKeyThumbprint() has not been implemented")}))}))},removeTokenBindingKey:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - removeTokenBindingKey() has not been implemented",ae.createUnexpectedError("Crypto interface - removeTokenBindingKey() has not been implemented")}))}))},clearKeystore:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - clearKeystore() has not been implemented",ae.createUnexpectedError("Crypto interface - clearKeystore() has not been implemented")}))}))},signJwt:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - signJwt() has not been implemented",ae.createUnexpectedError("Crypto interface - signJwt() has not been implemented")}))}))},hashString:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Crypto interface - hashString() has not been implemented",ae.createUnexpectedError("Crypto interface - hashString() has not been implemented")}))}))}},ce={clientInfoDecodingError:{code:"client_info_decoding_error",desc:"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause."},clientInfoEmptyError:{code:"client_info_empty_error",desc:"The client info was empty. Please review the trace to determine the root cause."},tokenParsingError:{code:"token_parsing_error",desc:"Token cannot be parsed. Please review stack trace to determine root cause."},nullOrEmptyToken:{code:"null_or_empty_token",desc:"The token is null or empty. Please review the trace to determine the root cause."},endpointResolutionError:{code:"endpoints_resolution_error",desc:"Error: could not resolve endpoints. Please check network and try again."},networkError:{code:"network_error",desc:"Network request failed. Please check network trace to determine root cause."},unableToGetOpenidConfigError:{code:"openid_config_error",desc:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints."},hashNotDeserialized:{code:"hash_not_deserialized",desc:"The hash parameters could not be deserialized. Please review the trace to determine the root cause."},blankGuidGenerated:{code:"blank_guid_generated",desc:"The guid generated was blank. Please review the trace to determine the root cause."},invalidStateError:{code:"invalid_state",desc:"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState()."},stateMismatchError:{code:"state_mismatch",desc:"State mismatch error. Please check your network. Continued requests may cause cache overflow."},stateNotFoundError:{code:"state_not_found",desc:"State not found"},nonceMismatchError:{code:"nonce_mismatch",desc:"Nonce mismatch error. This may be caused by a race condition in concurrent requests."},nonceNotFoundError:{code:"nonce_not_found",desc:"nonce not found"},authTimeNotFoundError:{code:"auth_time_not_found",desc:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information."},maxAgeTranspiredError:{code:"max_age_transpired",desc:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication."},noTokensFoundError:{code:"no_tokens_found",desc:"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken()."},multipleMatchingTokens:{code:"multiple_matching_tokens",desc:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account."},multipleMatchingAccounts:{code:"multiple_matching_accounts",desc:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account"},multipleMatchingAppMetadata:{code:"multiple_matching_appMetadata",desc:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata"},tokenRequestCannotBeMade:{code:"request_cannot_be_made",desc:"Token request cannot be made without authorization code or refresh token."},appendEmptyScopeError:{code:"cannot_append_empty_scope",desc:"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info."},removeEmptyScopeError:{code:"cannot_remove_empty_scope",desc:"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info."},appendScopeSetError:{code:"cannot_append_scopeset",desc:"Cannot append ScopeSet due to error."},emptyInputScopeSetError:{code:"empty_input_scopeset",desc:"Empty input ScopeSet cannot be processed."},DeviceCodePollingCancelled:{code:"device_code_polling_cancelled",desc:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true."},DeviceCodeExpired:{code:"device_code_expired",desc:"Device code is expired."},DeviceCodeUnknownError:{code:"device_code_unknown_error",desc:"Device code stopped polling for unknown reasons."},NoAccountInSilentRequest:{code:"no_account_in_silent_request",desc:"Please pass an account object, silent flow is not supported without account information"},invalidCacheRecord:{code:"invalid_cache_record",desc:"Cache record object was null or undefined."},invalidCacheEnvironment:{code:"invalid_cache_environment",desc:"Invalid environment when attempting to create cache entry"},noAccountFound:{code:"no_account_found",desc:"No account found in cache for given key."},CachePluginError:{code:"no cache plugin set on CacheManager",desc:"ICachePlugin needs to be set before using readFromStorage or writeFromStorage"},noCryptoObj:{code:"no_crypto_object",desc:"No crypto object detected. This is required for the following operation: "},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},unexpectedAccountType:{code:"unexpected_account_type",desc:"Unexpected account type."},unexpectedCredentialType:{code:"unexpected_credential_type",desc:"Unexpected credential type."},invalidAssertion:{code:"invalid_assertion",desc:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515"},invalidClientCredential:{code:"invalid_client_credential",desc:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential"},tokenRefreshRequired:{code:"token_refresh_required",desc:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired."},userTimeoutReached:{code:"user_timeout_reached",desc:"User defined timeout for device code polling reached"},tokenClaimsRequired:{code:"token_claims_cnf_required_for_signedjwt",desc:"Cannot generate a POP jwt if the token_claims are not populated"},noAuthorizationCodeFromServer:{code:"authorization_code_missing_from_server_response",desc:"Server response does not contain an authorization code to proceed"},noAzureRegionDetected:{code:"no_azure_region_detected",desc:"No azure region was detected and no fallback was made available"},accessTokenEntityNullError:{code:"access_token_entity_null",desc:"Access token entity is null, please check logs and cache to ensure a valid access token is present."},bindingKeyNotRemovedError:{code:"binding_key_not_removed",desc:"Could not remove the credential's binding key from storage."},logoutNotSupported:{code:"end_session_endpoint_not_supported",desc:"Provided authority does not support logout."},keyIdMissing:{code:"key_id_missing",desc:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key."},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},userCanceledError:{code:"user_canceled",desc:"User canceled the flow."}},ue=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientAuthError",Object.setPrototypeOf(o,t.prototype),o}return v(t,e),t.createClientInfoDecodingError=function(e){return new t(ce.clientInfoDecodingError.code,ce.clientInfoDecodingError.desc+" Failed with error: "+e)},t.createClientInfoEmptyError=function(){return new t(ce.clientInfoEmptyError.code,""+ce.clientInfoEmptyError.desc)},t.createTokenParsingError=function(e){return new t(ce.tokenParsingError.code,ce.tokenParsingError.desc+" Failed with error: "+e)},t.createTokenNullOrEmptyError=function(e){return new t(ce.nullOrEmptyToken.code,ce.nullOrEmptyToken.desc+" Raw Token Value: "+e)},t.createEndpointDiscoveryIncompleteError=function(e){return new t(ce.endpointResolutionError.code,ce.endpointResolutionError.desc+" Detail: "+e)},t.createNetworkError=function(e,r){return new t(ce.networkError.code,ce.networkError.desc+" | Fetch client threw: "+r+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToGetOpenidConfigError=function(e){return new t(ce.unableToGetOpenidConfigError.code,ce.unableToGetOpenidConfigError.desc+" Attempted to retrieve endpoints from: "+e)},t.createHashNotDeserializedError=function(e){return new t(ce.hashNotDeserialized.code,ce.hashNotDeserialized.desc+" Given Object: "+e)},t.createInvalidStateError=function(e,r){return new t(ce.invalidStateError.code,ce.invalidStateError.desc+" Invalid State: "+e+", Root Err: "+r)},t.createStateMismatchError=function(){return new t(ce.stateMismatchError.code,ce.stateMismatchError.desc)},t.createStateNotFoundError=function(e){return new t(ce.stateNotFoundError.code,ce.stateNotFoundError.desc+": "+e)},t.createNonceMismatchError=function(){return new t(ce.nonceMismatchError.code,ce.nonceMismatchError.desc)},t.createAuthTimeNotFoundError=function(){return new t(ce.authTimeNotFoundError.code,ce.authTimeNotFoundError.desc)},t.createMaxAgeTranspiredError=function(){return new t(ce.maxAgeTranspiredError.code,ce.maxAgeTranspiredError.desc)},t.createNonceNotFoundError=function(e){return new t(ce.nonceNotFoundError.code,ce.nonceNotFoundError.desc+": "+e)},t.createMultipleMatchingTokensInCacheError=function(){return new t(ce.multipleMatchingTokens.code,ce.multipleMatchingTokens.desc+".")},t.createMultipleMatchingAccountsInCacheError=function(){return new t(ce.multipleMatchingAccounts.code,ce.multipleMatchingAccounts.desc)},t.createMultipleMatchingAppMetadataInCacheError=function(){return new t(ce.multipleMatchingAppMetadata.code,ce.multipleMatchingAppMetadata.desc)},t.createTokenRequestCannotBeMadeError=function(){return new t(ce.tokenRequestCannotBeMade.code,ce.tokenRequestCannotBeMade.desc)},t.createAppendEmptyScopeToSetError=function(e){return new t(ce.appendEmptyScopeError.code,ce.appendEmptyScopeError.desc+" Given Scope: "+e)},t.createRemoveEmptyScopeFromSetError=function(e){return new t(ce.removeEmptyScopeError.code,ce.removeEmptyScopeError.desc+" Given Scope: "+e)},t.createAppendScopeSetError=function(e){return new t(ce.appendScopeSetError.code,ce.appendScopeSetError.desc+" Detail Error: "+e)},t.createEmptyInputScopeSetError=function(){return new t(ce.emptyInputScopeSetError.code,""+ce.emptyInputScopeSetError.desc)},t.createDeviceCodeCancelledError=function(){return new t(ce.DeviceCodePollingCancelled.code,""+ce.DeviceCodePollingCancelled.desc)},t.createDeviceCodeExpiredError=function(){return new t(ce.DeviceCodeExpired.code,""+ce.DeviceCodeExpired.desc)},t.createDeviceCodeUnknownError=function(){return new t(ce.DeviceCodeUnknownError.code,""+ce.DeviceCodeUnknownError.desc)},t.createNoAccountInSilentRequestError=function(){return new t(ce.NoAccountInSilentRequest.code,""+ce.NoAccountInSilentRequest.desc)},t.createNullOrUndefinedCacheRecord=function(){return new t(ce.invalidCacheRecord.code,ce.invalidCacheRecord.desc)},t.createInvalidCacheEnvironmentError=function(){return new t(ce.invalidCacheEnvironment.code,ce.invalidCacheEnvironment.desc)},t.createNoAccountFoundError=function(){return new t(ce.noAccountFound.code,ce.noAccountFound.desc)},t.createCachePluginError=function(){return new t(ce.CachePluginError.code,""+ce.CachePluginError.desc)},t.createNoCryptoObjectError=function(e){return new t(ce.noCryptoObj.code,""+ce.noCryptoObj.desc+e)},t.createInvalidCacheTypeError=function(){return new t(ce.invalidCacheType.code,""+ce.invalidCacheType.desc)},t.createUnexpectedAccountTypeError=function(){return new t(ce.unexpectedAccountType.code,""+ce.unexpectedAccountType.desc)},t.createUnexpectedCredentialTypeError=function(){return new t(ce.unexpectedCredentialType.code,""+ce.unexpectedCredentialType.desc)},t.createInvalidAssertionError=function(){return new t(ce.invalidAssertion.code,""+ce.invalidAssertion.desc)},t.createInvalidCredentialError=function(){return new t(ce.invalidClientCredential.code,""+ce.invalidClientCredential.desc)},t.createRefreshRequiredError=function(){return new t(ce.tokenRefreshRequired.code,ce.tokenRefreshRequired.desc)},t.createUserTimeoutReachedError=function(){return new t(ce.userTimeoutReached.code,ce.userTimeoutReached.desc)},t.createTokenClaimsRequiredError=function(){return new t(ce.tokenClaimsRequired.code,ce.tokenClaimsRequired.desc)},t.createNoAuthCodeInServerResponseError=function(){return new t(ce.noAuthorizationCodeFromServer.code,ce.noAuthorizationCodeFromServer.desc)},t.createBindingKeyNotRemovedError=function(){return new t(ce.bindingKeyNotRemovedError.code,ce.bindingKeyNotRemovedError.desc)},t.createLogoutNotSupportedError=function(){return new t(ce.logoutNotSupported.code,ce.logoutNotSupported.desc)},t.createKeyIdMissingError=function(){return new t(ce.keyIdMissing.code,ce.keyIdMissing.desc)},t.createNoNetworkConnectivityError=function(){return new t(ce.noNetworkConnectivity.code,ce.noNetworkConnectivity.desc)},t.createUserCanceledError=function(){return new t(ce.userCanceledError.code,ce.userCanceledError.desc)},t}(ae),le=function(){function e(){}return e.decodeAuthToken=function(t){if(e.isEmpty(t))throw ue.createTokenNullOrEmptyError(t);var r=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!r||r.length<4)throw ue.createTokenParsingError("Given token is malformed: "+JSON.stringify(t));return{header:r[1],JWSPayload:r[2],JWSSig:r[3]}},e.isEmpty=function(e){return void 0===e||!e||0===e.length},e.isEmptyObj=function(t){if(t&&!e.isEmpty(t))try{var r=JSON.parse(t);return 0===Object.keys(r).length}catch(e){}return!0},e.startsWith=function(e,t){return 0===e.indexOf(t)},e.endsWith=function(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length},e.queryStringToObject=function(e){var t={},r=e.split("&"),n=function(e){return decodeURIComponent(e.replace(/\+/g," "))};return r.forEach((function(e){if(e.trim()){var r=e.split(/=(.+)/g,2),o=r[0],i=r[1];o&&i&&(t[n(o)]=n(i))}})),t},e.trimArrayEntries=function(e){return e.map((function(e){return e.trim()}))},e.removeEmptyStringsFromArray=function(t){return t.filter((function(t){return!e.isEmpty(t)}))},e.jsonParseHelper=function(e){try{return JSON.parse(e)}catch(e){return null}},e.matchPattern=function(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)},e}(); /*! @azure/msal-common v13.0.0 2023-05-02 */ e.LogLevel=void 0,(oe=e.LogLevel||(e.LogLevel={}))[oe.Error=0]="Error",oe[oe.Warning=1]="Warning",oe[oe.Info=2]="Info",oe[oe.Verbose=3]="Verbose",oe[oe.Trace=4]="Trace";var de,he=function(){function t(r,n,o){this.level=e.LogLevel.Info;var i=r||t.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||function(){},this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level="number"==typeof i.logLevel?i.logLevel:e.LogLevel.Info,this.correlationId=i.correlationId||A.EMPTY_STRING,this.packageName=n||A.EMPTY_STRING,this.packageVersion=o||A.EMPTY_STRING}return t.createDefaultLoggerOptions=function(){return{loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info}},t.prototype.clone=function(e,r,n){return new t({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:n||this.correlationId},e,r)},t.prototype.logMessage=function(t,r){if(!(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)){var n=(new Date).toUTCString(),o=(le.isEmpty(r.correlationId)?le.isEmpty(this.correlationId)?"["+n+"]":"["+n+"] : ["+this.correlationId+"]":"["+n+"] : ["+r.correlationId+"]")+" : "+this.packageName+"@"+this.packageVersion+" : "+e.LogLevel[r.logLevel]+" - "+t;this.executeCallback(r.logLevel,o,r.containsPii||!1)}},t.prototype.executeCallback=function(e,t,r){this.localCallback&&this.localCallback(e,t,r)},t.prototype.error=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:r||A.EMPTY_STRING})},t.prototype.errorPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:r||A.EMPTY_STRING})},t.prototype.warning=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:r||A.EMPTY_STRING})},t.prototype.warningPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:r||A.EMPTY_STRING})},t.prototype.info=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:r||A.EMPTY_STRING})},t.prototype.infoPii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:r||A.EMPTY_STRING})},t.prototype.verbose=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:r||A.EMPTY_STRING})},t.prototype.verbosePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:r||A.EMPTY_STRING})},t.prototype.trace=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:r||A.EMPTY_STRING})},t.prototype.tracePii=function(t,r){this.logMessage(t,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:r||A.EMPTY_STRING})},t.prototype.isPiiLoggingEnabled=function(){return this.piiLoggingEnabled||!1},t}(),pe="@azure/msal-common",ge="13.0.0"; /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e[e.None=0]="None",e.AzurePublic="https://login.microsoftonline.com",e.AzurePpe="https://login.windows-ppe.net",e.AzureChina="https://login.chinacloudapi.cn",e.AzureGermany="https://login.microsoftonline.de",e.AzureUsGovernment="https://login.microsoftonline.us"}(de||(de={})); /*! @azure/msal-common v13.0.0 2023-05-02 */ var fe,me={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},claimsRequestParsingError:{code:"claims_request_parsing_error",desc:"Could not parse the given claims request object."},authorityUriInsecure:{code:"authority_uri_insecure",desc:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options"},urlParseError:{code:"url_parse_error",desc:"URL could not be parsed into appropriate segments."},urlEmptyError:{code:"empty_url_error",desc:"URL was empty or null."},emptyScopesError:{code:"empty_input_scopes_error",desc:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token."},nonArrayScopesError:{code:"nonarray_input_scopes_error",desc:"Scopes cannot be passed as non-array."},clientIdSingleScopeError:{code:"clientid_input_scopes_error",desc:"Client ID can only be provided as a single scope."},invalidPrompt:{code:"invalid_prompt_value",desc:"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest"},invalidClaimsRequest:{code:"invalid_claims",desc:"Given claims parameter must be a stringified JSON object."},tokenRequestEmptyError:{code:"token_request_empty",desc:"Token request was empty and not found in cache."},logoutRequestEmptyError:{code:"logout_request_empty",desc:"The logout request was null or undefined."},invalidCodeChallengeMethod:{code:"invalid_code_challenge_method",desc:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".'},invalidCodeChallengeParams:{code:"pkce_params_missing",desc:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request"},invalidCloudDiscoveryMetadata:{code:"invalid_cloud_discovery_metadata",desc:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields"},invalidAuthorityMetadata:{code:"invalid_authority_metadata",desc:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields."},untrustedAuthority:{code:"untrusted_authority",desc:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."},invalidAzureCloudInstance:{code:"invalid_azure_cloud_instance",desc:"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values"},missingSshJwk:{code:"missing_ssh_jwk",desc:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme."},missingSshKid:{code:"missing_ssh_kid",desc:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme."},missingNonceAuthenticationHeader:{code:"missing_nonce_authentication_header",desc:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce."},invalidAuthenticationHeader:{code:"invalid_authentication_header",desc:"Invalid authentication header provided"}},ve=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="ClientConfigurationError",Object.setPrototypeOf(o,t.prototype),o}return v(t,e),t.createRedirectUriEmptyError=function(){return new t(me.redirectUriNotSet.code,me.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(me.postLogoutUriNotSet.code,me.postLogoutUriNotSet.desc)},t.createClaimsRequestParsingError=function(e){return new t(me.claimsRequestParsingError.code,me.claimsRequestParsingError.desc+" Given value: "+e)},t.createInsecureAuthorityUriError=function(e){return new t(me.authorityUriInsecure.code,me.authorityUriInsecure.desc+" Given URI: "+e)},t.createUrlParseError=function(e){return new t(me.urlParseError.code,me.urlParseError.desc+" Given Error: "+e)},t.createUrlEmptyError=function(){return new t(me.urlEmptyError.code,me.urlEmptyError.desc)},t.createEmptyScopesArrayError=function(){return new t(me.emptyScopesError.code,""+me.emptyScopesError.desc)},t.createClientIdSingleScopeError=function(e){return new t(me.clientIdSingleScopeError.code,me.clientIdSingleScopeError.desc+" Given Scopes: "+e)},t.createInvalidPromptError=function(e){return new t(me.invalidPrompt.code,me.invalidPrompt.desc+" Given value: "+e)},t.createInvalidClaimsRequestError=function(){return new t(me.invalidClaimsRequest.code,me.invalidClaimsRequest.desc)},t.createEmptyLogoutRequestError=function(){return new t(me.logoutRequestEmptyError.code,me.logoutRequestEmptyError.desc)},t.createEmptyTokenRequestError=function(){return new t(me.tokenRequestEmptyError.code,me.tokenRequestEmptyError.desc)},t.createInvalidCodeChallengeMethodError=function(){return new t(me.invalidCodeChallengeMethod.code,me.invalidCodeChallengeMethod.desc)},t.createInvalidCodeChallengeParamsError=function(){return new t(me.invalidCodeChallengeParams.code,me.invalidCodeChallengeParams.desc)},t.createInvalidCloudDiscoveryMetadataError=function(){return new t(me.invalidCloudDiscoveryMetadata.code,me.invalidCloudDiscoveryMetadata.desc)},t.createInvalidAuthorityMetadataError=function(){return new t(me.invalidAuthorityMetadata.code,me.invalidAuthorityMetadata.desc)},t.createUntrustedAuthorityError=function(){return new t(me.untrustedAuthority.code,me.untrustedAuthority.desc)},t.createInvalidAzureCloudInstanceError=function(){return new t(me.invalidAzureCloudInstance.code,me.invalidAzureCloudInstance.desc)},t.createMissingSshJwkError=function(){return new t(me.missingSshJwk.code,me.missingSshJwk.desc)},t.createMissingSshKidError=function(){return new t(me.missingSshKid.code,me.missingSshKid.desc)},t.createMissingNonceAuthenticationHeadersError=function(){return new t(me.missingNonceAuthenticationHeader.code,me.missingNonceAuthenticationHeader.desc)},t.createInvalidAuthenticationHeaderError=function(e,r){return new t(me.invalidAuthenticationHeader.code,me.invalidAuthenticationHeader.desc+". Invalid header: "+e+". Details: "+r)},t}(ue),ye=function(){function e(e){var t=this,r=e?le.trimArrayEntries(I(e)):[],n=r?le.removeEmptyStringsFromArray(r):[];this.validateInputScopes(n),this.scopes=new Set,n.forEach((function(e){return t.scopes.add(e)}))}return e.fromString=function(t){return new e((t||A.EMPTY_STRING).split(" "))},e.createSearchScopes=function(t){var r=new e(t);return r.containsOnlyOIDCScopes()?r.removeScope(A.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r},e.prototype.validateInputScopes=function(e){if(!e||e.length<1)throw ve.createEmptyScopesArrayError()},e.prototype.containsScope=function(t){var r=new e(this.printScopesLowerCase().split(" "));return!le.isEmpty(t)&&r.scopes.has(t.toLowerCase())},e.prototype.containsScopeSet=function(e){var t=this;return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((function(e){return t.containsScope(e)})))},e.prototype.containsOnlyOIDCScopes=function(){var e=this,t=0;return R.forEach((function(r){e.containsScope(r)&&(t+=1)})),this.scopes.size===t},e.prototype.appendScope=function(e){le.isEmpty(e)||this.scopes.add(e.trim())},e.prototype.appendScopes=function(e){var t=this;try{e.forEach((function(e){return t.appendScope(e)}))}catch(e){throw ue.createAppendScopeSetError(e)}},e.prototype.removeScope=function(e){if(le.isEmpty(e))throw ue.createRemoveEmptyScopeFromSetError(e);this.scopes.delete(e.trim())},e.prototype.removeOIDCScopes=function(){var e=this;R.forEach((function(t){e.scopes.delete(t)}))},e.prototype.unionScopeSets=function(e){if(!e)throw ue.createEmptyInputScopeSetError();var t=new Set;return e.scopes.forEach((function(e){return t.add(e.toLowerCase())})),this.scopes.forEach((function(e){return t.add(e.toLowerCase())})),t},e.prototype.intersectingScopeSets=function(e){if(!e)throw ue.createEmptyInputScopeSetError();e.containsOnlyOIDCScopes()||e.removeOIDCScopes();var t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r},e.prototype.getScopeCount=function(){return this.scopes.size},e.prototype.asArray=function(){var e=[];return this.scopes.forEach((function(t){return e.push(t)})),e},e.prototype.printScopes=function(){return this.scopes?this.asArray().join(" "):A.EMPTY_STRING},e.prototype.printScopesLowerCase=function(){return this.printScopes().toLowerCase()},e}(); /*! @azure/msal-common v13.0.0 2023-05-02 */ function Ce(e,t){if(le.isEmpty(e))throw ue.createClientInfoEmptyError();try{var r=t.base64Decode(e);return JSON.parse(r)}catch(e){throw ue.createClientInfoDecodingError(e.message)}}function Te(e){if(le.isEmpty(e))throw ue.createClientInfoDecodingError("Home account ID was empty.");var t=e.split(U.CLIENT_INFO_SEPARATOR,2);return{uid:t[0],utid:t.length<2?A.EMPTY_STRING:t[1]}} /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e[e.Default=0]="Default",e[e.Adfs=1]="Adfs",e[e.Dsts=2]="Dsts",e[e.Ciam=3]="Ciam"}(fe||(fe={})); /*! @azure/msal-common v13.0.0 2023-05-02 */ var Ie=function(){function e(){}return e.prototype.generateAccountId=function(){return[this.homeAccountId,this.environment].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},e.prototype.generateAccountKey=function(){return e.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})},e.prototype.generateType=function(){switch(this.authorityType){case q.ADFS_ACCOUNT_TYPE:return L.ADFS;case q.MSAV1_ACCOUNT_TYPE:return L.MSA;case q.MSSTS_ACCOUNT_TYPE:return L.MSSTS;case q.GENERIC_ACCOUNT_TYPE:return L.GENERIC;default:throw ue.createUnexpectedAccountTypeError()}},e.prototype.getAccountInfo=function(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,idTokenClaims:this.idTokenClaims,nativeAccountId:this.nativeAccountId}},e.generateAccountCacheKey=function(e){return[e.homeAccountId,e.environment||A.EMPTY_STRING,e.tenantId||A.EMPTY_STRING].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAccount=function(t,r,n,o,i,a,s,c){var u,l,d,h,p,g,f=new e;f.authorityType=q.MSSTS_ACCOUNT_TYPE,f.clientInfo=t,f.homeAccountId=r,f.nativeAccountId=c;var m=s||o&&o.getPreferredCache();if(!m)throw ue.createInvalidCacheEnvironmentError();if(f.environment=m,f.realm=(null===(u=null==n?void 0:n.claims)||void 0===u?void 0:u.tid)||A.EMPTY_STRING,n){f.idTokenClaims=n.claims,f.localAccountId=(null===(l=null==n?void 0:n.claims)||void 0===l?void 0:l.oid)||(null===(d=null==n?void 0:n.claims)||void 0===d?void 0:d.sub)||A.EMPTY_STRING;var v=null===(h=null==n?void 0:n.claims)||void 0===h?void 0:h.preferred_username,y=(null===(p=null==n?void 0:n.claims)||void 0===p?void 0:p.emails)?n.claims.emails[0]:null;f.username=v||y||A.EMPTY_STRING,f.name=null===(g=null==n?void 0:n.claims)||void 0===g?void 0:g.name}return f.cloudGraphHostName=i,f.msGraphHost=a,f},e.createGenericAccount=function(t,r,n,o,i,a){var s,c,u,l,d=new e;d.authorityType=n&&n.authorityType===fe.Adfs?q.ADFS_ACCOUNT_TYPE:q.GENERIC_ACCOUNT_TYPE,d.homeAccountId=t,d.realm=A.EMPTY_STRING;var h=a||n&&n.getPreferredCache();if(!h)throw ue.createInvalidCacheEnvironmentError();return r&&(d.localAccountId=(null===(s=null==r?void 0:r.claims)||void 0===s?void 0:s.oid)||(null===(c=null==r?void 0:r.claims)||void 0===c?void 0:c.sub)||A.EMPTY_STRING,d.username=(null===(u=null==r?void 0:r.claims)||void 0===u?void 0:u.upn)||A.EMPTY_STRING,d.name=(null===(l=null==r?void 0:r.claims)||void 0===l?void 0:l.name)||A.EMPTY_STRING,d.idTokenClaims=null==r?void 0:r.claims),d.environment=h,d.cloudGraphHostName=o,d.msGraphHost=i,d},e.generateHomeAccountId=function(e,t,r,n,o){var i,a=(null===(i=null==o?void 0:o.claims)||void 0===i?void 0:i.sub)?o.claims.sub:A.EMPTY_STRING;if(t===fe.Adfs||t===fe.Dsts)return a;if(e)try{var s=Ce(e,n);if(!le.isEmpty(s.uid)&&!le.isEmpty(s.utid))return""+s.uid+U.CLIENT_INFO_SEPARATOR+s.utid}catch(e){}return r.verbose("No client info in response"),a},e.isAccountEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))},e.accountInfoIsEqual=function(e,t,r){if(!e||!t)return!1;var n=!0;if(r){var o=e.idTokenClaims||{},i=t.idTokenClaims||{};n=o.iat===i.iat&&o.nonce===i.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n},e}(),we=function(){function e(t,r){if(le.isEmpty(t))throw ue.createTokenNullOrEmptyError(t);this.rawToken=t,this.claims=e.extractTokenClaims(t,r)}return e.extractTokenClaims=function(e,t){var r=le.decodeAuthToken(e);try{var n=r.JWSPayload,o=t.base64Decode(n);return JSON.parse(o)}catch(e){throw ue.createTokenParsingError(e)}},e.checkMaxAge=function(e,t){if(0===t||Date.now()-3e5>e+t)throw ue.createMaxAgeTranspiredError()},e}(),Ee=function(){function t(e,t,r){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(pe,ge)}return t.prototype.getAllAccounts=function(){var e=this,t=this.getAccountKeys();if(t.length<1)return[];var r=t.reduce((function(t,r){var n=e.getAccount(r);return n?(t.push(n),t):t}),[]);return r.length<1?[]:r.map((function(t){return e.getAccountInfoFromEntity(t)}))},t.prototype.getAccountInfoFilteredBy=function(e){var t=this.getAccountsFilteredBy(e);return t.length>0?this.getAccountInfoFromEntity(t[0]):null},t.prototype.getAccountInfoFromEntity=function(e){var t=e.getAccountInfo(),r=this.getIdToken(t);return r&&(t.idToken=r.secret,t.idTokenClaims=new we(r.secret,this.cryptoImpl).claims),t},t.prototype.saveCacheRecord=function(e){return C(this,void 0,void 0,(function(){return T(this,(function(t){switch(t.label){case 0:if(!e)throw ue.createNullOrUndefinedCacheRecord();return e.account&&this.setAccount(e.account),e.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken?[4,this.saveAccessToken(e.accessToken)]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata),[2]}}))}))},t.prototype.saveAccessToken=function(e){return C(this,void 0,void 0,(function(){var t,r,n,o,i=this;return T(this,(function(a){switch(a.label){case 0:return t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},r=this.getTokenKeys(),n=ye.fromString(e.target),o=[],r.accessToken.forEach((function(e){if(i.accessTokenKeyMatchesFilter(e,t,!1)){var r=i.getAccessTokenCredential(e);if(r&&i.credentialMatchesFilter(r,t))ye.fromString(r.target).intersectingScopeSets(n)&&o.push(i.removeAccessToken(e))}})),[4,Promise.all(o)];case 1:return a.sent(),this.setAccessTokenCredential(e),[2]}}))}))},t.prototype.getAccountsFilteredBy=function(e){var t=this,r=this.getAccountKeys(),n=[];return r.forEach((function(r){if(t.isAccountKey(r,e.homeAccountId,e.realm)){var o=t.getAccount(r);o&&(e.homeAccountId&&!t.matchHomeAccountId(o,e.homeAccountId)||e.localAccountId&&!t.matchLocalAccountId(o,e.localAccountId)||e.username&&!t.matchUsername(o,e.username)||e.environment&&!t.matchEnvironment(o,e.environment)||e.realm&&!t.matchRealm(o,e.realm)||e.nativeAccountId&&!t.matchNativeAccountId(o,e.nativeAccountId)||n.push(o))}})),n},t.prototype.isAccountKey=function(e,t,r){return!(e.split(U.CACHE_KEY_SEPARATOR).length<3)&&(!(t&&!e.toLowerCase().includes(t.toLowerCase()))&&!(r&&!e.toLowerCase().includes(r.toLowerCase())))},t.prototype.isCredentialKey=function(e){if(e.split(U.CACHE_KEY_SEPARATOR).length<6)return!1;var t=e.toLowerCase();if(-1===t.indexOf(x.ID_TOKEN.toLowerCase())&&-1===t.indexOf(x.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(x.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(x.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(x.REFRESH_TOKEN.toLowerCase())>-1){var r=""+x.REFRESH_TOKEN+U.CACHE_KEY_SEPARATOR+this.clientId+U.CACHE_KEY_SEPARATOR,n=""+x.REFRESH_TOKEN+U.CACHE_KEY_SEPARATOR+F+U.CACHE_KEY_SEPARATOR;if(-1===t.indexOf(r.toLowerCase())&&-1===t.indexOf(n.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0},t.prototype.credentialMatchesFilter=function(t,r){if(r.clientId&&!this.matchClientId(t,r.clientId))return!1;if(r.userAssertionHash&&!this.matchUserAssertionHash(t,r.userAssertionHash))return!1;if("string"==typeof r.homeAccountId&&!this.matchHomeAccountId(t,r.homeAccountId))return!1;if(r.environment&&!this.matchEnvironment(t,r.environment))return!1;if(r.realm&&!this.matchRealm(t,r.realm))return!1;if(r.credentialType&&!this.matchCredentialType(t,r.credentialType))return!1;if(r.familyId&&!this.matchFamilyId(t,r.familyId))return!1;if(r.target&&!this.matchTarget(t,r.target))return!1;if((r.requestedClaimsHash||t.requestedClaimsHash)&&t.requestedClaimsHash!==r.requestedClaimsHash)return!1;if(t.credentialType===x.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(r.tokenType&&!this.matchTokenType(t,r.tokenType))return!1;if(r.tokenType===e.AuthenticationScheme.SSH&&r.keyId&&!this.matchKeyId(t,r.keyId))return!1}return!0},t.prototype.getAppMetadataFilteredBy=function(e){return this.getAppMetadataFilteredByInternal(e.environment,e.clientId)},t.prototype.getAppMetadataFilteredByInternal=function(e,t){var r=this,n=this.getKeys(),o={};return n.forEach((function(n){if(r.isAppMetadata(n)){var i=r.getAppMetadata(n);i&&(e&&!r.matchEnvironment(i,e)||t&&!r.matchClientId(i,t)||(o[n]=i))}})),o},t.prototype.getAuthorityMetadataByAlias=function(e){var t=this,r=this.getAuthorityMetadataKeys(),n=null;return r.forEach((function(r){if(t.isAuthorityMetadata(r)&&-1!==r.indexOf(t.clientId)){var o=t.getAuthorityMetadata(r);o&&-1!==o.aliases.indexOf(e)&&(n=o)}})),n},t.prototype.removeAllAccounts=function(){return C(this,void 0,void 0,(function(){var e,t,r=this;return T(this,(function(n){switch(n.label){case 0:return e=this.getAccountKeys(),t=[],e.forEach((function(e){t.push(r.removeAccount(e))})),[4,Promise.all(t)];case 1:return n.sent(),[2]}}))}))},t.prototype.removeAccount=function(e){return C(this,void 0,void 0,(function(){var t;return T(this,(function(r){switch(r.label){case 0:if(!(t=this.getAccount(e)))throw ue.createNoAccountFoundError();return[4,this.removeAccountContext(t)];case 1:return r.sent(),this.removeItem(e),[2]}}))}))},t.prototype.removeAccountContext=function(e){return C(this,void 0,void 0,(function(){var t,r,n,o=this;return T(this,(function(i){switch(i.label){case 0:return t=this.getTokenKeys(),r=e.generateAccountId(),n=[],t.idToken.forEach((function(e){0===e.indexOf(r)&&o.removeIdToken(e)})),t.accessToken.forEach((function(e){0===e.indexOf(r)&&n.push(o.removeAccessToken(e))})),t.refreshToken.forEach((function(e){0===e.indexOf(r)&&o.removeRefreshToken(e)})),[4,Promise.all(n)];case 1:return i.sent(),[2]}}))}))},t.prototype.removeAccessToken=function(t){return C(this,void 0,void 0,(function(){var r,n;return T(this,(function(o){switch(o.label){case 0:if(!(r=this.getAccessTokenCredential(t)))return[2];if(r.credentialType.toLowerCase()!==x.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())return[3,4];if(r.tokenType!==e.AuthenticationScheme.POP)return[3,4];if(!(n=r.keyId))return[3,4];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.cryptoImpl.removeTokenBindingKey(n)];case 2:return o.sent(),[3,4];case 3:throw o.sent(),ue.createBindingKeyNotRemovedError();case 4:return[2,this.removeItem(t)]}}))}))},t.prototype.removeAppMetadata=function(){var e=this;return this.getKeys().forEach((function(t){e.isAppMetadata(t)&&e.removeItem(t)})),!0},t.prototype.readCacheRecord=function(e,t,r){var n=this.getTokenKeys(),o=this.readAccountFromCache(e),i=this.getIdToken(e,n),a=this.getAccessToken(e,t,n),s=this.getRefreshToken(e,!1,n),c=this.readAppMetadataFromCache(r);return o&&i&&(o.idTokenClaims=new we(i.secret,this.cryptoImpl).claims),{account:o,idToken:i,accessToken:a,refreshToken:s,appMetadata:c}},t.prototype.readAccountFromCache=function(e){var t=Ie.generateAccountCacheKey(e);return this.getAccount(t)},t.prototype.getIdToken=function(e,t){this.commonLogger.trace("CacheManager - getIdToken called");var r={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:x.ID_TOKEN,clientId:this.clientId,realm:e.tenantId},n=this.getIdTokensByFilter(r,t),o=n.length;if(o<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(o>1)throw ue.createMultipleMatchingTokensInCacheError();return this.commonLogger.info("CacheManager:getIdToken - Returning id token"),n[0]},t.prototype.getIdTokensByFilter=function(e,t){var r=this,n=t&&t.idToken||this.getTokenKeys().idToken,o=[];return n.forEach((function(t){if(r.idTokenKeyMatchesFilter(t,y({clientId:r.clientId},e))){var n=r.getIdTokenCredential(t);n&&r.credentialMatchesFilter(n,e)&&o.push(n)}})),o},t.prototype.idTokenKeyMatchesFilter=function(e,t){var r=e.toLowerCase();return(!t.clientId||-1!==r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase()))},t.prototype.removeIdToken=function(e){this.removeItem(e)},t.prototype.removeRefreshToken=function(e){this.removeItem(e)},t.prototype.getAccessToken=function(t,r,n){var o=this;this.commonLogger.trace("CacheManager - getAccessToken called");var i=ye.createSearchScopes(r.scopes),a=r.authenticationScheme||e.AuthenticationScheme.BEARER,s=a&&a.toLowerCase()!==e.AuthenticationScheme.BEARER.toLowerCase()?x.ACCESS_TOKEN_WITH_AUTH_SCHEME:x.ACCESS_TOKEN,c={homeAccountId:t.homeAccountId,environment:t.environment,credentialType:s,clientId:this.clientId,realm:t.tenantId,target:i,tokenType:a,keyId:r.sshKid,requestedClaimsHash:r.requestedClaimsHash},u=n&&n.accessToken||this.getTokenKeys().accessToken,l=[];u.forEach((function(e){if(o.accessTokenKeyMatchesFilter(e,c,!0)){var t=o.getAccessTokenCredential(e);t&&o.credentialMatchesFilter(t,c)&&l.push(t)}}));var d=l.length;if(d<1)return this.commonLogger.info("CacheManager:getAccessToken - No token found"),null;if(d>1)throw ue.createMultipleMatchingTokensInCacheError();return this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),l[0]},t.prototype.accessTokenKeyMatchesFilter=function(e,t,r){var n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.requestedClaimsHash&&-1===n.indexOf(t.requestedClaimsHash.toLowerCase()))return!1;if(t.target)for(var o=t.target.asArray(),i=0;i<o.length;i++){if(r&&!n.includes(o[i].toLowerCase()))return!1;if(!r&&n.includes(o[i].toLowerCase()))return!0}return!0},t.prototype.getAccessTokensByFilter=function(e){var t=this,r=this.getTokenKeys(),n=[];return r.accessToken.forEach((function(r){if(t.accessTokenKeyMatchesFilter(r,e,!0)){var o=t.getAccessTokenCredential(r);o&&t.credentialMatchesFilter(o,e)&&n.push(o)}})),n},t.prototype.getRefreshToken=function(e,t,r){var n=this;this.commonLogger.trace("CacheManager - getRefreshToken called");var o=t?F:void 0,i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:x.REFRESH_TOKEN,clientId:this.clientId,familyId:o},a=r&&r.refreshToken||this.getTokenKeys().refreshToken,s=[];return a.forEach((function(e){if(n.refreshTokenKeyMatchesFilter(e,i)){var t=n.getRefreshTokenCredential(e);t&&n.credentialMatchesFilter(t,i)&&s.push(t)}})),s.length<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),s[0])},t.prototype.refreshTokenKeyMatchesFilter=function(e,t){var r=e.toLowerCase();return(!t.familyId||-1!==r.indexOf(t.familyId.toLowerCase()))&&(!(!t.familyId&&t.clientId&&-1===r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase())))},t.prototype.readAppMetadataFromCache=function(e){var t={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(t),n=Object.keys(r).map((function(e){return r[e]})),o=n.length;if(o<1)return null;if(o>1)throw ue.createMultipleMatchingAppMetadataInCacheError();return n[0]},t.prototype.isAppMetadataFOCI=function(e){var t=this.readAppMetadataFromCache(e);return!(!t||t.familyId!==F)},t.prototype.matchHomeAccountId=function(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)},t.prototype.matchLocalAccountId=function(e,t){return!("string"!=typeof e.localAccountId||t!==e.localAccountId)},t.prototype.matchUsername=function(e,t){return!("string"!=typeof e.username||t.toLowerCase()!==e.username.toLowerCase())},t.prototype.matchUserAssertionHash=function(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)},t.prototype.matchEnvironment=function(e,t){var r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)},t.prototype.matchCredentialType=function(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()},t.prototype.matchClientId=function(e,t){return!(!e.clientId||t!==e.clientId)},t.prototype.matchFamilyId=function(e,t){return!(!e.familyId||t!==e.familyId)},t.prototype.matchRealm=function(e,t){return!(!e.realm||t!==e.realm)},t.prototype.matchNativeAccountId=function(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)},t.prototype.matchTarget=function(e,t){return!(e.credentialType!==x.ACCESS_TOKEN&&e.credentialType!==x.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)&&ye.fromString(e.target).containsScopeSet(t)},t.prototype.matchTokenType=function(e,t){return!(!e.tokenType||e.tokenType!==t)},t.prototype.matchKeyId=function(e,t){return!(!e.keyId||e.keyId!==t)},t.prototype.isAppMetadata=function(e){return-1!==e.indexOf(D)},t.prototype.isAuthorityMetadata=function(e){return-1!==e.indexOf(K)},t.prototype.generateAuthorityMetadataCacheKey=function(e){return K+"-"+this.clientId+"-"+e},t.toObject=function(e,t){for(var r in t)e[r]=t[r];return e},t}(),ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.prototype.setAccount=function(){throw ae.createUnexpectedError("Storage interface - setAccount() has not been implemented for the cacheStorage interface.")},t.prototype.getAccount=function(){throw ae.createUnexpectedError("Storage interface - getAccount() has not been implemented for the cacheStorage interface.")},t.prototype.setIdTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getIdTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAccessTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getAccessTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setRefreshTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.getRefreshTokenCredential=function(){throw ae.createUnexpectedError("Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.")},t.prototype.setAppMetadata=function(){throw ae.createUnexpectedError("Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAppMetadata=function(){throw ae.createUnexpectedError("Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.setServerTelemetry=function(){throw ae.createUnexpectedError("Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.getServerTelemetry=function(){throw ae.createUnexpectedError("Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.")},t.prototype.setAuthorityMetadata=function(){throw ae.createUnexpectedError("Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadata=function(){throw ae.createUnexpectedError("Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.")},t.prototype.getAuthorityMetadataKeys=function(){throw ae.createUnexpectedError("Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.")},t.prototype.setThrottlingCache=function(){throw ae.createUnexpectedError("Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.getThrottlingCache=function(){throw ae.createUnexpectedError("Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.")},t.prototype.removeItem=function(){throw ae.createUnexpectedError("Storage interface - removeItem() has not been implemented for the cacheStorage interface.")},t.prototype.containsKey=function(){throw ae.createUnexpectedError("Storage interface - containsKey() has not been implemented for the cacheStorage interface.")},t.prototype.getKeys=function(){throw ae.createUnexpectedError("Storage interface - getKeys() has not been implemented for the cacheStorage interface.")},t.prototype.getAccountKeys=function(){throw ae.createUnexpectedError("Storage interface - getAccountKeys() has not been implemented for the cacheStorage interface.")},t.prototype.getTokenKeys=function(){throw ae.createUnexpectedError("Storage interface - getTokenKeys() has not been implemented for the cacheStorage interface.")},t.prototype.clear=function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Storage interface - clear() has not been implemented for the cacheStorage interface.",ae.createUnexpectedError("Storage interface - clear() has not been implemented for the cacheStorage interface.")}))}))},t.prototype.updateCredentialCacheKey=function(){throw ae.createUnexpectedError("Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.")},t}(Ee),Se={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},be={loggerCallback:function(){},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:A.EMPTY_STRING},Ae={sendGetRequestAsync:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Network interface - sendGetRequestAsync() has not been implemented",ae.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented")}))}))},sendPostRequestAsync:function(){return C(this,void 0,void 0,(function(){return T(this,(function(e){throw"Network interface - sendPostRequestAsync() has not been implemented",ae.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented")}))}))}},_e={sku:A.SKU,version:ge,cpu:A.EMPTY_STRING,os:A.EMPTY_STRING},Re={clientSecret:A.EMPTY_STRING,clientAssertion:void 0},Pe={azureCloudInstance:de.None,tenant:""+A.DEFAULT_COMMON_TENANT},Me={application:{appName:"",appVersion:""}}; /*! @azure/msal-common v13.0.0 2023-05-02 */ /*! @azure/msal-common v13.0.0 2023-05-02 */ var Ne,Oe=function(e){function t(r,n,o){var i=e.call(this,r,n,o)||this;return i.name="ServerError",Object.setPrototypeOf(i,t.prototype),i}return v(t,e),t}(ae),qe=function(){function e(){}return e.generateThrottlingStorageKey=function(e){return ee+"."+JSON.stringify(e)},e.preProcess=function(t,r){var n,o=e.generateThrottlingStorageKey(r),i=t.getThrottlingCache(o);if(i){if(i.throttleTime<Date.now())return void t.removeItem(o);throw new Oe((null===(n=i.errorCodes)||void 0===n?void 0:n.join(" "))||A.EMPTY_STRING,i.errorMessage,i.subError)}},e.postProcess=function(t,r,n){if(e.checkResponseStatus(n)||e.checkResponseForRetryAfter(n)){var o={throttleTime:e.calculateThrottleTime(parseInt(n.headers[w.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};t.setThrottlingCache(e.generateThrottlingStorageKey(r),o)}},e.checkResponseStatus=function(e){return 429===e.status||e.status>=500&&e.status<600},e.checkResponseForRetryAfter=function(e){return!!e.headers&&(e.headers.hasOwnProperty(w.RETRY_AFTER)&&(e.status<200||e.status>=300))},e.calculateThrottleTime=function(e){var t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||X),r+Z))},e.removeThrottle=function(e,t,r,n){var o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);e.removeItem(i)},e}(),Ue=function(){function e(e,t){this.networkClient=e,this.cacheManager=t}return e.prototype.sendPostRequest=function(e,t,r){return C(this,void 0,void 0,(function(){var n,o;return T(this,(function(i){switch(i.label){case 0:qe.preProcess(this.cacheManager,e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.networkClient.sendPostRequestAsync(t,r)];case 2:return n=i.sent(),[3,4];case 3:throw(o=i.sent())instanceof ae?o:ue.createNetworkError(t,o);case 4:return qe.postProcess(this.cacheManager,e,n),[2,n]}}))}))},e}(); /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e.HOME_ACCOUNT_ID="home_account_id",e.UPN="UPN"}(Ne||(Ne={})); /*! @azure/msal-common v13.0.0 2023-05-02 */ var xe,Le,Be=function(){function e(){}return e.validateRedirectUri=function(e){if(le.isEmpty(e))throw ve.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in M)t.push(M[r]);if(t.indexOf(e)<0)throw ve.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw ve.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(le.isEmpty(e)||le.isEmpty(t))throw ve.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if([B.PLAIN,B.S256].indexOf(e)<0)throw ve.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach((function(t,r){e[r]&&delete e[r]})),Object.fromEntries(Object.entries(e).filter((function(e){return""!==e[1]})))):{}},e}(),He=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(S.RESPONSE_TYPE,encodeURIComponent(A.CODE_RESPONSE_TYPE))},t.prototype.addResponseTypeForTokenAndIdToken=function(){this.parameters.set(S.RESPONSE_TYPE,encodeURIComponent(A.TOKEN_RESPONSE_TYPE+" "+A.ID_TOKEN_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(S.RESPONSE_MODE,encodeURIComponent(e||N.QUERY))},t.prototype.addNativeBroker=function(){this.parameters.set(S.NATIVE_BROKER,encodeURIComponent("1"))},t.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=t?I(e||[],_):e||[],n=new ye(r);this.parameters.set(S.SCOPE,encodeURIComponent(n.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(S.CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e){Be.validateRedirectUri(e),this.parameters.set(S.REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){Be.validateRedirectUri(e),this.parameters.set(S.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(S.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(P.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(P.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(w.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(w.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(P.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);Be.validateClaims(r),this.parameters.set(S.CLAIMS,encodeURIComponent(r))},t.prototype.addCorrelationId=function(e){this.parameters.set(S.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(S.X_CLIENT_SKU,e.sku),this.parameters.set(S.X_CLIENT_VER,e.version),e.os&&this.parameters.set(S.X_CLIENT_OS,e.os),e.cpu&&this.parameters.set(S.X_CLIENT_CPU,e.cpu)},t.prototype.addApplicationTelemetry=function(e){(null==e?void 0:e.appName)&&this.parameters.set(S.X_APP_NAME,e.appName),(null==e?void 0:e.appVersion)&&this.parameters.set(S.X_APP_VER,e.appVersion)},t.prototype.addPrompt=function(e){Be.validatePrompt(e),this.parameters.set(""+S.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){le.isEmpty(e)||this.parameters.set(S.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(S.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,t){if(Be.validateCodeChallengeParams(e,t),!e||!t)throw ve.createInvalidCodeChallengeParamsError();this.parameters.set(S.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(S.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},t.prototype.addAuthorizationCode=function(e){this.parameters.set(S.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(S.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(S.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(S.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(S.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){le.isEmpty(e)||this.parameters.set(S.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){le.isEmpty(e)||this.parameters.set(S.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(S.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(S.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(S.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set("client_info","1")},t.prototype.addExtraQueryParameters=function(e){var t=this,r=Be.sanitizeEQParams(e,this.parameters);Object.keys(r).forEach((function(r){t.parameters.set(r,e[r])}))},t.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw ve.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(b.ACCESS_TOKEN)||(r[b.ACCESS_TOKEN]={}),r[b.ACCESS_TOKEN][b.XMS_CC]={values:t}),JSON.stringify(r)},t.prototype.addUsername=function(e){this.parameters.set(j.username,encodeURIComponent(e))},t.prototype.addPassword=function(e){this.parameters.set(j.password,encodeURIComponent(e))},t.prototype.addPopToken=function(t){le.isEmpty(t)||(this.parameters.set(S.TOKEN_TYPE,e.AuthenticationScheme.POP),this.parameters.set(S.REQ_CNF,encodeURIComponent(t)))},t.prototype.addSshJwk=function(t){le.isEmpty(t)||(this.parameters.set(S.TOKEN_TYPE,e.AuthenticationScheme.SSH),this.parameters.set(S.REQ_CNF,encodeURIComponent(t)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(S.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(S.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(S.X_MS_LIB_CAPABILITY,te)},t.prototype.addLogoutHint=function(e){this.parameters.set(S.LOGOUT_HINT,encodeURIComponent(e))},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach((function(t,r){e.push(r+"="+t)})),e.join("&")},t}(),De=function(){function e(e,t){this.config=function(e){var t,r=e.authOptions,n=e.systemOptions,o=e.loggerOptions,i=e.storageInterface,a=e.networkInterface,s=e.cryptoInterface,c=e.clientCredentials,u=e.libraryInfo,l=e.telemetry,d=e.serverTelemetryManager,h=e.persistencePlugin,p=e.serializableCache,g=y(y({},be),o);return{authOptions:(t=r,y({clientCapabilities:[],azureCloudOptions:Pe,skipAuthorityMetadataCache:!1},t)),systemOptions:y(y({},Se),n),loggerOptions:g,storageInterface:i||new ke(r.clientId,se,new he(g)),networkInterface:a||Ae,cryptoInterface:s||se,clientCredentials:c||Re,libraryInfo:y(y({},_e),u),telemetry:y(y({},Me),l),serverTelemetryManager:d||null,persistencePlugin:h||null,serializableCache:p||null}}(e),this.logger=new he(this.config.loggerOptions,pe,ge),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new Ue(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}return e.prototype.createTokenRequestHeaders=function(e){var t={};if(t[w.CONTENT_TYPE]=A.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Ne.HOME_ACCOUNT_ID:try{var r=Te(e.credential);t[w.CCS_HEADER]="Oid:"+r.uid+"@"+r.utid}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Ne.UPN:t[w.CCS_HEADER]="UPN: "+e.credential}return t},e.prototype.executePostToTokenEndpoint=function(e,t,r,n){return C(this,void 0,void 0,(function(){var o;return T(this,(function(i){switch(i.label){case 0:return[4,this.networkManager.sendPostRequest(n,e,{body:t,headers:r})];case 1:return o=i.sent(),this.config.serverTelemetryManager&&o.status<500&&429!==o.status&&this.config.serverTelemetryManager.clearTelemetryCache(),[2,o]}}))}))},e.prototype.updateAuthority=function(e){if(!e.discoveryComplete())throw ue.createEndpointDiscoveryIncompleteError("Updated authority has not completed endpoint discovery.");this.authority=e},e.prototype.createTokenQueryParameters=function(e){var t=new He;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},e}(),Fe=function(){function t(){}return t.prototype.generateAccountId=function(){return t.generateAccountIdForCacheKey(this.homeAccountId,this.environment)},t.prototype.generateCredentialId=function(){return t.generateCredentialIdForCacheKey(this.credentialType,this.clientId,this.realm,this.familyId)},t.prototype.generateTarget=function(){return t.generateTargetForCacheKey(this.target)},t.prototype.generateCredentialKey=function(){return t.generateCredentialCacheKey(this.homeAccountId,this.environment,this.credentialType,this.clientId,this.realm,this.target,this.familyId,this.tokenType,this.requestedClaimsHash)},t.prototype.generateType=function(){switch(this.credentialType){case x.ID_TOKEN:return L.ID_TOKEN;case x.ACCESS_TOKEN:case x.ACCESS_TOKEN_WITH_AUTH_SCHEME:return L.ACCESS_TOKEN;case x.REFRESH_TOKEN:return L.REFRESH_TOKEN;default:throw ue.createUnexpectedCredentialTypeError()}},t.generateCredentialCacheKey=function(e,t,r,n,o,i,a,s,c){return[this.generateAccountIdForCacheKey(e,t),this.generateCredentialIdForCacheKey(r,n,o,a),this.generateTargetForCacheKey(i),this.generateClaimsHashForCacheKey(c),this.generateSchemeForCacheKey(s)].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateAccountIdForCacheKey=function(e,t){return[e,t].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateCredentialIdForCacheKey=function(e,t,r,n){return[e,e===x.REFRESH_TOKEN&&n||t,r||A.EMPTY_STRING].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},t.generateTargetForCacheKey=function(e){return(e||A.EMPTY_STRING).toLowerCase()},t.generateClaimsHashForCacheKey=function(e){return(e||A.EMPTY_STRING).toLowerCase()},t.generateSchemeForCacheKey=function(t){return t&&t.toLowerCase()!==e.AuthenticationScheme.BEARER.toLowerCase()?t.toLowerCase():A.EMPTY_STRING},t}(),Ke=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.createIdTokenEntity=function(e,r,n,o,i){var a=new t;return a.credentialType=x.ID_TOKEN,a.homeAccountId=e,a.environment=r,a.clientId=o,a.secret=n,a.realm=i,a},t.isIdTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===x.ID_TOKEN)},t}(Fe),ze=function(){function e(){}return e.nowSeconds=function(){return Math.round((new Date).getTime()/1e3)},e.isTokenExpired=function(t,r){var n=Number(t)||0;return e.nowSeconds()+r>n},e.wasClockTurnedBack=function(t){return Number(t)>e.nowSeconds()},e.delay=function(e,t){return new Promise((function(r){return setTimeout((function(){return r(t)}),e)}))},e}(),Ge=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return v(r,t),r.createAccessTokenEntity=function(t,n,o,i,a,s,c,u,l,d,h,p,g,f,m){var v,y,C=new r;C.homeAccountId=t,C.credentialType=x.ACCESS_TOKEN,C.secret=o;var T=ze.nowSeconds();if(C.cachedAt=T.toString(),C.expiresOn=c.toString(),C.extendedExpiresOn=u.toString(),d&&(C.refreshOn=d.toString()),C.environment=n,C.clientId=i,C.realm=a,C.target=s,C.userAssertionHash=p,C.tokenType=le.isEmpty(h)?e.AuthenticationScheme.BEARER:h,f&&(C.requestedClaims=f,C.requestedClaimsHash=m),(null===(v=C.tokenType)||void 0===v?void 0:v.toLowerCase())!==e.AuthenticationScheme.BEARER.toLowerCase())switch(C.credentialType=x.ACCESS_TOKEN_WITH_AUTH_SCHEME,C.tokenType){case e.AuthenticationScheme.POP:var I=we.extractTokenClaims(o,l);if(!(null===(y=null==I?void 0:I.cnf)||void 0===y?void 0:y.kid))throw ue.createTokenClaimsRequiredError();C.keyId=I.cnf.kid;break;case e.AuthenticationScheme.SSH:C.keyId=g}return C},r.isAccessTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.hasOwnProperty("target")&&(e.credentialType===x.ACCESS_TOKEN||e.credentialType===x.ACCESS_TOKEN_WITH_AUTH_SCHEME))},r}(Fe),Qe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.createRefreshTokenEntity=function(e,r,n,o,i,a){var s=new t;return s.clientId=o,s.credentialType=x.REFRESH_TOKEN,s.environment=r,s.homeAccountId=e,s.secret=n,s.userAssertionHash=a,i&&(s.familyId=i),s},t.isRefreshTokenEntity=function(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")&&e.credentialType===x.REFRESH_TOKEN)},t}(Fe),je=["interaction_required","consent_required","login_required"],We=["message_only","additional_action","basic_action","user_password_expired","consent_required"],Ve={noTokensFoundError:{code:"no_tokens_found",desc:"No refresh token found in the cache. Please sign-in."},native_account_unavailable:{code:"native_account_unavailable",desc:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API."}},Ye=function(e){function t(r,n,o,i,a,s,c){var u=e.call(this,r,n,o)||this;return Object.setPrototypeOf(u,t.prototype),u.timestamp=i||A.EMPTY_STRING,u.traceId=a||A.EMPTY_STRING,u.correlationId=s||A.EMPTY_STRING,u.claims=c||A.EMPTY_STRING,u.name="InteractionRequiredAuthError",u}return v(t,e),t.isInteractionRequiredError=function(e,t,r){var n=!!e&&je.indexOf(e)>-1,o=!!r&&We.indexOf(r)>-1,i=!!t&&je.some((function(e){return t.indexOf(e)>-1}));return n||i||o},t.createNoTokensFoundError=function(){return new t(Ve.noTokensFoundError.code,Ve.noTokensFoundError.desc)},t.createNativeAccountUnavailableError=function(){return new t(Ve.native_account_unavailable.code,Ve.native_account_unavailable.desc)},t}(ae),$e=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null},Je=function(){function e(){}return e.setRequestState=function(t,r,n){var o=e.generateLibraryState(t,n);return le.isEmpty(r)?o:""+o+A.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t){if(!e)throw ue.createNoCryptoObjectError("generateLibraryState");var r={id:e.createNewGuid()};t&&(r.meta=t);var n=JSON.stringify(r);return e.base64Encode(n)},e.parseRequestState=function(e,t){if(!e)throw ue.createNoCryptoObjectError("parseRequestState");if(le.isEmpty(t))throw ue.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(A.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(A.RESOURCE_DELIM):A.EMPTY_STRING,i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:le.isEmpty(o)?A.EMPTY_STRING:o,libraryState:a}}catch(e){throw ue.createInvalidStateError(t,e)}},e}(),Xe=function(){function e(t){if(this._urlString=t,le.isEmpty(this._urlString))throw ve.createUrlEmptyError();le.isEmpty(this.getHash())&&(this._urlString=e.canonicalizeUri(t))}return Object.defineProperty(e.prototype,"urlString",{get:function(){return this._urlString},enumerable:!1,configurable:!0}),e.canonicalizeUri=function(e){if(e){var t=e.toLowerCase();return le.endsWith(t,"?")?t=t.slice(0,-1):le.endsWith(t,"?/")&&(t=t.slice(0,-2)),le.endsWith(t,"/")||(t+="/"),t}return e},e.prototype.validateAsUri=function(){var e;try{e=this.getUrlComponents()}catch(e){throw ve.createUrlParseError(e)}if(!e.HostNameAndPort||!e.PathSegments)throw ve.createUrlParseError("Given url string: "+this.urlString);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw ve.createInsecureAuthorityUriError(this.urlString)},e.appendQueryString=function(e,t){return le.isEmpty(t)?e:e.indexOf("?")<0?e+"?"+t:e+"&"+t},e.removeHashFromUrl=function(t){return e.canonicalizeUri(t.split("#")[0])},e.prototype.replaceTenantPath=function(t){var r=this.getUrlComponents(),n=r.PathSegments;return!t||0===n.length||n[0]!==k.COMMON&&n[0]!==k.ORGANIZATIONS||(n[0]=t),e.constructAuthorityUriFromObject(r)},e.prototype.getHash=function(){return e.parseHash(this.urlString)},e.prototype.getUrlComponents=function(){var e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw ve.createUrlParseError("Given url string: "+this.urlString);var r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]},n=r.AbsolutePath.split("/");return n=n.filter((function(e){return e&&e.length>0})),r.PathSegments=n,!le.isEmpty(r.QueryString)&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r},e.getDomainFromUrl=function(e){var t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw ve.createUrlParseError("Given url string: "+e);return r[2]},e.getAbsoluteUrl=function(t,r){if(t[0]===A.FORWARD_SLASH){var n=new e(r).getUrlComponents();return n.Protocol+"//"+n.HostNameAndPort+t}return t},e.parseHash=function(e){var t=e.indexOf("#"),r=e.indexOf("#/");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):A.EMPTY_STRING},e.parseQueryString=function(e){var t=e.indexOf("?"),r=e.indexOf("/?");return r>-1?e.substring(r+2):t>-1?e.substring(t+1):A.EMPTY_STRING},e.constructAuthorityUriFromObject=function(t){return new e(t.Protocol+"//"+t.HostNameAndPort+"/"+t.PathSegments.join("/"))},e.getDeserializedHash=function(t){if(le.isEmpty(t))return{};var r=e.parseHash(t),n=le.queryStringToObject(le.isEmpty(r)?t:r);if(!n)throw ue.createHashNotDeserializedError(JSON.stringify(n));return n},e.getDeserializedQueryString=function(t){if(le.isEmpty(t))return{};var r=e.parseQueryString(t),n=le.queryStringToObject(le.isEmpty(r)?t:r);if(!n)throw ue.createHashNotDeserializedError(JSON.stringify(n));return n},e.hashContainsKnownProperties=function(t){if(le.isEmpty(t)||t.indexOf("=")<0)return!1;var r=e.getDeserializedHash(t);return!!(r.code||r.error_description||r.error||r.state)},e}(); /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e.AcquireTokenByCode="acquireTokenByCode",e.AcquireTokenByRefreshToken="acquireTokenByRefreshToken",e.AcquireTokenSilent="acquireTokenSilent",e.AcquireTokenSilentAsync="acquireTokenSilentAsync",e.AcquireTokenPopup="acquireTokenPopup",e.CryptoOptsGetPublicKeyThumbprint="cryptoOptsGetPublicKeyThumbprint",e.CryptoOptsSignJwt="cryptoOptsSignJwt",e.SilentCacheClientAcquireToken="silentCacheClientAcquireToken",e.SilentIframeClientAcquireToken="silentIframeClientAcquireToken",e.SilentRefreshClientAcquireToken="silentRefreshClientAcquireToken",e.SsoSilent="ssoSilent",e.StandardInteractionClientGetDiscoveredAuthority="standardInteractionClientGetDiscoveredAuthority",e.FetchAccountIdWithNativeBroker="fetchAccountIdWithNativeBroker",e.NativeInteractionClientAcquireToken="nativeInteractionClientAcquireToken",e.BaseClientCreateTokenRequestHeaders="baseClientCreateTokenRequestHeaders",e.BrokerHandhshake="brokerHandshake",e.AcquireTokenByRefreshTokenInBroker="acquireTokenByRefreshTokenInBroker",e.AcquireTokenByBroker="acquireTokenByBroker",e.RefreshTokenClientExecuteTokenRequest="refreshTokenClientExecuteTokenRequest",e.RefreshTokenClientAcquireToken="refreshTokenClientAcquireToken",e.RefreshTokenClientAcquireTokenWithCachedRefreshToken="refreshTokenClientAcquireTokenWithCachedRefreshToken",e.RefreshTokenClientAcquireTokenByRefreshToken="refreshTokenClientAcquireTokenByRefreshToken",e.RefreshTokenClientCreateTokenRequestBody="refreshTokenClientCreateTokenRequestBody",e.AcquireTokenFromCache="acquireTokenFromCache",e.AcquireTokenBySilentIframe="acquireTokenBySilentIframe",e.InitializeBaseRequest="initializeBaseRequest",e.InitializeSilentRequest="initializeSilentRequest",e.InitializeClientApplication="initializeClientApplication",e.SilentIframeClientTokenHelper="silentIframeClientTokenHelper",e.SilentHandlerInitiateAuthRequest="silentHandlerInitiateAuthRequest",e.SilentHandlerMonitorIframeForHash="silentHandlerMonitorIframeForHash",e.SilentHandlerLoadFrame="silentHandlerLoadFrame",e.StandardInteractionClientCreateAuthCodeClient="standardInteractionClientCreateAuthCodeClient",e.StandardInteractionClientGetClientConfiguration="standardInteractionClientGetClientConfiguration",e.StandardInteractionClientInitializeAuthorizationRequest="standardInteractionClientInitializeAuthorizationRequest",e.StandardInteractionClientInitializeAuthorizationCodeRequest="standardInteractionClientInitializeAuthorizationCodeRequest",e.GetAuthCodeUrl="getAuthCodeUrl",e.HandleCodeResponseFromServer="handleCodeResponseFromServer",e.HandleCodeResponseFromHash="handleCodeResponseFromHash",e.UpdateTokenEndpointAuthority="updateTokenEndpointAuthority",e.AuthClientAcquireToken="authClientAcquireToken",e.AuthClientExecuteTokenRequest="authClientExecuteTokenRequest",e.AuthClientCreateTokenRequestBody="authClientCreateTokenRequestBody",e.AuthClientCreateQueryString="authClientCreateQueryString",e.PopTokenGenerateCnf="popTokenGenerateCnf",e.PopTokenGenerateKid="popTokenGenerateKid",e.HandleServerTokenResponse="handleServerTokenResponse",e.AuthorityFactoryCreateDiscoveredInstance="authorityFactoryCreateDiscoveredInstance",e.AuthorityResolveEndpointsAsync="authorityResolveEndpointsAsync",e.AuthorityGetCloudDiscoveryMetadataFromNetwork="authorityGetCloudDiscoveryMetadataFromNetwork",e.AuthorityUpdateCloudDiscoveryMetadata="authorityUpdateCloudDiscoveryMetadata",e.AuthorityGetEndpointMetadataFromNetwork="authorityGetEndpointMetadataFromNetwork",e.AuthorityUpdateEndpointMetadata="authorityUpdateEndpointMetadata",e.AuthorityUpdateMetadataWithRegionalInformation="authorityUpdateMetadataWithRegionalInformation",e.RegionDiscoveryDetectRegion="regionDiscoveryDetectRegion",e.RegionDiscoveryGetRegionFromIMDS="regionDiscoveryGetRegionFromIMDS",e.RegionDiscoveryGetCurrentVersion="regionDiscoveryGetCurrentVersion",e.AcquireTokenByCodeAsync="acquireTokenByCodeAsync",e.GetEndpointMetadataFromNetwork="getEndpointMetadataFromNetwork",e.GetCloudDiscoveryMetadataFromNetworkMeasurement="getCloudDiscoveryMetadataFromNetworkMeasurement",e.HandleRedirectPromiseMeasurement="handleRedirectPromiseMeasurement",e.UpdateCloudDiscoveryMetadataMeasurement="updateCloudDiscoveryMetadataMeasurement",e.UsernamePasswordClientAcquireToken="usernamePasswordClientAcquireToken",e.NativeMessageHandlerHandshake="nativeMessageHandlerHandshake"}(xe||(xe={})),function(e){e[e.NotStarted=0]="NotStarted",e[e.InProgress=1]="InProgress",e[e.Completed=2]="Completed"}(Le||(Le={}));var Ze,et=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status"]); /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e.SW="sw",e.UHW="uhw"}(Ze||(Ze={}));var tt=function(){function e(e,t){this.cryptoUtils=e,this.performanceClient=t}return e.prototype.generateCnf=function(e){var t,r;return C(this,void 0,void 0,(function(){var n,o,i;return T(this,(function(a){switch(a.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.PopTokenGenerateCnf,e.correlationId),null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.PopTokenGenerateKid,e.correlationId),[4,this.generateKid(e)];case 1:return n=a.sent(),o=this.cryptoUtils.base64Encode(JSON.stringify(n)),i={kid:n.kid,reqCnfString:o},[4,this.cryptoUtils.hashString(o)];case 2:return[2,(i.reqCnfHash=a.sent(),i)]}}))}))},e.prototype.generateKid=function(e){var t;return C(this,void 0,void 0,(function(){return T(this,(function(r){switch(r.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.PopTokenGenerateKid,e.correlationId),[4,this.cryptoUtils.getPublicKeyThumbprint(e)];case 1:return[2,{kid:r.sent(),xms_ksl:Ze.SW}]}}))}))},e.prototype.signPopToken=function(e,t,r){return C(this,void 0,void 0,(function(){return T(this,(function(n){return[2,this.signPayload(e,t,r)]}))}))},e.prototype.signPayload=function(e,t,r,n){return C(this,void 0,void 0,(function(){var o,i,a,s,c,u;return T(this,(function(l){switch(l.label){case 0:return o=r.resourceRequestMethod,i=r.resourceRequestUri,a=r.shrClaims,s=r.shrNonce,c=i?new Xe(i):void 0,u=null==c?void 0:c.getUrlComponents(),[4,this.cryptoUtils.signJwt(y({at:e,ts:ze.nowSeconds(),m:null==o?void 0:o.toUpperCase(),u:null==u?void 0:u.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:null==u?void 0:u.AbsolutePath,q:(null==u?void 0:u.QueryString)?[[],u.QueryString]:void 0,client_claims:a||void 0},n),t,r.correlationId)];case 1:return[2,l.sent()]}}))}))},e}(),rt=function(){function e(){}return e.prototype.generateAppMetadataKey=function(){return e.generateAppMetadataCacheKey(this.environment,this.clientId)},e.generateAppMetadataCacheKey=function(e,t){return[D,e,t].join(U.CACHE_KEY_SEPARATOR).toLowerCase()},e.createAppMetadataEntity=function(t,r,n){var o=new e;return o.clientId=t,o.environment=r,n&&(o.familyId=n),o},e.isAppMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(D)&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("environment"))},e}(),nt=function(){function e(e,t){this.cache=e,this.hasChanged=t}return Object.defineProperty(e.prototype,"cacheHasChanged",{get:function(){return this.hasChanged},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tokenCache",{get:function(){return this.cache},enumerable:!1,configurable:!0}),e}(),ot=function(){function t(e,t,r,n,o,i,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i,this.performanceClient=a}return t.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?ue.createStateNotFoundError("Cached State"):ue.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw ue.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(Ye.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Ye(e.error||A.EMPTY_STRING,e.error_description,e.suberror,e.timestamp||A.EMPTY_STRING,e.trace_id||A.EMPTY_STRING,e.correlation_id||A.EMPTY_STRING,e.claims||A.EMPTY_STRING);throw new Oe(e.error||A.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&Ce(e.client_info,r)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(Ye.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Ye(e.error,e.error_description,e.suberror,e.timestamp||A.EMPTY_STRING,e.trace_id||A.EMPTY_STRING,e.correlation_id||A.EMPTY_STRING,e.claims||A.EMPTY_STRING);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Oe(e.error,t,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,o,i,a,s,c,u){var l;return C(this,void 0,void 0,(function(){var d,h,p,g,f,m;return T(this,(function(v){switch(v.label){case 0:if(null===(l=this.performanceClient)||void 0===l||l.addQueueMeasurement(xe.HandleServerTokenResponse,e.correlation_id),e.id_token){if(d=new we(e.id_token||A.EMPTY_STRING,this.cryptoObj),i&&!le.isEmpty(i.nonce)&&d.claims.nonce!==i.nonce)throw ue.createNonceMismatchError();if(o.maxAge||0===o.maxAge){if(!(h=d.claims.auth_time))throw ue.createAuthTimeNotFoundError();we.checkMaxAge(h,o.maxAge)}}this.homeAccountIdentifier=Ie.generateHomeAccountId(e.client_info||A.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,d),i&&i.state&&(p=Je.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0,g=this.generateCacheRecord(e,r,n,o,d,a,i),v.label=1;case 1:return v.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),f=new nt(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(f)]):[3,3];case 2:v.sent(),v.label=3;case 3:return!s||c||!g.account||(m=g.account.generateAccountKey(),this.cacheStorage.getAccount(m))?[4,this.cacheStorage.saveCacheRecord(g)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,d,p,void 0,u)]);case 4:return v.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&f?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(f)]):[3,7];case 6:v.sent(),v.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,g,!1,o,d,p,e,u)]}}))}))},t.prototype.generateCacheRecord=function(e,t,r,n,o,i,a){var s,c,u=t.getPreferredCache();if(le.isEmpty(u))throw ue.createInvalidCacheEnvironmentError();!le.isEmpty(e.id_token)&&o&&(s=Ke.createIdTokenEntity(this.homeAccountIdentifier,u,e.id_token||A.EMPTY_STRING,this.clientId,o.claims.tid||A.EMPTY_STRING),c=this.generateAccountEntity(e,o,t,a));var l=null;if(!le.isEmpty(e.access_token)){var d=e.scope?ye.fromString(e.scope):new ye(n.scopes||[]),h=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,p=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,g=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,f=r+h,m=f+p,v=g&&g>0?r+g:void 0;l=Ge.createAccessTokenEntity(this.homeAccountIdentifier,u,e.access_token||A.EMPTY_STRING,this.clientId,o?o.claims.tid||A.EMPTY_STRING:t.tenant,d.printScopes(),f,m,this.cryptoObj,v,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}var y=null;le.isEmpty(e.refresh_token)||(y=Qe.createRefreshTokenEntity(this.homeAccountIdentifier,u,e.refresh_token||A.EMPTY_STRING,this.clientId,e.foci,i));var C=null;return le.isEmpty(e.foci)||(C=rt.createAppMetadataEntity(this.clientId,u,e.foci)),new $e(c,s,l,y,C)},t.prototype.generateAccountEntity=function(e,t,r,n){var o=r.authorityType,i=n?n.cloud_graph_host_name:A.EMPTY_STRING,a=n?n.msgraph_host:A.EMPTY_STRING;if(o===fe.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Ie.createGenericAccount(this.homeAccountIdentifier,t,r,i,a);if(le.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw ue.createClientInfoEmptyError();return e.client_info?Ie.createAccount(e.client_info,this.homeAccountIdentifier,t,r,i,a):Ie.createGenericAccount(this.homeAccountIdentifier,t,r,i,a)},t.generateAuthenticationResult=function(t,r,n,o,i,a,s,c,u){var l,d,h;return C(this,void 0,void 0,(function(){var p,g,f,m,v,y,C,I,w,E,k;return T(this,(function(T){switch(T.label){case 0:if(p=A.EMPTY_STRING,g=[],f=null,v=A.EMPTY_STRING,!n.accessToken)return[3,4];if(n.accessToken.tokenType!==e.AuthenticationScheme.POP)return[3,2];if(y=new tt(t),C=n.accessToken,I=C.secret,!(w=C.keyId))throw ue.createKeyIdMissingError();return[4,y.signPopToken(I,w,i)];case 1:return p=T.sent(),[3,3];case 2:p=n.accessToken.secret,T.label=3;case 3:g=ye.fromString(n.accessToken.target).asArray(),f=new Date(1e3*Number(n.accessToken.expiresOn)),m=new Date(1e3*Number(n.accessToken.extendedExpiresOn)),T.label=4;case 4:return n.appMetadata&&(v=n.appMetadata.familyId===F?F:A.EMPTY_STRING),E=(null==a?void 0:a.claims.oid)||(null==a?void 0:a.claims.sub)||A.EMPTY_STRING,k=(null==a?void 0:a.claims.tid)||A.EMPTY_STRING,(null==c?void 0:c.spa_accountid)&&n.account&&(n.account.nativeAccountId=null==c?void 0:c.spa_accountid),[2,{authority:r.canonicalAuthority,uniqueId:E,tenantId:k,scopes:g,account:n.account?n.account.getAccountInfo():null,idToken:a?a.rawToken:A.EMPTY_STRING,idTokenClaims:a?a.claims:{},accessToken:p,fromCache:o,expiresOn:f,correlationId:i.correlationId,requestId:u||A.EMPTY_STRING,extExpiresOn:m,familyId:v,tokenType:(null===(l=n.accessToken)||void 0===l?void 0:l.tokenType)||A.EMPTY_STRING,state:s?s.userRequestState:A.EMPTY_STRING,cloudGraphHostName:(null===(d=n.account)||void 0===d?void 0:d.cloudGraphHostName)||A.EMPTY_STRING,msGraphHost:(null===(h=n.account)||void 0===h?void 0:h.msGraphHost)||A.EMPTY_STRING,code:null==c?void 0:c.spa_code,fromNativeBroker:!1}]}}))}))},t}(),it=function(t){function r(e,r){var n=t.call(this,e,r)||this;return n.includeRedirectUri=!0,n}return v(r,t),r.prototype.getAuthCodeUrl=function(e){var t,r;return C(this,void 0,void 0,(function(){var n;return T(this,(function(o){switch(o.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.GetAuthCodeUrl,e.correlationId),null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.AuthClientCreateQueryString,e.correlationId),[4,this.createAuthCodeUrlQueryString(e)];case 1:return n=o.sent(),[2,Xe.appendQueryString(this.authority.authorizationEndpoint,n)]}}))}))},r.prototype.acquireToken=function(e,t){var r,n,o,i,a,s;return C(this,void 0,void 0,(function(){var c,u,l,d,h,p,g=this;return T(this,(function(f){switch(f.label){case 0:if(!e||!e.code)throw ue.createTokenRequestCannotBeMadeError();return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.AuthClientAcquireToken,e.correlationId),c=null===(n=this.performanceClient)||void 0===n?void 0:n.startMeasurement("AuthCodeClientAcquireToken",e.correlationId),this.logger.info("in acquireToken call in auth-code client"),u=ze.nowSeconds(),null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.AuthClientExecuteTokenRequest,e.correlationId),[4,this.executeTokenRequest(this.authority,e)];case 1:return l=f.sent(),d=null===(i=l.headers)||void 0===i?void 0:i[w.X_MS_REQUEST_ID],(h=null===(a=l.headers)||void 0===a?void 0:a[w.X_MS_HTTP_VERSION])&&(null==c||c.addStaticFields({httpVerAuthority:h})),(p=new ot(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient)).validateTokenResponse(l.body),null===(s=this.performanceClient)||void 0===s||s.setPreQueueTime(xe.HandleServerTokenResponse,e.correlationId),[2,p.handleServerTokenResponse(l.body,this.authority,u,e,t,void 0,void 0,void 0,d).then((function(e){return null==c||c.endMeasurement({success:!0}),e})).catch((function(t){throw g.logger.verbose("Error in fetching token in ACC",e.correlationId),null==c||c.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t}))]}}))}))},r.prototype.handleFragmentResponse=function(e,t){var r=new ot(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null),n=new Xe(e),o=Xe.getDeserializedHash(n.getHash());if(r.validateServerAuthorizationCodeResponse(o,t,this.cryptoUtils),!o.code)throw ue.createNoAuthCodeInServerResponseError();return y(y({},o),{code:o.code})},r.prototype.getLogoutUri=function(e){if(!e)throw ve.createEmptyLogoutRequestError();var t=this.createLogoutUrlQueryString(e);return Xe.appendQueryString(this.authority.endSessionEndpoint,t)},r.prototype.executeTokenRequest=function(e,t){var r,n;return C(this,void 0,void 0,(function(){var o,i,a,s,c,u,l;return T(this,(function(d){switch(d.label){case 0:return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.AuthClientExecuteTokenRequest,t.correlationId),null===(n=this.performanceClient)||void 0===n||n.setPreQueueTime(xe.AuthClientCreateTokenRequestBody,t.correlationId),o=this.createTokenQueryParameters(t),i=Xe.appendQueryString(e.tokenEndpoint,o),[4,this.createTokenRequestBody(t)];case 1:if(a=d.sent(),s=void 0,t.clientInfo)try{c=Ce(t.clientInfo,this.cryptoUtils),s={credential:""+c.uid+U.CLIENT_INFO_SEPARATOR+c.utid,type:Ne.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return u=this.createTokenRequestHeaders(s||t.ccsCredential),l={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[2,this.executePostToTokenEndpoint(i,a,u,l)]}}))}))},r.prototype.createTokenRequestBody=function(t){var r,n;return C(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,d;return T(this,(function(h){switch(h.label){case 0:return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.AuthClientCreateTokenRequestBody,t.correlationId),(o=new He).addClientId(this.config.authOptions.clientId),this.includeRedirectUri?o.addRedirectUri(t.redirectUri):Be.validateRedirectUri(t.redirectUri),o.addScopes(t.scopes),o.addAuthorizationCode(t.code),o.addLibraryInfo(this.config.libraryInfo),o.addApplicationTelemetry(this.config.telemetry.application),o.addThrottling(),this.serverTelemetryManager&&o.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&o.addCodeVerifier(t.codeVerifier),this.config.clientCredentials.clientSecret&&o.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(i=this.config.clientCredentials.clientAssertion,o.addClientAssertion(i.assertion),o.addClientAssertionType(i.assertionType)),o.addGrantType(O.AUTHORIZATION_CODE_GRANT),o.addClientInfo(),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:(a=new tt(this.cryptoUtils,this.performanceClient),null===(n=this.performanceClient)||void 0===n||n.setPreQueueTime(xe.PopTokenGenerateCnf,t.correlationId),[4,a.generateCnf(t)]);case 1:return s=h.sent(),o.addPopToken(s.reqCnfString),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ve.createMissingSshJwkError();o.addSshJwk(t.sshJwk)}h.label=3;case 3:if(c=t.correlationId||this.config.cryptoInterface.createNewGuid(),o.addCorrelationId(c),(!le.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&o.addClaims(t.claims,this.config.authOptions.clientCapabilities),u=void 0,t.clientInfo)try{l=Ce(t.clientInfo,this.cryptoUtils),u={credential:""+l.uid+U.CLIENT_INFO_SEPARATOR+l.utid,type:Ne.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else u=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&u)switch(u.type){case Ne.HOME_ACCOUNT_ID:try{l=Te(u.credential),o.addCcsOid(l)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Ne.UPN:o.addCcsUpn(u.credential)}return t.tokenBodyParameters&&o.addExtraQueryParameters(t.tokenBodyParameters),!t.enableSpaAuthorizationCode||t.tokenBodyParameters&&t.tokenBodyParameters[S.RETURN_SPA_CODE]||o.addExtraQueryParameters(((d={})[S.RETURN_SPA_CODE]="1",d)),[2,o.createQueryString()]}}))}))},r.prototype.createAuthCodeUrlQueryString=function(t){var r;return C(this,void 0,void 0,(function(){var n,o,i,a,s,c,u;return T(this,(function(l){switch(l.label){case 0:if(null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.AuthClientCreateQueryString,t.correlationId),(n=new He).addClientId(this.config.authOptions.clientId),o=I(t.scopes||[],t.extraScopesToConsent||[]),n.addScopes(o),n.addRedirectUri(t.redirectUri),i=t.correlationId||this.config.cryptoInterface.createNewGuid(),n.addCorrelationId(i),n.addResponseMode(t.responseMode),n.addResponseTypeCode(),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addClientInfo(),t.codeChallenge&&t.codeChallengeMethod&&n.addCodeChallengeParams(t.codeChallenge,t.codeChallengeMethod),t.prompt&&n.addPrompt(t.prompt),t.domainHint&&n.addDomainHint(t.domainHint),t.prompt!==M.SELECT_ACCOUNT)if(t.sid&&t.prompt===M.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),n.addSid(t.sid);else if(t.account){if(a=this.extractAccountSid(t.account),s=this.extractLoginHint(t.account)){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),n.addLoginHint(s);try{c=Te(t.account.homeAccountId),n.addCcsOid(c)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(a&&t.prompt===M.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),n.addSid(a);try{c=Te(t.account.homeAccountId),n.addCcsOid(c)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(t.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),n.addLoginHint(t.loginHint),n.addCcsUpn(t.loginHint);else if(t.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),n.addLoginHint(t.account.username);try{c=Te(t.account.homeAccountId),n.addCcsOid(c)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else t.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),n.addLoginHint(t.loginHint),n.addCcsUpn(t.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return t.nonce&&n.addNonce(t.nonce),t.state&&n.addState(t.state),(!le.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(t.claims,this.config.authOptions.clientCapabilities),t.extraQueryParameters&&n.addExtraQueryParameters(t.extraQueryParameters),t.nativeBroker?(n.addNativeBroker(),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:[4,new tt(this.cryptoUtils).generateCnf(t)]):[3,2];case 1:u=l.sent(),n.addPopToken(u.reqCnfHash),l.label=2;case 2:return[2,n.createQueryString()]}}))}))},r.prototype.createLogoutUrlQueryString=function(e){var t=new He;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.createQueryString()},r.prototype.extractAccountSid=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.sid)||null},r.prototype.extractLoginHint=function(e){var t;return(null===(t=e.idTokenClaims)||void 0===t?void 0:t.login_hint)||null},r}(De),at=function(t){function r(e,r){return t.call(this,e,r)||this}return v(r,t),r.prototype.acquireToken=function(e){var t,r,n,o,i,a,s;return C(this,void 0,void 0,(function(){var c,u,l,d,h,p,g=this;return T(this,(function(f){switch(f.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.RefreshTokenClientAcquireToken,e.correlationId),c=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(xe.RefreshTokenClientAcquireToken,e.correlationId),this.logger.verbose("RefreshTokenClientAcquireToken called",e.correlationId),u=ze.nowSeconds(),null===(n=this.performanceClient)||void 0===n||n.setPreQueueTime(xe.RefreshTokenClientExecuteTokenRequest,e.correlationId),[4,this.executeTokenRequest(e,this.authority)];case 1:return l=f.sent(),d=null===(o=l.headers)||void 0===o?void 0:o[w.X_MS_HTTP_VERSION],null==c||c.addStaticFields({refreshTokenSize:(null===(i=l.body.refresh_token)||void 0===i?void 0:i.length)||0}),d&&(null==c||c.addStaticFields({httpVerToken:d})),h=null===(a=l.headers)||void 0===a?void 0:a[w.X_MS_REQUEST_ID],(p=new ot(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(l.body),null===(s=this.performanceClient)||void 0===s||s.setPreQueueTime(xe.HandleServerTokenResponse,e.correlationId),[2,p.handleServerTokenResponse(l.body,this.authority,u,e,void 0,void 0,!0,e.forceCache,h).then((function(e){return null==c||c.endMeasurement({success:!0}),e})).catch((function(t){throw g.logger.verbose("Error in fetching refresh token",e.correlationId),null==c||c.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t}))]}}))}))},r.prototype.acquireTokenByRefreshToken=function(e){var t,r,n,o;return C(this,void 0,void 0,(function(){var i,a;return T(this,(function(s){if(!e)throw ve.createEmptyTokenRequestError();if(null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw ue.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId),[2,this.acquireTokenWithCachedRefreshToken(e,!0)]}catch(t){if(i=t instanceof Ye&&t.errorCode===Ve.noTokensFoundError.code,a=t instanceof Oe&&t.errorCode===re&&t.subError===ne,i||a)return null===(n=this.performanceClient)||void 0===n||n.setPreQueueTime(xe.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId),[2,this.acquireTokenWithCachedRefreshToken(e,!1)];throw t}return null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId),[2,this.acquireTokenWithCachedRefreshToken(e,!1)]}))}))},r.prototype.acquireTokenWithCachedRefreshToken=function(t,r){var n,o,i;return C(this,void 0,void 0,(function(){var a,s,c;return T(this,(function(u){if(null===(n=this.performanceClient)||void 0===n||n.addQueueMeasurement(xe.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),a=null===(o=this.performanceClient)||void 0===o?void 0:o.startMeasurement(xe.RefreshTokenClientAcquireTokenWithCachedRefreshToken,t.correlationId),this.logger.verbose("RefreshTokenClientAcquireTokenWithCachedRefreshToken called",t.correlationId),!(s=this.cacheManager.getRefreshToken(t.account,r)))throw null==a||a.discardMeasurement(),Ye.createNoTokensFoundError();return null==a||a.endMeasurement({success:!0}),c=y(y({},t),{refreshToken:s.secret,authenticationScheme:t.authenticationScheme||e.AuthenticationScheme.BEARER,ccsCredential:{credential:t.account.homeAccountId,type:Ne.HOME_ACCOUNT_ID}}),null===(i=this.performanceClient)||void 0===i||i.setPreQueueTime(xe.RefreshTokenClientAcquireToken,t.correlationId),[2,this.acquireToken(c)]}))}))},r.prototype.executeTokenRequest=function(e,t){var r,n,o;return C(this,void 0,void 0,(function(){var i,a,s,c,u,l;return T(this,(function(d){switch(d.label){case 0:return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.RefreshTokenClientExecuteTokenRequest,e.correlationId),i=null===(n=this.performanceClient)||void 0===n?void 0:n.startMeasurement(xe.RefreshTokenClientExecuteTokenRequest,e.correlationId),null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.RefreshTokenClientCreateTokenRequestBody,e.correlationId),a=this.createTokenQueryParameters(e),s=Xe.appendQueryString(t.tokenEndpoint,a),[4,this.createTokenRequestBody(e)];case 1:return c=d.sent(),u=this.createTokenRequestHeaders(e.ccsCredential),l={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},[2,this.executePostToTokenEndpoint(s,c,u,l).then((function(e){return null==i||i.endMeasurement({success:!0}),e})).catch((function(e){throw null==i||i.endMeasurement({success:!1}),e}))]}}))}))},r.prototype.createTokenRequestBody=function(t){var r,n,o;return C(this,void 0,void 0,(function(){var i,a,s,c,u,l,d;return T(this,(function(h){switch(h.label){case 0:return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.RefreshTokenClientCreateTokenRequestBody,t.correlationId),i=t.correlationId,a=null===(n=this.performanceClient)||void 0===n?void 0:n.startMeasurement(xe.BaseClientCreateTokenRequestHeaders,i),(s=new He).addClientId(this.config.authOptions.clientId),s.addScopes(t.scopes),s.addGrantType(O.REFRESH_TOKEN_GRANT),s.addClientInfo(),s.addLibraryInfo(this.config.libraryInfo),s.addApplicationTelemetry(this.config.telemetry.application),s.addThrottling(),this.serverTelemetryManager&&s.addServerTelemetry(this.serverTelemetryManager),s.addCorrelationId(i),s.addRefreshToken(t.refreshToken),this.config.clientCredentials.clientSecret&&s.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion&&(c=this.config.clientCredentials.clientAssertion,s.addClientAssertion(c.assertion),s.addClientAssertionType(c.assertionType)),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:(u=new tt(this.cryptoUtils,this.performanceClient),null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.PopTokenGenerateCnf,t.correlationId),[4,u.generateCnf(t)]);case 1:return l=h.sent(),s.addPopToken(l.reqCnfString),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw null==a||a.endMeasurement({success:!1}),ve.createMissingSshJwkError();s.addSshJwk(t.sshJwk)}h.label=3;case 3:if((!le.isEmptyObj(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&s.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case Ne.HOME_ACCOUNT_ID:try{d=Te(t.ccsCredential.credential),s.addCcsOid(d)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Ne.UPN:s.addCcsUpn(t.ccsCredential.credential)}return null==a||a.endMeasurement({success:!0}),[2,s.createQueryString()]}}))}))},r}(De),st=function(e){function t(t,r){return e.call(this,t,r)||this}return v(t,e),t.prototype.acquireToken=function(e){return C(this,void 0,void 0,(function(){var t;return T(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.acquireCachedToken(e)];case 1:return[2,r.sent()];case 2:if((t=r.sent())instanceof ue&&t.errorCode===ce.tokenRefreshRequired.code)return[2,new at(this.config,this.performanceClient).acquireTokenByRefreshToken(e)];throw t;case 3:return[2]}}))}))},t.prototype.acquireCachedToken=function(e){var t,r,n,o;return C(this,void 0,void 0,(function(){var i,a;return T(this,(function(s){switch(s.label){case 0:if(!e)throw ve.createEmptyTokenRequestError();if(e.forceRefresh)throw null===(t=this.serverTelemetryManager)||void 0===t||t.setCacheOutcome($.FORCE_REFRESH),this.logger.info("SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true."),ue.createRefreshRequiredError();if(!e.account)throw ue.createNoAccountInSilentRequestError();if(i=e.authority||this.authority.getPreferredCache(),!(a=this.cacheManager.readCacheRecord(e.account,e,i)).accessToken)throw null===(r=this.serverTelemetryManager)||void 0===r||r.setCacheOutcome($.NO_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties."),ue.createRefreshRequiredError();if(ze.wasClockTurnedBack(a.accessToken.cachedAt)||ze.isTokenExpired(a.accessToken.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw null===(n=this.serverTelemetryManager)||void 0===n||n.setCacheOutcome($.CACHED_ACCESS_TOKEN_EXPIRED),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within "+this.config.systemOptions.tokenRenewalOffsetSeconds+" seconds."),ue.createRefreshRequiredError();if(a.accessToken.refreshOn&&ze.isTokenExpired(a.accessToken.refreshOn,0))throw null===(o=this.serverTelemetryManager)||void 0===o||o.setCacheOutcome($.REFRESH_CACHED_ACCESS_TOKEN),this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'."),ue.createRefreshRequiredError();return this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[4,this.generateResultFromCacheRecord(a,e)];case 1:return[2,s.sent()]}}))}))},t.prototype.generateResultFromCacheRecord=function(e,t){return C(this,void 0,void 0,(function(){var r,n;return T(this,(function(o){switch(o.label){case 0:if(e.idToken&&(r=new we(e.idToken.secret,this.config.cryptoInterface)),t.maxAge||0===t.maxAge){if(!(n=null==r?void 0:r.claims.auth_time))throw ue.createAuthTimeNotFoundError();we.checkMaxAge(n,t.maxAge)}return[4,ot.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)];case 1:return[2,o.sent()]}}))}))},t}(De); /*! @azure/msal-common v13.0.0 2023-05-02 */ /*! @azure/msal-common v13.0.0 2023-05-02 */ function ct(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")} /*! @azure/msal-common v13.0.0 2023-05-02 */var ut,lt={"https://login.microsoftonline.com/common/":{token_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/common/":{token_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/common/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/common/":{token_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/common/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/common/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/common/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/consumers/":{token_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/consumers/":{token_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/consumers/":{token_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/consumers/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/consumers/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"},"https://login.microsoftonline.com/organizations/":{token_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.com/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.com/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.com",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pas.windows.net"},"https://login.chinacloudapi.cn/organizations/":{token_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo",authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.chinacloudapi.cn/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"partner.microsoftonline.cn",cloud_graph_host_name:"graph.chinacloudapi.cn",msgraph_host:"microsoftgraph.chinacloudapi.cn",rbac_url:"https://pas.chinacloudapi.cn"},"https://login.microsoftonline.us/organizations/":{token_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/token",token_endpoint_auth_methods_supported:["client_secret_post","private_key_jwt","client_secret_basic"],jwks_uri:"https://login.microsoftonline.us/organizations/discovery/v2.0/keys",response_modes_supported:["query","fragment","form_post"],subject_types_supported:["pairwise"],id_token_signing_alg_values_supported:["RS256"],response_types_supported:["code","id_token","code id_token","id_token token"],scopes_supported:["openid","profile","email","offline_access"],issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",request_uri_parameter_supported:!1,userinfo_endpoint:"https://graph.microsoft.com/oidc/userinfo",authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize",device_authorization_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode",http_logout_supported:!0,frontchannel_logout_supported:!0,end_session_endpoint:"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout",claims_supported:["sub","iss","cloud_instance_name","cloud_instance_host_name","cloud_graph_host_name","msgraph_host","aud","exp","iat","auth_time","acr","nonce","preferred_username","name","tid","ver","at_hash","c_hash","email"],kerberos_endpoint:"https://login.microsoftonline.us/organizations/kerberos",tenant_region_scope:null,cloud_instance_name:"microsoftonline.us",cloud_graph_host_name:"graph.windows.net",msgraph_host:"graph.microsoft.com",rbac_url:"https://pasff.usgovcloudapi.net"}},dt={"https://login.microsoftonline.com/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/common/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/common/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/consumers/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/consumers/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.com/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.chinacloudapi.cn/organizations/":{tenant_discovery_endpoint:"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},"https://login.microsoftonline.us/organizations/":{tenant_discovery_endpoint:"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration","api-version":"1.1",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]}}; /*! @azure/msal-common v13.0.0 2023-05-02 */ e.ProtocolMode=void 0,(ut=e.ProtocolMode||(e.ProtocolMode={})).AAD="AAD",ut.OIDC="OIDC"; /*! @azure/msal-common v13.0.0 2023-05-02 */ var ht=function(){function e(){this.expiresAt=ze.nowSeconds()+z}return e.prototype.updateCloudDiscoveryMetadata=function(e,t){this.aliases=e.aliases,this.preferred_cache=e.preferred_cache,this.preferred_network=e.preferred_network,this.aliasesFromNetwork=t},e.prototype.updateEndpointMetadata=function(e,t){this.authorization_endpoint=e.authorization_endpoint,this.token_endpoint=e.token_endpoint,this.end_session_endpoint=e.end_session_endpoint,this.issuer=e.issuer,this.endpointsFromNetwork=t,this.jwks_uri=e.jwks_uri},e.prototype.updateCanonicalAuthority=function(e){this.canonical_authority=e},e.prototype.resetExpiresAt=function(){this.expiresAt=ze.nowSeconds()+z},e.prototype.isExpired=function(){return this.expiresAt<=ze.nowSeconds()},e.isAuthorityMetadataEntity=function(e,t){return!!t&&(0===e.indexOf(K)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri"))},e}(); /*! @azure/msal-common v13.0.0 2023-05-02 */ /*! @azure/msal-common v13.0.0 2023-05-02 */ var pt,gt,ft,mt,vt,yt,Ct,Tt,It,wt=function(){function e(e,t,r){this.networkInterface=e,this.performanceClient=t,this.correlationId=r}return e.prototype.detectRegion=function(t,r){var n,o,i,a;return C(this,void 0,void 0,(function(){var s,c,u,l,d;return T(this,(function(h){switch(h.label){case 0:if(null===(n=this.performanceClient)||void 0===n||n.addQueueMeasurement(xe.RegionDiscoveryDetectRegion,this.correlationId),s=t)return[3,8];c=e.IMDS_OPTIONS,h.label=1;case 1:return h.trys.push([1,6,,7]),null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(A.IMDS_VERSION,c)];case 2:return(u=h.sent()).status===W.httpSuccess&&(s=u.body,r.region_source=V.IMDS),u.status!==W.httpBadRequest?[3,5]:(null===(i=this.performanceClient)||void 0===i||i.setPreQueueTime(xe.RegionDiscoveryGetCurrentVersion,this.correlationId),[4,this.getCurrentVersion(c)]);case 3:return(l=h.sent())?(null===(a=this.performanceClient)||void 0===a||a.setPreQueueTime(xe.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[4,this.getRegionFromIMDS(l,c)]):(r.region_source=V.FAILED_AUTO_DETECTION,[2,null]);case 4:(d=h.sent()).status===W.httpSuccess&&(s=d.body,r.region_source=V.IMDS),h.label=5;case 5:return[3,7];case 6:return h.sent(),r.region_source=V.FAILED_AUTO_DETECTION,[2,null];case 7:return[3,9];case 8:r.region_source=V.ENVIRONMENT_VARIABLE,h.label=9;case 9:return s||(r.region_source=V.FAILED_AUTO_DETECTION),[2,s||null]}}))}))},e.prototype.getRegionFromIMDS=function(e,t){var r;return C(this,void 0,void 0,(function(){return T(this,(function(n){return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.RegionDiscoveryGetRegionFromIMDS,this.correlationId),[2,this.networkInterface.sendGetRequestAsync(A.IMDS_ENDPOINT+"?api-version="+e+"&format=text",t,A.IMDS_TIMEOUT)]}))}))},e.prototype.getCurrentVersion=function(e){var t;return C(this,void 0,void 0,(function(){var r;return T(this,(function(n){switch(n.label){case 0:null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.RegionDiscoveryGetCurrentVersion,this.correlationId),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(A.IMDS_ENDPOINT+"?format=json",e)];case 2:return(r=n.sent()).status===W.httpBadRequest&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?[2,r.body["newest-versions"][0]]:[2,null];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},e.IMDS_OPTIONS={headers:{Metadata:"true"}},e}(),Et=function(){function t(e,t,r,n,o,i,a){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=i,this.correlationId=a,this.regionDiscovery=new wt(t,this.performanceClient,this.correlationId)}return Object.defineProperty(t.prototype,"authorityType",{get:function(){if(this.canonicalAuthorityUrlComponents.HostNameAndPort.endsWith(A.CIAM_AUTH_URL))return fe.Ciam;var e=this.canonicalAuthorityUrlComponents.PathSegments;if(e.length)switch(e[0].toLowerCase()){case A.ADFS:return fe.Adfs;case A.DSTS:return fe.Dsts}return fe.Default},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"protocolMode",{get:function(){return this.authorityOptions.protocolMode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"options",{get:function(){return this.authorityOptions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthority",{get:function(){return this._canonicalAuthority.urlString},set:function(e){this._canonicalAuthority=new Xe(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canonicalAuthorityUrlComponents",{get:function(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hostnameAndPort",{get:function(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tenant",{get:function(){return this.canonicalAuthorityUrlComponents.PathSegments[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"authorizationEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.authorization_endpoint);return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint);return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceCodeEndpoint",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"endSessionEndpoint",{get:function(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw ue.createLogoutNotSupportedError();var e=this.replacePath(this.metadata.end_session_endpoint);return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selfSignedJwtAudience",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.issuer);return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"jwksUri",{get:function(){if(this.discoveryComplete()){var e=this.replacePath(this.metadata.jwks_uri);return this.replaceTenant(e)}throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},enumerable:!1,configurable:!0}),t.prototype.replaceTenant=function(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)},t.prototype.replacePath=function(e){var t=e,r=new Xe(this.metadata.canonical_authority).getUrlComponents().PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((function(e,n){var o=r[n];e!==o&&(t=t.replace("/"+o+"/","/"+e+"/"))})),t},Object.defineProperty(t.prototype,"defaultOpenIdConfigurationEndpoint",{get:function(){return this.authorityType===fe.Adfs||this.authorityType===fe.Dsts||this.protocolMode===e.ProtocolMode.OIDC?this.canonicalAuthority+".well-known/openid-configuration":this.canonicalAuthority+"v2.0/.well-known/openid-configuration"},enumerable:!1,configurable:!0}),t.prototype.discoveryComplete=function(){return!!this.metadata},t.prototype.resolveEndpointsAsync=function(){var e,t,r;return C(this,void 0,void 0,(function(){var n,o,i,a;return T(this,(function(s){switch(s.label){case 0:return null===(e=this.performanceClient)||void 0===e||e.addQueueMeasurement(xe.AuthorityResolveEndpointsAsync,this.correlationId),(n=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort))||(n=new ht).updateCanonicalAuthority(this.canonicalAuthority),null===(t=this.performanceClient)||void 0===t||t.setPreQueueTime(xe.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),[4,this.updateCloudDiscoveryMetadata(n)];case 1:return o=s.sent(),this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,n.preferred_network),null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.AuthorityUpdateEndpointMetadata,this.correlationId),[4,this.updateEndpointMetadata(n)];case 2:return i=s.sent(),o!==H.CACHE&&i!==H.CACHE&&(n.resetExpiresAt(),n.updateCanonicalAuthority(this.canonicalAuthority)),a=this.cacheManager.generateAuthorityMetadataCacheKey(n.preferred_cache),this.cacheManager.setAuthorityMetadata(a,n),this.metadata=n,[2]}}))}))},t.prototype.updateEndpointMetadata=function(e){var t,r,n,o,i,a;return C(this,void 0,void 0,(function(){var s,c;return T(this,(function(u){switch(u.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.AuthorityUpdateEndpointMetadata,this.correlationId),(s=this.getEndpointMetadataFromConfig())?(e.updateEndpointMetadata(s,!1),[2,H.CONFIG]):this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!e.isExpired()?[2,H.CACHE]:(null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),[4,this.getEndpointMetadataFromNetwork()]);case 1:return(s=u.sent())?(null===(n=this.authorityOptions.azureRegionConfiguration)||void 0===n?void 0:n.azureRegion)?(null===(o=this.performanceClient)||void 0===o||o.setPreQueueTime(xe.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(s)]):[3,3]:[3,4];case 2:s=u.sent(),u.label=3;case 3:return e.updateEndpointMetadata(s,!0),[2,H.NETWORK];case 4:return!(c=this.getEndpointMetadataFromHardcodedValues())||this.authorityOptions.skipAuthorityMetadataCache?[3,7]:(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)?(null===(a=this.performanceClient)||void 0===a||a.setPreQueueTime(xe.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),[4,this.updateMetadataWithRegionalInformation(c)]):[3,6];case 5:c=u.sent(),u.label=6;case 6:return e.updateEndpointMetadata(c,!1),[2,H.HARDCODED_VALUES];case 7:throw ue.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint)}}))}))},t.prototype.isAuthoritySameType=function(e){return new Xe(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length},t.prototype.getEndpointMetadataFromConfig=function(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw ve.createInvalidAuthorityMetadataError()}return null},t.prototype.getEndpointMetadataFromNetwork=function(){var e;return C(this,void 0,void 0,(function(){var t,r;return T(this,(function(n){switch(n.label){case 0:null===(e=this.performanceClient)||void 0===e||e.addQueueMeasurement(xe.AuthorityGetEndpointMetadataFromNetwork,this.correlationId),t={},n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint,t)];case 2:return[2,ct((r=n.sent()).body)?r.body:null];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},t.prototype.getEndpointMetadataFromHardcodedValues=function(){return this.canonicalAuthority in lt?lt[this.canonicalAuthority]:null},t.prototype.updateMetadataWithRegionalInformation=function(e){var r,n,o,i,a,s,c;return C(this,void 0,void 0,(function(){var u,l;return T(this,(function(d){switch(d.label){case 0:return null===(r=this.performanceClient)||void 0===r||r.addQueueMeasurement(xe.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId),null===(n=this.performanceClient)||void 0===n||n.setPreQueueTime(xe.RegionDiscoveryDetectRegion,this.correlationId),[4,this.regionDiscovery.detectRegion(null===(o=this.authorityOptions.azureRegionConfiguration)||void 0===o?void 0:o.environmentRegion,this.regionDiscoveryMetadata)];case 1:return u=d.sent(),l=(null===(i=this.authorityOptions.azureRegionConfiguration)||void 0===i?void 0:i.azureRegion)===A.AZURE_REGION_AUTO_DISCOVER_FLAG?u:null===(a=this.authorityOptions.azureRegionConfiguration)||void 0===a?void 0:a.azureRegion,(null===(s=this.authorityOptions.azureRegionConfiguration)||void 0===s?void 0:s.azureRegion)===A.AZURE_REGION_AUTO_DISCOVER_FLAG?this.regionDiscoveryMetadata.region_outcome=u?Y.AUTO_DETECTION_REQUESTED_SUCCESSFUL:Y.AUTO_DETECTION_REQUESTED_FAILED:this.regionDiscoveryMetadata.region_outcome=u?(null===(c=this.authorityOptions.azureRegionConfiguration)||void 0===c?void 0:c.azureRegion)===u?Y.CONFIGURED_MATCHES_DETECTED:Y.CONFIGURED_NOT_DETECTED:Y.CONFIGURED_NO_AUTO_DETECTION,l?(this.regionDiscoveryMetadata.region_used=l,[2,t.replaceWithRegionalInformation(e,l)]):[2,e]}}))}))},t.prototype.updateCloudDiscoveryMetadata=function(e){var t,r;return C(this,void 0,void 0,(function(){var n,o,i;return T(this,(function(a){switch(a.label){case 0:return null===(t=this.performanceClient)||void 0===t||t.addQueueMeasurement(xe.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId),this.logger.verbose("Attempting to get cloud discovery metadata in the config"),this.logger.verbosePii("Known Authorities: "+(this.authorityOptions.knownAuthorities||A.NOT_APPLICABLE)),this.logger.verbosePii("Authority Metadata: "+(this.authorityOptions.authorityMetadata||A.NOT_APPLICABLE)),this.logger.verbosePii("Canonical Authority: "+(e.canonical_authority||A.NOT_APPLICABLE)),(n=this.getCloudDiscoveryMetadataFromConfig())?(this.logger.verbose("Found cloud discovery metadata in the config."),e.updateCloudDiscoveryMetadata(n,!1),[2,H.CONFIG]):(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache."),o=e.isExpired(),this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found metadata in the cache."),[2,H.CACHE]):(o&&this.logger.verbose("The metadata entity is expired."),this.logger.verbose("Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network."),null===(r=this.performanceClient)||void 0===r||r.setPreQueueTime(xe.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),[4,this.getCloudDiscoveryMetadataFromNetwork()]));case 1:if(n=a.sent())return this.logger.verbose("cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()"),e.updateCloudDiscoveryMetadata(n,!0),[2,H.NETWORK];if(this.logger.verbose("Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values."),(i=this.getCloudDiscoveryMetadataFromHarcodedValues())&&!this.options.skipAuthorityMetadataCache)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),e.updateCloudDiscoveryMetadata(i,!1),[2,H.HARDCODED_VALUES];throw this.logger.error("Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error."),ve.createUntrustedAuthorityError()}}))}))},t.prototype.getCloudDiscoveryMetadataFromConfig=function(){if(this.authorityType===fe.Ciam)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");var e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),r=t.getCloudDiscoveryMetadataFromNetworkResponse(e.metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),r)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),r;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),ve.createInvalidCloudDiscoveryMetadataError()}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null},t.prototype.getCloudDiscoveryMetadataFromNetwork=function(){var e;return C(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u;return T(this,(function(l){switch(l.label){case 0:null===(e=this.performanceClient)||void 0===e||e.addQueueMeasurement(xe.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId),r=""+A.AAD_INSTANCE_DISCOVERY_ENDPT+this.canonicalAuthority+"oauth2/v2.0/authorize",n={},o=null,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,this.networkInterface.sendGetRequestAsync(r,n)];case 2:if(i=l.sent(),a=void 0,s=void 0,function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")} /*! @azure/msal-common v13.0.0 2023-05-02 */(i.body))a=i.body,s=a.metadata,this.logger.verbosePii("tenant_discovery_endpoint is: "+a.tenant_discovery_endpoint);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(i.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),[2,null];if(this.logger.warning("A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: "+i.status),(a=i.body).error===A.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),[2,null];this.logger.warning("The CloudInstanceDiscoveryErrorResponse error is "+a.error),this.logger.warning("The CloudInstanceDiscoveryErrorResponse error description is "+a.error_description),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),s=[]}return this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),o=t.getCloudDiscoveryMetadataFromNetworkResponse(s,this.hostnameAndPort),[3,4];case 3:return(c=l.sent())instanceof ae?this.logger.error("There was a network error while attempting to get the cloud discovery instance metadata.\r\nError: "+c.errorCode+"\r\nError Description: "+c.errorMessage):(u=c,this.logger.error("A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\r\nError: "+u.name+"\r\nError Description: "+u.message)),[2,null];case 4:return o||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),o=t.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),[2,o]}}))}))},t.prototype.getCloudDiscoveryMetadataFromHarcodedValues=function(){return this.canonicalAuthority in dt?dt[this.canonicalAuthority]:null},t.prototype.isInKnownAuthorities=function(){var e=this;return this.authorityOptions.knownAuthorities.filter((function(t){return Xe.getDomainFromUrl(t).toLowerCase()===e.hostnameAndPort})).length>0},t.generateAuthority=function(e,t){var r;if(t&&t.azureCloudInstance!==de.None){var n=t.tenant?t.tenant:A.DEFAULT_COMMON_TENANT;r=t.azureCloudInstance+"/"+n+"/"}return r||e},t.createCloudDiscoveryMetadataFromHost=function(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}},t.getCloudDiscoveryMetadataFromNetworkResponse=function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.aliases.indexOf(t)>-1)return n}return null},t.prototype.getPreferredCache=function(){if(this.discoveryComplete())return this.metadata.preferred_cache;throw ue.createEndpointDiscoveryIncompleteError("Discovery incomplete.")},t.prototype.isAlias=function(e){return this.metadata.aliases.indexOf(e)>-1},t.isPublicCloudAuthority=function(e){return A.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0},t.buildRegionalAuthorityString=function(e,t,r){var n=new Xe(e);n.validateAsUri();var o=n.getUrlComponents(),i=t+"."+o.HostNameAndPort;this.isPublicCloudAuthority(o.HostNameAndPort)&&(i=t+"."+A.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX);var a=Xe.constructAuthorityUriFromObject(y(y({},n.getUrlComponents()),{HostNameAndPort:i})).urlString;return r?a+"?"+r:a},t.replaceWithRegionalInformation=function(e,r){return e.authorization_endpoint=t.buildRegionalAuthorityString(e.authorization_endpoint,r),e.token_endpoint=t.buildRegionalAuthorityString(e.token_endpoint,r,A.REGIONAL_AUTH_NON_MSI_QUERY_STRING),e.end_session_endpoint&&(e.end_session_endpoint=t.buildRegionalAuthorityString(e.end_session_endpoint,r)),e},t.transformCIAMAuthority=function(e){var t=e.endsWith(A.FORWARD_SLASH)?e:""+e+A.FORWARD_SLASH,r=new Xe(e).getUrlComponents();0===r.PathSegments.length&&r.HostNameAndPort.endsWith(A.CIAM_AUTH_URL)&&(t=""+t+r.HostNameAndPort.split(".")[0]+A.AAD_TENANT_DOMAIN_SUFFIX);return t},t}(),kt=function(){function e(){}return e.createDiscoveredInstance=function(t,r,n,o,i,a,s){return C(this,void 0,void 0,(function(){var c,u,l;return T(this,(function(d){switch(d.label){case 0:null==a||a.addQueueMeasurement(xe.AuthorityFactoryCreateDiscoveredInstance,s),c=Et.transformCIAMAuthority(t),u=e.createInstance(c,r,n,o,i,a,s),d.label=1;case 1:return d.trys.push([1,3,,4]),null==a||a.setPreQueueTime(xe.AuthorityResolveEndpointsAsync,s),[4,u.resolveEndpointsAsync()];case 2:return d.sent(),[2,u];case 3:throw l=d.sent(),ue.createEndpointDiscoveryIncompleteError(l);case 4:return[2]}}))}))},e.createInstance=function(e,t,r,n,o,i,a){if(le.isEmpty(e))throw ve.createUrlEmptyError();return new Et(e,t,r,n,o,i,a)},e}(),St=function(){function e(){this.failedRequests=[],this.errors=[],this.cacheHits=0}return e.isServerTelemetryEntity=function(e,t){var r=0===e.indexOf(Q.CACHE_KEY),n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n},e}(),bt=function(){function e(){}return e.isThrottlingEntity=function(e,t){var r=!1;e&&(r=0===e.indexOf(ee));var n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n},e}(),At={sendGetRequestAsync:function(){return Promise.reject(ae.createUnexpectedError("Network interface - sendGetRequestAsync() has not been implemented for the Network interface."))},sendPostRequestAsync:function(){return Promise.reject(ae.createUnexpectedError("Network interface - sendPostRequestAsync() has not been implemented for the Network interface."))}},_t={code:"missing_kid_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided."},Rt={code:"missing_alg_error",desc:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."},Pt=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="JoseHeaderError",Object.setPrototypeOf(o,t.prototype),o}return v(t,e),t.createMissingKidError=function(){return new t(_t.code,_t.desc)},t.createMissingAlgError=function(){return new t(Rt.code,Rt.desc)},t}(ae),Mt=function(){function e(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}return e.getShrHeaderString=function(t){if(!t.kid)throw Pt.createMissingKidError();if(!t.alg)throw Pt.createMissingAlgError();var r=new e({typ:t.typ||J.Pop,kid:t.kid,alg:t.alg});return JSON.stringify(r)},e}(),Nt=function(){function e(e){this.headers=e}return e.prototype.getShrNonce=function(){var e=this.headers[w.AuthenticationInfo];if(e){var t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw ve.createInvalidAuthenticationHeaderError(w.AuthenticationInfo,"nextnonce challenge is missing.")}var r=this.headers[w.WWWAuthenticate];if(r){var n=this.parseChallenges(r);if(n.nonce)return n.nonce;throw ve.createInvalidAuthenticationHeaderError(w.WWWAuthenticate,"nonce challenge is missing.")}throw ve.createMissingNonceAuthenticationHeadersError()},e.prototype.parseChallenges=function(e){var t=e.indexOf(" "),r=e.substr(t+1).split(","),n={};return r.forEach((function(e){var t=e.split("="),r=t[0],o=t[1];n[r]=unescape(o.replace(/['"]+/g,A.EMPTY_STRING))})),n},e}(),Ot=function(){function e(e,t){this.cacheOutcome=$.NO_CACHE_HIT,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||A.EMPTY_STRING,this.wrapperVer=e.wrapperVer||A.EMPTY_STRING,this.telemetryCacheKey=Q.CACHE_KEY+U.CACHE_KEY_SEPARATOR+e.clientId}return e.prototype.generateCurrentRequestHeaderValue=function(){var e=""+this.apiId+Q.VALUE_SEPARATOR+this.cacheOutcome,t=[this.wrapperSKU,this.wrapperVer].join(Q.VALUE_SEPARATOR),r=[e,this.getRegionDiscoveryFields()].join(Q.VALUE_SEPARATOR);return[Q.SCHEMA_VERSION,r,t].join(Q.CATEGORY_SEPARATOR)},e.prototype.generateLastRequestHeaderValue=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t),n=t.failedRequests.slice(0,2*r).join(Q.VALUE_SEPARATOR),o=t.errors.slice(0,r).join(Q.VALUE_SEPARATOR),i=t.errors.length,a=[i,r<i?Q.OVERFLOW_TRUE:Q.OVERFLOW_FALSE].join(Q.VALUE_SEPARATOR);return[Q.SCHEMA_VERSION,t.cacheHits,n,o,a].join(Q.CATEGORY_SEPARATOR)},e.prototype.cacheFailedRequest=function(e){var t=this.getLastRequests();t.errors.length>=Q.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),le.isEmpty(e.subError)?le.isEmpty(e.errorCode)?e&&e.toString()?t.errors.push(e.toString()):t.errors.push(Q.UNKNOWN_ERROR):t.errors.push(e.errorCode):t.errors.push(e.subError),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)},e.prototype.incrementCacheHits=function(){var e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits},e.prototype.getLastRequests=function(){var e=new St;return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e},e.prototype.clearTelemetryCache=function(){var t=this.getLastRequests(),r=e.maxErrorsToSend(t);if(r===t.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{var n=new St;n.failedRequests=t.failedRequests.slice(2*r),n.errors=t.errors.slice(r),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n)}},e.maxErrorsToSend=function(e){var t,r=0,n=0,o=e.errors.length;for(t=0;t<o;t++){var i=e.failedRequests[2*t]||A.EMPTY_STRING,a=e.failedRequests[2*t+1]||A.EMPTY_STRING,s=e.errors[t]||A.EMPTY_STRING;if(!((n+=i.toString().length+a.toString().length+s.length+3)<Q.MAX_LAST_HEADER_BYTES))break;r+=1}return r},e.prototype.getRegionDiscoveryFields=function(){var e=[];return e.push(this.regionUsed||A.EMPTY_STRING),e.push(this.regionSource||A.EMPTY_STRING),e.push(this.regionOutcome||A.EMPTY_STRING),e.join(",")},e.prototype.updateRegionDiscoveryMetadata=function(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome},e.prototype.setCacheOutcome=function(e){this.cacheOutcome=e},e}(),qt=function(){function e(e,t,r,n,o,i){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.queueMeasurements=new Map,this.preQueueTimeByCorrelationId=new Map}return e.prototype.startPerformanceMeasurement=function(e,t){return{}},e.prototype.startPerformanceMeasuremeant=function(e,t){return{}},e.prototype.getIntFields=function(){return et},e.prototype.getPreQueueTime=function(e,t){var r=this.preQueueTimeByCorrelationId.get(t);if(r){if(r.name===e)return r.time;this.logger.trace("PerformanceClient.getPreQueueTime: no pre-queue time found for "+e+", unable to add queue measurement")}else this.logger.trace("PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: "+t+", unable to add queue measurement")},e.prototype.calculateQueuedTime=function(e,t){return e<1?(this.logger.trace("PerformanceClient: preQueueTime should be a positive integer and not "+e),0):t<1?(this.logger.trace("PerformanceClient: currentTime should be a positive integer and not "+t),0):t<e?(this.logger.trace("PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved"),0):t-e},e.prototype.addQueueMeasurement=function(e,t,r,n){if(t){if(0===r)this.logger.trace("PerformanceClient.addQueueMeasurement: queue time provided for "+e+" is "+r);else if(!r)return void this.logger.trace("PerformanceClient.addQueueMeasurement: no queue time provided for "+e);var o={eventName:e,queueTime:r,manuallyCompleted:n},i=this.queueMeasurements.get(t);if(i)i.push(o),this.queueMeasurements.set(t,i);else{this.logger.trace("PerformanceClient.addQueueMeasurement: adding correlationId "+t+" to queue measurements");var a=[o];this.queueMeasurements.set(t,a)}this.preQueueTimeByCorrelationId.delete(t)}else this.logger.trace("PerformanceClient.addQueueMeasurement: correlationId not provided for "+e+", cannot add queue measurement")},e.prototype.startMeasurement=function(e,t){var r,n,o=this,i=t||this.generateId();t||this.logger.info("PerformanceClient: No correlation id provided for "+e+", generating",i),this.logger.trace("PerformanceClient: Performance measurement started for "+e,i);var a=this.startPerformanceMeasuremeant(e,i);a.startMeasurement();var s={eventId:this.generateId(),status:Le.InProgress,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:i,appName:null===(r=this.applicationTelemetry)||void 0===r?void 0:r.appName,appVersion:null===(n=this.applicationTelemetry)||void 0===n?void 0:n.appVersion};return this.cacheEventByCorrelationId(s),{endMeasurement:function(e){return o.endMeasurement(y(y({},s),e),a)},discardMeasurement:function(){return o.discardMeasurements(s.correlationId)},addStaticFields:function(e){return o.addStaticFields(e,s.correlationId)},increment:function(e){return o.increment(e,s.correlationId)},measurement:a,event:s}},e.prototype.endMeasurement=function(e,t){var r,n,o=this,i=this.eventsByCorrelationId.get(e.correlationId);if(!i)return this.logger.trace("PerformanceClient: Measurement not found for "+e.eventId,e.correlationId),null;var a=e.eventId===i.eventId,s={totalQueueTime:0,totalQueueCount:0,manuallyCompletedCount:0};a?(s=this.getQueueInfo(e.correlationId),this.discardCache(i.correlationId)):null===(r=i.incompleteSubMeasurements)||void 0===r||r.delete(e.eventId),null==t||t.endMeasurement();var c=null==t?void 0:t.flushMeasurement();if(!c)return this.logger.trace("PerformanceClient: Performance measurement not taken",i.correlationId),null;if(this.logger.trace("PerformanceClient: Performance measurement ended for "+e.name+": "+c+" ms",e.correlationId),!a)return i[e.name+"DurationMs"]=Math.floor(c),y({},i);var u=y(y({},i),e),l=0;return null===(n=u.incompleteSubMeasurements)||void 0===n||n.forEach((function(t){o.logger.trace("PerformanceClient: Incomplete submeasurement "+t.name+" found for "+e.name,u.correlationId),l++})),u.incompleteSubMeasurements=void 0,u=y(y({},u),{durationMs:Math.round(c),queuedTimeMs:s.totalQueueTime,queuedCount:s.totalQueueCount,queuedManuallyCompletedCount:s.manuallyCompletedCount,status:Le.Completed,incompleteSubsCount:l}),this.truncateIntegralFields(u,this.getIntFields()),this.emitEvents([u],e.correlationId),u},e.prototype.addStaticFields=function(e,t){this.logger.trace("PerformanceClient: Updating static fields");var r=this.eventsByCorrelationId.get(t);r?this.eventsByCorrelationId.set(t,y(y({},r),e)):this.logger.trace("PerformanceClient: Event not found for",t)},e.prototype.increment=function(e,t){this.logger.trace("PerformanceClient: Updating counters");var r=this.eventsByCorrelationId.get(t);if(r)for(var n in e)r.hasOwnProperty(n)||(r[n]=0),r[n]+=e[n];else this.logger.trace("PerformanceClient: Event not found for",t)},e.prototype.cacheEventByCorrelationId=function(e){var t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" added/updated",e.correlationId),t.incompleteSubMeasurements=t.incompleteSubMeasurements||new Map,t.incompleteSubMeasurements.set(e.eventId,{name:e.name,startTimeMs:e.startTimeMs})):(this.logger.trace("PerformanceClient: Performance measurement for "+e.name+" started",e.correlationId),this.eventsByCorrelationId.set(e.correlationId,y({},e)))},e.prototype.getQueueInfo=function(e){var t=this.queueMeasurements.get(e);t||this.logger.trace("PerformanceClient: no queue measurements found for for correlationId: "+e);var r=0,n=0,o=0;return null==t||t.forEach((function(e){r+=e.queueTime,n++,o+=e.manuallyCompleted?1:0})),{totalQueueTime:r,totalQueueCount:n,manuallyCompletedCount:o}},e.prototype.discardMeasurements=function(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e)},e.prototype.discardCache=function(e){this.discardMeasurements(e),this.logger.trace("PerformanceClient: QueueMeasurements discarded",e),this.queueMeasurements.delete(e),this.logger.trace("PerformanceClient: Pre-queue times discarded",e),this.preQueueTimeByCorrelationId.delete(e)},e.prototype.addPerformanceCallback=function(e){var t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose("PerformanceClient: Performance callback registered with id: "+t),t},e.prototype.removePerformanceCallback=function(e){var t=this.callbacks.delete(e);return t?this.logger.verbose("PerformanceClient: Performance callback "+e+" removed."):this.logger.verbose("PerformanceClient: Performance callback "+e+" not removed."),t},e.prototype.emitEvents=function(e,t){var r=this;this.logger.verbose("PerformanceClient: Emitting performance events",t),this.callbacks.forEach((function(n,o){r.logger.trace("PerformanceClient: Emitting event to callback "+o,t),n.apply(null,[e])}))},e.prototype.truncateIntegralFields=function(e,t){t.forEach((function(t){t in e&&"number"==typeof e[t]&&(e[t]=Math.floor(e[t]))}))},e}(),Ut=function(){function e(){}return e.prototype.startMeasurement=function(){},e.prototype.endMeasurement=function(){},e.prototype.flushMeasurement=function(){return null},e}(),xt=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return v(t,e),t.prototype.generateId=function(){return"callback-id"},t.prototype.startPerformanceMeasuremeant=function(){return new Ut},t.prototype.startPerformanceMeasurement=function(){return new Ut},t.prototype.calculateQueuedTime=function(e,t){return 0},t.prototype.addQueueMeasurement=function(e,t,r){},t.prototype.setPreQueueTime=function(e,t){},t}(qt),Lt={pkceNotGenerated:{code:"pkce_not_created",desc:"The PKCE code challenge and verifier could not be generated."},cryptoDoesNotExist:{code:"crypto_nonexistent",desc:"The crypto object or function is not available."},httpMethodNotImplementedError:{code:"http_method_not_implemented",desc:"The HTTP method given has not been implemented in this library."},emptyNavigateUriError:{code:"empty_navigate_uri",desc:"Navigation URI is empty. Please check stack trace for more info."},hashEmptyError:{code:"hash_empty_error",desc:"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."},hashDoesNotContainStateError:{code:"no_state_in_hash",desc:"Hash does not contain state. Please verify that the request originated from msal."},hashDoesNotContainKnownPropertiesError:{code:"hash_does_not_contain_known_properties",desc:"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."},unableToParseStateError:{code:"unable_to_parse_state",desc:"Unable to parse state. Please verify that the request originated from msal."},stateInteractionTypeMismatchError:{code:"state_interaction_type_mismatch",desc:"Hash contains state but the interaction type does not match the caller."},interactionInProgress:{code:"interaction_in_progress",desc:"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors."},popupWindowError:{code:"popup_window_error",desc:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser."},emptyWindowError:{code:"empty_window_error",desc:"window.open returned null or undefined window object."},userCancelledError:{code:"user_cancelled",desc:"User cancelled the flow."},monitorPopupTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},monitorIframeTimeoutError:{code:"monitor_window_timeout",desc:"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors."},redirectInIframeError:{code:"redirect_in_iframe",desc:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."},blockTokenRequestsInHiddenIframeError:{code:"block_iframe_reload",desc:"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors"},blockAcquireTokenInPopupsError:{code:"block_nested_popups",desc:"Request was blocked inside a popup because MSAL detected it was running in a popup."},iframeClosedPrematurelyError:{code:"iframe_closed_prematurely",desc:"The iframe being monitored was closed prematurely."},silentLogoutUnsupportedError:{code:"silent_logout_unsupported",desc:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead."},noAccountError:{code:"no_account_error",desc:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request."},silentPromptValueError:{code:"silent_prompt_value_error",desc:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'."},noTokenRequestCacheError:{code:"no_token_request_cache_error",desc:"No token request found in cache."},unableToParseTokenRequestCacheError:{code:"unable_to_parse_token_request_cache_error",desc:"The cached token request could not be parsed."},noCachedAuthorityError:{code:"no_cached_authority_error",desc:"No cached authority found."},authRequestNotSet:{code:"auth_request_not_set_error",desc:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler"},invalidCacheType:{code:"invalid_cache_type",desc:"Invalid cache type"},notInBrowserEnvironment:{code:"non_browser_environment",desc:"Login and token requests are not supported in non-browser environments."},databaseNotOpen:{code:"database_not_open",desc:"Database is not open!"},noNetworkConnectivity:{code:"no_network_connectivity",desc:"No network connectivity. Check your internet connection."},postRequestFailed:{code:"post_request_failed",desc:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'"},getRequestFailed:{code:"get_request_failed",desc:"Network request failed. Please check the network trace to determine root cause."},failedToParseNetworkResponse:{code:"failed_to_parse_response",desc:"Failed to parse network response. Check network trace."},unableToLoadTokenError:{code:"unable_to_load_token",desc:"Error loading token to cache."},signingKeyNotFoundInStorage:{code:"crypto_key_not_found",desc:"Cryptographic Key or Keypair not found in browser storage."},authCodeRequired:{code:"auth_code_required",desc:"An authorization code must be provided (as the `code` property on the request) to this flow."},authCodeOrNativeAccountRequired:{code:"auth_code_or_nativeAccountId_required",desc:"An authorization code or nativeAccountId must be provided to this flow."},spaCodeAndNativeAccountPresent:{code:"spa_code_and_nativeAccountId_present",desc:"Request cannot contain both spa code and native account id."},databaseUnavailable:{code:"database_unavailable",desc:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts."},unableToAcquireTokenFromNativePlatform:{code:"unable_to_acquire_token_from_native_platform",desc:"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors."},nativeHandshakeTimeout:{code:"native_handshake_timeout",desc:"Timed out while attempting to establish connection to browser extension"},nativeExtensionNotInstalled:{code:"native_extension_not_installed",desc:"Native extension is not installed. If you think this is a mistake call the initialize function."},nativeConnectionNotEstablished:{code:"native_connection_not_established",desc:"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors."},nativeBrokerCalledBeforeInitialize:{code:"native_broker_called_before_initialize",desc:"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors."},nativePromptNotSupported:{code:"native_prompt_not_supported",desc:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow."}},Bt=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name="BrowserAuthError",o}return u(t,e),t.createPkceNotGeneratedError=function(e){return new t(Lt.pkceNotGenerated.code,Lt.pkceNotGenerated.desc+" Detail:"+e)},t.createCryptoNotAvailableError=function(e){return new t(Lt.cryptoDoesNotExist.code,Lt.cryptoDoesNotExist.desc+" Detail:"+e)},t.createHttpMethodNotImplementedError=function(e){return new t(Lt.httpMethodNotImplementedError.code,Lt.httpMethodNotImplementedError.desc+" Given Method: "+e)},t.createEmptyNavigationUriError=function(){return new t(Lt.emptyNavigateUriError.code,Lt.emptyNavigateUriError.desc)},t.createEmptyHashError=function(e){return new t(Lt.hashEmptyError.code,Lt.hashEmptyError.desc+" Given Url: "+e)},t.createHashDoesNotContainStateError=function(){return new t(Lt.hashDoesNotContainStateError.code,Lt.hashDoesNotContainStateError.desc)},t.createHashDoesNotContainKnownPropertiesError=function(){return new t(Lt.hashDoesNotContainKnownPropertiesError.code,Lt.hashDoesNotContainKnownPropertiesError.desc)},t.createUnableToParseStateError=function(){return new t(Lt.unableToParseStateError.code,Lt.unableToParseStateError.desc)},t.createStateInteractionTypeMismatchError=function(){return new t(Lt.stateInteractionTypeMismatchError.code,Lt.stateInteractionTypeMismatchError.desc)},t.createInteractionInProgressError=function(){return new t(Lt.interactionInProgress.code,Lt.interactionInProgress.desc)},t.createPopupWindowError=function(e){var r=Lt.popupWindowError.desc;return r=le.isEmpty(e)?r:r+" Details: "+e,new t(Lt.popupWindowError.code,r)},t.createEmptyWindowCreatedError=function(){return new t(Lt.emptyWindowError.code,Lt.emptyWindowError.desc)},t.createUserCancelledError=function(){return new t(Lt.userCancelledError.code,Lt.userCancelledError.desc)},t.createMonitorPopupTimeoutError=function(){return new t(Lt.monitorPopupTimeoutError.code,Lt.monitorPopupTimeoutError.desc)},t.createMonitorIframeTimeoutError=function(){return new t(Lt.monitorIframeTimeoutError.code,Lt.monitorIframeTimeoutError.desc)},t.createRedirectInIframeError=function(e){return new t(Lt.redirectInIframeError.code,Lt.redirectInIframeError.desc+" (window.parent !== window) => "+e)},t.createBlockReloadInHiddenIframeError=function(){return new t(Lt.blockTokenRequestsInHiddenIframeError.code,Lt.blockTokenRequestsInHiddenIframeError.desc)},t.createBlockAcquireTokenInPopupsError=function(){return new t(Lt.blockAcquireTokenInPopupsError.code,Lt.blockAcquireTokenInPopupsError.desc)},t.createIframeClosedPrematurelyError=function(){return new t(Lt.iframeClosedPrematurelyError.code,Lt.iframeClosedPrematurelyError.desc)},t.createSilentLogoutUnsupportedError=function(){return new t(Lt.silentLogoutUnsupportedError.code,Lt.silentLogoutUnsupportedError.desc)},t.createNoAccountError=function(){return new t(Lt.noAccountError.code,Lt.noAccountError.desc)},t.createSilentPromptValueError=function(e){return new t(Lt.silentPromptValueError.code,Lt.silentPromptValueError.desc+" Given value: "+e)},t.createUnableToParseTokenRequestCacheError=function(){return new t(Lt.unableToParseTokenRequestCacheError.code,Lt.unableToParseTokenRequestCacheError.desc)},t.createNoTokenRequestCacheError=function(){return new t(Lt.noTokenRequestCacheError.code,Lt.noTokenRequestCacheError.desc)},t.createAuthRequestNotSetError=function(){return new t(Lt.authRequestNotSet.code,Lt.authRequestNotSet.desc)},t.createNoCachedAuthorityError=function(){return new t(Lt.noCachedAuthorityError.code,Lt.noCachedAuthorityError.desc)},t.createInvalidCacheTypeError=function(){return new t(Lt.invalidCacheType.code,""+Lt.invalidCacheType.desc)},t.createNonBrowserEnvironmentError=function(){return new t(Lt.notInBrowserEnvironment.code,Lt.notInBrowserEnvironment.desc)},t.createDatabaseNotOpenError=function(){return new t(Lt.databaseNotOpen.code,Lt.databaseNotOpen.desc)},t.createNoNetworkConnectivityError=function(){return new t(Lt.noNetworkConnectivity.code,Lt.noNetworkConnectivity.desc)},t.createPostRequestFailedError=function(e,r){return new t(Lt.postRequestFailed.code,Lt.postRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createGetRequestFailedError=function(e,r){return new t(Lt.getRequestFailed.code,Lt.getRequestFailed.desc+" | Network client threw: "+e+" | Attempted to reach: "+r.split("?")[0])},t.createFailedToParseNetworkResponseError=function(e){return new t(Lt.failedToParseNetworkResponse.code,Lt.failedToParseNetworkResponse.desc+" | Attempted to reach: "+e.split("?")[0])},t.createUnableToLoadTokenError=function(e){return new t(Lt.unableToLoadTokenError.code,Lt.unableToLoadTokenError.desc+" | "+e)},t.createSigningKeyNotFoundInStorageError=function(e){return new t(Lt.signingKeyNotFoundInStorage.code,Lt.signingKeyNotFoundInStorage.desc+" | No match found for KeyId: "+e)},t.createAuthCodeRequiredError=function(){return new t(Lt.authCodeRequired.code,Lt.authCodeRequired.desc)},t.createAuthCodeOrNativeAccountIdRequiredError=function(){return new t(Lt.authCodeOrNativeAccountRequired.code,Lt.authCodeOrNativeAccountRequired.desc)},t.createSpaCodeAndNativeAccountIdPresentError=function(){return new t(Lt.spaCodeAndNativeAccountPresent.code,Lt.spaCodeAndNativeAccountPresent.desc)},t.createDatabaseUnavailableError=function(){return new t(Lt.databaseUnavailable.code,Lt.databaseUnavailable.desc)},t.createUnableToAcquireTokenFromNativePlatformError=function(){return new t(Lt.unableToAcquireTokenFromNativePlatform.code,Lt.unableToAcquireTokenFromNativePlatform.desc)},t.createNativeHandshakeTimeoutError=function(){return new t(Lt.nativeHandshakeTimeout.code,Lt.nativeHandshakeTimeout.desc)},t.createNativeExtensionNotInstalledError=function(){return new t(Lt.nativeExtensionNotInstalled.code,Lt.nativeExtensionNotInstalled.desc)},t.createNativeConnectionNotEstablishedError=function(){return new t(Lt.nativeConnectionNotEstablished.code,Lt.nativeConnectionNotEstablished.desc)},t.createNativeBrokerCalledBeforeInitialize=function(){return new t(Lt.nativeBrokerCalledBeforeInitialize.code,Lt.nativeBrokerCalledBeforeInitialize.desc)},t.createNativePromptParameterNotSupportedError=function(){return new t(Lt.nativePromptNotSupported.code,Lt.nativePromptNotSupported.desc)},t}(ae),Ht="invalid_grant",Dt=483,Ft=600,Kt="msal",zt=30,Gt="msal.js.browser",Qt="53ee284d-920a-4b59-9d30-a60315b26836",jt="ppnbnpeolgkicgegkbkbjmhlideopiji",Wt="MATS"; /*! @azure/msal-common v13.0.0 2023-05-02 */!function(e){e.HandshakeRequest="Handshake",e.HandshakeResponse="HandshakeResponse",e.GetToken="GetToken",e.Response="Response"}(pt||(pt={})),e.BrowserCacheLocation=void 0,(gt=e.BrowserCacheLocation||(e.BrowserCacheLocation={})).LocalStorage="localStorage",gt.SessionStorage="sessionStorage",gt.MemoryStorage="memoryStorage",function(e){e.GET="GET",e.POST="POST"}(ft||(ft={})),function(e){e.AUTHORITY="authority",e.ACQUIRE_TOKEN_ACCOUNT="acquireToken.account",e.SESSION_STATE="session.state",e.REQUEST_STATE="request.state",e.NONCE_IDTOKEN="nonce.id_token",e.ORIGIN_URI="request.origin",e.RENEW_STATUS="token.renew.status",e.URL_HASH="urlHash",e.REQUEST_PARAMS="request.params",e.SCOPES="scopes",e.INTERACTION_STATUS_KEY="interaction.status",e.CCS_CREDENTIAL="ccs.credential",e.CORRELATION_ID="request.correlationId",e.NATIVE_REQUEST="request.native",e.REDIRECT_CONTEXT="request.redirect.context"}(mt||(mt={})),function(e){e.ACCOUNT_KEYS="msal.account.keys",e.TOKEN_KEYS="msal.token.keys"}(vt||(vt={})),function(e){e.WRAPPER_SKU="wrapper.sku",e.WRAPPER_VER="wrapper.version"}(yt||(yt={})),e.ApiId=void 0,(Ct=e.ApiId||(e.ApiId={}))[Ct.acquireTokenRedirect=861]="acquireTokenRedirect",Ct[Ct.acquireTokenPopup=862]="acquireTokenPopup",Ct[Ct.ssoSilent=863]="ssoSilent",Ct[Ct.acquireTokenSilent_authCode=864]="acquireTokenSilent_authCode",Ct[Ct.handleRedirectPromise=865]="handleRedirectPromise",Ct[Ct.acquireTokenByCode=866]="acquireTokenByCode",Ct[Ct.acquireTokenSilent_silentFlow=61]="acquireTokenSilent_silentFlow",Ct[Ct.logout=961]="logout",Ct[Ct.logoutPopup=962]="logoutPopup",e.InteractionType=void 0,(Tt=e.InteractionType||(e.InteractionType={})).Redirect="redirect",Tt.Popup="popup",Tt.Silent="silent",Tt.None="none",e.InteractionStatus=void 0,(It=e.InteractionStatus||(e.InteractionStatus={})).Startup="startup",It.Login="login",It.Logout="logout",It.AcquireToken="acquireToken",It.SsoSilent="ssoSilent",It.HandleRedirect="handleRedirect",It.None="none";var Vt,Yt={scopes:_},$t="jwk";e.WrapperSKU=void 0,(Vt=e.WrapperSKU||(e.WrapperSKU={})).React="@azure/msal-react",Vt.Angular="@azure/msal-angular";var Jt,Xt="msal.db",Zt=Xt+".keys";!function(e){e[e.Default=0]="Default",e[e.AccessToken=1]="AccessToken",e[e.AccessTokenAndRefreshToken=2]="AccessTokenAndRefreshToken",e[e.RefreshToken=3]="RefreshToken",e[e.RefreshTokenAndNetwork=4]="RefreshTokenAndNetwork",e[e.Skip=5]="Skip"}(Jt||(Jt={})); /*! @azure/msal-browser v2.37.0 2023-05-02 */ var er,tr,rr={redirectUriNotSet:{code:"redirect_uri_empty",desc:"A redirect URI is required for all calls, and none has been set."},postLogoutUriNotSet:{code:"post_logout_uri_empty",desc:"A post logout redirect has not been set."},storageNotSupportedError:{code:"storage_not_supported",desc:"Given storage configuration option was not supported."},noRedirectCallbacksSet:{code:"no_redirect_callbacks",desc:"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},invalidCallbackObject:{code:"invalid_callback_object",desc:"The object passed for the callback was invalid. More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics."},stubPcaInstanceCalled:{code:"stubbed_public_client_application_called",desc:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors"},inMemRedirectUnavailable:{code:"in_mem_redirect_unavailable",desc:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},entropyNotProvided:{code:"entropy_not_provided",desc:"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option."}},nr=function(e){function t(r,n){var o=e.call(this,r,n)||this;return o.name="BrowserConfigurationAuthError",Object.setPrototypeOf(o,t.prototype),o}return u(t,e),t.createRedirectUriEmptyError=function(){return new t(rr.redirectUriNotSet.code,rr.redirectUriNotSet.desc)},t.createPostLogoutRedirectUriEmptyError=function(){return new t(rr.postLogoutUriNotSet.code,rr.postLogoutUriNotSet.desc)},t.createStorageNotSupportedError=function(e){return new t(rr.storageNotSupportedError.code,rr.storageNotSupportedError.desc+" Given Location: "+e)},t.createRedirectCallbacksNotSetError=function(){return new t(rr.noRedirectCallbacksSet.code,rr.noRedirectCallbacksSet.desc)},t.createStubPcaInstanceCalledError=function(){return new t(rr.stubPcaInstanceCalled.code,rr.stubPcaInstanceCalled.desc)},t.createInMemoryRedirectUnavailableError=function(){return new t(rr.inMemRedirectUnavailable.code,rr.inMemRedirectUnavailable.desc)},t.createEntropyNotProvided=function(){return new t(rr.entropyNotProvided.code,rr.entropyNotProvided.desc)},t}(ae),or=function(){function t(e){this.validateWindowStorage(e),this.windowStorage=window[e]}return t.prototype.validateWindowStorage=function(t){if(t!==e.BrowserCacheLocation.LocalStorage&&t!==e.BrowserCacheLocation.SessionStorage)throw nr.createStorageNotSupportedError(t);if(!!!window[t])throw nr.createStorageNotSupportedError(t)},t.prototype.getItem=function(e){return this.windowStorage.getItem(e)},t.prototype.setItem=function(e,t){this.windowStorage.setItem(e,t)},t.prototype.removeItem=function(e){this.windowStorage.removeItem(e)},t.prototype.getKeys=function(){return Object.keys(this.windowStorage)},t.prototype.containsKey=function(e){return this.windowStorage.hasOwnProperty(e)},t}(),ir=function(){function e(){this.cache=new Map}return e.prototype.getItem=function(e){return this.cache.get(e)||null},e.prototype.setItem=function(e,t){this.cache.set(e,t)},e.prototype.removeItem=function(e){this.cache.delete(e)},e.prototype.getKeys=function(){var e=[];return this.cache.forEach((function(t,r){e.push(r)})),e},e.prototype.containsKey=function(e){return this.cache.has(e)},e.prototype.clear=function(){this.cache.clear()},e}(),ar=function(){function e(){}return e.extractBrowserRequestState=function(e,t){if(le.isEmpty(t))return null;try{return Je.parseRequestState(e,t).libraryState.meta}catch(e){throw ue.createInvalidStateError(t,e)}},e.parseServerResponseFromHash=function(e){if(!e)return{};var t=new Xe(e);return Xe.getDeserializedHash(t.getHash())},e}(),sr=function(t){function r(e,r,n,o){var i=t.call(this,e,n,o)||this;return i.COOKIE_LIFE_MULTIPLIER=864e5,i.cacheConfig=r,i.logger=o,i.internalStorage=new ir,i.browserStorage=i.setupBrowserStorage(i.cacheConfig.cacheLocation),i.temporaryCacheStorage=i.setupTemporaryCacheStorage(i.cacheConfig.temporaryCacheLocation,i.cacheConfig.cacheLocation),r.cacheMigrationEnabled&&(i.migrateCacheEntries(),i.createKeyMaps()),i}return u(r,t),r.prototype.setupBrowserStorage=function(t){switch(t){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new or(t)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=e.BrowserCacheLocation.MemoryStorage,new ir},r.prototype.setupTemporaryCacheStorage=function(t,r){switch(r){case e.BrowserCacheLocation.LocalStorage:case e.BrowserCacheLocation.SessionStorage:try{return new or(t||e.BrowserCacheLocation.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}case e.BrowserCacheLocation.MemoryStorage:default:return this.internalStorage}},r.prototype.migrateCacheEntries=function(){var e=this,t=A.CACHE_PREFIX+"."+E.ID_TOKEN,r=A.CACHE_PREFIX+"."+E.CLIENT_INFO,n=A.CACHE_PREFIX+"."+E.ERROR,o=A.CACHE_PREFIX+"."+E.ERROR_DESC,i=[this.browserStorage.getItem(t),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];[E.ID_TOKEN,E.CLIENT_INFO,E.ERROR,E.ERROR_DESC].forEach((function(t,r){return e.migrateCacheEntry(t,i[r])}))},r.prototype.migrateCacheEntry=function(e,t){t&&this.setTemporaryCache(e,t,!0)},r.prototype.createKeyMaps=function(){var e=this;this.logger.trace("BrowserCacheManager - createKeyMaps called.");var t=this.getItem(vt.ACCOUNT_KEYS),r=this.getItem(vt.TOKEN_KEYS+"."+this.clientId);t&&r?this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration."):this.browserStorage.getKeys().forEach((function(t){var r;if(e.isCredentialKey(t)&&(r=e.getItem(t))){var n=e.validateAndParseJson(r);if(n&&n.hasOwnProperty("credentialType"))switch(n.credentialType){case x.ID_TOKEN:if(Ke.isIdTokenEntity(n)){e.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: "+t+" found, saving key to token key map");var o=Ee.toObject(new Ke,n),i=e.updateCredentialCacheKey(t,o);return void e.addTokenKey(i,x.ID_TOKEN)}e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: "+t);break;case x.ACCESS_TOKEN:case x.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Ge.isAccessTokenEntity(n)){e.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: "+t+" found, saving key to token key map");var a=Ee.toObject(new Ge,n);i=e.updateCredentialCacheKey(t,a);return void e.addTokenKey(i,x.ACCESS_TOKEN)}e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: "+t);break;case x.REFRESH_TOKEN:if(Qe.isRefreshTokenEntity(n)){e.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: "+t+" found, saving key to token key map");var s=Ee.toObject(new Qe,n);i=e.updateCredentialCacheKey(t,s);return void e.addTokenKey(i,x.REFRESH_TOKEN)}e.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),e.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: "+t)}}if(e.isAccountKey(t)&&(r=e.getItem(t))){var c=e.validateAndParseJson(r);c&&Ie.isAccountEntity(c)&&(e.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),e.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: "+t+" found, saving key to account key map"),e.addAccountKeyToMap(t))}}))},r.prototype.validateAndParseJson=function(e){try{var t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}},r.prototype.getItem=function(e){return this.browserStorage.getItem(e)},r.prototype.setItem=function(e,t){this.browserStorage.setItem(e,t)},r.prototype.getAccount=function(e){this.logger.trace("BrowserCacheManager.getAccount called");var t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;var r=this.validateAndParseJson(t);return r&&Ie.isAccountEntity(r)?Ee.toObject(new Ie,r):(this.removeAccountKeyFromMap(e),null)},r.prototype.setAccount=function(e){this.logger.trace("BrowserCacheManager.setAccount called");var t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)},r.prototype.getAccountKeys=function(){this.logger.trace("BrowserCacheManager.getAccountKeys called");var e=this.getItem(vt.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])},r.prototype.addAccountKeyToMap=function(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: "+e);var t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(vt.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")},r.prototype.removeAccountKeyFromMap=function(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: "+e);var t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(vt.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")},r.prototype.removeAccount=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(r){return t.prototype.removeAccount.call(this,e),this.removeAccountKeyFromMap(e),[2]}))}))},r.prototype.removeIdToken=function(e){t.prototype.removeIdToken.call(this,e),this.removeTokenKey(e,x.ID_TOKEN)},r.prototype.removeAccessToken=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(r){return t.prototype.removeAccessToken.call(this,e),this.removeTokenKey(e,x.ACCESS_TOKEN),[2]}))}))},r.prototype.removeRefreshToken=function(e){t.prototype.removeRefreshToken.call(this,e),this.removeTokenKey(e,x.REFRESH_TOKEN)},r.prototype.getTokenKeys=function(){this.logger.trace("BrowserCacheManager.getTokenKeys called");var e=this.getItem(vt.TOKEN_KEYS+"."+this.clientId);if(e){var t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}},r.prototype.addTokenKey=function(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");var r=this.getTokenKeys();switch(t){case x.ID_TOKEN:-1===r.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case x.ACCESS_TOKEN:-1===r.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case x.REFRESH_TOKEN:-1===r.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: "+t),ue.createUnexpectedCredentialTypeError()}this.setItem(vt.TOKEN_KEYS+"."+this.clientId,JSON.stringify(r))},r.prototype.removeTokenKey=function(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");var r=this.getTokenKeys();switch(t){case x.ID_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: "+e+" from map");var n=r.idToken.indexOf(e);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case x.ACCESS_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: "+e+" from map");var o=r.accessToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case x.REFRESH_TOKEN:this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: "+e+" from map");var i=r.refreshToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:this.logger.error("BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: "+t),ue.createUnexpectedCredentialTypeError()}this.setItem(vt.TOKEN_KEYS+"."+this.clientId,JSON.stringify(r))},r.prototype.getIdTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.ID_TOKEN),null;var r=this.validateAndParseJson(t);return r&&Ke.isIdTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),Ee.toObject(new Ke,r)):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.ID_TOKEN),null)},r.prototype.setIdTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,x.ID_TOKEN)},r.prototype.getAccessTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.ACCESS_TOKEN),null;var r=this.validateAndParseJson(t);return r&&Ge.isAccessTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),Ee.toObject(new Ge,r)):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.ACCESS_TOKEN),null)},r.prototype.setAccessTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,x.ACCESS_TOKEN)},r.prototype.getRefreshTokenCredential=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.REFRESH_TOKEN),null;var r=this.validateAndParseJson(t);return r&&Qe.isRefreshTokenEntity(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),Ee.toObject(new Qe,r)):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,x.REFRESH_TOKEN),null)},r.prototype.setRefreshTokenCredential=function(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");var t=e.generateCredentialKey();this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,x.REFRESH_TOKEN)},r.prototype.getAppMetadata=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&rt.isAppMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),Ee.toObject(new rt,r)):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null)},r.prototype.setAppMetadata=function(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");var t=e.generateAppMetadataKey();this.setItem(t,JSON.stringify(e))},r.prototype.getServerTelemetry=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&St.isServerTelemetryEntity(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),Ee.toObject(new St,r)):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)},r.prototype.setServerTelemetry=function(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))},r.prototype.getAuthorityMetadata=function(e){var t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&ht.isAuthorityMetadataEntity(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),Ee.toObject(new ht,r)):null},r.prototype.getAuthorityMetadataKeys=function(){var e=this;return this.internalStorage.getKeys().filter((function(t){return e.isAuthorityMetadata(t)}))},r.prototype.setWrapperMetadata=function(e,t){this.internalStorage.setItem(yt.WRAPPER_SKU,e),this.internalStorage.setItem(yt.WRAPPER_VER,t)},r.prototype.getWrapperMetadata=function(){return[this.internalStorage.getItem(yt.WRAPPER_SKU)||A.EMPTY_STRING,this.internalStorage.getItem(yt.WRAPPER_VER)||A.EMPTY_STRING]},r.prototype.setAuthorityMetadata=function(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))},r.prototype.getActiveAccount=function(){var e=this.generateCacheKey(E.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");var r=this.generateCacheKey(E.ACTIVE_ACCOUNT),n=this.getItem(r);if(!n)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;var o=this.getAccountInfoByFilter({localAccountId:n})[0]||null;return o?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(o),o):null}var i=this.validateAndParseJson(t);return i?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoByFilter({homeAccountId:i.homeAccountId,localAccountId:i.localAccountId})[0]||null):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)},r.prototype.setActiveAccount=function(e){var t=this.generateCacheKey(E.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(E.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");var n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId};this.browserStorage.setItem(t,JSON.stringify(n)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)},r.prototype.getAccountInfoByFilter=function(e){var t=this.getAllAccounts();return this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total "+t.length+" accounts found"),t.filter((function(t){return(!e.username||e.username.toLowerCase()===t.username.toLowerCase())&&((!e.homeAccountId||e.homeAccountId===t.homeAccountId)&&((!e.localAccountId||e.localAccountId===t.localAccountId)&&((!e.tenantId||e.tenantId===t.tenantId)&&(!e.environment||e.environment===t.environment))))}))},r.prototype.getAccountInfoByHints=function(e,t){var r=this.getAllAccounts().filter((function(r){if(t){var n=r.idTokenClaims&&r.idTokenClaims.sid;return t===n}return!!e&&e===r.username}));if(1===r.length)return r[0];if(r.length>1)throw ue.createMultipleMatchingAccountsInCacheError();return null},r.prototype.getThrottlingCache=function(e){var t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;var r=this.validateAndParseJson(t);return r&&bt.isThrottlingEntity(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),Ee.toObject(new bt,r)):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)},r.prototype.setThrottlingCache=function(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))},r.prototype.getTemporaryCache=function(t,r){var n=r?this.generateCacheKey(t):t;if(this.cacheConfig.storeAuthStateInCookie){var o=this.getItemCookie(n);if(o)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),o}var i=this.temporaryCacheStorage.getItem(n);if(!i){if(this.cacheConfig.cacheLocation===e.BrowserCacheLocation.LocalStorage){var a=this.browserStorage.getItem(n);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),i},r.prototype.setTemporaryCache=function(e,t,r){var n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))},r.prototype.removeItem=function(e){this.browserStorage.removeItem(e),this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))},r.prototype.containsKey=function(e){return this.browserStorage.containsKey(e)||this.temporaryCacheStorage.containsKey(e)},r.prototype.getKeys=function(){return f(this.browserStorage.getKeys(),this.temporaryCacheStorage.getKeys())},r.prototype.clear=function(){return h(this,void 0,void 0,(function(){var e=this;return p(this,(function(t){switch(t.label){case 0:return[4,this.removeAllAccounts()];case 1:return t.sent(),this.removeAppMetadata(),this.getKeys().forEach((function(t){!e.browserStorage.containsKey(t)&&!e.temporaryCacheStorage.containsKey(t)||-1===t.indexOf(A.CACHE_PREFIX)&&-1===t.indexOf(e.clientId)||e.removeItem(t)})),this.internalStorage.clear(),[2]}}))}))},r.prototype.setItemCookie=function(e,t,r){var n=encodeURIComponent(e)+"="+encodeURIComponent(t)+";path=/;SameSite=Lax;";r&&(n+="expires="+this.getCookieExpirationTime(r)+";");this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n},r.prototype.getItemCookie=function(e){for(var t=encodeURIComponent(e)+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];" "===o.charAt(0);)o=o.substring(1);if(0===o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return A.EMPTY_STRING},r.prototype.clearMsalCookies=function(){var e=this,t=A.CACHE_PREFIX+"."+this.clientId;document.cookie.split(";").forEach((function(r){for(;" "===r.charAt(0);)r=r.substring(1);if(0===r.indexOf(t)){var n=r.split("=")[0];e.clearItemCookie(n)}}))},r.prototype.clearItemCookie=function(e){this.setItemCookie(e,A.EMPTY_STRING,-1)},r.prototype.getCookieExpirationTime=function(e){var t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()},r.prototype.getCache=function(){return this.browserStorage},r.prototype.setCache=function(){},r.prototype.generateCacheKey=function(e){return this.validateAndParseJson(e)?JSON.stringify(e):le.startsWith(e,A.CACHE_PREFIX)||le.startsWith(e,E.ADAL_ID_TOKEN)?e:A.CACHE_PREFIX+"."+this.clientId+"."+e},r.prototype.generateAuthorityKey=function(e){var t=Je.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(mt.AUTHORITY+"."+t)},r.prototype.generateNonceKey=function(e){var t=Je.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(mt.NONCE_IDTOKEN+"."+t)},r.prototype.generateStateKey=function(e){var t=Je.parseRequestState(this.cryptoImpl,e).libraryState.id;return this.generateCacheKey(mt.REQUEST_STATE+"."+t)},r.prototype.getCachedAuthority=function(e){var t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;var n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)},r.prototype.updateCacheEntries=function(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");var i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);var a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);var s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){var c={credential:o.homeAccountId,type:Ne.HOME_ACCOUNT_ID};this.setTemporaryCache(mt.CCS_CREDENTIAL,JSON.stringify(c),!0)}else if(!le.isEmpty(n)){c={credential:n,type:Ne.UPN};this.setTemporaryCache(mt.CCS_CREDENTIAL,JSON.stringify(c),!0)}},r.prototype.resetRequestCache=function(e){var t=this;this.logger.trace("BrowserCacheManager.resetRequestCache called"),le.isEmpty(e)||this.getKeys().forEach((function(r){-1!==r.indexOf(e)&&t.removeItem(r)})),e&&(this.removeItem(this.generateStateKey(e)),this.removeItem(this.generateNonceKey(e)),this.removeItem(this.generateAuthorityKey(e))),this.removeItem(this.generateCacheKey(mt.REQUEST_PARAMS)),this.removeItem(this.generateCacheKey(mt.ORIGIN_URI)),this.removeItem(this.generateCacheKey(mt.URL_HASH)),this.removeItem(this.generateCacheKey(mt.CORRELATION_ID)),this.removeItem(this.generateCacheKey(mt.CCS_CREDENTIAL)),this.removeItem(this.generateCacheKey(mt.NATIVE_REQUEST)),this.setInteractionInProgress(!1)},r.prototype.cleanRequestByState=function(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){var t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: "+r),this.resetRequestCache(r||A.EMPTY_STRING)}this.clearMsalCookies()},r.prototype.cleanRequestByInteractionType=function(e){var t=this;this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.getKeys().forEach((function(r){if(-1!==r.indexOf(mt.REQUEST_STATE)){var n=t.temporaryCacheStorage.getItem(r);if(n){var o=ar.extractBrowserRequestState(t.cryptoImpl,n);o&&o.interactionType===e&&(t.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: "+n),t.resetRequestCache(n))}}})),this.clearMsalCookies(),this.setInteractionInProgress(!1)},r.prototype.cacheCodeRequest=function(e,t){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");var r=t.base64Encode(JSON.stringify(e));this.setTemporaryCache(mt.REQUEST_PARAMS,r,!0)},r.prototype.getCachedRequest=function(e,t){this.logger.trace("BrowserCacheManager.getCachedRequest called");var r=this.getTemporaryCache(mt.REQUEST_PARAMS,!0);if(!r)throw Bt.createNoTokenRequestCacheError();var n=this.validateAndParseJson(t.base64Decode(r));if(!n)throw Bt.createUnableToParseTokenRequestCacheError();if(this.removeItem(this.generateCacheKey(mt.REQUEST_PARAMS)),le.isEmpty(n.authority)){var o=this.generateAuthorityKey(e),i=this.getTemporaryCache(o);if(!i)throw Bt.createNoCachedAuthorityError();n.authority=i}return n},r.prototype.getCachedNativeRequest=function(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");var e=this.getTemporaryCache(mt.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;var t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)},r.prototype.isInteractionInProgress=function(e){var t=this.getInteractionInProgress();return e?t===this.clientId:!!t},r.prototype.getInteractionInProgress=function(){var e=A.CACHE_PREFIX+"."+mt.INTERACTION_STATUS_KEY;return this.getTemporaryCache(e,!1)},r.prototype.setInteractionInProgress=function(e){var t=A.CACHE_PREFIX+"."+mt.INTERACTION_STATUS_KEY;if(e){if(this.getInteractionInProgress())throw Bt.createInteractionInProgressError();this.setTemporaryCache(t,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeItem(t)},r.prototype.getLegacyLoginHint=function(){var e=this.getTemporaryCache(E.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(E.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));var t=this.getTemporaryCache(E.ID_TOKEN,!0);t&&(this.removeItem(this.generateCacheKey(E.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));var r=t||e;if(r){var n=new we(r,this.cryptoImpl);if(n.claims&&n.claims.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),n.claims.preferred_username;if(n.claims&&n.claims.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),n.claims.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null},r.prototype.updateCredentialCacheKey=function(e,t){var r=t.generateCredentialKey();if(e!==r){var n=this.getItem(e);if(n)return this.removeItem(e),this.setItem(r,n),this.logger.verbose("Updated an outdated "+t.credentialType+" cache key"),r;this.logger.error("Attempted to update an outdated "+t.credentialType+" cache key but no item matching the outdated key was found in storage")}return e},r.prototype.getRedirectRequestContext=function(){return this.getTemporaryCache(mt.REDIRECT_CONTEXT,!0)},r.prototype.setRedirectRequestContext=function(e){this.setTemporaryCache(mt.REDIRECT_CONTEXT,e,!0)},r}(Ee),cr="@azure/msal-browser",ur="2.37.0",lr=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o;return p(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,fetch(e,{method:ft.GET,headers:this.getFetchHeaders(t)})];case 1:return r=i.sent(),[3,3];case 2:throw n=i.sent(),window.navigator.onLine?Bt.createGetRequestFailedError(n,e):Bt.createNoNetworkConnectivityError();case 3:return i.trys.push([3,5,,6]),o={headers:this.getHeaderDict(r.headers)},[4,r.json()];case 4:return[2,(o.body=i.sent(),o.status=r.status,o)];case 5:throw i.sent(),Bt.createFailedToParseNetworkResponseError(e);case 6:return[2]}}))}))},e.prototype.sendPostRequestAsync=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o,i;return p(this,(function(a){switch(a.label){case 0:r=t&&t.body||A.EMPTY_STRING,a.label=1;case 1:return a.trys.push([1,3,,4]),[4,fetch(e,{method:ft.POST,headers:this.getFetchHeaders(t),body:r})];case 2:return n=a.sent(),[3,4];case 3:throw o=a.sent(),window.navigator.onLine?Bt.createPostRequestFailedError(o,e):Bt.createNoNetworkConnectivityError();case 4:return a.trys.push([4,6,,7]),i={headers:this.getHeaderDict(n.headers)},[4,n.json()];case 5:return[2,(i.body=a.sent(),i.status=n.status,i)];case 6:throw a.sent(),Bt.createFailedToParseNetworkResponseError(e);case 7:return[2]}}))}))},e.prototype.getFetchHeaders=function(e){var t=new Headers;if(!e||!e.headers)return t;var r=e.headers;return Object.keys(r).forEach((function(e){t.append(e,r[e])})),t},e.prototype.getHeaderDict=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t},e}(),dr=function(){function e(){}return e.prototype.sendGetRequestAsync=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,this.sendRequestAsync(e,ft.GET,t)]}))}))},e.prototype.sendPostRequestAsync=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,this.sendRequestAsync(e,ft.POST,t)]}))}))},e.prototype.sendRequestAsync=function(e,t,r){var n=this;return new Promise((function(o,i){var a=new XMLHttpRequest;if(a.open(t,e,!0),n.setXhrHeaders(a,r),a.onload=function(){(a.status<200||a.status>=300)&&(t===ft.POST?i(Bt.createPostRequestFailedError("Failed with status "+a.status,e)):i(Bt.createGetRequestFailedError("Failed with status "+a.status,e)));try{var r=JSON.parse(a.responseText),s={headers:n.getHeaderDict(a),body:r,status:a.status};o(s)}catch(t){i(Bt.createFailedToParseNetworkResponseError(e))}},a.onerror=function(){window.navigator.onLine?t===ft.POST?i(Bt.createPostRequestFailedError("Failed with status "+a.status,e)):i(Bt.createGetRequestFailedError("Failed with status "+a.status,e)):i(Bt.createNoNetworkConnectivityError())},t===ft.POST&&r&&r.body)a.send(r.body);else{if(t!==ft.GET)throw Bt.createHttpMethodNotImplementedError(t);a.send()}}))},e.prototype.setXhrHeaders=function(e,t){if(t&&t.headers){var r=t.headers;Object.keys(r).forEach((function(t){e.setRequestHeader(t,r[t])}))}},e.prototype.getHeaderDict=function(e){var t=e.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};return t.forEach((function(e){var t=e.split(": "),n=t.shift(),o=t.join(": ");n&&o&&(r[n]=o)})),r},e}(),hr=function(){function t(){}return t.clearHash=function(e){e.location.hash=A.EMPTY_STRING,"function"==typeof e.history.replaceState&&e.history.replaceState(null,A.EMPTY_STRING,""+e.location.origin+e.location.pathname+e.location.search)},t.replaceHash=function(e){var t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):A.EMPTY_STRING},t.isInIframe=function(){return window.parent!==window},t.isInPopup=function(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(Kt+".")},t.getCurrentUri=function(){return window.location.href.split("?")[0].split("#")[0]},t.getHomepage=function(){var e=new Xe(window.location.href).getUrlComponents();return e.Protocol+"//"+e.HostNameAndPort+"/"},t.getBrowserNetworkClient=function(){return window.fetch&&window.Headers?new lr:new dr},t.blockReloadInHiddenIframes=function(){if(Xe.hashContainsKnownProperties(window.location.hash)&&t.isInIframe())throw Bt.createBlockReloadInHiddenIframeError()},t.blockRedirectInIframe=function(r,n){var o=t.isInIframe();if(r===e.InteractionType.Redirect&&o&&!n)throw Bt.createRedirectInIframeError(o)},t.blockAcquireTokenInPopups=function(){if(t.isInPopup())throw Bt.createBlockAcquireTokenInPopupsError()},t.blockNonBrowserEnvironment=function(e){if(!e)throw Bt.createNonBrowserEnvironmentError()},t.blockNativeBrokerCalledBeforeInitialized=function(e,t){if(e&&!t)throw Bt.createNativeBrokerCalledBeforeInitialize()},t.detectIEOrEdge=function(){var e=window.navigator.userAgent,t=e.indexOf("MSIE "),r=e.indexOf("Trident/"),n=e.indexOf("Edge/");return t>0||r>0||n>0},t}(),pr=function(){function t(e,t,r,n,o,i,a,s,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.nativeMessageHandler=s,this.correlationId=c||this.browserCrypto.createNewGuid(),this.logger=n.clone(Gt,ur,this.correlationId),this.performanceClient=a}return t.prototype.clearCacheOnLogout=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:if(!e)return[3,5];Ie.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null)),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.browserStorage.removeAccount(Ie.generateAccountCacheKey(e))];case 2:return t.sent(),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request."),[3,4];case 3:return t.sent(),this.logger.error("Account provided in logout request was not found. Local cache unchanged."),[3,4];case 4:return[3,9];case 5:return t.trys.push([5,8,,9]),this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),[4,this.browserStorage.clear()];case 6:return t.sent(),[4,this.browserCrypto.clearKeystore()];case 7:return t.sent(),[3,9];case 8:return t.sent(),this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged."),[3,9];case 9:return[2]}}))}))},t.prototype.initializeBaseRequest=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i;return p(this,(function(a){switch(a.label){case 0:if(this.performanceClient.addQueueMeasurement(xe.InitializeBaseRequest,t.correlationId),this.logger.verbose("Initializing BaseAuthRequest"),r=t.authority||this.config.auth.authority,n=f(t&&t.scopes||[]),(o=l(l({},t),{correlationId:this.correlationId,authority:r,scopes:n})).authenticationScheme){if(o.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ve.createMissingSshJwkError();if(!t.sshKid)throw ve.createMissingSshKidError()}this.logger.verbose('Authentication Scheme set to "'+o.authenticationScheme+'" as configured in Auth request')}else o.authenticationScheme=e.AuthenticationScheme.BEARER,this.logger.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return!t.claims||le.isEmpty(t.claims)?[3,2]:(i=o,[4,this.browserCrypto.hashString(t.claims)]);case 1:i.requestedClaimsHash=a.sent(),a.label=2;case 2:return[2,o]}}))}))},t.prototype.getRedirectUri=function(e){this.logger.verbose("getRedirectUri called");var t=e||this.config.auth.redirectUri||hr.getCurrentUri();return Xe.getAbsoluteUrl(t,hr.getCurrentUri())},t.prototype.initializeServerTelemetryManager=function(e,t){this.logger.verbose("initializeServerTelemetryManager called");var r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ot(r,this.browserStorage)},t.prototype.getDiscoveredAuthority=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){switch(r.label){case 0:return this.logger.verbose("getDiscoveredAuthority called"),t={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata},e?(this.logger.verbose("Creating discovered authority with request authority"),[4,kt.createDiscoveredInstance(e,this.config.system.networkClient,this.browserStorage,t,this.logger)]):[3,2];case 1:case 3:return[2,r.sent()];case 2:return this.logger.verbose("Creating discovered authority with configured authority"),[4,kt.createDiscoveredInstance(this.config.auth.authority,this.config.system.networkClient,this.browserStorage,t,this.logger)]}}))}))},t}(),gr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.initializeAuthorizationCodeRequest=function(e){return h(this,void 0,void 0,(function(){var t,r;return p(this,(function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement(xe.StandardInteractionClientInitializeAuthorizationCodeRequest,e.correlationId),this.logger.verbose("initializeAuthorizationRequest called",e.correlationId),[4,this.browserCrypto.generatePkceCodes()];case 1:return t=n.sent(),r=l(l({},e),{redirectUri:e.redirectUri,code:A.EMPTY_STRING,codeVerifier:t.verifier}),e.codeChallenge=t.challenge,e.codeChallengeMethod=A.S256_CODE_CHALLENGE_METHOD,[2,r]}}))}))},t.prototype.initializeLogoutRequest=function(e){this.logger.verbose("initializeLogoutRequest called",null==e?void 0:e.correlationId);var t=l({correlationId:this.correlationId||this.browserCrypto.createNewGuid()},e);if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){var r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=Xe.getAbsoluteUrl(e.postLogoutRedirectUri,hr.getCurrentUri())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=Xe.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,hr.getCurrentUri())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Xe.getAbsoluteUrl(hr.getCurrentUri(),hr.getCurrentUri())),t},t.prototype.getLogoutHintFromIdTokenClaims=function(e){var t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null},t.prototype.createAuthCodeClient=function(e,t,r){return h(this,void 0,void 0,(function(){var n;return p(this,(function(o){switch(o.label){case 0:return this.performanceClient.addQueueMeasurement(xe.StandardInteractionClientCreateAuthCodeClient,this.correlationId),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(e,t,r)];case 1:return n=o.sent(),[2,new it(n,this.performanceClient)]}}))}))},t.prototype.getClientConfiguration=function(e,t,r){return h(this,void 0,void 0,(function(){var n,o;return p(this,(function(i){switch(i.label){case 0:return this.performanceClient.addQueueMeasurement(xe.StandardInteractionClientGetClientConfiguration,this.correlationId),this.logger.verbose("getClientConfiguration called",this.correlationId),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),[4,this.getDiscoveredAuthority(t,r)];case 1:return n=i.sent(),o=this.config.system.loggerOptions,[2,{authOptions:{clientId:this.config.auth.clientId,authority:n,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:o.loggerCallback,piiLoggingEnabled:o.piiLoggingEnabled,logLevel:o.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:e,libraryInfo:{sku:Gt,version:ur,cpu:A.EMPTY_STRING,os:A.EMPTY_STRING},telemetry:this.config.telemetry}]}}))}))},t.prototype.validateAndExtractStateFromHash=function(e,t,r){if(this.logger.verbose("validateAndExtractStateFromHash called",r),!e.state)throw Bt.createHashDoesNotContainStateError();var n=ar.extractBrowserRequestState(this.browserCrypto,e.state);if(!n)throw Bt.createUnableToParseStateError();if(n.interactionType!==t)throw Bt.createStateInteractionTypeMismatchError();return this.logger.verbose("Returning state from hash",r),e.state},t.prototype.getDiscoveredAuthority=function(e,t){var r;return h(this,void 0,void 0,(function(){var n,o,i,a;return p(this,(function(s){switch(s.label){case 0:return this.performanceClient.addQueueMeasurement(xe.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),this.logger.verbose("getDiscoveredAuthority called",this.correlationId),n=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(xe.StandardInteractionClientGetDiscoveredAuthority,this.correlationId),o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e||this.config.auth.authority,a=Et.generateAuthority(i,t||this.config.auth.azureCloudOptions),this.logger.verbose("Creating discovered authority with configured authority",this.correlationId),this.performanceClient.setPreQueueTime(xe.AuthorityFactoryCreateDiscoveredInstance,this.correlationId),[4,kt.createDiscoveredInstance(a,this.config.system.networkClient,this.browserStorage,o,this.logger,this.performanceClient,this.correlationId).then((function(e){return n.endMeasurement({success:!0}),e})).catch((function(e){throw n.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))];case 1:return[2,s.sent()]}}))}))},t.prototype.initializeAuthorizationRequest=function(e,t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return p(this,(function(u){switch(u.label){case 0:return this.performanceClient.addQueueMeasurement(xe.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId),this.logger.verbose("initializeAuthorizationRequest called",this.correlationId),r=this.getRedirectUri(e.redirectUri),n={interactionType:t},o=Je.setRequestState(this.browserCrypto,e&&e.state||A.EMPTY_STRING,n),this.performanceClient.setPreQueueTime(xe.InitializeBaseRequest,this.correlationId),a=[{}],[4,this.initializeBaseRequest(e)];case 1:return i=l.apply(void 0,[l.apply(void 0,a.concat([u.sent()])),{redirectUri:r,state:o,nonce:e.nonce||this.browserCrypto.createNewGuid(),responseMode:N.FRAGMENT}]),(s=e.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii("Setting validated request account: "+s.homeAccountId,this.correlationId),i.account=s),le.isEmpty(i.loginHint)&&!s&&(c=this.browserStorage.getLegacyLoginHint())&&(i.loginHint=c),[2,i]}}))}))},t}(pr),fr=function(){function e(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}return e.prototype.handleCodeResponseFromHash=function(e,t,r,n){return h(this,void 0,void 0,(function(){var o,i,a;return p(this,(function(s){if(this.performanceClient.addQueueMeasurement(xe.HandleCodeResponseFromHash,this.authCodeRequest.correlationId),this.logger.verbose("InteractionHandler.handleCodeResponse called"),le.isEmpty(e))throw Bt.createEmptyHashError(e);if(o=this.browserStorage.generateStateKey(t),!(i=this.browserStorage.getTemporaryCache(o)))throw ue.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,i)}catch(e){throw e instanceof Oe&&e.subError===Lt.userCancelledError.code?Bt.createUserCancelledError():e}return this.performanceClient.setPreQueueTime(xe.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),[2,this.handleCodeResponseFromServer(a,t,r,n)]}))}))},e.prototype.handleCodeResponseFromServer=function(e,t,r,n,o){return void 0===o&&(o=!0),h(this,void 0,void 0,(function(){var i,a,s,c,u,l;return p(this,(function(d){switch(d.label){case 0:if(this.performanceClient.addQueueMeasurement(xe.HandleCodeResponseFromServer,this.authCodeRequest.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),i=this.browserStorage.generateStateKey(t),!(a=this.browserStorage.getTemporaryCache(i)))throw ue.createStateNotFoundError("Cached State");return s=this.browserStorage.generateNonceKey(a),c=this.browserStorage.getTemporaryCache(s),this.authCodeRequest.code=e.code,e.cloud_instance_host_name?(this.performanceClient.setPreQueueTime(xe.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),[4,this.updateTokenEndpointAuthority(e.cloud_instance_host_name,r,n)]):[3,2];case 1:d.sent(),d.label=2;case 2:return o&&(e.nonce=c||void 0),e.state=a,e.client_info?this.authCodeRequest.clientInfo=e.client_info:(u=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=u),this.performanceClient.setPreQueueTime(xe.AuthClientAcquireToken,this.authCodeRequest.correlationId),[4,this.authModule.acquireToken(this.authCodeRequest,e)];case 3:return l=d.sent(),this.browserStorage.cleanRequestByState(t),[2,l]}}))}))},e.prototype.updateTokenEndpointAuthority=function(e,t,r){return h(this,void 0,void 0,(function(){var n,o;return p(this,(function(i){switch(i.label){case 0:return this.performanceClient.addQueueMeasurement(xe.UpdateTokenEndpointAuthority,this.authCodeRequest.correlationId),n="https://"+e+"/"+t.tenant+"/",[4,kt.createDiscoveredInstance(n,r,this.browserStorage,t.options,this.logger,this.performanceClient,this.authCodeRequest.correlationId)];case 1:return o=i.sent(),this.authModule.updateAuthority(o),[2]}}))}))},e.prototype.checkCcsCredentials=function(){var e=this.browserStorage.getTemporaryCache(mt.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii("Cache credential could not be parsed: "+e)}return null},e}(),mr=function(t){function r(e,r,n,o,i,a){var s=t.call(this,e,r,n,o,a)||this;return s.browserCrypto=i,s}return u(r,t),r.prototype.initiateAuthRequest=function(t,r){return h(this,void 0,void 0,(function(){var n;return p(this,(function(o){switch(o.label){case 0:return this.logger.verbose("RedirectHandler.initiateAuthRequest called"),le.isEmpty(t)?[3,7]:(r.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(mt.ORIGIN_URI,r.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(mt.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest,this.browserCrypto),this.logger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: "+t),n={apiId:e.ApiId.acquireTokenRedirect,timeout:r.redirectTimeout,noHistory:!1},"function"!=typeof r.onRedirectNavigate?[3,4]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),!1===r.onRedirectNavigate(t)?[3,2]:(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),[4,r.navigationClient.navigateExternal(t,n)])));case 1:case 5:return o.sent(),[2];case 2:return this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation"),[2];case 3:return[3,6];case 4:return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),[4,r.navigationClient.navigateExternal(t,n)];case 6:return[3,8];case 7:throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),Bt.createEmptyNavigationUriError();case 8:return[2]}}))}))},r.prototype.handleCodeResponseFromHash=function(e,t,r,n){return h(this,void 0,void 0,(function(){var o,i,a,s,c,u,l;return p(this,(function(d){switch(d.label){case 0:if(this.logger.verbose("RedirectHandler.handleCodeResponse called"),le.isEmpty(e))throw Bt.createEmptyHashError(e);if(this.browserStorage.setInteractionInProgress(!1),o=this.browserStorage.generateStateKey(t),!(i=this.browserStorage.getTemporaryCache(o)))throw ue.createStateNotFoundError("Cached State");try{a=this.authModule.handleFragmentResponse(e,i)}catch(e){throw e instanceof Oe&&e.subError===Lt.userCancelledError.code?Bt.createUserCancelledError():e}return s=this.browserStorage.generateNonceKey(i),c=this.browserStorage.getTemporaryCache(s),this.authCodeRequest.code=a.code,a.cloud_instance_host_name?[4,this.updateTokenEndpointAuthority(a.cloud_instance_host_name,r,n)]:[3,2];case 1:d.sent(),d.label=2;case 2:return a.nonce=c||void 0,a.state=i,a.client_info?this.authCodeRequest.clientInfo=a.client_info:(u=this.checkCcsCredentials())&&(this.authCodeRequest.ccsCredential=u),[4,this.authModule.acquireToken(this.authCodeRequest,a)];case 3:return l=d.sent(),this.browserStorage.cleanRequestByState(t),[2,l]}}))}))},r}(fr); /*! @azure/msal-browser v2.37.0 2023-05-02 */ e.EventType=void 0,(er=e.EventType||(e.EventType={})).INITIALIZE_START="msal:initializeStart",er.INITIALIZE_END="msal:initializeEnd",er.ACCOUNT_ADDED="msal:accountAdded",er.ACCOUNT_REMOVED="msal:accountRemoved",er.LOGIN_START="msal:loginStart",er.LOGIN_SUCCESS="msal:loginSuccess",er.LOGIN_FAILURE="msal:loginFailure",er.ACQUIRE_TOKEN_START="msal:acquireTokenStart",er.ACQUIRE_TOKEN_SUCCESS="msal:acquireTokenSuccess",er.ACQUIRE_TOKEN_FAILURE="msal:acquireTokenFailure",er.ACQUIRE_TOKEN_NETWORK_START="msal:acquireTokenFromNetworkStart",er.SSO_SILENT_START="msal:ssoSilentStart",er.SSO_SILENT_SUCCESS="msal:ssoSilentSuccess",er.SSO_SILENT_FAILURE="msal:ssoSilentFailure",er.ACQUIRE_TOKEN_BY_CODE_START="msal:acquireTokenByCodeStart",er.ACQUIRE_TOKEN_BY_CODE_SUCCESS="msal:acquireTokenByCodeSuccess",er.ACQUIRE_TOKEN_BY_CODE_FAILURE="msal:acquireTokenByCodeFailure",er.HANDLE_REDIRECT_START="msal:handleRedirectStart",er.HANDLE_REDIRECT_END="msal:handleRedirectEnd",er.POPUP_OPENED="msal:popupOpened",er.LOGOUT_START="msal:logoutStart",er.LOGOUT_SUCCESS="msal:logoutSuccess",er.LOGOUT_FAILURE="msal:logoutFailure",er.LOGOUT_END="msal:logoutEnd",function(e){e.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",e.USER_CANCEL="USER_CANCEL",e.NO_NETWORK="NO_NETWORK",e.TRANSIENT_ERROR="TRANSIENT_ERROR",e.PERSISTENT_ERROR="PERSISTENT_ERROR",e.DISABLED="DISABLED",e.ACCOUNT_UNAVAILABLE="ACCOUNT_UNAVAILABLE"}(tr||(tr={}));var vr={code:"ContentError"},yr={code:"user_switch",desc:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."},Cr={code:"tokens_not_found_in_internal_memory_cache",desc:"Tokens not cached in MSAL JS internal memory, please make the WAM request"},Tr=function(e){function t(r,n,o){var i=e.call(this,r,n)||this;return Object.setPrototypeOf(i,t.prototype),i.name="NativeAuthError",i.ext=o,i}return u(t,e),t.prototype.isFatal=function(){return!(!this.ext||!this.ext.status||this.ext.status!==tr.PERSISTENT_ERROR&&this.ext.status!==tr.DISABLED)||this.errorCode===vr.code},t.createError=function(e,r,n){if(n&&n.status)switch(n.status){case tr.ACCOUNT_UNAVAILABLE:return Ye.createNativeAccountUnavailableError();case tr.USER_INTERACTION_REQUIRED:return new Ye(e,r);case tr.USER_CANCEL:return Bt.createUserCancelledError();case tr.NO_NETWORK:return Bt.createNoNetworkConnectivityError()}return new t(e,r,n)},t.createUserSwitchError=function(){return new t(yr.code,yr.desc)},t.createTokensNotFoundInCacheError=function(){return new t(Cr.code,Cr.desc)},t}(ae),Ir=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return u(r,t),r.prototype.acquireToken=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a;return p(this,(function(s){switch(s.label){case 0:return r=this.performanceClient.startMeasurement(xe.SilentCacheClientAcquireToken,t.correlationId),n=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createSilentFlowClient(n,t.authority,t.azureCloudOptions)];case 1:o=s.sent(),this.logger.verbose("Silent auth client created"),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,o.acquireCachedToken(t)];case 3:return i=s.sent(),r.endMeasurement({success:!0,fromCache:!0}),[2,i];case 4:throw(a=s.sent())instanceof Bt&&a.errorCode===Lt.signingKeyNotFoundInStorage.code&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),r.endMeasurement({errorCode:a instanceof ae&&a.errorCode||void 0,subErrorCode:a instanceof ae&&a.subError||void 0,success:!1}),a;case 5:return[2]}}))}))},r.prototype.logout=function(){return Promise.reject(Bt.createSilentLogoutUnsupportedError())},r.prototype.createSilentFlowClient=function(e,t,r){return h(this,void 0,void 0,(function(){var n;return p(this,(function(o){switch(o.label){case 0:return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(e,t,r)];case 1:return n=o.sent(),[2,new st(n,this.performanceClient)]}}))}))},r.prototype.initializeSilentRequest=function(e,t){return h(this,void 0,void 0,(function(){var r;return p(this,(function(n){switch(n.label){case 0:return this.performanceClient.addQueueMeasurement(xe.InitializeSilentRequest,this.correlationId),this.performanceClient.setPreQueueTime(xe.InitializeBaseRequest,this.correlationId),r=[l({},e)],[4,this.initializeBaseRequest(e)];case 1:return[2,l.apply(void 0,[l.apply(void 0,r.concat([n.sent()])),{account:t,forceRefresh:e.forceRefresh||!1}])]}}))}))},r}(gr),wr=function(t){function r(e,r,n,o,i,a,s,c,u,l,d,h){var p=t.call(this,e,r,n,o,i,a,c,u,h)||this;return p.apiId=s,p.accountId=l,p.nativeMessageHandler=u,p.nativeStorageManager=d,p.silentCacheClient=new Ir(e,p.nativeStorageManager,n,o,i,a,c,u,h),p}return u(r,t),r.prototype.acquireToken=function(e){return h(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return p(this,(function(c){switch(c.label){case 0:return this.logger.trace("NativeInteractionClient - acquireToken called."),t=this.performanceClient.startMeasurement(xe.NativeInteractionClientAcquireToken,e.correlationId),r=ze.nowSeconds(),[4,this.initializeNativeRequest(e)];case 1:n=c.sent(),c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.acquireTokensFromCache(this.accountId,n)];case 3:return o=c.sent(),t.endMeasurement({success:!0,isNativeBroker:!1,fromCache:!0}),[2,o];case 4:return c.sent(),this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call"),[3,5];case 5:return i={method:pt.GetToken,request:n},[4,this.nativeMessageHandler.sendMessage(i)];case 6:return a=c.sent(),s=this.validateNativeResponse(a),[2,this.handleNativeResponse(s,n,r).then((function(e){return t.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e})).catch((function(e){throw t.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e}))]}}))}))},r.prototype.createSilentCacheRequest=function(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:ye.fromString(e.scope).asArray(),account:t,forceRefresh:!1}},r.prototype.acquireTokensFromCache=function(e,t){return h(this,void 0,void 0,(function(){var r,n;return p(this,(function(o){switch(o.label){case 0:if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),ue.createNoAccountFoundError();if(!(r=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:e})))throw ue.createNoAccountFoundError();o.label=1;case 1:return o.trys.push([1,3,,4]),n=this.createSilentCacheRequest(t,r),[4,this.silentCacheClient.acquireToken(n)];case 2:return[2,o.sent()];case 3:throw o.sent();case 4:return[2]}}))}))},r.prototype.acquireTokenRedirect=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s;return p(this,(function(c){switch(c.label){case 0:return this.logger.trace("NativeInteractionClient - acquireTokenRedirect called."),[4,this.initializeNativeRequest(t)];case 1:r=c.sent(),n={method:pt.GetToken,request:r},c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.nativeMessageHandler.sendMessage(n)];case 3:return o=c.sent(),this.validateNativeResponse(o),[3,5];case 4:if((i=c.sent())instanceof Tr&&i.isFatal())throw i;return[3,5];case 5:return this.browserStorage.setTemporaryCache(mt.NATIVE_REQUEST,JSON.stringify(r),!0),a={apiId:e.ApiId.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},s=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(t.redirectUri),[4,this.navigationClient.navigateExternal(s,a)];case 6:return c.sent(),[2]}}))}))},r.prototype.handleRedirectPromise=function(){return h(this,void 0,void 0,(function(){var e,t,r,n,o,i,a,s;return p(this,(function(c){switch(c.label){case 0:if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(e=this.browserStorage.getCachedNativeRequest()))return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),[2,null];t=e.prompt,r=d(e,["prompt"]),t&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(mt.NATIVE_REQUEST)),n={method:pt.GetToken,request:r},o=ze.nowSeconds(),c.label=1;case 1:return c.trys.push([1,3,,4]),this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker."),[4,this.nativeMessageHandler.sendMessage(n)];case 2:return i=c.sent(),this.validateNativeResponse(i),a=this.handleNativeResponse(i,r,o),this.browserStorage.setInteractionInProgress(!1),[2,a];case 3:throw s=c.sent(),this.browserStorage.setInteractionInProgress(!1),s;case 4:return[2]}}))}))},r.prototype.logout=function(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")},r.prototype.handleNativeResponse=function(e,t,r){return h(this,void 0,void 0,(function(){var n,o,i,a,s,c;return p(this,(function(u){switch(u.label){case 0:if(this.logger.trace("NativeInteractionClient - handleNativeResponse called."),e.account.id!==t.accountId)throw Tr.createUserSwitchError();return[4,this.getDiscoveredAuthority(t.authority)];case 1:return n=u.sent(),o=n.getPreferredCache(),i=this.createIdTokenObj(e),a=this.createHomeAccountIdentifier(e,i),s=this.createAccountEntity(e,a,i,o),[4,this.generateAuthenticationResult(e,t,i,s,n.canonicalAuthority,r)];case 2:return c=u.sent(),this.cacheAccount(s),this.cacheNativeTokens(e,t,a,i,c.accessToken,c.tenantId,r),[2,c]}}))}))},r.prototype.createIdTokenObj=function(e){return new we(e.id_token||A.EMPTY_STRING,this.browserCrypto)},r.prototype.createHomeAccountIdentifier=function(e,t){return Ie.generateHomeAccountId(e.client_info||A.EMPTY_STRING,fe.Default,this.logger,this.browserCrypto,t)},r.prototype.createAccountEntity=function(e,t,r,n){return Ie.createAccount(e.client_info,t,r,void 0,void 0,void 0,n,e.account.id)},r.prototype.generateScopes=function(e,t){return e.scope?ye.fromString(e.scope):ye.fromString(t.scope)},r.prototype.generatePopAccessToken=function(t,r){return h(this,void 0,void 0,(function(){var n,o;return p(this,(function(i){switch(i.label){case 0:if(r.tokenType!==e.AuthenticationScheme.POP)return[3,2];if(t.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),[2,t.shr];if(n=new tt(this.browserCrypto),o={resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,shrNonce:r.shrNonce},!r.keyId)throw ue.createKeyIdMissingError();return[4,n.signPopToken(t.access_token,r.keyId,o)];case 1:return[2,i.sent()];case 2:return[2,t.access_token]}}))}))},r.prototype.generateAuthenticationResult=function(t,r,n,o,i,a){return h(this,void 0,void 0,(function(){var s,c,u,l,d,h,g;return p(this,(function(p){switch(p.label){case 0:return s=this.addTelemetryFromNativeResponse(t),c=t.scope?ye.fromString(t.scope):ye.fromString(r.scope),u=t.account.properties||{},l=u.UID||n.claims.oid||n.claims.sub||A.EMPTY_STRING,d=u.TenantId||n.claims.tid||A.EMPTY_STRING,[4,this.generatePopAccessToken(t,r)];case 1:return h=p.sent(),g=r.tokenType===e.AuthenticationScheme.POP?e.AuthenticationScheme.POP:e.AuthenticationScheme.BEARER,[2,{authority:i,uniqueId:l,tenantId:d,scopes:c.asArray(),account:o.getAccountInfo(),idToken:t.id_token,idTokenClaims:n.claims,accessToken:h,fromCache:!!s&&this.isResponseFromCache(s),expiresOn:new Date(1e3*Number(a+t.expires_in)),tokenType:g,correlationId:this.correlationId,state:t.state,fromNativeBroker:!0}]}}))}))},r.prototype.cacheAccount=function(e){var t=this;this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch((function(e){t.logger.error("Error occurred while removing account context from browser storage. "+e)}))},r.prototype.cacheNativeTokens=function(t,r,n,o,i,a,s){var c=Ke.createIdTokenEntity(n,r.authority,t.id_token||A.EMPTY_STRING,r.clientId,o.claims.tid||A.EMPTY_STRING);this.nativeStorageManager.setIdTokenCredential(c);var u=s+(r.tokenType===e.AuthenticationScheme.POP?A.SHR_NONCE_VALIDITY:("string"==typeof t.expires_in?parseInt(t.expires_in,10):t.expires_in)||0),l=this.generateScopes(t,r),d=Ge.createAccessTokenEntity(n,r.authority,i,r.clientId,a,l.printScopes(),u,0,this.browserCrypto);this.nativeStorageManager.setAccessTokenCredential(d)},r.prototype.addTelemetryFromNativeResponse=function(e){var t=this.getMATSFromResponse(e);return t?(this.performanceClient.addStaticFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null},r.prototype.validateNativeResponse=function(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw Tr.createUnexpectedError("Response missing expected properties.")},r.prototype.getMATSFromResponse=function(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null},r.prototype.isResponseFromCache=function(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached},r.prototype.initializeNativeRequest=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,h,g=this;return p(this,(function(p){switch(p.label){case 0:return this.logger.trace("NativeInteractionClient - initializeNativeRequest called"),r=t.authority||this.config.auth.authority,(n=new Xe(r)).validateAsUri(),o=t.scopes,i=d(t,["scopes"]),(a=new ye(o||[])).appendScopes(_),s=function(){switch(g.apiId){case e.ApiId.ssoSilent:case e.ApiId.acquireTokenSilent_silentFlow:return g.logger.trace("initializeNativeRequest: silent request sets prompt to none"),M.NONE}if(t.prompt)switch(t.prompt){case M.NONE:case M.CONSENT:case M.LOGIN:return g.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),t.prompt;default:throw g.logger.trace("initializeNativeRequest: prompt = "+t.prompt+" is not compatible with native flow"),Bt.createNativePromptParameterNotSupportedError()}else g.logger.trace("initializeNativeRequest: prompt was not provided")},c=l(l({},i),{accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:a.printScopes(),redirectUri:this.getRedirectUri(t.redirectUri),prompt:s(),correlationId:this.correlationId,tokenType:t.authenticationScheme,windowTitleSubstring:document.title,extraParameters:l(l(l({},t.extraQueryParameters),t.tokenQueryParameters),{telemetry:Wt}),extendedExpiryToken:!1}),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:(u={resourceRequestUri:t.resourceRequestUri,resourceRequestMethod:t.resourceRequestMethod,shrClaims:t.shrClaims,shrNonce:t.shrNonce},[4,new tt(this.browserCrypto).generateCnf(u)]);case 1:h=p.sent(),c.reqCnf=h.reqCnfHash,c.keyId=h.kid,p.label=2;case 2:return[2,c]}}))}))},r}(pr),Er=function(){function t(e,t,r,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.responseId=0,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(xe.NativeMessageHandlerHandshake)}return t.prototype.sendMessage=function(e){return h(this,void 0,void 0,(function(){var t,r=this;return p(this,(function(n){return this.logger.trace("NativeMessageHandler - sendMessage called."),t={channel:Qt,extensionId:this.extensionId,responseId:this.responseId++,body:e},this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii("NativeMessageHandler - Sending request to browser extension: "+JSON.stringify(t)),this.messageChannel.port1.postMessage(t),[2,new Promise((function(e,n){r.resolvers.set(t.responseId,{resolve:e,reject:n})}))]}))}))},t.createProvider=function(e,r,n){return h(this,void 0,void 0,(function(){var o,i;return p(this,(function(a){switch(a.label){case 0:e.trace("NativeMessageHandler - createProvider called."),a.label=1;case 1:return a.trys.push([1,3,,5]),[4,(o=new t(e,r,n,jt)).sendHandshakeRequest()];case 2:return a.sent(),[2,o];case 3:return a.sent(),[4,(i=new t(e,r,n)).sendHandshakeRequest()];case 4:return a.sent(),[2,i];case 5:return[2]}}))}))},t.prototype.sendHandshakeRequest=function(){return h(this,void 0,void 0,(function(){var e,t=this;return p(this,(function(r){return this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1),e={channel:Qt,extensionId:this.extensionId,responseId:this.responseId++,body:{method:pt.HandshakeRequest}},this.handshakeEvent.addStaticFields({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=function(e){t.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),[2,new Promise((function(r,n){t.handshakeResolvers.set(e.responseId,{resolve:r,reject:n}),t.timeoutId=window.setTimeout((function(){window.removeEventListener("message",t.windowListener,!1),t.messageChannel.port1.close(),t.messageChannel.port2.close(),t.handshakeEvent.endMeasurement({extensionHandshakeTimedOut:!0,success:!1}),n(Bt.createNativeHandshakeTimeoutError()),t.handshakeResolvers.delete(e.responseId)}),t.handshakeTimeoutMs)}))]}))}))},t.prototype.onWindowMessage=function(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source===window){var t=e.data;if(t.channel&&t.channel===Qt&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===pt.HandshakeRequest){this.logger.verbose(t.extensionId?"Extension with id: "+t.extensionId+" not installed":"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1);var r=this.handshakeResolvers.get(t.responseId);r&&(this.handshakeEvent.endMeasurement({success:!1,extensionInstalled:!1}),r.reject(Bt.createNativeExtensionNotInstalledError()))}}},t.prototype.onChannelMessage=function(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");var t=e.data,r=this.resolvers.get(t.responseId),n=this.handshakeResolvers.get(t.responseId);try{var o=t.body.method;if(o===pt.Response){if(!r)return;var i=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii("NativeMessageHandler - Received response from browser extension: "+JSON.stringify(i)),"Success"!==i.status)r.reject(Tr.createError(i.code,i.description,i.ext));else{if(!i.result)throw ae.createUnexpectedError("Event does not contain result.");i.result.code&&i.result.description?r.reject(Tr.createError(i.result.code,i.result.description,i.result.ext)):r.resolve(i.result)}this.resolvers.delete(t.responseId)}else if(o===pt.HandshakeResponse){if(!n)return;clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose("NativeMessageHandler - Received HandshakeResponse from extension: "+this.extensionId),this.handshakeEvent.endMeasurement({extensionInstalled:!0,success:!0}),n.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii("Error parsing response from WAM Extension: "+t.toString()),this.logger.errorPii("Unable to parse "+e),r?r.reject(t):n&&n.reject(t)}},t.prototype.getExtensionId=function(){return this.extensionId},t.prototype.getExtensionVersion=function(){return this.extensionVersion},t.isNativeAvailable=function(t,r,n,o){if(r.trace("isNativeAvailable called"),!t.system.allowNativeBroker)return r.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!n)return r.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case e.AuthenticationScheme.BEARER:case e.AuthenticationScheme.POP:return r.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return r.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0},t}(),kr=function(t){function r(e,r,n,o,i,a,s,c,u,l){var d=t.call(this,e,r,n,o,i,a,s,u,l)||this;return d.nativeStorage=c,d}return u(r,t),r.prototype.acquireToken=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,d,h=this;return p(this,(function(p){switch(p.label){case 0:return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,e.InteractionType.Redirect)];case 1:r=p.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||A.EMPTY_STRING,r.account||null),n=this.initializeServerTelemetryManager(e.ApiId.acquireTokenRedirect),o=function(e){e.persisted&&(h.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),h.browserStorage.cleanRequestByState(r.state))},p.label=2;case 2:return p.trys.push([2,7,,8]),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return i=p.sent(),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(n,r.authority,r.azureCloudOptions)];case 4:return a=p.sent(),this.logger.verbose("Auth code client created"),s=new mr(a,this.browserStorage,i,this.logger,this.browserCrypto,this.performanceClient),[4,a.getAuthCodeUrl(l(l({},r),{nativeBroker:Er.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}))];case 5:return c=p.sent(),u=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+u),window.addEventListener("pageshow",o),[4,s.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:u,onRedirectNavigate:t.onRedirectNavigate})];case 6:return[2,p.sent()];case 7:throw(d=p.sent())instanceof ae&&d.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),n.cacheFailedRequest(d),this.browserStorage.cleanRequestByState(r.state),d;case 8:return[2]}}))}))},r.prototype.handleRedirectPromise=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l,d,h,g;return p(this,(function(p){switch(p.label){case 0:r=this.initializeServerTelemetryManager(e.ApiId.handleRedirectPromise),p.label=1;case 1:if(p.trys.push([1,10,,11]),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),[2,null];if(!(n=this.getRedirectResponseHash(t||window.location.hash)))return this.logger.info("handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null];o=void 0;try{i=Xe.getDeserializedHash(n),o=this.validateAndExtractStateFromHash(i,e.InteractionType.Redirect),this.logger.verbose("State extracted from hash")}catch(t){return this.logger.info("handleRedirectPromise was unable to extract state due to: "+t),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),[2,null]}return a=this.browserStorage.getTemporaryCache(mt.ORIGIN_URI,!0)||A.EMPTY_STRING,s=Xe.removeHashFromUrl(a),c=Xe.removeHashFromUrl(window.location.href),s===c&&this.config.auth.navigateToLoginRequestUrl?(this.logger.verbose("Current page is loginRequestUrl, handling hash"),[4,this.handleHash(n,o,r)]):[3,3];case 2:return u=p.sent(),a.indexOf("#")>-1&&hr.replaceHash(a),[2,u];case 3:return this.config.auth.navigateToLoginRequestUrl?[3,4]:(this.logger.verbose("NavigateToLoginRequestUrl set to false, handling hash"),[2,this.handleHash(n,o,r)]);case 4:return hr.isInIframe()&&!this.config.system.allowRedirectInIframe?[3,9]:(this.browserStorage.setTemporaryCache(mt.URL_HASH,n,!0),l={apiId:e.ApiId.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0},d=!0,a&&"null"!==a?[3,6]:(h=hr.getHomepage(),this.browserStorage.setTemporaryCache(mt.ORIGIN_URI,h,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),[4,this.navigationClient.navigateInternal(h,l)]));case 5:return d=p.sent(),[3,8];case 6:return this.logger.verbose("Navigating to loginRequestUrl: "+a),[4,this.navigationClient.navigateInternal(a,l)];case 7:d=p.sent(),p.label=8;case 8:if(!d)return[2,this.handleHash(n,o,r)];p.label=9;case 9:return[2,null];case 10:throw(g=p.sent())instanceof ae&&g.setCorrelationId(this.correlationId),r.cacheFailedRequest(g),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),g;case 11:return[2]}}))}))},r.prototype.getRedirectResponseHash=function(e){if(this.logger.verbose("getRedirectResponseHash called"),Xe.hashContainsKnownProperties(e))return hr.clearHash(window),this.logger.verbose("Hash contains known properties, returning response hash"),e;var t=this.browserStorage.getTemporaryCache(mt.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(mt.URL_HASH)),this.logger.verbose("Hash does not contain known properties, returning cached hash"),t},r.prototype.handleHash=function(t,r,n){return h(this,void 0,void 0,(function(){var o,i,a,s,c,u,d=this;return p(this,(function(h){switch(h.label){case 0:if(o=this.browserStorage.getCachedRequest(r,this.browserCrypto),this.logger.verbose("handleHash called, retrieved cached request"),(i=Xe.getDeserializedHash(t)).accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Bt.createNativeConnectionNotEstablishedError();return a=new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,i.accountId,this.browserStorage,o.correlationId),s=Je.parseRequestState(this.browserCrypto,r).userRequestState,[2,a.acquireToken(l(l({},o),{state:s,prompt:void 0})).finally((function(){d.browserStorage.cleanRequestByState(r)}))]}if(!(c=this.browserStorage.getCachedAuthority(r)))throw Bt.createNoCachedAuthorityError();return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,o.correlationId),[4,this.createAuthCodeClient(n,c)];case 1:return u=h.sent(),this.logger.verbose("Auth code client created"),qe.removeThrottle(this.browserStorage,this.config.auth.clientId,o),[4,new mr(u,this.browserStorage,o,this.logger,this.browserCrypto,this.performanceClient).handleCodeResponseFromHash(t,r,u.authority,this.networkClient)];case 2:return[2,h.sent()]}}))}))},r.prototype.logout=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s;return p(this,(function(c){switch(c.label){case 0:this.logger.verbose("logoutRedirect called"),r=this.initializeLogoutRequest(t),n=this.initializeServerTelemetryManager(e.ApiId.logout),c.label=1;case 1:return c.trys.push([1,10,,11]),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Redirect,t),[4,this.clearCacheOnLogout(r.account)];case 2:return c.sent(),o={apiId:e.ApiId.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,r.correlationId),[4,this.createAuthCodeClient(n,t&&t.authority)];case 3:return i=c.sent(),this.logger.verbose("Auth code client created"),a=i.getLogoutUri(r),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Redirect,r),t&&"function"==typeof t.onRedirectNavigate?!1===t.onRedirectNavigate(a)?[3,5]:(this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,o)]):[3,7];case 4:return c.sent(),[2];case 5:this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation"),c.label=6;case 6:return[3,9];case 7:return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),[4,this.navigationClient.navigateExternal(a,o)];case 8:return c.sent(),[2];case 9:return[3,11];case 10:throw(s=c.sent())instanceof ae&&s.setCorrelationId(this.correlationId),n.cacheFailedRequest(s),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Redirect,null,s),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),s;case 11:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Redirect),[2]}}))}))},r.prototype.getRedirectStartPage=function(e){var t=e||window.location.href;return Xe.getAbsoluteUrl(t,hr.getCurrentUri())},r}(gr),Sr=function(t){function r(e,r,n,o,i,a,s,c,u,l){var d=t.call(this,e,r,n,o,i,a,s,u,l)||this;return d.unloadWindow=d.unloadWindow.bind(d),d.nativeStorage=c,d}return u(r,t),r.prototype.acquireToken=function(e){try{var t=this.generatePopupName(e.scopes||_,e.authority||this.config.auth.authority),r=e.popupWindowAttributes||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t,r);this.logger.verbose("asyncPopup set to false, opening popup before acquiring token");var n=this.openSizedPopup("about:blank",t,r);return this.acquireTokenPopupAsync(e,t,r,n)}catch(e){return Promise.reject(e)}},r.prototype.logout=function(e){try{this.logger.verbose("logoutPopup called");var t=this.initializeLogoutRequest(e),r=this.generateLogoutPopupName(t),n=e&&e.authority,o=e&&e.mainWindowRedirectUri,i=(null==e?void 0:e.popupWindowAttributes)||{};if(this.config.system.asyncPopups)return this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,i,n,void 0,o);this.logger.verbose("asyncPopup set to false, opening popup");var a=this.openSizedPopup("about:blank",r,i);return this.logoutPopupAsync(t,r,i,n,a,o)}catch(e){return Promise.reject(e)}},r.prototype.acquireTokenPopupAsync=function(t,r,n,o){return h(this,void 0,void 0,(function(){var i,a,s,c,u,d,h,g,f,m,v,y,C,T,I,w,E=this;return p(this,(function(p){switch(p.label){case 0:return this.logger.verbose("acquireTokenPopupAsync called"),i=this.initializeServerTelemetryManager(e.ApiId.acquireTokenPopup),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,e.InteractionType.Popup)];case 1:a=p.sent(),this.browserStorage.updateCacheEntries(a.state,a.nonce,a.authority,a.loginHint||A.EMPTY_STRING,a.account||null),p.label=2;case 2:return p.trys.push([2,8,,9]),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationCodeRequest,t.correlationId),[4,this.initializeAuthorizationCodeRequest(a)];case 3:return s=p.sent(),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(i,a.authority,a.azureCloudOptions)];case 4:return c=p.sent(),this.logger.verbose("Auth code client created"),u=Er.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme),d=void 0,u&&(d=this.performanceClient.startMeasurement(xe.FetchAccountIdWithNativeBroker,t.correlationId)),[4,c.getAuthCodeUrl(l(l({},a),{nativeBroker:u}))];case 5:return h=p.sent(),g=new fr(c,this.browserStorage,s,this.logger,this.performanceClient),f={popup:o,popupName:r,popupWindowAttributes:n},m=this.initiateAuthRequest(h,f),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:m},null),[4,this.monitorPopupForHash(m)];case 6:if(v=p.sent(),y=Xe.getDeserializedHash(v),C=this.validateAndExtractStateFromHash(y,e.InteractionType.Popup,a.correlationId),qe.removeThrottle(this.browserStorage,this.config.auth.clientId,s),y.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),d&&d.endMeasurement({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw Bt.createNativeConnectionNotEstablishedError();return T=new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,y.accountId,this.nativeStorage,a.correlationId),I=Je.parseRequestState(this.browserCrypto,C).userRequestState,[2,T.acquireToken(l(l({},a),{state:I,prompt:void 0})).finally((function(){E.browserStorage.cleanRequestByState(C)}))]}return[4,g.handleCodeResponseFromHash(v,C,c.authority,this.networkClient)];case 7:return[2,p.sent()];case 8:throw w=p.sent(),o&&o.close(),w instanceof ae&&w.setCorrelationId(this.correlationId),i.cacheFailedRequest(w),this.browserStorage.cleanRequestByState(a.state),w;case 9:return[2]}}))}))},r.prototype.logoutPopupAsync=function(t,r,n,o,i,a){return h(this,void 0,void 0,(function(){var s,c,u,l,d,h,g;return p(this,(function(p){switch(p.label){case 0:this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(e.EventType.LOGOUT_START,e.InteractionType.Popup,t),s=this.initializeServerTelemetryManager(e.ApiId.logoutPopup),p.label=1;case 1:return p.trys.push([1,5,,6]),[4,this.clearCacheOnLogout(t.account)];case 2:return p.sent(),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(s,o)];case 3:return c=p.sent(),this.logger.verbose("Auth code client created"),u=c.getLogoutUri(t),this.eventHandler.emitEvent(e.EventType.LOGOUT_SUCCESS,e.InteractionType.Popup,t),l=this.openPopup(u,{popupName:r,popupWindowAttributes:n,popup:i}),this.eventHandler.emitEvent(e.EventType.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:l},null),[4,this.waitForLogoutPopup(l)];case 4:return p.sent(),a?(d={apiId:e.ApiId.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},h=Xe.getAbsoluteUrl(a,hr.getCurrentUri()),this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii("Redirecting main window to: "+h),this.navigationClient.navigateInternal(h,d)):this.logger.verbose("No main window navigation requested"),[3,6];case 5:throw g=p.sent(),i&&i.close(),g instanceof ae&&g.setCorrelationId(this.correlationId),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(e.EventType.LOGOUT_FAILURE,e.InteractionType.Popup,null,g),this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),s.cacheFailedRequest(g),g;case 6:return this.eventHandler.emitEvent(e.EventType.LOGOUT_END,e.InteractionType.Popup),[2]}}))}))},r.prototype.initiateAuthRequest=function(e,t){if(le.isEmpty(e))throw this.logger.error("Navigate url is empty"),Bt.createEmptyNavigationUriError();return this.logger.infoPii("Navigate to: "+e),this.openPopup(e,t)},r.prototype.monitorPopupForHash=function(e){var t=this;return new Promise((function(r,n){var o=t.config.system.windowHashTimeout/t.config.system.pollIntervalMilliseconds,i=0;t.logger.verbose("PopupHandler.monitorPopupForHash - polling started");var a=setInterval((function(){if(e.closed)return t.logger.error("PopupHandler.monitorPopupForHash - window closed"),t.cleanPopup(),clearInterval(a),void n(Bt.createUserCancelledError());var s=A.EMPTY_STRING,c=A.EMPTY_STRING;try{s=e.location.href,c=e.location.hash}catch(e){}le.isEmpty(s)||"about:blank"===s||(t.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),i++,c?(t.logger.verbose("PopupHandler.monitorPopupForHash - found hash in url"),clearInterval(a),t.cleanPopup(e),Xe.hashContainsKnownProperties(c)?(t.logger.verbose("PopupHandler.monitorPopupForHash - hash contains known properties, returning."),r(c)):(t.logger.error("PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely."),t.logger.errorPii("PopupHandler.monitorPopupForHash - hash found: "+c),n(Bt.createHashDoesNotContainKnownPropertiesError()))):i>o&&(t.logger.error("PopupHandler.monitorPopupForHash - unable to find hash in url, timing out"),clearInterval(a),n(Bt.createMonitorPopupTimeoutError())))}),t.config.system.pollIntervalMilliseconds)}))},r.prototype.waitForLogoutPopup=function(e){var t=this;return new Promise((function(r){t.logger.verbose("PopupHandler.waitForLogoutPopup - polling started");var n=setInterval((function(){e.closed&&(t.logger.error("PopupHandler.waitForLogoutPopup - window closed"),t.cleanPopup(),clearInterval(n),r());var o=A.EMPTY_STRING;try{o=e.location.href}catch(e){}le.isEmpty(o)||"about:blank"===o||(t.logger.verbose("PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing."),clearInterval(n),t.cleanPopup(e),r())}),t.config.system.pollIntervalMilliseconds)}))},r.prototype.openPopup=function(e,t){try{var r=void 0;if(t.popup?(r=t.popup,this.logger.verbosePii("Navigating popup window to: "+e),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii("Opening popup window to: "+e),r=this.openSizedPopup(e,t.popupName,t.popupWindowAttributes)),!r)throw Bt.createEmptyWindowCreatedError();return r.focus&&r.focus(),this.currentWindow=r,window.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),Bt.createPopupWindowError(e.toString())}},r.prototype.openSizedPopup=function(e,t,r){var n,o,i,a,s=window.screenLeft?window.screenLeft:window.screenX,c=window.screenTop?window.screenTop:window.screenY,u=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,l=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,d=null===(n=r.popupSize)||void 0===n?void 0:n.width,h=null===(o=r.popupSize)||void 0===o?void 0:o.height,p=null===(i=r.popupPosition)||void 0===i?void 0:i.top,g=null===(a=r.popupPosition)||void 0===a?void 0:a.left;return(!d||d<0||d>u)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),d=Dt),(!h||h<0||h>l)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),h=Ft),(!p||p<0||p>l)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),p=Math.max(0,l/2-Ft/2+c)),(!g||g<0||g>u)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),g=Math.max(0,u/2-Dt/2+s)),window.open(e,t,"width="+d+", height="+h+", top="+p+", left="+g+", scrollbars=yes")},r.prototype.unloadWindow=function(t){this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()},r.prototype.cleanPopup=function(e){e&&e.close(),window.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)},r.prototype.generatePopupName=function(e,t){return Kt+"."+this.config.auth.clientId+"."+e.join("-")+"."+t+"."+this.correlationId},r.prototype.generateLogoutPopupName=function(e){var t=e.account&&e.account.homeAccountId;return Kt+"."+this.config.auth.clientId+"."+t+"."+this.correlationId},r}(gr),br=function(){function e(){}return e.prototype.navigateInternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.prototype.navigateExternal=function(t,r){return e.defaultNavigateWindow(t,r)},e.defaultNavigateWindow=function(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((function(e){setTimeout((function(){e(!0)}),t.timeout)}))},e}(),Ar=6e3; /*! @azure/msal-browser v2.37.0 2023-05-02 */ var _r,Rr=function(e){function t(t,r,n,o,i,a){var s=e.call(this,t,r,n,o,a)||this;return s.navigateFrameWait=i.navigateFrameWait,s.pollIntervalMilliseconds=i.pollIntervalMilliseconds,s}return u(t,e),t.prototype.initiateAuthRequest=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:if(this.performanceClient.addQueueMeasurement(xe.SilentHandlerInitiateAuthRequest,this.authCodeRequest.correlationId),le.isEmpty(e))throw this.logger.info("Navigate url is empty"),Bt.createEmptyNavigationUriError();return this.navigateFrameWait?(this.performanceClient.setPreQueueTime(xe.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),[4,this.loadFrame(e)]):[3,2];case 1:return[2,t.sent()];case 2:return[2,this.loadFrameSync(e)]}}))}))},t.prototype.monitorIframeForHash=function(e,t){var r=this;return this.performanceClient.addQueueMeasurement(xe.SilentHandlerMonitorIframeForHash,this.authCodeRequest.correlationId),new Promise((function(n,o){t<Ar&&r.logger.warning("system.loadFrameTimeout or system.iframeHashTimeout set to lower ("+t+"ms) than the default ("+Ar+"ms). This may result in timeouts.");var i=window.performance.now()+t,a=setInterval((function(){if(window.performance.now()>i)return r.removeHiddenIframe(e),clearInterval(a),void o(Bt.createMonitorIframeTimeoutError());var t=A.EMPTY_STRING,s=e.contentWindow;try{t=s?s.location.href:A.EMPTY_STRING}catch(e){}if(!le.isEmpty(t)){var c=s?s.location.hash:A.EMPTY_STRING;return Xe.hashContainsKnownProperties(c)?(r.removeHiddenIframe(e),clearInterval(a),void n(c)):void 0}}),r.pollIntervalMilliseconds)}))},t.prototype.loadFrame=function(e){var t=this;return this.performanceClient.addQueueMeasurement(xe.SilentHandlerLoadFrame,this.authCodeRequest.correlationId),new Promise((function(r,n){var o=t.createHiddenIframe();setTimeout((function(){o?(o.src=e,r(o)):n("Unable to load iframe")}),t.navigateFrameWait)}))},t.prototype.loadFrameSync=function(e){var t=this.createHiddenIframe();return t.src=e,t},t.prototype.createHiddenIframe=function(){var e=document.createElement("iframe");return e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.getElementsByTagName("body")[0].appendChild(e),e},t.prototype.removeHiddenIframe=function(e){document.body===e.parentNode&&document.body.removeChild(e)},t}(fr),Pr=function(t){function r(e,r,n,o,i,a,s,c,u,l,d){var h=t.call(this,e,r,n,o,i,a,c,l,d)||this;return h.apiId=s,h.nativeStorage=u,h}return u(r,t),r.prototype.acquireToken=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a;return p(this,(function(s){switch(s.label){case 0:if(this.performanceClient.addQueueMeasurement(xe.SilentIframeClientAcquireToken,t.correlationId),this.logger.verbose("acquireTokenByIframe called"),r=this.performanceClient.startMeasurement(xe.SilentIframeClientAcquireToken,t.correlationId),le.isEmpty(t.loginHint)&&le.isEmpty(t.sid)&&(!t.account||le.isEmpty(t.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),t.prompt&&t.prompt!==M.NONE&&t.prompt!==M.NO_SESSION)throw r.endMeasurement({success:!1}),Bt.createSilentPromptValueError(t.prompt);return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(l(l({},t),{prompt:t.prompt||M.NONE}),e.InteractionType.Silent)];case 1:n=s.sent(),this.browserStorage.updateCacheEntries(n.state,n.nonce,n.authority,n.loginHint||A.EMPTY_STRING,n.account||null),o=this.initializeServerTelemetryManager(this.apiId),s.label=2;case 2:return s.trys.push([2,5,,6]),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientCreateAuthCodeClient,t.correlationId),[4,this.createAuthCodeClient(o,n.authority,n.azureCloudOptions)];case 3:return i=s.sent(),this.logger.verbose("Auth code client created"),this.performanceClient.setPreQueueTime(xe.SilentIframeClientTokenHelper,t.correlationId),[4,this.silentTokenHelper(i,n).then((function(e){return r.endMeasurement({success:!0,fromCache:!1,requestId:e.requestId}),e}))];case 4:return[2,s.sent()];case 5:throw(a=s.sent())instanceof ae&&a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a),this.browserStorage.cleanRequestByState(n.state),r.endMeasurement({errorCode:a instanceof ae&&a.errorCode||void 0,subErrorCode:a instanceof ae&&a.subError||void 0,success:!1}),a;case 6:return[2]}}))}))},r.prototype.logout=function(){return Promise.reject(Bt.createSilentLogoutUnsupportedError())},r.prototype.silentTokenHelper=function(t,r){return h(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,h,g=this;return p(this,(function(p){switch(p.label){case 0:return this.performanceClient.addQueueMeasurement(xe.SilentIframeClientTokenHelper,r.correlationId),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationCodeRequest,r.correlationId),[4,this.initializeAuthorizationCodeRequest(r)];case 1:return n=p.sent(),this.performanceClient.setPreQueueTime(xe.GetAuthCodeUrl,r.correlationId),[4,t.getAuthCodeUrl(l(l({},r),{nativeBroker:Er.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,r.authenticationScheme)}))];case 2:return o=p.sent(),i=new Rr(t,this.browserStorage,n,this.logger,this.config.system,this.performanceClient),this.performanceClient.setPreQueueTime(xe.SilentHandlerInitiateAuthRequest,r.correlationId),[4,i.initiateAuthRequest(o)];case 3:return a=p.sent(),this.performanceClient.setPreQueueTime(xe.SilentHandlerMonitorIframeForHash,r.correlationId),[4,i.monitorIframeForHash(a,this.config.system.iframeHashTimeout)];case 4:if(s=p.sent(),c=Xe.getDeserializedHash(s),u=this.validateAndExtractStateFromHash(c,e.InteractionType.Silent,n.correlationId),c.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw Bt.createNativeConnectionNotEstablishedError();return d=new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,c.accountId,this.browserStorage,this.correlationId),h=Je.parseRequestState(this.browserCrypto,u).userRequestState,[2,d.acquireToken(l(l({},r),{state:h,prompt:r.prompt||M.NONE})).finally((function(){g.browserStorage.cleanRequestByState(u)}))]}return this.performanceClient.setPreQueueTime(xe.HandleCodeResponseFromHash,r.correlationId),[2,i.handleCodeResponseFromHash(s,u,t.authority,this.networkClient)]}}))}))},r}(gr),Mr=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return u(r,t),r.prototype.acquireToken=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s=this;return p(this,(function(c){switch(c.label){case 0:return this.performanceClient.addQueueMeasurement(xe.SilentRefreshClientAcquireToken,t.correlationId),this.performanceClient.setPreQueueTime(xe.InitializeBaseRequest,t.correlationId),n=[l({},t)],[4,this.initializeBaseRequest(t)];case 1:return r=l.apply(void 0,n.concat([c.sent()])),o=this.performanceClient.startMeasurement(xe.SilentRefreshClientAcquireToken,r.correlationId),i=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(i,r.authority,r.azureCloudOptions)];case 2:return a=c.sent(),this.logger.verbose("Refresh token client created"),this.performanceClient.setPreQueueTime(xe.RefreshTokenClientAcquireTokenByRefreshToken,t.correlationId),[2,a.acquireTokenByRefreshToken(r).then((function(e){return o.endMeasurement({success:!0,fromCache:e.fromCache,requestId:e.requestId}),e})).catch((function(e){throw e instanceof ae&&e.setCorrelationId(s.correlationId),i.cacheFailedRequest(e),o.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e}))]}}))}))},r.prototype.logout=function(){return Promise.reject(Bt.createSilentLogoutUnsupportedError())},r.prototype.createRefreshTokenClient=function(e,t,r){return h(this,void 0,void 0,(function(){var n;return p(this,(function(o){switch(o.label){case 0:return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientGetClientConfiguration,this.correlationId),[4,this.getClientConfiguration(e,t,r)];case 1:return n=o.sent(),[2,new at(n,this.performanceClient)]}}))}))},r}(gr),Nr=function(){function t(e,t){this.eventCallbacks=new Map,this.logger=e,this.browserCrypto=t,this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}return t.prototype.addEventCallback=function(e){if("undefined"!=typeof window){var t=this.browserCrypto.createNewGuid();return this.eventCallbacks.set(t,e),this.logger.verbose("Event callback registered with id: "+t),t}return null},t.prototype.removeEventCallback=function(e){this.eventCallbacks.delete(e),this.logger.verbose("Event callback "+e+" removed.")},t.prototype.enableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))},t.prototype.disableAccountStorageEvents=function(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))},t.prototype.emitEvent=function(e,t,r,n){var o=this;if("undefined"!=typeof window){var i={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.logger.info("Emitting event: "+e),this.eventCallbacks.forEach((function(t,r){o.logger.verbose("Emitting event to callback "+r+": "+e),t.apply(null,[i])}))}},t.prototype.handleAccountCacheChange=function(t){try{var r=t.newValue||t.oldValue;if(!r)return;var n=JSON.parse(r);if("object"!=typeof n||!Ie.isAccountEntity(n))return;var o=Ee.toObject(new Ie,n).getAccountInfo();!t.oldValue&&t.newValue?(this.logger.info("Account was added to cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_ADDED,void 0,o)):!t.newValue&&t.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.emitEvent(e.EventType.ACCOUNT_REMOVED,void 0,o))}catch(t){return}},t}(),Or=function(){function e(){}return e.decimalToHex=function(e){for(var t=e.toString(16);t.length<2;)t="0"+t;return t},e}(),qr=function(){function e(e){this.cryptoObj=e}return e.prototype.generateGuid=function(){try{var e=new Uint8Array(16);return this.cryptoObj.getRandomValues(e),e[6]|=64,e[6]&=79,e[8]|=128,e[8]&=191,Or.decimalToHex(e[0])+Or.decimalToHex(e[1])+Or.decimalToHex(e[2])+Or.decimalToHex(e[3])+"-"+Or.decimalToHex(e[4])+Or.decimalToHex(e[5])+"-"+Or.decimalToHex(e[6])+Or.decimalToHex(e[7])+"-"+Or.decimalToHex(e[8])+Or.decimalToHex(e[9])+"-"+Or.decimalToHex(e[10])+Or.decimalToHex(e[11])+Or.decimalToHex(e[12])+Or.decimalToHex(e[13])+Or.decimalToHex(e[14])+Or.decimalToHex(e[15])}catch(e){for(var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",r="0123456789abcdef",n=0,o=A.EMPTY_STRING,i=0;i<36;i++)"-"!==t[i]&&"4"!==t[i]&&(n=16*Math.random()|0),"x"===t[i]?o+=r[n]:"y"===t[i]?(n&=3,o+=r[n|=8]):o+=t[i];return o}},e.prototype.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}(),Ur=function(){function e(){}return e.stringToUtf8Arr=function(e){for(var t,r=0,n=e.length,o=0;o<n;o++)r+=(t=e.charCodeAt(o))<128?1:t<2048?2:t<65536?3:t<2097152?4:t<67108864?5:6;for(var i=new Uint8Array(r),a=0,s=0;a<r;s++)(t=e.charCodeAt(s))<128?i[a++]=t:t<2048?(i[a++]=192+(t>>>6),i[a++]=128+(63&t)):t<65536?(i[a++]=224+(t>>>12),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<2097152?(i[a++]=240+(t>>>18),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):t<67108864?(i[a++]=248+(t>>>24),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t)):(i[a++]=252+(t>>>30),i[a++]=128+(t>>>24&63),i[a++]=128+(t>>>18&63),i[a++]=128+(t>>>12&63),i[a++]=128+(t>>>6&63),i[a++]=128+(63&t));return i},e.stringToArrayBuffer=function(e){for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return t},e.utf8ArrToString=function(e){for(var t=A.EMPTY_STRING,r=void 0,n=e.length,o=0;o<n;o++)r=e[o],t+=String.fromCharCode(r>251&&r<254&&o+5<n?1073741824*(r-252)+(e[++o]-128<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>247&&r<252&&o+4<n?(r-248<<24)+(e[++o]-128<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>239&&r<248&&o+3<n?(r-240<<18)+(e[++o]-128<<12)+(e[++o]-128<<6)+e[++o]-128:r>223&&r<240&&o+2<n?(r-224<<12)+(e[++o]-128<<6)+e[++o]-128:r>191&&r<224&&o+1<n?(r-192<<6)+e[++o]-128:r);return t},e.getSortedObjectString=function(e){return JSON.stringify(e,Object.keys(e).sort())},e}(),xr=function(){function e(){}return e.prototype.urlEncode=function(e){return encodeURIComponent(this.encode(e).replace(/=/g,A.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_"))},e.prototype.urlEncodeArr=function(e){return this.base64EncArr(e).replace(/=/g,A.EMPTY_STRING).replace(/\+/g,"-").replace(/\//g,"_")},e.prototype.encode=function(e){var t=Ur.stringToUtf8Arr(e);return this.base64EncArr(t)},e.prototype.base64EncArr=function(e){for(var t=(3-e.length%3)%3,r=A.EMPTY_STRING,n=void 0,o=e.length,i=0,a=0;a<o;a++)n=a%3,i|=e[a]<<(16>>>n&24),2!==n&&e.length-a!=1||(r+=String.fromCharCode(this.uint6ToB64(i>>>18&63),this.uint6ToB64(i>>>12&63),this.uint6ToB64(i>>>6&63),this.uint6ToB64(63&i)),i=0);return 0===t?r:r.substring(0,r.length-t)+(1===t?"=":"==")},e.prototype.uint6ToB64=function(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65},e}(),Lr=function(){function e(){}return e.prototype.decode=function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Invalid base64 string")}var r=this.base64DecToArr(t);return Ur.utf8ArrToString(r)},e.prototype.base64DecToArr=function(e,t){for(var r=e.replace(/[^A-Za-z0-9\+\/]/g,A.EMPTY_STRING),n=r.length,o=t?Math.ceil((3*n+1>>>2)/t)*t:3*n+1>>>2,i=new Uint8Array(o),a=void 0,s=void 0,c=0,u=0,l=0;l<n;l++)if(s=3&l,c|=this.b64ToUint6(r.charCodeAt(l))<<18-6*s,3===s||n-l==1){for(a=0;a<3&&u<o;a++,u++)i[u]=c>>>(16>>>a&24)&255;c=0}return i},e.prototype.b64ToUint6=function(e){return e>64&&e<91?e-65:e>96&&e<123?e-71:e>47&&e<58?e+4:43===e?62:47===e?63:0},e}(),Br=function(){function e(e){this.base64Encode=new xr,this.cryptoObj=e}return e.prototype.generateCodes=function(){return h(this,void 0,void 0,(function(){var e,t;return p(this,(function(r){switch(r.label){case 0:return e=this.generateCodeVerifier(),[4,this.generateCodeChallengeFromVerifier(e)];case 1:return t=r.sent(),[2,{verifier:e,challenge:t}]}}))}))},e.prototype.generateCodeVerifier=function(){try{var e=new Uint8Array(32);return this.cryptoObj.getRandomValues(e),this.base64Encode.urlEncodeArr(e)}catch(e){throw Bt.createPkceNotGeneratedError(e)}},e.prototype.generateCodeChallengeFromVerifier=function(e){return h(this,void 0,void 0,(function(){var t,r;return p(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.cryptoObj.sha256Digest(e)];case 1:return t=n.sent(),[2,this.base64Encode.urlEncodeArr(new Uint8Array(t))];case 2:throw r=n.sent(),Bt.createPkceNotGeneratedError(r);case 3:return[2]}}))}))},e}(),Hr=function(){function e(){}return e.prototype.getRandomValues=function(e){return window.crypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,window.crypto.subtle.generateKey(e,t,r)]}))}))},e.prototype.exportKey=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){return[2,window.crypto.subtle.exportKey($t,e)]}))}))},e.prototype.importKey=function(e,t,r,n){return h(this,void 0,void 0,(function(){return p(this,(function(o){return[2,window.crypto.subtle.importKey($t,e,t,r,n)]}))}))},e.prototype.sign=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,window.crypto.subtle.sign(e,t,r)]}))}))},e.prototype.digest=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,window.crypto.subtle.digest(e,t)]}))}))},e}(),Dr=function(){function e(){}return e.prototype.initPrng=function(e){return window.msrCrypto.initPrng(f(e))},e.prototype.getRandomValues=function(e){return window.msrCrypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,window.msrCrypto.subtle.generateKey(e,t,r)]}))}))},e.prototype.exportKey=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){return[2,window.msrCrypto.subtle.exportKey($t,e)]}))}))},e.prototype.importKey=function(e,t,r,n){return h(this,void 0,void 0,(function(){return p(this,(function(o){return[2,window.msrCrypto.subtle.importKey($t,e,t,r,n)]}))}))},e.prototype.sign=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,window.msrCrypto.subtle.sign(e,t,r)]}))}))},e.prototype.digest=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,window.msrCrypto.subtle.digest(e,t)]}))}))},e}(),Fr=function(){function e(){}return e.prototype.getRandomValues=function(e){return window.msCrypto.getRandomValues(e)},e.prototype.generateKey=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.generateKey(e,t,r);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.exportKey=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){return[2,new Promise((function(t,r){var n=window.msCrypto.subtle.exportKey($t,e);n.addEventListener("complete",(function(e){var n=e.target.result,o=Ur.utf8ArrToString(new Uint8Array(n)).replace(/\r/g,A.EMPTY_STRING).replace(/\n/g,A.EMPTY_STRING).replace(/\t/g,A.EMPTY_STRING).split(" ").join(A.EMPTY_STRING).replace("\0",A.EMPTY_STRING);try{t(JSON.parse(o))}catch(e){r(e)}})),n.addEventListener("error",(function(e){r(e)}))}))]}))}))},e.prototype.importKey=function(e,t,r,n){return h(this,void 0,void 0,(function(){var o,i;return p(this,(function(a){return o=Ur.getSortedObjectString(e),i=Ur.stringToArrayBuffer(o),[2,new Promise((function(e,o){var a=window.msCrypto.subtle.importKey($t,i,t,r,n);a.addEventListener("complete",(function(t){e(t.target.result)})),a.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.sign=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,new Promise((function(n,o){var i=window.msCrypto.subtle.sign(e,t,r);i.addEventListener("complete",(function(e){n(e.target.result)})),i.addEventListener("error",(function(e){o(e)}))}))]}))}))},e.prototype.digest=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,new Promise((function(r,n){var o=window.msCrypto.subtle.digest(e,t.buffer);o.addEventListener("complete",(function(e){r(e.target.result)})),o.addEventListener("error",(function(e){n(e)}))}))]}))}))},e}(),Kr="SHA-256",zr=new Uint8Array([1,0,1]),Gr=function(){function e(e,t){var r,n;if(this.logger=e,this.cryptoOptions=t,this.hasBrowserCrypto())this.logger.verbose("BrowserCrypto: modern crypto interface available"),this.subtleCrypto=new Hr;else if(this.hasIECrypto())this.logger.verbose("BrowserCrypto: MS crypto interface available"),this.subtleCrypto=new Fr;else{if(!this.hasMsrCrypto()||!(null===(r=this.cryptoOptions)||void 0===r?void 0:r.useMsrCrypto))throw this.hasMsrCrypto()&&this.logger.info("BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled"),this.logger.error("BrowserCrypto: No crypto interfaces available."),Bt.createCryptoNotAvailableError("Browser crypto, msCrypto, or msrCrypto interfaces not available.");this.logger.verbose("BrowserCrypto: MSR crypto interface available"),this.subtleCrypto=new Dr}if(this.subtleCrypto.initPrng){if(this.logger.verbose("BrowserCrypto: Interface requires entropy"),!(null===(n=this.cryptoOptions)||void 0===n?void 0:n.entropy))throw this.logger.error("BrowserCrypto: Interface requires entropy but none provided."),nr.createEntropyNotProvided();this.logger.verbose("BrowserCrypto: Entropy provided"),this.subtleCrypto.initPrng(this.cryptoOptions.entropy)}this.keygenAlgorithmOptions={name:"RSASSA-PKCS1-v1_5",hash:Kr,modulusLength:2048,publicExponent:zr}}return e.prototype.hasIECrypto=function(){return"msCrypto"in window},e.prototype.hasBrowserCrypto=function(){return"crypto"in window},e.prototype.hasMsrCrypto=function(){return"msrCrypto"in window},e.prototype.sha256Digest=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){return t=Ur.stringToUtf8Arr(e),[2,this.subtleCrypto.digest({name:Kr},t)]}))}))},e.prototype.getRandomValues=function(e){return this.subtleCrypto.getRandomValues(e)},e.prototype.generateKeyPair=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,this.subtleCrypto.generateKey(this.keygenAlgorithmOptions,e,t)]}))}))},e.prototype.exportJwk=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){return[2,this.subtleCrypto.exportKey(e)]}))}))},e.prototype.importJwk=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,this.subtleCrypto.importKey(e,this.keygenAlgorithmOptions,t,r)]}))}))},e.prototype.sign=function(e,t){return h(this,void 0,void 0,(function(){return p(this,(function(r){return[2,this.subtleCrypto.sign(this.keygenAlgorithmOptions,e,t)]}))}))},e}(),Qr=function(){function e(){this.dbName=Xt,this.version=1,this.tableName=Zt,this.dbOpen=!1}return e.prototype.open=function(){return h(this,void 0,void 0,(function(){var e=this;return p(this,(function(t){return[2,new Promise((function(t,r){var n=window.indexedDB.open(e.dbName,e.version);n.addEventListener("upgradeneeded",(function(t){t.target.result.createObjectStore(e.tableName)})),n.addEventListener("success",(function(r){var n=r;e.db=n.target.result,e.dbOpen=!0,t()})),n.addEventListener("error",(function(){return r(Bt.createDatabaseUnavailableError())}))}))]}))}))},e.prototype.closeConnection=function(){var e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)},e.prototype.validateDbIsOpen=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return this.dbOpen?[3,2]:[4,this.open()];case 1:return[2,e.sent()];case 2:return[2]}}))}))},e.prototype.getItem=function(e){return h(this,void 0,void 0,(function(){var t=this;return p(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Bt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).get(e);o.addEventListener("success",(function(e){var n=e;t.closeConnection(),r(n.target.result)})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.setItem=function(e,t){return h(this,void 0,void 0,(function(){var r=this;return p(this,(function(n){switch(n.label){case 0:return[4,this.validateDbIsOpen()];case 1:return n.sent(),[2,new Promise((function(n,o){if(!r.db)return o(Bt.createDatabaseNotOpenError());var i=r.db.transaction([r.tableName],"readwrite").objectStore(r.tableName).put(t,e);i.addEventListener("success",(function(){r.closeConnection(),n()})),i.addEventListener("error",(function(e){r.closeConnection(),o(e)}))}))]}}))}))},e.prototype.removeItem=function(e){return h(this,void 0,void 0,(function(){var t=this;return p(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Bt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readwrite").objectStore(t.tableName).delete(e);o.addEventListener("success",(function(){t.closeConnection(),r()})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.getKeys=function(){return h(this,void 0,void 0,(function(){var e=this;return p(this,(function(t){switch(t.label){case 0:return[4,this.validateDbIsOpen()];case 1:return t.sent(),[2,new Promise((function(t,r){if(!e.db)return r(Bt.createDatabaseNotOpenError());var n=e.db.transaction([e.tableName],"readonly").objectStore(e.tableName).getAllKeys();n.addEventListener("success",(function(r){var n=r;e.closeConnection(),t(n.target.result)})),n.addEventListener("error",(function(t){e.closeConnection(),r(t)}))}))]}}))}))},e.prototype.containsKey=function(e){return h(this,void 0,void 0,(function(){var t=this;return p(this,(function(r){switch(r.label){case 0:return[4,this.validateDbIsOpen()];case 1:return r.sent(),[2,new Promise((function(r,n){if(!t.db)return n(Bt.createDatabaseNotOpenError());var o=t.db.transaction([t.tableName],"readonly").objectStore(t.tableName).count(e);o.addEventListener("success",(function(e){var n=e;t.closeConnection(),r(1===n.target.result)})),o.addEventListener("error",(function(e){t.closeConnection(),n(e)}))}))]}}))}))},e.prototype.deleteDatabase=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){return this.db&&this.dbOpen&&this.closeConnection(),[2,new Promise((function(e,t){var r=window.indexedDB.deleteDatabase(Xt);r.addEventListener("success",(function(){return e(!0)})),r.addEventListener("blocked",(function(){return e(!0)})),r.addEventListener("error",(function(){return t(!1)}))}))]}))}))},e}(),jr=function(){function e(e,t){this.inMemoryCache=new ir,this.indexedDBCache=new Qr,this.logger=e,this.storeName=t}return e.prototype.handleDatabaseAccessError=function(e){if(!(e instanceof Bt&&e.errorCode===Lt.databaseUnavailable.code))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")},e.prototype.getItem=function(e){return h(this,void 0,void 0,(function(){var t,r;return p(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.getItem(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.getItem(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.setItem=function(e,t){return h(this,void 0,void 0,(function(){var r;return p(this,(function(n){switch(n.label){case 0:this.inMemoryCache.setItem(e,t),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.indexedDBCache.setItem(e,t)];case 2:return n.sent(),[3,4];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2]}}))}))},e.prototype.removeItem=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){switch(r.label){case 0:this.inMemoryCache.removeItem(e),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,this.indexedDBCache.removeItem(e)];case 2:return r.sent(),[3,4];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2]}}))}))},e.prototype.getKeys=function(){return h(this,void 0,void 0,(function(){var e,t;return p(this,(function(r){switch(r.label){case 0:if(0!==(e=this.inMemoryCache.getKeys()).length)return[3,4];r.label=1;case 1:return r.trys.push([1,3,,4]),this.logger.verbose("In-memory cache is empty, now querying persistent storage."),[4,this.indexedDBCache.getKeys()];case 2:return[2,r.sent()];case 3:return t=r.sent(),this.handleDatabaseAccessError(t),[3,4];case 4:return[2,e]}}))}))},e.prototype.containsKey=function(e){return h(this,void 0,void 0,(function(){var t,r;return p(this,(function(n){switch(n.label){case 0:if(t=this.inMemoryCache.containsKey(e))return[3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),[4,this.indexedDBCache.containsKey(e)];case 2:return[2,n.sent()];case 3:return r=n.sent(),this.handleDatabaseAccessError(r),[3,4];case 4:return[2,t]}}))}))},e.prototype.clearInMemory=function(){this.logger.verbose("Deleting in-memory keystore "+this.storeName),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore "+this.storeName+" deleted")},e.prototype.clearPersistent=function(){return h(this,void 0,void 0,(function(){var e,t;return p(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.logger.verbose("Deleting persistent keystore"),[4,this.indexedDBCache.deleteDatabase()];case 1:return(e=r.sent())&&this.logger.verbose("Persistent keystore deleted"),[2,e];case 2:return t=r.sent(),this.handleDatabaseAccessError(t),[2,!1];case 3:return[2]}}))}))},e}(); /*! @azure/msal-browser v2.37.0 2023-05-02 */!function(e){e.asymmetricKeys="asymmetricKeys",e.symmetricKeys="symmetricKeys"}(_r||(_r={}));var Wr=function(){function e(e){this.logger=e,this.asymmetricKeys=new jr(this.logger,_r.asymmetricKeys),this.symmetricKeys=new jr(this.logger,_r.symmetricKeys)}return e.prototype.clear=function(){return h(this,void 0,void 0,(function(){var e;return p(this,(function(t){switch(t.label){case 0:this.asymmetricKeys.clearInMemory(),this.symmetricKeys.clearInMemory(),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.asymmetricKeys.clearPersistent()];case 2:return t.sent(),[2,!0];case 3:return(e=t.sent())instanceof Error?this.logger.error("Clearing keystore failed with error: "+e.message):this.logger.error("Clearing keystore failed with unknown error"),[2,!1];case 4:return[2]}}))}))},e}(),Vr=function(){function e(e,t,r){this.logger=e,this.browserCrypto=new Gr(this.logger,r),this.b64Encode=new xr,this.b64Decode=new Lr,this.guidGenerator=new qr(this.browserCrypto),this.pkceGenerator=new Br(this.browserCrypto),this.cache=new Wr(this.logger),this.performanceClient=t}return e.prototype.createNewGuid=function(){return this.guidGenerator.generateGuid()},e.prototype.base64Encode=function(e){return this.b64Encode.encode(e)},e.prototype.base64Decode=function(e){return this.b64Decode.decode(e)},e.prototype.generatePkceCodes=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){return[2,this.pkceGenerator.generateCodes()]}))}))},e.prototype.getPublicKeyThumbprint=function(t){var r;return h(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l;return p(this,(function(d){switch(d.label){case 0:return n=null===(r=this.performanceClient)||void 0===r?void 0:r.startMeasurement(xe.CryptoOptsGetPublicKeyThumbprint,t.correlationId),[4,this.browserCrypto.generateKeyPair(e.EXTRACTABLE,e.POP_KEY_USAGES)];case 1:return o=d.sent(),[4,this.browserCrypto.exportJwk(o.publicKey)];case 2:return i=d.sent(),a={e:i.e,kty:i.kty,n:i.n},s=Ur.getSortedObjectString(a),[4,this.hashString(s)];case 3:return c=d.sent(),[4,this.browserCrypto.exportJwk(o.privateKey)];case 4:return u=d.sent(),[4,this.browserCrypto.importJwk(u,!1,["sign"])];case 5:return l=d.sent(),[4,this.cache.asymmetricKeys.setItem(c,{privateKey:l,publicKey:o.publicKey,requestMethod:t.resourceRequestMethod,requestUri:t.resourceRequestUri})];case 6:return d.sent(),n&&n.endMeasurement({success:!0}),[2,c]}}))}))},e.prototype.removeTokenBindingKey=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:return[4,this.cache.asymmetricKeys.removeItem(e)];case 1:return t.sent(),[4,this.cache.asymmetricKeys.containsKey(e)];case 2:return[2,!t.sent()]}}))}))},e.prototype.clearKeystore=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.cache.clear()];case 1:return[2,e.sent()]}}))}))},e.prototype.signJwt=function(e,t,r){var n;return h(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,d,h,g,f,m,v;return p(this,(function(p){switch(p.label){case 0:return o=null===(n=this.performanceClient)||void 0===n?void 0:n.startMeasurement(xe.CryptoOptsSignJwt,r),[4,this.cache.asymmetricKeys.getItem(t)];case 1:if(!(i=p.sent()))throw Bt.createSigningKeyNotFoundInStorageError(t);return[4,this.browserCrypto.exportJwk(i.publicKey)];case 2:return a=p.sent(),s=Ur.getSortedObjectString(a),c=this.b64Encode.urlEncode(JSON.stringify({kid:t})),u=Mt.getShrHeaderString({kid:c,alg:a.alg}),l=this.b64Encode.urlEncode(u),e.cnf={jwk:JSON.parse(s)},d=this.b64Encode.urlEncode(JSON.stringify(e)),h=l+"."+d,g=Ur.stringToArrayBuffer(h),[4,this.browserCrypto.sign(i.privateKey,g)];case 3:return f=p.sent(),m=this.b64Encode.urlEncodeArr(new Uint8Array(f)),v=h+"."+m,o&&o.endMeasurement({success:!0}),[2,v]}}))}))},e.prototype.hashString=function(e){return h(this,void 0,void 0,(function(){var t,r;return p(this,(function(n){switch(n.label){case 0:return[4,this.browserCrypto.sha256Digest(e)];case 1:return t=n.sent(),r=new Uint8Array(t),[2,this.b64Encode.urlEncodeArr(r)]}}))}))},e.POP_KEY_USAGES=["sign","verify"],e.EXTRACTABLE=!0,e}(),Yr=function(){function e(t,r){this.correlationId=r,this.measureName=e.makeMeasureName(t,r),this.startMark=e.makeStartMark(t,r),this.endMark=e.makeEndMark(t,r)}return e.makeMeasureName=function(e,t){return"msal.measure."+e+"."+t},e.makeStartMark=function(e,t){return"msal.start."+e+"."+t},e.makeEndMark=function(e,t){return"msal.end."+e+"."+t},e.supportsBrowserPerformance=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName},e.flushMeasurements=function(t,r){if(e.supportsBrowserPerformance())try{r.forEach((function(r){var n=e.makeMeasureName(r.name,t);window.performance.getEntriesByName(n,"measure").length>0&&(window.performance.clearMeasures(n),window.performance.clearMarks(e.makeStartMark(n,t)),window.performance.clearMarks(e.makeEndMark(n,t)))}))}catch(e){}},e.prototype.startMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}},e.prototype.endMeasurement=function(){if(e.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}},e.prototype.flushMeasurement=function(){if(e.supportsBrowserPerformance())try{var t=window.performance.getEntriesByName(this.measureName,"measure");if(t.length>0){var r=t[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),r}}catch(e){}return null},e}(),$r=function(e){function t(t,r,n,o,i,a,s){var c=e.call(this,t,r,n,o,i,a)||this;return c.browserCrypto=new Gr(c.logger,s),c.guidGenerator=new qr(c.browserCrypto),c}return u(t,e),t.prototype.startPerformanceMeasuremeant=function(e,t){return new Yr(e,t)},t.prototype.generateId=function(){return this.guidGenerator.generateGuid()},t.prototype.getPageVisibility=function(){var e;return(null===(e=document.visibilityState)||void 0===e?void 0:e.toString())||null},t.prototype.deleteIncompleteSubMeasurements=function(e){var t=this.eventsByCorrelationId.get(e.event.correlationId),r=t&&t.eventId===e.event.eventId,n=[];r&&(null==t?void 0:t.incompleteSubMeasurements)&&t.incompleteSubMeasurements.forEach((function(e){n.push(l({},e))})),n.length>0&&Yr.flushMeasurements(e.event.correlationId,n)},t.prototype.supportsBrowserPerformanceNow=function(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.now},t.prototype.startMeasurement=function(t,r){var n=this,o=this.getPageVisibility(),i=e.prototype.startMeasurement.call(this,t,r);return l(l({},i),{endMeasurement:function(e){var t=i.endMeasurement(l({startPageVisibility:o,endPageVisibility:n.getPageVisibility()},e));return n.deleteIncompleteSubMeasurements(i),t},discardMeasurement:function(){i.discardMeasurement(),n.deleteIncompleteSubMeasurements(i),i.measurement.flushMeasurement()}})},t.prototype.setPreQueueTime=function(e,t){if(this.supportsBrowserPerformanceNow())if(t){var r=this.preQueueTimeByCorrelationId.get(t);r&&(this.logger.trace("BrowserPerformanceClient: Incomplete pre-queue "+r.name+" found",t),this.addQueueMeasurement(r.name,t,void 0,!0)),this.preQueueTimeByCorrelationId.set(t,{name:e,time:window.performance.now()})}else this.logger.trace("BrowserPerformanceClient: correlationId for "+e+" not provided, unable to set telemetry queue time");else this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for "+e)},t.prototype.addQueueMeasurement=function(t,r,n,o){if(this.supportsBrowserPerformanceNow())if(r){var i=e.prototype.getPreQueueTime.call(this,t,r);if(i){var a=window.performance.now(),s=n||e.prototype.calculateQueuedTime.call(this,i,a);return e.prototype.addQueueMeasurement.call(this,t,r,s,o)}}else this.logger.trace("BrowserPerformanceClient: correlationId for "+t+" not provided, unable to add queue measurement");else this.logger.trace("BrowserPerformanceClient: window performance API not available, unable to add queue measurement for "+t)},t}(qt),Jr=function(){function e(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}return e.prototype.loadExternalTokens=function(e,t,r){if(this.logger.info("TokenCache - loadExternalTokens called"),!t.id_token)throw Bt.createUnableToLoadTokenError("Please ensure server response includes id token.");var n,o,i=new we(t.id_token,this.cryptoObj);if(e.account){var a=this.loadAccount(i,e.account.environment,void 0,void 0,e.account.homeAccountId);n=new $e(a,this.loadIdToken(i,a.homeAccountId,e.account.environment,e.account.tenantId),this.loadAccessToken(e,t,a.homeAccountId,e.account.environment,e.account.tenantId,r),this.loadRefreshToken(e,t,a.homeAccountId,e.account.environment))}else{if(!e.authority)throw Bt.createUnableToLoadTokenError("Please provide a request with an account or a request with authority.");var s=Et.generateAuthority(e.authority,e.azureCloudOptions),c={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache};if(o=new Et(s,this.config.system.networkClient,this.storage,c,this.logger),r.clientInfo){this.logger.trace("TokenCache - homeAccountId from options");a=this.loadAccount(i,o.hostnameAndPort,r.clientInfo,o.authorityType);n=new $e(a,this.loadIdToken(i,a.homeAccountId,o.hostnameAndPort,o.tenant),this.loadAccessToken(e,t,a.homeAccountId,o.hostnameAndPort,o.tenant,r),this.loadRefreshToken(e,t,a.homeAccountId,o.hostnameAndPort))}else{if(!t.client_info)throw Bt.createUnableToLoadTokenError("Please provide clientInfo in the response or options.");this.logger.trace("TokenCache - homeAccountId from response");a=this.loadAccount(i,o.hostnameAndPort,t.client_info,o.authorityType);n=new $e(a,this.loadIdToken(i,a.homeAccountId,o.hostnameAndPort,o.tenant),this.loadAccessToken(e,t,a.homeAccountId,o.hostnameAndPort,o.tenant,r),this.loadRefreshToken(e,t,a.homeAccountId,o.hostnameAndPort))}}return this.generateAuthenticationResult(e,i,n,o)},e.prototype.loadAccount=function(e,t,r,n,o){var i;if(o?i=o:void 0!==n&&r&&(i=Ie.generateHomeAccountId(r,n,this.logger,this.cryptoObj,e)),!i)throw Bt.createUnableToLoadTokenError("Unexpected missing homeAccountId");var a=r?Ie.createAccount(r,i,e,void 0,void 0,void 0,t):Ie.createGenericAccount(i,e,void 0,void 0,void 0,t);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading account"),this.storage.setAccount(a),a;throw Bt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadIdToken=function(e,t,r,n){var o=Ke.createIdTokenEntity(t,r,e.rawToken,this.config.auth.clientId,n);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading id token"),this.storage.setIdTokenCredential(o),o;throw Bt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadAccessToken=function(e,t,r,n,o,i){if(!t.access_token)return this.logger.verbose("TokenCache - No access token provided for caching"),null;if(!t.expires_in)throw Bt.createUnableToLoadTokenError("Please ensure server response includes expires_in value.");if(!i.extendedExpiresOn)throw Bt.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");var a=new ye(e.scopes).printScopes(),s=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,c=i.extendedExpiresOn,u=Ge.createAccessTokenEntity(r,n,t.access_token,this.config.auth.clientId,o,a,s,c,this.cryptoObj);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading access token"),this.storage.setAccessTokenCredential(u),u;throw Bt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.loadRefreshToken=function(e,t,r,n){if(!t.refresh_token)return this.logger.verbose("TokenCache - No refresh token provided for caching"),null;var o=Qe.createRefreshTokenEntity(r,n,t.refresh_token,this.config.auth.clientId);if(this.isBrowserEnvironment)return this.logger.verbose("TokenCache - loading refresh token"),this.storage.setRefreshTokenCredential(o),o;throw Bt.createUnableToLoadTokenError("loadExternalTokens is designed to work in browser environments only.")},e.prototype.generateAuthenticationResult=function(e,t,r,n){var o,i,a,s,c=A.EMPTY_STRING,u=[],l=null;(null==r?void 0:r.accessToken)&&(c=r.accessToken.secret,u=ye.fromString(r.accessToken.target).asArray(),l=new Date(1e3*Number(r.accessToken.expiresOn)),s=new Date(1e3*Number(r.accessToken.extendedExpiresOn)));var d=(null==t?void 0:t.claims.oid)||(null==t?void 0:t.claims.sub)||A.EMPTY_STRING,h=(null==t?void 0:t.claims.tid)||A.EMPTY_STRING;return{authority:n?n.canonicalAuthority:A.EMPTY_STRING,uniqueId:d,tenantId:h,scopes:u,account:(null==r?void 0:r.account)?r.account.getAccountInfo():null,idToken:t?t.rawToken:A.EMPTY_STRING,idTokenClaims:t?t.claims:{},accessToken:c,fromCache:!0,expiresOn:l,correlationId:e.correlationId||A.EMPTY_STRING,requestId:A.EMPTY_STRING,extExpiresOn:s,familyId:A.EMPTY_STRING,tokenType:(null===(o=null==r?void 0:r.accessToken)||void 0===o?void 0:o.tokenType)||A.EMPTY_STRING,state:A.EMPTY_STRING,cloudGraphHostName:(null===(i=null==r?void 0:r.account)||void 0===i?void 0:i.cloudGraphHostName)||A.EMPTY_STRING,msGraphHost:(null===(a=null==r?void 0:r.account)||void 0===a?void 0:a.msGraphHost)||A.EMPTY_STRING,code:void 0,fromNativeBroker:!1}},e}(),Xr=function(e){function t(t){var r=e.call(this,t)||this;return r.includeRedirectUri=!1,r}return u(t,e),t}(it),Zr=function(t){function r(e,r,n,o,i,a,s,c,u,l){var d=t.call(this,e,r,n,o,i,a,c,u,l)||this;return d.apiId=s,d}return u(r,t),r.prototype.acquireToken=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s;return p(this,(function(c){switch(c.label){case 0:if(this.logger.trace("SilentAuthCodeClient.acquireToken called"),!t.code)throw Bt.createAuthCodeRequiredError();return this.performanceClient.setPreQueueTime(xe.StandardInteractionClientInitializeAuthorizationRequest,t.correlationId),[4,this.initializeAuthorizationRequest(t,e.InteractionType.Silent)];case 1:r=c.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||A.EMPTY_STRING,r.account||null),n=this.initializeServerTelemetryManager(this.apiId),c.label=2;case 2:return c.trys.push([2,4,,5]),o=l(l({},r),{code:t.code}),this.performanceClient.setPreQueueTime(xe.StandardInteractionClientGetClientConfiguration,t.correlationId),[4,this.getClientConfiguration(n,r.authority)];case 3:return i=c.sent(),a=new Xr(i),this.logger.verbose("Auth code client created"),[2,new Rr(a,this.browserStorage,o,this.logger,this.config.system,this.performanceClient).handleCodeResponseFromServer({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},r.state,a.authority,this.networkClient,!1)];case 4:throw(s=c.sent())instanceof ae&&s.setCorrelationId(this.correlationId),n.cacheFailedRequest(s),this.browserStorage.cleanRequestByState(r.state),s;case 5:return[2]}}))}))},r.prototype.logout=function(){return Promise.reject(Bt.createSilentLogoutUnsupportedError())},r}(gr),en=function(){function t(t){var r,n,o;this.isBrowserEnvironment="undefined"!=typeof window,this.config=function(t,r){var n=t.auth,o=t.cache,i=t.system,a=t.telemetry,s={clientId:A.EMPTY_STRING,authority:""+A.DEFAULT_AUTHORITY,knownAuthorities:[],cloudDiscoveryMetadata:A.EMPTY_STRING,authorityMetadata:A.EMPTY_STRING,redirectUri:A.EMPTY_STRING,postLogoutRedirectUri:A.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:e.ProtocolMode.AAD,azureCloudOptions:{azureCloudInstance:de.None,tenant:A.EMPTY_STRING},skipAuthorityMetadataCache:!1},c={cacheLocation:e.BrowserCacheLocation.SessionStorage,temporaryCacheLocation:e.BrowserCacheLocation.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!o||o.cacheLocation!==e.BrowserCacheLocation.LocalStorage)},u={loggerCallback:function(){},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},d=l(l({},Se),{loggerOptions:u,networkClient:r?hr.getBrowserNetworkClient():At,navigationClient:new br,loadFrameTimeout:0,windowHashTimeout:(null==i?void 0:i.loadFrameTimeout)||6e4,iframeHashTimeout:(null==i?void 0:i.loadFrameTimeout)||Ar,navigateFrameWait:r&&hr.detectIEOrEdge()?500:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(null==i?void 0:i.nativeBrokerHandshakeTimeout)||2e3,pollIntervalMilliseconds:zt,cryptoOptions:{useMsrCrypto:!1,entropy:void 0}}),h=l(l({},i),{loggerOptions:(null==i?void 0:i.loggerOptions)||u}),p={application:{appName:A.EMPTY_STRING,appVersion:A.EMPTY_STRING}};return{auth:l(l({},s),n),cache:l(l({},c),o),system:l(l({},d),h),telemetry:l(l({},p),a)}}(t,this.isBrowserEnvironment),this.initialized=!1,this.logger=new he(this.config.system.loggerOptions,cr,ur),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.isBrowserEnvironment?new $r(this.config.auth.clientId,this.config.auth.authority,this.logger,cr,ur,this.config.telemetry.application,this.config.system.cryptoOptions):new xt(this.config.auth.clientId,this.config.auth.authority,this.logger,cr,ur,this.config.telemetry.application),this.browserCrypto=this.isBrowserEnvironment?new Vr(this.logger,this.performanceClient,this.config.system.cryptoOptions):se,this.eventHandler=new Nr(this.logger,this.browserCrypto),this.browserStorage=this.isBrowserEnvironment?new sr(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger):(r=this.config.auth.clientId,n=this.logger,o={cacheLocation:e.BrowserCacheLocation.MemoryStorage,temporaryCacheLocation:e.BrowserCacheLocation.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1},new sr(r,o,se,n));var i={cacheLocation:e.BrowserCacheLocation.MemoryStorage,temporaryCacheLocation:e.BrowserCacheLocation.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1};this.nativeInternalStorage=new sr(this.config.auth.clientId,i,this.browserCrypto,this.logger),this.tokenCache=new Jr(this.config,this.browserStorage,this.logger,this.browserCrypto),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}return t.prototype.initialize=function(){return h(this,void 0,void 0,(function(){var t,r,n,o;return p(this,(function(i){switch(i.label){case 0:if(this.logger.trace("initialize called"),this.initialized)return this.logger.info("initialize has already been called, exiting early."),[2];if(t=this.config.system.allowNativeBroker,r=this.performanceClient.startMeasurement(xe.InitializeClientApplication),this.eventHandler.emitEvent(e.EventType.INITIALIZE_START),!t)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),n=this,[4,Er.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)];case 2:return n.nativeExtensionProvider=i.sent(),[3,4];case 3:return o=i.sent(),this.logger.verbose(o),[3,4];case 4:return this.initialized=!0,this.eventHandler.emitEvent(e.EventType.INITIALIZE_END),r.endMeasurement({allowNativeBroker:t,success:!0}),[2]}}))}))},t.prototype.handleRedirectPromise=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l=this;return p(this,(function(d){return this.logger.verbose("handleRedirectPromise called"),hr.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=t||A.EMPTY_STRING,void 0===(o=this.redirectResponse.get(n))?(this.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_START,e.InteractionType.Redirect),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),i=this.browserStorage.getCachedNativeRequest(),a=void 0,i&&Er.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),s=new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,i.accountId,this.nativeInternalStorage,i.correlationId),a=s.handleRedirectPromise()):(this.logger.trace("handleRedirectPromise - acquiring token from web flow"),c=this.browserStorage.getTemporaryCache(mt.CORRELATION_ID,!0)||A.EMPTY_STRING,u=this.createRedirectClient(c),a=u.handleRedirectPromise(t)),o=a.then((function(t){t&&(r.length<l.getAllAccounts().length?(l.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Redirect,t),l.logger.verbose("handleRedirectResponse returned result, login success")):(l.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),l.logger.verbose("handleRedirectResponse returned result, acquire token success")));return l.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((function(t){throw r.length>0?l.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):l.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),l.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})),this.redirectResponse.set(n,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},t.prototype.acquireTokenRedirect=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s=this;return p(this,(function(c){return r=this.getRequestCorrelationId(t),this.logger.verbose("acquireTokenRedirect called",r),this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),(n=this.getAllAccounts().length>0)?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Redirect,t),this.nativeExtensionProvider&&this.canUseNative(t)?(i=new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(t),this.nativeInternalStorage,t.correlationId),o=i.acquireTokenRedirect(t).catch((function(e){if(e instanceof Tr&&e.isFatal())return s.nativeExtensionProvider=void 0,s.createRedirectClient(t.correlationId).acquireToken(t);if(e instanceof Ye)return s.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),s.createRedirectClient(t.correlationId).acquireToken(t);throw s.browserStorage.setInteractionInProgress(!1),e}))):(a=this.createRedirectClient(t.correlationId),o=a.acquireToken(t)),[2,o.catch((function(t){throw n?s.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):s.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),t}))]}))}))},t.prototype.acquireTokenPopup=function(t){var r=this,n=this.getRequestCorrelationId(t),o=this.performanceClient.startMeasurement(xe.AcquireTokenPopup,n);try{this.logger.verbose("acquireTokenPopup called",n),this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup)}catch(e){return Promise.reject(e)}var i,a=this.getAllAccounts();(a.length>0?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Popup,t),this.canUseNative(t))?i=this.acquireTokenNative(t,e.ApiId.acquireTokenPopup).then((function(e){return r.browserStorage.setInteractionInProgress(!1),o.endMeasurement({success:!0,isNativeBroker:!0,requestId:e.requestId}),e})).catch((function(e){if(e instanceof Tr&&e.isFatal())return r.nativeExtensionProvider=void 0,r.createPopupClient(t.correlationId).acquireToken(t);if(e instanceof Ye)return r.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),r.createPopupClient(t.correlationId).acquireToken(t);throw r.browserStorage.setInteractionInProgress(!1),e})):i=this.createPopupClient(t.correlationId).acquireToken(t);return i.then((function(t){return a.length<r.getAllAccounts().length?r.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Popup,t):r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),o.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),o.endMeasurement({success:!0,requestId:t.requestId}),t})).catch((function(t){return a.length>0?r.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t):r.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Popup,null,t),o.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),Promise.reject(t)}))},t.prototype.trackPageVisibilityWithMeasurement=function(){var e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))},t.prototype.ssoSilent=function(t){var r;return h(this,void 0,void 0,(function(){var n,o,i,a,s=this;return p(this,(function(c){return n=this.getRequestCorrelationId(t),o=l(l({},t),{prompt:t.prompt,correlationId:n}),this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.ssoSilentMeasurement=this.performanceClient.startMeasurement(xe.SsoSilent,n),null===(r=this.ssoSilentMeasurement)||void 0===r||r.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",n),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_START,e.InteractionType.Silent,o),this.canUseNative(o)?i=this.acquireTokenNative(o,e.ApiId.ssoSilent).catch((function(e){if(e instanceof Tr&&e.isFatal())return s.nativeExtensionProvider=void 0,s.createSilentIframeClient(o.correlationId).acquireToken(o);throw e})):(a=this.createSilentIframeClient(o.correlationId),i=a.acquireToken(o)),[2,i.then((function(t){var r,n;return s.eventHandler.emitEvent(e.EventType.SSO_SILENT_SUCCESS,e.InteractionType.Silent,t),null===(r=s.ssoSilentMeasurement)||void 0===r||r.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),null===(n=s.ssoSilentMeasurement)||void 0===n||n.endMeasurement({success:!0,isNativeBroker:t.fromNativeBroker,requestId:t.requestId}),t})).catch((function(t){var r;throw s.eventHandler.emitEvent(e.EventType.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,t),null===(r=s.ssoSilentMeasurement)||void 0===r||r.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t})).finally((function(){document.removeEventListener("visibilitychange",s.trackPageVisibilityWithMeasurement)}))]}))}))},t.prototype.acquireTokenByCode=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a=this;return p(this,(function(s){r=this.getRequestCorrelationId(t),this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.trace("acquireTokenByCode called",r),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_BY_CODE_START,e.InteractionType.Silent,t),n=this.performanceClient.startMeasurement(xe.AcquireTokenByCode,t.correlationId);try{if(t.code&&t.nativeAccountId)throw Bt.createSpaCodeAndNativeAccountIdPresentError();if(t.code)return o=t.code,(i=this.hybridAuthCodeResponses.get(o))?(this.logger.verbose("Existing acquireTokenByCode request found",t.correlationId),n.discardMeasurement()):(this.logger.verbose("Initiating new acquireTokenByCode request",r),i=this.acquireTokenByCodeAsync(l(l({},t),{correlationId:r})).then((function(t){return a.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS,e.InteractionType.Silent,t),a.hybridAuthCodeResponses.delete(o),n.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),n.endMeasurement({success:!0,isNativeBroker:t.fromNativeBroker,requestId:t.requestId}),t})).catch((function(t){throw a.hybridAuthCodeResponses.delete(o),a.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE,e.InteractionType.Silent,null,t),n.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t})),this.hybridAuthCodeResponses.set(o,i)),[2,i];if(t.nativeAccountId){if(this.canUseNative(t,t.nativeAccountId))return[2,this.acquireTokenNative(t,e.ApiId.acquireTokenByCode,t.nativeAccountId).catch((function(e){throw e instanceof Tr&&e.isFatal()&&(a.nativeExtensionProvider=void 0),e}))];throw Bt.createUnableToAcquireTokenFromNativePlatformError()}throw Bt.createAuthCodeOrNativeAccountIdRequiredError()}catch(t){throw this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE,e.InteractionType.Silent,null,t),n.endMeasurement({errorCode:t instanceof ae&&t.errorCode||void 0,subErrorCode:t instanceof ae&&t.subError||void 0,success:!1}),t}return[2]}))}))},t.prototype.acquireTokenByCodeAsync=function(e){var t;return h(this,void 0,void 0,(function(){var r=this;return p(this,(function(n){switch(n.label){case 0:return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(xe.AcquireTokenByCodeAsync,e.correlationId),null===(t=this.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),[4,this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then((function(e){var t;return null===(t=r.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e})).catch((function(e){var t;throw null===(t=r.acquireTokenByCodeAsyncMeasurement)||void 0===t||t.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})).finally((function(){document.removeEventListener("visibilitychange",r.trackPageVisibilityWithMeasurement)}))];case 1:return[2,n.sent()]}}))}))},t.prototype.acquireTokenFromCache=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){switch(this.performanceClient.addQueueMeasurement(xe.AcquireTokenFromCache,t.correlationId),r.cacheLookupPolicy){case Jt.Default:case Jt.AccessToken:case Jt.AccessTokenAndRefreshToken:return[2,e.acquireToken(t)];default:throw ue.createRefreshRequiredError()}return[2]}))}))},t.prototype.acquireTokenByRefreshToken=function(e,t){return h(this,void 0,void 0,(function(){var r;return p(this,(function(n){switch(this.performanceClient.addQueueMeasurement(xe.AcquireTokenByRefreshToken,e.correlationId),t.cacheLookupPolicy){case Jt.Default:case Jt.AccessTokenAndRefreshToken:case Jt.RefreshToken:case Jt.RefreshTokenAndNetwork:return r=this.createSilentRefreshClient(e.correlationId),this.performanceClient.setPreQueueTime(xe.SilentRefreshClientAcquireToken,e.correlationId),[2,r.acquireToken(e)];default:throw ue.createRefreshRequiredError()}return[2]}))}))},t.prototype.acquireTokenBySilentIframe=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){return this.performanceClient.addQueueMeasurement(xe.AcquireTokenBySilentIframe,e.correlationId),t=this.createSilentIframeClient(e.correlationId),this.performanceClient.setPreQueueTime(xe.SilentIframeClientAcquireToken,e.correlationId),[2,t.acquireToken(e)]}))}))},t.prototype.logout=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){return t=this.getRequestCorrelationId(e),this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),[2,this.logoutRedirect(l({correlationId:t},e))]}))}))},t.prototype.logoutRedirect=function(t){return h(this,void 0,void 0,(function(){var r;return p(this,(function(n){return r=this.getRequestCorrelationId(t),this.preflightBrowserEnvironmentCheck(e.InteractionType.Redirect),[2,this.createRedirectClient(r).logout(t)]}))}))},t.prototype.logoutPopup=function(t){try{var r=this.getRequestCorrelationId(t);return this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup),this.createPopupClient(r).logout(t)}catch(e){return Promise.reject(e)}},t.prototype.getAllAccounts=function(){return this.logger.verbose("getAllAccounts called"),this.isBrowserEnvironment?this.browserStorage.getAllAccounts():[]},t.prototype.getAccountByUsername=function(e){if(this.logger.trace("getAccountByUsername called"),!e)return this.logger.warning("getAccountByUsername: No username provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({username:e});return t?(this.logger.verbose("getAccountByUsername: Account matching username found, returning"),this.logger.verbosePii("getAccountByUsername: Returning signed-in accounts matching username: "+e),t):(this.logger.verbose("getAccountByUsername: No matching account found, returning null"),null)},t.prototype.getAccountByHomeId=function(e){if(this.logger.trace("getAccountByHomeId called"),!e)return this.logger.warning("getAccountByHomeId: No homeAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({homeAccountId:e});return t?(this.logger.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),this.logger.verbosePii("getAccountByHomeId: Returning signed-in accounts matching homeAccountId: "+e),t):(this.logger.verbose("getAccountByHomeId: No matching account found, returning null"),null)},t.prototype.getAccountByLocalId=function(e){if(this.logger.trace("getAccountByLocalId called"),!e)return this.logger.warning("getAccountByLocalId: No localAccountId provided"),null;var t=this.browserStorage.getAccountInfoFilteredBy({localAccountId:e});return t?(this.logger.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),this.logger.verbosePii("getAccountByLocalId: Returning signed-in accounts matching localAccountId: "+e),t):(this.logger.verbose("getAccountByLocalId: No matching account found, returning null"),null)},t.prototype.setActiveAccount=function(e){this.browserStorage.setActiveAccount(e)},t.prototype.getActiveAccount=function(){return this.browserStorage.getActiveAccount()},t.prototype.preflightBrowserEnvironmentCheck=function(t,r){if(void 0===r&&(r=!0),this.logger.verbose("preflightBrowserEnvironmentCheck started"),hr.blockNonBrowserEnvironment(this.isBrowserEnvironment),hr.blockRedirectInIframe(t,this.config.system.allowRedirectInIframe),hr.blockReloadInHiddenIframes(),hr.blockAcquireTokenInPopups(),hr.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker,this.initialized),t===e.InteractionType.Redirect&&this.config.cache.cacheLocation===e.BrowserCacheLocation.MemoryStorage&&!this.config.cache.storeAuthStateInCookie)throw nr.createInMemoryRedirectUnavailableError();t!==e.InteractionType.Redirect&&t!==e.InteractionType.Popup||this.preflightInteractiveRequest(r)},t.prototype.preflightInteractiveRequest=function(e){this.logger.verbose("preflightInteractiveRequest called, validating app environment"),hr.blockReloadInHiddenIframes(),e&&this.browserStorage.setInteractionInProgress(!0)},t.prototype.acquireTokenNative=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw Bt.createNativeConnectionNotEstablishedError();return[2,new wr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)]}))}))},t.prototype.canUseNative=function(e,t){if(this.logger.trace("canUseNative called"),!Er.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case M.NONE:case M.CONSENT:case M.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace("canUseNative: prompt = "+e.prompt+" is not compatible with native flow, returning false"),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)},t.prototype.getNativeAccountId=function(e){var t=e.account||this.browserStorage.getAccountInfoByHints(e.loginHint,e.sid)||this.getActiveAccount();return t&&t.nativeAccountId||""},t.prototype.createPopupClient=function(e){return new Sr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createRedirectClient=function(e){return new kr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)},t.prototype.createSilentIframeClient=function(t){return new Pr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,t)},t.prototype.createSilentCacheClient=function(e){return new Ir(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentRefreshClient=function(e){return new Mr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)},t.prototype.createSilentAuthCodeClient=function(t){return new Zr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,t)},t.prototype.addEventCallback=function(e){return this.eventHandler.addEventCallback(e)},t.prototype.removeEventCallback=function(e){this.eventHandler.removeEventCallback(e)},t.prototype.addPerformanceCallback=function(e){return this.performanceClient.addPerformanceCallback(e)},t.prototype.removePerformanceCallback=function(e){return this.performanceClient.removePerformanceCallback(e)},t.prototype.enableAccountStorageEvents=function(){this.eventHandler.enableAccountStorageEvents()},t.prototype.disableAccountStorageEvents=function(){this.eventHandler.disableAccountStorageEvents()},t.prototype.getTokenCache=function(){return this.tokenCache},t.prototype.getLogger=function(){return this.logger},t.prototype.setLogger=function(e){this.logger=e},t.prototype.initializeWrapperLibrary=function(e,t){this.browserStorage.setWrapperMetadata(e,t)},t.prototype.setNavigationClient=function(e){this.navigationClient=e},t.prototype.getConfiguration=function(){return this.config},t.prototype.getRequestCorrelationId=function(e){return(null==e?void 0:e.correlationId)?e.correlationId:this.isBrowserEnvironment?this.browserCrypto.createNewGuid():A.EMPTY_STRING},t}(),tn=function(t){function r(e){var r=t.call(this,e)||this;return r.astsAsyncMeasurement=void 0,r.activeSilentTokenRequests=new Map,r.trackPageVisibility=r.trackPageVisibility.bind(r),r}return u(r,t),r.prototype.loginRedirect=function(e){return h(this,void 0,void 0,(function(){var t;return p(this,(function(r){return t=this.getRequestCorrelationId(e),this.logger.verbose("loginRedirect called",t),[2,this.acquireTokenRedirect(l({correlationId:t},e||Yt))]}))}))},r.prototype.loginPopup=function(e){var t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup(l({correlationId:t},e||Yt))},r.prototype.acquireTokenSilent=function(t){return h(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u=this;return p(this,(function(d){if(r=this.getRequestCorrelationId(t),(n=this.performanceClient.startMeasurement(xe.AcquireTokenSilent,r)).addStaticFields({cacheLookupPolicy:t.cacheLookupPolicy}),this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),this.logger.verbose("acquireTokenSilent called",r),!(o=t.account||this.getActiveAccount()))throw Bt.createNoAccountError();return i={clientId:this.config.auth.clientId,authority:t.authority||A.EMPTY_STRING,scopes:t.scopes,homeAccountIdentifier:o.homeAccountId,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},a=JSON.stringify(i),void 0===(s=this.activeSilentTokenRequests.get(a))?(this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r),this.performanceClient.setPreQueueTime(xe.AcquireTokenSilentAsync,r),c=this.acquireTokenSilentAsync(l(l({},t),{correlationId:r}),o).then((function(e){return u.activeSilentTokenRequests.delete(a),n.addStaticFields({accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),n.endMeasurement({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,cacheLookupPolicy:t.cacheLookupPolicy,requestId:e.requestId}),e})).catch((function(e){throw u.activeSilentTokenRequests.delete(a),n.endMeasurement({errorCode:e.errorCode,subErrorCode:e.subError,success:!1}),e})),this.activeSilentTokenRequests.set(a,c),[2,c]):(this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),n.discardMeasurement(),[2,s])}))}))},r.prototype.trackPageVisibility=function(){this.astsAsyncMeasurement&&(this.logger.info("Perf: Visibility change detected"),this.astsAsyncMeasurement.increment({visibilityChangeCount:1}))},r.prototype.acquireTokenSilentAsync=function(t,r){var n;return h(this,void 0,void 0,(function(){var o,i,a,s,c,u=this;return p(this,(function(d){switch(d.label){case 0:return this.performanceClient.addQueueMeasurement(xe.AcquireTokenSilentAsync,t.correlationId),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),this.astsAsyncMeasurement=this.performanceClient.startMeasurement(xe.AcquireTokenSilentAsync,t.correlationId),null===(n=this.astsAsyncMeasurement)||void 0===n||n.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibility),Er.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,t.authenticationScheme)&&r.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),i=l(l({},t),{account:r}),o=this.acquireTokenNative(i,e.ApiId.acquireTokenSilent_silentFlow).catch((function(e){return h(u,void 0,void 0,(function(){return p(this,(function(r){if(e instanceof Tr&&e.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(t.correlationId).acquireToken(t)];throw e}))}))})),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),a=this.createSilentCacheClient(t.correlationId),this.performanceClient.setPreQueueTime(xe.InitializeSilentRequest,t.correlationId),[4,a.initializeSilentRequest(t,r)];case 2:s=d.sent(),c=l(l({},t),{cacheLookupPolicy:t.cacheLookupPolicy||Jt.Default}),this.performanceClient.setPreQueueTime(xe.AcquireTokenFromCache,s.correlationId),o=this.acquireTokenFromCache(a,s,c).catch((function(r){if(c.cacheLookupPolicy===Jt.AccessToken)throw r;return hr.blockReloadInHiddenIframes(),u.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,s),u.performanceClient.setPreQueueTime(xe.AcquireTokenByRefreshToken,s.correlationId),u.acquireTokenByRefreshToken(s,c).catch((function(e){var r=e instanceof Oe,n=e instanceof Ye,o=e.errorCode===Ht;if((!r||!o||n||c.cacheLookupPolicy===Jt.AccessTokenAndRefreshToken||c.cacheLookupPolicy===Jt.RefreshToken)&&c.cacheLookupPolicy!==Jt.Skip)throw e;return u.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",t.correlationId),u.performanceClient.setPreQueueTime(xe.AcquireTokenBySilentIframe,s.correlationId),u.acquireTokenBySilentIframe(s)}))})),d.label=3;case 3:return[2,o.then((function(t){var r;return u.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),null===(r=u.astsAsyncMeasurement)||void 0===r||r.endMeasurement({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,requestId:t.requestId}),t})).catch((function(t){var r;throw u.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),null===(r=u.astsAsyncMeasurement)||void 0===r||r.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t})).finally((function(){document.removeEventListener("visibilitychange",u.trackPageVisibility)}))]}}))}))},r}(en),rn={initialize:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},acquireTokenPopup:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},acquireTokenRedirect:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},acquireTokenSilent:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},acquireTokenByCode:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},getAllAccounts:function(){return[]},getAccountByHomeId:function(){return null},getAccountByUsername:function(){return null},getAccountByLocalId:function(){return null},handleRedirectPromise:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},loginPopup:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},loginRedirect:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},logout:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},logoutRedirect:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},logoutPopup:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},ssoSilent:function(){return Promise.reject(nr.createStubPcaInstanceCalledError())},addEventCallback:function(){return null},removeEventCallback:function(){},addPerformanceCallback:function(){return""},removePerformanceCallback:function(){return!1},enableAccountStorageEvents:function(){},disableAccountStorageEvents:function(){},getTokenCache:function(){throw nr.createStubPcaInstanceCalledError()},getLogger:function(){throw nr.createStubPcaInstanceCalledError()},setLogger:function(){},setActiveAccount:function(){},getActiveAccount:function(){return null},initializeWrapperLibrary:function(){},setNavigationClient:function(){},getConfiguration:function(){throw nr.createStubPcaInstanceCalledError()}},nn=function(){function t(){}return t.getInteractionStatusFromEvent=function(t,r){switch(t.eventType){case e.EventType.LOGIN_START:return e.InteractionStatus.Login;case e.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case e.EventType.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case e.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case e.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case e.EventType.SSO_SILENT_SUCCESS:case e.EventType.SSO_SILENT_FAILURE:if(r&&r!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case e.EventType.LOGOUT_END:if(r&&r!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case e.EventType.HANDLE_REDIRECT_END:if(r&&r!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case e.EventType.LOGIN_SUCCESS:case e.EventType.LOGIN_FAILURE:case e.EventType.ACQUIRE_TOKEN_SUCCESS:case e.EventType.ACQUIRE_TOKEN_FAILURE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==e.InteractionStatus.Login&&r!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}}return null},t}(),on=function(){function e(e,t){var r=t&&t.loggerOptions||{};this.logger=new he(r,cr,ur),this.cryptoOps=new Vr(this.logger),this.popTokenGenerator=new tt(this.cryptoOps),this.shrParameters=e}return e.prototype.generatePublicKeyThumbprint=function(){return h(this,void 0,void 0,(function(){return p(this,(function(e){switch(e.label){case 0:return[4,this.popTokenGenerator.generateKid(this.shrParameters)];case 1:return[2,e.sent().kid]}}))}))},e.prototype.signRequest=function(e,t,r){return h(this,void 0,void 0,(function(){return p(this,(function(n){return[2,this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)]}))}))},e.prototype.removeKeys=function(e){return h(this,void 0,void 0,(function(){return p(this,(function(t){switch(t.label){case 0:return[4,this.cryptoOps.removeTokenBindingKey(e)];case 1:return[2,t.sent()]}}))}))},e}(),an="function",sn="object",cn="undefined",un="prototype",ln="hasOwnProperty",dn=Object,hn=dn[un],pn=dn.assign,gn=dn.create,fn=dn.defineProperty,mn=hn[ln],vn=null; /*! @azure/msal-browser v2.37.0 2023-05-02 */function yn(e){return void 0===e&&(e=!0),vn&&e||(typeof globalThis!==cn&&globalThis&&(vn=globalThis),typeof self!==cn&&self&&(vn=self),typeof window!==cn&&window&&(vn=window),typeof global!==cn&&global&&(vn=global)),vn}function Cn(e){throw new TypeError(e)}function Tn(e){if(gn)return gn(e);if(null==e)return{};var t=typeof e;function r(){}return t!==sn&&t!==an&&Cn("Object prototype may only be an Object:"+e),r[un]=e,new r}(yn()||{}).Symbol,(yn()||{}).Reflect;var In=pn||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])hn[ln].call(t,o)&&(e[o]=t[o]);return e},wn=function(e,t){return wn=dn.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t[ln](r)&&(e[r]=t[r])},wn(e,t)};function En(e,t){function r(){this.constructor=e}typeof t!==an&&null!==t&&Cn("Class extends value "+String(t)+" is not a constructor or null"),wn(e,t),e[un]=null===t?Tn(t):(r[un]=t[un],new r)}function kn(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e} /*! * Microsoft Dynamic Proto Utility, 1.1.4 * Copyright (c) Microsoft and contributors. All rights reserved. */var Sn="constructor",bn="prototype",An="function",_n="_dynInstFuncs",Rn="_isDynProxy",Pn="_dynClass",Mn="_dynInstChk",Nn=Mn,On="_dfOpts",qn="_unknown_",Un="__proto__",xn="useBaseInst",Ln="setInstFuncs",Bn=Object,Hn=Bn.getPrototypeOf,Dn=0;function Fn(e,t){return e&&Bn[bn].hasOwnProperty.call(e,t)}function Kn(e){return e&&(e===Bn[bn]||e===Array[bn])}function zn(e){return Kn(e)||e===Function[bn]}function Gn(e){if(e){if(Hn)return Hn(e);var t=e[Un]||e[bn]||(e[Sn]?e[Sn][bn]:null);if(t)return t}return null}function Qn(e,t){var r=[],n=Bn.getOwnPropertyNames;if(n)r=n(e);else for(var o in e)"string"==typeof o&&Fn(e,o)&&r.push(o);if(r&&r.length>0)for(var i=0;i<r.length;i++)t(r[i])}function jn(e,t,r){return t!==Sn&&typeof e[t]===An&&(r||Fn(e,t))}function Wn(e){throw new TypeError("DynamicProto: "+e)}function Vn(e,t){for(var r=e.length-1;r>=0;r--)if(e[r]===t)return!0;return!1}function Yn(e,t,r,n,o){function i(e,t){var r=function(){var n=function(e,t,r,n){var o=null;if(e&&Fn(r,Pn)){var i=e[_n]||{};if((o=(i[r[Pn]]||{})[t])||Wn("Missing ["+t+"] "+An),!o[Mn]&&!1!==i[Nn]){for(var a=!Fn(e,t),s=Gn(e),c=[];a&&s&&!zn(s)&&!Vn(c,s);){var u=s[t];if(u){a=u===n;break}c.push(s),s=Gn(s)}try{a&&(e[t]=o),o[Mn]=1}catch(e){i[Nn]=!1}}}return o}(this,t,e,r)||function(e,t,r){var n=t[e];return n===r&&(n=Gn(t)[e]),typeof n!==An&&Wn("["+e+"] is not a "+An),n}(t,e,r);return n.apply(this,arguments)};return r[Rn]=1,r}if(!Kn(e)){var a=r[_n]=r[_n]||{},s=a[t]=a[t]||{};!1!==a[Nn]&&(a[Nn]=!!o),Qn(r,(function(t){jn(r,t,!1)&&r[t]!==n[t]&&(s[t]=r[t],delete r[t],(!Fn(e,t)||e[t]&&!e[t][Rn])&&(e[t]=i(e,t)))}))}}function $n(e,t){return Fn(e,bn)?e.name||t||qn:((e||{})[Sn]||{}).name||t||qn}function Jn(e,t,r,n){Fn(e,bn)||Wn("theClass is an invalid class definition.");var o=e[bn];(function(e,t){if(Hn)for(var r=[],n=Gn(t);n&&!zn(n)&&!Vn(r,n);){if(n===e)return!0;r.push(n),n=Gn(n)}return!1})(o,t)||Wn("["+$n(e)+"] is not in class hierarchy of ["+$n(t)+"]");var i=null;Fn(o,Pn)?i=o[Pn]:(i="_dynCls$"+$n(e,"_")+"$"+Dn,Dn++,o[Pn]=i);var a=Jn[On],s=!!a[xn];s&&n&&void 0!==n[xn]&&(s=!!n[xn]);var c=function(e){var t={};return Qn(e,(function(r){!t[r]&&jn(e,r,!1)&&(t[r]=e[r])})),t}(t),u=function(e,t,r,n){function o(e,t,r){var o=t[r];if(o[Rn]&&n){var i=e[_n]||{};!1!==i[Nn]&&(o=(i[t[Pn]]||{})[r]||o)}return function(){return o.apply(e,arguments)}}var i={};Qn(r,(function(e){i[e]=o(t,r,e)}));for(var a=Gn(e),s=[];a&&!zn(a)&&!Vn(s,a);)Qn(a,(function(e){!i[e]&&jn(a,e,!Hn)&&(i[e]=o(t,a,e))})),s.push(a),a=Gn(a);return i}(o,t,c,s);r(t,u);var l=!!Hn&&!!a[Ln];l&&n&&(l=!!n[Ln]),Yn(o,i,t,c,!1!==l)}Jn[On]={setInstFuncs:!0,useBaseInst:!0};var Xn,Zn=0,eo=1,to=2,ro=4,no=5;!function(e){e[e.CRITICAL=1]="CRITICAL",e[e.WARNING=2]="WARNING"}(Xn||(Xn={}));var oo={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99,InvalidInstrumentationKey:100,CannotParseAiBlobValue:101,InvalidContentBlob:102,TrackPageActionEventFailed:103,FailedAddingCustomDefinedRequestContext:104,InMemoryStorageBufferFull:105},io="on",ao="attachEvent",so="addEventListener",co="toISOString",uo="endsWith",lo="startsWith",ho="indexOf",po="trim",go="toString",fo=fn,mo=dn.freeze,vo=dn.keys,yo=String[un],Co=yo[po],To=yo[uo],Io=yo[lo],wo=Date[un][co],Eo=Array.isArray,ko=hn[go];function So(e){return void 0===e||typeof e===cn}function bo(e){return null===e||So(e)}function Ao(e){return!bo(e)}function _o(e,t){return!(!e||!mn.call(e,t))}function Ro(e){return!(!e||typeof e!==sn)}function Po(e){return!(!e||typeof e!==an)}function Mo(e,t,r,n){void 0===n&&(n=!1);var o=!1;if(!bo(e))try{bo(e[so])?bo(e[ao])||(e[ao](io+t,r),o=!0):(e[so](t,r,n),o=!0)}catch(e){}return o}function No(e,t){if(e)for(var r in e)mn.call(e,r)&&t.call(e,r,e[r])}function Oo(e,t){var r=!1;return e&&t&&!(r=e===t)&&(r=Io?e[lo](t):function(e,t){var r=!1,n=t?t.length:0;if(e&&n&&e.length>=n&&!(r=e===t)){for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;r=!0}return r}(e,t)),r}function qo(e,t){return!(!e||!t)&&-1!==e.indexOf(t)}mn[go].call(dn);var Uo=Eo||function(e){return!(!e||"[object Array]"!==ko.call(e))};function xo(e){return"string"==typeof e}function Lo(e){return"number"==typeof e}function Bo(e){return"boolean"==typeof e}function Ho(e){if(e)return wo?e[co]():function(e){if(e&&e.getUTCFullYear){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}}(e)}function Do(e,t,r){var n=e.length;try{for(var o=0;o<n&&(!(o in e)||-1!==t.call(r||e,e[o],o,e));o++);}catch(e){}}function Fo(e,t,r){if(e){if(e[ho])return e[ho](t,r);var n=e.length,o=r||0;try{for(var i=Math.max(o>=0?o:n-Math.abs(o),0);i<n;i++)if(i in e&&e[i]===t)return i}catch(e){}}return-1}function Ko(e){return e&&(e=Co&&e[po]?e[po]():e.replace?e.replace(/^\s+|\s+$/g,""):e),e}var zo=!{toString:null}.propertyIsEnumerable("toString"),Go=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"];function Qo(e){var t=typeof e;if(t===an||t===sn&&null!==e||Cn("objKeys called on non-object"),!zo&&vo)return vo(e);var r=[];for(var n in e)e&&mn.call(e,n)&&r.push(n);if(zo)for(var o=Go.length,i=0;i<o;i++)e&&mn.call(e,Go[i])&&r.push(Go[i]);return r}function jo(e,t,r,n){if(fo)try{var o={enumerable:!0,configurable:!0};return r&&(o.get=r),n&&(o.set=n),fo(e,t,o),!0}catch(e){}return!1}var Wo=mo||function(e){return e};function Vo(){var e=Date;return e.now?e.now():(new e).getTime()}function Yo(e){return(t=e)&&"[object Error]"===ko.call(t)?e.name:"";var t}function $o(e,t,r,n,o){var i=r;return e&&((i=e[t])===r||o&&!o(i)||n&&!n(r)||(i=r,e[t]=i)),i}function Jo(e){return!e}function Xo(e){return!!e}function Zo(e){throw new Error(e)}function ei(e){return e&&pn&&(e=dn(pn({},e))),e}var ti="window",ri="document",ni="navigator",oi="location",ii="console",ai="performance",si="JSON",ci="crypto",ui="msCrypto",li="msie",di="trident/",hi=null,pi=null,gi=!1,fi=null,mi=null;function vi(e,t){var r=!1;if(e){try{if(!(r=t in e)){var n=e[un];n&&(r=t in n)}}catch(e){}if(!r)try{r=!So((new e)[t])}catch(e){}}return r}function yi(e){var t=yn();return t&&t[e]?t[e]:e===ti&&Ci()?window:null}function Ci(){return Boolean(typeof window===sn&&window)}function Ti(){return Ci()?window:yi(ti)}function Ii(){return Boolean(typeof document===sn&&document)?document:yi(ri)}function wi(){return Boolean(typeof navigator===sn&&navigator)}function Ei(){return wi()?navigator:yi(ni)}function ki(e){if(e&&gi){var t=yi("__mockLocation");if(t)return t}return typeof location===sn&&location?location:yi(oi)}function Si(){return Boolean(typeof JSON===sn&&JSON||null!==yi(si))}function bi(){return Si()?JSON||yi(si):null}function Ai(){var e=Ei();return!(!e||!e.product)&&"ReactNative"===e.product}function _i(){var e=Ei();if(e&&(e.userAgent!==pi||null===hi)){var t=((pi=e.userAgent)||"").toLowerCase();hi=qo(t,li)||qo(t,di)}return hi}function Ri(e){var t=Object[un].toString.call(e),r="";return"[object Error]"===t?r="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":Si()&&(r=bi().stringify(e)),t+r}function Pi(){return null===mi&&(mi=wi()&&Boolean(Ei().sendBeacon)),mi}function Mi(e){var t=!1;try{t=!!yi("fetch");var r=yi("Request");t&&e&&r&&(t=vi(r,"keepalive"))}catch(e){}return t}function Ni(){var e=!1;try{e=!!yi("XMLHttpRequest")}catch(e){}return e}var Oi,qi=["eventsSent","eventsDiscarded","eventsSendRequest","perfEvent"],Ui=null;function xi(e,t){return function(){var r=arguments,n=Li(t);if(n){var o=n.listener;o&&o[e]&&o[e].apply(o,r)}}}function Li(e){var t,r=Ui;return r||!0===e.disableDbgExt||(r=Ui||((t=yi("Microsoft"))&&(Ui=t.ApplicationInsights),Ui)),r?r.ChromeDbgExt:null}function Bi(e){return e?'"'+e.replace(/\"/g,"")+'"':""}function Hi(e,t){var r=typeof console!==cn?console:yi(ii);if(r){var n="log";r[e]&&(n=e),Po(r[n])&&r[n](t)}}var Di=function(){function e(e,t,r,n){void 0===r&&(r=!1);var o=this;o.messageId=e,o.message=(r?"AI: ":"AI (Internal): ")+e;var i="";Si()&&(i=bi().stringify(n));var a=(t?" message:"+Bi(t):"")+(n?" props:"+Bi(i):"");o.message+=a}return e.dataType="MessageData",e}();function Fi(e,t){return(e||{}).logger||new Ki(t)}var Ki=function e(t){this.identifier="DiagnosticLogger",this.queue=[];var r=0,n={};Jn(e,this,(function(e){function o(e,r){var n=t[e];return bo(n)?r:n}function i(e,r){var n=Li(t);n&&n.diagLog&&n.diagLog(e,r)}bo(t)&&(t={}),e.consoleLoggingLevel=function(){return o("loggingLevelConsole",0)},e.telemetryLoggingLevel=function(){return o("loggingLevelTelemetry",1)},e.maxInternalMessageLimit=function(){return o("maxMessageLimit",25)},e.enableDebugExceptions=function(){return o("enableDebugExceptions",!1)},e.throwInternal=function(t,r,o,a,s){void 0===s&&(s=!1);var c=new Di(r,o,s,a);if(e.enableDebugExceptions())throw c;var u=t===Xn.CRITICAL?"errorToConsole":"warnToConsole";if(So(c.message))i("throw"+(t===Xn.CRITICAL?"Critical":"Warning"),c);else{var l=e.consoleLoggingLevel();if(s){var d=+c.messageId;!n[d]&&l>=t&&(e[u](c.message),n[d]=!0)}else l>=t&&e[u](c.message);e.logInternalMessage(t,c)}},e.warnToConsole=function(e){Hi("warn",e),i("warning",e)},e.errorToConsole=function(e){Hi("error",e),i("error",e)},e.resetInternalMessageCount=function(){r=0,n={}},e.logInternalMessage=function(t,o){if(!(r>=e.maxInternalMessageLimit())){var a=!0,s="AITR_"+o.messageId;if(n[s]?a=!1:n[s]=!0,a&&(t<=e.telemetryLoggingLevel()&&(e.queue.push(o),r++,i(t===Xn.CRITICAL?"error":"warn",o)),r===e.maxInternalMessageLimit())){var c="Internal events throttle limit per PageView reached for this app.",u=new Di(oo.MessageLimitPerPVExceeded,c,!1);e.queue.push(u),t===Xn.CRITICAL?e.errorToConsole(c):e.warnToConsole(c)}}}}))},zi="ctx",Gi=function(){function e(t,r,n){var o,i=this,a=!1;(i.start=Vo(),i.name=t,i.isAsync=n,i.isChildEvt=function(){return!1},Po(r))&&(a=jo(i,"payload",(function(){return!o&&Po(r)&&(o=r(),r=null),o})));i.getCtx=function(t){return t?t===e.ParentContextKey||t===e.ChildrenContextKey?i[t]:(i[zi]||{})[t]:null},i.setCtx=function(t,r){if(t)if(t===e.ParentContextKey)i[t]||(i.isChildEvt=function(){return!0}),i[t]=r;else if(t===e.ChildrenContextKey)i[t]=r;else{(i[zi]=i[zi]||{})[t]=r}},i.complete=function(){var t=0,n=i.getCtx(e.ChildrenContextKey);if(Uo(n))for(var o=0;o<n.length;o++){var s=n[o];s&&(t+=s.time)}i.time=Vo()-i.start,i.exTime=i.time-t,i.complete=function(){},!a&&Po(r)&&(i.payload=r())}}return e.ParentContextKey="parent",e.ChildrenContextKey="childEvts",e}(),Qi=function e(t){this.ctx={},Jn(e,this,(function(e){e.create=function(e,t,r){return new Gi(e,t,r)},e.fire=function(e){e&&(e.complete(),t&&Po(t.perfEvent)&&t.perfEvent(e))},e.setCtx=function(t,r){t&&((e[zi]=e[zi]||{})[t]=r)},e.getCtx=function(t){return(e[zi]||{})[t]}}))},ji="CoreUtils.doPerf";function Wi(e,t,r,n,o){if(e){var i=e;if(Po(i.getPerfMgr)&&(i=i.getPerfMgr()),i){var a=void 0,s=i.getCtx(ji);try{if(a=i.create(t(),n,o)){if(s&&a.setCtx&&(a.setCtx(Gi.ParentContextKey,s),s.getCtx&&s.setCtx)){var c=s.getCtx(Gi.ChildrenContextKey);c||(c=[],s.setCtx(Gi.ChildrenContextKey,c)),c.push(a)}return i.setCtx(ji,a),r(a)}}catch(e){a&&a.setCtx&&a.setCtx("exception",e)}finally{a&&i.fire(a),i.setCtx(ji,s)}}}return r()}var Vi=function(e,t){var r=this,n=null,o=Po(e.processTelemetry),i=Po(e.setNextPlugin);r._hasRun=!1,r.getPlugin=function(){return e},r.getNext=function(){return n},r.setNext=function(e){n=e},r.processTelemetry=function(a,s){s||(s=t);var c=e?e.identifier:"TelemetryPluginChain";Wi(s?s.core():null,(function(){return c+":processTelemetry"}),(function(){if(e&&o){r._hasRun=!0;try{s.setNext(n),i&&e.setNextPlugin(n),n&&(n._hasRun=!1),e.processTelemetry(a,s)}catch(r){var t=n&&n._hasRun;n&&t||s.diagLog().throwInternal(Xn.CRITICAL,oo.PluginException,"Plugin ["+e.identifier+"] failed during processTelemetry - "+Ri(r)),n&&!t&&n.processTelemetry(a,s)}}else n&&(r._hasRun=!0,n.processTelemetry(a,s))}),(function(){return{item:a}}),!a.sync)}};function Yi(e,t){var r=[];if(e&&e.length>0)for(var n=null,o=0;o<e.length;o++){var i=e[o];if(i&&Po(i.processTelemetry)){var a=new Vi(i,t);r.push(a),n&&n.setNext(a),n=a}}return r.length>0?r[0]:null}var $i=function e(t,r,n,o){var i=this,a=null;null!==o&&(t&&Po(t.getPlugin)?a=function(e,t,r){var n=[],o=!r;if(e)for(;e;){var i=e.getPlugin();(o||i===r)&&(o=!0,n.push(i)),e=e.getNext()}return o||n.push(r),Yi(n,t)}(t,i,o||t.getPlugin()):o?a=function(e,t,r){var n=e,o=!1;return r&&e&&(n=[],Do(e,(function(e){(o||e===r)&&(o=!0,n.push(e))}))),r&&!o&&(n||(n=[]),n.push(r)),Yi(n,t)}(t,i,o):So(o)&&(a=Yi(t,i))),i.core=function(){return n},i.diagLog=function(){return Fi(n,r)},i.getCfg=function(){return r},i.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),r){var o=r.extensionConfig;o&&e&&(n=o[e])}return n||t},i.getConfig=function(e,t,n){var o;void 0===n&&(n=!1);var a=i.getExtCfg(e,null);return a&&!bo(a[t])?o=a[t]:r&&!bo(r[t])&&(o=r[t]),bo(o)?n:o},i.hasNext=function(){return null!=a},i.getNext=function(){return a},i.setNext=function(e){a=e},i.processNext=function(e){var t=a;t&&(a=t.getNext(),t.processTelemetry(e,i))},i.createNew=function(t,o){return void 0===t&&(t=null),new e(t||a,r,n,o)}},Ji="extensionConfig",Xi="getPlugin",Zi=function(){function e(){var e=this,t=!1,r=null,n=null;e.core=null,e.diagLog=function(t){return e._getTelCtx(t).diagLog()},e.isInitialized=function(){return t},e.setInitialized=function(e){t=e},e.setNextPlugin=function(e){n=e},e.processNext=function(e,t){t?t.processNext(e):n&&Po(n.processTelemetry)&&n.processTelemetry(e,null)},e._getTelCtx=function(t){void 0===t&&(t=null);var o=t;if(!o){var i=r||new $i(null,{},e.core);o=n&&n[Xi]?i.createNew(null,n[Xi]):i.createNew(null,n)}return o},e._baseTelInit=function(o,i,a,s){o&&$o(o,Ji,[],null,bo),!s&&i&&(s=i.getProcessTelContext().getNext());var c=n;n&&n[Xi]&&(c=n[Xi]()),e.core=i,r=new $i(s,o,i,c),t=!0}}return e.prototype.initialize=function(e,t,r,n){this._baseTelInit(e,t,r,n)},e}(),ea="processTelemetry",ta="priority",ra="setNextPlugin",na="isInitialized";function oa(e,t){for(var r=[],n=null,o=e.getNext();o;){var i=o.getPlugin();i&&(n&&Po(n[ra])&&Po(i[ea])&&n[ra](i),Po(i[na])&&i[na]()||r.push(i),n=i,o=o.getNext())}Do(r,(function(r){r.initialize(e.getCfg(),e.core(),t,e.getNext())}))}function ia(e){return e.sort((function(e,t){var r=0,n=Po(t[ea]);return Po(e[ea])?r=n?e[ta]-t[ta]:1:n&&(r=-1),r}))}var aa=500,sa=function(e){function t(){var r,n=e.call(this)||this;function o(e){e&&e.length>0&&(function(e){Do(e,(function(e){e.priority<aa&&Zo("Channel has invalid priority"+e.identifier)}))}(e=e.sort((function(e,t){return e.priority-t.priority}))),r.push(e))}return n.identifier="ChannelControllerPlugin",n.priority=500,Jn(t,n,(function(e,t){e.setNextPlugin=function(e){},e.processTelemetry=function(e,t){r&&Do(r,(function(r){r.length>0&&n._getTelCtx(t).createNew(r).processNext(e)}))},e.getChannelControls=function(){return r},e.initialize=function(n,i,a){e.isInitialized()||(t.initialize(n,i,a),function(e,t){r=[],e&&Do(e,(function(e){return o(e)}));if(t){var n=[];Do(t,(function(e){e.priority>aa&&n.push(e)})),o(n)}}((n||{}).channels,a),Do(r,(function(e){return oa(new $i(e,n,i),a)})))}})),n}var r;return En(t,e),t._staticInit=(jo(r=t.prototype,"ChannelControls",r.getChannelControls),void jo(r,"channelQueue",r.getChannelControls)),t}(Zi),ca="toGMTString",ua="toUTCString",la="cookie",da="expires",ha="enabled",pa="isCookieUseDisabled",ga="disableCookiesUsage",fa="_ckMgr",ma="",va=null,ya=null,Ca=null,Ta=Ii(),Ia={},wa={};function Ea(e){return!e||e.isEnabled()}function ka(e,t){var r;if(e)r=e.getCookieMgr();else if(t){var n=t.cookieCfg;r=n[fa]?n[fa]:Sa(t)}return r||(r=function(e,t){var r=Sa[fa]||wa[fa];return r||(r=Sa[fa]=Sa(e,t),wa[fa]=r),r}(t,(e||{}).logger)),r}function Sa(e,t){var r=function(e){var t=e.cookieCfg=e.cookieCfg||{};if($o(t,"domain",e.cookieDomain,Ao,bo),$o(t,"path",e.cookiePath||"/",null,bo),bo(t[ha])){var r=void 0;So(e[pa])||(r=!e[pa]),So(e[ga])||(r=!e[ga]),t[ha]=r}return t}(e||wa),n=r.path||"/",o=r.domain,i=!1!==r[ha],a={isEnabled:function(){var e=i&&ba(t),r=wa[fa];return e&&r&&a!==r&&(e=Ea(r)),e},setEnabled:function(e){i=!1!==e},set:function(e,t,i,s,c){var u=!1;if(Ea(a)){var l={},d=Ko(t||ma),h=d.indexOf(";");if(-1!==h&&(d=Ko(t.substring(0,h)),l=Aa(t.substring(h+1))),$o(l,"domain",s||o,Xo,So),!bo(i)){var p=_i();if(So(l[da])){var g=Vo()+1e3*i;if(g>0){var f=new Date;f.setTime(g),$o(l,da,_a(f,p?ca:ua)||_a(f,p?ca:ua)||ma,Xo)}}p||$o(l,"max-age",ma+i,null,So)}var m=ki();m&&"https:"===m.protocol&&($o(l,"secure",null,null,So),null===ya&&(ya=!function(e){if(!xo(e))return!1;if(qo(e,"CPU iPhone OS 12")||qo(e,"iPad; CPU OS 12"))return!0;if(qo(e,"Macintosh; Intel Mac OS X 10_14")&&qo(e,"Version/")&&qo(e,"Safari"))return!0;if(qo(e,"Macintosh; Intel Mac OS X 10_14")&&function(e,t){var r=!1;return e&&t&&!(r=e===t)&&(r=To?e[uo](t):function(e,t){var r=!1,n=t?t.length:0,o=e?e.length:0;if(n&&o&&o>=n&&!(r=e===t)){for(var i=o-1,a=n-1;a>=0;a--){if(e[i]!=t[a])return!1;i--}r=!0}return r}(e,t)),r}(e,"AppleWebKit/605.1.15 (KHTML, like Gecko)"))return!0;if(qo(e,"Chrome/5")||qo(e,"Chrome/6"))return!0;if(qo(e,"UnrealEngine")&&!qo(e,"Chrome"))return!0;if(qo(e,"UCBrowser/12")||qo(e,"UCBrowser/11"))return!0;return!1}((Ei()||{}).userAgent)),ya&&$o(l,"SameSite","None",null,So)),$o(l,"path",c||n,null,So),(r.setCookie||Ma)(e,Ra(d,l)),u=!0}return u},get:function(e){var t=ma;return Ea(a)&&(t=(r.getCookie||Pa)(e)),t},del:function(e,t){var r=!1;return Ea(a)&&(r=a.purge(e,t)),r},purge:function(e,n){var o,i=!1;if(ba(t)){var a=((o={}).path=n||"/",o[da]="Thu, 01 Jan 1970 00:00:01 GMT",o);_i()||(a["max-age"]="0"),(r.delCookie||Ma)(e,Ra(ma,a)),i=!0}return i}};return a[fa]=a,a}function ba(e){if(null===va){va=!1;try{va=void 0!==(Ta||{})[la]}catch(t){e&&e.throwInternal(Xn.WARNING,oo.CannotAccessCookie,"Cannot access document.cookie - "+Yo(t),{exception:Ri(t)})}}return va}function Aa(e){var t={};e&&e.length&&Do(Ko(e).split(";"),(function(e){if(e=Ko(e||ma)){var r=e.indexOf("=");-1===r?t[e]=null:t[Ko(e.substring(0,r))]=Ko(e.substring(r+1))}}));return t}function _a(e,t){return Po(e[t])?e[t]():null}function Ra(e,t){var r=e||ma;return No(t,(function(e,t){r+="; "+e+(bo(t)?ma:"="+t)})),r}function Pa(e){var t=ma;if(Ta){var r=Ta[la]||ma;Ca!==r&&(Ia=Aa(r),Ca=r),t=Ko(Ia[e]||ma)}return t}function Ma(e,t){Ta&&(Ta[la]=e+"="+t)}var Na="_notificationManager";function Oa(e,t){return new Qi(t)}var qa=function e(t){this.listeners=[];var r=!!(t||{}).perfEvtsSendAll;Jn(e,this,(function(e){e.addNotificationListener=function(t){e.listeners.push(t)},e.removeNotificationListener=function(t){for(var r=Fo(e.listeners,t);r>-1;)e.listeners.splice(r,1),r=Fo(e.listeners,t)},e.eventsSent=function(t){Do(e.listeners,(function(e){e&&e.eventsSent&&setTimeout((function(){return e.eventsSent(t)}),0)}))},e.eventsDiscarded=function(t,r){Do(e.listeners,(function(e){e&&e.eventsDiscarded&&setTimeout((function(){return e.eventsDiscarded(t,r)}),0)}))},e.eventsSendRequest=function(t,r){Do(e.listeners,(function(e){if(e&&e.eventsSendRequest)if(r)setTimeout((function(){return e.eventsSendRequest(t,r)}),0);else try{e.eventsSendRequest(t,r)}catch(e){}}))},e.perfEvent=function(t){t&&(!r&&t.isChildEvt()||Do(e.listeners,(function(e){if(e&&e.perfEvent)if(t.isAsync)setTimeout((function(){return e.perfEvent(t)}),0);else try{e.perfEvent(t)}catch(e){}})))}}))},Ua=function(e){function t(){var r=e.call(this)||this,n=0;return Jn(t,r,(function(e,t){function r(t){var r=e.getNotifyMgr();r&&r.eventsDiscarded([t],to)}e.initialize=function(e,r,n,o){t.initialize(e,r,n||new Ki(e),o||new qa(e))},e.track=function(n){Wi(e.getPerfMgr(),(function(){return"AppInsightsCore:track"}),(function(){null===n&&(r(n),Zo("Invalid telemetry item")),function(e){if(bo(e.name))throw r(e),Error("telemetry name required")}(n),t.track(n)}),(function(){return{item:n}}),!n.sync)},e.addNotificationListener=function(t){var r=e.getNotifyMgr();r&&r.addNotificationListener(t)},e.removeNotificationListener=function(t){var r=e.getNotifyMgr();r&&r.removeNotificationListener(t)},e.pollInternalLogs=function(t){var r=e.config.diagnosticLogInterval;return r&&r>0||(r=1e4),n&&e.stopPollingInternalLogs(),n=setInterval((function(){var r=e.logger?e.logger.queue:[];Do(r,(function(r){var n={name:t||"InternalMessageId: "+r.messageId,iKey:e.config.instrumentationKey,time:Ho(new Date),baseType:Di.dataType,baseData:{message:r.message}};e.track(n)})),r.length=0}),r)},e.stopPollingInternalLogs=function(){n&&(clearInterval(n),n=0)}})),r}return En(t,e),t}((function e(){var t,r,n,o,i,a=!1;Jn(e,this,(function(e){e._extensions=new Array,r=new sa,e.logger=new Ki({loggingLevelConsole:Xn.CRITICAL}),t=[],e.isInitialized=function(){return a},e.initialize=function(t,o,i,s){var c,u,l,d;e.isInitialized()&&Zo("Core should not be initialized more than once"),t&&!bo(t.instrumentationKey)||Zo("Please provide instrumentation key"),n=s,e[Na]=s,e.config=t||{},s&&!0!==e.config.disableDbgExt&&s.addNotificationListener(function(e){if(!Oi){Oi={};for(var t=0;t<qi.length;t++)Oi[qi[t]]=xi(qi[t],e)}return Oi}(t)),e.config.enablePerfMgr&&$o(e.config,"createPerfMgr",Oa),t.extensions=bo(t.extensions)?[]:t.extensions,(u=Ji,(c=t)?!(d=c[u])&&bo(d)&&(d=So(l)?{}:l,c[u]=d):d=So(l)?{}:l,d).NotificationManager=s,i&&(e.logger=i);var h=[];h.push.apply(h,kn(kn([],o),t.extensions)),h=ia(h);var p=[],g={};Do(h,(function(e){(bo(e)||bo(e.initialize))&&Zo("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(bo(g[t])?g[t]=n:i.warnToConsole("Two extensions have same priority #"+t+" - "+g[t]+", "+n)),(!t||t<r.priority)&&p.push(e)})),h.push(r),p.push(r),h=ia(h),e._extensions=h,oa(new $i([r],t,e),h),oa(new $i(p,t,e),h),e._extensions=p,0===e.getTransmissionControls().length&&Zo("No channels available"),a=!0,e.releaseQueue()},e.getTransmissionControls=function(){return r.getChannelControls()},e.track=function(r){$o(r,"iKey",e.config.instrumentationKey,null,Jo),$o(r,"time",Ho(new Date),null,Jo),$o(r,"ver","4.0",null,bo),e.isInitialized()?e.getProcessTelContext().processNext(r):t.push(r)},e.getProcessTelContext=function(){var t=e._extensions,n=t;return t&&0!==t.length||(n=[r]),new $i(n,e.config,e)},e.getNotifyMgr=function(){return n||(n=Tn({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){},eventsSendRequest:function(e,t){}}),e[Na]=n),n},e.getCookieMgr=function(){return i||(i=Sa(e.config,e.logger)),i},e.setCookieMgr=function(e){i=e},e.getPerfMgr=function(){return o||e.config&&e.config.enablePerfMgr&&Po(e.config.createPerfMgr)&&(o=e.config.createPerfMgr(e,e.getNotifyMgr())),o||null},e.setPerfMgr=function(e){o=e},e.eventCnt=function(){return t.length},e.releaseQueue=function(){t.length>0&&(Do(t,(function(t){e.getProcessTelContext().processNext(t)})),t=[])}}))})),xa=4294967296,La=4294967295,Ba=!1,Ha=123456789,Da=987654321;function Fa(){try{var e=2147483647&Vo();(t=(Math.random()*xa^e)+e)<0&&(t>>>=0),Ha=123456789+t&La,Da=987654321-t&La,Ba=!0}catch(e){}var t}function Ka(e){var t,r=yi(ci)||yi(ui);return r&&r.getRandomValues?t=r.getRandomValues(new Uint32Array(1))[0]&La:_i()?(Ba||Fa(),t=function(e){var t=((Da=36969*(65535&Da)+(Da>>16)&La)<<16)+(65535&(Ha=18e3*(65535&Ha)+(Ha>>16)&La))>>>0&La|0;e||(t>>>=0);return t}()&La):t=Math.floor(xa*Math.random()|0),e||(t>>>=0),t}var za="visibilitychange",Ga="pagehide",Qa="pageshow";function ja(e,t){var r=!1,n=Ti();n&&(r=Mo(n,e,t),r=Mo(n.body,e,t)||r);var o=Ii();return o&&(r=Mo(o,e,t)||r),r}function Wa(e,t,r){var n=!1;if(t&&e&&Uo(e)){var o=[];Do(e,(function(e){xo(e)&&(r&&-1!==Fo(r,e)?o.push(e):n=ja(e,t)||n)})),!n&&o.length>0&&(n=Wa(o,t))}return n}function Va(e,t){return Wa(["beforeunload","unload","pagehide"],e,t)}function Ya(e,t){var r=!1;return t&&-1!==Fo(t,Ga)||(r=ja(Ga,e)),t&&-1!==Fo(t,za)||(r=ja(za,(function(t){var r=Ii();e&&r&&"hidden"===r.visibilityState&&e(t)}))||r),!r&&t&&(r=Ya(e)),r}function $a(e,t){var r=!1;return t&&-1!==Fo(t,Qa)||(r=ja(Qa,e)),t&&-1!==Fo(t,za)||(r=ja(za,(function(t){var r=Ii();e&&r&&"visible"===r.visibilityState&&e(t)}))||r),!r&&t&&(r=$a(e)),r}function Ja(){function e(){return(e=15)>0?Math.floor(Ka()/La*(e+1))>>>0:0;var e}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(es,(function(t){var r=0|e();return("x"===t?r:3&r|8).toString(16)}))}function Xa(e){void 0===e&&(e=22);for(var t=Ka()>>>0,r=0,n="";n.length<e;)r++,n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&t),t>>>=6,5===r&&(t=(Ka()<<2&4294967295|3&t)>>>0,r=0);return n}var Za,es=/[xy]/g,ts={NotSet:0,Pii_DistinguishedName:1,Pii_GenericData:2,Pii_IPV4Address:3,Pii_IPv6Address:4,Pii_MailSubject:5,Pii_PhoneNumber:6,Pii_QueryString:7,Pii_SipAddress:8,Pii_SmtpAddress:9,Pii_Identity:10,Pii_Uri:11,Pii_Fqdn:12,Pii_IPV4AddressLegacy:13,CustomerContent_GenericContent:32},rs=1,ns=2,os=3,is=4,as={Unspecified:0,String:1,Int32:2,UInt32:3,Int64:4,UInt64:5,Double:6,Bool:7,Guid:8,DateTime:9},ss=In(In({},oo),{AuthHandShakeError:501,AuthRedirectFail:502,BrowserCannotReadLocalStorage:503,BrowserCannotWriteLocalStorage:504,BrowserDoesNotSupportLocalStorage:505,CannotParseBiBlobValue:506,CannotParseDataAttribute:507,CVPluginNotAvailable:508,DroppedEvent:509,ErrorParsingAISessionCookie:510,ErrorProvidedChannels:511,FailedToGetCookies:512,FailedToInitializeCorrelationVector:513,FailedToInitializeSDK:514,InvalidContentBlob:515,InvalidCorrelationValue:516,SessionRenewalDateIsZero:517,SendPostOnCompleteFailure:518,PostResponseHandler:519,SDKNotInitialized:520}),cs="1DS-Web-JS-3.1.11",us="withCredentials",ls=((Za={})[0]=as.Unspecified,Za[2]=as.Double,Za[1]=as.String,Za[3]=as.Bool,Za[4098]=as.Double,Za[4097]=as.String,Za[4099]=as.Bool,Za);Boolean(Ii());var ds=Boolean(Ti());function hs(e){return!(""===e||bo(e))}function ps(e,t,r){if(!t&&!hs(t)||"string"!=typeof e)return null;var n=typeof t;if("string"===n||"number"===n||"boolean"===n||Uo(t))t={value:t};else if("object"!==n||t.hasOwnProperty("value")){if(bo(t.value)||""===t.value||!xo(t.value)&&!Lo(t.value)&&!Bo(t.value)&&!Uo(t.value))return null}else t={value:r?JSON.stringify(t):t};if(Uo(t.value)&&!(t.value.length>0))return null;if(!bo(t.kind)){if(Uo(t.value)||!function(e){if(e===ts.NotSet||e>ts.NotSet&&e<=ts.Pii_IPV4AddressLegacy||e===ts.CustomerContent_GenericContent)return!0;return!1}(t.kind))return null;t.value=t.value.toString()}return t}function gs(e,t,r){var n=-1;if(!So(e))if(t>0&&(32===t?n=8192:t<=13&&(n=t<<5)),function(e){if(e>=0&&e<=9)return!0;return!1}(r))-1===n&&(n=0),n|=r;else{var o=ls[Ts(e)]||-1;-1!==n&&-1!==o?n|=o:o===as.Double&&(n=o)}return n}function fs(e,t,r){var n;return void 0===r&&(r=!0),e&&(n=e.get(t),r&&n&&decodeURIComponent&&(n=decodeURIComponent(n))),n||""}function ms(e){void 0===e&&(e="D");var t=Ja();return"B"===e?t="{"+t+"}":"P"===e?t="("+t+")":"N"===e&&(t=t.replace(/-/g,"")),t}function vs(e,t,r,n,o){var i={},a=!1,s=0,c=arguments.length,u=arguments;for("[object Boolean]"===Object[un].toString.call(u[0])&&(a=u[0],s++);s<c;s++){No(u[s],(function(e,t){a&&t&&Ro(t)?Uo(t)?(i[e]=i[e]||[],Do(t,(function(t,r){t&&Ro(t)?i[e][r]=vs(!0,i[e][r],t):i[e][r]=t}))):i[e]=vs(!0,i[e],t):i[e]=t}))}return i}var ys=function(){var e=yi(ai);return e&&e.now?e.now():Vo()};function Cs(e,t){var r=e;r.timings=r.timings||{},r.timings.processTelemetryStart=r.timings.processTelemetryStart||{},r.timings.processTelemetryStart[t]=ys()}function Ts(e){var t=0;if(null!=e){var r=typeof e;"string"===r?t=1:"number"===r?t=2:"boolean"===r?t=3:r===sn&&(t=4,Uo(e)?(t=4096,e.length>0&&(t|=Ts(e[0]))):_o(e,"value")&&(t=8192|Ts(e.value)))}return t}var Is="version",ws="properties",Es=function(e){function t(){var r=e.call(this)||this;return r.pluginVersionStringArr=[],r.pluginVersionString="",Jn(t,r,(function(e,t){e.logger&&e.logger.queue||(e.logger=new Ki({loggingLevelConsole:Xn.CRITICAL})),e.initialize=function(r,n,o,i){Wi(e,(function(){return"AppInsightsCore.initialize"}),(function(){if(r){r.endpointUrl||(r.endpointUrl="https://browser.events.data.microsoft.com/OneCollector/1.0/");var a=r.propertyStorageOverride;if(a&&(!a.getProperty||!a.setProperty))throw new Error("Invalid property storage override passed.");r.channels&&Do(r.channels,(function(t){t&&Do(t,(function(t){if(t.identifier&&t.version){var r=t.identifier+"="+t.version;e.pluginVersionStringArr.push(r)}}))}))}e.getWParam=function(){return"undefined"!=typeof document?0:-1},n&&Do(n,(function(t){if(t&&t.identifier&&t.version){var r=t.identifier+"="+t.version;e.pluginVersionStringArr.push(r)}})),e.pluginVersionString=e.pluginVersionStringArr.join(";");try{t.initialize(r,n,o,i),e.pollInternalLogs("InternalLog")}catch(t){var s=e.logger,c=Ri(t);-1!==c.indexOf("channels")&&(c+="\r\n - Channels must be provided through config.channels only!"),s.throwInternal(Xn.CRITICAL,ss.FailedToInitializeSDK,"SDK Initialization Failed - no telemetry will be sent: "+c)}}),(function(){return{config:r,extensions:n,logger:o,notificationManager:i}}))},e.track=function(r){Wi(e,(function(){return"AppInsightsCore.track"}),(function(){var n,o=r;if(o){o.timings=o.timings||{},o.timings.trackStart=ys(),(n=o.latency)&&Lo(n)&&n>=rs&&n<=is||(o.latency=rs);var i=o.ext=o.ext||{};i.sdk=i.sdk||{},i.sdk.ver=cs;var a=o.baseData=o.baseData||{};a[ws]||(a[ws]={});var s=a[ws];s[Is]||(s[Is]=""),""!==e.pluginVersionString&&(s[Is]=e.pluginVersionString)}t.track(o)}),(function(){return{item:r}}),!r.sync)}})),r}return En(t,e),t}(Ua),ks=["AX","EX","SF","CS","CF","CT","CU","DC","DF","H5","HL","WS","WP"];function Ss(e,t){void 0===t&&(t=ks);var r=null;if(e)for(var n=e.split(","),o=0;o<n.length;o++)bs(n[o],t)&&(r?r+=","+n[o]:r=n[o]);return r}function bs(e,t){if(void 0===t&&(t=ks),!e||e.length<4)return!1;for(var r=!1,n=e.substring(0,3).toString().toUpperCase(),o=0;o<t.length;o++)if(t[o]+":"===n&&e.length<=256){r=!0;break}return r}var As=function(){function e(e,t){this.core=t,this.appExpId=null,this.flightIdNameSpaces=ks.slice(0),this.expIdCookieName="Treatments",this._cookieMgr=ka(t),this._propertiesConfig=e;var r=Ii();if(r){var n=r.documentElement;r&&(this.locale=n.lang)}this.env=e.env?e.env:this._getMetaDataFromDOM("awa-").env}return e.prototype.getExpId=function(){return this._propertiesConfig.expId?this._readExpIdFromCoreData(this._propertiesConfig.expId):this._readExpIdFromCookie()},e.prototype._getMetaDataFromDOM=function(e){var t,r={},n=Ii();if(n){t=n&&n.querySelectorAll("meta");for(var o=0;o<t.length;o++){var i=t[o];if(i.name)if(0===i.name.toLowerCase().indexOf(e))r[i.name.replace(e,"")]=i.content}}return r},e.prototype._setAppExpId=function(e){e!==this.appExpId&&(this.appExpId=Ss(e,this.flightIdNameSpaces))},e.prototype._getAppExpId=function(){return this.appExpId},e.prototype._readExpIdFromCookie=function(){var e=fs(this._cookieMgr,this.expIdCookieName);return this._setAppExpId(e),this._getAppExpId()},e.prototype._readExpIdFromCoreData=function(e){return this._setAppExpId(e),this._getAppExpId()},e.validateAppExpId=Ss,e._staticInit=void jo(e.prototype,"expId",e.prototype.getExpId),e}(),_s=function(){},Rs=function(){function e(t,r,n){this.core=n,this._propertiesConfig=r;var o=this._cookieMgr=ka(n,t);if(o&&o.isEnabled()){if(!this._propertiesConfig.hashIdentifiers&&!this._propertiesConfig.dropIdentifiers){var i=fs(o,"MUID");i&&this.setLocalId("t:"+i)}if(this._propertiesConfig.enableApplicationInsightsUser){var a=fs(o,e.userCookieName);if(a){var s=a.split(e.cookieSeparator);s.length>0&&(this.id=s[0])}if(!this.id){this.id=Xa(t&&!So(t.idLength)?t.idLength:22);var c=Ho(new Date);this.accountAcquisitionDate=c;var u=[this.id,c],l=this._propertiesConfig.cookieDomain?this._propertiesConfig.cookieDomain:void 0;o.set(e.userCookieName,u.join(e.cookieSeparator),31536e3,l)}}}if("undefined"!=typeof navigator){var d=navigator;this.locale=d.userLanguage||d.language}}return e.prototype.getLocalId=function(){if(this._customLocalId)return this._customLocalId;if(!this._propertiesConfig.hashIdentifiers&&!this._propertiesConfig.dropIdentifiers){var e=fs(this._cookieMgr,"MUID");e&&this.setLocalId("t:"+e)}},e.prototype.setLocalId=function(e){this._customLocalId=e},e.cookieSeparator="|",e.userCookieName="ai_user",e._staticInit=void jo(e.prototype,"localId",e.prototype.getLocalId,e.prototype.setLocalId),e}(),Ps="([\\d,.]+)",Ms="Unknown",Ns="Edg/",Os=[{ua:"OPR/",b:"Opera"},{ua:"PhantomJS",b:"PhantomJS"},{ua:"Edge",b:"Edge"},{ua:Ns,b:"Edge"},{ua:"Electron",b:"Electron"},{ua:"Chrome",b:"Chrome"},{ua:"Trident",b:"MSIE"},{ua:"MSIE ",b:"MSIE"},{ua:"Firefox",b:"Firefox"},{ua:"Safari",b:"Safari"},{ua:"SkypeShell",b:"SkypeShell"}],qs=[{br:"Microsoft Edge",b:"Edge"},{br:"Google Chrome",b:"Chrome"},{br:"Opera",b:"Opera"}]; /** * Cloud.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2020 */function Us(e,t){return t.indexOf(e)>-1}function xs(e,t){for(var r=0;r<t.length;r++)if(e==t[r].brand)return t[r].version;return null}function Ls(e,t){return"MSIE"===t?function(e){var t=e.match(new RegExp("MSIE "+Ps));if(t)return t[1];var r=e.match(new RegExp("rv:"+Ps));if(r)return r[1]}(e):function(e,t){"Safari"===e?e="Version":"Edge"===e&&Us(Ns,t)&&(e="Edg");var r=t.match(new RegExp(e+"/"+Ps));if(r)return r[1];if("Opera"===e&&(r=t.match(new RegExp("OPR/"+Ps))))return r[1];return Ms}(t,e)}var Bs=function(){function e(t,r){var n=ka(r),o=t||{};Jn(e,this,(function(e){var t=ki();if(t){var r=t.hostname;r&&(e.domain="file:"===t.protocol?"local":r)}if(o.populateBrowserInfo){var i=o.userAgent,a=(o.userAgentData||{}).brands,s=Ei();s&&(i=i||s.userAgent||"",a=a||(s.userAgentData||{}).brands),function(t,r){if(Uo(r))try{for(var n=0;n<qs.length;n++){var o=xs(qs[n].br,r);if(o)return e.browser=qs[n].b,void(e.browserVer=o)}}catch(e){}if(t){var i=function(e){if(e)for(var t=0;t<Os.length;t++)if(Us(Os[t].ua,e))return Os[t].b;return Ms}(t);e.browser=i,e.browserVer=Ls(t,i)}}(i,a);var c=function(){var e={h:0,w:0},t=Ti();return t&&t.screen&&(e.h=screen.height,e.w=screen.width),e}();e.screenRes=c.w+"X"+c.h}e.getUserConsent=function(){return o.userConsented||!!fs(n,o.userConsentCookieName||"MSCC")},e.getUserConsentDetails=function(){try{var e=o.callback;if(e&&e.userConsentDetails){var t=e.userConsentDetails();if(t)return JSON.stringify({Required:t.Required||!1,Analytics:t.Analytics||!1,SocialMedia:t.SocialMedia||!1,Advertising:t.Advertising||!1})}}catch(e){}return null},jo(e,"userConsent",e.getUserConsent)}))}return e._staticInit=void jo(e.prototype,"userConsent",e.prototype.getUserConsent),e}(),Hs={WIN:/(windows|win32)/i,WINRT:/ arm;/i,WINPHONE:/windows\sphone\s\d+\.\d+/i,OSX:/(macintosh|mac os x)/i,IOS:/(ipad|iphone|ipod)(?=.*like mac os x)/i,LINUX:/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)/i,ANDROID:/android/i,CROS:/CrOS/i},Ds={5.1:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1","10.0":"10"},Fs="([\\d,.]+)",Ks="([\\d,_,.]+)",zs="Unknown",Gs=[{r:Hs.WINPHONE,os:"Windows Phone"},{r:Hs.WINRT,os:"Windows RT"},{r:Hs.WIN,os:"Windows"},{r:Hs.IOS,os:"iOS"},{r:Hs.ANDROID,os:"Android"},{r:Hs.LINUX,os:"Linux"},{r:Hs.CROS,os:"Chrome OS"},{s:"x11",os:"Unix"},{s:"blackberry",os:"BlackBerry"},{s:"symbian",os:"Symbian"},{s:"nokia",os:"Nokia"},{r:Hs.OSX,os:"Mac OS X"}];function Qs(e,t){return"Windows"===t?js(e,"Windows NT"):"Android"===t?js(e,t):"Mac OS X"===t?function(e){var t=e.match(new RegExp("Mac OS X "+Ks));if(t){var r=t[1].replace(/_/g,".");if(r){var n=Ws(r);return n?r.split(n)[0]:r}}return zs}(e):"iOS"===t?function(e){var t=e.match(new RegExp("OS "+Ks));if(t){var r=t[1].replace(/_/g,".");if(r){var n=Ws(r);return n?r.split(n)[0]:r}}return zs}(e):zs}function js(e,t){var r=e.match(new RegExp(t+" "+Fs));return r?Ds[r[1]]?Ds[r[1]]:r[1]:zs}function Ws(e){return e.indexOf(".")>-1?".":e.indexOf("_")>-1?"_":null}var Vs=function(e){if(e.populateOperatingSystemInfo){var t=Ei()||{},r=e.userAgent||t.userAgent||"",n=e.userAgentData||t.userAgentData||{};if(r){var o=function(e){for(var t=0;t<Gs.length;t++){var r=Gs[t];if(r.r&&e.match(r.r))return r.os;if(r.s&&-1!==e.indexOf(r.s))return r.os}return zs}(r.toLowerCase());this.name=o,this.ver=Qs(r,o)}this.name&&this.name!==zs||!xo(n.platform)||(this.name=n.platform)}},Ys=function(){function e(e,t){this.core=t,e.serviceName&&(this.serviceName=e.serviceName),this._cookieMgr=ka(t)}return e.prototype.getMsfpc=function(){return fs(this._cookieMgr,"MSFPC")},e.prototype.getAnid=function(){return fs(this._cookieMgr,"ANON").slice(0,34)},e._staticInit=(jo(e.prototype,"msfpc",e.prototype.getMsfpc),void jo(e.prototype,"anid",e.prototype.getAnid)),e}(),$s=function(e){this.popSample=100,this.eventFlags=0,e.hashIdentifiers&&(this.eventFlags=1048576|this.eventFlags),e.dropIdentifiers&&(this.eventFlags=2097152|this.eventFlags)},Js=function(){var e=(new Date).getTimezoneOffset(),t=e%60,r=(e-t)/60,n="+";r>0&&(n="-"),r=Math.abs(r),t=Math.abs(t),this.tz=n+(r<10?"0"+r:r.toString())+":"+(t<10?"0"+t:t.toString())},Xs=function(){},Zs=function(){function e(){}return e.prototype.setId=function(e){this.customId=e},e.prototype.getId=function(){return xo(this.customId)?this.customId:this.automaticId},e._staticInit=void jo(e.prototype,"id",e.prototype.getId,e.prototype.setId),e}(),ec=function(e,t,r,n){if(e.enableApplicationInsightsTrace){this.traceId=t||function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r="",n=0;n<4;n++)r+=t[15&(e=Ka())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var o=t[8+(3&Ka())|0];return r.substr(0,8)+r.substr(9,4)+"4"+r.substr(13,3)+o+r.substr(16,3)+r.substr(19,12)}(),this.parentId=r,this.name=n;var o=ki();o&&o.pathname&&(this.name=o.pathname)}},tc=Wo({id:"id",ver:"ver",appName:"name",locale:"locale",expId:"expId",env:"env"}),rc=Wo({domain:"domain",browser:"browser",browserVer:"browserVer",screenRes:"screenRes",userConsent:"userConsent",consentDetails:"consentDetails"}),nc=Wo({locale:"locale",localId:"localId",id:"id"}),oc=Wo({osName:"name",ver:"ver"}),ic=Wo({ver:"ver",seq:"seq",installId:"installId",epoch:"epoch"}),ac=Wo({msfpc:"msfpc",anid:"anid",serviceName:"serviceName"}),sc=Wo({popSample:"popSample",eventFlags:"eventFlags"}),cc=Wo({tz:"tz"}),uc=Wo({sessionId:"sesId"}),lc=Wo({localId:"localId",deviceClass:"deviceClass",make:"make",model:"model"}),dc=Wo({role:"role",roleInstance:"roleInstance",roleVer:"roleVer"}),hc=Wo({traceId:"traceID",traceName:"name",parentId:"parentID"}),pc=Wo({UserExt:"user",DeviceExt:"device",TraceExt:"trace",WebExt:"web",AppExt:"app",OSExt:"os",SdkExt:"sdk",IntWebExt:"intweb",UtcExt:"utc",LocExt:"loc",CloudExt:"cloud"}),gc="MicrosoftApplicationsTelemetryDeviceId";var fc,mc,vc=function(){function e(e,t){this._sequenceId=0;var r=e.propertyStorageOverride;this.seq=this._sequenceId,this.epoch=Ka(!1).toString();var n=ka(t,e);if(n.isEnabled()||r){var o=function(e,t,r){return t?t.getProperty(r)||"":fs(e,r)}(n,r,gc);o||(o=Ja()),function(e,t,r,n){t?t.setProperty(r,n):e.set(r,n,31536e3)}(n,r,gc,o),this.installId=o}else n.purge(gc)}return e.prototype.getSequenceId=function(){return++this._sequenceId},e}();function yc(){return void 0===fc&&(fc=!!Tc(mc.LocalStorage)),fc}function Cc(){return yc()?Tc(mc.LocalStorage):null}function Tc(e){var t,r,n=null;try{var o=yn();if(!o)return null;r=new Date,(n=e===mc.LocalStorage?o.localStorage:o.sessionStorage)&&Po(n.setItem)&&(n.setItem(r,r),t=n.getItem(r)!==r,n.removeItem(r),t&&(n=null))}catch(e){n=null}return n}!function(e){e[e.LocalStorage=0]="LocalStorage",e[e.SessionStorage=1]="SessionStorage"}(mc||(mc={}));var Ic=function(){function e(t,r){var n,o,i=Fi(t),a=ka(t);Jn(e,this,(function(t){var s,c={sessionRenewalMs:(s=r).sessionRenewalMs&&function(){return s.sessionRenewalMs},sessionExpirationMs:s.sessionExpirationMs&&function(){return s.sessionExpirationMs},cookieDomain:s.cookieDomain&&function(){return s.cookieDomain},namePrefix:s.namePrefix&&function(){return s.namePrefix},sessionAsGuid:function(){return s.sessionAsGuid},idLength:function(){return s.idLength?s.idLength:22}};function u(e){var r=t.automaticSession,n=e.split("|");n.length>0&&r.setId(n[0]);try{if(n.length>1){var o=+n[1];r.acquisitionDate=+new Date(o),r.acquisitionDate=r.acquisitionDate>0?r.acquisitionDate:0}if(n.length>2){var a=+n[2];r.renewalDate=+new Date(a),r.renewalDate=r.renewalDate>0?r.renewalDate:0}}catch(e){i.throwInternal(Xn.CRITICAL,ss.ErrorParsingAISessionCookie,"Error parsing ai_session cookie, session will be reset: "+e)}0===r.renewalDate&&i.throwInternal(Xn.WARNING,ss.SessionRenewalDateIsZero,"AI session renewal date is 0, session will be reset.")}function l(){var e=t.automaticSession,r=(new Date).getTime(),n=t.config.sessionAsGuid();!So(n)&&n?Bo(n)?e.setId(ms()):e.setId(ms(n)):e.setId(Xa(c&&c.idLength?c.idLength():22)),e.acquisitionDate=r,e.renewalDate=r,d(e.getId(),e.acquisitionDate,e.renewalDate),yc()||i.throwInternal(Xn.WARNING,ss.BrowserDoesNotSupportLocalStorage,"Browser does not support local storage. Session durations will be inaccurate.")}function d(e,r,i){var s=r+t.config.sessionExpirationMs(),c=i+t.config.sessionRenewalMs(),u=new Date,l=[e,r,i];s<c?u.setTime(s):u.setTime(c);var d=t.config.cookieDomain?t.config.cookieDomain():null;a.set(o(),l.join("|")+";expires="+u.toUTCString(),null,d),n=(new Date).getTime()}Po(r.sessionExpirationMs)||(c.sessionExpirationMs=function(){return e.acquisitionSpan}),Po(r.sessionRenewalMs)||(c.sessionRenewalMs=function(){return e.renewalSpan}),t.config=c,o=function(){return t.config.namePrefix&&t.config.namePrefix()?e.cookieNameConst+t.config.namePrefix():e.cookieNameConst},t.automaticSession=new Zs,t.update=function(){t.automaticSession.getId()||function(){var e=function(e){return ba(null)?fs(ka(null),e):""}(o());if(e&&Po(e.split))u(e);else{var r=function(e,t){var r=Cc();if(null!==r)try{return r.getItem(t)}catch(t){fc=!1,e.throwInternal(Xn.CRITICAL,ss.BrowserCannotReadLocalStorage,"Browser failed read of local storage. "+t)}return null}(i,o());r&&u(r)}t.automaticSession.getId()||l()}();var r=t.automaticSession,a=t.config,s=(new Date).getTime(),c=s-r.acquisitionDate>a.sessionExpirationMs(),h=s-r.renewalDate>a.sessionRenewalMs();if(c||h)l();else{(!n||s-n>e.cookieUpdateInterval)&&(r.renewalDate=s,d(r.getId(),r.acquisitionDate,r.renewalDate))}},t.backup=function(){var e,r,n,a=t.automaticSession;e=a.getId(),r=a.acquisitionDate,n=a.renewalDate,function(e,t,r){var n=Cc();if(null!==n)try{return n.setItem(t,r),!0}catch(t){fc=!1,e.throwInternal(Xn.CRITICAL,ss.BrowserCannotWriteLocalStorage,"Browser failed write to local storage. "+t)}}(i,o(),[e,r,n].join("|"))}}))}return e.acquisitionSpan=864e5,e.renewalSpan=18e5,e.cookieUpdateInterval=6e4,e.cookieNameConst="ai_session",e}(),wc=xo,Ec=function(){function e(e,t,r){var n=this;n.app=new As(t,r),n.cloud=new _s,n.user=new Rs(e,t,r),n.os=new Vs(t),n.web=new Bs(t,r),n.sdk=new vc(e,r),n.intWeb=new Ys(t,r),n.utc=new $s(t),n.loc=new Js,n.device=new Xs,n.telemetryTrace=new ec(t),n.sessionManager=new Ic(r,t),n.session=new Zs}return e.prototype.getSessionId=function(){var e=this.session;if(e&&wc(e.customId))return e.customId;var t=this.sessionManager;t.update();var r=t.automaticSession;if(r){var n=r.getId();n&&wc(n)&&(e.automaticId=n)}return e.automaticId},e.prototype.applyApplicationContext=function(e){var t=this.app,r=e.ext[pc.AppExt];$o(r,tc.id,t.id,wc),$o(r,tc.ver,t.ver,wc),$o(r,tc.appName,t.name,wc),$o(r,tc.locale,t.locale,wc),$o(r,tc.expId,t.getExpId(),wc),$o(r,tc.env,t.env,wc)},e.prototype.applyUserContext=function(e){var t=this.user,r=e.ext[pc.UserExt];$o(r,nc.localId,t.getLocalId(),wc),$o(r,nc.locale,t.locale,wc),$o(r,nc.id,t.id,wc)},e.prototype.applyWebContext=function(e){var t=this.web,r=e.ext[pc.WebExt];$o(r,rc.domain,t.domain,wc),$o(r,rc.browser,t.browser,wc),$o(r,rc.browserVer,t.browserVer,wc),$o(r,rc.screenRes,t.screenRes,wc),r[rc.userConsent]=t.getUserConsent(),r[rc.consentDetails]=t.getUserConsentDetails()},e.prototype.applyOsContext=function(e){var t=this.os,r=e.ext[pc.OSExt];$o(r,oc.osName,t.name,wc),$o(r,oc.ver,t.ver,wc)},e.prototype.applySdkContext=function(e){var t=this.sdk,r=e.ext[pc.SdkExt];r[ic.seq]=t.getSequenceId(),r[ic.epoch]=t.epoch,$o(r,ic.installId,t.installId,wc)},e.prototype.applyIntWebContext=function(e){var t=this.intWeb,r=e.ext[pc.IntWebExt];$o(r,ac.msfpc,t.getMsfpc(),wc),$o(r,ac.anid,t.getAnid(),wc),$o(r,ac.serviceName,t.serviceName,wc)},e.prototype.applyUtcContext=function(e){var t=this.utc,r=e.ext[pc.UtcExt];r[sc.popSample]=t.popSample,t.eventFlags>0&&(r[sc.eventFlags]=t.eventFlags)},e.prototype.applyLocContext=function(e){e.ext[pc.LocExt][cc.tz]=this.loc.tz},e.prototype.applySessionContext=function(e){e.ext[pc.AppExt][uc.sessionId]=this.getSessionId()},e.prototype.applyDeviceContext=function(e){var t=this.device,r=e.ext[pc.DeviceExt];$o(r,lc.localId,t.localId,wc),$o(r,lc.make,t.make,wc),$o(r,lc.model,t.model,wc),$o(r,lc.deviceClass,t.deviceClass,wc)},e.prototype.applyCloudContext=function(e){var t=this.cloud,r=e.ext[pc.CloudExt];$o(r,dc.role,t.role,wc),$o(r,dc.roleInstance,t.roleInstance,wc),$o(r,dc.roleVer,t.roleVer,wc)},e.prototype.applyAITraceContext=function(e){var t=this.telemetryTrace,r=e.ext[pc.TraceExt];$o(r,hc.traceId,t.traceId,wc),$o(r,hc.traceName,t.name,wc),$o(r,hc.parentId,t.parentId,wc)},e}(),kc=function(e){function t(){var r,n=e.call(this)||this;n.identifier="SystemPropertiesCollector",n.priority=3,n.version="3.1.11";var o={};return Jn(t,n,(function(t,i){t.initialize=function(o,i,a){e.prototype.initialize.call(n,o,i,a),r=new Ec(o,t._getTelCtx().getExtCfg(t.identifier),i)},t.processTelemetry=function(e,n){Cs(e,t.identifier),n=t._getTelCtx(n);var i,a,s=e.ext=e.ext?e.ext:{};e.data=e.data?e.data:{},s[pc.AppExt]=s[pc.AppExt]||{},s[pc.UserExt]=s[pc.UserExt]||{},s[pc.WebExt]=s[pc.WebExt]||{},s[pc.OSExt]=s[pc.OSExt]||{},s[pc.SdkExt]=s[pc.SdkExt]||{},s[pc.IntWebExt]=s[pc.IntWebExt]||{},s[pc.UtcExt]=s[pc.UtcExt]||{},s[pc.LocExt]=s[pc.LocExt]||{},s[pc.DeviceExt]=s[pc.DeviceExt]||{},s[pc.TraceExt]=s[pc.TraceExt]||{},s[pc.CloudExt]=s[pc.CloudExt]||{},r.applyApplicationContext(e),r.applyUserContext(e),r.applyWebContext(e),r.applyOsContext(e),r.applySdkContext(e),r.applyIntWebContext(e),r.applyUtcContext(e),r.applyLocContext(e),r.applySessionContext(e),r.applyDeviceContext(e),r.applyAITraceContext(e),r.applyCloudContext(e),Do(Qo(s),(function(e){0===Qo(s[e]).length&&delete s[e]})),i=o,a=e.data,i&&No(i,(function(e,t){a[e]||(a[e]=t)})),t.processNext(e,n)},t.getPropertiesContext=function(){return r},t.setProperty=function(e,t){o[e]=t}})),n}return En(t,e),t}(Zi),Sc=kc,bc="REAL_TIME",Ac="POST",_c="drop",Rc="send",Pc="requeue",Mc="rspFail",Nc="application/x-json-stream",Oc="cache-control",qc="content-type",Uc="kill-tokens",xc="kill-duration",Lc="time-delta-millis",Bc="AuthMsaDeviceTicket",Hc="msfpc";function Dc(e){var t=(e.ext||{}).intweb;return t&&hs(t[Hc])?t[Hc]:null}function Fc(e){for(var t=null,r=0;null===t&&r<e.length;r++)t=Dc(e[r]);return t}var Kc=function(){function e(t,r){var n=r?[].concat(r):[],o=this,i=Fc(n);o.iKey=function(){return t},o.Msfpc=function(){return i||""},o.count=function(){return n.length},o.events=function(){return n},o.addEvent=function(e){return!!e&&(n.push(e),i||(i=Dc(e)),!0)},o.split=function(r,o){var a;if(r<n.length){var s=n.length-r;bo(o)||(s=o<s?o:s),a=n.splice(r,s),i=Fc(n)}return new e(t,a)}}return e.create=function(t,r){return new e(t,r)},e}(),zc=2e6,Gc=Math.min(zc,65e3),Qc="metadata",jc="f",Wc=/\./,Vc=function e(t,r,n,o){var i="data",a="baseData",s=!!o,c=r,u={};Jn(e,this,(function(e){function r(e,t,o,i,a,l,d){No(e,(function(e,h){var p=null;if(h||hs(h)){var g=o,f=e,m=a,v=t;if(s&&!i&&Wc.test(e)){var y=e.split("."),C=y.length;if(C>1){m&&(m=m.slice());for(var T=0;T<C-1;T++){var I=y[T];v=v[I]=v[I]||{},g+="."+I,m&&m.push(I)}f=y[C-1]}}var w=i&&function(e,t){var r=u[e];return void 0===r&&(e.length>=7&&(r=Oo(e,"ext.metadata")||Oo(e,"ext.web")),u[e]=r),r}(g);if(p=!w&&c&&c.handleField(g,f)?c.value(g,f,h,n):ps(f,h,n)){var E=p.value;if(v[f]=E,l&&l(m,f,p),d&&"object"==typeof E&&!Uo(E)){var k=m;k&&(k=k.slice()).push(f),r(h,E,g+"."+f,i,k,l,d)}}}}))}e.createPayload=function(e,t,r,n,o,i){return{apiKeys:[],payloadBlob:"",overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:e,isTeardown:t,isSync:r,isBeacon:n,sendType:i,sendReason:o}},e.appendPayload=function(r,n,o){var i=r&&n&&!r.overflow;return i&&Wi(t,(function(){return"Serializer:appendPayload"}),(function(){for(var t=n.events(),i=r.payloadBlob,a=r.numEvents,s=!1,c=[],u=[],l=r.isBeacon,d=l?65e3:3984588,h=l?Gc:zc,p=0,g=0;p<t.length;){var f=t[p];if(f){if(a>=o){r.overflow=n.split(p);break}var m=e.getEventBlob(f);if(m&&m.length<=h){var v=m.length;if(i.length+v>d){r.overflow=n.split(p);break}i&&(i+="\r\n"),i+=m,++g>20&&(i.substr(0,1),g=0),s=!0,a++}else m?c.push(f):u.push(f),t.splice(p,1),p--}p++}if(c&&c.length>0&&r.sizeExceed.push(Kc.create(n.iKey(),c)),u&&u.length>0&&r.failedEvts.push(Kc.create(n.iKey(),u)),s){r.batches.push(n),r.payloadBlob=i,r.numEvents=a;var y=n.iKey();-1===Fo(r.apiKeys,y)&&r.apiKeys.push(y)}}),(function(){return{payload:r,theBatch:{iKey:n.iKey(),evts:n.events()},max:o}})),i},e.getEventBlob=function(e){try{return Wi(t,(function(){return"Serializer.getEventBlob"}),(function(){var t={};t.name=e.name,t.time=e.time,t.ver=e.ver,t.iKey="o:"+function(e){if(e){var t=e.indexOf("-");if(t>-1)return e.substring(0,t)}return""}(e.iKey);var n={},o=e.ext;o&&(t.ext=n,No(o,(function(e,t){r(t,n[e]={},"ext."+e,!0,null,null,!0)})));var s=t[i]={};s.baseType=e.baseType;var c=s[a]={};return r(e.baseData,c,a,!1,[a],(function(e,t,r){Yc(n,e,t,r)}),!0),r(e.data,s,i,!1,[],(function(e,t,r){Yc(n,e,t,r)}),!0),JSON.stringify(t)}),(function(){return{item:e}}))}catch(e){return null}}}))};function Yc(e,t,r,n){if(n&&e){var o=gs(n.value,n.kind,n.propertyType);if(o>-1){var i=e[Qc];i||(i=e[Qc]={f:{}});var a=i[jc];if(a||(a=i[jc]={}),t)for(var s=0;s<t.length;s++){var c=t[s];a[c]||(a[c]={f:{}});var u=a[c][jc];u||(u=a[c][jc]={}),a=u}a=a[r]={},Uo(n.value)?a.a={t:o}:a.t=o}}} /** * RetryPolicy.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */var $c,Jc,Xc=function(){function e(){}return e.shouldRetryForStatus=function(e){return!(e>=300&&e<500&&408!=e&&429!=e||501==e||505==e)},e.getMillisToBackoffForRetry=function(e){var t,r=Math.floor(1200*Math.random())+2400;return t=Math.pow(2,e)*r,Math.min(t,6e5)},e}(),Zc=function e(){var t={};Jn(e,this,(function(e){e.setKillSwitchTenants=function(e,r){if(e&&r)try{var n=(a=e.split(","),s=[],a&&Do(a,(function(e){s.push(Ko(e))})),s);if("this-request-only"===r)return n;for(var o=1e3*parseInt(r,10),i=0;i<n.length;++i)t[n[i]]=Vo()+o}catch(e){return[]}var a,s;return[]},e.isTenantKilled=function(e){var r=t,n=Ko(e);return void 0!==r[n]&&r[n]>Vo()||(delete r[n],!1)}}))},eu=Zc,tu=function e(){var t=!0,r=!0,n=!0,o="use-collector-delta",i=!1;Jn(e,this,(function(e){e.allowRequestSending=function(){return t},e.firstRequestSent=function(){n&&(n=!1,i||(t=!1))},e.shouldAddClockSkewHeaders=function(){return r},e.getClockSkewHeaderValue=function(){return o},e.setClockSkew=function(e){i||(e?(o=e,r=!0,i=!0):r=!1,t=!0)}}))},ru="sendAttempt",nu="&NoResponseBody=true",ou=(($c={})[1]=Pc,$c[100]=Pc,$c[200]="sent",$c[8004]=_c,$c[8003]=_c,$c),iu={};function au(e){try{return e.responseText}catch(e){}return""}function su(e,t){var r=!1;if(e&&t){var n=Qo(e);if(n&&n.length>0)for(var o=t.toLowerCase(),i=0;i<n.length;i++){var a=n[i];if(a&&_o(t,a)&&a.toLowerCase()===o){r=!0;break}}}return r}function cu(e,t,r,n){t&&r&&r.length>0&&(n&&iu[t]?(e.hdrs[iu[t]]=r,e.useHdrs=!0):e.url+="&"+t+"="+r)}Jc=Bc,iu[Bc]=Jc;var uu,lu,du,hu,pu=function e(t,r,n,o){this._responseHandlers=[];var i,a,s,c,u,l,d="?cors=true&"+qc.toLowerCase()+"="+Nc,h=new eu,p=!1,g=new tu,f=!1,m=0,v=!0,y=[],C={},T=[],I=null,w=!1,E=!1,k=!1;Jn(e,this,(function(e){var S=!0;function b(e,t){for(var r=0,n=null,o=0;null==n&&o<e.length;)1===(r=e[o])?(null===fi&&(fi="undefined"!=typeof XDomainRequest)&&Ni()&&(fi=fi&&!vi(yi("XMLHttpRequest"),"withCredentials")),fi?n=A:Ni()&&(n=R)):2===r&&Mi(t)?n=_:f&&3===r&&Pi()&&(n=M),o++;return n?{_transport:r,_isSync:t,sendPOST:n}:null}function A(e,t,r){var n=new XDomainRequest;n.open(Ac,e.urlString),e.timeout&&(n.timeout=e.timeout),n.onload=function(){var e=au(n);P(t,200,{},e),z(e)},n.onerror=function(){P(t,400,{})},n.ontimeout=function(){P(t,500,{})},n.onprogress=function(){},r?n.send(e.data):i._setTimeoutOverride((function(){n.send(e.data)}),0)}function _(e,t,r){var n,o=e.urlString,a=!1,s=!1,c=((n={body:e.data,method:Ac}).Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,n);r&&(c.keepalive=!0,2===e._sendReason&&(a=!0,o+=nu)),S&&(c.credentials="include"),e.headers&&Qo(e.headers).length>0&&(c.headers=e.headers),fetch(o,c).then((function(e){var r={},n="";e.headers&&e.headers.forEach((function(e,t){r[t]=e})),e.body&&e.text().then((function(e){n=e})),s||(s=!0,P(t,e.status,r,n),z(n))})).catch((function(e){s||(s=!0,P(t,0,{}))})),a&&!s&&(s=!0,P(t,200,{})),!s&&e.timeout>0&&i._setTimeoutOverride((function(){s||(s=!0,P(t,500,{}))}),e.timeout)}function R(e,t,r){var n=e.urlString;function o(e,t,r){if(!e[r]&&t&&t.getResponseHeader){var n=t.getResponseHeader(r);n&&(e[r]=Ko(n))}return e}function i(e){var t,r,n={};return e.getAllResponseHeaders?(t=e.getAllResponseHeaders(),r={},xo(t)&&Do(Ko(t).split(/[\r\n]+/),(function(e){if(e){var t=e.indexOf(": ");if(-1!==t){var n=Ko(e.substring(0,t)).toLowerCase(),o=Ko(e.substring(t+1));r[n]=o}else r[Ko(e)]=1}})),n=r):(n=o(n,e,Lc),n=o(n,e,xc),n=o(n,e,"kill-duration-seconds")),n}function a(e,r){P(t,e.status,i(e),r)}r&&e.disableXhrSync&&(r=!1);var s=function(e,t,r,n,o,i){function a(e,t,r){try{e[t]=r}catch(e){}}void 0===n&&(n=!1),void 0===o&&(o=!1);var s=new XMLHttpRequest;return n&&a(s,"Microsoft_ApplicationInsights_BypassAjaxInstrumentation",n),r&&a(s,us,r),s.open(e,t,!o),r&&a(s,us,r),!o&&i&&a(s,"timeout",i),s}(Ac,n,S,!0,r,e.timeout);No(e.headers,(function(e,t){s.setRequestHeader(e,t)})),s.onload=function(){var e=au(s);a(s,e),z(e)},s.onerror=function(){a(s)},s.ontimeout=function(){a(s)},s.send(e.data)}function P(e,t,r,n){try{e(t,r,n)}catch(e){i.diagLog().throwInternal(Xn.WARNING,ss.SendPostOnCompleteFailure,Ri(e))}}function M(e,t,r){var n=200,o=e._thePayload,a=e.urlString+nu;try{var s=Ei();if(!s.sendBeacon(a,e.data))if(o){var c=[];Do(o.batches,(function(e){if(c&&e&&e.count()>0){for(var t=e.events(),r=0;r<t.length;r++)if(!s.sendBeacon(a,I.getEventBlob(t[r]))){c.push(e.split(r));break}}else c.push(e.split(0))})),G(c,8003,o.sendType,!0)}else n=0}catch(e){i.diagLog().warnToConsole("Failed to send telemetry using sendBeacon API. Ex:"+e),n=0}finally{P(t,n,{},"")}}function N(e){return 2===e||3===e}function O(e){return E&&N(e)&&(e=2),e}function q(){return!p&&m<r}function U(){var e=T;return T=[],e}function x(e,t,r){var n=!1;return e&&e.length>0&&!p&&a[t]&&I&&(n=0!==t||q()&&(r>0||g.allowRequestSending())),n}function L(e){var t={};return e&&Do(e,(function(e,r){t[r]={iKey:e.iKey(),evts:e.events()}})),t}function B(e,r,n,o,c){if(e&&0!==e.length)if(p)G(e,1,o);else{o=O(o);try{var u=e,l=0!==o;Wi(s,(function(){return"HttpManager:_sendBatches"}),(function(i){i&&(e=e.slice(0));for(var s=[],u=null,d=ys(),p=a[o]||(l?a[1]:a[0]),g=(E||N(o)||p&&3===p._transport)&&!v&&f&&Pi();x(e,o,r);){var m=e.shift();m&&m.count()>0&&(h.isTenantKilled(m.iKey())?s.push(m):(u=u||I.createPayload(r,n,l,g,c,o),I.appendPayload(u,m,t)?null!==u.overflow&&(e=[u.overflow].concat(e),u.overflow=null,F(u,d,ys(),c),d=ys(),u=null):(F(u,d,ys(),c),d=ys(),e=[m].concat(e),u=null)))}u&&F(u,d,ys(),c),e.length>0&&(T=e.concat(T)),G(s,8004,o)}),(function(){return{batches:L(u),retryCount:r,isTeardown:n,isSynchronous:l,sendReason:c,useSendBeacon:N(o),sendType:o}}),!l)}catch(e){i.diagLog().throwInternal(Xn.WARNING,ss.CannotSerializeObject,"Unexpected Exception sending batch: "+Ri(e))}}}function H(e,t){var r={url:d,hdrs:{},useHdrs:!1};r.hdrs=vs(r.hdrs,C),r.useHdrs=Qo(r.hdrs).length>0,cu(r,"client-id","NO_AUTH",t),cu(r,"client-version",cs,t);var n="";Do(e.apiKeys,(function(e){n.length>0&&(n+=","),n+=e})),cu(r,"apikey",n,t),cu(r,"upload-time",Vo().toString(),t);var o=function(e){for(var t=0;t<e.batches.length;t++){var r=e.batches[t].Msfpc();if(r)return encodeURIComponent(r)}return""}(e);if(hs(o)&&(r.url+="&ext.intweb.msfpc="+o),g.shouldAddClockSkewHeaders()&&cu(r,"time-delta-to-apply-millis",g.getClockSkewHeaderValue(),t),s.getWParam){var i=s.getWParam();i>=0&&(r.url+="&w="+i)}for(var a=0;a<y.length;a++)r.url+="&"+y[a].name+"="+y[a].value;return r}function D(e,t,r){e[t]=e[t]||{},e[t][i.identifier]=r}function F(t,r,o,c){if(t&&t.payloadBlob&&t.payloadBlob.length>0){var d=!!e.sendHook,p=a[t.sendType];!N(t.sendType)&&t.isBeacon&&2===t.sendReason&&(p=a[2]||a[3]||p);var f=k;(t.isBeacon||3===p._transport)&&(f=!1);var y=H(t,f);f=f||y.useHdrs;var C=ys();Wi(s,(function(){return"HttpManager:_doPayloadSend"}),(function(){for(var a=0;a<t.batches.length;a++)for(var T=t.batches[a].events(),I=0;I<T.length;I++){var k=T[I];if(w){var S=k.timings=k.timings||{};D(S,"sendEventStart",C),D(S,"serializationStart",r),D(S,"serializationCompleted",o)}k[ru]>0?k[ru]++:k[ru]=1}G(t.batches,1e3+(c||0),t.sendType,!0);var b={data:t.payloadBlob,urlString:y.url,headers:y.hdrs,_thePayload:t,_sendReason:c,timeout:u};So(l)||(b.disableXhrSync=!!l),f&&(su(b.headers,Oc)||(b.headers[Oc]="no-cache, no-store"),su(b.headers,qc)||(b.headers[qc]=Nc));var A=null;p&&(A=function(r){g.firstRequestSent();var o=function(r,o){!function(t,r,o,a){var s=9e3,c=null,u=!1,l=!1;try{var d=!0;if(typeof t!==cn){if(r){g.setClockSkew(r[Lc]);var p=r[xc]||r["kill-duration-seconds"];Do(h.setKillSwitchTenants(r[Uc],p),(function(e){Do(o.batches,(function(t){if(t.iKey()===e){c=c||[];var r=t.split(0);o.numEvents-=r.count(),c.push(r)}}))}))}if(200==t||204==t)return void(s=200);(!Xc.shouldRetryForStatus(t)||o.numEvents<=0)&&(d=!1),s=9e3+t%1e3}if(d){s=100;var f=o.retryCnt;0===o.sendType&&(f<n?(u=!0,K((function(){0===o.sendType&&m--,B(o.batches,f+1,o.isTeardown,E?2:o.sendType,5)}),E,Xc.getMillisToBackoffForRetry(f))):(l=!0,E&&(s=8001)))}}finally{u||(g.setClockSkew(),function(t,r,n,o){try{o&&i._backOffTransmission(),200===r&&(o||t.isSync||i._clearBackOff(),function(e){if(w){var t=ys();Do(e,(function(e){e&&e.count()>0&&function(e,t){w&&Do(e,(function(e){D(e.timings=e.timings||{},"sendEventCompleted",t)}))}(e.events(),t)}))}}(t.batches)),G(t.batches,r,t.sendType,!0)}finally{0===t.sendType&&(m--,5!==n&&e.sendQueuedRequests(t.sendType,n))}}(o,s,a,l)),G(c,8004,o.sendType)}}(r,o,t,c)},a=t.isTeardown||t.isSync;try{p.sendPOST(r,o,a),e.sendListener&&e.sendListener(b,r,a,t.isBeacon)}catch(e){i.diagLog().warnToConsole("Unexpected exception sending payload. Ex:"+Ri(e)),P(o,0,{})}}),Wi(s,(function(){return"HttpManager:_doPayloadSend.sender"}),(function(){if(A)if(0===t.sendType&&m++,d&&!t.isBeacon&&3!==p._transport){var r={data:b.data,urlString:b.urlString,headers:vs({},b.headers),timeout:b.timeout,disableXhrSync:b.disableXhrSync},n=!1;Wi(s,(function(){return"HttpManager:_doPayloadSend.sendHook"}),(function(){try{e.sendHook(r,(function(e){n=!0,v||e._thePayload||(e._thePayload=e._thePayload||b._thePayload,e._sendReason=e._sendReason||b._sendReason),A(e)}),t.isSync||t.isTeardown)}catch(e){n||A(b)}}))}else A(b)}))}),(function(){return{thePayload:t,serializationStart:r,serializationCompleted:o,sendReason:c}}),t.isSync)}t.sizeExceed&&t.sizeExceed.length>0&&G(t.sizeExceed,8003,t.sendType),t.failedEvts&&t.failedEvts.length>0&&G(t.failedEvts,8002,t.sendType)}function K(e,t,r){t?e():i._setTimeoutOverride(e,r)}function z(t){var r=e._responseHandlers;try{for(var n=0;n<r.length;n++)try{r[n](t)}catch(e){i.diagLog().throwInternal(Xn.CRITICAL,ss.PostResponseHandler,"Response handler failed: "+e)}if(t){var o=JSON.parse(t);hs(o.webResult)&&hs(o.webResult[Hc])&&c.set("MSFPC",o.webResult[Hc],31536e3)}}catch(e){}}function G(e,t,r,n){if(e&&e.length>0&&o){var a=o[(u=t,l=ou[u],hs(l)||(l="oth",u>=9e3&&u<=9999?l=Mc:u>=8e3&&u<=8999?l=_c:u>=1e3&&u<=1999&&(l=Rc)),l)];if(a){var c=0!==r;Wi(s,(function(){return"HttpManager:_sendBatchesNotification"}),(function(){K((function(){try{a.call(o,e,t,c,r)}catch(e){i.diagLog().throwInternal(Xn.CRITICAL,ss.NotificationException,"send request notification failed: "+e)}}),n||c,0)}),(function(){return{batches:L(e),reason:t,isSync:c,sendSync:n,sendType:r}}),!c)}}var u,l}e.initialize=function(e,t,r,n,o){var h;o||(o={}),d=e+d,k=!So(o.avoidOptions)&&!o.avoidOptions,s=t,c=t.getCookieMgr(),w=!s.config.disableEventTimings;var p=!!s.config.enableCompoundKey;i=r;var g=o.valueSanitizer,m=o.stringifyObjects;So(o.enableCompoundKey)||(p=!!o.enableCompoundKey),u=o.xhrTimeout,l=o.disableXhrSync,f=!Ai(),I=new Vc(s,g,m,p);var y=n,C=o.alwaysUseXhrOverride?n:null,T=o.alwaysUseXhrOverride?n:null;if(!n){v=!1;var E=ki();E&&E.protocol&&"file:"===E.protocol.toLowerCase()&&(S=!1);var A=[];A=Ai()?[2,1]:[1,2,3];var _=o.transports;_&&(Lo(_)?A=[_].concat(A):Uo(_)&&(A=_.concat(A))),n=b(A,!1),y=b(A,!0),n||i.diagLog().warnToConsole("No available transport to send events")}(h={})[0]=n,h[1]=y||b([1,2,3],!0),h[2]=C||b([3,2],!0)||y||b([1],!0),h[3]=T||b([2,3],!0)||y||b([1],!0),a=h},e._getDbgPlgTargets=function(){return[a[0],h,I,a]},e.addQueryStringParameter=function(e,t){for(var r=0;r<y.length;r++)if(y[r].name===e)return void(y[r].value=t);y.push({name:e,value:t})},e.addHeader=function(e,t){C[e]=t},e.canSendRequest=function(){return q()&&g.allowRequestSending()},e.sendQueuedRequests=function(e,t){So(e)&&(e=0),E&&(e=O(e),t=2),x(T,e,0)&&B(U(),0,!1,e,t||0)},e.isCompletelyIdle=function(){return!p&&0===m&&0===T.length},e.setUnloading=function(e){E=e},e.addBatch=function(e){if(e&&e.count()>0){if(h.isTenantKilled(e.iKey()))return!1;T.push(e)}return!0},e.teardown=function(){T.length>0&&B(U(),0,!0,2,2)},e.pause=function(){p=!0},e.resume=function(){p=!1,e.sendQueuedRequests(0,4)},e.sendSynchronousBatch=function(e,t,r){e&&e.count()>0&&(bo(t)&&(t=1),E&&(t=O(t),r=2),B([e],0,!1,t,r||0))}}))},gu=ds?window:void 0,fu="eventsDiscarded",mu="overrideInstrumentationKey",vu="maxEventRetryAttempts",yu="maxUnloadEventRetryAttempts",Cu=function(e){function t(){var r,n=e.call(this)||this;n.identifier="PostChannel",n.priority=1011,n.version="3.1.11";var o,i,a,s,c,u=!1,l=[],d=null,h=!1,p=0,g=500,f=0,m=1e4,v={},y=bc,C=null,T=null,I=0,w=0,E={},k=-1,S=!0,b=!1,A=6,_=2;return Jn(t,n,(function(e,t){function n(e){"beforeunload"!==(e||Ti().event).type&&(b=!0,i.setUnloading(b)),x(2,2)}function R(e){b=!1,i.setUnloading(b)}function P(e,t){if(e.sendAttempt||(e.sendAttempt=0),e.latency||(e.latency=rs),e.ext&&e.ext.trace&&delete e.ext.trace,e.ext&&e.ext.user&&e.ext.user.id&&delete e.ext.user.id,S&&(e.ext=ei(e.ext),e.baseData&&(e.baseData=ei(e.baseData)),e.data&&(e.data=ei(e.data))),e.sync)if(I||h)e.latency=os,e.sync=!1;else if(i)return S&&(e=ei(e)),void i.sendSynchronousBatch(Kc.create(e.iKey,[e]),!0===e.sync?1:e.sync,3);var r=e.latency,n=f,o=m;r===is&&(n=p,o=g);var a=!1;if(n<o)a=!H(e,t);else{var s=rs,c=20;r===is&&(s=is,c=1),a=!0,function(e,t,r,n){for(;r<=t;){var o=L(e,t,!0);if(o&&o.count()>0){var i=o.split(0,n),a=i.count();if(a>0)return r===is?p-=a:f-=a,W(fu,[i],no),!0}r++}return D(),!1}(e.iKey,e.latency,s,c)&&(a=!H(e,t))}a&&j(fu,[e],no)}function M(e,t,r){var n=F(e,t,r);return i.sendQueuedRequests(t,r),n}function N(){return f>0}function O(){if(k>=0&&F(k,0,c)&&i.sendQueuedRequests(0,c),p>0&&!T&&!h){var e=v[y][2];e>=0&&(T=q((function(){T=null,M(is,0,1),O()}),e))}var t=v[y][1];!C&&!d&&t>=0&&!h&&(N()?C=q((function(){C=null,M(0===w?os:rs,0,1),w++,w%=2,O()}),t):w=0)}function q(t,r){0===r&&I&&(r=1);var n=1e3;return I&&(n=Xc.getMillisToBackoffForRetry(I-1)),e._setTimeoutOverride(t,r*n)}function U(){null!==C&&(e._clearTimeoutOverride(C),C=null,w=0)}function x(t,r){U(),d&&(e._clearTimeoutOverride(d),d=null),h||M(rs,t,r)}function L(e,t,r){var n=E[t];n||(n=E[t=rs]);var o=n.iKeyMap[e];return!o&&r&&(o=Kc.create(e),n.batches.push(o),n.iKeyMap[e]=o),o}function B(t,r){i.canSendRequest()&&!I&&(a>0&&f>a&&(r=!0),r&&null==d&&e.flush(t,null,20))}function H(e,t){S&&(e=ei(e));var r=e.latency,n=L(e.iKey,r,!0);return!!n.addEvent(e)&&(r!==is?(f++,t&&0===e.sendAttempt&&B(!e.sync,s>0&&n.count()>=s)):p++,!0)}function D(){for(var e=0,t=0,r=function(r){var n=E[r];n&&n.batches&&Do(n.batches,(function(n){r===is?e+=n.count():t+=n.count()}))},n=rs;n<=is;n++)r(n);f=t,p=e}function F(t,r,n){var o=!1,a=0===r;return!a||i.canSendRequest()?Wi(e.core,(function(){return"PostChannel._queueBatches"}),(function(){for(var e=[],r=is;r>=t;){var n=E[r];n&&n.batches&&n.batches.length>0&&(Do(n.batches,(function(t){i.addBatch(t)?o=o||t&&t.count()>0:e=e.concat(t.events()),r===is?p-=t.count():f-=t.count()})),n.batches=[],n.iKeyMap={}),r--}e.length>0&&j(fu,e,ro),o&&k>=t&&(k=-1,c=0)}),(function(){return{latency:t,sendType:r,sendReason:n}}),!a):(k=k>=0?Math.min(k,t):t,c=Math.max(c,n)),o}function K(e,t){M(rs,0,t),z((function(){e&&e(),l.length>0?d=q((function(){return K(l.shift(),t)}),0):(d=null,N()&&O())}))}function z(e){i.isCompletelyIdle()?e():d=q((function(){z(e)}),.25)}function G(){(v={})[bc]=[2,1,0],v.NEAR_REAL_TIME=[6,3,0],v.BEST_EFFORT=[18,9,0]}function Q(t,r){var n=e._notificationManager||{},o=n[t];if(o)try{o.apply(n,r)}catch(r){e.diagLog().throwInternal(Xn.CRITICAL,ss.NotificationException,t+" notification failed: "+r)}}function j(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t&&t.length>0&&Q(e,[t].concat(r))}function W(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t&&t.length>0&&Do(t,(function(t){t&&t.count()>0&&Q(e,[t.events()].concat(r))}))}function V(){s=r&&r.disableAutoBatchFlushLimit?0:Math.max(1500,m/6)}G(),E[is]={batches:[],iKeyMap:{}},E[os]={batches:[],iKeyMap:{}},E[ns]={batches:[],iKeyMap:{}},E[rs]={batches:[],iKeyMap:{}},V(),i=new pu(500,2,1,{requeue:function(t,r){var n=[],o=A;b&&(o=_);Do(t,(function(t){t&&t.count()>0&&Do(t.events(),(function(t){t&&(t.sync&&(t.latency=is,t.sync=!1),t.sendAttempt<o?(Cs(t,e.identifier),P(t,!1)):n.push(t))}))})),n.length>0&&j(fu,n,eo);b&&x(2,2)},send:function(e,t,r){e&&e.length>0&&Q("eventsSendRequest",[t>=1e3&&t<=1999?t-1e3:0,!0!==r])},sent:function(e,t){W("eventsSent",e,t),O()},drop:function(e,t){W(fu,e,t>=8e3&&t<=8999?t-8e3:Zn)},rspFail:function(e){W(fu,e,eo),O()},oth:function(e,t){W(fu,e,Zn),O()}}),e._getDbgPlgTargets=function(){return[i]},e.initialize=function(s,c,u){Wi(c,(function(){return"PostChannel:initialize"}),(function(){var l=c;t.initialize(s,c,u),e.setInitialized(!1);var d=e._getTelCtx();s.extensionConfig[e.identifier]=s.extensionConfig[e.identifier]||{},r=d.getExtCfg(e.identifier),e._setTimeoutOverride=r.setTimeoutOverride?r.setTimeoutOverride:setTimeout.bind(gu),e._clearTimeoutOverride=r.clearTimeoutOverride?r.clearTimeoutOverride:clearTimeout.bind(gu),S=!r.disableOptimizeObj&&!!yi("chrome"),function(e){var t=e.getWParam;e.getWParam=function(){var e=0;return r.ignoreMc1Ms0CookieProcessing&&(e|=2),e|t()}}(l),r.eventsLimitInMem>0&&(m=r.eventsLimitInMem),r.immediateEventLimit>0&&(g=r.immediateEventLimit),r.autoFlushEventsLimit>0&&(a=r.autoFlushEventsLimit),r.disableXhrSync,Lo(r[vu])&&(A=r[vu]),Lo(r[yu])&&(_=r[yu]),V(),r.httpXHROverride&&r.httpXHROverride.sendPOST&&(o=r.httpXHROverride),hs(s.anonCookieName)&&i.addQueryStringParameter("anoncknm",s.anonCookieName),i.sendHook=r.payloadPreprocessor,i.sendListener=r.payloadListener;var h=r.overrideEndpointUrl?r.overrideEndpointUrl:s.endpointUrl;e._notificationManager=s.extensionConfig.NotificationManager,i.initialize(h,e.core,e,o,r);var p=s.disablePageUnloadEvents||[];Va(n,p),Ya(n,p),$a(R,s.disablePageShowEvents),e.setInitialized(!0)}),(function(){return{coreConfig:s,core:c,extensions:u}}))},e.processTelemetry=function(t,n){Cs(t,e.identifier);var o=(n=e._getTelCtx(n)).getExtCfg(e.identifier),i=!!r.disableTelemetry;o&&(i=i||!!o.disableTelemetry);var a=t;i||u||(r[mu]&&(a.iKey=r[mu]),o&&o[mu]&&(a.iKey=o[mu]),P(a,!0),b?x(2,2):O()),e.processNext(a,n)},e.setEventQueueLimits=function(e,t){m=e>0?e:1e4,a=t>0?t:0,V();var r=f>e;if(!r&&s>0)for(var n=rs;!r&&n<=os;n++){var o=E[n];o&&o.batches&&Do(o.batches,(function(e){e&&e.count()>=s&&(r=!0)}))}B(!0,r)},e.teardown=function(){x(2,2),u=!0,i.teardown()},e.pause=function(){U(),h=!0,i.pause()},e.resume=function(){h=!1,i.resume(),O()},e.addResponseHandler=function(e){i._responseHandlers.push(e)},e._loadTransmitProfiles=function(e){U(),G(),y=bc,O(),No(e,(function(e,t){var r=t.length;if(r>=2){var n=r>2?t[2]:0;if(t.splice(0,r-2),t[1]<0&&(t[0]=-1),t[1]>0&&t[0]>0){var o=t[0]/t[1];t[0]=Math.ceil(o)*t[1]}n>=0&&t[1]>=0&&n>t[1]&&(n=t[1]),t.push(n),v[e]=t}}))},e.flush=function(e,t,r){void 0===e&&(e=!0),h||(U(),r=r||1,e?(F(rs,0,r),D(),null==d?d=q((function(){K(t,r)}),0):l.push(t)):(M(rs,1,r),null!=t&&t()))},e.setMsaAuthTicket=function(e){i.addHeader(Bc,e)},e.hasEvents=N,e._setTransmitProfile=function(e){y!==e&&void 0!==v[e]&&(U(),y=e,O())},e._backOffTransmission=function(){I<4&&(I++,U(),O())},e._clearBackOff=function(){I&&(I=0,U(),O())}})),n}return En(t,e),t}(Zi),Tu=Cu,Iu=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return En(t,e),t.prototype.initialize=function(t,r){var n=this,o=this;Wi(this,(function(){return"ApplicationInsights:initialize"}),(function(){o._postChannel=new Tu,o._propertyManager=new Sc;var i=[n._propertyManager];if(r&&(i=i.concat(r)),t||Zo("You must provide a config object!"),t.channels&&t.channels.length>0){for(var a=!1,s=0;s<t.channels[0].length;s++)if(t.channels[0][s].identifier===o._postChannel.identifier){a=!0;break}a||t.channels[0].push(o._postChannel)}else t.channels=[[o._postChannel]];var c=t.extensionConfig=t.extensionConfig||[];c[o._postChannel.identifier]=t?t.channelConfiguration:{},c[o._propertyManager.identifier]=t?t.propertyConfiguration:{};try{e.prototype.initialize.call(n,t,i)}catch(e){o.logger.throwInternal(Xn.CRITICAL,ss.FailedToInitializeSDK,"Failed to initialize SDK."+Ri(e))}}),(function(){return{config:t,extensions:r}}))},t.prototype.getPropertyManager=function(){return this._propertyManager},t.prototype.getPostChannel=function(){return this._postChannel},t}(Es),wu=Iu,Eu=function(){function e(t,r){this.logger=t,this.isSampled=!(null==r?void 0:r.disabled)&&this.calculateSampling(null==r?void 0:r.samplingPercentage),this.logger.verbose("PerformanceTelemetryReporter: Sampled for 1p telemetry: "+this.isSampled.toString()),this.eventsToEmit=(null==r?void 0:r.eventsToEmit)||[xe.AcquireTokenSilent,xe.SsoSilent,xe.AcquireTokenByCode],this.logger.verbose("PerformanceTelemetryReporter: Events to be tracked include : "+this.eventsToEmit),this.logger.verbose("PerformanceTelemetryReporter: Events passed in the PerformanceTelemetryConfiguration are: "+(null==r?void 0:r.eventsToEmit));var n={instrumentationKey:e.instrumentationKey,extensions:[]};this.appInsights=new wu,this.appInsights.initialize(n,[]),this.logger.verbose("PerformanceTelemetryReporter: Initialized")}return e.prototype.calculateSampling=function(t){return 0===t?(this.logger.verbose(" PerformanceTelemetryReporter: No sampling rate configured."),!1):(this.logger.verbose("PerformanceTelemetryReporter: Configured sampling rate = "+t+" "),this.logger.verbose("PerformanceTelemetryReporter: DEFAULT sampling rate = "+e.DEFAULT_SAMPLING_RATE),Math.random()<=(t||e.DEFAULT_SAMPLING_RATE))},e.prototype.sendCustomEvent=function(e){var t=n(n({},e),{appName:void 0}),r={name:e.name,data:t};this.logger.verbose("PerformanceTelemetryReporter: Sending "+r.name+" for tracking"),this.appInsights.track(r)},e.prototype.canSendEvent=function(t){var r,n=!this.eventsToEmit||(null===(r=this.eventsToEmit)||void 0===r?void 0:r.indexOf(t.name))>-1,o=e.DEFAULT_ALLOWED_CLOUDS.some((function(e){return 0===t.authority.indexOf(e.toString())}));return this.isSampled&&n&&o},e.prototype.getPerformanceTelemetryCallback=function(){var e=this;this.logger.trace("PerformanceTelemetryReporter: Attaching callback to send custom metrics.");return this.logger.verbose(" PerformanceTelemetryReporter: Returning callback as telemetry emitted."),function(t){t.forEach((function(t){e.canSendEvent(t)?(e.logger.verbose("PerformanceTelemetryReporter: Emitting telemetry for "+t.name,t.correlationId),e.sendCustomEvent(t)):e.logger.verbose("PerformanceTelemetryReporter: Skipping telemetry for "+t.name,t.correlationId)}))}},e.DEFAULT_SAMPLING_RATE=.1,e.DEFAULT_ALLOWED_CLOUDS=[de.AzurePublic,de.AzurePpe],e.instrumentationKey="d634483c08244c1ca09af2b2d952c92e-ab2bba03-2ba3-49d8-a82c-ef6da750d8ab-7725",e}(),ku=function(e){function t(t,r){var n=e.call(this,t)||this,o=new Eu(n.getLogger(),null==r?void 0:r.performanceTelemetryConfiguration);return n.addPerformanceCallback(o.getPerformanceTelemetryCallback()),n}return r(t,e),t}(tn);!function(e){e.HANDSHAKE_REQUEST="BrokerHandshakeRequest",e.HANDSHAKE_RESPONSE="BrokerHandshakeResponse",e.AUTH_REQUEST="BrokerAuthRequest",e.REDIRECT_RESPONSE="BrokerRedirectResponse",e.HANDLE_REDIRECT_REQUEST="BrokerHandleRedirectRequest",e.AUTH_RESULT="BrokerAuthResult"}(uu||(uu={})),function(e){e.BROKER_RESPONSE="broker.response"}(lu||(lu={})),function(e){e.BROKER_CLIENT_ID="brk_client_id",e.BROKER_REDIRECT_URI="brk_redirect_uri"}(du||(du={})),function(e){e.BROKER_AUTH_ERROR_NAME="BrokerAuthError",e.INTERACTION_REQ_ERROR_NAME="InteractionRequiredAuthError",e.SERVER_ERROR_NAME="ServerError",e.CLIENT_AUTH_ERR_NAME="ClientAuthError",e.CLIENT_CONFIG_ERROR_NAME="ClientConfigurationError",e.BROWSER_AUTH_ERROR_NAME="BrowserAuthError",e.BROWSER_CONFIG_ERROR_NAME="BrowserConfigurationError",e.AUTH_ERROR_NAME="AuthError"}(hu||(hu={}));var Su="plain",bu="S256",Au=function(){function e(e){this.messageType=e}return e.validateMessage=function(e){if(!e.data||!e.data.messageType)return null;switch(e.data.messageType){case uu.HANDSHAKE_REQUEST:case uu.HANDSHAKE_RESPONSE:case uu.HANDLE_REDIRECT_REQUEST:case uu.AUTH_REQUEST:case uu.AUTH_RESULT:case uu.REDIRECT_RESPONSE:return e;default:return null}},e}(),_u=function(e){function t(t,r){var n=e.call(this,uu.HANDSHAKE_REQUEST)||this;return n.embeddedClientId=t,n.version=r,n}return r(t,e),t.validate=function(e){return e.data&&e.data.messageType===uu.HANDSHAKE_REQUEST&&e.data.embeddedClientId&&e.data.version?new t(e.data.embeddedClientId,e.data.version):null},t}(Au),Ru={code:"no_tokens_to_cache",desc:"The broker did not have any tokens for the client to cache."},Pu={code:"no_embedded_app",desc:"The embedded application object was not created. Please ensure you have configured your application correctly for an embedded application: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/broker-v2/lib/msal-browser/docs/broker.md#brokered-application-configuration"},Mu={code:"broker_response_invalid",desc:"The broker response did not have the expected values."},Nu={code:"broker_request_incomplete",desc:"The brokered request did not have the expected values."},Ou={code:"broker_popup_will_redirect",desc:"The request for a brokered popup requires a redirect by the broker. If your app does not perform the redirect, please check the broker's logs."},qu={code:"broker_timeout",desc:"Message broker timed out."},Uu={code:"broker_handshake_timeout",desc:"Broker handshake response timed out."},xu={code:"invalid_broker_message",desc:"messageType for broker message is invalid"},Lu={code:"untrusted_broker_error",desc:"The given broker origin is not trusted."},Bu={code:"no_trusted_brokers_provided",desc:"No trusted brokers provided."},Hu={code:"brokering_disabled",desc:"Brokering is not enabled for the client application. Please check logs to see if handshake was performed."},Du=function(e){function t(r,n){var o=e.call(this,r,n)||this;return Object.setPrototypeOf(o,t.prototype),o.name=hu.BROKER_AUTH_ERROR_NAME,o}return r(t,e),t.createNoTokensToCacheError=function(){return new t(Ru.code,""+Ru.desc)},t.createNoEmbeddedAppError=function(){return new t(Pu.code,Pu.desc)},t.createBrokerResponseInvalidError=function(){return new t(Mu.code,""+Mu.desc)},t.createBrokerRequestIncompleteError=function(){return new t(Nu.code,""+Nu.desc)},t.createBrokerPopupRequestRedirectingError=function(){return new t(Ou.code,Ou.desc)},t.createNoTrustedBrokersProvidedError=function(){return new Bt(Bu.code,Bu.desc)},t.createBrokeringDisabledError=function(e){return new Bt(Hu.code,Hu.desc+" Inner Error: "+e)},t.createMessageBrokerTimeoutError=function(){return new Bt(qu.code,qu.desc)},t.createMessageBrokerHandshakeTimeoutError=function(){return new Bt(Uu.code,Uu.desc)},t.createInvalidBrokerMessageError=function(){return new Bt(xu.code,xu.desc)},t.createUntrustedBrokerError=function(){return new Bt(Lu.code,Lu.desc)},t}(Bt),Fu=function(e){function t(t,r){var n=e.call(this,uu.HANDSHAKE_RESPONSE)||this;return n.version=t,n.brokerOrigin=r,n}return r(t,e),t.validate=function(e,r){var n=Au.validateMessage(e);if(r&&n&&n.data.messageType===uu.HANDSHAKE_RESPONSE&&n.data.version){if(r.filter((function(t){return le.matchPattern(t,e.origin)})).length<=0)throw Du.createUntrustedBrokerError();return new t(n.data.version,n.origin)}return null},t}(Au),Ku=function(e){function t(t,r,n,o){var i=e.call(this,uu.AUTH_REQUEST)||this;return i.embeddedClientId=t,i._embeddedAppOrigin=o,i.interactionType=r,i.request=n,i}return r(t,e),Object.defineProperty(t.prototype,"embeddedAppOrigin",{get:function(){return this._embeddedAppOrigin},enumerable:!1,configurable:!0}),t.validate=function(e){return e.data&&e.data.messageType===uu.AUTH_REQUEST&&e.data.embeddedClientId&&e.data.interactionType&&e.data.request?new t(e.data.embeddedClientId,e.data.interactionType,e.data.request,e.origin):null},t}(Au),zu=function(e){function t(){return e.call(this,uu.REDIRECT_RESPONSE)||this}return r(t,e),t.validate=function(e){return e.data&&e.data.messageType===uu.REDIRECT_RESPONSE?new t:null},t}(Au),Gu=function(e){function t(t,r,n){var o=e.call(this,uu.AUTH_RESULT)||this;return o.interactionType=t,o.result=r,o.errorPayload=o.generateErrorPayload(n),o}return r(t,e),t.prototype.generateErrorPayload=function(e){return e?n({},e):void 0},t.validate=function(e){return e.data&&e.data.messageType===uu.AUTH_RESULT&&e.data.interactionType&&(e.data.result||e.data.errorPayload)?new t(e.data.interactionType,e.data.result,e.data.errorPayload):null},t.detectError=function(e){switch(e.name){case hu.INTERACTION_REQ_ERROR_NAME:return new Ye(e.errorCode,e.errorMessage,e.subError);case hu.SERVER_ERROR_NAME:return new Oe(e.errorCode,e.errorMessage,e.subError);case hu.CLIENT_AUTH_ERR_NAME:return new ue(e.errorCode,e.errorMessage);case hu.CLIENT_CONFIG_ERROR_NAME:return new ve(e.errorCode,e.errorMessage);case hu.BROWSER_AUTH_ERROR_NAME:return new Bt(e.errorCode,e.errorMessage);case hu.BROWSER_CONFIG_ERROR_NAME:return new nr(e.errorCode,e.errorMessage);case hu.BROKER_AUTH_ERROR_NAME:return new Du(e.errorCode,e.errorMessage);case hu.AUTH_ERROR_NAME:return new ae(e.errorCode,e.errorMessage,e.subError);default:return ae.createUnexpectedError("Unknown error: "+JSON.stringify(e))}},t.processBrokerResponseMessage=function(e,r){var n=t.validate(e);return t.processBrokerResponse(n,r)},t.processBrokerResponse=function(e,r){if(!e)return null;if(e.errorPayload)throw t.detectError(e.errorPayload);if(!e.result||!e.result.tokensToCache)throw Du.createBrokerResponseInvalidError();var o=new Ge,i=new Ke,a=new Ie,s=e.result.tokensToCache,c={accessToken:Ee.toObject(s.accessToken,o),idToken:Ee.toObject(s.idToken,i),account:Ee.toObject(s.account,a),refreshToken:null,appMetadata:null};return r.saveCacheRecord(c),delete e.result.tokensToCache,n({},e.result)},t}(Au),Qu=function(e){function t(t,r){var n=e.call(this,uu.HANDLE_REDIRECT_REQUEST)||this;return n.embeddedClientId=t,n.version=r,n}return r(t,e),t.validate=function(e){return e.data&&e.data.messageType===uu.HANDLE_REDIRECT_REQUEST&&e.data.embeddedClientId&&e.data.version?new t(e.data.embeddedClientId,e.data.version):null},t}(Au);function ju(e){var t=e.brokerOptions,r={preferredInteractionType:null,brokerRedirectParams:{},actAsBroker:!1,allowBrokering:!1,trustedBrokerDomains:[],brokerHandshakeTimeout:(null==t?void 0:t.brokerHandshakeTimeout)||2e3,brokerMessageTimeout:(null==t?void 0:t.brokerMessageTimeout)||6e3,brokerInteractionTimeout:(null==t?void 0:t.brokerInteractionTimeout)||3e5};return{brokerOptions:n(n({},r),t)}}var Wu,Vu=function(){function e(){}return e.validateRedirectUri=function(e){if(le.isEmpty(e))throw ve.createRedirectUriEmptyError()},e.validatePrompt=function(e){var t=[];for(var r in M)t.push(M[r]);if(t.indexOf(e)<0)throw ve.createInvalidPromptError(e)},e.validateClaims=function(e){try{JSON.parse(e)}catch(e){throw ve.createInvalidClaimsRequestError()}},e.validateCodeChallengeParams=function(e,t){if(le.isEmpty(e)||le.isEmpty(t))throw ve.createInvalidCodeChallengeParamsError();this.validateCodeChallengeMethod(t)},e.validateCodeChallengeMethod=function(e){if([Su,bu].indexOf(e)<0)throw ve.createInvalidCodeChallengeMethodError()},e.sanitizeEQParams=function(e,t){return e?(t.forEach((function(t,r){e[r]&&delete e[r]})),e):{}},e}(),Yu=function(){function t(){this.parameters=new Map}return t.prototype.addResponseTypeCode=function(){this.parameters.set(S.RESPONSE_TYPE,encodeURIComponent(A.CODE_RESPONSE_TYPE))},t.prototype.addResponseMode=function(e){this.parameters.set(S.RESPONSE_MODE,encodeURIComponent(e||N.QUERY))},t.prototype.addScopes=function(e,t){void 0===t&&(t=!0);var r=t?s(e||[],_):e||[],n=new ye(r);this.parameters.set(S.SCOPE,encodeURIComponent(n.printScopes()))},t.prototype.addClientId=function(e){this.parameters.set(S.CLIENT_ID,encodeURIComponent(e))},t.prototype.addBrokerClientId=function(e){this.parameters.set(du.BROKER_CLIENT_ID,encodeURIComponent(e))},t.prototype.addRedirectUri=function(e,t){if(Vu.validateRedirectUri(e),t){var r=this.buildRedirectUri(e,t);this.parameters.set(S.REDIRECT_URI,encodeURIComponent(r))}else this.parameters.set(S.REDIRECT_URI,encodeURIComponent(e))},t.prototype.buildRedirectUri=function(e,t){return"brk-"+t+"://"+new Xe(e).getUrlComponents().HostNameAndPort},t.prototype.addBrokerRedirectUri=function(e){this.parameters.set(du.BROKER_REDIRECT_URI,encodeURIComponent(e))},t.prototype.addPostLogoutRedirectUri=function(e){Vu.validateRedirectUri(e),this.parameters.set(S.POST_LOGOUT_URI,encodeURIComponent(e))},t.prototype.addIdTokenHint=function(e){this.parameters.set(S.ID_TOKEN_HINT,encodeURIComponent(e))},t.prototype.addDomainHint=function(e){this.parameters.set(P.DOMAIN_HINT,encodeURIComponent(e))},t.prototype.addLoginHint=function(e){this.parameters.set(P.LOGIN_HINT,encodeURIComponent(e))},t.prototype.addCcsUpn=function(e){this.parameters.set(w.CCS_HEADER,encodeURIComponent("UPN:"+e))},t.prototype.addCcsOid=function(e){this.parameters.set(w.CCS_HEADER,encodeURIComponent("Oid:"+e.uid+"@"+e.utid))},t.prototype.addSid=function(e){this.parameters.set(P.SID,encodeURIComponent(e))},t.prototype.addClaims=function(e,t){var r=this.addClientCapabilitiesToClaims(e,t);Vu.validateClaims(r),this.parameters.set(S.CLAIMS,encodeURIComponent(r))},t.prototype.addCorrelationId=function(e){this.parameters.set(S.CLIENT_REQUEST_ID,encodeURIComponent(e))},t.prototype.addLibraryInfo=function(e){this.parameters.set(S.X_CLIENT_SKU,e.sku),this.parameters.set(S.X_CLIENT_VER,e.version),this.parameters.set(S.X_CLIENT_OS,e.os),this.parameters.set(S.X_CLIENT_CPU,e.cpu)},t.prototype.addPrompt=function(e){Vu.validatePrompt(e),this.parameters.set(""+S.PROMPT,encodeURIComponent(e))},t.prototype.addState=function(e){le.isEmpty(e)||this.parameters.set(S.STATE,encodeURIComponent(e))},t.prototype.addNonce=function(e){this.parameters.set(S.NONCE,encodeURIComponent(e))},t.prototype.addCodeChallengeParams=function(e,t){if(Vu.validateCodeChallengeParams(e,t),!e||!t)throw ve.createInvalidCodeChallengeParamsError();this.parameters.set(S.CODE_CHALLENGE,encodeURIComponent(e)),this.parameters.set(S.CODE_CHALLENGE_METHOD,encodeURIComponent(t))},t.prototype.addAuthorizationCode=function(e){this.parameters.set(S.CODE,encodeURIComponent(e))},t.prototype.addDeviceCode=function(e){this.parameters.set(S.DEVICE_CODE,encodeURIComponent(e))},t.prototype.addRefreshToken=function(e){this.parameters.set(S.REFRESH_TOKEN,encodeURIComponent(e))},t.prototype.addCodeVerifier=function(e){this.parameters.set(S.CODE_VERIFIER,encodeURIComponent(e))},t.prototype.addClientSecret=function(e){this.parameters.set(S.CLIENT_SECRET,encodeURIComponent(e))},t.prototype.addClientAssertion=function(e){this.parameters.set(S.CLIENT_ASSERTION,encodeURIComponent(e))},t.prototype.addClientAssertionType=function(e){this.parameters.set(S.CLIENT_ASSERTION_TYPE,encodeURIComponent(e))},t.prototype.addOboAssertion=function(e){this.parameters.set(S.OBO_ASSERTION,encodeURIComponent(e))},t.prototype.addRequestTokenUse=function(e){this.parameters.set(S.REQUESTED_TOKEN_USE,encodeURIComponent(e))},t.prototype.addGrantType=function(e){this.parameters.set(S.GRANT_TYPE,encodeURIComponent(e))},t.prototype.addClientInfo=function(){this.parameters.set(S.CLIENT_INFO,"1")},t.prototype.addExtraQueryParameters=function(e){var t=this;Vu.sanitizeEQParams(e,this.parameters),Object.keys(e).forEach((function(r){t.parameters.set(r,e[r])}))},t.prototype.addClientCapabilitiesToClaims=function(e,t){var r;if(e)try{r=JSON.parse(e)}catch(e){throw ve.createInvalidClaimsRequestError()}else r={};return t&&t.length>0&&(r.hasOwnProperty(b.ACCESS_TOKEN)||(r[b.ACCESS_TOKEN]={}),r[b.ACCESS_TOKEN][b.XMS_CC]={values:t}),JSON.stringify(r)},t.prototype.addUsername=function(e){this.parameters.set(j.username,e)},t.prototype.addPassword=function(e){this.parameters.set(j.password,e)},t.prototype.addPopToken=function(t){le.isEmpty(t)||(this.parameters.set(S.TOKEN_TYPE,e.AuthenticationScheme.POP),this.parameters.set(S.REQ_CNF,encodeURIComponent(t)))},t.prototype.addSshJwk=function(t){le.isEmpty(t)||(this.parameters.set(S.TOKEN_TYPE,e.AuthenticationScheme.SSH),this.parameters.set(S.REQ_CNF,encodeURIComponent(t)))},t.prototype.addServerTelemetry=function(e){this.parameters.set(S.X_CLIENT_CURR_TELEM,e.generateCurrentRequestHeaderValue()),this.parameters.set(S.X_CLIENT_LAST_TELEM,e.generateLastRequestHeaderValue())},t.prototype.addThrottling=function(){this.parameters.set(S.X_MS_LIB_CAPABILITY,te)},t.prototype.addLogoutHint=function(e){this.parameters.set(S.LOGOUT_HINT,encodeURIComponent(e))},t.prototype.createQueryString=function(){var e=new Array;return this.parameters.forEach((function(t,r){e.push(r+"="+t)})),e.join("&")},t}(),$u=function(e,t,r,n,o){this.account=e||null,this.idToken=t||null,this.accessToken=r||null,this.refreshToken=n||null,this.appMetadata=o||null},Ju=function(){function t(e,t,r,n,o,i){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i,this.homeAccountIdentifier=""}return t.prototype.validateServerAuthorizationCodeResponse=function(e,t,r){if(!e.state||!t)throw e.state?ue.createStateNotFoundError("Cached State"):ue.createStateNotFoundError("Server State");if(decodeURIComponent(e.state)!==decodeURIComponent(t))throw ue.createStateMismatchError();if(e.error||e.error_description||e.suberror){if(Ye.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Ye(e.error||A.EMPTY_STRING,e.error_description,e.suberror);throw new Oe(e.error||A.EMPTY_STRING,e.error_description,e.suberror)}e.client_info&&Ce(e.client_info,r)},t.prototype.validateTokenResponse=function(e){if(e.error||e.error_description||e.suberror){if(Ye.isInteractionRequiredError(e.error,e.error_description,e.suberror))throw new Ye(e.error,e.error_description,e.suberror);var t=e.error_codes+" - ["+e.timestamp+"]: "+e.error_description+" - Correlation ID: "+e.correlation_id+" - Trace ID: "+e.trace_id;throw new Oe(e.error,t,e.suberror)}},t.prototype.handleServerTokenResponse=function(e,r,n,a,s,c,u){return o(this,void 0,void 0,(function(){var o,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:if(e.id_token&&(o=new we(e.id_token||A.EMPTY_STRING,this.cryptoObj),s&&!le.isEmpty(s.nonce)&&o.claims.nonce!==s.nonce))throw ue.createNonceMismatchError();this.homeAccountIdentifier=Ie.generateHomeAccountId(e.client_info||A.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,o),s&&s.state&&(l=Je.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||a.sshKid||void 0,d=this.generateCacheRecord(e,r,n,a,o,c,s),i.label=1;case 1:return i.trys.push([1,,5,8]),this.persistencePlugin&&this.serializableCache?(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),h=new nt(this.serializableCache,!0),[4,this.persistencePlugin.beforeCacheAccess(h)]):[3,3];case 2:i.sent(),i.label=3;case 3:return!u||!d.account||(p=d.account.generateAccountKey(),this.cacheStorage.getAccount(p))?[4,this.cacheStorage.saveCacheRecord(d)]:(this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,a,o,l)]);case 4:return i.sent(),[3,8];case 5:return this.persistencePlugin&&this.serializableCache&&h?(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),[4,this.persistencePlugin.afterCacheAccess(h)]):[3,7];case 6:i.sent(),i.label=7;case 7:return[7];case 8:return[2,t.generateAuthenticationResult(this.cryptoObj,r,d,!1,a,o,l,e.spa_code)]}}))}))},t.prototype.handleBrokeredServerTokenResponse=function(e,r,a,s,c,u,l){return o(this,void 0,void 0,(function(){var o,d,h,p,g;return i(this,(function(i){switch(i.label){case 0:if(e.id_token&&(o=new we(e.id_token||A.EMPTY_STRING,this.cryptoObj),u&&!le.isEmpty(u.nonce)&&o.claims.nonce!==u.nonce))throw ue.createNonceMismatchError();return this.homeAccountIdentifier=Ie.generateHomeAccountId(e.client_info||A.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,o),u&&u.state&&(d=Je.parseRequestState(this.cryptoObj,u.state)),(h=this.generateCacheRecord(e,r,a,s,o,l,u,s.embeddedAppClientId)).refreshToken&&this.cacheStorage.setRefreshTokenCredential(h.refreshToken),h.account&&this.cacheStorage.setAccount(h.account),h.refreshToken=null,[4,t.generateAuthenticationResult(this.cryptoObj,r,h,!1,s,o,d)];case 1:return p=i.sent(),g=this.generateResponseThumbprint(r,s.scopes,s.embeddedAppClientId,c),[2,n(n({},p),{tokensToCache:h,responseThumbprint:g})]}}))}))},t.prototype.generateCacheRecord=function(e,t,r,n,o,i,a,s){var c,u,l=t.getPreferredCache();if(le.isEmpty(l))throw ue.createInvalidCacheEnvironmentError();!le.isEmpty(e.id_token)&&o&&(c=Ke.createIdTokenEntity(this.homeAccountIdentifier,l,e.id_token||A.EMPTY_STRING,s||this.clientId,o.claims.tid||A.EMPTY_STRING),u=this.generateAccountEntity(e,o,t,i,a));var d=null;if(!le.isEmpty(e.access_token)){var h=e.scope?ye.fromString(e.scope):new ye(n.scopes||[]),p=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,g=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,f=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,m=r+p,v=m+g,y=f&&f>0?r+f:void 0;d=Ge.createAccessTokenEntity(this.homeAccountIdentifier,l,e.access_token||A.EMPTY_STRING,s||this.clientId,o?o.claims.tid||A.EMPTY_STRING:t.tenant,h.printScopes(),m,v,this.cryptoObj,y,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}var C=null;le.isEmpty(e.refresh_token)||(C=Qe.createRefreshTokenEntity(this.homeAccountIdentifier,l,e.refresh_token||A.EMPTY_STRING,this.clientId,e.foci,i));var T=null;return le.isEmpty(e.foci)||(T=rt.createAppMetadataEntity(s||this.clientId,l,e.foci)),new $u(u,c,d,C,T)},t.prototype.generateAccountEntity=function(e,t,r,n,o){var i=r.authorityType,a=o?o.cloud_graph_host_name:"",s=o?o.msgraph_host:"";if(i===fe.Adfs)return this.logger.verbose("Authority type is ADFS, creating ADFS account"),Ie.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s);if(le.isEmpty(e.client_info)&&"AAD"===r.protocolMode)throw ue.createClientInfoEmptyError();return e.client_info?Ie.createAccount(e.client_info,this.homeAccountIdentifier,t,r,n,a,s):Ie.createGenericAccount(this.homeAccountIdentifier,t,r,n,a,s)},t.generateAuthenticationResult=function(t,r,n,a,s,c,u,l){var d,h,p;return o(this,void 0,void 0,(function(){var o,g,f,m,v,y,C,T,I,w,E;return i(this,(function(i){switch(i.label){case 0:if(o="",g=[],f=null,v=A.EMPTY_STRING,!n.accessToken)return[3,4];if(n.accessToken.tokenType!==e.AuthenticationScheme.POP||!n.accessToken.keyId)return[3,2];if(y=new tt(t),C=n.accessToken,T=C.secret,!(I=C.keyId))throw ue.createKeyIdMissingError();return[4,y.signPopToken(T,I,s)];case 1:return o=i.sent(),[3,3];case 2:o=n.accessToken.secret,i.label=3;case 3:g=ye.fromString(n.accessToken.target).asArray(),f=new Date(1e3*Number(n.accessToken.expiresOn)),m=new Date(1e3*Number(n.accessToken.extendedExpiresOn)),i.label=4;case 4:return n.appMetadata&&(v=n.appMetadata.familyId===F?F:A.EMPTY_STRING),w=(null==c?void 0:c.claims.oid)||(null==c?void 0:c.claims.sub)||A.EMPTY_STRING,E=(null==c?void 0:c.claims.tid)||A.EMPTY_STRING,[2,{authority:r.canonicalAuthority,uniqueId:w,tenantId:E,scopes:g,account:n.account?n.account.getAccountInfo():null,idToken:c?c.rawToken:A.EMPTY_STRING,idTokenClaims:c?c.claims:{},accessToken:o,fromCache:a,expiresOn:f,correlationId:s.correlationId,extExpiresOn:m,familyId:v,tokenType:(null===(d=n.accessToken)||void 0===d?void 0:d.tokenType)||A.EMPTY_STRING,state:u?u.userRequestState:A.EMPTY_STRING,cloudGraphHostName:(null===(h=n.account)||void 0===h?void 0:h.cloudGraphHostName)||A.EMPTY_STRING,msGraphHost:(null===(p=n.account)||void 0===p?void 0:p.msGraphHost)||A.EMPTY_STRING,code:l}]}}))}))},t.prototype.generateResponseThumbprint=function(e,t,r,n){var o={authority:e.canonicalAuthority,clientId:r,scopes:t};return n+"."+this.cryptoObj.base64Encode(JSON.stringify(o))},t}(),Xu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return r(n,t),n.prototype.getAuthCodeUrl=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){return t=this.createBrokerAuthCodeUrlQueryString(e),[2,Xe.appendQueryString(this.authority.authorizationEndpoint,t)]}))}))},n.prototype.acquireToken=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:if(this.logger.verbose("in acquireToken call"),!e||le.isEmpty(e.code))throw ue.createTokenRequestCannotBeMadeError();return r=ze.nowSeconds(),[4,this.executeBrokerTokenRequest(this.authority,e)];case 1:return n=i.sent(),(o=new Ju(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(n.body),e.embeddedAppClientId?[3,3]:[4,o.handleServerTokenResponse(n.body,this.authority,r,e,t)];case 2:case 4:return[2,i.sent()];case 3:return[4,o.handleBrokeredServerTokenResponse(n.body,this.authority,r,e,e.redirectUri,t)]}}))}))},n.prototype.executeBrokerTokenRequest=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u;return i(this,(function(i){switch(i.label){case 0:return r={clientId:this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid},[4,this.createBrokerTokenRequestBody(t)];case 1:if(n=i.sent(),o=this.createBrokerTokenQueryParameters(t),a=void 0,t.clientInfo)try{s=Ce(t.clientInfo,this.cryptoUtils),a={credential:s.uid+"."+s.utid,type:Ne.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}return c=this.createTokenRequestHeaders(a||t.ccsCredential),u=le.isEmpty(o)?e.tokenEndpoint:e.tokenEndpoint+"?"+o,[2,this.executePostToTokenEndpoint(u,n,c,r)]}}))}))},n.prototype.createBrokerAuthCodeUrlQueryString=function(e){var t=new Yu;t.addClientId(e.embeddedAppClientId);var r=s(e.scopes||[],e.extraScopesToConsent||[]);t.addScopes(r),t.addRedirectUri(e.redirectUri,this.config.authOptions.clientId);var n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==M.SELECT_ACCOUNT)if(e.sid&&e.prompt===M.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){var o=this.extractSidFromAccount(e.account);if(o&&e.prompt===M.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(o);try{var i=Te(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{i=Te(e.account.homeAccountId);t.addCcsOid(i)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");return e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(!le.isEmpty(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters),t.addBrokerClientId(this.config.authOptions.clientId),t.addBrokerRedirectUri(e.brokerRedirectUri),t.createQueryString()},n.prototype.createBrokerTokenQueryParameters=function(e){var t=new Yu;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},n.prototype.createBrokerTokenRequestBody=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c;return i(this,(function(i){switch(i.label){case 0:return(r=new Yu).addClientId(t.embeddedAppClientId),r.addRedirectUri(t.redirectUri,this.config.authOptions.clientId),r.addScopes(t.scopes),r.addAuthorizationCode(t.code),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),t.codeVerifier&&r.addCodeVerifier(t.codeVerifier),r.addGrantType("authorization_code"),r.addClientInfo(),t.authenticationScheme===e.AuthenticationScheme.POP&&t.resourceRequestMethod&&t.resourceRequestUri?[4,new tt(this.cryptoUtils).generateCnf(t)]:[3,2];case 1:return n=i.sent(),r.addPopToken(n.reqCnfString),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ve.createMissingSshJwkError();r.addSshJwk(t.sshJwk)}i.label=3;case 3:if(o=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(o),(!le.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),a=void 0,t.clientInfo)try{s=Ce(t.clientInfo,this.cryptoUtils),a={credential:s.uid+"."+s.utid,type:Ne.HOME_ACCOUNT_ID}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else a=t.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&a)switch(a.type){case Ne.HOME_ACCOUNT_ID:try{s=Te(a.credential),r.addCcsOid(s)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Ne.UPN:r.addCcsUpn(a.credential)}return t.tokenBodyParameters&&r.addExtraQueryParameters(t.tokenBodyParameters),!t.enableSpaAuthorizationCode||t.tokenBodyParameters&&t.tokenBodyParameters[S.RETURN_SPA_CODE]||r.addExtraQueryParameters(((c={})[S.RETURN_SPA_CODE]="1",c)),r.addBrokerClientId(this.config.authOptions.clientId),r.addBrokerRedirectUri(t.brokerRedirectUri),[2,r.createQueryString()]}}))}))},n.prototype.extractSidFromAccount=function(e){return e.idTokenClaims&&e.idTokenClaims.sid||null},n}(it),Zu=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,l;return i(this,(function(i){switch(i.label){case 0:return[4,this.initializeBrokeredRequest(t,e.InteractionType.Redirect)];case 1:r=i.sent(),this.browserStorage.setRedirectRequestContext(r.embeddedAppClientId),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null),n=this.initializeServerTelemetryManager(e.ApiId.acquireTokenRedirect),i.label=2;case 2:return i.trys.push([2,7,,8]),[4,this.initializeAuthorizationCodeRequest(r)];case 3:return o=i.sent(),[4,this.createAuthCodeClient(n,r.authority)];case 4:return a=i.sent(),this.logger.verbose("Auth code client created"),s=new mr(a,this.browserStorage,o,this.logger,this.browserCrypto,this.performanceClient),[4,a.getAuthCodeUrl(r)];case 5:return c=i.sent(),u=this.getRedirectStartPage(t.redirectStartPage),this.logger.verbosePii("Redirect start page: "+u),[4,s.initiateAuthRequest(c,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:u,onRedirectNavigate:t.onRedirectNavigate})];case 6:return[2,i.sent()];case 7:throw(l=i.sent())instanceof ae&&l.setCorrelationId(this.correlationId),n.cacheFailedRequest(l),this.browserStorage.cleanRequestByState(r.state),l;case 8:return[2]}}))}))},a.prototype.createAuthCodeClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new Xu(r)]}}))}))},a.prototype.initializeBrokeredRequest=function(e,t){return o(this,void 0,void 0,(function(){var r,o,a,c,u,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:return this.logger.verbose("initializeBrokeredRequest called"),r=A.EMPTY_STRING,e.state&&(o=Je.parseRequestState(this.browserCrypto,e.state),r=o&&o.userRequestState||""),a=e.authority||this.config.auth.authority,c=new ye(e.scopes||[]),u={interactionType:t,brokeredClientId:e.embeddedAppClientId,brokeredReqAuthority:a,brokeredReqScopes:c.printScopes()},l=Je.setRequestState(this.browserCrypto,r,u),(d=e.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+d)),h=e.nonce||this.browserCrypto.createNewGuid(),this.browserStorage.setInteractionInProgress(!0),p=[{}],[4,this.initializeBaseRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,p.concat([i.sent()])),{account:d||void 0,state:l,nonce:h,responseMode:N.FRAGMENT,authority:a,correlationId:this.correlationId,scopes:s(e&&e.scopes||[]),redirectUri:this.getRedirectUri(e.redirectUri),brokerRedirectUri:e.brokerRedirectUri,embeddedAppClientId:e.embeddedAppClientId}])]}}))}))},a}(kr),el=function(){function e(){}return e.setRequestState=function(t,r,n,o){var i=e.generateLibraryState(t,n,o);return le.isEmpty(r)?i:""+i+A.RESOURCE_DELIM+r},e.generateLibraryState=function(e,t,r){if(!e)throw ue.createNoCryptoObjectError("generateLibraryState");var n={id:r||e.createNewGuid()};t&&(n.meta=t);var o=JSON.stringify(n);return e.base64Encode(o)},e.parseRequestState=function(e,t){if(!e)throw ue.createNoCryptoObjectError("parseRequestState");if(le.isEmpty(t))throw ue.createInvalidStateError(t,"Null, undefined or empty state");try{var r=t.split(A.RESOURCE_DELIM),n=r[0],o=r.length>1?r.slice(1).join(A.RESOURCE_DELIM):"",i=e.base64Decode(n),a=JSON.parse(i);return{userRequestState:le.isEmpty(o)?"":o,libraryState:a}}catch(e){throw ue.createInvalidStateError(t,e.message)}},e}(),tl=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.initializeBrokeredRequest(t,e.InteractionType.Popup)];case 1:return r=i.sent(),this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null),n=this.generatePopupName(r.scopes,r.authority),o=t.popupWindowAttributes||{},this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),[2,this.acquireTokenPopupAsync(r,n,o)]):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),a=this.openSizedPopup("about:blank",n,o),[2,this.acquireTokenPopupAsync(r,n,o,a)]);case 2:return s=i.sent(),[2,Promise.reject(s)];case 3:return[2]}}))}))},a.prototype.createAuthCodeClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new Xu(r)]}}))}))},a.prototype.initializeBrokeredRequest=function(e,t){return o(this,void 0,void 0,(function(){var r,o,a,c,u,l,d,h,p,g;return i(this,(function(i){switch(i.label){case 0:return this.logger.verbose("initializeBrokeredRequest called"),r=A.EMPTY_STRING,o=A.EMPTY_STRING,e.state&&(a=el.parseRequestState(this.browserCrypto,e.state),r=a&&a.userRequestState||A.EMPTY_STRING,o=a&&a.libraryState.id||A.EMPTY_STRING),c=e.authority||this.config.auth.authority,u=new ye(e.scopes||[]),l={interactionType:t,brokeredClientId:e.embeddedAppClientId,brokeredReqAuthority:c,brokeredReqScopes:u.printScopes()},d=el.setRequestState(this.browserCrypto,r,l,o),(h=e.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+h)),p=e.nonce||this.browserCrypto.createNewGuid(),this.browserStorage.setInteractionInProgress(!0),g=[{}],[4,this.initializeBaseRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,g.concat([i.sent()])),{account:h||void 0,state:d,nonce:p,responseMode:N.FRAGMENT,authority:c,correlationId:this.correlationId,scopes:s(e&&e.scopes||[]),redirectUri:this.getRedirectUri(e.redirectUri),brokerRedirectUri:e.brokerRedirectUri,embeddedAppClientId:e.embeddedAppClientId}])]}}))}))},a}(Sr),rl=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(r){return o(this,void 0,void 0,(function(){var o;return i(this,(function(i){switch(i.label){case 0:if(this.logger.verbose("acquireTokenByIframe called"),le.isEmpty(r.loginHint)&&le.isEmpty(r.sid)&&(!r.account||le.isEmpty(r.account.username))&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request."),r.prompt&&r.prompt!==M.NONE)throw Bt.createSilentPromptValueError(r.prompt);return[4,this.initializeBrokeredRequest(n(n({},r),{prompt:M.NONE}),e.InteractionType.Silent)];case 1:return o=i.sent(),[2,t.prototype.acquireToken.call(this,o)]}}))}))},a.prototype.createAuthCodeClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new Xu(r)]}}))}))},a.prototype.initializeBrokeredRequest=function(e,t){return o(this,void 0,void 0,(function(){var r,o,a,c,u,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:return this.logger.verbose("initializeBrokeredRequest called"),r=A.EMPTY_STRING,e.state&&(o=Je.parseRequestState(this.browserCrypto,e.state),r=o&&o.userRequestState||""),a=e.authority||this.config.auth.authority,c=new ye(e.scopes||[]),u={interactionType:t,brokeredClientId:e.embeddedAppClientId,brokeredReqAuthority:a,brokeredReqScopes:c.printScopes()},l=Je.setRequestState(this.browserCrypto,r,u),(d=e.account||this.browserStorage.getActiveAccount())&&(this.logger.verbose("Setting validated request account"),this.logger.verbosePii("Setting validated request account: "+d)),h=e.nonce||this.browserCrypto.createNewGuid(),p=[{}],[4,this.initializeBaseRequest(e)];case 1:return[2,n.apply(void 0,[n.apply(void 0,p.concat([i.sent()])),{account:d||void 0,state:l,nonce:h,responseMode:N.FRAGMENT,authority:a,correlationId:this.correlationId,scopes:s(e&&e.scopes||[]),redirectUri:this.getRedirectUri(e.redirectUri)}])]}}))}))},a}(Pr),nl=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(e){return o(this,void 0,void 0,(function(){var t,r,n;return i(this,(function(o){switch(o.label){case 0:return t=ze.nowSeconds(),[4,this.executeBrokerTokenRequest(e,this.authority)];case 1:return r=o.sent(),(n=new Ju(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin)).validateTokenResponse(r.body),e.embeddedAppClientId?[2,n.handleBrokeredServerTokenResponse(r.body,this.authority,t,e,e.embeddedAppRedirectUri)]:[2,n.handleServerTokenResponse(r.body,this.authority,t,e,void 0,void 0,!0)]}}))}))},a.prototype.acquireTokenByRefreshToken=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){if(!e)throw ve.createEmptyTokenRequestError();if(!e.account)throw ue.createNoAccountInSilentRequestError();if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return[2,this.acquireBrokerTokenWithCachedRefreshToken(e,!0)]}catch(n){if(t=n instanceof Ye&&n.errorCode===Ve.noTokensFoundError.code,r=n instanceof Oe&&n.errorCode===re&&n.subError===ne,t||r)return[2,this.acquireBrokerTokenWithCachedRefreshToken(e,!1)];throw n}return[2,this.acquireBrokerTokenWithCachedRefreshToken(e,!1)]}))}))},a.prototype.executeBrokerTokenRequest=function(e,t){return o(this,void 0,void 0,(function(){var r,n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return[4,this.createBrokerTokenRequestBody(e)];case 1:return r=i.sent(),n=this.createBrokerTokenQueryParameters(e),o=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid},s=Xe.appendQueryString(t.tokenEndpoint,n),[2,this.executePostToTokenEndpoint(s,r,o,a)]}}))}))},a.prototype.acquireBrokerTokenWithCachedRefreshToken=function(e,t){return o(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){if(!(r=this.cacheManager.getRefreshToken(e.account,t)))throw Ye.createNoTokensFoundError();return o=n(n({},e),{refreshToken:r.secret}),[2,this.acquireToken(o)]}))}))},a.prototype.createBrokerTokenQueryParameters=function(e){var t=new Yu;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()},a.prototype.createBrokerTokenRequestBody=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a;return i(this,(function(i){switch(i.label){case 0:return(r=new Yu).addClientId(t.embeddedAppClientId),r.addScopes(t.scopes),r.addGrantType("refresh_token"),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addThrottling(),this.serverTelemetryManager&&r.addServerTelemetry(this.serverTelemetryManager),n=t.correlationId||this.config.cryptoInterface.createNewGuid(),r.addCorrelationId(n),r.addRefreshToken(t.refreshToken),t.authenticationScheme!==e.AuthenticationScheme.POP?[3,2]:[4,new tt(this.cryptoUtils).generateCnf(t)];case 1:return o=i.sent(),r.addPopToken(o.reqCnfString),[3,3];case 2:if(t.authenticationScheme===e.AuthenticationScheme.SSH){if(!t.sshJwk)throw ve.createMissingSshJwkError();r.addSshJwk(t.sshJwk)}i.label=3;case 3:if((!le.isEmpty(t.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(t.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&t.ccsCredential)switch(t.ccsCredential.type){case Ne.HOME_ACCOUNT_ID:try{a=Te(t.ccsCredential.credential),r.addCcsOid(a)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case Ne.UPN:r.addCcsUpn(t.ccsCredential.credential)}return r.addBrokerClientId(this.config.authOptions.clientId),r.addRedirectUri(t.embeddedAppRedirectUri,this.config.authOptions.clientId),[2,r.createQueryString()]}}))}))},a}(at),ol=function(t){function a(){return null!==t&&t.apply(this,arguments)||this}return r(a,t),a.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r,o,a,s=this;return i(this,(function(i){switch(i.label){case 0:return r=n(n({},t),this.initializeBaseRequest(t)),o=this.initializeServerTelemetryManager(e.ApiId.acquireTokenSilent_silentFlow),[4,this.createRefreshTokenClient(o,r.authority)];case 1:return a=i.sent(),this.logger.verbose("Refresh token client created"),[2,a.acquireTokenByRefreshToken(r).catch((function(e){throw e instanceof ae&&e.setCorrelationId(s.correlationId),o.cacheFailedRequest(e),e}))]}}))}))},a.prototype.createRefreshTokenClient=function(e,t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return[4,this.getClientConfiguration(e,t)];case 1:return r=n.sent(),[2,new nl(r)]}}))}))},a}(Mr),il=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.prototype.generateBrokerResponseKey=function(e){return lu.BROKER_RESPONSE+"."+e},t.prototype.getBrokerResponseByOrigin=function(e){var t=this.getMemoryKeys(),r=lu.BROKER_RESPONSE+"."+e,n=t.filter((function(e){return e.indexOf(r)>=0}));return n.length<=0?null:(n.length>1&&this.logger.error("Too many responses found for the origin, sending back the first one found. You may need to call login/acquireTokenPopup/Silent() again."),this.getBrokerResponse(n[0]))},t.prototype.getBrokerResponseByThumbprint=function(e,t){var r=t+"."+this.cryptoImpl.base64Encode(JSON.stringify(e)),n=lu.BROKER_RESPONSE+"."+r;return this.getBrokerResponse(n)},t.prototype.getBrokerResponse=function(e){var t=this.getMemoryCache(e);return t?(this.removeMemoryItem(e),t):null},t.prototype.removeMemoryItem=function(e){return this.internalStorage.removeItem(e),!0},t.prototype.getMemoryCache=function(e){var t=this.generateCacheKey(e),r=this.internalStorage.getItem(t);return r||null},t.prototype.setMemoryCache=function(e,t){var r=this.generateCacheKey(e);this.internalStorage.setItem(r,t)},t.prototype.getMemoryKeys=function(){return this.internalStorage.getKeys()},t}(sr),al=function(e){function t(t,r,n,o,i,a,s,c,u,l,d,h){var p=e.call(this,t,r,n,o,i,a,s,c,u,l,d,h)||this;return p.embeddedAppClientId="",p.embeddedAppOrigin="",p}return r(t,e),t.prototype.acquireToken=function(t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:return this.logger.verbose("Getting tokens from brokered native flow."),r=t,this.embeddedAppClientId=r.embeddedAppClientId,this.embeddedAppOrigin=r.embeddedAppRedirectUri,[4,e.prototype.acquireToken.call(this,r)];case 1:return[2,n.sent()]}}))}))},t.prototype.handleNativeResponse=function(t,r,a){var s;return o(this,void 0,void 0,(function(){var o,c,u,l,d,h,p,g;return i(this,(function(i){switch(i.label){case 0:return this.logger.trace("BrokerNativeInteractionClient - handleNativeResponse called"),c="",u=this.createIdTokenObj(t),l=this.createHomeAccountIdentifier(t,u),d=null===(s=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:r.accountId}))||void 0===s?void 0:s.homeAccountId,h=new Ju(this.config.auth.clientId,this.browserStorage,this.browserCrypto,this.logger,null,null),[4,this.getDiscoveredAuthority(r.authority)];case 1:return p=i.sent(),l!==d||t.account.id===r.accountId?[3,3]:(this.logger.verbose("Getting tokens from brokered native flow."),[4,this.handleEmbeddedNativeResponse(t,r,l,u,a)]);case 2:return o=i.sent(),c=h.generateResponseThumbprint(p,ye.fromString(t.scope).asArray(),this.embeddedAppClientId||r.embeddedAppClientId,this.embeddedAppOrigin||r.embeddedAppRedirectUri),[3,5];case 3:return[4,e.prototype.handleNativeResponse.call(this,t,r,a)];case 4:o=i.sent(),i.label=5;case 5:return g=h.generateCacheRecord(t,p,a,this.convertNativeRequestToBaseAuthRequest(r),u,void 0,void 0,this.embeddedAppClientId||r.embeddedAppClientId),[2,n(n({},o),{tokensToCache:g,responseThumbprint:c})]}}))}))},t.prototype.handleEmbeddedNativeResponse=function(e,t,r,n,a){return o(this,void 0,void 0,(function(){var o,s,c;return i(this,(function(i){switch(i.label){case 0:return[4,this.getDiscoveredAuthority(t.authority)];case 1:return o=i.sent(),s=o.getPreferredCache(),c=this.createAccountEntity(e,r,n,s),[4,this.generateAuthenticationResult(e,t,n,c,o.canonicalAuthority,a)];case 2:return[2,i.sent()]}}))}))},t.prototype.convertNativeRequestToBaseAuthRequest=function(e){var t=e.scope,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["scope"]),o=ye.fromString(t);return n(n({},r),{scopes:o.asArray()})},t}(wr);!function(e){e.ExperimentalPublicClientApplicationInitializeBrokering="experimentalPublicClientApplicationInitializeBrokering",e.BrokerClientApplicationHandleBrokerHandshake="brokerClientApplicationHandleBrokerHandshake",e.BrokerClientApplicationBrokeredSSOSilentRequest="brokerClientApplicationBrokeredSSOSilentRequest",e.BrokerClientApplicationBrokeredSilentRequest="brokerClientApplicationBrokeredSilentRequest",e.EmbeddedClientApplicationSendSSOSilentRequest="embeddedClientApplicationSendSSOSilentRequest",e.EmbeddedClientApplicationSendPopupRequest="embeddedClientApplicationSendPopupRequest",e.EmbeddedClientApplicationSendRedirectRequest="embeddedClientApplicationSendRedirectRequest",e.EmbeddedClientApplicationHandleRedirectRequest="embeddedClientApplicationHandleRedirectRequest",e.EmbeddedClientApplicationSendSilentRefreshRequest="embeddedClientApplicationSendSilentRefreshRequest"}(Wu||(Wu={}));var sl=new Set(["brokerInteractionTimeoutMs","brokerMessageTimeoutMs","brokerHandshakeTimeoutMs","brokerIframeTimeoutMs"]);function cl(e,t,r){return e.startMeasurement(t,r)}function ul(e,t){e&&e.addStaticFields(function(e){var t,r;try{for(var n=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(Object.keys(e)),o=n.next();!o.done;o=n.next()){var i=o.value;sl.has(i)&&"number"==typeof e[i]&&(e[i]=Math.floor(e[i]))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}return e}(t))}var ll,dl,hl=function(t){function a(e,r){var n=t.call(this,e)||this;return n.brokerStorage=new il(n.config.auth.clientId,n.config.cache,n.browserCrypto,n.logger),n.currentBrokerRedirectResponse=void 0,n.hybridAuthPromise=void 0,n.experimentalConfig=ju(r),n}return r(a,t),a.prototype.handleRedirectPromise=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:return t=this.handleBrokerRedirect(e),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(mt.REDIRECT_CONTEXT)),this.currentBrokerRedirectResponse=this.waitForBrokeredResponse(t),[4,this.currentBrokerRedirectResponse];case 1:return r=n.sent(),this.currentBrokerRedirectResponse=void 0,[2,r&&!r.tokensToCache?r:null]}}))}))},a.prototype.getRequestContext=function(){return this.brokerStorage.getRedirectRequestContext()},a.prototype.handleBrokerRedirect=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,l,d=this;return i(this,(function(i){return this.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_START,e.InteractionType.Redirect),this.logger.verbose("handleBrokerRedirect called"),r=this.getAllAccounts(),this.isBrowserEnvironment?(n=t||A.EMPTY_STRING,void 0===(o=this.redirectResponse.get(n))?(this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise"),a=this.browserStorage.getCachedNativeRequest(),s=void 0,a&&Er.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t?(this.logger.trace("handleRedirectPromise - acquiring token from native platform"),c=new al(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(a),this.nativeInternalStorage,a.correlationId),s=c.handleRedirectPromise()):(u=this.browserStorage.getTemporaryCache(mt.CORRELATION_ID,!0)||"",l=new Zu(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,u),s=l.handleRedirectPromise(t)),o=s.then((function(t){t&&(r.length<d.getAllAccounts().length?(d.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Redirect,t),d.logger.verbose("handleRedirectResponse returned result, login success")):(d.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),d.logger.verbose("handleRedirectResponse returned result, acquire token success")));return d.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((function(t){throw r.length>0?d.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):d.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),d.eventHandler.emitEvent(e.EventType.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})),this.redirectResponse.set(n,o)):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),[2,o]):(this.logger.verbose("handleRedirectPromise returns null, not browser environment"),[2,null])}))}))},a.prototype.waitForBrokeredResponse=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return[4,e];case 1:if(t=r.sent()){if(!t.tokensToCache)return[2,t];this.brokerStorage.setMemoryCache(this.brokerStorage.generateBrokerResponseKey(t.responseThumbprint),JSON.stringify(t)),this.setActiveAccount(t.account)}return[2,null]}}))}))},a.prototype.listenForBrokerMessage=function(e){return o(this,void 0,void 0,(function(){return i(this,(function(t){return this.logger.verbose("listening for child broker messages."),window.addEventListener("message",this.handleBrokerMessage.bind(this)),e&&e.codeRequest&&(this.hybridAuthPromise=this.acquireTokenByCode(e.codeRequest)),[2,this.hybridAuthPromise]}))}))},a.prototype.handleBrokerMessage=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:if(!(t=Au.validateMessage(e)))return[3,8];switch(t.data.messageType){case uu.HANDSHAKE_REQUEST:return[3,1];case uu.HANDLE_REDIRECT_REQUEST:return[3,3];case uu.AUTH_REQUEST:return[3,5]}return[3,7];case 1:return this.logger.verbose("Broker handshake request received"),[4,this.handleBrokerHandshake(t)];case 2:case 4:case 6:return[2,r.sent()];case 3:return this.logger.verbose("Broker handle redirect request received"),[4,this.handleBrokerRedirectResponse(t)];case 5:return this.logger.verbose("Broker auth request received"),[4,this.handleBrokerAuthRequest(t)];case 7:case 8:return[2]}}))}))},a.prototype.handleBrokerHandshake=function(e){return o(this,void 0,void 0,(function(){var t,r,n,o;return i(this,(function(i){switch(i.label){case 0:if(t=cl(this.performanceClient,Wu.BrokerClientApplicationHandleBrokerHandshake),r=_u.validate(e),this.logger.verbose("Broker handshake validated: "+JSON.stringify(r)),n=new Fu(ur,""),!this.hybridAuthPromise)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.hybridAuthPromise];case 2:return i.sent(),[3,4];case 3:return o=i.sent(),this.logger.error("Broker could obtain tokens use authorization code initializer: "+o),[3,4];case 4:return e.source.postMessage(n,e.origin),t.endMeasurement({success:!0}),this.logger.verbose("Sending handshake response to "+e.origin),[2]}}))}))},a.prototype.handleBrokerRedirectResponse=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s;return i(this,(function(i){switch(i.label){case 0:return Qu.validate(t)?(r=t.ports[0],this.currentBrokerRedirectResponse?[4,this.currentBrokerRedirectResponse]:[3,2]):[3,3];case 1:i.sent(),i.label=2;case 2:if(n=this.brokerStorage.getBrokerResponseByOrigin(this.getEmbeddedAppRedirectUri(t.origin)))return o=JSON.parse(n),a=t.ports[0],s=new Gu(e.InteractionType.Redirect,o),this.logger.verbosePii("Sending auth response"),a.postMessage(s),a.close(),[2];s=new Gu(e.InteractionType.Redirect,null),r.postMessage(s),r.close(),i.label=3;case 3:return[2]}}))}))},a.prototype.handleBrokerAuthRequest=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a,s,c,u,l;return i(this,(function(i){switch(i.label){case 0:if(!(r=Ku.validate(t)))return[3,3];if(!r.request.authority||!r.request.scopes)throw Du.createBrokerRequestIncompleteError();return cl(this.performanceClient,xe.AcquireTokenByBroker,r.request.correlationId),this.logger.verbose("Broker auth request validated: "+r),this.currentBrokerRedirectResponse?[4,this.currentBrokerRedirectResponse]:[3,2];case 1:i.sent(),i.label=2;case 2:if(n={authority:r.request.authority,clientId:r.embeddedClientId,scopes:r.request.scopes},o=this.brokerStorage.getBrokerResponseByThumbprint(n,this.getEmbeddedAppRedirectUri(r.embeddedAppOrigin)))return a=JSON.parse(o),s=t.ports[0],c=new Gu(e.InteractionType.Redirect,a),this.logger.verbosePii("Sending auth response"),s.postMessage(c),s.close(),[2];switch(u=r.request.account||this.getActiveAccount(),r.interactionType){case e.InteractionType.Silent:return u?[2,this.brokeredSilentRequest(r,t.ports[0],u)]:[2,this.brokeredSsoSilentRequest(r,t.ports[0])];case e.InteractionType.Redirect:case e.InteractionType.Popup:default:return l=this.getInteractionType(r.interactionType),[2,this.interactiveBrokerRequest(l,r,t)]}i.label=3;case 3:return[2]}}))}))},a.prototype.getInteractionType=function(e){var t=this.experimentalConfig.brokerOptions.preferredInteractionType;return t||e},a.prototype.interactiveBrokerRequest=function(t,r,n){return o(this,void 0,void 0,(function(){return i(this,(function(o){switch(t){case e.InteractionType.Redirect:return[2,this.brokeredRedirectRequest(r,n.ports[0])];case e.InteractionType.Popup:return[2,this.brokeredPopupRequest(r,n.ports[0])];case e.InteractionType.Silent:return this.logger.error("Invalid code path. interactiveBrokerRequest() should only be called for interactive requests."),[2];case e.InteractionType.None:return this.logger.error("Broker is blocking interactive requests. Please attempt a silent request or sign into the broker first."),[2];default:return this.logger.error("Invalid code path. interactiveBrokerRequest() should only be called for interactive requests."),[2]}}))}))},a.prototype.brokeredRedirectRequest=function(t,r){var a,s;return o(this,void 0,void 0,(function(){var o,c,u,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("Brokered redirect request initiated."),i.label=1;case 1:return i.trys.push([1,5,,6]),o=new zu,r.postMessage(o),r.close(),this.logger.verbose("Sending redirect response: "+o),c=t.request,u=new Zu(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,c.correlationId),c.redirectUri=t.embeddedAppOrigin,c.embeddedAppClientId=t.embeddedClientId,c.brokerRedirectUri=u.getRedirectUri(),c.redirectStartPage=null===(a=this.experimentalConfig.brokerOptions.brokerRedirectParams)||void 0===a?void 0:a.redirectStartPage,c.onRedirectNavigate=null===(s=this.experimentalConfig.brokerOptions.brokerRedirectParams)||void 0===s?void 0:s.onRedirectNavigate,l=c.account||this.getActiveAccount(),this.canUseNative(c,null==l?void 0:l.nativeAccountId)?(this.logger.verbose("Native flow available for broker."),c.embeddedAppRedirectUri=this.getEmbeddedAppRedirectUri(t.embeddedAppOrigin),(d=t.request).extraQueryParameters=n(n({},d.extraQueryParameters),{child_client_id:c.embeddedAppClientId,child_redirect_uri:c.embeddedAppRedirectUri}),d.redirectUri=hr.getCurrentUri(),this.browserStorage.setRedirectRequestContext(c.embeddedAppClientId),this.browserStorage.setInteractionInProgress(!0),[4,this.acquireTokenByNative(d,e.ApiId.acquireTokenRedirect)]):[3,3];case 2:return i.sent(),[3,4];case 3:return[2,u.acquireToken(c)];case 4:return[3,6];case 5:return h=i.sent(),p=new Gu(e.InteractionType.Redirect,null,h),this.logger.verbose("Found auth error in redirect: "+h),r.postMessage(p),r.close(),[3,6];case 6:return[2]}}))}))},a.prototype.brokeredPopupRequest=function(t,r){return o(this,void 0,void 0,(function(){var o,a,s,c,u,l,d;return i(this,(function(i){switch(i.label){case 0:this.logger.verbose("Brokered popup request initiated."),i.label=1;case 1:return i.trys.push([1,6,,7]),o=t.request,a=new tl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,o.correlationId),o.redirectUri=t.embeddedAppOrigin,o.embeddedAppClientId=t.embeddedClientId,o.brokerRedirectUri=a.getRedirectUri(),s=void 0,c=o.account||this.getActiveAccount(),this.canUseNative(o,null==c?void 0:c.nativeAccountId)?(this.logger.verbose("Native flow available for broker."),o.embeddedAppRedirectUri=this.getEmbeddedAppRedirectUri(t.embeddedAppOrigin),(u=t.request).extraQueryParameters=n(n({},u.extraQueryParameters),{child_client_id:o.embeddedAppClientId,child_redirect_uri:o.embeddedAppRedirectUri}),u.redirectUri=hr.getCurrentUri(),[4,this.acquireTokenByNative(u,e.ApiId.acquireTokenPopup)]):[3,3];case 2:return s=i.sent(),[3,5];case 3:return[4,a.acquireToken(o)];case 4:s=i.sent(),i.label=5;case 5:return d=new Gu(e.InteractionType.Popup,s),this.logger.verbosePii("Sending auth response"),r.postMessage(d),r.close(),[3,7];case 6:return l=i.sent(),d=new Gu(e.InteractionType.Popup,null,l),this.logger.verbose("Found auth error in popup: "+l),r.postMessage(d),r.close(),[3,7];case 7:return[2]}}))}))},a.prototype.brokeredSsoSilentRequest=function(t,r){var a,s,c,u;return o(this,void 0,void 0,(function(){var o,l,d,h,p,g,f,m;return i(this,(function(i){switch(i.label){case 0:o=cl(this.performanceClient,Wu.BrokerClientApplicationBrokeredSSOSilentRequest,t.request.correlationId),this.logger.verbose("Brokered SSO Silent request initiated."),i.label=1;case 1:return i.trys.push([1,6,,7]),l=t.request,d=new rl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,l.correlationId),l.redirectUri=t.embeddedAppOrigin,l.embeddedAppClientId=t.embeddedClientId,l.brokerRedirectUri=d.getRedirectUri(),h=void 0,p=l.account||this.getActiveAccount(),this.canUseNative(l,null==p?void 0:p.nativeAccountId)?(this.logger.verbose("Native flow available for broker."),l.embeddedAppRedirectUri=this.getEmbeddedAppRedirectUri(t.embeddedAppOrigin),(g=t.request).extraQueryParameters=n(n({},g.extraQueryParameters),{child_client_id:l.embeddedAppClientId,child_redirect_uri:l.embeddedAppRedirectUri}),g.redirectUri=hr.getCurrentUri(),[4,this.acquireTokenByNative(g,e.ApiId.ssoSilent)]):[3,3];case 2:return h=i.sent(),[3,5];case 3:return[4,d.acquireToken(l)];case 4:h=i.sent(),i.label=5;case 5:return m=new Gu(e.InteractionType.Silent,h),this.logger.verbosePii("Sending auth response"),r.postMessage(m),r.close(),o.endMeasurement({success:!0,fromCache:null===(a=m.result)||void 0===a?void 0:a.fromCache,accessTokenSize:null===(s=m.result)||void 0===s?void 0:s.accessToken.length,idTokenSize:null===(c=m.result)||void 0===c?void 0:c.idToken.length,requestId:null===(u=m.result)||void 0===u?void 0:u.requestId}),[3,7];case 6:return f=i.sent(),m=new Gu(e.InteractionType.Silent,null,f),this.logger.verbose("Found auth error in ssoSilent: "+f),r.postMessage(m),r.close(),o.endMeasurement({errorCode:f.errorCode,subErrorCode:f.subError,success:!1}),[3,7];case 7:return[2]}}))}))},a.prototype.brokeredSilentRequest=function(t,r,a){return o(this,void 0,void 0,(function(){var o,s,c,u,l,d,h,p;return i(this,(function(i){switch(i.label){case 0:o=cl(this.performanceClient,Wu.BrokerClientApplicationBrokeredSilentRequest,t.request.correlationId),this.logger.verbose("Brokered Silent request initiated."),i.label=1;case 1:return i.trys.push([1,6,,7]),(s=t.request).embeddedAppClientId=t.embeddedClientId,s.embeddedAppRedirectUri=t.embeddedAppOrigin,s.account||(s.account=a),c=void 0,this.canUseNative(s)?(this.logger.verbose("Native flow available for broker."),s.embeddedAppRedirectUri=this.getEmbeddedAppRedirectUri(t.embeddedAppOrigin),(u=t.request).extraQueryParameters=n(n({},u.extraQueryParameters),{child_client_id:s.embeddedAppClientId,child_redirect_uri:s.embeddedAppRedirectUri}),u.redirectUri=hr.getCurrentUri(),[4,this.acquireTokenByNative(u,e.ApiId.acquireTokenSilent_silentFlow)]):[3,3];case 2:return c=i.sent(),[3,5];case 3:return[4,this.acquireTokenByRefreshToken(s)];case 4:c=i.sent(),i.label=5;case 5:return(p=new Gu(e.InteractionType.Silent,c)).result&&p.result.tokensToCache?(this.logger.verbosePii("Sending auth response: "+JSON.stringify(p)),r.postMessage(p),r.close(),o.endMeasurement({success:!0,fromCache:p.result.fromCache,accessTokenSize:p.result.accessToken.length,idTokenSize:p.result.idToken.length,isNativeBroker:p.result.fromNativeBroker,requestId:p.result.requestId})):(l=Du.createNoTokensToCacheError(),d=new Gu(e.InteractionType.Silent,null,l),this.logger.verbose(""+l),r.postMessage(d),r.close(),o.endMeasurement({errorCode:l.errorCode,subErrorCode:l.subError,success:!1})),[3,7];case 6:return h=i.sent(),p=new Gu(e.InteractionType.Silent,null,h),this.logger.verbose("Found auth error in silent: "+h),r.postMessage(p),r.close(),o.endMeasurement({errorCode:h.errorCode,subErrorCode:h.subError,success:!1}),[3,7];case 7:return[2]}}))}))},a.prototype.acquireTokenByRefreshToken=function(t){return o(this,void 0,void 0,(function(){var r,o=this;return i(this,(function(i){return this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),hr.blockReloadInHiddenIframes(),[2,(r=new ol(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,t.correlationId)).acquireToken(t).catch((function(i){var a=i instanceof Oe,s=i instanceof Ye,c=i.errorCode===Ht;if(a&&c&&!s)return o.logger.verbose("Refresh token expired or invalid, attempting acquire token by iframe",t.correlationId),new rl(o.config,o.browserStorage,o.browserCrypto,o.logger,o.eventHandler,o.navigationClient,e.ApiId.acquireTokenSilent_authCode,o.performanceClient,o.nativeInternalStorage,o.nativeExtensionProvider).acquireToken(n(n({},t),{brokerRedirectUri:r.getRedirectUri()}));throw i}))]}))}))},a.prototype.acquireTokenByNative=function(t,r,n){return o(this,void 0,void 0,(function(){var o,a=this;return i(this,(function(i){if(this.logger.trace("Brokered acquireTokenNative called"),!this.nativeExtensionProvider)throw Bt.createNativeConnectionNotEstablishedError();return o=new al(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,this.performanceClient,this.nativeExtensionProvider,n||this.getNativeAccountId(t),this.nativeInternalStorage,t.correlationId),r===e.ApiId.acquireTokenRedirect?[2,o.acquireTokenRedirect(t)]:[2,o.acquireToken(t).catch((function(e){throw e instanceof Tr&&e.isFatal()&&(a.nativeExtensionProvider=void 0),e}))]}))}))},a.prototype.getEmbeddedAppRedirectUri=function(e){return(new Yu).buildRedirectUri(e,this.config.auth.clientId)},a}(ku);!function(e){e.Interaction="brokerInteractionTimeoutMs",e.Message="brokerMessageTimeoutMs",e.Iframe="brokerIframeTimeoutMs"}(ll||(ll={})),function(e){e.Interaction="brokerInteractionTimedOut",e.Message="brokerMessageTimedOut",e.Iframe="brokerIframeTimedOut"}(dl||(dl={}));var pl=function(){function t(e,t,r,n,o){this.brokerOpts=t,this.clientId=e,this.logger=r,this.browserStorage=n,this.brokerConnectionEstablished=!1,this.version=ur,this.brokerOrigin=A.EMPTY_STRING,this.performanceClient=o}return Object.defineProperty(t.prototype,"trustedBrokersProvided",{get:function(){return!!this.brokerOpts.trustedBrokerDomains&&this.brokerOpts.trustedBrokerDomains.length>=1},enumerable:!1,configurable:!0}),t.prototype.initiateHandshake=function(e){return o(this,void 0,void 0,(function(){var t,r;return i(this,(function(n){switch(n.label){case 0:if(!this.trustedBrokersProvided)throw Du.createNoTrustedBrokersProvidedError();n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.sendHandshakeRequest(e)];case 2:return t=n.sent(),this.brokerOrigin=t.brokerOrigin,this.brokerConnectionEstablished=!0,[3,4];case 3:return r=n.sent(),this.logger.error(r.message),this.brokerConnectionEstablished=!1,[3,4];case 4:return[2]}}))}))},t.prototype.preflightBrokerRequest=function(){return o(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:if(this.brokerConnectionEstablished)return[3,4];this.logger.verbose("Attempting handshake..."),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.initiateHandshake(this.performanceEvent)];case 2:return t.sent(),[3,4];case 3:throw e=t.sent(),this.logger.error("Handshake rejected"),Du.createBrokeringDisabledError(e.message);case 4:return[2]}}))}))},t.prototype.sendSsoSilentRequest=function(t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:this.performanceEvent=cl(this.performanceClient,Wu.EmbeddedClientApplicationSendSSOSilentRequest,t.correlationId),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.preflightBrokerRequest()];case 2:return i.sent(),[4,this.sendRequest(t,e.InteractionType.Silent,{type:ll.Iframe,error:dl.Iframe,value:Ar})];case 3:if(r=i.sent(),!(n=Gu.processBrokerResponseMessage(r,this.browserStorage)))throw this.performanceEvent.endMeasurement({success:!1}),this.logger.errorPii("Broker response is empty in brokered ssoSilent request: "+JSON.stringify(n)),Du.createBrokerResponseInvalidError();return this.performanceEvent.endMeasurement({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker,requestId:n.requestId}),[2,n];case 4:throw o=i.sent(),this.performanceEvent.endMeasurement({success:!1}),o;case 5:return[2]}}))}))},t.prototype.sendPopupRequest=function(t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:this.performanceEvent=cl(this.performanceClient,Wu.EmbeddedClientApplicationSendPopupRequest,t.correlationId),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.preflightBrokerRequest()];case 2:return i.sent(),[4,this.sendRequest(t,e.InteractionType.Popup,{type:ll.Interaction,error:dl.Interaction,value:this.brokerOpts.brokerInteractionTimeout})];case 3:if(r=i.sent(),!(n=Gu.processBrokerResponseMessage(r,this.browserStorage))){if(this.performanceEvent.endMeasurement({success:!1}),!zu.validate(r))throw this.logger.errorPii("Broker response is empty in brokered popup request: "+JSON.stringify(n)),Du.createBrokerResponseInvalidError();throw this.logger.verbose("popupRequest requires a redirect by the broker, this app will now redirect."),Du.createBrokerPopupRequestRedirectingError()}return this.performanceEvent.endMeasurement({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker,requestId:n.requestId}),[2,n];case 4:throw o=i.sent(),this.performanceEvent.endMeasurement({success:!1}),o;case 5:return[2]}}))}))},t.prototype.sendRedirectRequest=function(t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:this.performanceEvent=cl(this.performanceClient,Wu.EmbeddedClientApplicationSendRedirectRequest,t.correlationId),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.preflightBrokerRequest()];case 2:return i.sent(),[4,this.sendRequest(t,e.InteractionType.Redirect,{type:ll.Interaction,error:dl.Interaction,value:this.brokerOpts.brokerInteractionTimeout})];case 3:if(r=i.sent(),!(n=zu.validate(r)))throw this.logger.errorPii("Broker response is not a redirect: "+JSON.stringify(n)),Du.createBrokerResponseInvalidError();return this.logger.verbose("Broker redirecting: "+n),this.performanceEvent.endMeasurement({success:!0}),[3,5];case 4:throw o=i.sent(),this.performanceEvent.endMeasurement({success:!1}),o;case 5:return[2]}}))}))},t.prototype.sendHandleRedirectRequest=function(){return o(this,void 0,void 0,(function(){var e,t,r,n;return i(this,(function(o){switch(o.label){case 0:this.performanceEvent=cl(this.performanceClient,Wu.EmbeddedClientApplicationHandleRedirectRequest),o.label=1;case 1:return o.trys.push([1,4,,5]),[4,this.preflightBrokerRequest()];case 2:return o.sent(),e=new Qu(this.clientId,this.version),[4,this.messageBroker(e,{type:ll.Message,error:dl.Message,value:this.brokerOpts.brokerMessageTimeout})];case 3:return t=o.sent(),r=Gu.processBrokerResponseMessage(t,this.browserStorage),this.performanceEvent.endMeasurement({success:!0,fromCache:null==r?void 0:r.fromCache,accessTokenSize:null==r?void 0:r.accessToken.length,idTokenSize:null==r?void 0:r.idToken.length,isNativeBroker:null==r?void 0:r.fromNativeBroker}),[2,r];case 4:throw n=o.sent(),this.performanceEvent.endMeasurement({success:!1}),n;case 5:return[2]}}))}))},t.prototype.sendSilentRefreshRequest=function(t){return o(this,void 0,void 0,(function(){var r,n,o;return i(this,(function(i){switch(i.label){case 0:this.performanceEvent=cl(this.performanceClient,Wu.EmbeddedClientApplicationSendSilentRefreshRequest,t.correlationId),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,this.preflightBrokerRequest()];case 2:return i.sent(),[4,this.sendRequest(t,e.InteractionType.Silent,{type:ll.Message,error:dl.Message,value:this.brokerOpts.brokerMessageTimeout})];case 3:if(r=i.sent(),!(n=Gu.processBrokerResponseMessage(r,this.browserStorage)))throw this.logger.errorPii("Broker response is empty in brokered silent refresh request: "+JSON.stringify(n)),Du.createBrokerResponseInvalidError();return this.performanceEvent.endMeasurement({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker}),[2,n];case 4:throw o=i.sent(),this.performanceEvent.endMeasurement({success:!1}),o;case 5:return[2]}}))}))},t.prototype.sendRequest=function(e,t,r){return o(this,void 0,void 0,(function(){var n;return i(this,(function(o){return n=new Ku(this.clientId,t,e,A.EMPTY_STRING),[2,this.messageBroker(n,r)]}))}))},t.prototype.sendHandshakeRequest=function(e){return o(this,void 0,void 0,(function(){var t=this;return i(this,(function(r){return[2,new Promise((function(r,n){var o,i=setTimeout((function(){t.logger.warning("Broker handshake timed out"),window.removeEventListener("message",a),ul(e,{brokerHandshakeTimedOut:!0}),n(Du.createMessageBrokerHandshakeTimeoutError())}),t.brokerOpts.brokerHandshakeTimeout);ul(e,{brokerHandshakeTimeoutMs:t.brokerOpts.brokerHandshakeTimeout});var a=function(e){try{var o=Fu.validate(e,t.brokerOpts.trustedBrokerDomains);o?(clearTimeout(i),t.logger.verbose("Received handshake response: "+JSON.stringify(o)),window.removeEventListener("message",a),r(o)):(t.logger.warning("Message is not handshake response"),t.logger.verbosePii(""+JSON.stringify(e.data)))}catch(e){window.removeEventListener("message",a),n(e)}};window.addEventListener("message",a);var s=new _u(t.clientId,t.version);t.logger.verbose("Sending handshake request: "+s),null===(o=window.top)||void 0===o||o.postMessage(s,"*")}))]}))}))},t.prototype.messageBroker=function(e,t){return void 0===t&&(t={type:ll.Message,error:dl.Message,value:this.brokerOpts.brokerMessageTimeout}),o(this,void 0,void 0,(function(){var r=this;return i(this,(function(n){return[2,new Promise((function(n,o){var i,a=setTimeout((function(){var e={};e[t.error.toString()]=!0,ul(r.performanceEvent,e),o(Du.createMessageBrokerTimeoutError())}),t.value),s={};s[t.type.toString()]=t.value,ul(r.performanceEvent,s);var c=r.messageChannel||new MessageChannel;c.port1.onmessage=function(e){r.logger.verbose("in messageBroker<T> w/ origin: "+e),clearTimeout(a),c.port1.close(),n(e)},null===(i=window.top)||void 0===i||i.postMessage(e,r.brokerOrigin,[c.port2])}))]}))}))},t.prototype.setMessageChannel=function(e){this.messageChannel=e},t}(),gl=function(t){function a(e,r,n,o,i,a,s,c,u,l,d,h){var p=t.call(this,e,r,n,o,i,a,c,u,l)||this;return p.experimentalConfig=s,p.embeddedApp=d,p.broker=h,p}return r(a,t),a.prototype.acquireToken=function(){throw new Error("Method not implemented.")},a.prototype.acquireTokenPopup=function(t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:if(!this.embeddedApp)throw Du.createNoEmbeddedAppError();return[4,this.initializeAuthorizationRequest(t,e.InteractionType.Popup)];case 1:return r=n.sent(),[2,this.embeddedApp.sendPopupRequest(r)]}}))}))},a.prototype.ssoSilent=function(t){return o(this,void 0,void 0,(function(){var r,o;return i(this,(function(i){switch(i.label){case 0:if(!this.embeddedApp)throw Du.createNoEmbeddedAppError();return[4,this.initializeAuthorizationRequest(n(n({},t),{prompt:M.NONE}),e.InteractionType.Silent)];case 1:r=i.sent(),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,this.embeddedApp.sendSsoSilentRequest(r)];case 3:return[2,i.sent()];case 4:throw(o=i.sent())instanceof ae&&o.setCorrelationId(this.correlationId),this.browserStorage.cleanRequestByState(r.state),o;case 5:return[2]}}))}))},a.prototype.acquireTokenByBrokerRefresh=function(t){return o(this,void 0,void 0,(function(){var r;return i(this,(function(n){switch(n.label){case 0:if(!this.embeddedApp)throw Du.createNoEmbeddedAppError();return[4,this.embeddedApp.sendSilentRefreshRequest(t)];case 1:return r=n.sent(),this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,r),[2,r]}}))}))},a.prototype.logout=function(){throw new Error("Method not implemented.")},a}(gr),fl=function(t){function a(e,r,n){var o=t.call(this,e,n)||this;return o.experimentalConfig=ju(r),o}return r(a,t),a.prototype.initializeBrokering=function(e){return o(this,void 0,void 0,(function(){var t;return i(this,(function(r){switch(r.label){case 0:return this.isBrowserEnvironment?(t=cl(this.performanceClient,Wu.ExperimentalPublicClientApplicationInitializeBrokering),!this.experimentalConfig.brokerOptions.actAsBroker||hr.isInIframe()?[3,3]:(this.experimentalConfig.brokerOptions.allowBrokering&&this.logger.verbose("Running in top frame and both actAsBroker, allowBrokering flags set to true. actAsBroker takes precedence."),this.broker=new hl(this.config,this.experimentalConfig),this.logger.verbose("Acting as Broker"),this.logger.verbose("Initialize the extension for the new broker instance"),[4,this.broker.initialize()])):[2];case 1:return r.sent(),[4,this.broker.listenForBrokerMessage(e)];case 2:return r.sent(),t.endMeasurement({success:!0}),[3,5];case 3:return this.experimentalConfig.brokerOptions.allowBrokering?(this.embeddedApp=new pl(this.config.auth.clientId,this.experimentalConfig.brokerOptions,this.logger,this.browserStorage,this.performanceClient),this.logger.verbose("Acting as child"),[4,this.embeddedApp.initiateHandshake(t)]):[3,5];case 4:r.sent(),t.endMeasurement({success:this.embeddedApp.brokerConnectionEstablished}),r.label=5;case 5:return[2]}}))}))},a.prototype.handleRedirectPromise=function(e){var r;return o(this,void 0,void 0,(function(){var n,o;return i(this,(function(i){switch(i.label){case 0:return n=null===(r=this.broker)||void 0===r?void 0:r.getRequestContext(),this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished?[4,this.embeddedApp.sendHandleRedirectRequest()]:[3,2];case 1:return o=i.sent(),this.browserStorage.setInteractionInProgress(!1),[2,o];case 2:return this.broker&&n&&n!==this.config.auth.clientId?[2,this.broker.handleRedirectPromise(e)]:[2,t.prototype.handleRedirectPromise.call(this,e)];case 3:return[2]}}))}))},a.prototype.acquireTokenRedirect=function(e){var r;return o(this,void 0,void 0,(function(){return i(this,(function(n){if(null===(r=this.embeddedApp)||void 0===r?void 0:r.brokerConnectionEstablished)throw Bt.createRedirectInIframeError(hr.isInIframe());return[2,t.prototype.acquireTokenRedirect.call(this,e)]}))}))},a.prototype.acquireTokenPopup=function(t){var r,n=this,o=cl(this.performanceClient,xe.AcquireTokenPopup,t.correlationId);try{var i=!!(null===(r=this.embeddedApp)||void 0===r?void 0:r.brokerConnectionEstablished);if(this.preflightBrowserEnvironmentCheck(e.InteractionType.Popup,!i),this.logger.verbose("experimental acquireTokenPopup called",t.correlationId),i)return new gl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.experimentalConfig,this.performanceClient,this.nativeExtensionProvider,t.correlationId,this.embeddedApp,this.broker).acquireTokenPopup(t).then((function(e){return ul(o,{accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length}),o.endMeasurement({success:!0,requestId:e.requestId}),e})).catch((function(e){return o.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError}),Promise.reject(e)}));var a=this.getAllAccounts();a.length>0?this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t):this.eventHandler.emitEvent(e.EventType.LOGIN_START,e.InteractionType.Popup,t);var s=void 0;if(this.canUseNative(t))this.logger.verbose("Native popup flow activated"),s=this.acquireTokenNative(t,e.ApiId.acquireTokenPopup).then((function(e){return n.browserStorage.setInteractionInProgress(!1),o.endMeasurement({success:!0,isNativeBroker:!0,accessTokenSize:e.accessToken.length,idTokenSize:e.idToken.length,requestId:e.requestId}),e})).catch((function(e){if(e instanceof Tr&&e.isFatal())return n.logger.verbose("Native Auth Error"),n.nativeExtensionProvider=void 0,n.createPopupClient(t.correlationId).acquireToken(t);if(e instanceof Ye)return n.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),n.createPopupClient(t.correlationId).acquireToken(t);throw n.browserStorage.setInteractionInProgress(!1),e}));else s=new Sr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,t.correlationId).acquireToken(t);return s.then((function(t){return a.length<n.getAllAccounts().length?n.eventHandler.emitEvent(e.EventType.LOGIN_SUCCESS,e.InteractionType.Popup,t):n.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),ul(o,{accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),o.endMeasurement({success:!0,requestId:t.requestId}),t})).catch((function(t){return a.length>0?n.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t):n.eventHandler.emitEvent(e.EventType.LOGIN_FAILURE,e.InteractionType.Popup,null,t),o.endMeasurement({success:!1}),Promise.reject(t)}))}catch(e){return o.endMeasurement({success:!1}),Promise.reject(e)}},a.prototype.ssoSilent=function(t){return o(this,void 0,void 0,(function(){var r,n,o,a=this;return i(this,(function(i){this.preflightBrowserEnvironmentCheck(e.InteractionType.Silent),r=cl(this.performanceClient,xe.SsoSilent,t.correlationId),this.logger.verbose("ssoSilent called",t.correlationId),this.eventHandler.emitEvent(e.EventType.SSO_SILENT_START,e.InteractionType.Silent,t);try{return this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished?[2,new gl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.experimentalConfig,this.performanceClient,this.nativeExtensionProvider,t.correlationId,this.embeddedApp,this.broker).ssoSilent(t).then((function(e){return r.endMeasurement({success:!0,requestId:e.requestId}),e})).catch((function(e){throw r.endMeasurement({success:!1,errorCode:e.errorCode,subErrorCode:e.subError}),e}))]:(n=void 0,this.canUseNative(t)?(this.logger.verbose("Native sso silent flow activated"),n=this.acquireTokenNative(t,e.ApiId.ssoSilent).catch((function(e){if(e instanceof Tr&&e.isFatal())return a.logger.verbose("Native Auth Error"),a.nativeExtensionProvider=void 0,a.createSilentIframeClient(t.correlationId).acquireToken(t);throw e}))):(o=new Pr(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,e.ApiId.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,t.correlationId),n=o.acquireToken(t)),[2,n.then((function(t){return a.eventHandler.emitEvent(e.EventType.SSO_SILENT_SUCCESS,e.InteractionType.Silent,t),r.addStaticFields({accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),r.endMeasurement({success:!0,fromCache:t.fromCache,requestId:t.requestId}),t})).catch((function(e){throw e}))])}catch(t){throw this.eventHandler.emitEvent(e.EventType.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,t),r.endMeasurement({success:!1,errorCode:t.errorCode,subErrorCode:t.subError}),t}return[2]}))}))},a.prototype.acquireTokenSilentAsync=function(t,r){return o(this,void 0,void 0,(function(){var a,s,c,u,l,d=this;return i(this,(function(h){switch(h.label){case 0:return this.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),a=cl(this.performanceClient,xe.AcquireTokenSilentAsync,t.correlationId),this.canUseNative(t)?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),c=n(n({},t),{account:r}),s=this.acquireTokenNative(c,e.ApiId.acquireTokenSilent_silentFlow).catch((function(e){return o(d,void 0,void 0,(function(){return i(this,(function(r){if(e instanceof Tr&&e.isFatal())return this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,[2,this.createSilentIframeClient(t.correlationId).acquireToken(t)];throw e}))}))})),[3,3]):[3,1];case 1:return this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),[4,(u=new Ir(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient)).initializeSilentRequest(t,r)];case 2:l=h.sent(),s=u.acquireToken(l).catch((function(){return o(d,void 0,void 0,(function(){return i(this,(function(e){return this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished?[2,new gl(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.experimentalConfig,this.performanceClient,this.nativeExtensionProvider,t.correlationId,this.embeddedApp,this.broker).acquireTokenByBrokerRefresh(l)]:[2,this.acquireTokenByRefreshToken(l,t)]}))}))})),h.label=3;case 3:return[2,s.then((function(t){return d.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),a.endMeasurement({success:!0,fromCache:t.fromCache,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,isNativeBroker:t.fromNativeBroker,requestId:t.requestId}),t})).catch((function(t){throw d.eventHandler.emitEvent(e.EventType.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),a.endMeasurement({errorCode:t.errorCode,subErrorCode:t.subError,success:!1}),t}))]}}))}))},a.prototype.setActiveAccount=function(e){this.broker&&this.broker.setActiveAccount(e),t.prototype.setActiveAccount.call(this,e)},a}(ku);e.AccountEntity=Ie,e.AuthError=ae,e.AuthErrorMessage=ie,e.AuthenticationHeaderParser=Nt,e.BrowserAuthError=Bt,e.BrowserAuthErrorMessage=Lt,e.BrowserConfigurationAuthError=nr,e.BrowserConfigurationAuthErrorMessage=rr,e.BrowserUtils=hr,e.ClientAuthError=ue,e.ClientAuthErrorMessage=ce,e.ClientConfigurationError=ve,e.ClientConfigurationErrorMessage=me,e.DEFAULT_IFRAME_TIMEOUT_MS=Ar,e.EventMessageUtils=nn,e.ExperimentalPublicClientApplication=fl,e.InteractionRequiredAuthError=Ye,e.InteractionRequiredAuthErrorMessage=Ve,e.Logger=he,e.NavigationClient=br,e.PublicClientApplication=ku,e.ServerError=Oe,e.SignedHttpRequest=on,e.StringUtils=le,e.UrlString=Xe,e.stubbedPublicClientApplication=rn,e.version="2.37.0",Object.defineProperty(e,"__esModule",{value:!0})})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).msalv3={})}(this,(function(e){ /*! @azure/msal-common v14.15.0 2024-09-20 */ const t={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",CACHE_PREFIX:"msal",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_RESPONSE_TYPE:"code",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",FRAGMENT_RESPONSE_MODE:"fragment",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],TOKEN_RESPONSE_TYPE:"token",ID_TOKEN_RESPONSE_TYPE:"id_token",SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},r=400,n=499,o=500,i=599,a=[t.OPENID_SCOPE,t.PROFILE_SCOPE,t.OFFLINE_ACCESS_SCOPE],s=[...a,t.EMAIL_SCOPE],c="Content-Type",u="Retry-After",l="X-AnchorMailbox",d="WWW-Authenticate",h="Authentication-Info",p="x-ms-request-id",g="x-ms-httpver",f="idtoken",m="client.info",v="adal.idtoken",y="error",C="error.description",T="active-account",I="active-account-filters",w="common",E="organizations",k="consumers",S="access_token",b="xms_cc",A={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",CREATE:"create",NO_SESSION:"no_session"},_={PLAIN:"plain",S256:"S256"},R={QUERY:"query",FRAGMENT:"fragment"},P={...R,FORM_POST:"form_post"},M="authorization_code",N="refresh_token",O="MSSTS",q="ADFS",U="Generic",x={CACHE_KEY_SEPARATOR:"-",CLIENT_INFO_SEPARATOR:"."},L={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},B="appmetadata",H="1",D="authority-metadata",F=86400,K="config",z="cache",G="network",Q="hardcoded_values",j={SCHEMA_VERSION:5,MAX_CUR_HEADER_BYTES:80,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},W={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},V=60,Y=3600,$="throttling",J="retry-after, h429",X="invalid_grant",Z="client_mismatch",ee="username",te="password",re=200,ne=400,oe="1",ie="3",ae="4",se="2",ce="4",ue="5",le="0",de="1",he="2",pe="3",ge="4",fe={Jwt:"JWT",Jwk:"JWK",Pop:"pop"},me="unexpected_error",ve="post_request_failed";var ye=Object.freeze({__proto__:null,postRequestFailed:ve,unexpectedError:me}); /*! @azure/msal-common v14.15.0 2024-09-20 */const Ce={[me]:"Unexpected error in authentication.",[ve]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."},Te={unexpectedError:{code:me,desc:Ce[me]},postRequestFailed:{code:ve,desc:Ce[ve]}};class Ie extends Error{constructor(e,r,n){super(r?`${e}: ${r}`:e),Object.setPrototypeOf(this,Ie.prototype),this.errorCode=e||t.EMPTY_STRING,this.errorMessage=r||t.EMPTY_STRING,this.subError=n||t.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function we(e,t){return new Ie(e,t?`${Ce[e]} ${t}`:Ce[e])} /*! @azure/msal-common v14.15.0 2024-09-20 */const Ee="client_info_decoding_error",ke="client_info_empty_error",Se="token_parsing_error",be="null_or_empty_token",Ae="endpoints_resolution_error",_e="network_error",Re="openid_config_error",Pe="hash_not_deserialized",Me="invalid_state",Ne="state_mismatch",Oe="state_not_found",qe="nonce_mismatch",Ue="auth_time_not_found",xe="max_age_transpired",Le="multiple_matching_tokens",Be="multiple_matching_accounts",He="multiple_matching_appMetadata",De="request_cannot_be_made",Fe="cannot_remove_empty_scope",Ke="cannot_append_scopeset",ze="empty_input_scopeset",Ge="device_code_polling_cancelled",Qe="device_code_expired",je="device_code_unknown_error",We="no_account_in_silent_request",Ve="invalid_cache_record",Ye="invalid_cache_environment",$e="no_account_found",Je="no_crypto_object",Xe="unexpected_credential_type",Ze="invalid_assertion",et="invalid_client_credential",tt="token_refresh_required",rt="user_timeout_reached",nt="token_claims_cnf_required_for_signedjwt",ot="authorization_code_missing_from_server_response",it="binding_key_not_removed",at="end_session_endpoint_not_supported",st="key_id_missing",ct="no_network_connectivity",ut="user_canceled",lt="missing_tenant_id_error",dt="method_not_implemented",ht="nested_app_auth_bridge_disabled";var pt=Object.freeze({__proto__:null,authTimeNotFound:Ue,authorizationCodeMissingFromServerResponse:ot,bindingKeyNotRemoved:it,cannotAppendScopeSet:Ke,cannotRemoveEmptyScope:Fe,clientInfoDecodingError:Ee,clientInfoEmptyError:ke,deviceCodeExpired:Qe,deviceCodePollingCancelled:Ge,deviceCodeUnknownError:je,emptyInputScopeSet:ze,endSessionEndpointNotSupported:at,endpointResolutionError:Ae,hashNotDeserialized:Pe,invalidAssertion:Ze,invalidCacheEnvironment:Ye,invalidCacheRecord:Ve,invalidClientCredential:et,invalidState:Me,keyIdMissing:st,maxAgeTranspired:xe,methodNotImplemented:dt,missingTenantIdError:lt,multipleMatchingAccounts:Be,multipleMatchingAppMetadata:He,multipleMatchingTokens:Le,nestedAppAuthBridgeDisabled:ht,networkError:_e,noAccountFound:$e,noAccountInSilentRequest:We,noCryptoObject:Je,noNetworkConnectivity:ct,nonceMismatch:qe,nullOrEmptyToken:be,openIdConfigError:Re,requestCannotBeMade:De,stateMismatch:Ne,stateNotFound:Oe,tokenClaimsCnfRequiredForSignedJwt:nt,tokenParsingError:Se,tokenRefreshRequired:tt,unexpectedCredentialType:Xe,userCanceled:ut,userTimeoutReached:rt}); /*! @azure/msal-common v14.15.0 2024-09-20 */const gt={[Ee]:"The client info could not be parsed/decoded correctly",[ke]:"The client info was empty",[Se]:"Token cannot be parsed",[be]:"The token is null or empty",[Ae]:"Endpoints cannot be resolved",[_e]:"Network request failed",[Re]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[Pe]:"The hash parameters could not be deserialized",[Me]:"State was not the expected format",[Ne]:"State mismatch error",[Oe]:"State not found",[qe]:"Nonce mismatch error",[Ue]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[xe]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Le]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Be]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[He]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[De]:"Token request cannot be made without authorization code or refresh token.",[Fe]:"Cannot remove null or empty scope from ScopeSet",[Ke]:"Cannot append ScopeSet",[ze]:"Empty input ScopeSet cannot be processed",[Ge]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Qe]:"Device code is expired.",[je]:"Device code stopped polling for unknown reasons.",[We]:"Please pass an account object, silent flow is not supported without account information",[Ve]:"Cache record object was null or undefined.",[Ye]:"Invalid environment when attempting to create cache entry",[$e]:"No account found in cache for given key.",[Je]:"No crypto object detected.",[Xe]:"Unexpected credential type.",[Ze]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[et]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[tt]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[rt]:"User defined timeout for device code polling reached",[nt]:"Cannot generate a POP jwt if the token_claims are not populated",[ot]:"Server response does not contain an authorization code to proceed",[it]:"Could not remove the credential's binding key from storage.",[at]:"The provided authority does not support logout",[st]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[ct]:"No network connectivity. Check your internet connection.",[ut]:"User cancelled the flow.",[lt]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[dt]:"This method has not been implemented",[ht]:"The nested app auth bridge is disabled"},ft={clientInfoDecodingError:{code:Ee,desc:gt[Ee]},clientInfoEmptyError:{code:ke,desc:gt[ke]},tokenParsingError:{code:Se,desc:gt[Se]},nullOrEmptyToken:{code:be,desc:gt[be]},endpointResolutionError:{code:Ae,desc:gt[Ae]},networkError:{code:_e,desc:gt[_e]},unableToGetOpenidConfigError:{code:Re,desc:gt[Re]},hashNotDeserialized:{code:Pe,desc:gt[Pe]},invalidStateError:{code:Me,desc:gt[Me]},stateMismatchError:{code:Ne,desc:gt[Ne]},stateNotFoundError:{code:Oe,desc:gt[Oe]},nonceMismatchError:{code:qe,desc:gt[qe]},authTimeNotFoundError:{code:Ue,desc:gt[Ue]},maxAgeTranspired:{code:xe,desc:gt[xe]},multipleMatchingTokens:{code:Le,desc:gt[Le]},multipleMatchingAccounts:{code:Be,desc:gt[Be]},multipleMatchingAppMetadata:{code:He,desc:gt[He]},tokenRequestCannotBeMade:{code:De,desc:gt[De]},removeEmptyScopeError:{code:Fe,desc:gt[Fe]},appendScopeSetError:{code:Ke,desc:gt[Ke]},emptyInputScopeSetError:{code:ze,desc:gt[ze]},DeviceCodePollingCancelled:{code:Ge,desc:gt[Ge]},DeviceCodeExpired:{code:Qe,desc:gt[Qe]},DeviceCodeUnknownError:{code:je,desc:gt[je]},NoAccountInSilentRequest:{code:We,desc:gt[We]},invalidCacheRecord:{code:Ve,desc:gt[Ve]},invalidCacheEnvironment:{code:Ye,desc:gt[Ye]},noAccountFound:{code:$e,desc:gt[$e]},noCryptoObj:{code:Je,desc:gt[Je]},unexpectedCredentialType:{code:Xe,desc:gt[Xe]},invalidAssertion:{code:Ze,desc:gt[Ze]},invalidClientCredential:{code:et,desc:gt[et]},tokenRefreshRequired:{code:tt,desc:gt[tt]},userTimeoutReached:{code:rt,desc:gt[rt]},tokenClaimsRequired:{code:nt,desc:gt[nt]},noAuthorizationCodeFromServer:{code:ot,desc:gt[ot]},bindingKeyNotRemovedError:{code:it,desc:gt[it]},logoutNotSupported:{code:at,desc:gt[at]},keyIdMissing:{code:st,desc:gt[st]},noNetworkConnectivity:{code:ct,desc:gt[ct]},userCanceledError:{code:ut,desc:gt[ut]},missingTenantIdError:{code:lt,desc:gt[lt]},nestedAppAuthBridgeDisabled:{code:ht,desc:gt[ht]}};class mt extends Ie{constructor(e,t){super(e,t?`${gt[e]}: ${t}`:gt[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,mt.prototype)}}function vt(e,t){return new mt(e,t)} /*! @azure/msal-common v14.15.0 2024-09-20 */const yt={createNewGuid:()=>{throw vt(dt)},base64Decode:()=>{throw vt(dt)},base64Encode:()=>{throw vt(dt)},base64UrlEncode:()=>{throw vt(dt)},encodeKid:()=>{throw vt(dt)},async getPublicKeyThumbprint(){throw vt(dt)},async removeTokenBindingKey(){throw vt(dt)},async clearKeystore(){throw vt(dt)},async signJwt(){throw vt(dt)},async hashString(){throw vt(dt)}}; /*! @azure/msal-common v14.15.0 2024-09-20 */var Ct;e.LogLevel=void 0,(Ct=e.LogLevel||(e.LogLevel={}))[Ct.Error=0]="Error",Ct[Ct.Warning=1]="Warning",Ct[Ct.Info=2]="Info",Ct[Ct.Verbose=3]="Verbose",Ct[Ct.Trace=4]="Trace";class Tt{constructor(r,n,o){this.level=e.LogLevel.Info;const i=r||Tt.createDefaultLoggerOptions();this.localCallback=i.loggerCallback||(()=>{}),this.piiLoggingEnabled=i.piiLoggingEnabled||!1,this.level="number"==typeof i.logLevel?i.logLevel:e.LogLevel.Info,this.correlationId=i.correlationId||t.EMPTY_STRING,this.packageName=n||t.EMPTY_STRING,this.packageVersion=o||t.EMPTY_STRING}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info}}clone(e,t,r){return new Tt({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level,correlationId:r||this.correlationId},e,t)}logMessage(t,r){if(r.logLevel>this.level||!this.piiLoggingEnabled&&r.containsPii)return;const n=`${`[${(new Date).toUTCString()}] : [${r.correlationId||this.correlationId||""}]`} : ${this.packageName}@${this.packageVersion} : ${e.LogLevel[r.logLevel]} - ${t}`;this.executeCallback(r.logLevel,n,r.containsPii||!1)}executeCallback(e,t,r){this.localCallback&&this.localCallback(e,t,r)}error(r,n){this.logMessage(r,{logLevel:e.LogLevel.Error,containsPii:!1,correlationId:n||t.EMPTY_STRING})}errorPii(r,n){this.logMessage(r,{logLevel:e.LogLevel.Error,containsPii:!0,correlationId:n||t.EMPTY_STRING})}warning(r,n){this.logMessage(r,{logLevel:e.LogLevel.Warning,containsPii:!1,correlationId:n||t.EMPTY_STRING})}warningPii(r,n){this.logMessage(r,{logLevel:e.LogLevel.Warning,containsPii:!0,correlationId:n||t.EMPTY_STRING})}info(r,n){this.logMessage(r,{logLevel:e.LogLevel.Info,containsPii:!1,correlationId:n||t.EMPTY_STRING})}infoPii(r,n){this.logMessage(r,{logLevel:e.LogLevel.Info,containsPii:!0,correlationId:n||t.EMPTY_STRING})}verbose(r,n){this.logMessage(r,{logLevel:e.LogLevel.Verbose,containsPii:!1,correlationId:n||t.EMPTY_STRING})}verbosePii(r,n){this.logMessage(r,{logLevel:e.LogLevel.Verbose,containsPii:!0,correlationId:n||t.EMPTY_STRING})}trace(r,n){this.logMessage(r,{logLevel:e.LogLevel.Trace,containsPii:!1,correlationId:n||t.EMPTY_STRING})}tracePii(r,n){this.logMessage(r,{logLevel:e.LogLevel.Trace,containsPii:!0,correlationId:n||t.EMPTY_STRING})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}} /*! @azure/msal-common v14.15.0 2024-09-20 */const It="@azure/msal-common",wt="14.15.0",Et={None:"none",AzurePublic:"https://login.microsoftonline.com",AzurePpe:"https://login.windows-ppe.net",AzureChina:"https://login.chinacloudapi.cn",AzureGermany:"https://login.microsoftonline.de",AzureUsGovernment:"https://login.microsoftonline.us"}; /*! @azure/msal-common v14.15.0 2024-09-20 */ function kt(e,t){const r=function(e){if(!e)throw vt(be);const t=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(e);if(!t||t.length<4)throw vt(Se);return t[2]}(e);try{const e=t(r);return JSON.parse(e)}catch(e){throw vt(Se)}}function St(e,t){if(0===t||Date.now()-3e5>e+t)throw vt(xe)} /*! @azure/msal-common v14.15.0 2024-09-20 */function bt(){return Math.round((new Date).getTime()/1e3)}function At(e,t){const r=Number(e)||0;return bt()+t>r}function _t(e){return Number(e)>bt()} /*! @azure/msal-common v14.15.0 2024-09-20 */function Rt(e){return[Lt(e),Bt(e),Ht(e),Dt(e),Ft(e)].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}function Pt(e,t,r,n,o){return{credentialType:L.ID_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r,realm:o}}function Mt(e,t,r,n,o,i,a,s,c,u,l,d,h,p,g){const f={homeAccountId:e,credentialType:L.ACCESS_TOKEN,secret:r,cachedAt:bt().toString(),expiresOn:a.toString(),extendedExpiresOn:s.toString(),environment:t,clientId:n,realm:o,target:i,tokenType:l||W.BEARER};if(d&&(f.userAssertionHash=d),u&&(f.refreshOn=u.toString()),p&&(f.requestedClaims=p,f.requestedClaimsHash=g),f.tokenType?.toLowerCase()!==W.BEARER.toLowerCase())switch(f.credentialType=L.ACCESS_TOKEN_WITH_AUTH_SCHEME,f.tokenType){case W.POP:const e=kt(r,c);if(!e?.cnf?.kid)throw vt(nt);f.keyId=e.cnf.kid;break;case W.SSH:f.keyId=h}return f}function Nt(e,t,r,n,o,i,a){const s={credentialType:L.REFRESH_TOKEN,homeAccountId:e,environment:t,clientId:n,secret:r};return i&&(s.userAssertionHash=i),o&&(s.familyId=o),a&&(s.expiresOn=a.toString()),s}function Ot(e){return e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("credentialType")&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("secret")}function qt(e){return!!e&&(Ot(e)&&e.hasOwnProperty("realm")&&e.hasOwnProperty("target")&&(e.credentialType===L.ACCESS_TOKEN||e.credentialType===L.ACCESS_TOKEN_WITH_AUTH_SCHEME))}function Ut(e){return!!e&&(Ot(e)&&e.hasOwnProperty("realm")&&e.credentialType===L.ID_TOKEN)}function xt(e){return!!e&&(Ot(e)&&e.credentialType===L.REFRESH_TOKEN)}function Lt(e){return[e.homeAccountId,e.environment].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}function Bt(e){const t=e.credentialType===L.REFRESH_TOKEN&&e.familyId||e.clientId;return[e.credentialType,t,e.realm||""].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}function Ht(e){return(e.target||"").toLowerCase()}function Dt(e){return(e.requestedClaimsHash||"").toLowerCase()}function Ft(e){return e.tokenType&&e.tokenType.toLowerCase()!==W.BEARER.toLowerCase()?e.tokenType.toLowerCase():""}function Kt(){return bt()+F}function zt(e,t,r){e.authorization_endpoint=t.authorization_endpoint,e.token_endpoint=t.token_endpoint,e.end_session_endpoint=t.end_session_endpoint,e.issuer=t.issuer,e.endpointsFromNetwork=r,e.jwks_uri=t.jwks_uri}function Gt(e,t,r){e.aliases=t.aliases,e.preferred_cache=t.preferred_cache,e.preferred_network=t.preferred_network,e.aliasesFromNetwork=r}function Qt(e){return e.expiresAt<=bt()} /*! @azure/msal-common v14.15.0 2024-09-20 */const jt="redirect_uri_empty",Wt="claims_request_parsing_error",Vt="authority_uri_insecure",Yt="url_parse_error",$t="empty_url_error",Jt="empty_input_scopes_error",Xt="invalid_prompt_value",Zt="invalid_claims",er="token_request_empty",tr="logout_request_empty",rr="invalid_code_challenge_method",nr="pkce_params_missing",or="invalid_cloud_discovery_metadata",ir="invalid_authority_metadata",ar="untrusted_authority",sr="missing_ssh_jwk",cr="missing_ssh_kid",ur="missing_nonce_authentication_header",lr="invalid_authentication_header",dr="cannot_set_OIDCOptions",hr="cannot_allow_native_broker",pr="authority_mismatch";var gr=Object.freeze({__proto__:null,authorityMismatch:pr,authorityUriInsecure:Vt,cannotAllowNativeBroker:hr,cannotSetOIDCOptions:dr,claimsRequestParsingError:Wt,emptyInputScopesError:Jt,invalidAuthenticationHeader:lr,invalidAuthorityMetadata:ir,invalidClaims:Zt,invalidCloudDiscoveryMetadata:or,invalidCodeChallengeMethod:rr,invalidPromptValue:Xt,logoutRequestEmpty:tr,missingNonceAuthenticationHeader:ur,missingSshJwk:sr,missingSshKid:cr,pkceParamsMissing:nr,redirectUriEmpty:jt,tokenRequestEmpty:er,untrustedAuthority:ar,urlEmptyError:$t,urlParseError:Yt}); /*! @azure/msal-common v14.15.0 2024-09-20 */const fr={[jt]:"A redirect URI is required for all calls, and none has been set.",[Wt]:"Could not parse the given claims request object.",[Vt]:"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options",[Yt]:"URL could not be parsed into appropriate segments.",[$t]:"URL was empty or null.",[Jt]:"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.",[Xt]:"Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest",[Zt]:"Given claims parameter must be a stringified JSON object.",[er]:"Token request was empty and not found in cache.",[tr]:"The logout request was null or undefined.",[rr]:'code_challenge_method passed is invalid. Valid values are "plain" and "S256".',[nr]:"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request",[or]:"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields",[ir]:"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.",[ar]:"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.",[sr]:"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.",[cr]:"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.",[ur]:"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.",[lr]:"Invalid authentication header provided",[dr]:"Cannot set OIDCOptions parameter. Please change the protocol mode to OIDC or use a non-Microsoft authority.",[hr]:"Cannot set allowNativeBroker parameter to true when not in AAD protocol mode.",[pr]:"Authority mismatch error. Authority provided in login request or PublicClientApplication config does not match the environment of the provided account. Please use a matching account or make an interactive request to login to this authority."},mr={redirectUriNotSet:{code:jt,desc:fr[jt]},claimsRequestParsingError:{code:Wt,desc:fr[Wt]},authorityUriInsecure:{code:Vt,desc:fr[Vt]},urlParseError:{code:Yt,desc:fr[Yt]},urlEmptyError:{code:$t,desc:fr[$t]},emptyScopesError:{code:Jt,desc:fr[Jt]},invalidPrompt:{code:Xt,desc:fr[Xt]},invalidClaimsRequest:{code:Zt,desc:fr[Zt]},tokenRequestEmptyError:{code:er,desc:fr[er]},logoutRequestEmptyError:{code:tr,desc:fr[tr]},invalidCodeChallengeMethod:{code:rr,desc:fr[rr]},invalidCodeChallengeParams:{code:nr,desc:fr[nr]},invalidCloudDiscoveryMetadata:{code:or,desc:fr[or]},invalidAuthorityMetadata:{code:ir,desc:fr[ir]},untrustedAuthority:{code:ar,desc:fr[ar]},missingSshJwk:{code:sr,desc:fr[sr]},missingSshKid:{code:cr,desc:fr[cr]},missingNonceAuthenticationHeader:{code:ur,desc:fr[ur]},invalidAuthenticationHeader:{code:lr,desc:fr[lr]},cannotSetOIDCOptions:{code:dr,desc:fr[dr]},cannotAllowNativeBroker:{code:hr,desc:fr[hr]},authorityMismatch:{code:pr,desc:fr[pr]}};class vr extends Ie{constructor(e){super(e,fr[e]),this.name="ClientConfigurationError",Object.setPrototypeOf(this,vr.prototype)}}function yr(e){return new vr(e)} /*! @azure/msal-common v14.15.0 2024-09-20 */class Cr{static isEmptyObj(e){if(e)try{const t=JSON.parse(e);return 0===Object.keys(t).length}catch(e){}return!0}static startsWith(e,t){return 0===e.indexOf(t)}static endsWith(e,t){return e.length>=t.length&&e.lastIndexOf(t)===e.length-t.length}static queryStringToObject(e){const t={},r=e.split("&"),n=e=>decodeURIComponent(e.replace(/\+/g," "));return r.forEach((e=>{if(e.trim()){const[r,o]=e.split(/=(.+)/g,2);r&&o&&(t[n(r)]=n(o))}})),t}static trimArrayEntries(e){return e.map((e=>e.trim()))}static removeEmptyStringsFromArray(e){return e.filter((e=>!!e))}static jsonParseHelper(e){try{return JSON.parse(e)}catch(e){return null}}static matchPattern(e,t){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(t)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class Tr{constructor(e){const t=e?Cr.trimArrayEntries([...e]):[],r=t?Cr.removeEmptyStringsFromArray(t):[];this.validateInputScopes(r),this.scopes=new Set,r.forEach((e=>this.scopes.add(e)))}static fromString(e){const r=(e||t.EMPTY_STRING).split(" ");return new Tr(r)}static createSearchScopes(e){const r=new Tr(e);return r.containsOnlyOIDCScopes()?r.removeScope(t.OFFLINE_ACCESS_SCOPE):r.removeOIDCScopes(),r}validateInputScopes(e){if(!e||e.length<1)throw yr(Jt)}containsScope(e){const t=this.printScopesLowerCase().split(" "),r=new Tr(t);return!!e&&r.scopes.has(e.toLowerCase())}containsScopeSet(e){return!(!e||e.scopes.size<=0)&&(this.scopes.size>=e.scopes.size&&e.asArray().every((e=>this.containsScope(e))))}containsOnlyOIDCScopes(){let e=0;return s.forEach((t=>{this.containsScope(t)&&(e+=1)})),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach((e=>this.appendScope(e)))}catch(e){throw vt(Ke)}}removeScope(e){if(!e)throw vt(Fe);this.scopes.delete(e.trim())}removeOIDCScopes(){s.forEach((e=>{this.scopes.delete(e)}))}unionScopeSets(e){if(!e)throw vt(ze);const t=new Set;return e.scopes.forEach((e=>t.add(e.toLowerCase()))),this.scopes.forEach((e=>t.add(e.toLowerCase()))),t}intersectingScopeSets(e){if(!e)throw vt(ze);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const t=this.unionScopeSets(e),r=e.getScopeCount(),n=this.getScopeCount();return t.size<n+r}getScopeCount(){return this.scopes.size}asArray(){const e=[];return this.scopes.forEach((t=>e.push(t))),e}printScopes(){if(this.scopes){return this.asArray().join(" ")}return t.EMPTY_STRING}printScopesLowerCase(){return this.printScopes().toLowerCase()}} /*! @azure/msal-common v14.15.0 2024-09-20 */function Ir(e,t){if(!e)throw vt(ke);try{const r=t(e);return JSON.parse(r)}catch(e){throw vt(Ee)}}function wr(e){if(!e)throw vt(Ee);const r=e.split(x.CLIENT_INFO_SEPARATOR,2);return{uid:r[0],utid:r.length<2?t.EMPTY_STRING:r[1]}} /*! @azure/msal-common v14.15.0 2024-09-20 */function Er(e,t){return!!e&&!!t&&e===t.split(".")[1]}function kr(e,t,r,n){if(n){const{oid:t,sub:r,tid:o,name:i,tfp:a,acr:s}=n,c=o||a||s||"";return{tenantId:c,localAccountId:t||r||"",name:i,isHomeTenant:Er(c,e)}}return{tenantId:r,localAccountId:t,isHomeTenant:Er(r,e)}}function Sr(e,t,r,n){let o=e;if(t){const{isHomeTenant:r,...n}=t;o={...e,...n}}if(r){const{isHomeTenant:t,...i}=kr(e.homeAccountId,e.localAccountId,e.tenantId,r);return o={...o,...i,idTokenClaims:r,idToken:n},o}return o} /*! @azure/msal-common v14.15.0 2024-09-20 */const br=0,Ar=1,_r=2,Rr=3; /*! @azure/msal-common v14.15.0 2024-09-20 */function Pr(e){if(e){return e.tid||e.tfp||e.acr||null}return null} /*! @azure/msal-common v14.15.0 2024-09-20 */const Mr={AAD:"AAD",OIDC:"OIDC"}; /*! @azure/msal-common v14.15.0 2024-09-20 */class Nr{generateAccountId(){return[this.homeAccountId,this.environment].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}generateAccountKey(){return Nr.generateAccountCacheKey({homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId})}getAccountInfo(){return{homeAccountId:this.homeAccountId,environment:this.environment,tenantId:this.realm,username:this.username,localAccountId:this.localAccountId,name:this.name,nativeAccountId:this.nativeAccountId,authorityType:this.authorityType,tenantProfiles:new Map((this.tenantProfiles||[]).map((e=>[e.tenantId,e])))}}isSingleTenant(){return!this.tenantProfiles}static generateAccountCacheKey(e){const t=e.homeAccountId.split(".")[1];return[e.homeAccountId,e.environment||"",t||e.tenantId||""].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}static createAccount(e,t,r){const n=new Nr;let o;t.authorityType===Ar?n.authorityType=q:t.protocolMode===Mr.AAD?n.authorityType=O:n.authorityType=U,e.clientInfo&&r&&(o=Ir(e.clientInfo,r)),n.clientInfo=e.clientInfo,n.homeAccountId=e.homeAccountId,n.nativeAccountId=e.nativeAccountId;const i=e.environment||t&&t.getPreferredCache();if(!i)throw vt(Ye);n.environment=i,n.realm=o?.utid||Pr(e.idTokenClaims)||"",n.localAccountId=o?.uid||e.idTokenClaims?.oid||e.idTokenClaims?.sub||"";const a=e.idTokenClaims?.preferred_username||e.idTokenClaims?.upn,s=e.idTokenClaims?.emails?e.idTokenClaims.emails[0]:null;if(n.username=a||s||"",n.name=e.idTokenClaims?.name||"",n.cloudGraphHostName=e.cloudGraphHostName,n.msGraphHost=e.msGraphHost,e.tenantProfiles)n.tenantProfiles=e.tenantProfiles;else{const t=kr(e.homeAccountId,n.localAccountId,n.realm,e.idTokenClaims);n.tenantProfiles=[t]}return n}static createFromAccountInfo(e,t,r){const n=new Nr;return n.authorityType=e.authorityType||U,n.homeAccountId=e.homeAccountId,n.localAccountId=e.localAccountId,n.nativeAccountId=e.nativeAccountId,n.realm=e.tenantId,n.environment=e.environment,n.username=e.username,n.name=e.name,n.cloudGraphHostName=t,n.msGraphHost=r,n.tenantProfiles=Array.from(e.tenantProfiles?.values()||[]),n}static generateHomeAccountId(e,t,r,n,o){if(t!==Ar&&t!==_r){if(e)try{const t=Ir(e,n.base64Decode);if(t.uid&&t.utid)return`${t.uid}.${t.utid}`}catch(e){}r.warning("No client info in response")}return o?.sub||""}static isAccountEntity(e){return!!e&&(e.hasOwnProperty("homeAccountId")&&e.hasOwnProperty("environment")&&e.hasOwnProperty("realm")&&e.hasOwnProperty("localAccountId")&&e.hasOwnProperty("username")&&e.hasOwnProperty("authorityType"))}static accountInfoIsEqual(e,t,r){if(!e||!t)return!1;let n=!0;if(r){const r=e.idTokenClaims||{},o=t.idTokenClaims||{};n=r.iat===o.iat&&r.nonce===o.nonce}return e.homeAccountId===t.homeAccountId&&e.localAccountId===t.localAccountId&&e.username===t.username&&e.tenantId===t.tenantId&&e.environment===t.environment&&e.nativeAccountId===t.nativeAccountId&&n}} /*! @azure/msal-common v14.15.0 2024-09-20 */function Or(e){return e.startsWith("#/")?e.substring(2):e.startsWith("#")||e.startsWith("?")?e.substring(1):e}function qr(e){if(!e||e.indexOf("=")<0)return null;try{const t=Or(e),r=Object.fromEntries(new URLSearchParams(t));if(r.code||r.error||r.error_description||r.state)return r}catch(e){throw vt(Pe)}return null} /*! @azure/msal-common v14.15.0 2024-09-20 */class Ur{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw yr($t);e.includes("#")||(this._urlString=Ur.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let t=e.toLowerCase();return Cr.endsWith(t,"?")?t=t.slice(0,-1):Cr.endsWith(t,"?/")&&(t=t.slice(0,-2)),Cr.endsWith(t,"/")||(t+="/"),t}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch(e){throw yr(Yt)}if(!e.HostNameAndPort||!e.PathSegments)throw yr(Yt);if(!e.Protocol||"https:"!==e.Protocol.toLowerCase())throw yr(Vt)}static appendQueryString(e,t){return t?e.indexOf("?")<0?`${e}?${t}`:`${e}&${t}`:e}static removeHashFromUrl(e){return Ur.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const t=this.getUrlComponents(),r=t.PathSegments;return!e||0===r.length||r[0]!==w&&r[0]!==E||(r[0]=e),Ur.constructAuthorityUriFromObject(t)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),t=this.urlString.match(e);if(!t)throw yr(Yt);const r={Protocol:t[1],HostNameAndPort:t[4],AbsolutePath:t[5],QueryString:t[7]};let n=r.AbsolutePath.split("/");return n=n.filter((e=>e&&e.length>0)),r.PathSegments=n,r.QueryString&&r.QueryString.endsWith("/")&&(r.QueryString=r.QueryString.substring(0,r.QueryString.length-1)),r}static getDomainFromUrl(e){const t=RegExp("^([^:/?#]+://)?([^/?#]*)"),r=e.match(t);if(!r)throw yr(Yt);return r[2]}static getAbsoluteUrl(e,r){if(e[0]===t.FORWARD_SLASH){const t=new Ur(r).getUrlComponents();return t.Protocol+"//"+t.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new Ur(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}static hashContainsKnownProperties(e){return!!qr(e)}} /*! @azure/msal-common v14.15.0 2024-09-20 */const xr={"login.microsoftonline.com":{token_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.com/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout"},"login.chinacloudapi.cn":{token_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys",issuer:"https://login.partner.microsoftonline.cn/{tenantid}/v2.0",authorization_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout"},"login.microsoftonline.us":{token_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token",jwks_uri:"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys",issuer:"https://login.microsoftonline.us/{tenantid}/v2.0",authorization_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize",end_session_endpoint:"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout"}},Lr={tenant_discovery_endpoint:"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration",metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]}]},Br=new Set;function Hr(e,t,r,n){if(n?.trace(`getAliasesFromMetadata called with source: ${r}`),e&&t){const o=Dr(t,e);if(o)return n?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${r}, returning aliases`),o.aliases;n?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${r}`)}return null}function Dr(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(n.aliases.includes(t))return n}return null} /*! @azure/msal-common v14.15.0 2024-09-20 */Lr.metadata.forEach((e=>{e.aliases.forEach((e=>{Br.add(e)}))}));const Fr="cache_quota_exceeded",Kr="cache_error_unknown",zr={[Fr]:"Exceeded cache storage capacity.",[Kr]:"Unexpected error occurred when using cache storage."};class Gr extends Error{constructor(e,t){const r=t||(zr[e]?zr[e]:zr[Kr]);super(`${e}: ${r}`),Object.setPrototypeOf(this,Gr.prototype),this.name="CacheError",this.errorCode=e,this.errorMessage=r}} /*! @azure/msal-common v14.15.0 2024-09-20 */class Qr{constructor(e,t,r,n){this.clientId=e,this.cryptoImpl=t,this.commonLogger=r.clone(It,wt),this.staticAuthorityOptions=n}getAllAccounts(e){return this.buildTenantProfiles(this.getAccountsFilteredBy(e||{}),e)}getAccountInfoFilteredBy(e){const t=this.getAllAccounts(e);if(t.length>1){return t.sort((e=>e.idTokenClaims?-1:1))[0]}return 1===t.length?t[0]:null}getBaseAccountInfo(e){const t=this.getAccountsFilteredBy(e);return t.length>0?t[0].getAccountInfo():null}buildTenantProfiles(e,t){return e.flatMap((e=>this.getTenantProfilesFromAccountEntity(e,t?.tenantId,t)))}getTenantedAccountInfoByFilter(e,t,r,n){let o,i=null;if(n&&!this.tenantProfileMatchesFilter(r,n))return null;const a=this.getIdToken(e,t,r.tenantId);return a&&(o=kt(a.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(o,n))?null:(i=Sr(e,r,o,a?.secret),i)}getTenantProfilesFromAccountEntity(e,t,r){const n=e.getAccountInfo();let o=n.tenantProfiles||new Map;const i=this.getTokenKeys();if(t){const e=o.get(t);if(!e)return[];o=new Map([[t,e]])}const a=[];return o.forEach((e=>{const t=this.getTenantedAccountInfoByFilter(n,i,e,r);t&&a.push(t)})),a}tenantProfileMatchesFilter(e,t){return!(t.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,t.localAccountId))&&((!t.name||e.name===t.name)&&(void 0===t.isHomeTenant||e.isHomeTenant===t.isHomeTenant))}idTokenClaimsMatchTenantProfileFilter(e,t){if(t){if(t.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,t.localAccountId))return!1;if(t.loginHint&&!this.matchLoginHintFromTokenClaims(e,t.loginHint))return!1;if(t.username&&!this.matchUsername(e.preferred_username,t.username))return!1;if(t.name&&!this.matchName(e,t.name))return!1;if(t.sid&&!this.matchSid(e,t.sid))return!1}return!0}async saveCacheRecord(e,t,r){if(!e)throw vt(Ve);try{e.account&&this.setAccount(e.account),e.idToken&&!1!==t?.idToken&&this.setIdTokenCredential(e.idToken),e.accessToken&&!1!==t?.accessToken&&await this.saveAccessToken(e.accessToken),e.refreshToken&&!1!==t?.refreshToken&&this.setRefreshTokenCredential(e.refreshToken),e.appMetadata&&this.setAppMetadata(e.appMetadata)}catch(e){throw this.commonLogger?.error("CacheManager.saveCacheRecord: failed"),e instanceof Error?(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e.message}`,r),"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name||e.message.includes("exceeded the quota")?(this.commonLogger?.error("CacheManager.saveCacheRecord: exceeded storage quota",r),new Gr(Fr)):new Gr(e.name,e.message)):(this.commonLogger?.errorPii(`CacheManager.saveCacheRecord: ${e}`,r),new Gr(Kr))}}async saveAccessToken(e){const t={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType,requestedClaimsHash:e.requestedClaimsHash},r=this.getTokenKeys(),n=Tr.fromString(e.target),o=[];r.accessToken.forEach((e=>{if(!this.accessTokenKeyMatchesFilter(e,t,!1))return;const r=this.getAccessTokenCredential(e);if(r&&this.credentialMatchesFilter(r,t)){Tr.fromString(r.target).intersectingScopeSets(n)&&o.push(this.removeAccessToken(e))}})),await Promise.all(o),this.setAccessTokenCredential(e)}getAccountsFilteredBy(e){const t=this.getAccountKeys(),r=[];return t.forEach((t=>{if(!this.isAccountKey(t,e.homeAccountId))return;const n=this.getAccount(t,this.commonLogger);if(!n)return;if(e.homeAccountId&&!this.matchHomeAccountId(n,e.homeAccountId))return;if(e.username&&!this.matchUsername(n.username,e.username))return;if(e.environment&&!this.matchEnvironment(n,e.environment))return;if(e.realm&&!this.matchRealm(n,e.realm))return;if(e.nativeAccountId&&!this.matchNativeAccountId(n,e.nativeAccountId))return;if(e.authorityType&&!this.matchAuthorityType(n,e.authorityType))return;const o={localAccountId:e?.localAccountId,name:e?.name},i=n.tenantProfiles?.filter((e=>this.tenantProfileMatchesFilter(e,o)));i&&0===i.length||r.push(n)})),r}isAccountKey(e,t,r){return!(e.split(x.CACHE_KEY_SEPARATOR).length<3)&&(!(t&&!e.toLowerCase().includes(t.toLowerCase()))&&!(r&&!e.toLowerCase().includes(r.toLowerCase())))}isCredentialKey(e){if(e.split(x.CACHE_KEY_SEPARATOR).length<6)return!1;const t=e.toLowerCase();if(-1===t.indexOf(L.ID_TOKEN.toLowerCase())&&-1===t.indexOf(L.ACCESS_TOKEN.toLowerCase())&&-1===t.indexOf(L.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())&&-1===t.indexOf(L.REFRESH_TOKEN.toLowerCase()))return!1;if(t.indexOf(L.REFRESH_TOKEN.toLowerCase())>-1){const e=`${L.REFRESH_TOKEN}${x.CACHE_KEY_SEPARATOR}${this.clientId}${x.CACHE_KEY_SEPARATOR}`,r=`${L.REFRESH_TOKEN}${x.CACHE_KEY_SEPARATOR}${H}${x.CACHE_KEY_SEPARATOR}`;if(-1===t.indexOf(e.toLowerCase())&&-1===t.indexOf(r.toLowerCase()))return!1}else if(-1===t.indexOf(this.clientId.toLowerCase()))return!1;return!0}credentialMatchesFilter(e,t){if(t.clientId&&!this.matchClientId(e,t.clientId))return!1;if(t.userAssertionHash&&!this.matchUserAssertionHash(e,t.userAssertionHash))return!1;if("string"==typeof t.homeAccountId&&!this.matchHomeAccountId(e,t.homeAccountId))return!1;if(t.environment&&!this.matchEnvironment(e,t.environment))return!1;if(t.realm&&!this.matchRealm(e,t.realm))return!1;if(t.credentialType&&!this.matchCredentialType(e,t.credentialType))return!1;if(t.familyId&&!this.matchFamilyId(e,t.familyId))return!1;if(t.target&&!this.matchTarget(e,t.target))return!1;if((t.requestedClaimsHash||e.requestedClaimsHash)&&e.requestedClaimsHash!==t.requestedClaimsHash)return!1;if(e.credentialType===L.ACCESS_TOKEN_WITH_AUTH_SCHEME){if(t.tokenType&&!this.matchTokenType(e,t.tokenType))return!1;if(t.tokenType===W.SSH&&t.keyId&&!this.matchKeyId(e,t.keyId))return!1}return!0}getAppMetadataFilteredBy(e){const t=this.getKeys(),r={};return t.forEach((t=>{if(!this.isAppMetadata(t))return;const n=this.getAppMetadata(t);n&&(e.environment&&!this.matchEnvironment(n,e.environment)||e.clientId&&!this.matchClientId(n,e.clientId)||(r[t]=n))})),r}getAuthorityMetadataByAlias(e){const t=this.getAuthorityMetadataKeys();let r=null;return t.forEach((t=>{if(!this.isAuthorityMetadata(t)||-1===t.indexOf(this.clientId))return;const n=this.getAuthorityMetadata(t);n&&-1!==n.aliases.indexOf(e)&&(r=n)})),r}async removeAllAccounts(){const e=this.getAccountKeys(),t=[];e.forEach((e=>{t.push(this.removeAccount(e))})),await Promise.all(t)}async removeAccount(e){const t=this.getAccount(e,this.commonLogger);t&&(await this.removeAccountContext(t),this.removeItem(e))}async removeAccountContext(e){const t=this.getTokenKeys(),r=e.generateAccountId(),n=[];t.idToken.forEach((e=>{0===e.indexOf(r)&&this.removeIdToken(e)})),t.accessToken.forEach((e=>{0===e.indexOf(r)&&n.push(this.removeAccessToken(e))})),t.refreshToken.forEach((e=>{0===e.indexOf(r)&&this.removeRefreshToken(e)})),await Promise.all(n)}updateOutdatedCachedAccount(e,t,r){if(t&&t.isSingleTenant()){this.commonLogger?.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");const n=this.getAccountKeys().filter((e=>e.startsWith(t.homeAccountId))),o=[];n.forEach((e=>{const t=this.getCachedAccountEntity(e);t&&o.push(t)}));const i=o.find((e=>Er(e.realm,e.homeAccountId)))||o[0];i.tenantProfiles=o.map((e=>({tenantId:e.realm,localAccountId:e.localAccountId,name:e.name,isHomeTenant:Er(e.realm,e.homeAccountId)})));const a=Qr.toObject(new Nr,{...i}),s=a.generateAccountKey();return n.forEach((t=>{t!==s&&this.removeOutdatedAccount(e)})),this.setAccount(a),r?.verbose("Updated an outdated account entity in the cache"),a}return t}async removeAccessToken(e){const t=this.getAccessTokenCredential(e);if(t){if(t.credentialType.toLowerCase()===L.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&t.tokenType===W.POP){const e=t.keyId;if(e)try{await this.cryptoImpl.removeTokenBindingKey(e)}catch(e){throw vt(it)}}return this.removeItem(e)}}removeAppMetadata(){return this.getKeys().forEach((e=>{this.isAppMetadata(e)&&this.removeItem(e)})),!0}readAccountFromCache(e){const t=Nr.generateAccountCacheKey(e);return this.getAccount(t,this.commonLogger)}getIdToken(e,t,r,n,o){this.commonLogger.trace("CacheManager - getIdToken called");const i={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:L.ID_TOKEN,clientId:this.clientId,realm:r},a=this.getIdTokensByFilter(i,t),s=a.size;if(s<1)return this.commonLogger.info("CacheManager:getIdToken - No token found"),null;if(s>1){let t=a;if(!r){const r=new Map;a.forEach(((t,n)=>{t.realm===e.tenantId&&r.set(n,t)}));const n=r.size;if(n<1)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account but none match account entity tenant id, returning first result"),a.values().next().value;if(1===n)return this.commonLogger.info("CacheManager:getIdToken - Multiple ID tokens found for account, defaulting to home tenant profile"),r.values().next().value;t=r}return this.commonLogger.info("CacheManager:getIdToken - Multiple matching ID tokens found, clearing them"),t.forEach(((e,t)=>{this.removeIdToken(t)})),n&&o&&n.addFields({multiMatchedID:a.size},o),null}return this.commonLogger.info("CacheManager:getIdToken - Returning ID token"),a.values().next().value}getIdTokensByFilter(e,t){const r=t&&t.idToken||this.getTokenKeys().idToken,n=new Map;return r.forEach((t=>{if(!this.idTokenKeyMatchesFilter(t,{clientId:this.clientId,...e}))return;const r=this.getIdTokenCredential(t);r&&this.credentialMatchesFilter(r,e)&&n.set(t,r)})),n}idTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.clientId||-1!==r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase()))}removeIdToken(e){this.removeItem(e)}removeRefreshToken(e){this.removeItem(e)}getAccessToken(e,t,r,n,o,i){this.commonLogger.trace("CacheManager - getAccessToken called");const a=Tr.createSearchScopes(t.scopes),s=t.authenticationScheme||W.BEARER,c=s&&s.toLowerCase()!==W.BEARER.toLowerCase()?L.ACCESS_TOKEN_WITH_AUTH_SCHEME:L.ACCESS_TOKEN,u={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:c,clientId:this.clientId,realm:n||e.tenantId,target:a,tokenType:s,keyId:t.sshKid,requestedClaimsHash:t.requestedClaimsHash},l=r&&r.accessToken||this.getTokenKeys().accessToken,d=[];l.forEach((e=>{if(this.accessTokenKeyMatchesFilter(e,u,!0)){const t=this.getAccessTokenCredential(e);t&&this.credentialMatchesFilter(t,u)&&d.push(t)}}));const h=d.length;return h<1?(this.commonLogger.info("CacheManager:getAccessToken - No token found"),null):h>1?(this.commonLogger.info("CacheManager:getAccessToken - Multiple access tokens found, clearing them"),d.forEach((e=>{this.removeAccessToken(Rt(e))})),o&&i&&o.addFields({multiMatchedAT:d.length},i),null):(this.commonLogger.info("CacheManager:getAccessToken - Returning access token"),d[0])}accessTokenKeyMatchesFilter(e,t,r){const n=e.toLowerCase();if(t.clientId&&-1===n.indexOf(t.clientId.toLowerCase()))return!1;if(t.homeAccountId&&-1===n.indexOf(t.homeAccountId.toLowerCase()))return!1;if(t.realm&&-1===n.indexOf(t.realm.toLowerCase()))return!1;if(t.requestedClaimsHash&&-1===n.indexOf(t.requestedClaimsHash.toLowerCase()))return!1;if(t.target){const e=t.target.asArray();for(let t=0;t<e.length;t++){if(r&&!n.includes(e[t].toLowerCase()))return!1;if(!r&&n.includes(e[t].toLowerCase()))return!0}}return!0}getAccessTokensByFilter(e){const t=this.getTokenKeys(),r=[];return t.accessToken.forEach((t=>{if(!this.accessTokenKeyMatchesFilter(t,e,!0))return;const n=this.getAccessTokenCredential(t);n&&this.credentialMatchesFilter(n,e)&&r.push(n)})),r}getRefreshToken(e,t,r,n,o){this.commonLogger.trace("CacheManager - getRefreshToken called");const i=t?H:void 0,a={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:L.REFRESH_TOKEN,clientId:this.clientId,familyId:i},s=r&&r.refreshToken||this.getTokenKeys().refreshToken,c=[];s.forEach((e=>{if(this.refreshTokenKeyMatchesFilter(e,a)){const t=this.getRefreshTokenCredential(e);t&&this.credentialMatchesFilter(t,a)&&c.push(t)}}));const u=c.length;return u<1?(this.commonLogger.info("CacheManager:getRefreshToken - No refresh token found."),null):(u>1&&n&&o&&n.addFields({multiMatchedRT:u},o),this.commonLogger.info("CacheManager:getRefreshToken - returning refresh token"),c[0])}refreshTokenKeyMatchesFilter(e,t){const r=e.toLowerCase();return(!t.familyId||-1!==r.indexOf(t.familyId.toLowerCase()))&&(!(!t.familyId&&t.clientId&&-1===r.indexOf(t.clientId.toLowerCase()))&&(!t.homeAccountId||-1!==r.indexOf(t.homeAccountId.toLowerCase())))}readAppMetadataFromCache(e){const t={environment:e,clientId:this.clientId},r=this.getAppMetadataFilteredBy(t),n=Object.keys(r).map((e=>r[e])),o=n.length;if(o<1)return null;if(o>1)throw vt(He);return n[0]}isAppMetadataFOCI(e){const t=this.readAppMetadataFromCache(e);return!(!t||t.familyId!==H)}matchHomeAccountId(e,t){return!("string"!=typeof e.homeAccountId||t!==e.homeAccountId)}matchLocalAccountIdFromTokenClaims(e,t){return t===(e.oid||e.sub)}matchLocalAccountIdFromTenantProfile(e,t){return e.localAccountId===t}matchName(e,t){return!(t.toLowerCase()!==e.name?.toLowerCase())}matchUsername(e,t){return!(!e||"string"!=typeof e||t?.toLowerCase()!==e.toLowerCase())}matchUserAssertionHash(e,t){return!(!e.userAssertionHash||t!==e.userAssertionHash)}matchEnvironment(e,t){if(this.staticAuthorityOptions){const r=function(e,t){let r;const n=e.canonicalAuthority;if(n){const o=new Ur(n).getUrlComponents().HostNameAndPort;r=Hr(o,e.cloudDiscoveryMetadata?.metadata,K,t)||Hr(o,Lr.metadata,Q,t)||e.knownAuthorities}return r||[]}(this.staticAuthorityOptions,this.commonLogger);if(r.includes(t)&&r.includes(e.environment))return!0}const r=this.getAuthorityMetadataByAlias(t);return!!(r&&r.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,t){return e.credentialType&&t.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,t){return!(!e.clientId||t!==e.clientId)}matchFamilyId(e,t){return!(!e.familyId||t!==e.familyId)}matchRealm(e,t){return!(e.realm?.toLowerCase()!==t.toLowerCase())}matchNativeAccountId(e,t){return!(!e.nativeAccountId||t!==e.nativeAccountId)}matchLoginHintFromTokenClaims(e,t){return e.login_hint===t||(e.preferred_username===t||e.upn===t)}matchSid(e,t){return e.sid===t}matchAuthorityType(e,t){return!(!e.authorityType||t.toLowerCase()!==e.authorityType.toLowerCase())}matchTarget(e,t){if(e.credentialType!==L.ACCESS_TOKEN&&e.credentialType!==L.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target)return!1;return Tr.fromString(e.target).containsScopeSet(t)}matchTokenType(e,t){return!(!e.tokenType||e.tokenType!==t)}matchKeyId(e,t){return!(!e.keyId||e.keyId!==t)}isAppMetadata(e){return-1!==e.indexOf(B)}isAuthorityMetadata(e){return-1!==e.indexOf(D)}generateAuthorityMetadataCacheKey(e){return`${D}-${this.clientId}-${e}`}static toObject(e,t){for(const r in t)e[r]=t[r];return e}}class jr extends Qr{setAccount(){throw vt(dt)}getAccount(){throw vt(dt)}getCachedAccountEntity(){throw vt(dt)}setIdTokenCredential(){throw vt(dt)}getIdTokenCredential(){throw vt(dt)}setAccessTokenCredential(){throw vt(dt)}getAccessTokenCredential(){throw vt(dt)}setRefreshTokenCredential(){throw vt(dt)}getRefreshTokenCredential(){throw vt(dt)}setAppMetadata(){throw vt(dt)}getAppMetadata(){throw vt(dt)}setServerTelemetry(){throw vt(dt)}getServerTelemetry(){throw vt(dt)}setAuthorityMetadata(){throw vt(dt)}getAuthorityMetadata(){throw vt(dt)}getAuthorityMetadataKeys(){throw vt(dt)}setThrottlingCache(){throw vt(dt)}getThrottlingCache(){throw vt(dt)}removeItem(){throw vt(dt)}getKeys(){throw vt(dt)}getAccountKeys(){throw vt(dt)}getTokenKeys(){throw vt(dt)}async clear(){throw vt(dt)}updateCredentialCacheKey(){throw vt(dt)}removeOutdatedAccount(){throw vt(dt)}} /*! @azure/msal-common v14.15.0 2024-09-20 */const Wr={tokenRenewalOffsetSeconds:300,preventCorsPreflight:!1},Vr={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:e.LogLevel.Info,correlationId:t.EMPTY_STRING},Yr={claimsBasedCachingEnabled:!1},$r={async sendGetRequestAsync(){throw vt(dt)},async sendPostRequestAsync(){throw vt(dt)}},Jr={sku:t.SKU,version:wt,cpu:t.EMPTY_STRING,os:t.EMPTY_STRING},Xr={clientSecret:t.EMPTY_STRING,clientAssertion:void 0},Zr={azureCloudInstance:Et.None,tenant:`${t.DEFAULT_COMMON_TENANT}`},en={application:{appName:"",appVersion:""}};function tn(e){return e.authOptions.authority.options.protocolMode===Mr.OIDC} /*! @azure/msal-common v14.15.0 2024-09-20 */class rn extends Ie{constructor(e,t,r,n,o){super(e,t,r),this.name="ServerError",this.errorNo=n,this.status=o,Object.setPrototypeOf(this,rn.prototype)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class nn{static generateThrottlingStorageKey(e){return`${$}.${JSON.stringify(e)}`}static preProcess(e,r){const n=nn.generateThrottlingStorageKey(r),o=e.getThrottlingCache(n);if(o){if(o.throttleTime<Date.now())return void e.removeItem(n);throw new rn(o.errorCodes?.join(" ")||t.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(nn.checkResponseStatus(r)||nn.checkResponseForRetryAfter(r)){const n={throttleTime:nn.calculateThrottleTime(parseInt(r.headers[u])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(nn.generateThrottlingStorageKey(t),n)}}static checkResponseStatus(e){return 429===e.status||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return!!e.headers&&(e.headers.hasOwnProperty(u)&&(e.status<200||e.status>=300))}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(1e3*Math.min(r+(t||V),r+Y))}static removeThrottle(e,t,r,n){const o={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:n,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},i=this.generateThrottlingStorageKey(o);e.removeItem(i)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class on{constructor(e,t){this.networkClient=e,this.cacheManager=t}async sendPostRequest(e,t,r){let n;nn.preProcess(this.cacheManager,e);try{n=await this.networkClient.sendPostRequestAsync(t,r)}catch(e){throw e instanceof Ie?e:vt(_e)}return nn.postProcess(this.cacheManager,e,n),n}} /*! @azure/msal-common v14.15.0 2024-09-20 */const an="home_account_id",sn="UPN",cn="client_id",un="response_type",ln="token_type",dn="req_cnf",hn="return_spa_code"; /*! @azure/msal-common v14.15.0 2024-09-20 */ /*! @azure/msal-common v14.15.0 2024-09-20 */ class pn{static validateRedirectUri(e){if(!e)throw yr(jt)}static validatePrompt(e){const t=[];for(const e in A)t.push(A[e]);if(t.indexOf(e)<0)throw yr(Xt)}static validateClaims(e){try{JSON.parse(e)}catch(e){throw yr(Zt)}}static validateCodeChallengeParams(e,t){if(!e||!t)throw yr(nr);this.validateCodeChallengeMethod(t)}static validateCodeChallengeMethod(e){if([_.PLAIN,_.S256].indexOf(e)<0)throw yr(rr)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class gn{constructor(){this.parameters=new Map}addResponseTypeCode(){this.parameters.set(un,encodeURIComponent(t.CODE_RESPONSE_TYPE))}addResponseTypeForTokenAndIdToken(){this.parameters.set(un,encodeURIComponent(`${t.TOKEN_RESPONSE_TYPE} ${t.ID_TOKEN_RESPONSE_TYPE}`))}addResponseMode(e){this.parameters.set("response_mode",encodeURIComponent(e||P.QUERY))}addNativeBroker(){this.parameters.set("nativebroker",encodeURIComponent("1"))}addScopes(e,t=!0,r=a){!t||r.includes("openid")||e.includes("openid")||r.push("openid");const n=t?[...e||[],...r]:e||[],o=new Tr(n);this.parameters.set("scope",encodeURIComponent(o.printScopes()))}addClientId(e){this.parameters.set(cn,encodeURIComponent(e))}addRedirectUri(e){pn.validateRedirectUri(e),this.parameters.set("redirect_uri",encodeURIComponent(e))}addPostLogoutRedirectUri(e){pn.validateRedirectUri(e),this.parameters.set("post_logout_redirect_uri",encodeURIComponent(e))}addIdTokenHint(e){this.parameters.set("id_token_hint",encodeURIComponent(e))}addDomainHint(e){this.parameters.set("domain_hint",encodeURIComponent(e))}addLoginHint(e){this.parameters.set("login_hint",encodeURIComponent(e))}addCcsUpn(e){this.parameters.set(l,encodeURIComponent(`UPN:${e}`))}addCcsOid(e){this.parameters.set(l,encodeURIComponent(`Oid:${e.uid}@${e.utid}`))}addSid(e){this.parameters.set("sid",encodeURIComponent(e))}addClaims(e,t){const r=this.addClientCapabilitiesToClaims(e,t);pn.validateClaims(r),this.parameters.set("claims",encodeURIComponent(r))}addCorrelationId(e){this.parameters.set("client-request-id",encodeURIComponent(e))}addLibraryInfo(e){this.parameters.set("x-client-SKU",e.sku),this.parameters.set("x-client-VER",e.version),e.os&&this.parameters.set("x-client-OS",e.os),e.cpu&&this.parameters.set("x-client-CPU",e.cpu)}addApplicationTelemetry(e){e?.appName&&this.parameters.set("x-app-name",e.appName),e?.appVersion&&this.parameters.set("x-app-ver",e.appVersion)}addPrompt(e){pn.validatePrompt(e),this.parameters.set("prompt",encodeURIComponent(e))}addState(e){e&&this.parameters.set("state",encodeURIComponent(e))}addNonce(e){this.parameters.set("nonce",encodeURIComponent(e))}addCodeChallengeParams(e,t){if(pn.validateCodeChallengeParams(e,t),!e||!t)throw yr(nr);this.parameters.set("code_challenge",encodeURIComponent(e)),this.parameters.set("code_challenge_method",encodeURIComponent(t))}addAuthorizationCode(e){this.parameters.set("code",encodeURIComponent(e))}addDeviceCode(e){this.parameters.set("device_code",encodeURIComponent(e))}addRefreshToken(e){this.parameters.set("refresh_token",encodeURIComponent(e))}addCodeVerifier(e){this.parameters.set("code_verifier",encodeURIComponent(e))}addClientSecret(e){this.parameters.set("client_secret",encodeURIComponent(e))}addClientAssertion(e){e&&this.parameters.set("client_assertion",encodeURIComponent(e))}addClientAssertionType(e){e&&this.parameters.set("client_assertion_type",encodeURIComponent(e))}addOboAssertion(e){this.parameters.set("assertion",encodeURIComponent(e))}addRequestTokenUse(e){this.parameters.set("requested_token_use",encodeURIComponent(e))}addGrantType(e){this.parameters.set("grant_type",encodeURIComponent(e))}addClientInfo(){this.parameters.set("client_info","1")}addExtraQueryParameters(e){Object.entries(e).forEach((([e,t])=>{!this.parameters.has(e)&&t&&this.parameters.set(e,t)}))}addClientCapabilitiesToClaims(e,t){let r;if(e)try{r=JSON.parse(e)}catch(e){throw yr(Zt)}else r={};return t&&t.length>0&&(r.hasOwnProperty(S)||(r[S]={}),r[S][b]={values:t}),JSON.stringify(r)}addUsername(e){this.parameters.set(ee,encodeURIComponent(e))}addPassword(e){this.parameters.set(te,encodeURIComponent(e))}addPopToken(e){e&&(this.parameters.set(ln,W.POP),this.parameters.set(dn,encodeURIComponent(e)))}addSshJwk(e){e&&(this.parameters.set(ln,W.SSH),this.parameters.set(dn,encodeURIComponent(e)))}addServerTelemetry(e){this.parameters.set("x-client-current-telemetry",e.generateCurrentRequestHeaderValue()),this.parameters.set("x-client-last-telemetry",e.generateLastRequestHeaderValue())}addThrottling(){this.parameters.set("x-ms-lib-capability",J)}addLogoutHint(e){this.parameters.set("logout_hint",encodeURIComponent(e))}createQueryString(){const e=new Array;return this.parameters.forEach(((t,r)=>{e.push(`${r}=${t}`)})),e.join("&")}} /*! @azure/msal-common v14.15.0 2024-09-20 */ /*! @azure/msal-common v14.15.0 2024-09-20 */ const fn={AcquireTokenByCode:"acquireTokenByCode",AcquireTokenByRefreshToken:"acquireTokenByRefreshToken",AcquireTokenSilent:"acquireTokenSilent",AcquireTokenSilentAsync:"acquireTokenSilentAsync",AcquireTokenPopup:"acquireTokenPopup",AcquireTokenPreRedirect:"acquireTokenPreRedirect",AcquireTokenRedirect:"acquireTokenRedirect",CryptoOptsGetPublicKeyThumbprint:"cryptoOptsGetPublicKeyThumbprint",CryptoOptsSignJwt:"cryptoOptsSignJwt",SilentCacheClientAcquireToken:"silentCacheClientAcquireToken",SilentIframeClientAcquireToken:"silentIframeClientAcquireToken",AwaitConcurrentIframe:"awaitConcurrentIframe",SilentRefreshClientAcquireToken:"silentRefreshClientAcquireToken",SsoSilent:"ssoSilent",StandardInteractionClientGetDiscoveredAuthority:"standardInteractionClientGetDiscoveredAuthority",FetchAccountIdWithNativeBroker:"fetchAccountIdWithNativeBroker",NativeInteractionClientAcquireToken:"nativeInteractionClientAcquireToken",BaseClientCreateTokenRequestHeaders:"baseClientCreateTokenRequestHeaders",RefreshTokenClientExecutePostToTokenEndpoint:"refreshTokenClientExecutePostToTokenEndpoint",AuthorizationCodeClientExecutePostToTokenEndpoint:"authorizationCodeClientExecutePostToTokenEndpoint",BrokerHandhshake:"brokerHandshake",AcquireTokenByRefreshTokenInBroker:"acquireTokenByRefreshTokenInBroker",AcquireTokenByBroker:"acquireTokenByBroker",RefreshTokenClientExecuteTokenRequest:"refreshTokenClientExecuteTokenRequest",RefreshTokenClientAcquireToken:"refreshTokenClientAcquireToken",RefreshTokenClientAcquireTokenWithCachedRefreshToken:"refreshTokenClientAcquireTokenWithCachedRefreshToken",RefreshTokenClientAcquireTokenByRefreshToken:"refreshTokenClientAcquireTokenByRefreshToken",RefreshTokenClientCreateTokenRequestBody:"refreshTokenClientCreateTokenRequestBody",AcquireTokenFromCache:"acquireTokenFromCache",SilentFlowClientAcquireCachedToken:"silentFlowClientAcquireCachedToken",SilentFlowClientGenerateResultFromCacheRecord:"silentFlowClientGenerateResultFromCacheRecord",AcquireTokenBySilentIframe:"acquireTokenBySilentIframe",InitializeBaseRequest:"initializeBaseRequest",InitializeSilentRequest:"initializeSilentRequest",InitializeClientApplication:"initializeClientApplication",SilentIframeClientTokenHelper:"silentIframeClientTokenHelper",SilentHandlerInitiateAuthRequest:"silentHandlerInitiateAuthRequest",SilentHandlerMonitorIframeForHash:"silentHandlerMonitorIframeForHash",SilentHandlerLoadFrame:"silentHandlerLoadFrame",SilentHandlerLoadFrameSync:"silentHandlerLoadFrameSync",StandardInteractionClientCreateAuthCodeClient:"standardInteractionClientCreateAuthCodeClient",StandardInteractionClientGetClientConfiguration:"standardInteractionClientGetClientConfiguration",StandardInteractionClientInitializeAuthorizationRequest:"standardInteractionClientInitializeAuthorizationRequest",StandardInteractionClientInitializeAuthorizationCodeRequest:"standardInteractionClientInitializeAuthorizationCodeRequest",GetAuthCodeUrl:"getAuthCodeUrl",HandleCodeResponseFromServer:"handleCodeResponseFromServer",HandleCodeResponse:"handleCodeResponse",UpdateTokenEndpointAuthority:"updateTokenEndpointAuthority",AuthClientAcquireToken:"authClientAcquireToken",AuthClientExecuteTokenRequest:"authClientExecuteTokenRequest",AuthClientCreateTokenRequestBody:"authClientCreateTokenRequestBody",AuthClientCreateQueryString:"authClientCreateQueryString",PopTokenGenerateCnf:"popTokenGenerateCnf",PopTokenGenerateKid:"popTokenGenerateKid",HandleServerTokenResponse:"handleServerTokenResponse",DeserializeResponse:"deserializeResponse",AuthorityFactoryCreateDiscoveredInstance:"authorityFactoryCreateDiscoveredInstance",AuthorityResolveEndpointsAsync:"authorityResolveEndpointsAsync",AuthorityResolveEndpointsFromLocalSources:"authorityResolveEndpointsFromLocalSources",AuthorityGetCloudDiscoveryMetadataFromNetwork:"authorityGetCloudDiscoveryMetadataFromNetwork",AuthorityUpdateCloudDiscoveryMetadata:"authorityUpdateCloudDiscoveryMetadata",AuthorityGetEndpointMetadataFromNetwork:"authorityGetEndpointMetadataFromNetwork",AuthorityUpdateEndpointMetadata:"authorityUpdateEndpointMetadata",AuthorityUpdateMetadataWithRegionalInformation:"authorityUpdateMetadataWithRegionalInformation",RegionDiscoveryDetectRegion:"regionDiscoveryDetectRegion",RegionDiscoveryGetRegionFromIMDS:"regionDiscoveryGetRegionFromIMDS",RegionDiscoveryGetCurrentVersion:"regionDiscoveryGetCurrentVersion",AcquireTokenByCodeAsync:"acquireTokenByCodeAsync",GetEndpointMetadataFromNetwork:"getEndpointMetadataFromNetwork",GetCloudDiscoveryMetadataFromNetworkMeasurement:"getCloudDiscoveryMetadataFromNetworkMeasurement",HandleRedirectPromiseMeasurement:"handleRedirectPromise",HandleNativeRedirectPromiseMeasurement:"handleNativeRedirectPromise",UpdateCloudDiscoveryMetadataMeasurement:"updateCloudDiscoveryMetadataMeasurement",UsernamePasswordClientAcquireToken:"usernamePasswordClientAcquireToken",NativeMessageHandlerHandshake:"nativeMessageHandlerHandshake",NativeGenerateAuthResult:"nativeGenerateAuthResult",RemoveHiddenIframe:"removeHiddenIframe",ClearTokensAndKeysWithClaims:"clearTokensAndKeysWithClaims",CacheManagerGetRefreshToken:"cacheManagerGetRefreshToken",GeneratePkceCodes:"generatePkceCodes",GenerateCodeVerifier:"generateCodeVerifier",GenerateCodeChallengeFromVerifier:"generateCodeChallengeFromVerifier",Sha256Digest:"sha256Digest",GetRandomValues:"getRandomValues"},mn=new Map([[fn.AcquireTokenByCode,"ATByCode"],[fn.AcquireTokenByRefreshToken,"ATByRT"],[fn.AcquireTokenSilent,"ATS"],[fn.AcquireTokenSilentAsync,"ATSAsync"],[fn.AcquireTokenPopup,"ATPopup"],[fn.AcquireTokenRedirect,"ATRedirect"],[fn.CryptoOptsGetPublicKeyThumbprint,"CryptoGetPKThumb"],[fn.CryptoOptsSignJwt,"CryptoSignJwt"],[fn.SilentCacheClientAcquireToken,"SltCacheClientAT"],[fn.SilentIframeClientAcquireToken,"SltIframeClientAT"],[fn.SilentRefreshClientAcquireToken,"SltRClientAT"],[fn.SsoSilent,"SsoSlt"],[fn.StandardInteractionClientGetDiscoveredAuthority,"StdIntClientGetDiscAuth"],[fn.FetchAccountIdWithNativeBroker,"FetchAccIdWithNtvBroker"],[fn.NativeInteractionClientAcquireToken,"NtvIntClientAT"],[fn.BaseClientCreateTokenRequestHeaders,"BaseClientCreateTReqHead"],[fn.RefreshTokenClientExecutePostToTokenEndpoint,"RTClientExecPost"],[fn.AuthorizationCodeClientExecutePostToTokenEndpoint,"AuthCodeClientExecPost"],[fn.BrokerHandhshake,"BrokerHandshake"],[fn.AcquireTokenByRefreshTokenInBroker,"ATByRTInBroker"],[fn.AcquireTokenByBroker,"ATByBroker"],[fn.RefreshTokenClientExecuteTokenRequest,"RTClientExecTReq"],[fn.RefreshTokenClientAcquireToken,"RTClientAT"],[fn.RefreshTokenClientAcquireTokenWithCachedRefreshToken,"RTClientATWithCachedRT"],[fn.RefreshTokenClientAcquireTokenByRefreshToken,"RTClientATByRT"],[fn.RefreshTokenClientCreateTokenRequestBody,"RTClientCreateTReqBody"],[fn.AcquireTokenFromCache,"ATFromCache"],[fn.SilentFlowClientAcquireCachedToken,"SltFlowClientATCached"],[fn.SilentFlowClientGenerateResultFromCacheRecord,"SltFlowClientGenResFromCache"],[fn.AcquireTokenBySilentIframe,"ATBySltIframe"],[fn.InitializeBaseRequest,"InitBaseReq"],[fn.InitializeSilentRequest,"InitSltReq"],[fn.InitializeClientApplication,"InitClientApplication"],[fn.SilentIframeClientTokenHelper,"SIClientTHelper"],[fn.SilentHandlerInitiateAuthRequest,"SHandlerInitAuthReq"],[fn.SilentHandlerMonitorIframeForHash,"SltHandlerMonitorIframeForHash"],[fn.SilentHandlerLoadFrame,"SHandlerLoadFrame"],[fn.SilentHandlerLoadFrameSync,"SHandlerLoadFrameSync"],[fn.StandardInteractionClientCreateAuthCodeClient,"StdIntClientCreateAuthCodeClient"],[fn.StandardInteractionClientGetClientConfiguration,"StdIntClientGetClientConf"],[fn.StandardInteractionClientInitializeAuthorizationRequest,"StdIntClientInitAuthReq"],[fn.StandardInteractionClientInitializeAuthorizationCodeRequest,"StdIntClientInitAuthCodeReq"],[fn.GetAuthCodeUrl,"GetAuthCodeUrl"],[fn.HandleCodeResponseFromServer,"HandleCodeResFromServer"],[fn.HandleCodeResponse,"HandleCodeResp"],[fn.UpdateTokenEndpointAuthority,"UpdTEndpointAuth"],[fn.AuthClientAcquireToken,"AuthClientAT"],[fn.AuthClientExecuteTokenRequest,"AuthClientExecTReq"],[fn.AuthClientCreateTokenRequestBody,"AuthClientCreateTReqBody"],[fn.AuthClientCreateQueryString,"AuthClientCreateQueryStr"],[fn.PopTokenGenerateCnf,"PopTGenCnf"],[fn.PopTokenGenerateKid,"PopTGenKid"],[fn.HandleServerTokenResponse,"HandleServerTRes"],[fn.DeserializeResponse,"DeserializeRes"],[fn.AuthorityFactoryCreateDiscoveredInstance,"AuthFactCreateDiscInst"],[fn.AuthorityResolveEndpointsAsync,"AuthResolveEndpointsAsync"],[fn.AuthorityResolveEndpointsFromLocalSources,"AuthResolveEndpointsFromLocal"],[fn.AuthorityGetCloudDiscoveryMetadataFromNetwork,"AuthGetCDMetaFromNet"],[fn.AuthorityUpdateCloudDiscoveryMetadata,"AuthUpdCDMeta"],[fn.AuthorityGetEndpointMetadataFromNetwork,"AuthUpdCDMetaFromNet"],[fn.AuthorityUpdateEndpointMetadata,"AuthUpdEndpointMeta"],[fn.AuthorityUpdateMetadataWithRegionalInformation,"AuthUpdMetaWithRegInfo"],[fn.RegionDiscoveryDetectRegion,"RegDiscDetectReg"],[fn.RegionDiscoveryGetRegionFromIMDS,"RegDiscGetRegFromIMDS"],[fn.RegionDiscoveryGetCurrentVersion,"RegDiscGetCurrentVer"],[fn.AcquireTokenByCodeAsync,"ATByCodeAsync"],[fn.GetEndpointMetadataFromNetwork,"GetEndpointMetaFromNet"],[fn.GetCloudDiscoveryMetadataFromNetworkMeasurement,"GetCDMetaFromNet"],[fn.HandleRedirectPromiseMeasurement,"HandleRedirectPromise"],[fn.HandleNativeRedirectPromiseMeasurement,"HandleNtvRedirectPromise"],[fn.UpdateCloudDiscoveryMetadataMeasurement,"UpdateCDMeta"],[fn.UsernamePasswordClientAcquireToken,"UserPassClientAT"],[fn.NativeMessageHandlerHandshake,"NtvMsgHandlerHandshake"],[fn.NativeGenerateAuthResult,"NtvGenAuthRes"],[fn.RemoveHiddenIframe,"RemoveHiddenIframe"],[fn.ClearTokensAndKeysWithClaims,"ClearTAndKeysWithClaims"],[fn.CacheManagerGetRefreshToken,"CacheManagerGetRT"],[fn.GeneratePkceCodes,"GenPkceCodes"],[fn.GenerateCodeVerifier,"GenCodeVerifier"],[fn.GenerateCodeChallengeFromVerifier,"GenCodeChallengeFromVerifier"],[fn.Sha256Digest,"Sha256Digest"],[fn.GetRandomValues,"GetRandomValues"]]),vn=1,yn=2,Cn=new Set(["accessTokenSize","durationMs","idTokenSize","matsSilentStatus","matsHttpStatus","refreshTokenSize","queuedTimeMs","startTimeMs","status","multiMatchedAT","multiMatchedID","multiMatchedRT"]),Tn=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function ${t}`);const a=n?.startMeasurement(t,o);if(o){const e=t+"CallCount";n?.incrementFields({[e]:1},o)}try{const n=e(...i);return a?.end({success:!0}),r.trace(`Returning result from ${t}`),n}catch(e){r.trace(`Error occurred in ${t}`);try{r.trace(JSON.stringify(e))}catch(e){r.trace("Unable to print error message.")}throw a?.end({success:!1},e),e}},In=(e,t,r,n,o)=>(...i)=>{r.trace(`Executing function ${t}`);const a=n?.startMeasurement(t,o);if(o){const e=t+"CallCount";n?.incrementFields({[e]:1},o)}return n?.setPreQueueTime(t,o),e(...i).then((e=>(r.trace(`Returning result from ${t}`),a?.end({success:!0}),e))).catch((e=>{r.trace(`Error occurred in ${t}`);try{r.trace(JSON.stringify(e))}catch(e){r.trace("Unable to print error message.")}throw a?.end({success:!1},e),e}))}; /*! @azure/msal-common v14.15.0 2024-09-20 */ class wn{constructor(e,t,r,n){this.networkInterface=e,this.logger=t,this.performanceClient=r,this.correlationId=n}async detectRegion(e,r){this.performanceClient?.addQueueMeasurement(fn.RegionDiscoveryDetectRegion,this.correlationId);let n=e;if(n)r.region_source=ie;else{const e=wn.IMDS_OPTIONS;try{const o=await In(this.getRegionFromIMDS.bind(this),fn.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(t.IMDS_VERSION,e);if(o.status===re&&(n=o.body,r.region_source=ae),o.status===ne){const t=await In(this.getCurrentVersion.bind(this),fn.RegionDiscoveryGetCurrentVersion,this.logger,this.performanceClient,this.correlationId)(e);if(!t)return r.region_source=oe,null;const o=await In(this.getRegionFromIMDS.bind(this),fn.RegionDiscoveryGetRegionFromIMDS,this.logger,this.performanceClient,this.correlationId)(t,e);o.status===re&&(n=o.body,r.region_source=ae)}}catch(e){return r.region_source=oe,null}}return n||(r.region_source=oe),n||null}async getRegionFromIMDS(e,r){return this.performanceClient?.addQueueMeasurement(fn.RegionDiscoveryGetRegionFromIMDS,this.correlationId),this.networkInterface.sendGetRequestAsync(`${t.IMDS_ENDPOINT}?api-version=${e}&format=text`,r,t.IMDS_TIMEOUT)}async getCurrentVersion(e){this.performanceClient?.addQueueMeasurement(fn.RegionDiscoveryGetCurrentVersion,this.correlationId);try{const r=await this.networkInterface.sendGetRequestAsync(`${t.IMDS_ENDPOINT}?format=json`,e);return r.status===ne&&r.body&&r.body["newest-versions"]&&r.body["newest-versions"].length>0?r.body["newest-versions"][0]:null}catch(e){return null}}}wn.IMDS_OPTIONS={headers:{Metadata:"true"}}; /*! @azure/msal-common v14.15.0 2024-09-20 */ class En{constructor(e,t,r,n,o,i,a,s){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=t,this.cacheManager=r,this.authorityOptions=n,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=o,this.performanceClient=a,this.correlationId=i,this.managedIdentity=s||!1,this.regionDiscovery=new wn(t,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith(t.CIAM_AUTH_URL))return Rr;const r=e.PathSegments;if(r.length)switch(r[0].toLowerCase()){case t.ADFS:return Ar;case t.DSTS:return _r}return br}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new Ur(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw vt(Ae)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw vt(Ae)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw vt(Ae)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw vt(at);return this.replacePath(this.metadata.end_session_endpoint)}throw vt(Ae)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw vt(Ae)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw vt(Ae)}canReplaceTenant(e){return 1===e.PathSegments.length&&!En.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===br&&this.protocolMode===Mr.AAD}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let t=e;const r=new Ur(this.metadata.canonical_authority).getUrlComponents(),n=r.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach(((e,o)=>{let i=n[o];if(0===o&&this.canReplaceTenant(r)){const e=new Ur(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];i!==e&&(this.logger.verbose(`Replacing tenant domain name ${i} with id ${e}`),i=e)}e!==i&&(t=t.replace(`/${i}/`,`/${e}/`))})),this.replaceTenant(t)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===Ar||this.protocolMode!==Mr.AAD&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){this.performanceClient?.addQueueMeasurement(fn.AuthorityResolveEndpointsAsync,this.correlationId);const e=this.getCurrentMetadataEntity(),t=await In(this.updateCloudDiscoveryMetadata.bind(this),fn.AuthorityUpdateCloudDiscoveryMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const r=await In(this.updateEndpointMetadata.bind(this),fn.AuthorityUpdateEndpointMetadata,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,t,{source:r}),this.performanceClient?.addFields({cloudDiscoverySource:t,authorityEndpointSource:r},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:Kt(),jwks_uri:""}),e}updateCachedMetadata(e,t,r){t!==z&&r?.source!==z&&(e.expiresAt=Kt(),e.canonical_authority=this.canonicalAuthority);const n=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache);this.cacheManager.setAuthorityMetadata(n,e),this.metadata=e}async updateEndpointMetadata(e){this.performanceClient?.addQueueMeasurement(fn.AuthorityUpdateEndpointMetadata,this.correlationId);const t=this.updateEndpointMetadataFromLocalSources(e);if(t){if(t.source===Q&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&t.metadata){zt(e,await In(this.updateMetadataWithRegionalInformation.bind(this),fn.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(t.metadata),!1),e.canonical_authority=this.canonicalAuthority}return t.source}let r=await In(this.getEndpointMetadataFromNetwork.bind(this),fn.AuthorityGetEndpointMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(r=await In(this.updateMetadataWithRegionalInformation.bind(this),fn.AuthorityUpdateMetadataWithRegionalInformation,this.logger,this.performanceClient,this.correlationId)(r)),zt(e,r,!0),G;throw vt(Re,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("Attempting to get endpoint metadata from authority configuration");const t=this.getEndpointMetadataFromConfig();if(t)return this.logger.verbose("Found endpoint metadata in authority configuration"),zt(e,t,!1),{source:K};if(this.logger.verbose("Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values."),this.authorityOptions.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.");else{const t=this.getEndpointMetadataFromHardcodedValues();if(t)return zt(e,t,!1),{source:Q,metadata:t};this.logger.verbose("Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.")}const r=Qt(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!r?(this.logger.verbose("Found endpoint metadata in the cache."),{source:z}):(r&&this.logger.verbose("The metadata entity is expired."),null)}isAuthoritySameType(e){return new Ur(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch(e){throw yr(ir)}return null}async getEndpointMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(fn.AuthorityGetEndpointMetadataFromNetwork,this.correlationId);const e={},t=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${t}`);try{const r=await this.networkInterface.sendGetRequestAsync(t,e),n=function(e){return e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("jwks_uri")} /*! @azure/msal-common v14.15.0 2024-09-20 */(r.body);return n?r.body:(this.logger.verbose("Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration"),null)}catch(e){return this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in xr?xr[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){this.performanceClient?.addQueueMeasurement(fn.AuthorityUpdateMetadataWithRegionalInformation,this.correlationId);const r=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(r){if(r!==t.AZURE_REGION_AUTO_DISCOVER_FLAG)return this.regionDiscoveryMetadata.region_outcome=se,this.regionDiscoveryMetadata.region_used=r,En.replaceWithRegionalInformation(e,r);const n=await In(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),fn.RegionDiscoveryDetectRegion,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(n)return this.regionDiscoveryMetadata.region_outcome=ce,this.regionDiscoveryMetadata.region_used=n,En.replaceWithRegionalInformation(e,n);this.regionDiscoveryMetadata.region_outcome=ue}return e}async updateCloudDiscoveryMetadata(e){this.performanceClient?.addQueueMeasurement(fn.AuthorityUpdateCloudDiscoveryMetadata,this.correlationId);const t=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(t)return t;const r=await In(this.getCloudDiscoveryMetadataFromNetwork.bind(this),fn.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.logger,this.performanceClient,this.correlationId)();if(r)return Gt(e,r,!0),G;throw yr(ar)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("Attempting to get cloud discovery metadata from authority configuration"),this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities||t.NOT_APPLICABLE}`),this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata||t.NOT_APPLICABLE}`),this.logger.verbosePii(`Canonical Authority: ${e.canonical_authority||t.NOT_APPLICABLE}`);const r=this.getCloudDiscoveryMetadataFromConfig();if(r)return this.logger.verbose("Found cloud discovery metadata in authority configuration"),Gt(e,r,!1),K;if(this.logger.verbose("Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values."),this.options.skipAuthorityMetadataCache)this.logger.verbose("Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.");else{const t=(n=this.hostnameAndPort,Dr(Lr.metadata,n));if(t)return this.logger.verbose("Found cloud discovery metadata from hardcoded values."),Gt(e,t,!1),Q;this.logger.verbose("Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.")}var n;const o=Qt(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!o?(this.logger.verbose("Found cloud discovery metadata in the cache."),z):(o&&this.logger.verbose("The metadata entity is expired."),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===Rr)return this.logger.verbose("CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host."),En.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("The cloud discovery metadata has been provided as a network response, in the config.");try{this.logger.verbose("Attempting to parse the cloud discovery metadata.");const e=Dr(JSON.parse(this.authorityOptions.cloudDiscoveryMetadata).metadata,this.hostnameAndPort);if(this.logger.verbose("Parsed the cloud discovery metadata."),e)return this.logger.verbose("There is returnable metadata attached to the parsed cloud discovery metadata."),e;this.logger.verbose("There is no metadata attached to the parsed cloud discovery metadata.")}catch(e){throw this.logger.verbose("Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error."),yr(or)}}return this.isInKnownAuthorities()?(this.logger.verbose("The host is included in knownAuthorities. Creating new cloud discovery metadata from the host."),En.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){this.performanceClient?.addQueueMeasurement(fn.AuthorityGetCloudDiscoveryMetadataFromNetwork,this.correlationId);const e=`${t.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`,r={};let n=null;try{const o=await this.networkInterface.sendGetRequestAsync(e,r);let i,a;if(function(e){return e.hasOwnProperty("tenant_discovery_endpoint")&&e.hasOwnProperty("metadata")} /*! @azure/msal-common v14.15.0 2024-09-20 */(o.body))i=o.body,a=i.metadata,this.logger.verbosePii(`tenant_discovery_endpoint is: ${i.tenant_discovery_endpoint}`);else{if(!function(e){return e.hasOwnProperty("error")&&e.hasOwnProperty("error_description")}(o.body))return this.logger.error("AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse"),null;if(this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${o.status}`),i=o.body,i.error===t.INVALID_INSTANCE)return this.logger.error("The CloudInstanceDiscoveryErrorResponse error is invalid_instance."),null;this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${i.error}`),this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${i.error_description}`),this.logger.warning("Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []"),a=[]}this.logger.verbose("Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request."),n=Dr(a,this.hostnameAndPort)}catch(e){if(e instanceof Ie)this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\r\nError: ${e.errorCode}\r\nError Description: ${e.errorMessage}`);else{const t=e;this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\r\nError: ${t.name}\r\nError Description: ${t.message}`)}return null}return n||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),n=En.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter((e=>e&&Ur.getDomainFromUrl(e).toLowerCase()===this.hostnameAndPort)).length>0}static generateAuthority(e,r){let n;if(r&&r.azureCloudInstance!==Et.None){const e=r.tenant?r.tenant:t.DEFAULT_COMMON_TENANT;n=`${r.azureCloudInstance}/${e}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return t.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw vt(Ae)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Br.has(e)}static isPublicCloudAuthority(e){return t.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,r,n){const o=new Ur(e);o.validateAsUri();const i=o.getUrlComponents();let a=`${r}.${i.HostNameAndPort}`;this.isPublicCloudAuthority(i.HostNameAndPort)&&(a=`${r}.${t.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const s=Ur.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:a}).urlString;return n?`${s}?${n}`:s}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=En.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=En.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=En.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let r=e;const n=new Ur(e).getUrlComponents();if(0===n.PathSegments.length&&n.HostNameAndPort.endsWith(t.CIAM_AUTH_URL)){r=`${r}${n.HostNameAndPort.split(".")[0]}${t.AAD_TENANT_DOMAIN_SUFFIX}`}return r}}function kn(e){return e.endsWith(t.FORWARD_SLASH)?e:`${e}${t.FORWARD_SLASH}`}function Sn(e){const t=e.cloudDiscoveryMetadata;let r;if(t)try{r=JSON.parse(t)}catch(e){throw yr(or)}return{canonicalAuthority:e.authority?kn(e.authority):void 0,knownAuthorities:e.knownAuthorities,cloudDiscoveryMetadata:r}} /*! @azure/msal-common v14.15.0 2024-09-20 */async function bn(e,t,r,n,o,i,a){a?.addQueueMeasurement(fn.AuthorityFactoryCreateDiscoveredInstance,i);const s=En.transformCIAMAuthority(kn(e)),c=new En(s,t,r,n,o,i,a);try{return await In(c.resolveEndpointsAsync.bind(c),fn.AuthorityResolveEndpointsAsync,o,a,i)(),c}catch(e){throw vt(Ae)}} /*! @azure/msal-common v14.15.0 2024-09-20 */En.reservedTenantDomains=new Set(["{tenant}","{tenantid}",w,k,E]);class An{constructor(e,t){this.config=function({authOptions:e,systemOptions:t,loggerOptions:r,cacheOptions:n,storageInterface:o,networkInterface:i,cryptoInterface:a,clientCredentials:s,libraryInfo:c,telemetry:u,serverTelemetryManager:l,persistencePlugin:d,serializableCache:h}){const p={...Vr,...r};return{authOptions:(g=e,{clientCapabilities:[],azureCloudOptions:Zr,skipAuthorityMetadataCache:!1,instanceAware:!1,...g}),systemOptions:{...Wr,...t},loggerOptions:p,cacheOptions:{...Yr,...n},storageInterface:o||new jr(e.clientId,yt,new Tt(p)),networkInterface:i||$r,cryptoInterface:a||yt,clientCredentials:s||Xr,libraryInfo:{...Jr,...c},telemetry:{...en,...u},serverTelemetryManager:l||null,persistencePlugin:d||null,serializableCache:h||null};var g}(e),this.logger=new Tt(this.config.loggerOptions,It,wt),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.networkManager=new on(this.networkClient,this.cacheManager),this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const r={};if(r[c]=t.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case an:try{const t=wr(e.credential);r[l]=`Oid:${t.uid}@${t.utid}`}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case sn:r[l]=`UPN: ${e.credential}`}return r}async executePostToTokenEndpoint(e,t,r,n,o,i){i&&this.performanceClient?.addQueueMeasurement(i,o);const a=await this.networkManager.sendPostRequest(n,e,{body:t,headers:r});return this.performanceClient?.addFields({refreshTokenSize:a.body.refresh_token?.length||0,httpVerToken:a.headers?.[g]||""},o),this.config.serverTelemetryManager&&a.status<500&&429!==a.status&&this.config.serverTelemetryManager.clearTelemetryCache(),a}async updateAuthority(e,t){this.performanceClient?.addQueueMeasurement(fn.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,n=await bn(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=n}createTokenQueryParameters(e){const t=new gn;return e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.createQueryString()}} /*! @azure/msal-common v14.15.0 2024-09-20 */const _n="no_tokens_found",Rn="native_account_unavailable",Pn="refresh_token_expired",Mn="interaction_required",Nn="consent_required",On="login_required",qn="bad_token";var Un=Object.freeze({__proto__:null,badToken:qn,consentRequired:Nn,interactionRequired:Mn,loginRequired:On,nativeAccountUnavailable:Rn,noTokensFound:_n,refreshTokenExpired:Pn}); /*! @azure/msal-common v14.15.0 2024-09-20 */const xn=[Mn,Nn,On,qn],Ln=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],Bn={[_n]:"No refresh token found in the cache. Please sign-in.",[Rn]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[Pn]:"Refresh token has expired.",[qn]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."},Hn={noTokensFoundError:{code:_n,desc:Bn[_n]},native_account_unavailable:{code:Rn,desc:Bn[Rn]},bad_token:{code:qn,desc:Bn[qn]}};class Dn extends Ie{constructor(e,r,n,o,i,a,s,c){super(e,r,n),Object.setPrototypeOf(this,Dn.prototype),this.timestamp=o||t.EMPTY_STRING,this.traceId=i||t.EMPTY_STRING,this.correlationId=a||t.EMPTY_STRING,this.claims=s||t.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=c}}function Fn(e,t,r){const n=!!e&&xn.indexOf(e)>-1,o=!!r&&Ln.indexOf(r)>-1,i=!!t&&xn.some((e=>t.indexOf(e)>-1));return n||i||o}function Kn(e){return new Dn(e,Bn[e])} /*! @azure/msal-common v14.15.0 2024-09-20 */class zn{static setRequestState(e,r,n){const o=zn.generateLibraryState(e,n);return r?`${o}${t.RESOURCE_DELIM}${r}`:o}static generateLibraryState(e,t){if(!e)throw vt(Je);const r={id:e.createNewGuid()};t&&(r.meta=t);const n=JSON.stringify(r);return e.base64Encode(n)}static parseRequestState(e,r){if(!e)throw vt(Je);if(!r)throw vt(Me);try{const n=r.split(t.RESOURCE_DELIM),o=n[0],i=n.length>1?n.slice(1).join(t.RESOURCE_DELIM):t.EMPTY_STRING,a=e.base64Decode(o),s=JSON.parse(a);return{userRequestState:i||t.EMPTY_STRING,libraryState:s}}catch(e){throw vt(Me)}}} /*! @azure/msal-common v14.15.0 2024-09-20 */const Gn="sw";class Qn{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){this.performanceClient?.addQueueMeasurement(fn.PopTokenGenerateCnf,e.correlationId);const r=await In(this.generateKid.bind(this),fn.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),n=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:n}}async generateKid(e){this.performanceClient?.addQueueMeasurement(fn.PopTokenGenerateKid,e.correlationId);return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Gn}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,n){const{resourceRequestMethod:o,resourceRequestUri:i,shrClaims:a,shrNonce:s,shrOptions:c}=r,u=i?new Ur(i):void 0,l=u?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:bt(),m:o?.toUpperCase(),u:l?.HostNameAndPort,nonce:s||this.cryptoUtils.createNewGuid(),p:l?.AbsolutePath,q:l?.QueryString?[[],l.QueryString]:void 0,client_claims:a||void 0,...n},t,c,r.correlationId)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class jn{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}} /*! @azure/msal-common v14.15.0 2024-09-20 */class Wn{constructor(e,t,r,n,o,i,a){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=n,this.serializableCache=o,this.persistencePlugin=i,this.performanceClient=a}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?vt(Oe,"Cached State"):vt(Oe,"Server State");let r,n;try{r=decodeURIComponent(e.state)}catch(t){throw vt(Me,e.state)}try{n=decodeURIComponent(t)}catch(t){throw vt(Me,e.state)}if(r!==n)throw vt(Ne);if(e.error||e.error_description||e.suberror){const t=function(e){const t="code=",r=e.error_uri?.lastIndexOf(t);return r&&r>=0?e.error_uri?.substring(r+5):void 0}(e);if(Fn(e.error,e.error_description,e.suberror))throw new Dn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",t);throw new rn(e.error||"",e.error_description,e.suberror,t)}}validateTokenResponse(e,a){if(e.error||e.error_description||e.suberror){const s=`Error(s): ${e.error_codes||t.NOT_AVAILABLE} - Timestamp: ${e.timestamp||t.NOT_AVAILABLE} - Description: ${e.error_description||t.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||t.NOT_AVAILABLE} - Trace ID: ${e.trace_id||t.NOT_AVAILABLE}`,c=e.error_codes?.length?e.error_codes[0]:void 0,u=new rn(e.error,s,e.suberror,c,e.status);if(a&&e.status&&e.status>=o&&e.status<=i)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.\r\n${u}`);if(a&&e.status&&e.status>=r&&e.status<=n)return void this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.\r\n${u}`);if(Fn(e.error,e.error_description,e.suberror))throw new Dn(e.error,e.error_description,e.suberror,e.timestamp||t.EMPTY_STRING,e.trace_id||t.EMPTY_STRING,e.correlation_id||t.EMPTY_STRING,e.claims||t.EMPTY_STRING,c);throw u}}async handleServerTokenResponse(e,r,n,o,i,a,s,c,u){let l,d;if(this.performanceClient?.addQueueMeasurement(fn.HandleServerTokenResponse,e.correlation_id),e.id_token){if(l=kt(e.id_token||t.EMPTY_STRING,this.cryptoObj.base64Decode),i&&i.nonce&&l.nonce!==i.nonce)throw vt(qe);if(o.maxAge||0===o.maxAge){const e=l.auth_time;if(!e)throw vt(Ue);St(e,o.maxAge)}}this.homeAccountIdentifier=Nr.generateHomeAccountId(e.client_info||t.EMPTY_STRING,r.authorityType,this.logger,this.cryptoObj,l),i&&i.state&&(d=zn.parseRequestState(this.cryptoObj,i.state)),e.key_id=e.key_id||o.sshKid||void 0;const h=this.generateCacheRecord(e,r,n,o,l,a,i);let p;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),p=new jn(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(p)),s&&!c&&h.account){const e=h.account.generateAccountKey();if(!this.cacheStorage.getAccount(e,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Wn.generateAuthenticationResult(this.cryptoObj,r,h,!1,o,l,d,void 0,u)}await this.cacheStorage.saveCacheRecord(h,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&p&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(p))}return Wn.generateAuthenticationResult(this.cryptoObj,r,h,!1,o,l,d,e,u)}generateCacheRecord(e,t,r,n,o,i,a){const s=t.getPreferredCache();if(!s)throw vt(Ye);const c=Pr(o);let u,l;e.id_token&&o&&(u=Pt(this.homeAccountIdentifier,s,e.id_token,this.clientId,c||""),l=Vn(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,o,e.client_info,s,c,a,void 0,this.logger));let d=null;if(e.access_token){const o=e.scope?Tr.fromString(e.scope):new Tr(n.scopes||[]),a=("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0,u=("string"==typeof e.ext_expires_in?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,l=("string"==typeof e.refresh_in?parseInt(e.refresh_in,10):e.refresh_in)||void 0,h=r+a,p=h+u,g=l&&l>0?r+l:void 0;d=Mt(this.homeAccountIdentifier,s,e.access_token,this.clientId,c||t.tenant||"",o.printScopes(),h,p,this.cryptoObj.base64Decode,g,e.token_type,i,e.key_id,n.claims,n.requestedClaimsHash)}let h=null;if(e.refresh_token){let t;if(e.refresh_token_expires_in){t=r+("string"==typeof e.refresh_token_expires_in?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in)}h=Nt(this.homeAccountIdentifier,s,e.refresh_token,this.clientId,e.foci,i,t)}let p=null;return e.foci&&(p={clientId:this.clientId,environment:s,familyId:e.foci}),{account:l,idToken:u,accessToken:d,refreshToken:h,appMetadata:p}}static async generateAuthenticationResult(e,r,n,o,i,a,s,c,u){let l,d,h=t.EMPTY_STRING,p=[],g=null,f=t.EMPTY_STRING;if(n.accessToken){if(n.accessToken.tokenType!==W.POP||i.popKid)h=n.accessToken.secret;else{const t=new Qn(e),{secret:r,keyId:o}=n.accessToken;if(!o)throw vt(st);h=await t.signPopToken(r,o,i)}p=Tr.fromString(n.accessToken.target).asArray(),g=new Date(1e3*Number(n.accessToken.expiresOn)),l=new Date(1e3*Number(n.accessToken.extendedExpiresOn)),n.accessToken.refreshOn&&(d=new Date(1e3*Number(n.accessToken.refreshOn)))}n.appMetadata&&(f=n.appMetadata.familyId===H?H:"");const m=a?.oid||a?.sub||"",v=a?.tid||"";c?.spa_accountid&&n.account&&(n.account.nativeAccountId=c?.spa_accountid);const y=n.account?Sr(n.account.getAccountInfo(),void 0,a,n.idToken?.secret):null;return{authority:r.canonicalAuthority,uniqueId:m,tenantId:v,scopes:p,account:y,idToken:n?.idToken?.secret||"",idTokenClaims:a||{},accessToken:h,fromCache:o,expiresOn:g,extExpiresOn:l,refreshOn:d,correlationId:i.correlationId,requestId:u||t.EMPTY_STRING,familyId:f,tokenType:n.accessToken?.tokenType||t.EMPTY_STRING,state:s?s.userRequestState:t.EMPTY_STRING,cloudGraphHostName:n.account?.cloudGraphHostName||t.EMPTY_STRING,msGraphHost:n.account?.msGraphHost||t.EMPTY_STRING,code:c?.spa_code,fromNativeBroker:!1}}}function Vn(e,t,r,n,o,i,a,s,c,u,l){l?.verbose("setCachedAccount called");const d=e.getAccountKeys().find((e=>e.startsWith(r)));let h=null;d&&(h=e.getAccount(d,l));const p=h||Nr.createAccount({homeAccountId:r,idTokenClaims:o,clientInfo:i,environment:a,cloudGraphHostName:c?.cloud_graph_host_name,msGraphHost:c?.msgraph_host,nativeAccountId:u},t,n),g=p.tenantProfiles||[],f=s||p.realm;if(f&&!g.find((e=>e.tenantId===f))){const e=kr(r,p.localAccountId,f,o);g.push(e)}return p.tenantProfiles=g,p} /*! @azure/msal-common v14.15.0 2024-09-20 */async function Yn(e,t,r){if("string"==typeof e)return e;return e({clientId:t,tokenEndpoint:r})} /*! @azure/msal-common v14.15.0 2024-09-20 */class $n extends An{constructor(e,t){super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async getAuthCodeUrl(e){this.performanceClient?.addQueueMeasurement(fn.GetAuthCodeUrl,e.correlationId);const t=await In(this.createAuthCodeUrlQueryString.bind(this),fn.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return Ur.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){if(this.performanceClient?.addQueueMeasurement(fn.AuthClientAcquireToken,e.correlationId),!e.code)throw vt(De);const r=bt(),n=await In(this.executeTokenRequest.bind(this),fn.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),o=n.headers?.[p],i=new Wn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return i.validateTokenResponse(n.body),In(i.handleServerTokenResponse.bind(i),fn.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,r,e,t,void 0,void 0,void 0,o)}handleFragmentResponse(e,t){if(new Wn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw vt(ot);return e}getLogoutUri(e){if(!e)throw yr(tr);const t=this.createLogoutUrlQueryString(e);return Ur.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(fn.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),n=Ur.appendQueryString(e.tokenEndpoint,r),o=await In(this.createTokenRequestBody.bind(this),fn.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let i;if(t.clientInfo)try{const e=Ir(t.clientInfo,this.cryptoUtils.base64Decode);i={credential:`${e.uid}${x.CLIENT_INFO_SEPARATOR}${e.utid}`,type:an}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}const a=this.createTokenRequestHeaders(i||t.ccsCredential),s={clientId:t.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return In(this.executePostToTokenEndpoint.bind(this),fn.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(n,o,a,s,t.correlationId,fn.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(fn.AuthClientCreateTokenRequestBody,e.correlationId);const t=new gn;if(t.addClientId(e.tokenBodyParameters?.[cn]||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):pn.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!tn(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const r=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await Yn(r.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(r.assertionType)}if(t.addGrantType(M),t.addClientInfo(),e.authenticationScheme===W.POP){const r=new Qn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await In(r.generateCnf.bind(r),fn.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}t.addPopToken(n)}else if(e.authenticationScheme===W.SSH){if(!e.sshJwk)throw yr(sr);t.addSshJwk(e.sshJwk)}const r=e.correlationId||this.config.cryptoInterface.createNewGuid();let n;if(t.addCorrelationId(r),(!Cr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.clientInfo)try{const t=Ir(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${t.uid}${x.CLIENT_INFO_SEPARATOR}${t.utid}`,type:an}}catch(e){this.logger.verbose("Could not parse client info for CCS Header: "+e)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case an:try{const e=wr(n.credential);t.addCcsOid(e)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case sn:t.addCcsUpn(n.credential)}return e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),!e.enableSpaAuthorizationCode||e.tokenBodyParameters&&e.tokenBodyParameters[hn]||t.addExtraQueryParameters({[hn]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){this.performanceClient?.addQueueMeasurement(fn.AuthClientCreateQueryString,e.correlationId);const t=new gn;t.addClientId(e.extraQueryParameters?.[cn]||this.config.authOptions.clientId);const r=[...e.scopes||[],...e.extraScopesToConsent||[]];t.addScopes(r,!0,this.oidcDefaultScopes),t.addRedirectUri(e.redirectUri);const n=e.correlationId||this.config.cryptoInterface.createNewGuid();if(t.addCorrelationId(n),t.addResponseMode(e.responseMode),t.addResponseTypeCode(),t.addLibraryInfo(this.config.libraryInfo),tn(this.config)||t.addApplicationTelemetry(this.config.telemetry.application),t.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&t.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&t.addPrompt(e.prompt),e.domainHint&&t.addDomainHint(e.domainHint),e.prompt!==A.SELECT_ACCOUNT)if(e.sid&&e.prompt===A.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),t.addSid(e.sid);else if(e.account){const r=this.extractAccountSid(e.account);let n=this.extractLoginHint(e.account);if(n&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),n=null),n){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),t.addLoginHint(n);try{const r=wr(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(r&&e.prompt===A.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),t.addSid(r);try{const r=wr(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),t.addLoginHint(e.account.username);try{const r=wr(e.account.homeAccountId);t.addCcsOid(r)}catch(e){this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),t.addLoginHint(e.loginHint),t.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&t.addNonce(e.nonce),e.state&&t.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.addExtraQueryParams(e,t),e.nativeBroker&&(t.addNativeBroker(),e.authenticationScheme===W.POP)){const r=new Qn(this.cryptoUtils);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await In(r.generateCnf.bind(r),fn.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}t.addPopToken(n)}return t.createQueryString()}createLogoutUrlQueryString(e){const t=new gn;return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){return e.idTokenClaims?.sid||null}extractLoginHint(e){return e.idTokenClaims?.login_hint||null}} /*! @azure/msal-common v14.15.0 2024-09-20 */class Jn extends An{constructor(e,t){super(e,t)}async acquireToken(e){this.performanceClient?.addQueueMeasurement(fn.RefreshTokenClientAcquireToken,e.correlationId);const t=bt(),r=await In(this.executeTokenRequest.bind(this),fn.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),n=r.headers?.[p],o=new Wn(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return o.validateTokenResponse(r.body),In(o.handleServerTokenResponse.bind(o),fn.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,n)}async acquireTokenByRefreshToken(e){if(!e)throw yr(er);if(this.performanceClient?.addQueueMeasurement(fn.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw vt(We);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await In(this.acquireTokenWithCachedRefreshToken.bind(this),fn.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(t){const r=t instanceof Dn&&t.errorCode===_n,n=t instanceof rn&&t.errorCode===X&&t.subError===Z;if(r||n)return In(this.acquireTokenWithCachedRefreshToken.bind(this),fn.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw t}return In(this.acquireTokenWithCachedRefreshToken.bind(this),fn.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){this.performanceClient?.addQueueMeasurement(fn.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Tn(this.cacheManager.getRefreshToken.bind(this.cacheManager),fn.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw Kn(_n);if(r.expiresOn&&At(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||300))throw Kn(Pn);const n={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||W.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:an}};try{return await In(this.acquireToken.bind(this),fn.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(n)}catch(e){if(e instanceof Dn&&e.subError===qn){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const e=Rt(r);this.cacheManager.removeRefreshToken(e)}throw e}}async executeTokenRequest(e,t){this.performanceClient?.addQueueMeasurement(fn.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),n=Ur.appendQueryString(t.tokenEndpoint,r),o=await In(this.createTokenRequestBody.bind(this),fn.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),i=this.createTokenRequestHeaders(e.ccsCredential),a={clientId:e.tokenBodyParameters?.clientId||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return In(this.executePostToTokenEndpoint.bind(this),fn.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(n,o,i,a,e.correlationId,fn.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){this.performanceClient?.addQueueMeasurement(fn.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new gn;if(r.addClientId(e.tokenBodyParameters?.[cn]||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),r.addGrantType(N),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!tn(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addCorrelationId(t),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const t=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await Yn(t.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(t.assertionType)}if(e.authenticationScheme===W.POP){const t=new Qn(this.cryptoUtils,this.performanceClient);let n;if(e.popKid)n=this.cryptoUtils.encodeKid(e.popKid);else{n=(await In(t.generateCnf.bind(t),fn.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString}r.addPopToken(n)}else if(e.authenticationScheme===W.SSH){if(!e.sshJwk)throw yr(sr);r.addSshJwk(e.sshJwk)}if((!Cr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case an:try{const t=wr(e.ccsCredential.credential);r.addCcsOid(t)}catch(e){this.logger.verbose("Could not parse home account ID for CCS Header: "+e)}break;case sn:r.addCcsUpn(e.ccsCredential.credential)}return e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}} /*! @azure/msal-common v14.15.0 2024-09-20 */class Xn extends An{constructor(e,t){super(e,t)}async acquireToken(e){try{const[t,r]=await this.acquireCachedToken({...e,scopes:e.scopes?.length?e.scopes:[...a]});if(r===ge){this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed.");new Jn(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch((()=>{}))}return t}catch(t){if(t instanceof mt&&t.errorCode===tt){return new Jn(this.config,this.performanceClient).acquireTokenByRefreshToken(e)}throw t}}async acquireCachedToken(e){this.performanceClient?.addQueueMeasurement(fn.SilentFlowClientAcquireCachedToken,e.correlationId);let t=le;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Cr.isEmptyObj(e.claims))throw this.setCacheOutcome(de,e.correlationId),vt(tt);if(!e.account)throw vt(We);const r=e.account.tenantId||function(e){const t=new Ur(e).getUrlComponents(),r=t.PathSegments.slice(-1)[0]?.toLowerCase();switch(r){case w:case E:case k:return;default:return r}}(e.authority),n=this.cacheManager.getTokenKeys(),o=this.cacheManager.getAccessToken(e.account,e,n,r,this.performanceClient,e.correlationId);if(!o)throw this.setCacheOutcome(he,e.correlationId),vt(tt);if(_t(o.cachedAt)||At(o.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(pe,e.correlationId),vt(tt);o.refreshOn&&At(o.refreshOn,0)&&(t=ge);const i=e.authority||this.authority.getPreferredCache(),a={account:this.cacheManager.readAccountFromCache(e.account),accessToken:o,idToken:this.cacheManager.getIdToken(e.account,n,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(i)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await In(this.generateResultFromCacheRecord.bind(this),fn.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(a,e),t]}setCacheOutcome(e,t){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},t),e!==le&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){let r;if(this.performanceClient?.addQueueMeasurement(fn.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId),e.idToken&&(r=kt(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||0===t.maxAge){const e=r?.auth_time;if(!e)throw vt(Ue);St(e,t.maxAge)}return Wn.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}} /*! @azure/msal-common v14.15.0 2024-09-20 */const Zn={sendGetRequestAsync:()=>Promise.reject(vt(dt)),sendPostRequestAsync:()=>Promise.reject(vt(dt))}; /*! @azure/msal-common v14.15.0 2024-09-20 */ /*! @azure/msal-common v14.15.0 2024-09-20 */ const eo="|";function to(e){const{skus:t,libraryName:r,libraryVersion:n,extensionName:o,extensionVersion:i}=e,a=new Map([[0,[r,n]],[2,[o,i]]]);let s=[];if(t?.length){if(s=t.split(","),s.length<4)return t}else s=Array.from({length:4},(()=>eo));return a.forEach(((e,t)=>{2===e.length&&e[0]?.length&&e[1]?.length&&function(e){const{skuArr:t,index:r,skuName:n,skuVersion:o}=e;if(r>=t.length)return;t[r]=[n,o].join(eo)}({skuArr:s,index:t,skuName:e[0],skuVersion:e[1]})})),s.join(",")}class ro{constructor(e,r){this.cacheOutcome=le,this.cacheManager=r,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||t.EMPTY_STRING,this.wrapperVer=e.wrapperVer||t.EMPTY_STRING,this.telemetryCacheKey=j.CACHE_KEY+x.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${j.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r?.length&&t.push(`broker_error=${r}`);const n=t.join(j.VALUE_SEPARATOR),o=[e,this.getRegionDiscoveryFields()].join(j.VALUE_SEPARATOR);return[j.SCHEMA_VERSION,o,n].join(j.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=ro.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(j.VALUE_SEPARATOR),n=e.errors.slice(0,t).join(j.VALUE_SEPARATOR),o=e.errors.length,i=[o,t<o?j.OVERFLOW_TRUE:j.OVERFLOW_FALSE].join(j.VALUE_SEPARATOR);return[j.SCHEMA_VERSION,e.cacheHits,r,n,i].join(j.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=j.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Ie?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(j.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||{failedRequests:[],errors:[],cacheHits:0}}clearTelemetryCache(){const e=this.getLastRequests(),t=ro.maxErrorsToSend(e);if(t===e.errors.length)this.cacheManager.removeItem(this.telemetryCacheKey);else{const r={failedRequests:e.failedRequests.slice(2*t),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,r)}}static maxErrorsToSend(e){let r,n=0,o=0;const i=e.errors.length;for(r=0;r<i;r++){const i=e.failedRequests[2*r]||t.EMPTY_STRING,a=e.failedRequests[2*r+1]||t.EMPTY_STRING,s=e.errors[r]||t.EMPTY_STRING;if(o+=i.toString().length+a.toString().length+s.length+3,!(o<j.MAX_LAST_HEADER_BYTES))break;n+=1}return n}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||t.EMPTY_STRING),e.push(this.regionSource||t.EMPTY_STRING),e.push(this.regionOutcome||t.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return to(e)}} /*! @azure/msal-common v14.15.0 2024-09-20 */const no="missing_kid_error",oo="missing_alg_error",io={[no]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[oo]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class ao extends Ie{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,ao.prototype)}}function so(e){return new ao(e,io[e])} /*! @azure/msal-common v14.15.0 2024-09-20 */class co{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw so(no);if(!e.alg)throw so(oo);const t=new co({typ:e.typ||fe.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}} /*! @azure/msal-common v14.15.0 2024-09-20 */class uo{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class lo{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:vn,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new uo}}startPerformanceMeasurement(){return new uo}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}} /*! @azure/msal-common v14.15.0 2024-09-20 */function ho(e,t,r,n=5){if(e instanceof Error)return e instanceof Ie?(r.errorCode=e.errorCode,r.subErrorCode=e.subError,void((e instanceof rn||e instanceof Dn)&&(r.serverErrorNo=e.errorNo))):void(e instanceof Gr?r.errorCode=e.errorCode:r.errorStack?.length?t.trace("PerformanceClient.addErrorStack: Stack already exist",r.correlationId):e.stack?.length?(e.stack&&(r.errorStack=function(e,t){if(t<0)return[];const r=e.split("\r\n")||[];if(r.length<2)return[];const n=[];for(let e=Math.max(r.length-t-1,1);e<r.length;e++){const o=r[e];if(n.length>=t)break;n.push(po(o))}return n}(e.stack,n)),r.errorName=e.name):t.trace("PerformanceClient.addErrorStack: Input stack is empty",r.correlationId));t.trace("PerformanceClient.addErrorStack: Input error is not instance of Error",r.correlationId)}function po(e){const t=e.lastIndexOf(" ")+1;if(t<1)return e;const r=e.substring(t);let n=r.lastIndexOf("/");return n=n<0?r.lastIndexOf("\\"):n,n>=0?(e.substring(0,t)+"("+r.substring(n+1)+(")"===r.charAt(r.length-1)?"":")")).trimStart():e.trimStart()}class go{constructor(e,t,r,n,o,i,a,s){this.authority=t,this.libraryName=n,this.libraryVersion=o,this.applicationTelemetry=i,this.clientId=e,this.logger=r,this.callbacks=new Map,this.eventsByCorrelationId=new Map,this.eventStack=new Map,this.queueMeasurements=new Map,this.preQueueTimeByCorrelationId=new Map,this.intFields=a||new Set;for(const e of Cn)this.intFields.add(e);this.abbreviations=s||new Map;for(const[e,t]of mn)this.abbreviations.set(e,t)}startPerformanceMeasurement(e,t){return{}}getPreQueueTime(e,t){const r=this.preQueueTimeByCorrelationId.get(t);if(r){if(r.name===e)return r.time;this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue time found for ${e}, unable to add queue measurement`)}else this.logger.trace(`PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: ${t}, unable to add queue measurement`)}calculateQueuedTime(e,t){return e<1?(this.logger.trace(`PerformanceClient: preQueueTime should be a positive integer and not ${e}`),0):t<1?(this.logger.trace(`PerformanceClient: currentTime should be a positive integer and not ${t}`),0):t<e?(this.logger.trace("PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved"),0):t-e}addQueueMeasurement(e,t,r,n){if(!t)return void this.logger.trace(`PerformanceClient.addQueueMeasurement: correlationId not provided for ${e}, cannot add queue measurement`);if(0===r)this.logger.trace(`PerformanceClient.addQueueMeasurement: queue time provided for ${e} is ${r}`);else if(!r)return void this.logger.trace(`PerformanceClient.addQueueMeasurement: no queue time provided for ${e}`);const o={eventName:e,queueTime:n?0:r,manuallyCompleted:n},i=this.queueMeasurements.get(t);if(i)i.push(o),this.queueMeasurements.set(t,i);else{this.logger.trace(`PerformanceClient.addQueueMeasurement: adding correlationId ${t} to queue measurements`);const e=[o];this.queueMeasurements.set(t,e)}this.preQueueTimeByCorrelationId.delete(t)}startMeasurement(e,t){const r=t||this.generateId();t||this.logger.info(`PerformanceClient: No correlation id provided for ${e}, generating`,r),this.logger.trace(`PerformanceClient: Performance measurement started for ${e}`,r);const n={eventId:this.generateId(),status:vn,authority:this.authority,libraryName:this.libraryName,libraryVersion:this.libraryVersion,clientId:this.clientId,name:e,startTimeMs:Date.now(),correlationId:r,appName:this.applicationTelemetry?.appName,appVersion:this.applicationTelemetry?.appVersion};var o,i,a;return this.cacheEventByCorrelationId(n),o=n,i=this.abbreviations,(a=this.eventStack.get(r))&&a.push({name:i.get(o.name)||o.name}),{end:(e,t)=>this.endMeasurement({...n,...e},t),discard:()=>this.discardMeasurements(n.correlationId),add:e=>this.addFields(e,n.correlationId),increment:e=>this.incrementFields(e,n.correlationId),event:n,measurement:new uo}}endMeasurement(e,t){const r=this.eventsByCorrelationId.get(e.correlationId);if(!r)return this.logger.trace(`PerformanceClient: Measurement not found for ${e.eventId}`,e.correlationId),null;const n=e.eventId===r.eventId;let o={totalQueueTime:0,totalQueueCount:0,manuallyCompletedCount:0};e.durationMs=Math.round(e.durationMs||this.getDurationMs(e.startTimeMs));const i=JSON.stringify(function(e,t,r,n){if(!r?.length)return;const o=e=>e.length?e[e.length-1]:void 0,i=t.get(e.name)||e.name,a=o(r);if(a?.name!==i)return;const s=r?.pop();if(!s)return;const c=n instanceof Ie?n.errorCode:n instanceof Error?n.name:void 0,u=n instanceof Ie?n.subError:void 0;c&&s.childErr!==c&&(s.err=c,u&&(s.subErr=u)),delete s.name,delete s.childErr;const l={...s,dur:e.durationMs};e.success||(l.fail=1);const d=o(r);if(!d)return{[i]:l};let h;if(c&&(d.childErr=c),d[i]){const e=Object.keys(d).filter((e=>e.startsWith(i))).length;h=`${i}_${e+1}`}else h=i;return d[h]=l,d}(e,this.abbreviations,this.eventStack.get(r.correlationId),t));if(n?(o=this.getQueueInfo(e.correlationId),this.discardMeasurements(r.correlationId)):r.incompleteSubMeasurements?.delete(e.eventId),this.logger.trace(`PerformanceClient: Performance measurement ended for ${e.name}: ${e.durationMs} ms`,e.correlationId),!n)return r[e.name+"DurationMs"]=Math.floor(e.durationMs),{...r};t&&ho(t,this.logger,r);let a={...r,...e},s=0;return a.incompleteSubMeasurements?.forEach((t=>{this.logger.trace(`PerformanceClient: Incomplete submeasurement ${t.name} found for ${e.name}`,a.correlationId),s++})),a.incompleteSubMeasurements=void 0,a={...a,queuedTimeMs:o.totalQueueTime,queuedCount:o.totalQueueCount,queuedManuallyCompletedCount:o.manuallyCompletedCount,status:yn,incompleteSubsCount:s,context:i},this.truncateIntegralFields(a),this.emitEvents([a],e.correlationId),a}addFields(e,t){this.logger.trace("PerformanceClient: Updating static fields");const r=this.eventsByCorrelationId.get(t);r?this.eventsByCorrelationId.set(t,{...r,...e}):this.logger.trace("PerformanceClient: Event not found for",t)}incrementFields(e,t){this.logger.trace("PerformanceClient: Updating counters");const r=this.eventsByCorrelationId.get(t);if(r)for(const t in e){if(r.hasOwnProperty(t)){if(isNaN(Number(r[t])))return}else r[t]=0;r[t]+=e[t]}else this.logger.trace("PerformanceClient: Event not found for",t)}cacheEventByCorrelationId(e){const t=this.eventsByCorrelationId.get(e.correlationId);t?(this.logger.trace(`PerformanceClient: Performance measurement for ${e.name} added/updated`,e.correlationId),t.incompleteSubMeasurements=t.incompleteSubMeasurements||new Map,t.incompleteSubMeasurements.set(e.eventId,{name:e.name,startTimeMs:e.startTimeMs})):(this.logger.trace(`PerformanceClient: Performance measurement for ${e.name} started`,e.correlationId),this.eventsByCorrelationId.set(e.correlationId,{...e}),this.eventStack.set(e.correlationId,[]))}getQueueInfo(e){const t=this.queueMeasurements.get(e);t||this.logger.trace(`PerformanceClient: no queue measurements found for for correlationId: ${e}`);let r=0,n=0,o=0;return t?.forEach((e=>{r+=e.queueTime,n++,o+=e.manuallyCompleted?1:0})),{totalQueueTime:r,totalQueueCount:n,manuallyCompletedCount:o}}discardMeasurements(e){this.logger.trace("PerformanceClient: Performance measurements discarded",e),this.eventsByCorrelationId.delete(e),this.logger.trace("PerformanceClient: QueueMeasurements discarded",e),this.queueMeasurements.delete(e),this.logger.trace("PerformanceClient: Pre-queue times discarded",e),this.preQueueTimeByCorrelationId.delete(e),this.logger.trace("PerformanceClient: Event stack discarded",e),this.eventStack.delete(e)}addPerformanceCallback(e){for(const[t,r]of this.callbacks)if(r.toString()===e.toString())return this.logger.warning(`PerformanceClient: Performance callback is already registered with id: ${t}`),t;const t=this.generateId();return this.callbacks.set(t,e),this.logger.verbose(`PerformanceClient: Performance callback registered with id: ${t}`),t}removePerformanceCallback(e){const t=this.callbacks.delete(e);return t?this.logger.verbose(`PerformanceClient: Performance callback ${e} removed.`):this.logger.verbose(`PerformanceClient: Performance callback ${e} not removed.`),t}emitEvents(e,t){this.logger.verbose("PerformanceClient: Emitting performance events",t),this.callbacks.forEach(((r,n)=>{this.logger.trace(`PerformanceClient: Emitting event to callback ${n}`,t),r.apply(null,[e])}))}truncateIntegralFields(e){this.intFields.forEach((t=>{t in e&&"number"==typeof e[t]&&(e[t]=Math.floor(e[t]))}))}getDurationMs(e){const t=Date.now()-e;return t<0?t:0}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const fo="pkce_not_created",mo="crypto_nonexistent",vo="empty_navigate_uri",yo="hash_empty_error",Co="no_state_in_hash",To="hash_does_not_contain_known_properties",Io="unable_to_parse_state",wo="state_interaction_type_mismatch",Eo="interaction_in_progress",ko="popup_window_error",So="empty_window_error",bo="user_cancelled",Ao="monitor_popup_timeout",_o="monitor_window_timeout",Ro="redirect_in_iframe",Po="block_iframe_reload",Mo="block_nested_popups",No="iframe_closed_prematurely",Oo="silent_logout_unsupported",qo="no_account_error",Uo="silent_prompt_value_error",xo="no_token_request_cache_error",Lo="unable_to_parse_token_request_cache_error",Bo="no_cached_authority_error",Ho="auth_request_not_set_error",Do="invalid_cache_type",Fo="non_browser_environment",Ko="database_not_open",zo="no_network_connectivity",Go="post_request_failed",Qo="get_request_failed",jo="failed_to_parse_response",Wo="unable_to_load_token",Vo="crypto_key_not_found",Yo="auth_code_required",$o="auth_code_or_nativeAccountId_required",Jo="spa_code_and_nativeAccountId_present",Xo="database_unavailable",Zo="unable_to_acquire_token_from_native_platform",ei="native_handshake_timeout",ti="native_extension_not_installed",ri="native_connection_not_established",ni="uninitialized_public_client_application",oi="native_prompt_not_supported",ii="invalid_base64_string",ai="invalid_pop_token_request";var si=Object.freeze({__proto__:null,authCodeOrNativeAccountIdRequired:$o,authCodeRequired:Yo,authRequestNotSetError:Ho,blockIframeReload:Po,blockNestedPopups:Mo,cryptoKeyNotFound:Vo,cryptoNonExistent:mo,databaseNotOpen:Ko,databaseUnavailable:Xo,emptyNavigateUri:vo,emptyWindowError:So,failedToParseResponse:jo,getRequestFailed:Qo,hashDoesNotContainKnownProperties:To,hashEmptyError:yo,iframeClosedPrematurely:No,interactionInProgress:Eo,invalidBase64String:ii,invalidCacheType:Do,invalidPopTokenRequest:ai,monitorPopupTimeout:Ao,monitorWindowTimeout:_o,nativeConnectionNotEstablished:ri,nativeExtensionNotInstalled:ti,nativeHandshakeTimeout:ei,nativePromptNotSupported:oi,noAccountError:qo,noCachedAuthorityError:Bo,noNetworkConnectivity:zo,noStateInHash:Co,noTokenRequestCacheError:xo,nonBrowserEnvironment:Fo,pkceNotCreated:fo,popupWindowError:ko,postRequestFailed:Go,redirectInIframe:Ro,silentLogoutUnsupported:Oo,silentPromptValueError:Uo,spaCodeAndNativeAccountIdPresent:Jo,stateInteractionTypeMismatch:wo,unableToAcquireTokenFromNativePlatform:Zo,unableToLoadToken:Wo,unableToParseState:Io,unableToParseTokenRequestCacheError:Lo,uninitializedPublicClientApplication:ni,userCancelled:bo}); /*! @azure/msal-browser v3.26.0 2024-10-08 */const ci="For more visit: aka.ms/msaljs/browser-errors",ui={[fo]:"The PKCE code challenge and verifier could not be generated.",[mo]:"The crypto object or function is not available.",[vo]:"Navigation URI is empty. Please check stack trace for more info.",[yo]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${ci}`,[Co]:"Hash does not contain state. Please verify that the request originated from msal.",[To]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${ci}`,[Io]:"Unable to parse state. Please verify that the request originated from msal.",[wo]:"Hash contains state but the interaction type does not match the caller.",[Eo]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${ci}`,[ko]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[So]:"window.open returned null or undefined window object.",[bo]:"User cancelled the flow.",[Ao]:`Token acquisition in popup failed due to timeout. ${ci}`,[_o]:`Token acquisition in iframe failed due to timeout. ${ci}`,[Ro]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[Po]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${ci}`,[Mo]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[No]:"The iframe being monitored was closed prematurely.",[Oo]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[qo]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[Uo]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[xo]:"No token request found in cache.",[Lo]:"The cached token request could not be parsed.",[Bo]:"No cached authority found.",[Ho]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[Do]:"Invalid cache type",[Fo]:"Login and token requests are not supported in non-browser environments.",[Ko]:"Database is not open!",[zo]:"No network connectivity. Check your internet connection.",[Go]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[Qo]:"Network request failed. Please check the network trace to determine root cause.",[jo]:"Failed to parse network response. Check network trace.",[Wo]:"Error loading token to cache.",[Vo]:"Cryptographic Key or Keypair not found in browser storage.",[Yo]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[$o]:"An authorization code or nativeAccountId must be provided to this flow.",[Jo]:"Request cannot contain both spa code and native account id.",[Xo]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[Zo]:`Unable to acquire token from native platform. ${ci}`,[ei]:"Timed out while attempting to establish connection to browser extension",[ti]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[ri]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${ci}`,[ni]:`You must call and await the initialize function before attempting to call any other MSAL API. ${ci}`,[oi]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[ii]:"Invalid base64 encoded string.",[ai]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true."},li={pkceNotGenerated:{code:fo,desc:ui[fo]},cryptoDoesNotExist:{code:mo,desc:ui[mo]},emptyNavigateUriError:{code:vo,desc:ui[vo]},hashEmptyError:{code:yo,desc:ui[yo]},hashDoesNotContainStateError:{code:Co,desc:ui[Co]},hashDoesNotContainKnownPropertiesError:{code:To,desc:ui[To]},unableToParseStateError:{code:Io,desc:ui[Io]},stateInteractionTypeMismatchError:{code:wo,desc:ui[wo]},interactionInProgress:{code:Eo,desc:ui[Eo]},popupWindowError:{code:ko,desc:ui[ko]},emptyWindowError:{code:So,desc:ui[So]},userCancelledError:{code:bo,desc:ui[bo]},monitorPopupTimeoutError:{code:Ao,desc:ui[Ao]},monitorIframeTimeoutError:{code:_o,desc:ui[_o]},redirectInIframeError:{code:Ro,desc:ui[Ro]},blockTokenRequestsInHiddenIframeError:{code:Po,desc:ui[Po]},blockAcquireTokenInPopupsError:{code:Mo,desc:ui[Mo]},iframeClosedPrematurelyError:{code:No,desc:ui[No]},silentLogoutUnsupportedError:{code:Oo,desc:ui[Oo]},noAccountError:{code:qo,desc:ui[qo]},silentPromptValueError:{code:Uo,desc:ui[Uo]},noTokenRequestCacheError:{code:xo,desc:ui[xo]},unableToParseTokenRequestCacheError:{code:Lo,desc:ui[Lo]},noCachedAuthorityError:{code:Bo,desc:ui[Bo]},authRequestNotSet:{code:Ho,desc:ui[Ho]},invalidCacheType:{code:Do,desc:ui[Do]},notInBrowserEnvironment:{code:Fo,desc:ui[Fo]},databaseNotOpen:{code:Ko,desc:ui[Ko]},noNetworkConnectivity:{code:zo,desc:ui[zo]},postRequestFailed:{code:Go,desc:ui[Go]},getRequestFailed:{code:Qo,desc:ui[Qo]},failedToParseNetworkResponse:{code:jo,desc:ui[jo]},unableToLoadTokenError:{code:Wo,desc:ui[Wo]},signingKeyNotFoundInStorage:{code:Vo,desc:ui[Vo]},authCodeRequired:{code:Yo,desc:ui[Yo]},authCodeOrNativeAccountRequired:{code:$o,desc:ui[$o]},spaCodeAndNativeAccountPresent:{code:Jo,desc:ui[Jo]},databaseUnavailable:{code:Xo,desc:ui[Xo]},unableToAcquireTokenFromNativePlatform:{code:Zo,desc:ui[Zo]},nativeHandshakeTimeout:{code:ei,desc:ui[ei]},nativeExtensionNotInstalled:{code:ti,desc:ui[ti]},nativeConnectionNotEstablished:{code:ri,desc:ui[ri]},uninitializedPublicClientApplication:{code:ni,desc:ui[ni]},nativePromptNotSupported:{code:oi,desc:ui[oi]},invalidBase64StringError:{code:ii,desc:ui[ii]},invalidPopTokenRequest:{code:ai,desc:ui[ai]}};class di extends Ie{constructor(e){super(e,ui[e]),Object.setPrototypeOf(this,di.prototype),this.name="BrowserAuthError"}}function hi(e){return new di(e)} /*! @azure/msal-browser v3.26.0 2024-10-08 */const pi={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},gi="53ee284d-920a-4b59-9d30-a60315b26836",fi="ppnbnpeolgkicgegkbkbjmhlideopiji",mi="MATS",vi="Handshake",yi="HandshakeResponse",Ci="GetToken",Ti="Response",Ii={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},wi="GET",Ei="POST",ki="authority",Si="request.state",bi="nonce.id_token",Ai="request.origin",_i="urlHash",Ri="request.params",Pi="interaction.status",Mi="ccs.credential",Ni="request.correlationId",Oi="request.native",qi="msal.account.keys",Ui="msal.token.keys",xi="wrapper.sku",Li="wrapper.version",Bi={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var Hi;e.InteractionType=void 0,(Hi=e.InteractionType||(e.InteractionType={})).Redirect="redirect",Hi.Popup="popup",Hi.Silent="silent",Hi.None="none";const Di={Startup:"startup",Login:"login",Logout:"logout",AcquireToken:"acquireToken",SsoSilent:"ssoSilent",HandleRedirect:"handleRedirect",None:"none"},Fi={scopes:a},Ki="msal.db",zi=`${Ki}.keys`,Gi={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Qi=[Gi.Default,Gi.Skip,Gi.RefreshTokenAndNetwork]; /*! @azure/msal-browser v3.26.0 2024-10-08 */ function ji(e){return encodeURIComponent(Vi(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Wi(e){return Yi(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Vi(e){return Yi((new TextEncoder).encode(e))}function Yi(e){const t=Array.from(e,(e=>String.fromCodePoint(e))).join("");return btoa(t)} /*! @azure/msal-browser v3.26.0 2024-10-08 */const $i="SHA-256",Ji=new Uint8Array([1,0,1]),Xi="0123456789abcdef",Zi=new Uint32Array(1),ea={name:"RSASSA-PKCS1-v1_5",hash:$i,modulusLength:2048,publicExponent:Ji};async function ta(e,t,r){t?.addQueueMeasurement(fn.Sha256Digest,r);const n=(new TextEncoder).encode(e);return window.crypto.subtle.digest($i,n)}function ra(e){return window.crypto.getRandomValues(e)}function na(){return window.crypto.getRandomValues(Zi),Zi[0]}function oa(){const e=Date.now(),t=1024*na()+(1023&na()),r=new Uint8Array(16),n=Math.trunc(t/2**30),o=t&2**30-1,i=na();r[0]=e/2**40,r[1]=e/2**32,r[2]=e/2**24,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|n>>>8,r[7]=n,r[8]=128|o>>>24,r[9]=o>>>16,r[10]=o>>>8,r[11]=o,r[12]=i>>>24,r[13]=i>>>16,r[14]=i>>>8,r[15]=i;let a="";for(let e=0;e<r.length;e++)a+=Xi.charAt(r[e]>>>4),a+=Xi.charAt(15&r[e]),3!==e&&5!==e&&7!==e&&9!==e||(a+="-");return a}async function ia(e){return window.crypto.subtle.exportKey("jwk",e)}async function aa(e){const t=await ta(e);return Wi(new Uint8Array(t))} /*! @azure/msal-browser v3.26.0 2024-10-08 */const sa="storage_not_supported",ca="stubbed_public_client_application_called",ua="in_mem_redirect_unavailable";var la=Object.freeze({__proto__:null,inMemRedirectUnavailable:ua,storageNotSupported:sa,stubbedPublicClientApplicationCalled:ca}); /*! @azure/msal-browser v3.26.0 2024-10-08 */const da={[sa]:"Given storage configuration option was not supported.",[ca]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[ua]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."},ha={storageNotSupportedError:{code:sa,desc:da[sa]},stubPcaInstanceCalled:{code:ca,desc:da[ca]},inMemRedirectUnavailable:{code:ua,desc:da[ua]}};class pa extends Ie{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,pa.prototype)}}function ga(e){return new pa(e,da[e])} /*! @azure/msal-browser v3.26.0 2024-10-08 */function fa(e){e.location.hash="","function"==typeof e.history.replaceState&&e.history.replaceState(null,"",`${e.location.origin}${e.location.pathname}${e.location.search}`)}function ma(e){const t=e.split("#");t.shift(),window.location.hash=t.length>0?t.join("#"):""}function va(){return window.parent!==window}function ya(){return"undefined"!=typeof window&&!!window.opener&&window.opener!==window&&"string"==typeof window.name&&0===window.name.indexOf(`${pi.POPUP_NAME_PREFIX}.`)}function Ca(){return window.location.href.split("?")[0].split("#")[0]}function Ta(){const e=new Ur(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function Ia(){if(Ur.hashContainsKnownProperties(window.location.hash)&&va())throw hi(Po)}function wa(e){if(va()&&!e)throw hi(Ro)}function Ea(){if(ya())throw hi(Mo)}function ka(){if("undefined"==typeof window)throw hi(Fo)}function Sa(e){if(!e)throw hi(ni)}function ba(e){ka(),Ia(),Ea(),Sa(e)}function Aa(e,t){if(ba(e),wa(t.system.allowRedirectInIframe),t.cache.cacheLocation===Ii.MemoryStorage&&!t.cache.storeAuthStateInCookie)throw ga(ua)}function _a(e){const t=document.createElement("link");t.rel="preconnect",t.href=new URL(e).origin,t.crossOrigin="anonymous",document.head.appendChild(t),window.setTimeout((()=>{try{document.head.removeChild(t)}catch{}}),1e4)}function Ra(){return oa()}var Pa=Object.freeze({__proto__:null,blockAPICallsBeforeInitialize:Sa,blockAcquireTokenInPopups:Ea,blockNonBrowserEnvironment:ka,blockRedirectInIframe:wa,blockReloadInHiddenIframes:Ia,clearHash:fa,createGuid:Ra,getCurrentUri:Ca,getHomepage:Ta,invoke:Tn,invokeAsync:In,isInIframe:va,isInPopup:ya,preconnect:_a,preflightCheck:ba,redirectPreflightCheck:Aa,replaceHash:ma}); /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ma{navigateInternal(e,t){return Ma.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Ma.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise((e=>{setTimeout((()=>{e(!0)}),t.timeout)}))}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Na{async sendGetRequestAsync(e,t){let r;try{r=await fetch(e,{method:wi,headers:this.getFetchHeaders(t)})}catch(e){throw window.navigator.onLine?hi(Qo):hi(zo)}try{return{headers:this.getHeaderDict(r.headers),body:await r.json(),status:r.status}}catch(e){throw hi(jo)}}async sendPostRequestAsync(e,r){const n=r&&r.body||t.EMPTY_STRING;let o;try{o=await fetch(e,{method:Ei,headers:this.getFetchHeaders(r),body:n})}catch(e){throw window.navigator.onLine?hi(Go):hi(zo)}try{return{headers:this.getHeaderDict(o.headers),body:await o.json(),status:o.status}}catch(e){throw hi(jo)}}getFetchHeaders(e){const t=new Headers;if(!e||!e.headers)return t;const r=e.headers;return Object.keys(r).forEach((e=>{t.append(e,r[e])})),t}getHeaderDict(e){const t={};return e.forEach(((e,r)=>{t[r]=e})),t}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const Oa=1e4; /*! @azure/msal-browser v3.26.0 2024-10-08 */ const qa="@azure/msal-browser",Ua="3.26.0"; /*! @azure/msal-browser v3.26.0 2024-10-08 */ class xa{static loggerCallback(t,r){switch(t){case e.LogLevel.Error:return void console.error(r);case e.LogLevel.Info:return void console.info(r);case e.LogLevel.Verbose:return void console.debug(r);case e.LogLevel.Warning:return void console.warn(r);default:return void console.log(r)}}constructor(r){let n;this.browserEnvironment="undefined"!=typeof window,this.config=function({auth:r,cache:n,system:o,telemetry:i},a){const s={clientId:t.EMPTY_STRING,authority:`${t.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:t.EMPTY_STRING,authorityMetadata:t.EMPTY_STRING,redirectUri:t.EMPTY_STRING,postLogoutRedirectUri:t.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Mr.AAD,OIDCOptions:{serverResponseType:R.FRAGMENT,defaultScopes:[t.OPENID_SCOPE,t.PROFILE_SCOPE,t.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:Et.None,tenant:t.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:Ii.SessionStorage,temporaryCacheLocation:Ii.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!(!n||n.cacheLocation!==Ii.LocalStorage),claimsBasedCachingEnabled:!1},u={loggerCallback:()=>{},logLevel:e.LogLevel.Info,piiLoggingEnabled:!1},l={...{...Wr,loggerOptions:u,networkClient:a?new Na:Zn,navigationClient:new Ma,loadFrameTimeout:0,windowHashTimeout:o?.loadFrameTimeout||6e4,iframeHashTimeout:o?.loadFrameTimeout||Oa,navigateFrameWait:0,redirectNavigationTimeout:3e4,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:o?.nativeBrokerHandshakeTimeout||2e3,pollIntervalMilliseconds:pi.DEFAULT_POLL_INTERVAL_MS},...o,loggerOptions:o?.loggerOptions||u},d={application:{appName:t.EMPTY_STRING,appVersion:t.EMPTY_STRING},client:new lo};r?.protocolMode!==Mr.OIDC&&r?.OIDCOptions&&new Tt(l.loggerOptions).warning(JSON.stringify(yr(dr)));if(r?.protocolMode&&r.protocolMode!==Mr.AAD&&l?.allowNativeBroker)throw yr(hr);return{auth:{...s,...r,OIDCOptions:{...s.OIDCOptions,...r?.OIDCOptions}},cache:{...c,...n},system:l,telemetry:{...d,...i}}}(r,this.browserEnvironment);try{n=window[Ii.SessionStorage]}catch(e){}const o=n?.getItem("msal.browser.log.level"),i=n?.getItem("msal.browser.log.pii")?.toLowerCase(),a="true"===i||"false"!==i&&void 0,s={...this.config.system.loggerOptions},c=o&&Object.keys(e.LogLevel).includes(o)?e.LogLevel[o]:void 0;c&&(s.loggerCallback=xa.loggerCallback,s.logLevel=c),void 0!==a&&(s.piiLoggingEnabled=a),this.logger=new Tt(s,qa,Ua),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const La="USER_INTERACTION_REQUIRED",Ba="USER_CANCEL",Ha="NO_NETWORK",Da="TRANSIENT_ERROR",Fa="PERSISTENT_ERROR",Ka="DISABLED",za="ACCOUNT_UNAVAILABLE",Ga="NESTED_APP_AUTH_UNAVAILABLE"; /*! @azure/msal-browser v3.26.0 2024-10-08 */class Qa{static async initializeNestedAppAuthBridge(){if(void 0===window)throw new Error("window is undefined");if(void 0===window.nestedAppAuthBridge)throw new Error("window.nestedAppAuthBridge is undefined");try{window.nestedAppAuthBridge.addEventListener("message",(e=>{const t="string"==typeof e?e:e.data,r=JSON.parse(t),n=Qa.bridgeRequests.find((e=>e.requestId===r.requestId));void 0!==n&&(Qa.bridgeRequests.splice(Qa.bridgeRequests.indexOf(n),1),r.success?n.resolve(r):n.reject(r.error))}));const e=await new Promise(((e,t)=>{const r=Qa.buildRequest("GetInitContext"),n={requestId:r.requestId,method:r.method,resolve:e,reject:t};Qa.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}));return Qa.validateBridgeResultOrThrow(e.initContext)}catch(e){throw window.console.log(e),e}}getTokenInteractive(e){return this.getToken("GetTokenPopup",e)}getTokenSilent(e){return this.getToken("GetToken",e)}async getToken(e,t){const r=await this.sendRequest(e,{tokenParams:t});return{token:Qa.validateBridgeResultOrThrow(r.token),account:Qa.validateBridgeResultOrThrow(r.account)}}getHostCapabilities(){return this.capabilities??null}getAccountContext(){return this.accountContext?this.accountContext:null}static buildRequest(e,t){return{messageType:"NestedAppAuthRequest",method:e,requestId:oa(),sendTime:Date.now(),clientLibrary:pi.MSAL_SKU,clientLibraryVersion:Ua,...t}}sendRequest(e,t){const r=Qa.buildRequest(e,t);return new Promise(((e,t)=>{const n={requestId:r.requestId,method:r.method,resolve:e,reject:t};Qa.bridgeRequests.push(n),window.nestedAppAuthBridge.postMessage(JSON.stringify(r))}))}static validateBridgeResultOrThrow(e){if(void 0===e){throw{status:Ga}}return e}constructor(e,t,r,n){this.sdkName=e,this.sdkVersion=t,this.accountContext=r,this.capabilities=n}static async create(){const e=await Qa.initializeNestedAppAuthBridge();return new Qa(e.sdkName,e.sdkVersion,e.accountContext,e.capabilities)}}Qa.bridgeRequests=[]; /*! @azure/msal-browser v3.26.0 2024-10-08 */ class ja extends xa{constructor(){super(...arguments),this.bridgeProxy=void 0,this.accountContext=null}getModuleName(){return ja.MODULE_NAME}getId(){return ja.ID}getBridgeProxy(){return this.bridgeProxy}async initialize(){try{if("undefined"!=typeof window){"function"==typeof window.__initializeNestedAppAuth&&await window.__initializeNestedAppAuth();const e=await Qa.create();this.accountContext=e.getAccountContext(),this.bridgeProxy=e,this.available=void 0!==e}}catch(e){this.logger.infoPii(`Could not initialize Nested App Auth bridge (${e})`)}return this.logger.info(`Nested App Auth Bridge available: ${this.available}`),this.available}}ja.MODULE_NAME="",ja.ID="NestedAppOperatingContext"; /*! @azure/msal-browser v3.26.0 2024-10-08 */ class Wa extends xa{getModuleName(){return Wa.MODULE_NAME}getId(){return Wa.ID}async initialize(){return this.available="undefined"!=typeof window,this.available}} /*! @azure/msal-browser v3.26.0 2024-10-08 */ function Va(e){return(new TextDecoder).decode(function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw hi(ii)}const r=atob(t);return Uint8Array.from(r,(e=>e.codePointAt(0)||0))} /*! @azure/msal-browser v3.26.0 2024-10-08 */(e))}Wa.MODULE_NAME="",Wa.ID="StandardOperatingContext";class Ya{constructor(){this.dbName=Ki,this.version=1,this.tableName=zi,this.dbOpen=!1}async open(){return new Promise(((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",(e=>{e.target.result.createObjectStore(this.tableName)})),r.addEventListener("success",(t=>{const r=t;this.db=r.target.result,this.dbOpen=!0,e()})),r.addEventListener("error",(()=>t(hi(Xo))))}))}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(hi(Ko));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async setItem(e,t){return await this.validateDbIsOpen(),new Promise(((r,n)=>{if(!this.db)return n(hi(Ko));const o=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);o.addEventListener("success",(()=>{this.closeConnection(),r()})),o.addEventListener("error",(e=>{this.closeConnection(),n(e)}))}))}async removeItem(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(hi(Ko));const n=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);n.addEventListener("success",(()=>{this.closeConnection(),t()})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async getKeys(){return await this.validateDbIsOpen(),new Promise(((e,t)=>{if(!this.db)return t(hi(Ko));const r=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();r.addEventListener("success",(t=>{const r=t;this.closeConnection(),e(r.target.result)})),r.addEventListener("error",(e=>{this.closeConnection(),t(e)}))}))}async containsKey(e){return await this.validateDbIsOpen(),new Promise(((t,r)=>{if(!this.db)return r(hi(Ko));const n=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);n.addEventListener("success",(e=>{const r=e;this.closeConnection(),t(1===r.target.result)})),n.addEventListener("error",(e=>{this.closeConnection(),r(e)}))}))}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise(((e,t)=>{const r=window.indexedDB.deleteDatabase(Ki),n=setTimeout((()=>t(!1)),200);r.addEventListener("success",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("blocked",(()=>(clearTimeout(n),e(!0)))),r.addEventListener("error",(()=>(clearTimeout(n),t(!1))))}))}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class $a{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach(((t,r)=>{e.push(r)})),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ja{constructor(e){this.inMemoryCache=new $a,this.indexedDBCache=new Ya,this.logger=e}handleDatabaseAccessError(e){if(!(e instanceof di&&e.errorCode===Xo))throw e;this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.")}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(e){this.handleDatabaseAccessError(e)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(e){this.handleDatabaseAccessError(e)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(e){this.handleDatabaseAccessError(e)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(0===e.length)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(e){this.handleDatabaseAccessError(e)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(e){this.handleDatabaseAccessError(e)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Xa{constructor(e,t){this.logger=e,function(e){if(!("crypto"in window))throw e.error("BrowserCrypto: crypto interface is unavailable"),hi(mo);e.verbose("BrowserCrypto: modern crypto interface available")}(e),this.cache=new Ja(this.logger),this.performanceClient=t}createNewGuid(){return oa()}base64Encode(e){return Vi(e)}base64Decode(e){return Va(e)}base64UrlEncode(e){return ji(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const t=this.performanceClient?.startMeasurement(fn.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await async function(e,t){return window.crypto.subtle.generateKey(ea,e,t)}(Xa.EXTRACTABLE,Xa.POP_KEY_USAGES),n=await ia(r.publicKey),o=Za({e:n.e,kty:n.kty,n:n.n}),i=await this.hashString(o),a=await ia(r.privateKey),s=await async function(e,t,r){return window.crypto.subtle.importKey("jwk",e,ea,t,r)}(a,!1,["sign"]);return await this.cache.setItem(i,{privateKey:s,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),i}async removeTokenBindingKey(e){await this.cache.removeItem(e);return!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,n){const o=this.performanceClient?.startMeasurement(fn.CryptoOptsSignJwt,n),i=await this.cache.getItem(t);if(!i)throw hi(Vo);const a=await ia(i.publicKey),s=Za(a),c=ji(JSON.stringify({kid:t})),u=ji(co.getShrHeaderString({...r?.header,alg:a.alg,kid:c}));e.cnf={jwk:JSON.parse(s)};const l=`${u}.${ji(JSON.stringify(e))}`,d=(new TextEncoder).encode(l),h=await async function(e,t){return window.crypto.subtle.sign(ea,e,t)}(i.privateKey,d),p=`${l}.${Wi(new Uint8Array(h))}`;return o&&o.end({success:!0}),p}async hashString(e){return aa(e)}}function Za(e){return JSON.stringify(e,Object.keys(e).sort())} /*! @azure/msal-browser v3.26.0 2024-10-08 */Xa.POP_KEY_USAGES=["sign","verify"],Xa.EXTRACTABLE=!0;class es{constructor(e){this.validateWindowStorage(e),this.windowStorage=window[e]}validateWindowStorage(e){if(e!==Ii.LocalStorage&&e!==Ii.SessionStorage||!window[e])throw ga(sa)}getItem(e){return this.windowStorage.getItem(e)}setItem(e,t){this.windowStorage.setItem(e,t)}removeItem(e){this.windowStorage.removeItem(e)}getKeys(){return Object.keys(this.windowStorage)}containsKey(e){return this.windowStorage.hasOwnProperty(e)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */function ts(e,t){if(!t)return null;try{return zn.parseRequestState(e,t).libraryState.meta}catch(e){throw vt(Me)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class rs extends Qr{constructor(e,t,r,n,o,i){super(e,r,n,o),this.COOKIE_LIFE_MULTIPLIER=864e5,this.cacheConfig=t,this.logger=n,this.internalStorage=new $a,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation,this.cacheConfig.cacheLocation),t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=i}setupBrowserStorage(e){switch(e){case Ii.LocalStorage:case Ii.SessionStorage:try{return new es(e)}catch(e){this.logger.verbose(e);break}}return this.cacheConfig.cacheLocation=Ii.MemoryStorage,new $a}setupTemporaryCacheStorage(e,t){switch(t){case Ii.LocalStorage:case Ii.SessionStorage:try{return new es(e||Ii.SessionStorage)}catch(e){return this.logger.verbose(e),this.internalStorage}default:return this.internalStorage}}migrateCacheEntries(){const e=`${t.CACHE_PREFIX}.${f}`,r=`${t.CACHE_PREFIX}.${m}`,n=`${t.CACHE_PREFIX}.${y}`,o=`${t.CACHE_PREFIX}.${C}`,i=[this.browserStorage.getItem(e),this.browserStorage.getItem(r),this.browserStorage.getItem(n),this.browserStorage.getItem(o)];[f,m,y,C].forEach(((e,t)=>{const r=i[t];r&&this.setTemporaryCache(e,r,!0)}))}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(qi),t=this.getItem(`${Ui}.${this.clientId}`);if(e&&t)return void this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");this.browserStorage.getKeys().forEach((e=>{if(this.isCredentialKey(e)){const t=this.getItem(e);if(t){const r=this.validateAndParseJson(t);if(r&&r.hasOwnProperty("credentialType"))switch(r.credentialType){case L.ID_TOKEN:if(Ut(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,L.ID_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${e}`);break;case L.ACCESS_TOKEN:case L.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(qt(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,L.ACCESS_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${e}`);break;case L.REFRESH_TOKEN:if(xt(r)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${e} found, saving key to token key map`);const t=r,n=this.updateCredentialCacheKey(e,t);return void this.addTokenKey(n,L.REFRESH_TOKEN)}this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${e}`)}}}if(this.isAccountKey(e)){const t=this.getItem(e);if(t){const r=this.validateAndParseJson(t);r&&Nr.isAccountEntity(r)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${e} found, saving key to account key map`),this.addAccountKeyToMap(e))}}}))}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&"object"==typeof t?t:null}catch(e){return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return r&&Nr.isAccountEntity(r)?Qr.toObject(new Nr,r):(this.removeAccountKeyFromMap(e),null)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(qi);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();-1===t.indexOf(e)?(t.push(e),this.setItem(qi,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(qi,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,L.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,L.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,L.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Ui}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case L.ID_TOKEN:-1===r.idToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case L.ACCESS_TOKEN:-1===r.accessToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case L.REFRESH_TOKEN:-1===r.refreshToken.indexOf(e)&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),vt(Xe)}this.setItem(`${Ui}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case L.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const n=r.idToken.indexOf(e);n>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(n,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case L.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const o=r.accessToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case L.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const i=r.refreshToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),vt(Xe)}this.setItem(`${Ui}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.ID_TOKEN),null;const r=this.validateAndParseJson(t);return r&&Ut(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.ID_TOKEN),null)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=Rt(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,L.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return r&&qt(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.ACCESS_TOKEN),null)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=Rt(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,L.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return r&&xt(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,L.REFRESH_TOKEN),null)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=Rt(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,L.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&(n=e,(o=r)&&0===n.indexOf(B)&&o.hasOwnProperty("clientId")&&o.hasOwnProperty("environment"))?(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r):(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null);var n,o}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=function({environment:e,clientId:t}){return[B,e,t].join(x.CACHE_KEY_SEPARATOR).toLowerCase()}(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){const r=0===e.indexOf(j.CACHE_KEY);let n=!0;return t&&(n=t.hasOwnProperty("failedRequests")&&t.hasOwnProperty("errors")&&t.hasOwnProperty("cacheHits")),r&&n}(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r):(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){return!!t&&0===e.indexOf(D)&&t.hasOwnProperty("aliases")&&t.hasOwnProperty("preferred_cache")&&t.hasOwnProperty("preferred_network")&&t.hasOwnProperty("canonical_authority")&&t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("aliasesFromNetwork")&&t.hasOwnProperty("endpointsFromNetwork")&&t.hasOwnProperty("expiresAt")&&t.hasOwnProperty("jwks_uri")}(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter((e=>this.isAuthorityMetadata(e)))}setWrapperMetadata(e,t){this.internalStorage.setItem(xi,e),this.internalStorage.setItem(Li,t)}getWrapperMetadata(){return[this.internalStorage.getItem(xi)||t.EMPTY_STRING,this.internalStorage.getItem(Li)||t.EMPTY_STRING]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(I),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const e=this.generateCacheKey(T),t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const r=this.getAccountInfoFilteredBy({localAccountId:t});return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(r),r):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(I),r=this.generateCacheKey(T);if(e){this.logger.verbose("setActiveAccount: Active account set");const n={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(n)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&function(e,t){let r=!1;e&&(r=0===e.indexOf($));let n=!0;return t&&(n=t.hasOwnProperty("throttleTime")),r&&n}(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r):(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const e=this.getItemCookie(r);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),e}const n=this.temporaryCacheStorage.getItem(r);if(!n){if(this.cacheConfig.cacheLocation===Ii.LocalStorage){const e=this.browserStorage.getItem(r);if(e)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),e}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),n}setTemporaryCache(e,t,r){const n=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(n,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.setItemCookie(n,t))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.clearItemCookie(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach((e=>{-1===e.indexOf(t.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.removeTemporaryItem(e)})),this.browserStorage.getKeys().forEach((e=>{-1===e.indexOf(t.CACHE_PREFIX)&&-1===e.indexOf(this.clientId)||this.browserStorage.removeItem(e)})),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(fn.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),n=[];r.accessToken.forEach((e=>{const t=this.getAccessTokenCredential(e);t?.requestedClaimsHash&&e.includes(t.requestedClaimsHash.toLowerCase())&&n.push(this.removeAccessToken(e))})),await Promise.all(n),n.length>0&&this.logger.warning(`${n.length} access tokens with claims in the cache keys have been removed from the cache.`)}setItemCookie(e,t,r){let n=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){n+=`expires=${this.getCookieExpirationTime(r)};`}this.cacheConfig.secureCookies&&(n+="Secure;"),document.cookie=n}getItemCookie(e){const r=`${encodeURIComponent(e)}=`,n=document.cookie.split(";");for(let e=0;e<n.length;e++){let t=n[e];for(;" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(r))return decodeURIComponent(t.substring(r.length,t.length))}return t.EMPTY_STRING}clearMsalCookies(){const e=`${t.CACHE_PREFIX}.${this.clientId}`;document.cookie.split(";").forEach((t=>{for(;" "===t.charAt(0);)t=t.substring(1);if(0===t.indexOf(e)){const e=t.split("=")[0];this.clearItemCookie(e)}}))}clearItemCookie(e){this.setItemCookie(e,t.EMPTY_STRING,-1)}getCookieExpirationTime(e){const t=new Date;return new Date(t.getTime()+e*this.COOKIE_LIFE_MULTIPLIER).toUTCString()}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Cr.startsWith(e,t.CACHE_PREFIX)||Cr.startsWith(e,v)?e:`${t.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=zn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ki}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=zn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${bi}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=zn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Si}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const n=this.generateAuthorityKey(r);return this.getTemporaryCache(n)}updateCacheEntries(e,t,r,n,o){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const i=this.generateStateKey(e);this.setTemporaryCache(i,e,!1);const a=this.generateNonceKey(e);this.setTemporaryCache(a,t,!1);const s=this.generateAuthorityKey(e);if(this.setTemporaryCache(s,r,!1),o){const e={credential:o.homeAccountId,type:an};this.setTemporaryCache(Mi,JSON.stringify(e),!0)}else if(n){const e={credential:n,type:sn};this.setTemporaryCache(Mi,JSON.stringify(e),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach((t=>{-1!==t.indexOf(e)&&this.removeTemporaryItem(t)})),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Ri)),this.removeTemporaryItem(this.generateCacheKey(Ai)),this.removeTemporaryItem(this.generateCacheKey(_i)),this.removeTemporaryItem(this.generateCacheKey(Ni)),this.removeTemporaryItem(this.generateCacheKey(Mi)),this.removeTemporaryItem(this.generateCacheKey(Oi)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const r=this.generateStateKey(e),n=this.temporaryCacheStorage.getItem(r);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${n}`),this.resetRequestCache(n||t.EMPTY_STRING)}this.clearMsalCookies()}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach((t=>{if(-1===t.indexOf(Si))return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const n=ts(this.cryptoImpl,r);n&&n.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))})),this.clearMsalCookies(),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Vi(JSON.stringify(e));this.setTemporaryCache(Ri,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ri,!0);if(!t)throw hi(xo);let r;try{r=JSON.parse(Va(t))}catch(e){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${e}`),hi(Lo)}if(this.removeTemporaryItem(this.generateCacheKey(Ri)),!r.authority){const t=this.generateAuthorityKey(e),n=this.getTemporaryCache(t);if(!n)throw hi(Bo);r.authority=n}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Oi,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${t.CACHE_PREFIX}.${Pi}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const r=`${t.CACHE_PREFIX}.${Pi}`;if(e){if(this.getInteractionInProgress())throw hi(Eo);this.setTemporaryCache(r,this.clientId,!1)}else e||this.getInteractionInProgress()!==this.clientId||this.removeTemporaryItem(r)}getLegacyLoginHint(){const e=this.getTemporaryCache(v);e&&(this.browserStorage.removeItem(v),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(f,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(f)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const e=kt(r,Va);if(e.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),e.preferred_username;if(e.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),e.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=Rt(t);if(e!==r){const n=this.getItem(e);if(n)return this.browserStorage.removeItem(e),this.setItem(r,n),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){const r=Pt(e.account?.homeAccountId,e.account?.environment,e.idToken,this.clientId,e.tenantId);let n;t.claims&&(n=await this.cryptoImpl.hashString(t.claims));const o={idToken:r,accessToken:Mt(e.account?.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Va,void 0,e.tokenType,void 0,t.sshKid,t.claims,n)};return this.saveCacheRecord(o)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(e){if(e instanceof Gr&&this.performanceClient&&r)try{const e=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:e.refreshToken.length,cacheIdCount:e.idToken.length,cacheAtCount:e.accessToken.length},r)}catch(e){}throw e}}}const ns=(e,t)=>new rs(e,{cacheLocation:Ii.MemoryStorage,temporaryCacheLocation:Ii.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1},yt,t); /*! @azure/msal-browser v3.26.0 2024-10-08 */function os(e,t,r,n){return e.verbose("getAllAccounts called"),r?t.getAllAccounts(n):[]}function is(e,t,r){if(t.trace("getAccount called"),0===Object.keys(e).length)return t.warning("getAccount: No accountFilter provided"),null;const n=r.getAccountInfoFilteredBy(e);return n?(t.verbose("getAccount: Account matching provided filter found, returning"),n):(t.verbose("getAccount: No matching account found, returning null"),null)}function as(e,t,r){if(t.trace("getAccountByUsername called"),!e)return t.warning("getAccountByUsername: No username provided"),null;const n=r.getAccountInfoFilteredBy({username:e});return n?(t.verbose("getAccountByUsername: Account matching username found, returning"),t.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${e}`),n):(t.verbose("getAccountByUsername: No matching account found, returning null"),null)}function ss(e,t,r){if(t.trace("getAccountByHomeId called"),!e)return t.warning("getAccountByHomeId: No homeAccountId provided"),null;const n=r.getAccountInfoFilteredBy({homeAccountId:e});return n?(t.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),t.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${e}`),n):(t.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function cs(e,t,r){if(t.trace("getAccountByLocalId called"),!e)return t.warning("getAccountByLocalId: No localAccountId provided"),null;const n=r.getAccountInfoFilteredBy({localAccountId:e});return n?(t.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),t.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${e}`),n):(t.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function us(e,t){t.setActiveAccount(e)}function ls(e){return e.getActiveAccount()} /*! @azure/msal-browser v3.26.0 2024-10-08 */const ds={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"}; /*! @azure/msal-browser v3.26.0 2024-10-08 */class hs{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Tt({})}addEventCallback(e,t,r){if("undefined"!=typeof window){const n=r||Ra();return this.eventCallbacks.has(n)?(this.logger.error(`Event callback with id: ${n} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(n,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${n}`),n)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,n){if("undefined"!=typeof window){const o={eventType:e,interactionType:t||null,payload:r||null,error:n||null,timestamp:Date.now()};this.eventCallbacks.forEach((([t,r],n)=>{(0===r.length||r.includes(e))&&(this.logger.verbose(`Emitting event to callback ${n}: ${e}`),t.apply(null,[o]))}))}}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class ps{constructor(e,t,r,n,o,i,a,s,c){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=o,this.navigationClient=i,this.nativeMessageHandler=s,this.correlationId=c||oa(),this.logger=n.clone(pi.MSAL_SKU,Ua,this.correlationId),this.performanceClient=a}async clearCacheOnLogout(e){if(e){Nr.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Nr.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch(e){this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch(e){this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri||Ca();return Ur.getAbsoluteUrl(t,Ca())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new ro(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(fn.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const n={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},o=e.requestAuthority||this.config.auth.authority,i=r?.length?"true"===r:this.config.auth.instanceAware,a=t&&i?this.config.auth.authority.replace(Ur.getDomainFromUrl(o),t.environment):o,s=En.generateAuthority(a,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),c=await In(bn,fn.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(s,this.config.system.networkClient,this.browserStorage,n,this.logger,this.correlationId,this.performanceClient);if(t&&!c.isAlias(t.environment))throw yr(pr);return c}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const gs=32;async function fs(e,t,r){e.addQueueMeasurement(fn.GeneratePkceCodes,r);const n=Tn(ms,fn.GenerateCodeVerifier,t,e,r)(e,t,r);return{verifier:n,challenge:await In(vs,fn.GenerateCodeChallengeFromVerifier,t,e,r)(n,e,t,r)}}function ms(e,t,r){try{const n=new Uint8Array(gs);Tn(ra,fn.GetRandomValues,t,e,r)(n);return Wi(n)}catch(e){throw hi(fo)}}async function vs(e,t,r,n){t.addQueueMeasurement(fn.GenerateCodeChallengeFromVerifier,n);try{const o=await In(ta,fn.Sha256Digest,r,t,n)(e,t,n);return Wi(new Uint8Array(o))}catch(e){throw hi(fo)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */async function ys(e,t,r,n){r.addQueueMeasurement(fn.InitializeBaseRequest,e.correlationId);const o=e.authority||t.auth.authority,i=[...e&&e.scopes||[]],a={...e,correlationId:e.correlationId,authority:o,scopes:i};if(a.authenticationScheme){if(a.authenticationScheme===W.SSH){if(!e.sshJwk)throw yr(sr);if(!e.sshKid)throw yr(cr)}n.verbose(`Authentication Scheme set to "${a.authenticationScheme}" as configured in Auth request`)}else a.authenticationScheme=W.BEARER,n.verbose('Authentication Scheme wasn\'t explicitly set in request, defaulting to "Bearer" request');return t.cache.claimsBasedCachingEnabled&&e.claims&&!Cr.isEmptyObj(e.claims)&&(a.requestedClaimsHash=await aa(e.claims)),a}async function Cs(e,t,r,n,o){n.addQueueMeasurement(fn.InitializeSilentRequest,e.correlationId);const i=await In(ys,fn.InitializeBaseRequest,o,n,e.correlationId)(e,r,n,o);return{...e,...i,account:t,forceRefresh:e.forceRefresh||!1}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ts extends ps{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(fn.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const r=await In(fs,fn.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),n={...e,redirectUri:e.redirectUri,code:t.EMPTY_STRING,codeVerifier:r.verifier};return e.codeChallenge=r.challenge,e.codeChallengeMethod=t.S256_CODE_CHALLENGE_METHOD,n}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e?.correlationId);const t={correlationId:this.correlationId||oa(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return e&&null===e.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId):e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=Ur.getAbsoluteUrl(e.postLogoutRedirectUri,Ca())):null===this.config.auth.postLogoutRedirectUri?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=Ur.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Ca())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=Ur.getAbsoluteUrl(Ca(),Ca())),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(fn.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await In(this.getClientConfiguration.bind(this),fn.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new $n(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:r,requestAuthority:n,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:a}=e;this.performanceClient.addQueueMeasurement(fn.StandardInteractionClientGetClientConfiguration,this.correlationId);const s=await In(this.getDiscoveredAuthority.bind(this),fn.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:n,requestAzureCloudOptions:o,requestExtraQueryParameters:i,account:a}),c=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:s,clientCapabilities:this.config.auth.clientCapabilities},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:c.loggerCallback,piiLoggingEnabled:c.piiLoggingEnabled,logLevel:c.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:r,libraryInfo:{sku:pi.MSAL_SKU,version:Ua,cpu:t.EMPTY_STRING,os:t.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,r){this.performanceClient.addQueueMeasurement(fn.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const n=this.getRedirectUri(e.redirectUri),o={interactionType:r},i=zn.setRequestState(this.browserCrypto,e&&e.state||t.EMPTY_STRING,o),a={...await In(ys,fn.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:n,state:i,nonce:e.nonce||oa(),responseMode:this.config.auth.OIDCOptions.serverResponseType},s=e.account||this.browserStorage.getActiveAccount();if(s&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${s.homeAccountId}`,this.correlationId),a.account=s),!a.loginHint&&!s){const e=this.browserStorage.getLegacyLoginHint();e&&(a.loginHint=e)}return a}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const Is="user_switch",ws={[Is]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Es extends Ie{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Es.prototype),this.name="NativeAuthError",this.ext=r}}function ks(e){return!(!e.ext||!e.ext.status||"PERSISTENT_ERROR"!==e.ext.status&&"DISABLED"!==e.ext.status)||(!(!e.ext||!e.ext.error||-2147186943!==e.ext.error)||"ContentError"===e.errorCode)}function Ss(e,t,r){if(r&&r.status)switch(r.status){case"ACCOUNT_UNAVAILABLE":return Kn(Rn);case"USER_INTERACTION_REQUIRED":return new Dn(e,t);case"USER_CANCEL":return hi(bo);case"NO_NETWORK":return hi(zo)}return new Es(e,ws[e]||t,r)} /*! @azure/msal-browser v3.26.0 2024-10-08 */class bs extends Ts{async acquireToken(e){this.performanceClient.addQueueMeasurement(fn.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(Bi.acquireTokenSilent_silentFlow),r=await In(this.getClientConfiguration.bind(this),fn.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),n=new Xn(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const t=(await In(n.acquireCachedToken.bind(n),fn.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),t}catch(e){throw e instanceof di&&e.errorCode===Vo&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),e}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t?.account)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const As="brk_client_id",_s="brk_redirect_uri";class Rs extends ps{constructor(e,t,r,n,o,i,a,s,c,u,l,d){super(e,t,r,n,o,i,s,c,d),this.apiId=a,this.accountId=u,this.nativeMessageHandler=c,this.nativeStorageManager=l,this.silentCacheClient=new bs(e,this.nativeStorageManager,r,n,o,i,s,c,d),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const h=this.nativeMessageHandler.getExtensionId()===fi?"chrome":this.nativeMessageHandler.getExtensionId()?.length?"unknown":void 0;this.skus=ro.makeExtraSkuString({libraryName:pi.MSAL_SKU,libraryVersion:Ua,extensionName:h,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,"x-client-xtra-sku":this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(fn.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(fn.NativeInteractionClientAcquireToken,e.correlationId),r=bt();try{const n=await this.initializeNativeRequest(e);try{const e=await this.acquireTokensFromCache(this.accountId,n);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),e}catch(e){this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...o}=n,i={method:Ci,request:o},a=await this.nativeMessageHandler.sendMessage(i),s=this.validateNativeResponse(a);return await this.handleNativeResponse(s,n,r).then((e=>(t.end({success:!0,isNativeBroker:!0,requestId:e.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),e))).catch((e=>{throw t.end({success:!1,errorCode:e.errorCode,subErrorCode:e.subError,isNativeBroker:!0}),e}))}catch(e){throw e instanceof Es&&this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),e}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Tr.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),vt($e);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw vt($e);try{const e=this.createSilentCacheRequest(t,r),n=await this.silentCacheClient.acquireToken(e),o={...r,idTokenClaims:n?.idTokenClaims,idToken:n?.idToken};return{...n,account:o}}catch(e){throw e}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const n=await this.initializeNativeRequest(r),o={method:Ci,request:n};try{const e=await this.nativeMessageHandler.sendMessage(o);this.validateNativeResponse(e)}catch(e){if(e instanceof Es&&(this.serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode),ks(e)))throw e}this.browserStorage.setTemporaryCache(Oi,JSON.stringify(n),!0);const i={apiId:Bi.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},a=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(a,i)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&e?.addFields({errorCode:"no_cached_request"},t),null;const{prompt:n,...o}=r;n&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Oi));const i={method:Ci,request:o},a=bt();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const e=await this.nativeMessageHandler.sendMessage(i);this.validateNativeResponse(e);const t=this.handleNativeResponse(e,o,a);this.browserStorage.setInteractionInProgress(!1);const r=await t;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),r}catch(e){throw this.browserStorage.setInteractionInProgress(!1),e}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const n=kt(e.id_token,Va),o=this.createHomeAccountIdentifier(e,n),i=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId})?.homeAccountId;if(o!==i&&e.account.id!==t.accountId)throw Ss(Is);const a=await this.getDiscoveredAuthority({requestAuthority:t.authority}),s=Vn(this.browserStorage,a,o,Va,n,e.client_info,void 0,n.tid,void 0,e.account.id,this.logger),c=await this.generateAuthenticationResult(e,t,n,s,a.canonicalAuthority,r);return this.cacheAccount(s),this.cacheNativeTokens(e,t,o,n,e.access_token,c.tenantId,r),c}createHomeAccountIdentifier(e,r){return Nr.generateHomeAccountId(e.client_info||t.EMPTY_STRING,br,this.logger,this.browserCrypto,r)}generateScopes(e,t){return e.scope?Tr.fromString(e.scope):Tr.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===W.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Qn(this.browserCrypto),n={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw vt(st);return r.signPopToken(e.access_token,t.keyId,n)}return e.access_token}async generateAuthenticationResult(e,r,n,o,i,a){const s=this.addTelemetryFromNativeResponse(e),c=e.scope?Tr.fromString(e.scope):Tr.fromString(r.scope),u=e.account.properties||{},l=u.UID||n.oid||n.sub||t.EMPTY_STRING,d=u.TenantId||n.tid||t.EMPTY_STRING,h=Sr(o.getAccountInfo(),void 0,n,e.id_token);h.nativeAccountId!==e.account.id&&(h.nativeAccountId=e.account.id);const p=await this.generatePopAccessToken(e,r),g=r.tokenType===W.POP?W.POP:W.BEARER;return{authority:i,uniqueId:l,tenantId:d,scopes:c.asArray(),account:h,idToken:e.id_token,idTokenClaims:n,accessToken:p,fromCache:!!s&&this.isResponseFromCache(s),expiresOn:new Date(1e3*Number(a+e.expires_in)),tokenType:g,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch((e=>{this.logger.error(`Error occurred while removing account context from browser storage. ${e}`)}))}cacheNativeTokens(e,r,n,o,i,a,s){const c=Pt(n,r.authority,e.id_token||"",r.clientId,o.tid||""),u=s+(r.tokenType===W.POP?t.SHR_NONCE_VALIDITY:("string"==typeof e.expires_in?parseInt(e.expires_in,10):e.expires_in)||0),l=this.generateScopes(e,r),d={idToken:c,accessToken:Mt(n,r.authority,i,r.clientId,o.tid||a,l.printScopes(),u,0,Va,void 0,r.tokenType,void 0,r.keyId)};this.nativeStorageManager.saveCacheRecord(d,r.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw we(me,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch(e){this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return void 0===e.is_cached?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new Ur(t);r.validateAsUri();const{scopes:n,...o}=e,i=new Tr(n||[]);i.appendScopes(a);const s={...o,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:i.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:(()=>{switch(this.apiId){case Bi.ssoSilent:case Bi.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),A.NONE}if(e.prompt)switch(e.prompt){case A.NONE:case A.CONSENT:case A.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),hi(oi)}else this.logger.trace("initializeNativeRequest: prompt was not provided")})(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(s.signPopToken&&e.popKid)throw hi(ai);if(this.handleExtraBrokerParams(s),s.extraParameters=s.extraParameters||{},s.extraParameters.telemetry=mi,e.authenticationScheme===W.POP){const t={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},r=new Qn(this.browserCrypto);let n;if(s.keyId)n=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:s.keyId})),s.signPopToken=!1;else{const o=await In(r.generateCnf.bind(r),fn.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(t,this.logger);n=o.reqCnfString,s.keyId=o.kid,s.signPopToken=!0}s.reqCnf=n}return this.addRequestSKUs(s),s}handleExtraBrokerParams(e){if(e.extraParameters&&e.extraParameters.hasOwnProperty(As)&&e.extraParameters.hasOwnProperty(_s)&&e.extraParameters.hasOwnProperty(cn)){const t=e.extraParameters[cn],r=e.redirectUri,n=e.extraParameters[_s];e.extraParameters={child_client_id:t,child_redirect_uri:r},e.redirectUri=n}}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ps{constructor(e,t,r,n){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=n,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(fn.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:gi,extensionId:this.extensionId,responseId:oa(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise(((e,r)=>{this.resolvers.set(t.responseId,{resolve:e,reject:r})}))}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const n=new Ps(e,t,r,fi);return await n.sendHandshakeRequest(),n}catch(n){const o=new Ps(e,t,r);return await o.sendHandshakeRequest(),o}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:gi,extensionId:this.extensionId,responseId:oa(),body:{method:vi}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=e=>{this.onChannelMessage(e)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise(((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout((()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(hi(ei)),this.handshakeResolvers.delete(e.responseId)}),this.handshakeTimeoutMs)}))}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(t.channel&&t.channel===gi&&(!t.extensionId||t.extensionId===this.extensionId)&&t.body.method===vi){const e=this.handshakeResolvers.get(t.responseId);if(!e)return void this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),e.reject(hi(ti))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),n=this.handshakeResolvers.get(t.responseId);try{const e=t.body.method;if(e===Ti){if(!r)return;const e=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(e)}`),"Success"!==e.status)r.reject(Ss(e.code,e.description,e.ext));else{if(!e.result)throw we(me,"Event does not contain result.");e.result.code&&e.result.description?r.reject(Ss(e.result.code,e.result.description,e.result.ext)):r.resolve(e.result)}this.resolvers.delete(t.responseId)}else if(e===yi){if(!n)return void this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),n.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(t){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${t}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(t):n&&n.reject(t)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,n){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(n)switch(n){case W.BEARER:case W.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ms{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async handleCodeResponse(e,t){let r;this.performanceClient.addQueueMeasurement(fn.HandleCodeResponse,t.correlationId);try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(e){throw e instanceof rn&&e.subError===bo?hi(bo):e}return In(this.handleCodeResponseFromServer.bind(this),fn.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(fn.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await In(this.authModule.updateAuthority.bind(this.authModule),fn.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const e=this.createCcsCredentials(t);e&&(this.authCodeRequest.ccsCredential=e)}return await In(this.authModule.acquireToken.bind(this.authModule),fn.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:an}:e.loginHint?{credential:e.loginHint,type:sn}:null}} /*! @azure/msal-browser v3.26.0 2024-10-08 */function Ns(e,t,r){const n=qr(e);if(!n)throw Or(e)?(r.error(`A ${t} is present in the iframe but it does not contain known properties. It's likely that the ${t} has been replaced by code running on the redirectUri page.`),r.errorPii(`The ${t} detected is: ${e}`),hi(To)):(r.error(`The request has returned to the redirectUri but a ${t} is not present. It's likely that the ${t} has been removed or the page has been redirected by code running on the redirectUri page.`),hi(yo));return n} /*! @azure/msal-browser v3.26.0 2024-10-08 */ class Os extends Ts{constructor(e,t,r,n,o,i,a,s,c,u){super(e,t,r,n,o,i,a,c,u),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=s}acquireToken(e){try{const t={popupName:this.generatePopupName(e.scopes||a,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,t)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),t.popup=this.openSizedPopup("about:blank",t),this.acquireTokenPopupAsync(e,t))}catch(e){return Promise.reject(e)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},n=e&&e.authority,o=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,n,o)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,n,o))}catch(e){return Promise.reject(e)}}async acquireTokenPopupAsync(t,r){this.logger.verbose("acquireTokenPopupAsync called");const n=this.initializeServerTelemetryManager(Bi.acquireTokenPopup),o=await In(this.initializeAuthorizationRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Popup);_a(o.authority);try{const i=await In(this.initializeAuthorizationCodeRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),a=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),s=Ps.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme);let c;s&&(c=this.performanceClient.startMeasurement(fn.FetchAccountIdWithNativeBroker,t.correlationId));const u=await a.getAuthCodeUrl({...o,nativeBroker:s}),l=new Ms(a,this.browserStorage,i,this.logger,this.performanceClient),d=this.initiateAuthRequest(u,r);this.eventHandler.emitEvent(ds.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:d},null);const h=await this.monitorPopupForHash(d,r.popupWindowParent),p=Tn(Ns,fn.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(nn.removeThrottle(this.browserStorage,this.config.auth.clientId,i),p.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),c&&c.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw hi(ri);const e=new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,p.accountId,this.nativeStorage,o.correlationId),{userRequestState:t}=zn.parseRequestState(this.browserCrypto,o.state);return await e.acquireToken({...o,state:t,prompt:void 0})}return await l.handleCodeResponse(p,o)}catch(e){throw r.popup?.close(),e instanceof Ie&&(e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e)),e}}async logoutPopupAsync(t,r,n,o){this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(ds.LOGOUT_START,e.InteractionType.Popup,t);const i=this.initializeServerTelemetryManager(Bi.logoutPopup);try{await this.clearCacheOnLogout(t.account);const a=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:i,requestAuthority:n,account:t.account||void 0});try{a.authority.endSessionEndpoint}catch{if(t.account?.homeAccountId&&t.postLogoutRedirectUri&&a.authority.protocolMode===Mr.OIDC){if(this.browserStorage.removeAccount(t.account?.homeAccountId),this.eventHandler.emitEvent(ds.LOGOUT_SUCCESS,e.InteractionType.Popup,t),o){const e={apiId:Bi.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=Ur.getAbsoluteUrl(o,Ca());await this.navigationClient.navigateInternal(t,e)}return void r.popup?.close()}}const s=a.getLogoutUri(t);this.eventHandler.emitEvent(ds.LOGOUT_SUCCESS,e.InteractionType.Popup,t);const c=this.openPopup(s,r);if(this.eventHandler.emitEvent(ds.POPUP_OPENED,e.InteractionType.Popup,{popupWindow:c},null),await this.monitorPopupForHash(c,r.popupWindowParent).catch((()=>{})),o){const e={apiId:Bi.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},t=Ur.getAbsoluteUrl(o,Ca());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${t}`),await this.navigationClient.navigateInternal(t,e)}else this.logger.verbose("No main window navigation requested")}catch(t){throw r.popup?.close(),t instanceof Ie&&(t.setCorrelationId(this.correlationId),i.cacheFailedRequest(t)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(ds.LOGOUT_FAILURE,e.InteractionType.Popup,null,t),this.eventHandler.emitEvent(ds.LOGOUT_END,e.InteractionType.Popup),t}this.eventHandler.emitEvent(ds.LOGOUT_END,e.InteractionType.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),hi(vo)}monitorPopupForHash(e,t){return new Promise(((t,r)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const n=setInterval((()=>{if(e.closed)return this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(n),void r(hi(bo));let o="";try{o=e.location.href}catch(e){}if(!o||"about:blank"===o)return;clearInterval(n);let i="";const a=this.config.auth.OIDCOptions.serverResponseType;e&&(i=a===R.QUERY?e.location.search:e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),t(i)}),this.config.system.pollIntervalMilliseconds)})).finally((()=>{this.cleanPopup(e,t)}))}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):void 0===t.popup&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw hi(So);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(e){throw this.logger.error("error opening popup "+e.message),this.browserStorage.setInteractionInProgress(!1),hi(ko)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:n}){const o=n.screenLeft?n.screenLeft:n.screenX,i=n.screenTop?n.screenTop:n.screenY,a=n.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,s=n.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let c=r.popupSize?.width,u=r.popupSize?.height,l=r.popupPosition?.top,d=r.popupPosition?.left;return(!c||c<0||c>a)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),c=pi.POPUP_WIDTH),(!u||u<0||u>s)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),u=pi.POPUP_HEIGHT),(!l||l<0||l>s)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),l=Math.max(0,s/2-pi.POPUP_HEIGHT/2+i)),(!d||d<0||d>a)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),d=Math.max(0,a/2-pi.POPUP_WIDTH/2+o)),n.open(e,t,`width=${c}, height=${u}, top=${l}, left=${d}, scrollbars=yes`)}unloadWindow(t){this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Popup),this.currentWindow&&this.currentWindow.close(),t.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${pi.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${pi.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class qs{constructor(e,t,r,n,o){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=n,this.performanceClient=o}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ai,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ni,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:Bi.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if("function"==typeof t.onRedirectNavigate){this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback");return!1!==t.onRedirectNavigate(e)?(this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),void await t.navigationClient.navigateExternal(e,r)):void this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation")}return this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),void await t.navigationClient.navigateExternal(e,r)}throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),hi(vo)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),n=this.browserStorage.getTemporaryCache(r);if(!n)throw vt(Oe,"Cached State");let o;try{o=this.authModule.handleFragmentResponse(e,n)}catch(e){throw e instanceof rn&&e.subError===bo?hi(bo):e}const i=this.browserStorage.generateNonceKey(n),a=this.browserStorage.getTemporaryCache(i);if(this.authCodeRequest.code=o.code,o.cloud_instance_host_name&&await In(this.authModule.updateAuthority.bind(this.authModule),fn.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(o.cloud_instance_host_name,this.authCodeRequest.correlationId),o.nonce=a||void 0,o.state=n,o.client_info)this.authCodeRequest.clientInfo=o.client_info;else{const e=this.checkCcsCredentials();e&&(this.authCodeRequest.ccsCredential=e)}const s=await this.authModule.acquireToken(this.authCodeRequest,o);return this.browserStorage.cleanRequestByState(t),s}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Mi,!0);if(e)try{return JSON.parse(e)}catch(t){this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Us extends Ts{constructor(e,t,r,n,o,i,a,s,c,u){super(e,t,r,n,o,i,a,c,u),this.nativeStorage=s}async acquireToken(t){const r=await In(this.initializeAuthorizationRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(t,e.InteractionType.Redirect);this.browserStorage.updateCacheEntries(r.state,r.nonce,r.authority,r.loginHint||"",r.account||null);const n=this.initializeServerTelemetryManager(Bi.acquireTokenRedirect),o=t=>{t.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(r.state),this.eventHandler.emitEvent(ds.RESTORE_FROM_BFCACHE,e.InteractionType.Redirect))};try{const e=await In(this.initializeAuthorizationCodeRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(r),i=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),a=new qs(i,this.browserStorage,e,this.logger,this.performanceClient),s=await i.getAuthCodeUrl({...r,nativeBroker:Ps.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=this.getRedirectStartPage(t.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${c}`),window.addEventListener("pageshow",o),await a.initiateAuthRequest(s,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:c,onRedirectNavigate:t.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(e){throw e instanceof Ie&&(e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(r.state),e}}async handleRedirectPromise(r="",n){const o=this.initializeServerTelemetryManager(Bi.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[i,a]=this.getRedirectResponse(r||"");if(!i)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),"back_forward"!==function(){if("undefined"==typeof window||void 0===window.performance||"function"!=typeof window.performance.getEntriesByType)return;const e=window.performance.getEntriesByType("navigation"),t=e.length?e[0]:void 0;return t?.type}()?n.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const s=this.browserStorage.getTemporaryCache(Ai,!0)||t.EMPTY_STRING,c=Ur.removeHashFromUrl(s);if(c===Ur.removeHashFromUrl(window.location.href)&&this.config.auth.navigateToLoginRequestUrl){this.logger.verbose("Current page is loginRequestUrl, handling response"),s.indexOf("#")>-1&&ma(s);return await this.handleResponse(i,o)}if(!this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(i,o);if(!va()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(_i,a,!0);const e={apiId:Bi.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let t=!0;if(s&&"null"!==s)this.logger.verbose(`Navigating to loginRequestUrl: ${s}`),t=await this.navigationClient.navigateInternal(s,e);else{const r=Ta();this.browserStorage.setTemporaryCache(Ai,r,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),t=await this.navigationClient.navigateInternal(r,e)}if(!t)return await this.handleResponse(i,o)}return null}catch(t){throw t instanceof Ie&&(t.setCorrelationId(this.correlationId),o.cacheFailedRequest(t)),this.browserStorage.cleanRequestByInteractionType(e.InteractionType.Redirect),t}}getRedirectResponse(t){this.logger.verbose("getRedirectResponseHash called");let r=t;r||(r=this.config.auth.OIDCOptions.serverResponseType===R.QUERY?window.location.search:window.location.hash);let n=qr(r);if(n){try{!function(e,t,r){if(!e.state)throw hi(Co);const n=ts(t,e.state);if(!n)throw hi(Io);if(n.interactionType!==r)throw hi(wo)}(n,this.browserCrypto,e.InteractionType.Redirect)}catch(e){return e instanceof Ie&&this.logger.error(`Interaction type validation failed due to ${e.errorCode}: ${e.errorMessage}`),[null,""]}return fa(window),this.logger.verbose("Hash contains known properties, returning response hash"),[n,r]}const o=this.browserStorage.getTemporaryCache(_i,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(_i)),o&&(n=qr(o),n)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[n,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw hi(Co);const n=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw hi(ri);const t=new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,n.correlationId),{userRequestState:o}=zn.parseRequestState(this.browserCrypto,r);return t.acquireToken({...n,state:o,prompt:void 0}).finally((()=>{this.browserStorage.cleanRequestByState(r)}))}const o=this.browserStorage.getCachedAuthority(r);if(!o)throw hi(Bo);const i=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:o});nn.removeThrottle(this.browserStorage,this.config.auth.clientId,n);return new qs(i,this.browserStorage,n,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(t){this.logger.verbose("logoutRedirect called");const r=this.initializeLogoutRequest(t),n=this.initializeServerTelemetryManager(Bi.logout);try{this.eventHandler.emitEvent(ds.LOGOUT_START,e.InteractionType.Redirect,t),await this.clearCacheOnLogout(r.account);const o={apiId:Bi.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},i=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t&&t.authority,requestExtraQueryParameters:t?.extraQueryParameters,account:t&&t.account||void 0});if(i.authority.protocolMode===Mr.OIDC)try{i.authority.endSessionEndpoint}catch{if(r.account?.homeAccountId)return this.browserStorage.removeAccount(r.account?.homeAccountId),void this.eventHandler.emitEvent(ds.LOGOUT_SUCCESS,e.InteractionType.Redirect,r)}const a=i.getLogoutUri(r);if(this.eventHandler.emitEvent(ds.LOGOUT_SUCCESS,e.InteractionType.Redirect,r),!t||"function"!=typeof t.onRedirectNavigate)return this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(a,o);if(!1!==t.onRedirectNavigate(a))return this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),void await this.navigationClient.navigateExternal(a,o);this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation")}catch(t){throw t instanceof Ie&&(t.setCorrelationId(this.correlationId),n.cacheFailedRequest(t)),this.eventHandler.emitEvent(ds.LOGOUT_FAILURE,e.InteractionType.Redirect,null,t),this.eventHandler.emitEvent(ds.LOGOUT_END,e.InteractionType.Redirect),t}this.eventHandler.emitEvent(ds.LOGOUT_END,e.InteractionType.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return Ur.getAbsoluteUrl(t,Ca())}} /*! @azure/msal-browser v3.26.0 2024-10-08 */async function xs(e,t,r,n,o){if(t.addQueueMeasurement(fn.SilentHandlerInitiateAuthRequest,n),!e)throw r.info("Navigate url is empty"),hi(vo);return o?In(Bs,fn.SilentHandlerLoadFrame,r,t,n)(e,o,t,n):Tn(Hs,fn.SilentHandlerLoadFrameSync,r,t,n)(e)}async function Ls(e,t,r,n,o,i,a){return n.addQueueMeasurement(fn.SilentHandlerMonitorIframeForHash,i),new Promise(((n,i)=>{t<Oa&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${t}ms) than the default (10000ms). This may result in timeouts.`);const s=window.setTimeout((()=>{window.clearInterval(c),i(hi(_o))}),t),c=window.setInterval((()=>{let t="";const r=e.contentWindow;try{t=r?r.location.href:""}catch(e){}if(!t||"about:blank"===t)return;let o="";r&&(o=a===R.QUERY?r.location.search:r.location.hash),window.clearTimeout(s),window.clearInterval(c),n(o)}),r)})).finally((()=>{Tn(Fs,fn.RemoveHiddenIframe,o,n,i)(e)}))}function Bs(e,t,r,n){return r.addQueueMeasurement(fn.SilentHandlerLoadFrame,n),new Promise(((r,n)=>{const o=Ds();window.setTimeout((()=>{o?(o.src=e,r(o)):n("Unable to load iframe")}),t)}))}function Hs(e){const t=Ds();return t.src=e,t}function Ds(){const e=document.createElement("iframe");return e.className="msalSilentIframe",e.style.visibility="hidden",e.style.position="absolute",e.style.width=e.style.height="0",e.style.border="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(e),e}function Fs(e){document.body===e.parentNode&&document.body.removeChild(e)} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Ks extends Ts{constructor(e,t,r,n,o,i,a,s,c,u,l){super(e,t,r,n,o,i,s,u,l),this.apiId=a,this.nativeStorage=c}async acquireToken(t){this.performanceClient.addQueueMeasurement(fn.SilentIframeClientAcquireToken,t.correlationId),t.loginHint||t.sid||t.account&&t.account.username||this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const r={...t};r.prompt?r.prompt!==A.NONE&&r.prompt!==A.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${r.prompt} with ${A.NONE}`),r.prompt=A.NONE):r.prompt=A.NONE;const n=await In(this.initializeAuthorizationRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,t.correlationId)(r,e.InteractionType.Silent);_a(n.authority);const o=this.initializeServerTelemetryManager(this.apiId);let i;try{return i=await In(this.createAuthCodeClient.bind(this),fn.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,t.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),await In(this.silentTokenHelper.bind(this),fn.SilentIframeClientTokenHelper,this.logger,this.performanceClient,t.correlationId)(i,n)}catch(n){if(n instanceof Ie&&(n.setCorrelationId(this.correlationId),o.cacheFailedRequest(n)),!(i&&n instanceof Ie&&n.errorCode===pi.INVALID_GRANT_ERROR))throw n;this.performanceClient.addFields({retryError:n.errorCode},this.correlationId);const a=await In(this.initializeAuthorizationRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,t.correlationId)(r,e.InteractionType.Silent);return await In(this.silentTokenHelper.bind(this),fn.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(i,a)}}logout(){return Promise.reject(hi(Oo))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(fn.SilentIframeClientTokenHelper,r);const n=await In(this.initializeAuthorizationCodeRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),o=await In(e.getAuthCodeUrl.bind(e),fn.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Ps.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),i=new Ms(e,this.browserStorage,n,this.logger,this.performanceClient),a=await In(xs,fn.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(o,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),s=this.config.auth.OIDCOptions.serverResponseType,c=await In(Ls,fn.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(a,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,s),u=Tn(Ns,fn.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(c,s,this.logger);if(u.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw hi(ri);const e=new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,u.accountId,this.browserStorage,r),{userRequestState:n}=zn.parseRequestState(this.browserCrypto,t.state);return In(e.acquireToken.bind(e),fn.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:n,prompt:t.prompt||A.NONE})}return In(i.handleCodeResponse.bind(i),fn.HandleCodeResponse,this.logger,this.performanceClient,r)(u,t)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class zs extends Ts{async acquireToken(e){this.performanceClient.addQueueMeasurement(fn.SilentRefreshClientAcquireToken,e.correlationId);const t=await In(ys,fn.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const n=this.initializeServerTelemetryManager(Bi.acquireTokenSilent_silentFlow),o=await this.createRefreshTokenClient({serverTelemetryManager:n,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return In(o.acquireTokenByRefreshToken.bind(o),fn.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch((e=>{throw e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e),e}))}logout(){return Promise.reject(hi(Oo))}async createRefreshTokenClient(e){const t=await In(this.getClientConfiguration.bind(this),fn.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new Jn(t,this.performanceClient)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Gs{constructor(e,t,r,n){this.isBrowserEnvironment="undefined"!=typeof window,this.config=e,this.storage=t,this.logger=r,this.cryptoObj=n}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw hi(Fo);const n=t.id_token?kt(t.id_token,Va):void 0,o={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},i=e.authority?new En(En.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,o,this.logger,e.correlationId||oa()):void 0,a=this.loadAccount(e,r.clientInfo||t.client_info||"",n,i),s=this.loadIdToken(t,a.homeAccountId,a.environment,a.realm),c=this.loadAccessToken(e,t,a.homeAccountId,a.environment,a.realm,r),u=this.loadRefreshToken(t,a.homeAccountId,a.environment);return this.generateAuthenticationResult(e,{account:a,idToken:s,accessToken:c,refreshToken:u},n,i)}loadAccount(e,t,r,n){if(this.logger.verbose("TokenCache - loading account"),e.account){const t=Nr.createFromAccountInfo(e.account);return this.storage.setAccount(t),t}if(!n||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),hi(Wo);const o=Nr.generateHomeAccountId(t,n.authorityType,this.logger,this.cryptoObj,r),i=r?.tid,a=Vn(this.storage,n,o,Va,r,t,n.hostnameAndPort,i,void 0,void 0,this.logger);return this.storage.setAccount(a),a}loadIdToken(e,t,r,n){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const o=Pt(t,r,e.id_token,this.config.auth.clientId,n);return this.storage.setIdTokenCredential(o),o}loadAccessToken(e,t,r,n,o,i){if(!t.access_token)return this.logger.verbose("TokenCache - no access token found in response"),null;if(!t.expires_in)return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;if(!(t.scope||e.scopes&&e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null;this.logger.verbose("TokenCache - loading access token");const a=t.scope?Tr.fromString(t.scope):new Tr(e.scopes),s=i.expiresOn||t.expires_in+(new Date).getTime()/1e3,c=i.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+(new Date).getTime()/1e3,u=Mt(r,n,t.access_token,this.config.auth.clientId,o,a.printScopes(),s,c,Va);return this.storage.setAccessTokenCredential(u),u}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const n=Nt(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(n),n}generateAuthenticationResult(e,t,r,n){let o,i="",a=[],s=null;t?.accessToken&&(i=t.accessToken.secret,a=Tr.fromString(t.accessToken.target).asArray(),s=new Date(1e3*Number(t.accessToken.expiresOn)),o=new Date(1e3*Number(t.accessToken.extendedExpiresOn)));const c=t.account;return{authority:n?n.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:a,account:c.getAccountInfo(),idToken:t.idToken?.secret||"",idTokenClaims:r||{},accessToken:i,fromCache:!0,expiresOn:s,correlationId:e.correlationId||"",requestId:"",extExpiresOn:o,familyId:t.refreshToken?.familyId||"",tokenType:t?.accessToken?.tokenType||"",state:e.state||"",cloudGraphHostName:c.cloudGraphHostName||"",msGraphHost:c.msGraphHost||"",fromNativeBroker:!1}}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Qs extends $n{constructor(e){super(e),this.includeRedirectUri=!1}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class js extends Ts{constructor(e,t,r,n,o,i,a,s,c,u){super(e,t,r,n,o,i,s,c,u),this.apiId=a}async acquireToken(t){if(!t.code)throw hi(Yo);const r=await In(this.initializeAuthorizationRequest.bind(this),fn.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,t.correlationId)(t,e.InteractionType.Silent),n=this.initializeServerTelemetryManager(this.apiId);try{const e={...r,code:t.code},o=await In(this.getClientConfiguration.bind(this),fn.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,t.correlationId)({serverTelemetryManager:n,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),i=new Qs(o);this.logger.verbose("Auth code client created");const a=new Ms(i,this.browserStorage,e,this.logger,this.performanceClient);return await In(a.handleCodeResponseFromServer.bind(a),fn.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)({code:t.code,msgraph_host:t.msGraphHost,cloud_graph_host_name:t.cloudGraphHostName,cloud_instance_host_name:t.cloudInstanceHostName},r,!1)}catch(e){throw e instanceof Ie&&(e.setCorrelationId(this.correlationId),n.cacheFailedRequest(e)),e}}logout(){return Promise.reject(hi(Oo))}} /*! @azure/msal-browser v3.26.0 2024-10-08 */function Ws(e){const t=e?.idTokenClaims;return t?.tfp||t?.acr?"B2C":t?.tid?"9188040d-6c67-4c5b-b112-36a304b66dad"===t?.tid?"MSA":"AAD":void 0}function Vs(e,t){try{ba(e)}catch(e){throw t.end({success:!1},e),e}}class Ys{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Xa(this.logger,this.performanceClient):yt,this.eventHandler=new hs(this.logger),this.browserStorage=this.isBrowserEnvironment?new rs(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,Sn(this.config.auth),this.performanceClient):ns(this.config.auth.clientId,this.logger);const t={cacheLocation:Ii.MemoryStorage,temporaryCacheLocation:Ii.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new rs(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new Gs(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new Ys(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized)return void this.logger.info("initialize has already been called, exiting early.");if(!this.isBrowserEnvironment)return this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,void this.eventHandler.emitEvent(ds.INITIALIZE_END);const t=e?.correlationId||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,n=this.performanceClient.startMeasurement(fn.InitializeClientApplication,t);if(this.eventHandler.emitEvent(ds.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Ps.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(e){this.logger.verbose(e)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await In(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),fn.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(ds.INITIALIZE_END),n.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),Sa(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return void 0===r?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(t){const r=this.getAllAccounts(),n=this.browserStorage.getCachedNativeRequest(),o=n&&Ps.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!t,i=o?n?.correlationId:this.browserStorage.getTemporaryCache(Ni,!0)||"",a=this.performanceClient.startMeasurement(fn.AcquireTokenRedirect,i);let s;if(this.eventHandler.emitEvent(ds.HANDLE_REDIRECT_START,e.InteractionType.Redirect),o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const e=new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,n.accountId,this.nativeInternalStorage,n.correlationId);s=In(e.handleRedirectPromise.bind(e),fn.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,a.event.correlationId)(this.performanceClient,a.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const e=this.createRedirectClient(i);s=In(e.handleRedirectPromise.bind(e),fn.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,a.event.correlationId)(t,a)}return s.then((t=>{if(t){r.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(ds.LOGIN_SUCCESS,e.InteractionType.Redirect,t),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),a.end({success:!0,accountType:Ws(t.account)})}else a.event.errorCode?a.end({success:!1}):a.discard();return this.eventHandler.emitEvent(ds.HANDLE_REDIRECT_END,e.InteractionType.Redirect),t})).catch((t=>{const n=t;throw r.length>0?this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,n):this.eventHandler.emitEvent(ds.LOGIN_FAILURE,e.InteractionType.Redirect,null,n),this.eventHandler.emitEvent(ds.HANDLE_REDIRECT_END,e.InteractionType.Redirect),a.end({success:!1},n),t}))}async acquireTokenRedirect(t){const r=this.getRequestCorrelationId(t);this.logger.verbose("acquireTokenRedirect called",r);const n=this.performanceClient.startMeasurement(fn.AcquireTokenPreRedirect,r);n.add({accountType:Ws(t.account),scenarioId:t.scenarioId});const o=t.onRedirectNavigate;if(o)t.onRedirectNavigate=e=>{const t="function"==typeof o?o(e):void 0;return!1!==t?n.end({success:!0}):n.discard(),t};else{const e=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=t=>{const r="function"==typeof e?e(t):void 0;return!1!==r?n.end({success:!0}):n.discard(),r}}const i=this.getAllAccounts().length>0;try{let o;if(Aa(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),i?this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t):this.eventHandler.emitEvent(ds.LOGIN_START,e.InteractionType.Redirect,t),this.nativeExtensionProvider&&this.canUseNative(t)){o=new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(t),this.nativeInternalStorage,r).acquireTokenRedirect(t,n).catch((e=>{if(e instanceof Es&&ks(e)){this.nativeExtensionProvider=void 0;return this.createRedirectClient(r).acquireToken(t)}if(e instanceof Dn){this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow");return this.createRedirectClient(r).acquireToken(t)}throw this.browserStorage.setInteractionInProgress(!1),e}))}else{o=this.createRedirectClient(r).acquireToken(t)}return await o}catch(t){throw n.end({success:!1},t),i?this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t):this.eventHandler.emitEvent(ds.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),t}}acquireTokenPopup(t){const r=this.getRequestCorrelationId(t),n=this.performanceClient.startMeasurement(fn.AcquireTokenPopup,r);n.add({scenarioId:t.scenarioId,accountType:Ws(t.account)});try{this.logger.verbose("acquireTokenPopup called",r),Vs(this.initialized,n),this.browserStorage.setInteractionInProgress(!0)}catch(e){return Promise.reject(e)}const o=this.getAllAccounts();let i;if(o.length>0?this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t):this.eventHandler.emitEvent(ds.LOGIN_START,e.InteractionType.Popup,t),this.canUseNative(t))i=this.acquireTokenNative({...t,correlationId:r},Bi.acquireTokenPopup).then((e=>(this.browserStorage.setInteractionInProgress(!1),n.end({success:!0,isNativeBroker:!0,requestId:e.requestId,accountType:Ws(e.account)}),e))).catch((e=>{if(e instanceof Es&&ks(e)){this.nativeExtensionProvider=void 0;return this.createPopupClient(r).acquireToken(t)}if(e instanceof Dn){this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow");return this.createPopupClient(r).acquireToken(t)}throw this.browserStorage.setInteractionInProgress(!1),e}));else{i=this.createPopupClient(r).acquireToken(t)}return i.then((t=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(ds.LOGIN_SUCCESS,e.InteractionType.Popup,t):this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),n.end({success:!0,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:Ws(t.account)}),t))).catch((t=>(o.length>0?this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t):this.eventHandler.emitEvent(ds.LOGIN_FAILURE,e.InteractionType.Popup,null,t),n.end({success:!1},t),Promise.reject(t))))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(t){const r=this.getRequestCorrelationId(t),n={...t,prompt:t.prompt,correlationId:r};let o;if(this.ssoSilentMeasurement=this.performanceClient.startMeasurement(fn.SsoSilent,r),this.ssoSilentMeasurement?.add({scenarioId:t.scenarioId,accountType:Ws(t.account)}),Vs(this.initialized,this.ssoSilentMeasurement),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",r),this.eventHandler.emitEvent(ds.SSO_SILENT_START,e.InteractionType.Silent,n),this.canUseNative(n))o=this.acquireTokenNative(n,Bi.ssoSilent).catch((e=>{if(e instanceof Es&&ks(e)){this.nativeExtensionProvider=void 0;return this.createSilentIframeClient(n.correlationId).acquireToken(n)}throw e}));else{o=this.createSilentIframeClient(n.correlationId).acquireToken(n)}return o.then((t=>(this.eventHandler.emitEvent(ds.SSO_SILENT_SUCCESS,e.InteractionType.Silent,t),this.ssoSilentMeasurement?.end({success:!0,isNativeBroker:t.fromNativeBroker,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:Ws(t.account)}),t))).catch((t=>{throw this.eventHandler.emitEvent(ds.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,t),this.ssoSilentMeasurement?.end({success:!1},t),t})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenByCode(t){const r=this.getRequestCorrelationId(t);this.logger.trace("acquireTokenByCode called",r);const n=this.performanceClient.startMeasurement(fn.AcquireTokenByCode,r);Vs(this.initialized,n),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_BY_CODE_START,e.InteractionType.Silent,t),n.add({scenarioId:t.scenarioId});try{if(t.code&&t.nativeAccountId)throw hi(Jo);if(t.code){const o=t.code;let i=this.hybridAuthCodeResponses.get(o);return i?(this.logger.verbose("Existing acquireTokenByCode request found",r),n.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",r),i=this.acquireTokenByCodeAsync({...t,correlationId:r}).then((t=>(this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_BY_CODE_SUCCESS,e.InteractionType.Silent,t),this.hybridAuthCodeResponses.delete(o),n.end({success:!0,isNativeBroker:t.fromNativeBroker,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length,accountType:Ws(t.account)}),t))).catch((t=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_BY_CODE_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t})),this.hybridAuthCodeResponses.set(o,i)),await i}if(t.nativeAccountId){if(this.canUseNative(t,t.nativeAccountId)){const e=await this.acquireTokenNative({...t,correlationId:r},Bi.acquireTokenByCode,t.nativeAccountId).catch((e=>{throw e instanceof Es&&ks(e)&&(this.nativeExtensionProvider=void 0),e}));return n.end({accountType:Ws(e.account),success:!0}),e}throw hi(Zo)}throw hi($o)}catch(t){throw this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_BY_CODE_FAILURE,e.InteractionType.Silent,null,t),n.end({success:!1},t),t}}async acquireTokenByCodeAsync(e){this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(fn.AcquireTokenByCodeAsync,e.correlationId),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const t=this.createSilentAuthCodeClient(e.correlationId);return await t.acquireToken(e).then((e=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:e.fromCache,isNativeBroker:e.fromNativeBroker,requestId:e.requestId}),e))).catch((e=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},e),e})).finally((()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)}))}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(fn.AcquireTokenFromCache,e.correlationId),t){case Gi.Default:case Gi.AccessToken:case Gi.AccessTokenAndRefreshToken:const t=this.createSilentCacheClient(e.correlationId);return In(t.acquireToken.bind(t),fn.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw vt(tt)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(fn.AcquireTokenByRefreshToken,e.correlationId),t){case Gi.Default:case Gi.AccessTokenAndRefreshToken:case Gi.RefreshToken:case Gi.RefreshTokenAndNetwork:const t=this.createSilentRefreshClient(e.correlationId);return In(t.acquireToken.bind(t),fn.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw vt(tt)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(fn.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return In(t.acquireToken.bind(t),fn.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);Aa(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0);return this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);ba(this.initialized),this.browserStorage.setInteractionInProgress(!0);return this.createPopupClient(t).logout(e)}catch(e){return Promise.reject(e)}}async clearCache(e){if(!this.isBrowserEnvironment)return void this.logger.info("in non-browser environment, returning early.");const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return os(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return is(e,this.logger,this.browserStorage)}getAccountByUsername(e){return as(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return ss(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return cs(e,this.logger,this.browserStorage)}setActiveAccount(e){us(e,this.browserStorage)}getActiveAccount(){return ls(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Nr.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw hi(ri);return new Rs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Ps.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case A.NONE:case A.CONSENT:case A.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!(!t&&!this.getNativeAccountId(e))||(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1)}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new Os(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new Us(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new Ks(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new bs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new zs(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new js(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Bi.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return ka(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){"undefined"!=typeof window&&(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){try{e.key?.includes(I)&&this.eventHandler.emitEvent(ds.ACTIVE_ACCOUNT_CHANGED);const t=e.newValue||e.oldValue;if(!t)return;const r=JSON.parse(t);if("object"!=typeof r||!Nr.isAccountEntity(r))return;const n=Qr.toObject(new Nr,r).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(ds.ACCOUNT_ADDED,void 0,n)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(ds.ACCOUNT_REMOVED,void 0,n))}catch(e){return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?oa():t.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||Fi})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||Fi})}async acquireTokenSilent(e){const r=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(fn.AcquireTokenSilent,r);n.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Vs(this.initialized,n),this.logger.verbose("acquireTokenSilent called",r);const o=e.account||this.getActiveAccount();if(!o)throw hi(qo);n.add({accountType:Ws(o)});const i={clientId:this.config.auth.clientId,authority:e.authority||t.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},a=JSON.stringify(i),s=this.activeSilentTokenRequests.get(a);if(void 0===s){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",r);const t=In(this.acquireTokenSilentAsync.bind(this),fn.AcquireTokenSilentAsync,this.logger,this.performanceClient,r)({...e,correlationId:r},o).then((t=>(this.activeSilentTokenRequests.delete(a),n.end({success:!0,fromCache:t.fromCache,isNativeBroker:t.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,requestId:t.requestId,accessTokenSize:t.accessToken.length,idTokenSize:t.idToken.length}),t))).catch((e=>{throw this.activeSilentTokenRequests.delete(a),n.end({success:!1},e),e}));return this.activeSilentTokenRequests.set(a,t),{...await t,state:e.state}}return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",r),n.discard(),{...await s,state:e.state}}async acquireTokenSilentAsync(t,r){const n=()=>this.trackPageVisibility(t.correlationId);this.performanceClient.addQueueMeasurement(fn.AcquireTokenSilentAsync,t.correlationId),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t),t.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},t.correlationId),document.addEventListener("visibilitychange",n);const o=await In(Cs,fn.InitializeSilentRequest,this.logger,this.performanceClient,t.correlationId)(t,r,this.config,this.performanceClient,this.logger),i=t.cacheLookupPolicy||Gi.Default;return this.acquireTokenSilentNoIframe(o,i).catch((async e=>{const t=function(e,t){const r=!(e instanceof Dn&&e.subError!==qn),n=e.errorCode===pi.INVALID_GRANT_ERROR||e.errorCode===tt,o=r&&n||e.errorCode===_n||e.errorCode===Pn,i=Qi.includes(t);return o&&i} /*! @azure/msal-browser v3.26.0 2024-10-08 */(e,i);if(t){if(this.activeIframeRequest){if(i!==Gi.Skip){const[t,r]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${r}`,o.correlationId);const n=this.performanceClient.startMeasurement(fn.AwaitConcurrentIframe,o.correlationId);n.add({awaitIframeCorrelationId:r});const a=await t;if(n.end({success:a}),a)return this.logger.verbose(`Parallel iframe request with correlationId: ${r} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,i);throw this.logger.info(`Iframe request with correlationId: ${r} failed. Interaction is required.`),e}return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),In(this.acquireTokenBySilentIframe.bind(this),fn.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o)}{let e;return this.activeIframeRequest=[new Promise((t=>{e=t})),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),In(this.acquireTokenBySilentIframe.bind(this),fn.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then((t=>(e(!0),t))).catch((t=>{throw e(!1),t})).finally((()=>{this.activeIframeRequest=void 0}))}}throw e})).then((r=>(this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,r),t.correlationId&&this.performanceClient.addFields({fromCache:r.fromCache,isNativeBroker:r.fromNativeBroker,requestId:r.requestId},t.correlationId),r))).catch((t=>{throw this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),t})).finally((()=>{document.removeEventListener("visibilitychange",n)}))}async acquireTokenSilentNoIframe(t,r){return Ps.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,t.authenticationScheme)&&t.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(t,Bi.acquireTokenSilent_silentFlow).catch((async e=>{if(e instanceof Es&&ks(e))throw this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,vt(tt);throw e}))):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),In(this.acquireTokenFromCache.bind(this),fn.AcquireTokenFromCache,this.logger,this.performanceClient,t.correlationId)(t,r).catch((n=>{if(r===Gi.AccessToken)throw n;return this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_NETWORK_START,e.InteractionType.Silent,t),In(this.acquireTokenByRefreshToken.bind(this),fn.AcquireTokenByRefreshToken,this.logger,this.performanceClient,t.correlationId)(t,r)})))}} /*! @azure/msal-browser v3.26.0 2024-10-08 */ class $s{constructor(e,t,r,n){this.clientId=e,this.clientCapabilities=t,this.crypto=r,this.logger=n}toNaaTokenRequest(e){let t;t=void 0===e.extraQueryParameters?new Map:new Map(Object.entries(e.extraQueryParameters));const r=(new gn).addClientCapabilitiesToClaims(e.claims,this.clientCapabilities),n=e.scopes||a;return{platformBrokerId:e.account?.homeAccountId,clientId:this.clientId,authority:e.authority,scope:n.join(" "),correlationId:void 0!==e.correlationId?e.correlationId:this.crypto.createNewGuid(),claims:Cr.isEmptyObj(r)?void 0:r,state:e.state,authenticationScheme:e.authenticationScheme||W.BEARER,extraParameters:t}}fromNaaTokenResponse(e,t,r){if(!t.token.id_token||!t.token.access_token)throw vt(be);const n=new Date(1e3*(r+(t.token.expires_in||0))),o=kt(t.token.id_token,this.crypto.base64Decode),i=this.fromNaaAccountInfo(t.account,t.token.id_token,o),a=t.token.scope||e.scope;return{authority:t.token.authority||i.environment,uniqueId:i.localAccountId,tenantId:i.tenantId,scopes:a.split(" "),account:i,idToken:t.token.id_token,idTokenClaims:o,accessToken:t.token.access_token,fromCache:!1,expiresOn:n,tokenType:e.authenticationScheme||W.BEARER,correlationId:e.correlationId,extExpiresOn:n,state:e.state}}fromNaaAccountInfo(e,t,r){const n=r||e.idTokenClaims,o=e.localAccountId||n?.oid||n?.sub||"",i=e.tenantId||n?.tid||"",a=e.homeAccountId||`${o}.${i}`,s=e.username||n?.preferred_username||"",c=e.name||n?.name,u=new Map,l=kr(a,o,i,n);u.set(i,l);return{homeAccountId:a,environment:e.environment,tenantId:i,username:s,localAccountId:o,name:c,idToken:t,idTokenClaims:n,tenantProfiles:u}}fromBridgeError(e){if(!function(e){return void 0!==e.status}(e))return new Ie("unknown_error","An unknown error occurred");switch(e.status){case Ba:return new mt(ut);case Ha:return new mt(ct);case za:return new mt($e);case Ka:return new mt(ht);case Ga:return new mt(e.code||ht,e.description);case Da:case Fa:return new rn(e.code,e.description);case La:return new Dn(e.code,e.description);default:return new Ie(e.code,e.description)}}toAuthenticationResultFromCache(e,t,r,n,o){if(!t||!r)throw vt(be);const i=kt(t.secret,this.crypto.base64Decode),a=r.target||n.scopes.join(" ");return{authority:r.environment||e.environment,uniqueId:e.localAccountId,tenantId:e.tenantId,scopes:a.split(" "),account:e,idToken:t.secret,idTokenClaims:i||{},accessToken:r.secret,fromCache:!0,expiresOn:new Date(1e3*Number(r.expiresOn)),tokenType:n.authenticationScheme||W.BEARER,correlationId:o,extExpiresOn:new Date(1e3*Number(r.extendedExpiresOn)),state:n.state}}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const Js={code:"unsupported_method",desc:"This method is not supported in nested app environment."};class Xs extends Ie{constructor(e,t){super(e,t),Object.setPrototypeOf(this,Xs.prototype),this.name="NestedAppAuthError"}static createUnsupportedError(){return new Xs(Js.code,Js.desc)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class Zs{constructor(e){this.operatingContext=e;const t=this.operatingContext.getBridgeProxy();if(void 0===t)throw new Error("unexpected: bridgeProxy is undefined");this.bridgeProxy=t,this.config=e.getConfig(),this.logger=this.operatingContext.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=e.isBrowserEnvironment()?new Xa(this.logger,this.performanceClient):yt,this.browserStorage=this.operatingContext.isBrowserEnvironment()?new rs(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,Sn(this.config.auth)):ns(this.config.auth.clientId,this.logger),this.eventHandler=new hs(this.logger),this.nestedAppAuthAdapter=new $s(this.config.auth.clientId,this.config.auth.clientCapabilities,this.browserCrypto,this.logger);const r=this.bridgeProxy.getAccountContext();if(r){us(is(r,this.logger,this.browserStorage),this.browserStorage)}}static async createController(e){const t=new Zs(e);return Promise.resolve(t)}initialize(){return Promise.resolve()}ensureValidRequest(e){return e?.correlationId?e:{...e,correlationId:this.browserCrypto.createNewGuid()}}async acquireTokenInteractive(t){const r=this.ensureValidRequest(t);this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Popup,r);const n=this.performanceClient.startMeasurement(fn.AcquireTokenPopup,r.correlationId);n?.add({nestedAppAuthRequest:!0});try{const o=this.nestedAppAuthAdapter.toNaaTokenRequest(r),i=bt(),a=await this.bridgeProxy.getTokenInteractive(o),s=this.nestedAppAuthAdapter.fromNaaTokenResponse(o,a,i);return await this.hydrateCache(s,t),this.browserStorage.setActiveAccount(s.account),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,s),n.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),n.end({success:!0,requestId:s.requestId}),s}catch(t){const r=this.nestedAppAuthAdapter.fromBridgeError(t);throw this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t),n.end({success:!1},t),r}}async acquireTokenSilentInternal(t){const r=this.ensureValidRequest(t);this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Silent,r);const n=await this.acquireTokenFromCache(r);if(n)return this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,n),n;const o=this.performanceClient.startMeasurement(fn.SsoSilent,r.correlationId);o?.increment({visibilityChangeCount:0}),o?.add({nestedAppAuthRequest:!0});try{const n=this.nestedAppAuthAdapter.toNaaTokenRequest(r),i=bt(),a=await this.bridgeProxy.getTokenSilent(n),s=this.nestedAppAuthAdapter.fromNaaTokenResponse(n,a,i);return await this.hydrateCache(s,t),this.browserStorage.setActiveAccount(s.account),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,s),o?.add({accessTokenSize:s.accessToken.length,idTokenSize:s.idToken.length}),o?.end({success:!0,requestId:s.requestId}),s}catch(t){const r=this.nestedAppAuthAdapter.fromBridgeError(t);throw this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),o?.end({success:!1},t),r}}async acquireTokenFromCache(t){const r=this.performanceClient.startMeasurement(fn.AcquireTokenSilent,t.correlationId);r?.add({nestedAppAuthRequest:!0});const n=await this.acquireTokenFromCacheInternal(t);return n?(this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,n),r?.add({accessTokenSize:n?.accessToken.length,idTokenSize:n?.idToken.length}),r?.end({success:!0}),n):(this.logger.error("Cached tokens are not found for the account, proceeding with silent token request."),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null),r?.end({success:!1}),null)}async acquireTokenFromCacheInternal(e){const t=this.bridgeProxy.getAccountContext();let r=null;if(t){r=is(t,this.logger,this.browserStorage)||e.account}if(!r)return this.logger.verbose("No active account found, falling back to the host"),Promise.resolve(null);this.logger.verbose("active account found, attempting to acquire token silently");const n={...e,correlationId:e.correlationId||this.browserCrypto.createNewGuid(),authority:e.authority||r.environment,scopes:e.scopes?.length?e.scopes:[...a]},o=this.browserStorage.getTokenKeys(),i=this.browserStorage.getAccessToken(r,n,o,r.tenantId,this.performanceClient,n.correlationId);if(!i)return this.logger.verbose("No cached access token found"),Promise.resolve(null);if(_t(i.cachedAt)||At(i.expiresOn,this.config.system.tokenRenewalOffsetSeconds)){this.logger.verbose("Cached access token has expired, deleting all related tokens from cache");const e=Nr.createFromAccountInfo(r);return await this.browserStorage.removeAccountContext(e),Promise.resolve(null)}const s=this.browserStorage.getIdToken(r,o,r.tenantId,this.performanceClient,n.correlationId);return s?this.nestedAppAuthAdapter.toAuthenticationResultFromCache(r,s,i,n,n.correlationId):(this.logger.verbose("No cached id token found"),Promise.resolve(null))}async acquireTokenPopup(e){return this.acquireTokenInteractive(e)}acquireTokenRedirect(e){throw Xs.createUnsupportedError()}async acquireTokenSilent(e){return this.acquireTokenSilentInternal(e)}acquireTokenByCode(e){throw Xs.createUnsupportedError()}acquireTokenNative(e,t,r){throw Xs.createUnsupportedError()}acquireTokenByRefreshToken(e,t){throw Xs.createUnsupportedError()}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){throw Xs.createUnsupportedError()}removePerformanceCallback(e){throw Xs.createUnsupportedError()}enableAccountStorageEvents(){throw Xs.createUnsupportedError()}disableAccountStorageEvents(){throw Xs.createUnsupportedError()}getAllAccounts(e){return os(this.logger,this.browserStorage,this.isBrowserEnv(),e)}getAccount(e){return is(e,this.logger,this.browserStorage)}getAccountByUsername(e){return as(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return ss(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return cs(e,this.logger,this.browserStorage)}setActiveAccount(e){return us(e,this.browserStorage)}getActiveAccount(){return ls(this.browserStorage)}handleRedirectPromise(e){return Promise.resolve(null)}loginPopup(e){return this.acquireTokenInteractive(e||Fi)}loginRedirect(e){throw Xs.createUnsupportedError()}logout(e){throw Xs.createUnsupportedError()}logoutRedirect(e){throw Xs.createUnsupportedError()}logoutPopup(e){throw Xs.createUnsupportedError()}ssoSilent(e){return this.acquireTokenSilentInternal(e)}getTokenCache(){throw Xs.createUnsupportedError()}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){}setNavigationClient(e){this.logger.warning("setNavigationClient is not supported in nested app auth")}getConfiguration(){return this.config}isBrowserEnv(){return this.operatingContext.isBrowserEnvironment()}getBrowserCrypto(){return this.browserCrypto}getPerformanceClient(){throw Xs.createUnsupportedError()}getRedirectResponse(){throw Xs.createUnsupportedError()}async clearCache(e){throw Xs.createUnsupportedError()}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Nr.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),this.browserStorage.hydrateCache(e,t)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */async function ec(e){const t=new Wa(e),r=new ja(e),n=[t.initialize(),r.initialize()];return await Promise.all(n),r.isAvailable()&&e.auth.supportsNestedAppAuth?Zs.createController(r):t.isAvailable()?Ys.createController(t):null} /*! @azure/msal-browser v3.26.0 2024-10-08 */let tc=class e{static async createPublicClientApplication(t){const r=await async function(e,t){const r=new Wa(e);return await r.initialize(),Ys.createController(r,t)}(t);return new e(t,r)}constructor(e,t){this.controller=t||new Ys(new Wa(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}};async function rc(e){const t=new tc(e);return await t.initialize(),t} /*! @azure/msal-browser v3.26.0 2024-10-08 */class nc{constructor(e){this.initialized=!1,this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.logger=e.getLogger(),this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Xa(this.logger,this.performanceClient):yt,this.browserStorage=this.isBrowserEnvironment?new rs(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,void 0,this.performanceClient):ns(this.config.auth.clientId,this.logger)}getBrowserStorage(){return this.browserStorage}getAccount(e){return null}getAccountByHomeId(e){return null}getAccountByLocalId(e){return null}getAccountByUsername(e){return null}getAllAccounts(){return[]}initialize(){return this.initialized=!0,Promise.resolve()}acquireTokenPopup(e){return Sa(this.initialized),ka(),{}}acquireTokenRedirect(e){return Sa(this.initialized),ka(),Promise.resolve()}acquireTokenSilent(e){return Sa(this.initialized),ka(),{}}acquireTokenByCode(e){return Sa(this.initialized),ka(),{}}acquireTokenNative(e,t,r){return Sa(this.initialized),ka(),{}}acquireTokenByRefreshToken(e,t){return Sa(this.initialized),ka(),{}}addEventCallback(e,t){return null}removeEventCallback(e){}addPerformanceCallback(e){return Sa(this.initialized),ka(),""}removePerformanceCallback(e){return Sa(this.initialized),ka(),!0}enableAccountStorageEvents(){Sa(this.initialized),ka()}disableAccountStorageEvents(){Sa(this.initialized),ka()}handleRedirectPromise(e){return Sa(this.initialized),Promise.resolve(null)}loginPopup(e){return Sa(this.initialized),ka(),{}}loginRedirect(e){return Sa(this.initialized),ka(),{}}logout(e){return Sa(this.initialized),ka(),{}}logoutRedirect(e){return Sa(this.initialized),ka(),{}}logoutPopup(e){return Sa(this.initialized),ka(),{}}ssoSilent(e){return Sa(this.initialized),ka(),{}}getTokenCache(){return Sa(this.initialized),ka(),{}}getLogger(){return this.logger}setLogger(e){Sa(this.initialized),ka()}setActiveAccount(e){Sa(this.initialized),ka()}getActiveAccount(){return Sa(this.initialized),ka(),null}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){Sa(this.initialized),ka()}getConfiguration(){return this.config}isBrowserEnv(){return Sa(this.initialized),ka(),!0}getBrowserCrypto(){return Sa(this.initialized),ka(),{}}getPerformanceClient(){return Sa(this.initialized),ka(),{}}getRedirectResponse(){return Sa(this.initialized),ka(),{}}async clearCache(e){Sa(this.initialized),ka()}async hydrateCache(e,t){Sa(this.initialized),ka()}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class oc extends xa{getId(){return oc.ID}getModuleName(){return oc.MODULE_NAME}async initialize(){return!0}}oc.MODULE_NAME="",oc.ID="UnknownOperatingContext"; /*! @azure/msal-browser v3.26.0 2024-10-08 */ class ic{static async createPublicClientApplication(e){const t=await ec(e);let r;return r=null!==t?new ic(e,t):new ic(e),r}constructor(e,t){if(this.configuration=e,t)this.controller=t;else{const t=new oc(e);this.controller=new nc(t)}}async initialize(){if(this.controller instanceof nc){const e=await ec(this.configuration);return null!==e&&(this.controller=e),this.controller.initialize()}return Promise.resolve()}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */const ac={initialize:()=>Promise.reject(ga(ca)),acquireTokenPopup:()=>Promise.reject(ga(ca)),acquireTokenRedirect:()=>Promise.reject(ga(ca)),acquireTokenSilent:()=>Promise.reject(ga(ca)),acquireTokenByCode:()=>Promise.reject(ga(ca)),getAllAccounts:()=>[],getAccount:()=>null,getAccountByHomeId:()=>null,getAccountByUsername:()=>null,getAccountByLocalId:()=>null,handleRedirectPromise:()=>Promise.reject(ga(ca)),loginPopup:()=>Promise.reject(ga(ca)),loginRedirect:()=>Promise.reject(ga(ca)),logout:()=>Promise.reject(ga(ca)),logoutRedirect:()=>Promise.reject(ga(ca)),logoutPopup:()=>Promise.reject(ga(ca)),ssoSilent:()=>Promise.reject(ga(ca)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,enableAccountStorageEvents:()=>{},disableAccountStorageEvents:()=>{},getTokenCache:()=>{throw ga(ca)},getLogger:()=>{throw ga(ca)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw ga(ca)},hydrateCache:()=>Promise.reject(ga(ca)),clearCache:()=>Promise.reject(ga(ca))}; /*! @azure/msal-browser v3.26.0 2024-10-08 */ /*! @azure/msal-browser v3.26.0 2024-10-08 */ class sc{constructor(e,t){const r=t&&t.loggerOptions||{};this.logger=new Tt(r,qa,Ua),this.cryptoOps=new Xa(this.logger),this.popTokenGenerator=new Qn(this.cryptoOps),this.shrParameters=e}async generatePublicKeyThumbprint(){const{kid:e}=await this.popTokenGenerator.generateKid(this.shrParameters);return e}async signRequest(e,t,r){return this.popTokenGenerator.signPayload(e,t,this.shrParameters,r)}async removeKeys(e){return this.cryptoOps.removeTokenBindingKey(e)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */function cc(){let e;try{e=window[Ii.SessionStorage];const t=e?.getItem("msal.browser.performance.enabled");if(1===Number(t))return Promise.resolve().then((function(){return pc}))}catch(e){}}function uc(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.now}function lc(e){if(e&&uc())return Math.round(window.performance.now()-e)}class dc extends go{constructor(e,r,n){super(e.auth.clientId,e.auth.authority||`${t.DEFAULT_AUTHORITY}`,new Tt(e.system?.loggerOptions||{},qa,Ua),qa,Ua,e.telemetry?.application||{appName:"",appVersion:""},r,n)}generateId(){return oa()}getPageVisibility(){return document.visibilityState?.toString()||null}deleteIncompleteSubMeasurements(e){cc()?.then((t=>{const r=this.eventsByCorrelationId.get(e.event.correlationId),n=r&&r.eventId===e.event.eventId,o=[];n&&r?.incompleteSubMeasurements&&r.incompleteSubMeasurements.forEach((e=>{o.push({...e})})),t.BrowserPerformanceMeasurement.flushMeasurements(e.event.correlationId,o)}))}startMeasurement(e,t){const r=this.getPageVisibility(),n=super.startMeasurement(e,t),o=uc()?window.performance.now():void 0,i=cc()?.then((t=>new t.BrowserPerformanceMeasurement(e,n.event.correlationId)));return i?.then((e=>e.startMeasurement())),{...n,end:(e,t)=>{const a=n.end({...e,startPageVisibility:r,endPageVisibility:this.getPageVisibility(),durationMs:lc(o)},t);return i?.then((e=>e.endMeasurement())),this.deleteIncompleteSubMeasurements(n),a},discard:()=>{n.discard(),i?.then((e=>e.flushMeasurement())),this.deleteIncompleteSubMeasurements(n)}}}setPreQueueTime(e,t){if(!uc())return void this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for ${e}`);if(!t)return void this.logger.trace(`BrowserPerformanceClient: correlationId for ${e} not provided, unable to set telemetry queue time`);const r=this.preQueueTimeByCorrelationId.get(t);r&&(this.logger.trace(`BrowserPerformanceClient: Incomplete pre-queue ${r.name} found`,t),this.addQueueMeasurement(r.name,t,void 0,!0)),this.preQueueTimeByCorrelationId.set(t,{name:e,time:window.performance.now()})}addQueueMeasurement(e,t,r,n){if(!uc())return void this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to add queue measurement for ${e}`);if(!t)return void this.logger.trace(`BrowserPerformanceClient: correlationId for ${e} not provided, unable to add queue measurement`);const o=super.getPreQueueTime(e,t);if(!o)return;const i=window.performance.now(),a=r||super.calculateQueuedTime(o,i);return super.addQueueMeasurement(e,t,a,n)}} /*! @azure/msal-browser v3.26.0 2024-10-08 */class hc{constructor(e,t){this.correlationId=t,this.measureName=hc.makeMeasureName(e,t),this.startMark=hc.makeStartMark(e,t),this.endMark=hc.makeEndMark(e,t)}static makeMeasureName(e,t){return`msal.measure.${e}.${t}`}static makeStartMark(e,t){return`msal.start.${e}.${t}`}static makeEndMark(e,t){return`msal.end.${e}.${t}`}static supportsBrowserPerformance(){return"undefined"!=typeof window&&void 0!==window.performance&&"function"==typeof window.performance.mark&&"function"==typeof window.performance.measure&&"function"==typeof window.performance.clearMarks&&"function"==typeof window.performance.clearMeasures&&"function"==typeof window.performance.getEntriesByName}static flushMeasurements(e,t){if(hc.supportsBrowserPerformance())try{t.forEach((t=>{const r=hc.makeMeasureName(t.name,e);window.performance.getEntriesByName(r,"measure").length>0&&(window.performance.clearMeasures(r),window.performance.clearMarks(hc.makeStartMark(r,e)),window.performance.clearMarks(hc.makeEndMark(r,e)))}))}catch(e){}}startMeasurement(){if(hc.supportsBrowserPerformance())try{window.performance.mark(this.startMark)}catch(e){}}endMeasurement(){if(hc.supportsBrowserPerformance())try{window.performance.mark(this.endMark),window.performance.measure(this.measureName,this.startMark,this.endMark)}catch(e){}}flushMeasurement(){if(hc.supportsBrowserPerformance())try{const e=window.performance.getEntriesByName(this.measureName,"measure");if(e.length>0){const t=e[0].duration;return window.performance.clearMeasures(this.measureName),window.performance.clearMarks(this.startMark),window.performance.clearMarks(this.endMark),t}}catch(e){}return null}}var pc=Object.freeze({__proto__:null,BrowserPerformanceMeasurement:hc});const gc={...fn,PairwiseBrokerApplicationInitializeBrokering:"pairwiseBrokerApplicationInitializeBrokering",BrokerClientApplicationHandleBrokerHandshake:"brokerClientApplicationHandleBrokerHandshake",BrokerClientApplicationBrokeredSSOSilentRequest:"brokerClientApplicationBrokeredSSOSilentRequest",BrokerClientApplicationBrokeredSilentRequest:"brokerClientApplicationBrokeredSilentRequest",EmbeddedClientApplicationSendSSOSilentRequest:"embeddedSSOSilent",EmbeddedClientApplicationSendPopupRequest:"embeddedPopup",EmbeddedClientApplicationSendRedirectRequest:"embeddedRedirect",EmbeddedClientApplicationHandleRedirectRequest:"embeddedHandleRedirect",EmbeddedClientApplicationSendSilentRefreshRequest:"embeddedSilentRefresh"},fc=new Map([[gc.PairwiseBrokerApplicationInitializeBrokering,"PWBInitBrk"],[gc.BrokerClientApplicationHandleBrokerHandshake,"BrkClientHandeBrkHandshake"],[gc.BrokerClientApplicationBrokeredSSOSilentRequest,"BrkClientBrkSSOReq"],[gc.BrokerClientApplicationBrokeredSilentRequest,"BrkClientBrkSltReq"],[gc.EmbeddedClientApplicationSendSSOSilentRequest,"EmbClientSendSSOReq"],[gc.EmbeddedClientApplicationSendPopupRequest,"EmbClientSendPopupReq"],[gc.EmbeddedClientApplicationSendRedirectRequest,"EmbClientSendRedirectReq"],[gc.EmbeddedClientApplicationHandleRedirectRequest,"EmbClientHandleRedirectReq"],[gc.EmbeddedClientApplicationSendSilentRefreshRequest,"EmbClientSendSltRefreshReq"]]),mc=new Set(["brokerInteractionTimeoutMs","brokerMessageTimeoutMs","brokerHandshakeTimeoutMs","brokerIframeTimeoutMs"]);var vc="object",yc="undefined",Cc="prototype",Tc=Object,Ic=Tc[Cc]; /*! https://github.com/nevware21/ts-utils v0.11.4 */ function wc(e,t){return e||t}function Ec(e,t){return e[t]}var kc,Sc=void 0,bc=null,Ac="",_c="function",Rc="object",Pc="prototype",Mc="__proto__",Nc="undefined",Oc="constructor",qc="Symbol",Uc="_polyfill",xc="length",Lc="name",Bc="call",Hc="toString",Dc=wc(Object),Fc=Ec(Dc,Pc),Kc=wc(String),zc=Ec(Kc,Pc),Gc=wc(Math),Qc=wc(Array),jc=Ec(Qc,Pc),Wc=Ec(jc,"slice");function Vc(e,t){try{return{v:e.apply(this,t)}}catch(e){return{e:e}}}function Yc(e){return function(t){return typeof t===e}}function $c(e){var t="[object "+e+"]";return function(e){return!(!e||function(e){return Fc[Hc].call(e)}(e)!==t)}}function Jc(e){return typeof e===Nc||e===Nc}function Xc(e){return e===bc||Jc(e)}function Zc(e){return!!e||e!==Sc}var eu=Yc("string"),tu=Yc(_c);function ru(e){return!(!e&&Xc(e))&&(!!e&&typeof e===Rc)}var nu=Ec(Qc,"isArray"),ou=$c("Date"),iu=Yc("number"),au=Yc("boolean"),su=$c("Error");function cu(e){return!!(e&&e.then&&tu(e.then))}function uu(e){return!(!e||(t=function(){return!(e&&0+e)},r=!e,n=Vc(t),n.e?r:n.v));var t,r,n}var lu=Ec(Dc,"getOwnPropertyDescriptor");function du(e,t){return!!e&&Fc.hasOwnProperty[Bc](e,t)}var hu=wc(Ec(Dc,"hasOwn"),pu);function pu(e,t){return du(e,t)||!!lu(e,t)}function gu(e,t,r){if(e&&ru(e))for(var n in e)if(hu(e,n)&&-1===t[Bc](r||e,n,e[n]))break}var fu={e:"enumerable",c:"configurable",v:"value",w:"writable",g:"get",s:"set"};function mu(e){var t={};if(t[fu.c]=!0,t[fu.e]=!0,e.l){t.get=function(){return e.l.v};var r=lu(e.l,"v");r&&r.set&&(t.set=function(t){e.l.v=t})}return gu(e,(function(e,r){t[fu[e]]=Zc(r)?r:t[fu[e]]})),t}var vu=Ec(Dc,"defineProperty"),yu=Ec(Dc,"defineProperties");function Cu(e,t,r){return vu(e,t,mu(r))}function Tu(e,t){var r={};return gu(t,(function(e,t){r[e]=mu(t)})),yu(e,r)}function Iu(e,t,r,n,o){var i={};return gu(e,(function(e,n){wu(i,e,t?n:e,o),wu(i,n,r?n:e,o)})),n?n(i):i}function wu(e,t,r,n){vu(e,t,{value:r,enumerable:!0,writable:!!n})}var Eu=wc(Kc),ku="[object Error]";function Su(e,t){var r=Ac,n=Fc[Hc][Bc](e);n===ku&&(e={stack:Eu(e.stack),message:Eu(e.message),name:Eu(e.name)});try{r=((r=JSON.stringify(e,bc,t?"number"==typeof t?t:4:Sc))?r.replace(/"(\w+)"\s*:\s{0,1}/g,"$1: "):bc)||Eu(e)}catch(e){r=" - "+Su(e,t)}return n+": "+r}function bu(e){throw new Error(e)}function Au(e){throw new TypeError(e)}var _u=Ec(Dc,"freeze");function Ru(e){return e}function Pu(e){return e[Mc]||bc}var Mu=Ec(Dc,"assign"),Nu=Ec(Dc,"keys");function Ou(e){return _u&&gu(e,(function(e,t){(nu(t)||ru(t))&&Ou(t)})),qu(e)}var qu=wc(_u,Ru),Uu=wc(Ec(Dc,"getPrototypeOf"),Pu);function xu(e){return Iu(e,0,0,qu)}var Lu,Bu=xu({asyncIterator:0,hasInstance:1,isConcatSpreadable:2,iterator:3,match:4,matchAll:5,replace:6,search:7,species:8,split:9,toPrimitive:10,toStringTag:11,unscopables:12}),Hu="__tsUtils$gblCfg";function Du(){var e;return typeof globalThis!==Nc&&(e=globalThis),e||typeof self===Nc||(e=self),e||typeof window===Nc||(e=window),e||typeof global===Nc||(e=global),e}function Fu(){if(!Lu){var e=Vc(Du).v||{};Lu=e[Hu]=e[Hu]||{}}return Lu}var Ku=zu;function zu(e,t,r){var n=t?t[e]:bc;return function(t){var o=(t?t[e]:bc)||n;if(o||r){var i=arguments;return(o||r).apply(t,o?Wc[Bc](i,1):i)}Au('"'+Eu(e)+'" not defined for '+Su(t))}}function Gu(e){return function(t){return t[e]}}var Qu=Ec(Gc,"max"),ju=Ku("slice",zc),Wu=Ku("substring",zc),Vu=zu("substr",zc,Yu);function Yu(e,t,r){return Xc(e)&&Au("Invalid "+Su(e)),r<0?Ac:((t=t||0)<0&&(t=Qu(t+e[xc],0)),Jc(r)?ju(e,t):ju(e,t,t+r))}function $u(e,t){return Wu(e,0,t)}var Ju,Xu,Zu,el="_urid";function tl(e){var t={description:Eu(e),toString:function(){return qc+"("+e+")"}};return t[Uc]=!0,t}function rl(e){var t=function(){if(!Ju){var e=Fu();Ju=e.gblSym=e.gblSym||{k:{},s:{}}}return Ju}();if(!hu(t.k,e)){var r=tl(e),n=Nu(t.s).length;r[el]=function(){return n+"_"+r[Hc]()},t.k[e]=r,t.s[r[el]()]=Eu(e)}return t.k[e]}function nl(){Zu=Fu()}function ol(e){return vu({toJSON:function(){return e}},"v",{value:e})}var il,al="window";function sl(e,t){var r;return function(){return!Zu&&nl(),r&&!Zu.lzy||(r=ol(Vc(e,t).v)),r.v}}function cl(e){return!Zu&&nl(),il&&!1!==e&&!Zu.lzy||(il=ol(Vc(Du).v||bc)),il.v}function ul(e,t){var r;if((r=il&&!1!==t?il.v:cl(t))&&r[e])return r[e];if(e===al)try{return window}catch(e){}return bc}function ll(){return!!dl()}var dl=sl(ul,["document"]);var hl=sl(ul,[al]);var pl,gl,fl,ml=sl(ul,["navigator"]),vl=sl((function(){return!!Vc((function(){return process&&(process.versions||{}).node})).v}));function yl(){return pl=ol(Vc(ul,[qc]).v)}function Cl(e){var t=(Zu.lzy?0:pl)||yl();return t.v?t.v[e]:Sc}function Tl(){return!Zu&&nl(),((Zu.lzy?0:pl)||yl()).v}function Il(e,t){var r=Bu[e];!Zu&&nl();var n=(Zu.lzy?0:pl)||yl();return n.v?n.v[r||e]:t?Sc:function(e){var t;!Xu&&(Xu={});var r=Bu[e];return r&&(t=Xu[r]=Xu[r]||tl(qc+"."+r)),t}(e)}function wl(e,t){!Zu&&nl();var r=(Zu.lzy?0:pl)||yl();return r.v?r.v(e):t?bc:tl(e)}function El(e){return!Zu&&nl(),((gl=(Zu.lzy?0:gl)||ol(Vc(Cl,["for"]).v)).v||rl)(e)}function kl(e){return!!e&&tu(e.next)}function Sl(e){return!function(e){return e===bc||!Zc(e)}(e)&&tu(e[Il(3)])}function bl(e,t,r){if(e&&(kl(e)||(!fl&&(fl=ol(Il(3))),e=e[fl.v]?e[fl.v]():bc),kl(e))){var n=Sc,o=Sc;try{for(var i=0;!(o=e.next()).done&&-1!==t[Bc](r||e,o.value,i,e);)i++}catch(t){n={e:t},e.throw&&(o=bc,e.throw(n))}finally{try{o&&!o.done&&e.return&&e.return(o)}finally{if(n)throw n.e}}}}function Al(e,t,r){return e.apply(t,r)}function _l(e,t){return!Jc(t)&&e&&(nu(t)?Al(e.push,e,t):kl(t)||Sl(t)?bl(t,(function(t){e.push(t)})):e.push(t)),e}function Rl(e,t,r){if(e)for(var n=e[xc]>>>0,o=0;o<n&&(!(o in e)||-1!==t[Bc](r||e,e[o],o,e));o++);}var Pl=Ku("indexOf",jc);function Ml(e,t,r){return((e?e.slice:bc)||Wc).apply(e,Wc[Bc](arguments,1))}var Nl,Ol=wc(Ec(Dc,"create"),ql);function ql(e){if(!e)return{};var t=typeof e;function r(){}return t!==Rc&&t!==_c&&Au("Prototype must be an Object or function: "+Su(e)),r[Pc]=e,new r}function Ul(e,t){var r=Dc.setPrototypeOf||function(e,t){var r;!Nl&&(Nl=ol(((r={})[Mc]=[],r instanceof Array))),Nl.v?e[Mc]=t:gu(t,(function(t,r){return e[t]=r}))};return r(e,t)}function xl(e,t){t&&(e[Lc]=t)}function Ll(e,t,r){var n=r||Error,o=n[Pc][Lc],i=Error.captureStackTrace;return function(e,t,r){function n(){this[Oc]=t,Vc(Cu,[this,Lc,{v:e,c:!0,e:!1}])}return Vc(Cu,[t,Lc,{v:e,c:!0,e:!1}]),(t=Ul(t,r))[Pc]=r===bc?Ol(r):(n[Pc]=r[Pc],new n),t}(e,(function(){var r=this,a=arguments;try{Vc(xl,[n,e]);var s=Al(n,r,Wc[Bc](a))||r;if(s!==r){var c=Uu(r);c!==Uu(s)&&Ul(s,c)}return i&&i(s,r[Oc]),t&&t(s,a),s}finally{Vc(xl,[n,o])}}),n)}function Bl(){return(Date.now||Hl)()}function Hl(){return(new Date).getTime()}function Dl(e){return function(t){return Xc(t)&&Au("strTrim called ["+Su(t)+"]"),t&&t.replace&&(t=t.replace(e,Ac)),t}}var Fl,Kl,zl,Gl=zu("trim",zc,Dl(/^\s+|(?=\s)\s+$/g));function Ql(e){if(!e||typeof e!==Rc)return!1;zl||(zl=!hl()||hl());var t=!1;if(e!==zl){Kl||(Fl=Function[Pc][Hc],Kl=Fl[Bc](Dc));try{var r=Uu(e);(t=!r)||(du(r,Oc)&&(r=r[Oc]),t=!(!r||typeof r!==_c||Fl[Bc](r)!==Kl))}catch(e){}}return t}function jl(e){return e.value&&$l(e),!0}var Wl=[function(e){var t=e.value;if(nu(t)){var r=e.result=[];return r.length=t.length,e.copyTo(r,t),!0}return!1},$l,function(e){if(e.type===_c)return!0;return!1},function(e){var t=e.value;if(ou(t))return e.result=new Date(t.getTime()),!0;return!1}];function Vl(e,t,r,n){var o=r.handler,i=r.path?n?r.path.concat(n):r.path:[],a={handler:r.handler,src:r.src,path:i},s=typeof t,c=!1,u=t===bc;u||(t&&s===Rc?c=Ql(t):u=function(e){return!kc&&(kc=["string","number","boolean",Nc,"symbol","bigint"]),!(e===Rc||-1===kc.indexOf(e))}(s));var l={type:s,isPrim:u,isPlain:c,value:t,result:t,path:i,origin:r.src,copy:function(t,n){return Vl(e,t,n?a:r,n)},copyTo:function(t,r){return Yl(e,t,r,a)}};return l.isPrim?o&&o[Bc](r,l)?l.result:t:function(e,t,r,n){var o;return Rl(e,(function(e){if(e.k===t)return o=e,-1})),o||(o={k:t,v:t},e.push(o),n(o)),o.v}(e,t,0,(function(e){Cu(l,"result",{g:function(){return e.v},s:function(t){e.v=t}});for(var t=0,n=o;!(n||(t<Wl.length?Wl[t++]:jl))[Bc](r,l);)n=bc}))}function Yl(e,t,r,n){if(!Xc(r))for(var o in r)t[o]=Vl(e,r[o],n,o);return t}function $l(e){var t=e.value;if(t&&e.isPlain){var r=e.result={};return e.copyTo(r,t),!0}return!1}function Jl(e,t){return Rl(t,(function(t){!function(e,t,r){Yl([],e,t,{handler:r,src:t,path:[]})}(e,t)})),e}function Xl(e,t,r,n,o,i,a){return Jl(Vl([],s=e,{handler:c,src:s})||{},Wc[Bc](arguments));var s,c}var Zl=Gu(xc);var ed=zu("endsWith",zc,td);function td(e,t,r){eu(e)||Au("'"+Su(e)+"' is not a string");var n=eu(t)?t:Eu(t),o=!Jc(r)&&r<e[xc]?r:e[xc];return Wu(e,o-n[xc],o)===n}var rd=Ku("indexOf",zc),nd=zu("startsWith",zc,od);function od(e,t,r){eu(e)||Au("'"+Su(e)+"' is not a string");var n=eu(t)?t:Eu(t),o=r>0?r:0;return Wu(e,o,o+n[xc])===n}var id="ref",ad="unref",sd="hasRef",cd="enabled";function ud(e,t,r){var n=nu(t),o=n?t.length:0,i=(o>0?t[0]:n?Sc:t)||setTimeout,a=(o>1?t[1]:Sc)||clearTimeout,s=r[0];r[0]=function(){c.dn(),Al(s,Sc,Wc[Bc](arguments))};var c=function(e,t,r){var n,o=!0,i=e?t(bc):bc;function a(){return o=!1,i&&i[ad]&&i[ad](),n}function s(){i&&r(i),i=bc}function c(){return i=t(i),o||a(),n}return(n={cancel:s,refresh:c})[sd]=function(){return i&&i[sd]?i[sd]():o},n[id]=function(){return o=!0,i&&i[id]&&i[id](),n},n[ad]=a,{h:n=vu(n,cd,{get:function(){return!!i},set:function(e){!e&&i&&s(),e&&!i&&c()}}),dn:function(){i=bc}}}(e,(function(e){if(e){if(e.refresh)return e.refresh(),e;Al(a,Sc,[e])}return Al(i,Sc,r)}),(function(e){Al(a,Sc,[e])}));return c.h}function ld(e,t){return ud(!0,Sc,Wc[Bc](arguments))}(cl()||{}).Symbol,(cl()||{}).Reflect;var dd,hd=function(e,t){return hd=Tc.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])},hd(e,t)};function pd(e,t){function r(){this.constructor=e}"function"!=typeof t&&null!==t&&Au("Class extends value "+String(t)+" is not a constructor or null"),hd(e,t),e[Cc]=null===t?Ol(t):(r[Cc]=t[Cc],new r)}function gd(e,t){for(var r=0,n=t.length,o=e.length;r<n;r++,o++)e[o]=t[r];return e}var fd="constructor",md="prototype",vd="function",yd="_dynInstFuncs",Cd="_isDynProxy",Td="_dynClass",Id="_dynInstChk",wd=Id,Ed="_dfOpts",kd="_unknown_",Sd="__proto__",bd="_dyn"+Sd,Ad="__dynProto$Gbl",_d="_dynInstProto",Rd="useBaseInst",Pd="setInstFuncs",Md=Object,Nd=Md.getPrototypeOf,Od=Md.getOwnPropertyNames,qd=cl(),Ud=qd[Ad]||(qd[Ad]={o:(dd={},dd[Pd]=!0,dd[Rd]=!0,dd),n:1e3});function xd(e){return e&&(e===Md[md]||e===Array[md])}function Ld(e){return xd(e)||e===Function[md]}function Bd(e){var t;if(e){if(Nd)return Nd(e);var r=e[Sd]||e[md]||(e[fd]?e[fd][md]:null);t=e[bd]||r,du(e,bd)||(delete e[_d],t=e[bd]=e[_d]||e[bd],e[_d]=r)}return t}function Hd(e,t){var r=[];if(Od)r=Od(e);else for(var n in e)"string"==typeof n&&du(e,n)&&r.push(n);if(r&&r.length>0)for(var o=0;o<r.length;o++)t(r[o])}function Dd(e,t,r){return t!==fd&&typeof e[t]===vd&&(r||du(e,t))&&t!==Sd&&t!==md}function Fd(e){Au("DynamicProto: "+e)}function Kd(e,t){for(var r=e.length-1;r>=0;r--)if(e[r]===t)return!0;return!1}function zd(e,t,r,n,o){function i(e,t){var r=function(){var n=function(e,t,r,n){var o=null;if(e&&du(r,Td)){var i=e[yd]||Ol(null);if((o=(i[r[Td]]||Ol(null))[t])||Fd("Missing ["+t+"] "+vd),!o[Id]&&!1!==i[wd]){for(var a=!du(e,t),s=Bd(e),c=[];a&&s&&!Ld(s)&&!Kd(c,s);){var u=s[t];if(u){a=u===n;break}c.push(s),s=Bd(s)}try{a&&(e[t]=o),o[Id]=1}catch(e){i[wd]=!1}}}return o}(this,t,e,r)||function(e,t,r){var n=t[e];return n===r&&(n=Bd(t)[e]),typeof n!==vd&&Fd("["+e+"] is not a "+vd),n}(t,e,r);return n.apply(this,arguments)};return r[Cd]=1,r}if(!xd(e)){var a=r[yd]=r[yd]||Ol(null);if(!xd(a)){var s=a[t]=a[t]||Ol(null);!1!==a[wd]&&(a[wd]=!!o),xd(s)||Hd(r,(function(t){Dd(r,t,!1)&&r[t]!==n[t]&&(s[t]=r[t],delete r[t],(!du(e,t)||e[t]&&!e[t][Cd])&&(e[t]=i(e,t)))}))}}}function Gd(e,t){return du(e,md)?e.name||t||kd:((e||{})[fd]||{}).name||t||kd}function Qd(e,t,r,n){du(e,md)||Fd("theClass is an invalid class definition.");var o=e[md];(function(e,t){if(Nd){for(var r=[],n=Bd(t);n&&!Ld(n)&&!Kd(r,n);){if(n===e)return!0;r.push(n),n=Bd(n)}return!1}return!0})(o,t)||Fd("["+Gd(e)+"] not in hierarchy of ["+Gd(t)+"]");var i=null;du(o,Td)?i=o[Td]:(i="_dynCls$"+Gd(e,"_")+"$"+Ud.n,Ud.n++,o[Td]=i);var a=Qd[Ed],s=!!a[Rd];s&&n&&void 0!==n[Rd]&&(s=!!n[Rd]);var c=function(e){var t=Ol(null);return Hd(e,(function(r){!t[r]&&Dd(e,r,!1)&&(t[r]=e[r])})),t}(t),u=function(e,t,r,n){function o(e,t,r){var o=t[r];if(o[Cd]&&n){var i=e[yd]||{};!1!==i[wd]&&(o=(i[t[Td]]||{})[r]||o)}return function(){return o.apply(e,arguments)}}var i=Ol(null);Hd(r,(function(e){i[e]=o(t,r,e)}));for(var a=Bd(e),s=[];a&&!Ld(a)&&!Kd(s,a);)Hd(a,(function(e){!i[e]&&Dd(a,e,!Nd)&&(i[e]=o(t,a,e))})),s.push(a),a=Bd(a);return i}(o,t,c,s);r(t,u);var l=!!Nd&&!!a[Pd];l&&n&&(l=!!n[Pd]),zd(o,i,t,c,!1!==l)}Qd[Ed]=Ud.o;var jd,Wd=function(e){return Iu(e,1,0,qu)},Vd=function(e){return function(e){var t={};return gu(e,(function(e,r){wu(t,e,r[1]),wu(t,r[0],r[1])})),qu(t)}(e)},Yd=Wd({Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5}),$d=Wd({NONE:0,PENDING:3,INACTIVE:1,ACTIVE:2}),Jd="toLowerCase",Xd="blkVal",Zd="length",eh="rdOnly",th="notify",rh="warnToConsole",nh="throwInternal",oh="setDf",ih="watch",ah="logger",sh="apply",ch="push",uh="splice",lh="hdlr",dh="cancel",hh="initialize",ph="identifier",gh="removeNotificationListener",fh="addNotificationListener",mh="isInitialized",vh="instrumentationKey",yh="INACTIVE",Ch="value",Th="getNotifyMgr",Ih="getPlugin",wh="name",Eh="iKey",kh="time",Sh="processNext",bh="getProcessTelContext",Ah="pollInternalLogs",_h="enabled",Rh="stopPollingInternalLogs",Ph="unload",Mh="onComplete",Nh="version",Oh="loggingLevelConsole",qh="createNew",Uh="teardown",xh="messageId",Lh="message",Bh="isAsync",Hh="diagLog",Dh="_doTeardown",Fh="update",Kh="getNext",zh="setNextPlugin",Gh="protocol",Qh="userAgent",jh="split",Wh="nodeType",Vh="replace",Yh="type",$h="handler",Jh="status",Xh="getResponseHeader",Zh="getAllResponseHeaders",ep="isChildEvt",tp="data",rp="getCtx",np="setCtx",op="complete",ip="urlString",ap="sendPOST",sp="headers",cp="timeout",up="setRequestHeader",lp="traceId",dp="spanId",hp="traceFlags"; /*! * NevWare21 Solutions LLC - ts-async, 0.5.2 * https://github.com/nevware21/ts-async * Copyright (c) NevWare21 Solutions LLC and contributors. All rights reserved. * Licensed under the MIT license. */ var pp="Promise",gp="rejected";function fp(e,t){return mp(e,(function(e){return t?t({status:"fulfilled",rejected:!1,value:e}):e}),(function(e){return t?t({status:gp,rejected:!0,reason:e}):e}))}function mp(e,t,r,n){var o=e;try{if(cu(e))(t||r)&&(o=e.then(t,r));else try{t&&(o=t(e))}catch(e){if(!r)throw e;o=r(e)}}finally{n&&function(e,t){var r=e;t&&(cu(e)?r=e.finally?e.finally(t):e.then((function(e){return t(),e}),(function(e){throw t(),e})):t())}(o,n)}return o}var vp,yp=["pending","resolving","resolved",gp],Cp="dispatchEvent";function Tp(e){var t;return e&&e.createEvent&&(t=e.createEvent("Event")),!!t&&t.initEvent}var Ip,wp,Ep,kp,Sp="unhandledRejection",bp=Sp.toLowerCase(),Ap=[],_p=0,Rp=10;function Pp(e){return tu(e)?e.toString():Su(e)}function Mp(e,t,r){var n,o,i=Ml(arguments,3),a=0,s=!1,c=[],u=_p++,l=!1,d=null;function h(t,r){try{return Ap.push(u),l=!0,d&&d.cancel(),d=null,e((function(e,o){c.push((function(){try{var i=2===a?t:r,s=Jc(i)?n:tu(i)?i(n):i;cu(s)?s.then(e,o):i?e(s):3===a?o(s):e(s)}catch(e){o(e)}})),s&&g()}),i)}finally{Ap.pop()}}function p(){return yp[a]}function g(){if(c.length>0){var e=c.slice();c=[],l=!0,d&&d.cancel(),d=null,t(e)}}function f(e,t){return function(r){if(a===t){if(2===e&&cu(r))return a=1,void r.then(f(2,1),f(3,1));a=e,s=!0,n=r,g(),l||3!==e||d||(d=ld(m,Rp))}}}function m(){if(!l)if(l=!0,vl())process.emit(Sp,n,o);else{var e=hl()||cl();!Ip&&(Ip=ol(Vc(ul,[pp+"RejectionEvent"]).v)),function(e,t,r,n){var o=dl();!vp&&(vp=ol(!!Vc(Tp,[o]).v));var i=vp.v?o.createEvent("Event"):n?new Event(t):{};if(r&&r(i),vp.v&&i.initEvent(t,!1,!0),i&&e[Cp])e[Cp](i);else{var a=e["on"+t];if(a)a(i);else{var s=ul("console");s&&(s.error||s.log)(t,Su(i))}}}(e,bp,(function(e){return Cu(e,"promise",{g:function(){return o}}),e.reason=n,e}),!!Ip.v)}}return vu(o={then:h,catch:function(e){return h(void 0,e)},finally:function(e){var t=e,r=e;return tu(e)&&(t=function(t){return e&&e(),t},r=function(t){throw e&&e(),t}),h(t,r)}},"state",{get:p}),Tl()&&(o[Il(11)]="IPromise"),o.toString=function(){return"IPromise "+p()+(s?" - "+Pp(n):"")},function(){tu(r)||Au(pp+": executor is not a function - "+Pp(r));var e=f(3,0);try{r.call(o,f(2,0),e)}catch(t){e(t)}}(),o}function Np(e){return function(t){var r=Ml(arguments,1);return e((function(e,r){try{var n=[],o=1;bl(t,(function(t,i){t&&(o++,mp(t,(function(t){n[i]=t,0==--o&&e(n)}),r))})),0===--o&&e(n)}catch(e){r(e)}}),r)}}function Op(e){Rl(e,(function(e){try{e()}catch(e){}}))}function qp(e,t){return Mp(qp,function(e){var t=iu(e)?e:0;return function(e){ld((function(){Op(e)}),t)}}(t),e,t)}function Up(e,t){!wp&&(wp=ol(Vc(ul,[pp]).v||null));var r=wp.v;if(!r)return qp(e);tu(e)||Au(pp+": executor is not a function - "+Su(e));var n=0;var o=new r((function(t,r){e((function(e){n=2,t(e)}),(function(e){n=3,r(e)}))}));return vu(o,"state",{get:function(){return yp[n]}}),o}function xp(e){return Mp(xp,Op,e)}function Lp(e,t){var r;return!Ep&&(r=xp,Ep=ol((function(e){var t=Ml(arguments,1);return r((function(t,r){var n=[],o=1;function i(e,r){o++,fp(e,(function(e){e.rejected?n[r]={status:gp,reason:e.reason}:n[r]={status:"fulfilled",value:e.value},0==--o&&t(n)}))}try{nu(e)?Rl(e,i):Sl(e)?bl(e,i):Au("Input is not an iterable"),0==--o&&t(n)}catch(e){r(e)}}),t)}))),Ep.v(e,t)}function Bp(e,t){return!kp&&(kp=ol(Up)),kp.v.call(this,e,t)}var Hp=Np(Bp),Dp=void 0,Fp="",Kp="channels",zp="core",Gp="createPerfMgr",Qp="disabled",jp="extensionConfig",Wp="extensions",Vp="processTelemetry",Yp="priority",$p="eventsSent",Jp="eventsDiscarded",Xp="eventsSendRequest",Zp="perfEvent",eg="offlineEventsStored",tg="offlineBatchSent",rg="offlineBatchDrop",ng="getPerfMgr",og="domain",ig="path",ag="Not dynamic - ",sg=/-([a-z])/g,cg=/([^\w\d_$])/g,ug=/^(\d+[\w\d_$])/;function lg(e){return!Xc(e)}function dg(e){var t=e;return t&&eu(t)&&(t=(t=(t=t[Vh](sg,(function(e,t){return t.toUpperCase()})))[Vh](cg,"_"))[Vh](ug,(function(e,t){return"_"+t}))),t}function hg(e,t){return!(!e||!t)&&-1!==rd(e,t)}function pg(e){return e&&e.toISOString()||""}function gg(e){return su(e)?e[wh]:Fp}function fg(e,t,r,n,o){var i=r;return e&&((i=e[t])===r||o&&!o(i)||n&&!n(r)||(i=r,e[t]=i)),i}function mg(e,t,r,n,o){e&&t&&r&&(!1!==o||Jc(e[t]))&&(e[t]=function(e,t){var r=null,n=null;return tu(e)?r=e:n=e,function(){var e=arguments;if(r&&(n=r()),n)return n[t][sh](n,e)}}(r,n))}function vg(e,t,r,n){return e&&t&&ru(e)&&nu(r)&&Rl(r,(function(r){eu(r)&&mg(e,r,t,r,n)})),e}function yg(e){return e&&Mu&&(e=Tc(Mu({},e))),e}function Cg(e){try{return e.responseText}catch(e){}return null}function Tg(e,t){return e?"XMLHttpRequest,Status:"+e[Jh]+",Response:"+Cg(e)||e.response||"":t}function Ig(e,t){return t&&(iu(t)?e=[t].concat(e):nu(t)&&(e=t.concat(e))),e}var wg="withCredentials";function Eg(e,t,r){if(!e[r]&&t&&t[Xh]){var n=t[Xh](r);n&&(e[r]=Gl(n))}return e}function kg(e,t){var r,n,o={};return e[Zh]?(r=e[Zh](),n={},eu(r)&&Rl(Gl(r)[jh](/[\r\n]+/),(function(e){if(e){var t=e.indexOf(": ");if(-1!==t){var r=Gl(e.substring(0,t))[Jd](),o=Gl(e.substring(t+1));n[r]=o}else n[Gl(e)]=1}})),o=n):t&&(o=Eg(o,e,"time-delta-millis"),o=Eg(o,e,"kill-duration"),o=Eg(o,e,"kill-duration-seconds")),o}var Sg="location",bg="console",Ag="JSON",_g="crypto",Rg="msCrypto",Pg="msie",Mg="trident/",Ng="XMLHttpRequest",Og=null,qg=null,Ug=!1,xg=null,Lg=null;function Bg(e,t){var r=!1;if(e){try{if(!(r=t in e)){var n=e[Cc];n&&(r=t in n)}}catch(e){}if(!r)try{r=!Jc((new e)[t])}catch(e){}}return r}function Hg(e){if(e&&Ug){var t=ul("__mockLocation");if(t)return t}return typeof location===vc&&location?location:ul(Sg)}function Dg(){return Boolean(typeof JSON===vc&&JSON||null!==ul(Ag))}function Fg(){var e=ml();return!(!e||!e.product)&&"ReactNative"===e.product}function Kg(){var e=ml();if(e&&(e[Qh]!==qg||null===Og)){var t=((qg=e[Qh])||Fp)[Jd]();Og=hg(t,Pg)||hg(t,Mg)}return Og}function zg(e){return null!==Lg&&!1!==e||(Lg=!!ml()&&Boolean(ml().sendBeacon)),Lg}function Gg(e){var t=!1;try{t=!!ul("fetch");var r=ul("Request");t&&e&&r&&(t=Bg(r,"keepalive"))}catch(e){}return t}function Qg(){return null===xg&&(xg=typeof XDomainRequest!==yc)&&jg()&&(xg=xg&&!Bg(ul(Ng),"withCredentials")),xg}function jg(){var e=!1;try{e=!!ul(Ng)}catch(e){}return e}var Wg=4294967296,Vg=4294967295,Yg=123456789,$g=987654321,Jg=!1,Xg=Yg,Zg=$g;function ef(){try{var e=2147483647&Bl();(t=(Math.random()*Wg^e)+e)<0&&(t>>>=0),Xg=Yg+t&Vg,Zg=$g-t&Vg,Jg=!0}catch(e){}var t}function tf(e){var t=0,r=ul(_g)||ul(Rg);return r&&r.getRandomValues&&(t=r.getRandomValues(new Uint32Array(1))[0]&Vg),0===t&&Kg()&&(Jg||ef(),t=function(e){var t=((Zg=36969*(65535&Zg)+(Zg>>16)&Vg)<<16)+(65535&(Xg=18e3*(65535&Xg)+(Xg>>16)&Vg))>>>0&Vg|0;e||(t>>>=0);return t}()&Vg),0===t&&(t=Math.floor(Wg*Math.random()|0)),e||(t>>>=0),t}function rf(e){void 0===e&&(e=22);for(var t=tf()>>>0,r=0,n=Fp;n[Zd]<e;)r++,n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(63&t),t>>>=6,5===r&&(t=(tf()<<2&4294967295|3&t)>>>0,r=0);return n}var nf="3.3.3",of="."+rf(6),af=0;function sf(e){return 1===e[Wh]||9===e[Wh]||!+e[Wh]}function cf(e,t){return void 0===t&&(t=!1),dg(e+af+++(t?"."+nf:Fp)+of)}function uf(e){var t={id:cf("_aiData-"+(e||Fp)+"."+nf),accept:function(e){return sf(e)},get:function(e,r,n,o){var i=e[t.id];return i?i[dg(r)]:(o&&(i=function(e,t){var r=t[e.id];if(!r){r={};try{sf(t)&&Cu(t,e.id,{e:!1,v:r})}catch(e){}}return r}(t,e),i[dg(r)]=n),n)},kill:function(e,t){if(e&&e[t])try{delete e[t]}catch(e){}}};return t}function lf(e){return e&&ru(e)&&(e.isVal||e.fb||hu(e,"v")||hu(e,"mrg")||hu(e,"ref")||e.set)}function df(e,t,r){var n,o=r.dfVal||Zc;if(t&&r.fb){var i=r.fb;nu(i)||(i=[i]);for(var a=0;a<i[Zd];a++){var s=i[a],c=t[s];if(o(c)?n=c:e&&(o(c=e.cfg[s])&&(n=c),e.set(e.cfg,Eu(s),c)),o(n))break}}return!o(n)&&o(r.v)&&(n=r.v),n}function hf(e,t,r){var n,o=r;(r&&lf(r)&&(o=df(e,t,r)),o)&&(lf(o)&&(o=hf(e,t,o)),nu(o)?(n=[])[Zd]=o[Zd]:Ql(o)&&(n={}),n&&(gu(o,(function(r,o){o&&lf(o)&&(o=hf(e,t,o)),n[r]=o})),o=n));return o}function pf(e,t,r,n){var o,i,a,s,c,u,l,d,h=n;lf(h)?(o=h.isVal,i=h.set,u=h[eh],l=h[Xd],s=h.mrg,!(c=h.ref)&&Jc(c)&&(c=!!s),a=df(e,t,h)):a=n,l&&e[Xd](t,r);var p=!0,g=t[r];!g&&Xc(g)||(d=g,p=!1,o&&d!==a&&!o(d)&&(d=a,p=!0),i&&(p=(d=i(d,a,t))===a)),p?d=a?hf(e,t,a):a:(Ql(d)||nu(a))&&s&&a&&(Ql(a)||nu(a))&&gu(a,(function(t,r){pf(e,d,t,r)})),e.set(t,r,d),c&&e.ref(t,r),u&&e[eh](t,r)}var gf=El("[[ai_dynCfg_1]]"),ff=El("[[ai_blkDynCfg_1]]"),mf=El("[[ai_frcDynCfg_1]]");function vf(e){var t;if(e&&(nu(e)?(t=[])[Zd]=e[Zd]:Ql(e)&&(t={}),t))return gu(e,(function(e,r){t[e]=vf(r)})),t;return e}function yf(e,t,r){var n=!1;return r&&!e[t.blkVal]&&((n=r[mf])||r[ff]||(n=Ql(r)||nu(r))),n}function Cf(e){Au("InvalidAccess:"+e)}var Tf=["push","pop","shift","unshift","splice"],If=function(e,t,r,n){e&&e[nh](3,108,"".concat(r," [").concat(t,"] failed - ")+Su(n))};function wf(e,t){var r=lu(e,t);return r&&r.get}function Ef(e,t,r,n){if(t){var o=wf(t,r);o&&!!o[e.prop]?t[r]=n:function(e,t,r,n){var o={n:r,h:[],trk:function(t){t&&t.fn&&(-1===Pl(o.h,t)&&o.h[ch](t),e.trk(t,o))},clr:function(e){var t=Pl(o.h,e);-1!==t&&o.h[uh](t,1)}},i=!0,a=!1;function s(){i&&(a=a||yf(s,e,n),n&&!n[gf]&&a&&(n=Sf(e,n,r,"Converting")),i=!1);var t=e.act;return t&&o.trk(t),n}s[e.prop]={chng:function(){e.add(o)}},Cu(t,o.n,{g:s,s:function(c){if(n!==c){s[e.ro]&&!e.upd&&Cf("["+r+"] is read-only:"+Su(t)),i&&(a=a||yf(s,e,n),i=!1);var u=a&&s[e.rf];if(a)if(u){gu(n,(function(e){n[e]=c?c[e]:Dp}));try{gu(c,(function(t,r){Ef(e,n,t,r)})),c=n}catch(t){If((e.hdlr||{})[ah],r,"Assigning",t),a=!1}}else n&&n[gf]&&gu(n,(function(t){var r=wf(n,t);if(r){var o=r[e.prop];o&&o.chng()}}));if(c!==n){var l=c&&yf(s,e,c);!u&&l&&(c=Sf(e,c,r,"Converting")),n=c,a=l}e.add(o)}}})}(e,t,r,n)}return t}function kf(e,t,r,n){if(t){var o=wf(t,r),i=o&&!!o[e.prop],a=n&&n[0],s=n&&n[1],c=n&&n[2];if(!i){if(c)try{!function(e){if(e&&(Ql(e)||nu(e)))try{e[ff]=!0}catch(e){}}(t)}catch(t){If((e.hdlr||{})[ah],r,"Blocking",t)}try{Ef(e,t,r,t[r]),o=wf(t,r)}catch(t){If((e.hdlr||{})[ah],r,"State",t)}}a&&(o[e.rf]=a),s&&(o[e.ro]=s),c&&(o[e.blkVal]=!0)}return t}function Sf(e,t,r,n){try{gu(t,(function(r,n){Ef(e,t,r,n)})),t[gf]||(vu(t,gf,{get:function(){return e[lh]}}),function(e,t,r){nu(t)&&Rl(Tf,(function(n){var o=t[n];t[n]=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var a=o[sh](this,n);return Sf(e,t,r,"Patching"),a}}))}(e,t,r))}catch(t){If((e.hdlr||{})[ah],r,n,t)}return t}var bf="[[ai_",Af="]]";function _f(e){var t,r,n=wl(bf+"get"+e.uid+Af),o=wl(bf+"ro"+e.uid+Af),i=wl(bf+"rf"+e.uid+Af),a=wl(bf+"blkVal"+e.uid+Af),s=wl(bf+"dtl"+e.uid+Af),c=null,u=null;function l(t,n){var o=r.act;try{r.act=t,t&&t[s]&&(Rl(t[s],(function(e){e.clr(t)})),t[s]=[]),n({cfg:e.cfg,set:e.set.bind(e),setDf:e[oh].bind(e),ref:e.ref.bind(e),rdOnly:e[eh].bind(e)})}catch(t){var i=e[ah];throw i&&i[nh](1,107,Su(t)),t}finally{r.act=o||null}}function d(){if(c){var e=c;c=null,u&&u[dh](),u=null;var t=[];if(Rl(e,(function(e){if(e&&(e[s]&&(Rl(e[s],(function(t){t.clr(e)})),e[s]=null),e.fn))try{l(e,e.fn)}catch(e){t[ch](e)}})),c)try{d()}catch(e){t[ch](e)}t[Zd]>0&&function(e,t){jd||(jd=Ll("AggregationError",(function(e,t){t[Zd]>1&&(e.errors=t[1])})));var r=e||"One or more errors occurred.";throw Rl(t,(function(e,t){r+="\r\n".concat(t," > ").concat(Su(e))})),new jd(r,t||[])}("Watcher error(s): ",t)}}return(t={prop:n,ro:o,rf:i})[Xd]=a,t[lh]=e,t.add=function(e){if(e&&e.h[Zd]>0){c||(c=[]),u||(u=ld((function(){u=null,d()}),0));for(var t=0;t<e.h[Zd];t++){var r=e.h[t];r&&-1===Pl(c,r)&&c[ch](r)}}},t[th]=d,t.use=l,t.trk=function(e,t){if(e){var r=e[s]=e[s]||[];-1===Pl(r,t)&&r[ch](t)}},r=t}function Rf(e,t,r){var n,o=function(e){if(e){var t=e[gf]||e;if(t.cfg&&(t.cfg===e||t.cfg[gf]===t))return t}return null}(t);if(o)return o;var i,a=cf("dyncfg",!0),s=t&&!1!==r?t:vf(t);var c=((n={uid:null,cfg:s})[ah]=e,n[th]=function(){i[th]()},n.set=function(t,r,n){try{t=Ef(i,t,r,n)}catch(t){If(e,r,"Setting value",t)}return t[r]},n[oh]=function(e,t){return t&&gu(t,(function(t,r){pf(c,e,t,r)})),e},n[ih]=function(e){return function(e,t){var r={fn:t,rm:function(){r.fn=null,e=null,t=null}};return Cu(r,"toJSON",{v:function(){return"WatcherHandler"+(r.fn?"":"[X]")}}),e.use(r,t),r}(i,e)},n.ref=function(e,t){var r;return kf(i,e,t,(r={},r[0]=!0,r))[t]},n[eh]=function(e,t){var r;return kf(i,e,t,(r={},r[1]=!0,r))[t]},n[Xd]=function(e,t){var r;return kf(i,e,t,(r={},r[2]=!0,r))[t]},n._block=function(e,t){i.use(null,(function(r){var n=i.upd;try{Jc(t)||(i.upd=t),e(r)}finally{i.upd=n}}))},n);return Cu(c,"uid",{c:!1,e:!1,w:!1,v:a}),Sf(i=_f(c),s,"config","Creating"),c}function Pf(e,t,r,n){var o=Rf(r,e||{},n);return t&&o[oh](o.cfg,t),o}function Mf(e,t,r){var n=e[gf]||e;return!n.cfg||n.cfg!==e&&n.cfg[gf]!==n?(function(e,t){e?(e[rh](t),e[nh](2,108,t)):Cf(t)}(r,ag+Su(e)),Pf(e,null,r)[ih](t)):n[ih](t)}function Nf(e,t){if(e&&e[Ph])return e[Ph](t)}function Of(e,t,r){var n;return r||(n=Bp((function(e){r=e}))),e&&Zl(e)>0?fp(Nf(e[0],t),(function(){Of(Ml(e,1),t,r)})):r(),n}var qf="Microsoft_ApplicationInsights_BypassAjaxInstrumentation";function Uf(e){return{mrg:!0,v:e}}function xf(e){return{isVal:eu,v:Eu(e||Fp)}}var Lf,Bf,Hf=[$p,Jp,Xp,Zp],Df=null;function Ff(e,t){return function(){var r=arguments,n=Kf(t);if(n){var o=n.listener;o&&o[e]&&o[e][sh](o,r)}}}function Kf(e){var t,r=Df;return r||!0===e.disableDbgExt||(r=Df||((t=ul("Microsoft"))&&(Df=t.ApplicationInsights),Df)),r?r.ChromeDbgExt:null}var zf="warnToConsole",Gf={loggingLevelConsole:0,loggingLevelTelemetry:1,maxMessageLimit:25,enableDebug:!1},Qf=((Bf={})[0]=null,Bf[1]="errorToConsole",Bf[2]=zf,Bf[3]="debugToConsole",Bf);function jf(e){return e?'"'+e[Vh](/\"/g,Fp)+'"':Fp}function Wf(e,t){var r=typeof console!==yc?console:ul(bg);if(r){var n="log";r[e]&&(n=e),tu(r[n])&&r[n](t)}}var Vf=function(){function e(e,t,r,n){void 0===r&&(r=!1);var o=this;o[xh]=e,o[Lh]=(r?"AI: ":"AI (Internal): ")+e;var i=Fp;Dg()&&(i=(Dg()?JSON||ul(Ag):null).stringify(n));var a=(t?" message:"+jf(t):Fp)+(n?" props:"+jf(i):Fp);o[Lh]+=a}return e.dataType="MessageData",e}();function Yf(e,t){return(e||{})[ah]||new Xf(t)}var $f,Jf,Xf=function(){function e(t){this.identifier="DiagnosticLogger",this.queue=[];var r,n,o,i,a,s=0,c={};Qd(e,this,(function(e){function u(t,r){if(!(s>=o)){var i=!0,a="AITR_"+r[xh];if(c[a]?i=!1:c[a]=!0,i&&(t<=n&&(e.queue[ch](r),s++,l(1===t?"error":"warn",r)),s===o)){var u="Internal events throttle limit per PageView reached for this app.",d=new Vf(23,u,!1);e.queue[ch](d),1===t?e.errorToConsole(u):e[rh](u)}}}function l(e,r){var n=Kf(t||{});n&&n[Hh]&&n[Hh](e,r)}a=function(t){return Mf(Pf(t,Gf,e).cfg,(function(e){var t=e.cfg;r=t[Oh],n=t.loggingLevelTelemetry,o=t.maxMessageLimit,i=t.enableDebug}))}(t||{}),e.consoleLoggingLevel=function(){return r},e[nh]=function(t,n,o,a,s){void 0===s&&(s=!1);var d=new Vf(n,o,s,a);if(i)throw Su(d);var h=Qf[t]||zf;if(Jc(d[Lh]))l("throw"+(1===t?"Critical":"Warning"),d);else{if(s){var p=+d[xh];!c[p]&&r>=t&&(e[h](d[Lh]),c[p]=!0)}else r>=t&&e[h](d[Lh]);u(t,d)}},e.debugToConsole=function(e){Wf("debug",e),l("warning",e)},e[rh]=function(e){Wf("warn",e),l("warning",e)},e.errorToConsole=function(e){Wf("error",e),l("error",e)},e.resetInternalMessageCount=function(){s=0,c={}},e.logInternalMessage=u,e[Ph]=function(e){a&&a.rm(),a=null}}))}return e.__ieDyn=1,e}();function Zf(e){return e||new Xf}function em(e,t,r,n,o,i){void 0===i&&(i=!1),Zf(e)[nh](t,r,n,o,i)}function tm(e,t){Zf(e)[rh](t)}var rm,nm="toGMTString",om="toUTCString",im="cookie",am="expires",sm="isCookieUseDisabled",cm="disableCookiesUsage",um="_ckMgr",lm=null,dm=null,hm=null,pm={},gm={},fm=(($f={cookieCfg:Uf((Jf={},Jf[og]={fb:"cookieDomain",dfVal:lg},Jf.path={fb:"cookiePath",dfVal:lg},Jf.enabled=Dp,Jf.ignoreCookies=Dp,Jf.blockedCookies=Dp,Jf)),cookieDomain:Dp,cookiePath:Dp})[cm]=Dp,$f);function mm(){var e,t;!rm&&(e=function(){return dl()},t={},!Zu&&nl(),t.b=Zu.lzy,vu(t,"v",{configurable:!0,get:function(){var r=e();return Zu.lzy||vu(t,"v",{value:r}),t.b=Zu.lzy,r}}),rm=t)}function vm(e){return!e||e.isEnabled()}function ym(e,t){return!!(t&&e&&nu(e.ignoreCookies))&&-1!==Pl(e.ignoreCookies,t)}function Cm(e,t){var r=t[_h];if(Xc(r)){var n=void 0;Jc(e[sm])||(n=!e[sm]),Jc(e[cm])||(n=!e[cm]),r=n}return r}function Tm(e,t){var r;if(e)r=e.getCookieMgr();else if(t){var n=t.cookieCfg;r=n&&n[um]?n[um]:Im(t)}return r||(r=function(e,t){var r=Im[um]||gm[um];return r||(r=Im[um]=Im(e,t),gm[um]=r),r}(t,(e||{})[ah])),r}function Im(e,t){var r,n,o,i,a,s,c,u,l;e=Pf(e||gm,null,t).cfg,a=Mf(e,(function(t){t[oh](t.cfg,fm),n=t.ref(t.cfg,"cookieCfg"),o=n[ig]||"/",i=n[og],s=!1!==Cm(e,n),c=n.getCookie||bm,u=n.setCookie||Am,l=n.delCookie||Am}),t);var d=(r={isEnabled:function(){var r=!1!==Cm(e,n)&&s&&wm(t),o=gm[um];return r&&o&&d!==o&&(r=vm(o)),r},setEnabled:function(e){s=!1!==e,n[_h]=e},set:function(e,t,r,a,s){var c=!1;if(vm(d)&&!function(e,t){return!!(t&&e&&nu(e.blockedCookies)&&-1!==Pl(e.blockedCookies,t))||ym(e,t)}(n,e)){var l={},h=Gl(t||Fp),p=rd(h,";");if(-1!==p&&(h=Gl($u(t,p)),l=Em(Wu(t,p+1))),fg(l,og,a||i,uu,Jc),!Xc(r)){var g=Kg();if(Jc(l[am])){var f=Bl()+1e3*r;if(f>0){var m=new Date;m.setTime(f),fg(l,am,km(m,g?nm:om)||km(m,g?nm:om)||Fp,uu)}}g||fg(l,"max-age",Fp+r,null,Jc)}var v=Hg();v&&"https:"===v[Gh]&&(fg(l,"secure",null,null,Jc),null===dm&&(dm=!function(e){if(!eu(e))return!1;if(hg(e,"CPU iPhone OS 12")||hg(e,"iPad; CPU OS 12"))return!0;if(hg(e,"Macintosh; Intel Mac OS X 10_14")&&hg(e,"Version/")&&hg(e,"Safari"))return!0;if(hg(e,"Macintosh; Intel Mac OS X 10_14")&&ed(e,"AppleWebKit/605.1.15 (KHTML, like Gecko)"))return!0;if(hg(e,"Chrome/5")||hg(e,"Chrome/6"))return!0;if(hg(e,"UnrealEngine")&&!hg(e,"Chrome"))return!0;if(hg(e,"UCBrowser/12")||hg(e,"UCBrowser/11"))return!0;return!1}((ml()||{})[Qh])),dm&&fg(l,"SameSite","None",null,Jc)),fg(l,ig,s||o,null,Jc),u(e,Sm(h,l)),c=!0}return c},get:function(e){var t=Fp;return vm(d)&&!ym(n,e)&&(t=c(e)),t},del:function(e,t){var r=!1;return vm(d)&&(r=d.purge(e,t)),r},purge:function(e,r){var n,o=!1;if(wm(t)){var i=((n={})[ig]=r||"/",n[am]="Thu, 01 Jan 1970 00:00:01 GMT",n);Kg()||(i["max-age"]="0"),l(e,Sm(Fp,i)),o=!0}return o}},r[Ph]=function(e){a&&a.rm(),a=null},r);return d[um]=d,d}function wm(e){if(null===lm){lm=!1,!rm&&mm();try{var t=rm.v||{};lm=void 0!==t[im]}catch(t){em(e,2,68,"Cannot access document.cookie - "+gg(t),{exception:Su(t)})}}return lm}function Em(e){var t={};e&&e[Zd]&&Rl(Gl(e)[jh](";"),(function(e){if(e=Gl(e||Fp)){var r=rd(e,"=");-1===r?t[e]=null:t[Gl($u(e,r))]=Gl(Wu(e,r+1))}}));return t}function km(e,t){return tu(e[t])?e[t]():null}function Sm(e,t){var r=e||Fp;return gu(t,(function(e,t){r+="; "+e+(Xc(t)?Fp:"="+t)})),r}function bm(e){var t=Fp;if(!rm&&mm(),rm.v){var r=rm.v[im]||Fp;hm!==r&&(pm=Em(r),hm=r),t=Gl(pm[e]||Fp)}return t}function Am(e,t){!rm&&mm(),rm.v&&(rm.v[im]=e+"="+t)}var _m={perfEvtsSendAll:!1};function Rm(e){e.h=null;var t=e.cb;e.cb=[],Rl(t,(function(e){Vc(e.fn,[e.arg])}))}function Pm(e,t,r,n){Rl(e,(function(e){e&&e[t]&&(r?(r.cb[ch]({fn:n,arg:e}),r.h=r.h||ld(Rm,0,r)):Vc(n,[e]))}))}var Mm=function(){function e(t){var r,n;this.listeners=[];var o=[],i={h:null,cb:[]},a=Pf(t,_m);n=a[ih]((function(e){r=!!e.cfg.perfEvtsSendAll})),Qd(e,this,(function(e){Cu(e,"listeners",{g:function(){return o}}),e[fh]=function(e){o[ch](e)},e[gh]=function(e){for(var t=Pl(o,e);t>-1;)o[uh](t,1),t=Pl(o,e)},e[$p]=function(e){Pm(o,$p,i,(function(t){t[$p](e)}))},e[Jp]=function(e,t){Pm(o,Jp,i,(function(r){r[Jp](e,t)}))},e[Xp]=function(e,t){Pm(o,Xp,t?i:null,(function(r){r[Xp](e,t)}))},e[Zp]=function(e){e&&(!r&&e[ep]()||Pm(o,Zp,null,(function(t){e[Bh]?ld((function(){return t[Zp](e)}),0):t[Zp](e)})))},e[eg]=function(e){e&&e[Zd]&&Pm(o,eg,i,(function(t){t[eg](e)}))},e[tg]=function(e){e&&e[tp]&&Pm(o,tg,i,(function(t){t[tg](e)}))},e[rg]=function(e,t){if(e>0){var r=t||0;Pm(o,rg,i,(function(t){t[rg](e,r)}))}},e[Ph]=function(e){var t,r=function(){n&&n.rm(),n=null,o=[],i.h&&i.h[dh](),i.h=null,i.cb=[]};if(Pm(o,"unload",null,(function(r){var n=r[Ph](e);n&&(t||(t=[]),t[ch](n))})),t)return Bp((function(e){return fp(Hp(t),(function(){r(),e()}))}));r()}}))}return e.__ieDyn=1,e}(),Nm="ctx",Om="ParentContextKey",qm="ChildrenContextKey",Um=function(){function e(t,r,n){var o,i=this;(i.start=Bl(),i[wh]=t,i[Bh]=n,i[ep]=function(){return!1},tu(r))&&Cu(i,"payload",{g:function(){return!o&&tu(r)&&(o=r(),r=null),o}});i[rp]=function(t){return t?t===e[Om]||t===e[qm]?i[t]:(i[Nm]||{})[t]:null},i[np]=function(t,r){if(t)if(t===e[Om])i[t]||(i[ep]=function(){return!0}),i[t]=r;else if(t===e[qm])i[t]=r;else{(i[Nm]=i[Nm]||{})[t]=r}},i[op]=function(){var t=0,r=i[rp](e[qm]);if(nu(r))for(var n=0;n<r[Zd];n++){var o=r[n];o&&(t+=o[kh])}i[kh]=Bl()-i.start,i.exTime=i[kh]-t,i[op]=function(){}}}return e.ParentContextKey="parent",e.ChildrenContextKey="childEvts",e}(),xm=function(){function e(t){this.ctx={},Qd(e,this,(function(e){e.create=function(e,t,r){return new Um(e,t,r)},e.fire=function(e){e&&(e[op](),t&&tu(t[Zp])&&t[Zp](e))},e[np]=function(t,r){t&&((e[Nm]=e[Nm]||{})[t]=r)},e[rp]=function(t){return(e[Nm]||{})[t]}}))}return e.__ieDyn=1,e}(),Lm="CoreUtils.doPerf";function Bm(e,t,r,n,o){if(e){var i=e;if(i[ng]&&(i=i[ng]()),i){var a=void 0,s=i[rp](Lm);try{if(a=i.create(t(),n,o)){if(s&&a[np]&&(a[np](Um[Om],s),s[rp]&&s[np])){var c=s[rp](Um[qm]);c||(c=[],s[np](Um[qm],c)),c[ch](a)}return i[np](Lm,a),r(a)}}catch(e){a&&a[np]&&a[np]("exception",e)}finally{a&&i.fire(a),i[np](Lm,s)}}}return r()}function Hm(){var e=Dm();return Wu(e,0,8)+"-"+Wu(e,8,12)+"-"+Wu(e,12,16)+"-"+Wu(e,16,20)+"-"+Wu(e,20)}function Dm(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],r=Fp,n=0;n<4;n++)r+=t[15&(e=tf())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var o=t[8+(3&tf())|0];return Vu(r,0,8)+Vu(r,9,4)+"4"+Vu(r,13,3)+o+Vu(r,16,3)+Vu(r,19,12)}var Fm="00000000000000000000000000000000",Km="0000000000000000";function zm(e,t,r){return!(!e||e[Zd]!==t||e===r)&&!!e.match(/^[\da-f]*$/i)}function Gm(e){return zm(e,32,Fm)}function Qm(e){return zm(e,16,Km)}var jm=uf("plugin");function Wm(e){return jm.get(e,"state",{},!0)}function Vm(e,t){for(var r,n=[],o=null,i=e[Kh]();i;){var a=i[Ih]();if(a){o&&o[zh]&&a[Vp]&&o[zh](a);var s=!!(r=Wm(a))[mh];a[mh]&&(s=a[mh]()),s||n[ch](a),o=a,i=i[Kh]()}}Rl(n,(function(n){var o=e[zp]();n[hh](e.getCfg(),o,t,e[Kh]()),r=Wm(n),n[zp]||r[zp]||(r[zp]=o),r[mh]=!0,delete r[Uh]}))}function Ym(e){return e.sort((function(e,t){var r=0;if(t){var n=t[Vp];e[Vp]?r=n?e[Yp]-t[Yp]:1:n&&(r=-1)}else r=e?1:-1;return r}))}var $m,Jm="TelemetryPluginChain",Xm="_hasRun",Zm="_getTelCtx",ev=0;function tv(e,t,r,n){var o=null,i=[];t||(t=Pf({},null,r[ah])),null!==n&&(o=n?function(e,t,r){for(;e;){if(e[Ih]()===r)return e;e=e[Kh]()}return iv([r],t.config||{},t)}(e,r,n):e);var a={_next:function(){var e=o;if(o=e?e[Kh]():null,!e){var t=i;t&&t[Zd]>0&&(Rl(t,(function(e){try{e.func.call(e.self,e.args)}catch(e){em(r[ah],2,73,"Unexpected Exception during onComplete - "+Su(e))}})),i=[])}return e},ctx:{core:function(){return r},diagLog:function(){return Yf(r,t.cfg)},getCfg:function(){return t.cfg},getExtCfg:function(e,r){var n=s(e,!0);r&&gu(r,(function(e,r){if(Xc(n[e])){var o=t.cfg[e];!o&&Xc(o)||(n[e]=o)}pf(t,n,e,r)}));return t[oh](n,r)},getConfig:function(e,r,n){void 0===n&&(n=!1);var o,i=s(e,!1),a=t.cfg;!i||!i[r]&&Xc(i[r])?!a[r]&&Xc(a[r])||(o=a[r]):o=i[r];return o||!Xc(o)?o:n},hasNext:function(){return!!o},getNext:function(){return o},setNext:function(e){o=e},iterate:function(e){var t;for(;t=a._next();){var r=t[Ih]();r&&e(r)}},onComplete:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e&&i[ch]({func:e,self:Jc(t)?a.ctx:t,args:r})}}};function s(e,r){var n=null,o=t.cfg;if(o&&e){var i=o[jp];!i&&r&&(i={}),o[jp]=i,(i=t.ref(o,jp))&&(!(n=i[e])&&r&&(n={}),i[e]=n,n=t.ref(i,e))}return n}return a}function rv(e,t,r,n){var o=Pf(t),i=tv(e,o,r,n),a=i.ctx;return a[Sh]=function(e){var t=i._next();return t&&t[Vp](e,a),!t},a[qh]=function(e,t){return void 0===e&&(e=null),nu(e)&&(e=iv(e,o.cfg,r,t)),rv(e||a[Kh](),o.cfg,r,t)},a}function nv(e,t,r){var n=Pf(t.config),o=tv(e,n,t,r),i=o.ctx;return i[Sh]=function(e){var t=o._next();return t&&t[Ph](i,e),!t},i[qh]=function(e,r){return void 0===e&&(e=null),nu(e)&&(e=iv(e,n.cfg,t,r)),nv(e||i[Kh](),t,r)},i}function ov(e,t,r){var n=Pf(t.config),o=tv(e,n,t,r).ctx;return o[Sh]=function(e){return o.iterate((function(t){tu(t[Fh])&&t[Fh](o,e)}))},o[qh]=function(e,r){return void 0===e&&(e=null),nu(e)&&(e=iv(e,n.cfg,t,r)),ov(e||o[Kh](),t,r)},o}function iv(e,t,r,n){var o=null,i=!n;if(nu(e)&&e[Zd]>0){var a=null;Rl(e,(function(e){if(i||n!==e||(i=!0),i&&e&&tu(e[Vp])){var s=function(e,t,r){var n,o=null,i=tu(e[Vp]),a=tu(e[zh]);n=e?e[ph]+"-"+e[Yp]+"-"+ev++:"Unknown-0-"+ev++;var s={getPlugin:function(){return e},getNext:function(){return o},processTelemetry:l,unload:d,update:h,_id:n,_setNext:function(e){o=e}};function c(){var n;return e&&tu(e[Zm])&&(n=e[Zm]()),n||(n=rv(s,t,r)),n}function u(t,r,i,a,s){var c=!1,u=e?e[ph]:Jm,l=t[Xm];return l||(l=t[Xm]={}),t.setNext(o),e&&Bm(t[zp](),(function(){return u+":"+i}),(function(){l[n]=!0;try{var e=o?o._id:Fp;e&&(l[e]=!1),c=r(t)}catch(e){var a=!o||l[o._id];a&&(c=!0),o&&a||em(t[Hh](),1,73,"Plugin ["+u+"] failed during "+i+" - "+Su(e)+", run flags: "+Su(l))}}),a,s),c}function l(t,r){function n(r){if(!e||!i)return!1;var n=Wm(e);return!n[Uh]&&!n[Qp]&&(a&&e[zh](o),e[Vp](t,r),!0)}u(r=r||c(),n,"processTelemetry",(function(){return{item:t}}),!t.sync)||r[Sh](t)}function d(t,r){function n(){var n=!1;if(e){var o=Wm(e),i=e[zp]||o[zp];!e||i&&i!==t.core()||o[Uh]||(o[zp]=null,o[Uh]=!0,o[mh]=!1,e[Uh]&&!0===e[Uh](t,r)&&(n=!0))}return n}u(t,n,"unload",(function(){}),r[Bh])||t[Sh](r)}function h(t,r){function n(){var n=!1;if(e){var o=Wm(e),i=e[zp]||o[zp];!e||i&&i!==t.core()||o[Uh]||e[Fh]&&!0===e[Fh](t,r)&&(n=!0)}return n}u(t,n,"update",(function(){}),!1)||t[Sh](r)}return qu(s)}(e,t,r);o||(o=s),a&&a._setNext(s),a=s}}))}return n&&!o?iv([n],t,r):o}function av(){var e=[];return{add:function(t){t&&e[ch](t)},run:function(t,r){Rl(e,(function(e){try{e(t,r)}catch(e){em(t[Hh](),2,73,"Unexpected error calling unload handler - "+Su(e))}})),e=[]}}}function sv(){var e=[];return{run:function(t){var r=e;e=[],Rl(r,(function(e){try{(e.rm||e.remove).call(e)}catch(e){em(t,2,73,"Unloading:"+Su(e))}}))},add:function(t){t&&_l(e,t)}}}var cv="getPlugin",uv=(($m={})[jp]={isVal:lg,v:{}},$m),lv=function(){function e(){var t,r,n,o,i,a=this;function s(e){void 0===e&&(e=null);var t=e;if(!t){var o=r||rv(null,{},a[zp]);t=n&&n[cv]?o[qh](null,n[cv]):o[qh](null,n)}return t}function c(e,t,o){Pf(e,uv,Yf(t)),!o&&t&&(o=t[bh]()[Kh]());var i=n;n&&n[cv]&&(i=n[cv]()),a[zp]=t,r=rv(o,e,t,i)}function u(){t=!1,a[zp]=null,r=null,n=null,i=sv(),o=av()}u(),Qd(e,a,(function(e){e[hh]=function(e,r,n,o){c(e,r,o),t=!0},e[Uh]=function(t,r){var a,s=e[zp];if(s&&(!t||s===t[zp]())){var c,l=!1,d=t||nv(null,s,n&&n[cv]?n[cv]():n),h=r||((a={reason:0})[Bh]=!1,a);return e[Dh]&&!0===e[Dh](d,h,p)?c=!0:p(),c}function p(){l||(l=!0,o.run(d,r),i.run(d[Hh]()),!0===c&&d[Sh](h),u())}},e[Fh]=function(t,r){var o=e[zp];if(o&&(!t||o===t[zp]())){var i,a=!1,s=t||ov(null,o,n&&n[cv]?n[cv]():n),u=r||{reason:0};return e._doUpdate&&!0===e._doUpdate(s,u,l)?i=!0:l(),i}function l(){a||(a=!0,c(s.getCfg(),s.core(),s[Kh]()))}},mg(e,"_addUnloadCb",(function(){return o}),"add"),mg(e,"_addHook",(function(){return i}),"add"),Cu(e,"_unloadHooks",{g:function(){return i}})})),a[Hh]=function(e){return s(e)[Hh]()},a[mh]=function(){return t},a.setInitialized=function(e){t=e},a[zh]=function(e){n=e},a[Sh]=function(e,t){t?t[Sh](e):n&&tu(n[Vp])&&n[Vp](e,null)},a._getTelCtx=s}return e.__ieDyn=1,e}();var dv,hv=function(e){function t(){var r,n,o=e.call(this)||this;function i(){r=0,n=[]}return o.identifier="TelemetryInitializerPlugin",o.priority=199,i(),Qd(t,o,(function(e,t){e.addTelemetryInitializer=function(e){return function(e,t,r){var n={id:t,fn:r};return _l(e,n),{remove:function(){Rl(e,(function(t,r){if(t.id===n.id)return e[uh](r,1),-1}))}}}(n,r++,e)},e[Vp]=function(t,r){(function(e,t,r){for(var n=!1,o=e[Zd],i=0;i<o;++i){var a=e[i];if(a)try{if(!1===a.fn[sh](null,[t])){n=!0;break}}catch(e){em(r,2,64,"Telemetry initializer failed: "+gg(e),{exception:Su(e)},!0)}}return!n})(n,t,r?r[Hh]():e[Hh]())&&e[Sh](t,r)},e[Dh]=function(){i()}})),o}return pd(t,e),t.__ieDyn=1,t}(lv),pv="Plugins must provide initialize method",gv="SDK is still unloading...",fv=Ou(((dv={cookieCfg:{}})[Wp]={rdOnly:!0,ref:!0,v:[]},dv[Kp]={rdOnly:!0,ref:!0,v:[]},dv[jp]={ref:!0,v:{}},dv[Gp]=Dp,dv.loggingLevelConsole=0,dv.diagnosticLogInterval=Dp,dv));function mv(e,t){return new xm(t)}function vv(e,t){var r=!1;return Rl(t,(function(t){if(t===e)return r=!0,-1})),r}function yv(e,t,r,n){r&&gu(r,(function(r,o){n&&Ql(o)&&Ql(t[r])&&yv(e,t[r],o,n),n&&Ql(o)&&Ql(t[r])?yv(e,t[r],o,n):e.set(t,r,o)}))}function Cv(e,t){var r=null,n=-1;return Rl(e,(function(e,o){if(e.w===t)return r=e,n=o,-1})),{i:n,l:r}}function Tv(e,t,r,n){return t.add(e[ih]((function(e){var t=e.cfg.disableDbgExt;!0===t&&n&&(r[gh](n),n=null),r&&!n&&!0!==t&&(n=function(e){if(!Lf){Lf={};for(var t=0;t<Hf[Zd];t++)Lf[Hf[t]]=Ff(Hf[t],e)}return Lf}(e.cfg),r[fh](n))}))),n}var Iv=function(){function e(){var t,r,n,o,i,a,s,c,u,l,d,h,p,g,f,m,v,y,C,T,I,w,E,k,S,b,A,_,R,P,M,N;Qd(e,this,(function(e){function O(){R=!0,Xc(I)?(b=$d[yh],em(n,1,112,"ikey can't be resolved from promises")):b=$d.ACTIVE,q()}function q(){r&&(e.releaseQueue(),e[Ah]())}function U(e){P&&P[_h]||N||(e||n&&n.queue[Zd]>0)&&(M||(M=!0,V(t[ih]((function(e){var t=e.cfg.diagnosticLogInterval;t&&t>0||(t=1e4);var r=!1;P&&(r=P[_h],P[dh]()),P=function(e,t){return ud(!1,Sc,Wc[Bc](arguments))}(z,t),P.unref(),P[_h]=r})))),P[_h]=!0);return P}function x(){var e={};k=[];var t=function(t){t&&Rl(t,(function(t){if(t[ph]&&t[Nh]&&!e[t.identifier]){var r=t[ph]+"="+t[Nh];k[ch](r),e[t.identifier]=t}}))};t(h),d&&Rl(d,(function(e){t(e)})),t(l)}function L(){r=!1,(t=Pf({},fv,e[ah])).cfg[Oh]=1,Cu(e,"config",{g:function(){return t.cfg},s:function(t){e.updateCfg(t,!1)}}),Cu(e,"pluginVersionStringArr",{g:function(){return k||x(),k}}),Cu(e,"pluginVersionString",{g:function(){return S||(k||x(),S=k.join(";")),S||Fp}}),Cu(e,"logger",{g:function(){return n||(n=new Xf(t.cfg),t[ah]=n),n},s:function(e){t[ah]=e,n!==e&&(Nf(n,!1),n=e)}}),e[ah]=new Xf(t.cfg),E=[];var C=e.config[Wp]||[];C.splice(0,C[Zd]),_l(C,E),g=new hv,o=[],Nf(i,!1),i=null,a=null,s=null,Nf(c,!1),c=null,u=null,l=[],d=null,h=null,p=!1,f=null,m=cf("AIBaseCore",!0),v=av(),T=null,I=null,y=sv(),w=[],S=null,k=null,N=!1,P=null,M=!1,b=0,A=null,_=null,R=!1}function B(){var r=rv(F(),t.cfg,e);return r[Mh](U),r}function H(t){var r=function(e,t,r){var n,o=[],i=[],a={};return Rl(r,(function(r){(Xc(r)||Xc(r[hh]))&&bu(pv);var n=r[Yp],s=r[ph];r&&n&&(Xc(a[n])?a[n]=s:tm(e,"Two extensions have same priority #"+n+" - "+a[n]+", "+s)),!n||n<t?o[ch](r):i[ch](r)})),(n={})[zp]=o,n[Kp]=i,n}(e[ah],500,l);u=null,S=null,k=null,h=Ym(_l(h=(d||[])[0]||[],r[Kp]));var n=_l(Ym(r[zp]),h);E=qu(n);var o=e.config[Wp]||[];o.splice(0,o[Zd]),_l(o,E);var i=B();h&&h[Zd]>0&&Vm(i[qh](h),n),Vm(i,n),t&&Q(t)}function D(e){var t=null,r=null,n=[];return Rl(E,(function(t){if(t[ph]===e&&t!==g)return r=t,-1;t.getChannel&&n[ch](t)})),!r&&n[Zd]>0&&Rl(n,(function(t){if(!(r=t.getChannel(e)))return-1})),r&&(t={plugin:r,setEnabled:function(e){Wm(r)[Qp]=!e},isEnabled:function(){var e=Wm(r);return!e[Uh]&&!e[Qp]},remove:function(e,t){var n;void 0===e&&(e=!0);var o=[r],i=((n={reason:1})[Bh]=e,n);K(o,i,(function(e){e&&H({reason:32,removed:o}),t&&t(e)}))}}),t}function F(){if(!u){var r=(E||[]).slice();-1===Pl(r,g)&&r[ch](g),u=iv(Ym(r),t.cfg,e)}return u}function K(r,n,o){if(r&&r[Zd]>0){var i=nv(iv(r,t.cfg,e),e);i[Mh]((function(){var e=!1,t=[];Rl(l,(function(n,o){vv(n,r)?e=!0:t[ch](n)})),l=t,S=null,k=null;var n=[];d&&(Rl(d,(function(t,o){var i=[];Rl(t,(function(t){vv(t,r)?e=!0:i[ch](t)})),n[ch](i)})),d=n),o&&o(e),U()})),i[Sh](n)}else o(!1)}function z(){if(n&&n.queue){var t=n.queue.slice(0);n.queue[Zd]=0,Rl(t,(function(t){var r,n=((r={})[wh]=f||"InternalMessageId: "+t[xh],r[Eh]=I,r[kh]=pg(new Date),r.baseType=Vf.dataType,r.baseData={message:t[Lh]},r);e.track(n)}))}}function G(e,t,r,n){var o=1,i=!1,a=null;function s(){o--,i&&0===o&&(a&&a[dh](),a=null,t&&t(i),t=null)}(n=n||5e3,h&&h[Zd]>0)&&B()[qh](h).iterate((function(t){if(t.flush){o++;var i=!1;t.flush(e,(function(){i=!0,s()}),r)||i||(e&&null==a?a=ld((function(){a=null,s()}),n):s())}}));return i=!0,s(),!0}function Q(t){var r=ov(F(),e);r[Mh](U),e._updateHook&&!0===e._updateHook(r,t)||r[Sh](t)}function j(t){var r=e[ah];r?(em(r,2,73,t),U()):bu(t)}function W(t){var r=e[Th]();r&&r[Jp]([t],2)}function V(e){y.add(e)}L(),e._getDbgPlgTargets=function(){return[E,o]},e[mh]=function(){return r},e.activeStatus=function(){return b},e._setPendingStatus=function(){b=3},e[hh]=function(o,c,u,g){var f;p&&bu(gv),e[mh]()&&bu("Core cannot be initialized more than once"),t=Pf(o,fv,u||e[ah],!1),o=t.cfg,V(t[ih]((function(e){var t=e.cfg;if(!(3===b)){_=t.initInMemoMaxSize||100;var i=t[vh],a=t.endpointUrl;if(Xc(i)){I=null,b=$d[yh];var s="Please provide instrumentation key";r?(em(n,1,100,s),q()):bu(s)}else{var c=[];if(cu(i)?(c[ch](i),I=null):I=i,cu(a)?(c[ch](a),A=null):A=a,c[Zd]){R=!1,b=3;var u=lg(t.initTimeOut)?t.initTimeOut:5e4,l=Lp(c);ld((function(){R||O()}),u),fp(l,(function(e){try{if(R)return;if(!e.rejected){var t=e[Ch];if(t&&t[Zd]){var r=t[0];if(I=r&&r[Ch],t[Zd]>1){var n=t[1];A=n&&n[Ch]}}I&&(o[vh]=I,o.endpointUrl=A)}O()}catch(e){R||O()}}))}else O();var d=e.ref(e.cfg,jp);gu(d,(function(t){e.ref(d,t)}))}}}))),C=Tv(t,y,(i=g)&&e[Th](),C),V(t[ih]((function(t){var r,n,o,i;if(t.cfg.enablePerfMgr){var c=t.cfg[Gp];f!==c&&(c||(c=mv),r=t.cfg,n=Gp,o=c,r?!(i=r[n])&&Xc(i)&&(i=Jc(o)?{}:o,r[n]=i):i=Jc(o)?{}:o,f=c,s=null),a||s||!tu(c)||(s=c(e,e[Th]()))}else s=null,f=null}))),e[ah]=u;var m=o[Wp];if((l=[])[ch].apply(l,gd(gd([],c),m)),d=o[Kp],H(null),h&&0!==h[Zd]||bu("No "+Kp+" available"),d&&d[Zd]>1){var v=e[Ih]("TeeChannelController");v&&v.plugin||em(n,1,28,"TeeChannel required")}!function(e,t,r){Rl(t,(function(t){var n=Mf(e,t.w,r);delete t.w,t.rm=function(){n.rm()}}))}(o,w,n),w=null,r=!0,b===$d.ACTIVE&&q()},e.getChannels=function(){var e=[];return h&&Rl(h,(function(t){e[ch](t)})),qu(e)},e.track=function(t){Bm(e[ng](),(function(){return"AppInsightsCore:track"}),(function(){null===t&&(W(t),bu("Invalid telemetry item")),!t[wh]&&Xc(t[wh])&&(W(t),bu("telemetry name required")),t[Eh]=t[Eh]||I,t[kh]=t[kh]||pg(new Date),t.ver=t.ver||"4.0",!p&&e[mh]()&&b===$d.ACTIVE?B()[Sh](t):b!==$d[yh]&&o[Zd]<=_&&o[ch](t)}),(function(){return{item:t}}),!t.sync)},e[bh]=B,e[Th]=function(){return i||(i=new Mm(t.cfg),e._notificationManager=i),i},e[fh]=function(t){e.getNotifyMgr()[fh](t)},e[gh]=function(e){i&&i[gh](e)},e.getCookieMgr=function(){return c||(c=Im(t.cfg,e[ah])),c},e.setCookieMgr=function(e){c!==e&&(Nf(c,!1),c=e)},e[ng]=function(){return a||s||null},e.setPerfMgr=function(e){a=e},e.eventCnt=function(){return o[Zd]},e.releaseQueue=function(){if(r&&o[Zd]>0){var e=o;o=[],2===b?Rl(e,(function(e){e[Eh]=e[Eh]||I,B()[Sh](e)})):em(n,2,20,"core init status is not active")}},e[Ah]=function(e){return f=e||null,N=!1,P&&P[dh](),U(!0)},e[Rh]=function(){N=!0,P&&P[dh](),z()},vg(e,(function(){return g}),["addTelemetryInitializer"]),e[Ph]=function(t,o,a){var s;void 0===t&&(t=!0),r||bu("SDK is not initialized"),p&&bu(gv);var u,l=((s={reason:50})[Bh]=t,s.flushComplete=!1,s);t&&!o&&(u=Bp((function(e){o=e})));var d=nv(F(),e);return d[Mh]((function(){y.run(e[ah]),Of([c,i,n],t,(function(){L(),o&&o(l)}))}),e),z(),G(t,(function(t){l.flushComplete=t,p=!0,v.run(d,l),e[Rh](),d[Sh](l)}),6,a),u},e[Ih]=D,e.addPlugin=function(e,t,r,n){if(!e)return n&&n(!1),void j(pv);var o=D(e[ph]);if(o&&!t)return n&&n(!1),void j("Plugin ["+e[ph]+"] is already loaded!");var i={reason:16};function a(t){l[ch](e),i.added=[e],H(i),n&&n(!0)}if(o){var s=[o.plugin];K(s,{reason:2,isAsync:!!r},(function(e){e?(i.removed=s,i.reason|=32,a()):n&&n(!1)}))}else a()},e.updateCfg=function(r,n){var o;if(void 0===n&&(n=!0),e[mh]()){o={reason:1,cfg:t.cfg,oldCfg:Xl({},t.cfg),newConfig:Xl({},r),merge:n},r=o.newConfig;var i=t.cfg;r[Wp]=i[Wp],r[Kp]=i[Kp]}t._block((function(e){var t=e.cfg;yv(e,t,r,n),n||gu(t,(function(n){hu(r,n)||e.set(t,n,Dp)})),e[oh](t,fv)}),!0),t[th](),o&&Q(o)},e.evtNamespace=function(){return m},e.flush=G,e.getTraceCtx=function(e){var t,r;return T||(r={},T={getName:function(){return r[wh]},setName:function(e){t&&t.setName(e),r[wh]=e},getTraceId:function(){return r[lp]},setTraceId:function(e){t&&t.setTraceId(e),Gm(e)&&(r[lp]=e)},getSpanId:function(){return r[dp]},setSpanId:function(e){t&&t.setSpanId(e),Qm(e)&&(r[dp]=e)},getTraceFlags:function(){return r[hp]},setTraceFlags:function(e){t&&t.setTraceFlags(e),r[hp]=e}}),T},e.setTraceCtx=function(e){T=e||null},e.addUnloadHook=V,mg(e,"addUnloadCb",(function(){return v}),"add"),e.onCfgChange=function(n){var o,i,a,s;return r?o=Mf(t.cfg,n,e[ah]):((s=Cv(i=w,a=n).l)||(s={w:a,rm:function(){var e=Cv(i,a);-1!==e.i&&i[uh](e.i,1)}},i[ch](s)),o=s),function(e){return Cu({rm:function(){e.rm()}},"toJSON",{v:function(){return"aicore::onCfgChange<"+JSON.stringify(e)+">"}})}(o)},e.getWParam=function(){return ll()||t.cfg.enableWParam?0:-1}}))}return e.__ieDyn=1,e}(),wv="",Ev="&NoResponseBody=true",kv="POST",Sv=function(){function e(){var t,r,n,o,i,a,s,c,u,l,d,h,p,g,f=0;Qd(e,this,(function(e,m){var v=!0;function y(e,t){em(n,2,26,"Failed to send telemetry.",{message:e}),T(t,400,{})}function C(e){y("No endpoint url is provided for the batch",e)}function T(e,t,r,n){try{e&&e(t,r,n)}catch(e){}}function I(e,t){var r=ml(),n=e[ip];if(!n)return C(t),!0;n=e[ip]+(p?Ev:wv);var i=e[tp],a=o?i:new Blob([i],{type:"text/plain;charset=UTF-8"});return r.sendBeacon(n,a)}function w(e,t,r){var a=e[tp];try{if(a)if(I(e,t))T(t,200,{},wv);else{var s=i&&i.beaconOnRetry;s&&tu(s)?s(e,t,I):(c&&c[ap](e,t,!0),em(n,2,40,". Failed to send telemetry with Beacon API, retried with normal sender."))}}catch(e){o&&tm(n,"Failed to send telemetry using sendBeacon API. Ex:"+Su(e)),T(t,o?0:400,{},wv)}}function E(e,r,n){var a,s,c,u=e[sp]||{};!n&&t&&(a=Bp((function(e,t){s=e,c=t}))),o&&n&&e.disableXhrSync&&(n=!1);var l=e[ip];if(!l)return C(r),void(s&&s(!1));var d=function(e,t,r,n,o,i){function a(e,t,r){try{e[t]=r}catch(e){}}void 0===n&&(n=!1),void 0===o&&(o=!1);var s=new XMLHttpRequest;return n&&a(s,"Microsoft_ApplicationInsights_BypassAjaxInstrumentation",n),r&&a(s,wg,r),s.open(e,t,!o),r&&a(s,wg,r),!o&&i&&a(s,"timeout",i),s}(kv,l,v,!0,n,e[cp]);function h(t){var n=i&&i.xhrOnComplete;if(n&&tu(n))n(t,r,e);else{var a=Cg(t);T(r,t[Jh],kg(t,o),a)}}return o||d[up]("Content-type","application/json"),Rl(Nu(u),(function(e){d[up](e,u[e])})),d.onreadystatechange=function(){o||(h(d),4===d.readyState&&s&&s(!0))},d.onload=function(){o&&h(d)},d.onerror=function(e){T(r,o?d[Jh]:400,kg(d,o),o?wv:Tg(d)),c&&c(e)},d.ontimeout=function(){T(r,o?d[Jh]:500,kg(d,o),o?wv:Tg(d)),s&&s(!1)},d.send(e[tp]),a}function k(e,r,n){var a,c,u,l,d=e[ip],h=e[tp],m=o?h:new Blob([h],{type:"application/json"}),y=new Headers,I=h[Zd],w=!1,E=!1,k=e[sp]||{},S=((a={method:kv,body:m})[qf]=!0,a);e.headers&&Nu(e.headers)[Zd]>0&&(Rl(Nu(k),(function(e){y.append(e,k[e])})),S[sp]=y),s?S.credentials=s:v&&o&&(S.credentials="include"),n&&(S.keepalive=!0,f+=I,o?2===e._sendReason&&(w=!0,p&&(d+=Ev)):w=!0);var b=new Request(d,S);try{b[qf]=!0}catch(e){}if(!n&&t&&(c=Bp((function(e,t){u=e,l=t}))),!d)return C(r),void(u&&u(!1));function A(e){T(r,o?0:400,{},o?wv:e)}function _(e,t,n){var o=e[Jh],a=i.fetchOnComplete;a&&tu(a)?a(e,r,n||wv,t):T(r,o,{},n||wv)}try{fp(fetch(o?d:b,o?S:null),(function(t){if(n&&(f-=I,I=0),!E)if(E=!0,t.rejected)A(t.reason&&t.reason[Lh]),l&&l(t.reason);else{var r=t[Ch];try{o||r.ok?o&&!r.body?(_(r,null,wv),u&&u(!0)):fp(r.text(),(function(t){_(r,e,t[Ch]),u&&u(!0)})):(A(r.statusText),u&&u(!1))}catch(e){A(Su(e)),l&&l(e)}}}))}catch(e){E||(A(Su(e)),l&&l(e))}return w&&!E&&(E=!0,T(r,200,{}),u&&u(!0)),o&&!E&&e[cp]>0&&g&&g.set((function(){E||(E=!0,T(r,500,{}),u&&u(!0))}),e[cp]),c}function S(e,t,r){var a=hl(),s=new XDomainRequest,c=e[tp];s.onload=function(){var r=Cg(s),n=i&&i.xdrOnComplete;n&&tu(n)?n(s,t,e):T(t,200,{},r)},s.onerror=function(){T(t,400,{},o?wv:function(e,t){return e?"XDomainRequest,Response:"+Cg(e)||"":t}(s))},s.ontimeout=function(){T(t,500,{})},s.onprogress=function(){};var u=a&&a.location&&a.location[Gh]||"",l=e[ip];if(l){if(!o&&0!==l.lastIndexOf(u,0)){var d="Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol.";return em(n,2,40,". "+d),void y(d,t)}var h=o?l:l[Vh](/^(https?:)/,"");s.open(kv,h),e[cp]&&(s[cp]=e[cp]),s.send(c),o&&r?g&&g.set((function(){s.send(c)}),0):s.send(c)}else C(t)}function b(){f=0,r=!1,t=!1,n=null,o=null,i=null,a=null,s=null,c=null,u=!1,l=!1,d=!1,h=!1,p=!1,g=null}b(),e[hh]=function(t,o){n=o,r&&em(n,1,28,"Sender is already initialized"),e.SetConfig(t),r=!0},e._getDbgPlgTargets=function(){return[r,o,a,t]},e.SetConfig=function(e){try{if(i=e.senderOnCompleteCallBack||{},a=!!e.disableCredentials,s=e.fetchCredentials,o=!!e.isOneDs,t=!!e.enableSendPromise,u=!!e.disableXhr,l=!!e.disableBeacon,d=!!e.disableBeaconSync,g=e.timeWrapper,p=!!e.addNoResponse,h=!!e.disableFetchKeepAlive,c={sendPOST:E},o||(v=!1),a){var r=Hg();r&&r.protocol&&"file:"===r.protocol[Jd]()&&(v=!1)}return!0}catch(e){}return!1},e.getSyncFetchPayload=function(){return f},e.getSenderInst=function(e,t){return e&&e[Zd]?function(e,t){var r,n=0,o=null,i=0;for(;null==o&&i<e[Zd];)n=e[i],u||1!==n?2!==n||!Gg(t)||t&&h?3!==n||!zg()||(t?d:l)||(o=w):o=k:Qg()?o=S:jg()&&(o=E),i++;if(o)return(r={_transport:n,_isSync:t})[ap]=o,r;return null}(e,t):null},e.getFallbackInst=function(){return c},e[Dh]=function(e,t){b()}}))}return e.__ieDyn=1,e}(),bv="on",Av="attachEvent",_v="addEventListener",Rv="detachEvent",Pv="removeEventListener",Mv="events",Nv="visibilitychange",Ov="pagehide",qv="pageshow",Uv="unload",xv="beforeunload",Lv=cf("aiEvtPageHide"),Bv=cf("aiEvtPageShow"),Hv=/\.[\.]+/g,Dv=/[\.]+$/,Fv=1,Kv=uf("events"),zv=/^([^.]*)(?:\.(.+)|)/;function Gv(e){return e&&e[Vh]?e[Vh](/^[\s\.]+|(?=[\s\.])[\.\s]+$/g,Fp):e}function Qv(e,t){var r;if(t){var n=Fp;nu(t)?(n=Fp,Rl(t,(function(e){(e=Gv(e))&&("."!==e[0]&&(e="."+e),n+=e)}))):n=Gv(t),n&&("."!==n[0]&&(n="."+n),e=(e||Fp)+n)}var o=zv.exec(e||Fp)||[];return(r={})[Yh]=o[1],r.ns=(o[2]||Fp).replace(Hv,".").replace(Dv,Fp)[jh](".").sort().join("."),r}function jv(e,t,r){void 0===r&&(r=!0);var n=Kv.get(e,Mv,{},r),o=n[t];return o||(o=n[t]=[]),o}function Wv(e,t,r,n){e&&t&&t[Yh]&&(e[Pv]?e[Pv](t[Yh],r,n):e[Rv]&&e[Rv](bv+t[Yh],r))}function Vv(e,t,r,n){for(var o=t[Zd];o--;){var i=t[o];i&&(r.ns&&r.ns!==i.evtName.ns||n&&!n(i)||(Wv(e,i.evtName,i[$h],i.capture),t[uh](o,1)))}}function Yv(e,t){return t?Qv("xx",nu(t)?[e].concat(t):[e,t]).ns[jh]("."):e}function $v(e,t,r,n,o){var i;void 0===o&&(o=!1);var a=!1;if(e)try{var s=Qv(t,n);if(a=function(e,t,r,n){var o=!1;return e&&t&&t[Yh]&&r&&(e[_v]?(e[_v](t[Yh],r,n),o=!0):e[Av]&&(e[Av](bv+t[Yh],r),o=!0)),o}(e,s,r,o),a&&Kv.accept(e)){var c=((i={guid:Fv++,evtName:s})[$h]=r,i.capture=o,i);jv(e,s.type)[ch](c)}}catch(e){}return a}function Jv(e,t,r,n,o){if(void 0===o&&(o=!1),e)try{var i=Qv(t,n),a=!1;!function(e,t,r){if(t[Yh])Vv(e,jv(e,t[Yh]),t,r);else{var n=Kv.get(e,Mv,{});gu(n,(function(n,o){Vv(e,o,t,r)})),0===Nu(n)[Zd]&&Kv.kill(e,Mv)}}(e,i,(function(e){return!((!i.ns||r)&&e[$h]!==r)&&(a=!0,!0)})),a||Wv(e,i,r,o)}catch(e){}}function Xv(e,t,r,n){var o=!1;return t&&e&&e[Zd]>0&&Rl(e,(function(e){e&&(r&&-1!==Pl(r,e)||(o=function(e,t,r){var n=!1,o=hl();o&&(n=$v(o,e,t,r),n=$v(o.body,e,t,r)||n);var i=dl();return i&&(n=$v(i,e,t,r)||n),n}(e,t,n)||o))})),o}function Zv(e,t,r){e&&nu(e)&&Rl(e,(function(e){e&&function(e,t,r){var n=hl();n&&(Jv(n,e,t,r),Jv(n.body,e,t,r));var o=dl();o&&Jv(o,e,t,r)}(e,t,r)}))}function ey(e,t,r){return function(e,t,r,n){var o=!1;return t&&e&&nu(e)&&!(o=Xv(e,t,r,n))&&r&&r[Zd]>0&&(o=Xv(e,t,null,n)),o}([xv,Uv,Ov],e,t,r)}function ty(e,t,r){var n=Yv(Lv,r),o=Xv([Ov],e,t,n);return t&&-1!==Pl(t,Nv)||(o=Xv([Nv],(function(t){var r=dl();e&&r&&"hidden"===r.visibilityState&&e(t)}),t,n)||o),!o&&t&&(o=ty(e,null,r)),o}function ry(e,t,r){var n=Yv(Bv,r),o=Xv([qv],e,t,n);return!(o=Xv([Nv],(function(t){var r=dl();e&&r&&"visible"===r.visibilityState&&e(t)}),t,n)||o)&&t&&(o=ry(e,null,r)),o}var ny,oy="",iy="version",ay="properties",sy="initialize",cy="logger",uy="timings",ly="pollInternalLogs",dy="value",hy="kind",py="length",gy="processTelemetryStart",fy="1DS-Web-JS-4.3.3",my=Ic.hasOwnProperty,vy=((ny={})[0]=0,ny[2]=6,ny[1]=1,ny[3]=7,ny[4098]=6,ny[4097]=1,ny[4099]=7,ny);function yy(e){return!(e===oy||Xc(e))}function Cy(e,t,r){if(!t&&!yy(t)||"string"!=typeof e)return null;var n=typeof t;if("string"===n||"number"===n||"boolean"===n||nu(t))t={value:t};else if("object"!==n||my.call(t,"value")){if(Xc(t[dy])||t[dy]===oy||!eu(t[dy])&&!iu(t[dy])&&!au(t[dy])&&!nu(t[dy]))return null}else t={value:r?JSON.stringify(t):t};if(nu(t[dy])&&!(t[dy][py]>0))return null;if(!Xc(t[hy])){if(nu(t[dy])||!function(e){if(0===e||e>0&&e<=13||32===e)return!0;return!1}(t[hy]))return null;t[dy]=t[dy].toString()}return t}function Ty(e,t,r){var n=-1;if(!Jc(e))if(t>0&&(32===t?n=8192:t<=13&&(n=t<<5)),function(e){if(e>=0&&e<=9)return!0;return!1}(r))-1===n&&(n=0),n|=r;else{var o=vy[by(e)]||-1;-1!==n&&-1!==o?n|=o:6===o&&(n=o)}return n}function Iy(e,t,r){var n;return void 0===r&&(r=!0),e&&(n=e.get(t),r&&n&&decodeURIComponent&&(n=decodeURIComponent(n))),n||oy}function wy(e){void 0===e&&(e="D");var t=Hm();return"B"===e?t="{"+t+"}":"P"===e?t="("+t+")":"N"===e&&(t=t.replace(/-/g,oy)),t}function Ey(e,t,r,n,o){var i={},a=!1,s=0,c=arguments[py],u=arguments;for(au(u[0])&&(a=u[0],s++);s<c;s++){gu(u[s],(function(e,t){a&&t&&ru(t)?nu(t)?(i[e]=i[e]||[],Rl(t,(function(t,r){t&&ru(t)?i[e][r]=Ey(!0,i[e][r],t):i[e][r]=t}))):i[e]=Ey(!0,i[e],t):i[e]=t}))}return i}var ky=function(){return Bl()};function Sy(e,t){var r=e;r[uy]=r[uy]||{},r[uy][gy]=r[uy][gy]||{},r[uy][gy][t]=ky()}function by(e){var t=0;if(null!=e){var r=typeof e;"string"===r?t=1:"number"===r?t=2:"boolean"===r?t=3:r===vc&&(t=4,nu(e)?(t=4096,e[py]>0&&(t|=by(e[0]))):my.call(e,"value")&&(t=8192|by(e[dy])))}return t}function Ay(e){return e>0}var _y=Ou({endpointUrl:"https://browser.events.data.microsoft.com/OneCollector/1.0/",propertyStorageOverride:{isVal:function(e){!e||e.getProperty&&e.setProperty||bu("Invalid property storage override passed.");return!0}}});var Ry,Py=function(e){function t(){var r=e.call(this)||this;return Qd(t,r,(function(e,t){e[sy]=function(r,n,o,i){Bm(e,(function(){return"AppInsightsCore.initialize"}),(function(){try{t[sy](Pf(r,_y,o||e[cy],!1).cfg,n,o,i)}catch(t){var a=e[cy],s=Su(t);-1!==s.indexOf("channels")&&(s+="\r\n - Channels must be provided through config.channels only!"),em(a,1,514,"SDK Initialization Failed - no telemetry will be sent: "+s)}}),(function(){return{config:r,extensions:n,logger:o,notificationManager:i}}))},e.track=function(r){Bm(e,(function(){return"AppInsightsCore.track"}),(function(){var n,o=r;if(o){o[uy]=o[uy]||{},o[uy].trackStart=ky(),(n=o.latency)&&iu(n)&&n>=1&&n<=4||(o.latency=1);var i=o.ext=o.ext||{};i.sdk=i.sdk||{},i.sdk.ver=fy;var a=o.baseData=o.baseData||{};a[ay]=a[ay]||{};var s=a[ay];s[iy]=s[iy]||e.pluginVersionString||oy}t.track(o)}),(function(){return{item:r}}),!r.sync)},e[ly]=function(e){return t[ly](e||"InternalLog")}})),r}return pd(t,e),t.__ieDyn=1,t}(Iv),My="locale",Ny="ver",Oy="name",qy=Vd({UserExt:[0,"user"],DeviceExt:[1,"device"],TraceExt:[2,"trace"],WebExt:[3,"web"],AppExt:[4,"app"],OSExt:[5,"os"],SdkExt:[6,"sdk"],IntWebExt:[7,"intweb"],UtcExt:[8,"utc"],LocExt:[9,"loc"],CloudExt:[10,"cloud"],DtExt:[11,"dt"]}),Uy=Vd({id:[0,"id"],ver:[1,Ny],appName:[2,Oy],locale:[3,My],expId:[4,"expId"],env:[5,"env"]}),xy=Vd({domain:[0,"domain"],browser:[1,"browser"],browserVer:[2,"browserVer"],screenRes:[3,"screenRes"],userConsent:[4,"userConsent"],consentDetails:[5,"consentDetails"]}),Ly=Vd({locale:[0,My],localId:[1,"localId"],id:[2,"id"]}),By=Vd({osName:[0,Oy],ver:[1,Ny]}),Hy=Vd({ver:[0,Ny],seq:[1,"seq"],installId:[2,"installId"],epoch:[3,"epoch"]}),Dy=Vd({msfpc:[0,"msfpc"],anid:[1,"anid"],serviceName:[2,"serviceName"]}),Fy=Vd({popSample:[0,"popSample"],eventFlags:[1,"eventFlags"]}),Ky=Vd({tz:[0,"tz"]}),zy=Vd({sessionId:[0,"sesId"]}),Gy=Vd({localId:[0,"localId"],deviceClass:[1,"deviceClass"],make:[2,"make"],model:[3,"model"]}),Qy=Vd({role:[0,"role"],roleInstance:[1,"roleInstance"],roleVer:[2,"roleVer"]}),jy=Vd({traceId:[0,"traceID"],traceName:[1,Oy],parentId:[2,"parentID"]}),Wy=Vd({traceId:[0,"traceId"],spanId:[1,"spanId"],traceFlags:[2,"traceFlags"]});function Vy(){return void 0===Ry&&(Ry=!!$y(0)),Ry}function Yy(){return Vy()?$y(0):null}function $y(e){var t,r,n=null;try{var o=cl();if(!o)return null;r=new Date,(n=0===e?o.localStorage:o.sessionStorage)&&tu(n.setItem)&&(n.setItem(r,r),t=n.getItem(r)!==r,n.removeItem(r),t&&(n=null))}catch(e){n=null}return n} /** * Session.ts * @copyright Microsoft 2019 */ function Jy(){return this.getId()}function Xy(e){this.setId(e)}var Zy=function(){function e(){Qd(e,this,(function(e){e.setId=function(t){e.customId=t},e.getId=function(){return eu(e.customId)?e.customId:e.automaticId}}))}return e._staticInit=void Cu(e.prototype,"id",{g:Jy,s:Xy}),e}(),eC="ai_session",tC=function(){function e(t,r,n){var o,i,a,s=Yf(t),c=Tm(t);Qd(e,this,(function(t){var u=Mf(r,(function(){a=r,t.config=a}));function l(e){var r=t.automaticSession,n=e.split("|");n.length>0&&r.setId(n[0]);try{if(n.length>1){var o=+n[1];r.acquisitionDate=+new Date(o),r.acquisitionDate=r.acquisitionDate>0?r.acquisitionDate:0}if(n.length>2){var i=+n[2];r.renewalDate=+new Date(i),r.renewalDate=r.renewalDate>0?r.renewalDate:0}}catch(e){em(s,1,510,"Error parsing ai_session cookie, session will be reset: "+e)}0===r.renewalDate&&em(s,2,517,"AI session renewal date is 0, session will be reset.")}function d(){var e=t.automaticSession,r=(new Date).getTime(),n=t.config.sessionAsGuid;!Jc(n)&&n?au(n)?e.setId(wy()):e.setId(wy(n)):e.setId(rf(a.idLength||22)),e.acquisitionDate=r,e.renewalDate=r,h(e.getId(),e.acquisitionDate,e.renewalDate),Vy()||em(s,2,505,"Browser does not support local storage. Session durations will be inaccurate.")}function h(e,r,n){var a=r+t.config.sessionExpirationMs,s=n+t.config.sessionRenewalMs,u=new Date,l=[e,r,n];a<s?u.setTime(a):u.setTime(s);var d=t.config.cookieDomain||null;c.set(i(),l.join("|")+";expires="+u.toUTCString(),null,d),o=(new Date).getTime()}n&&n.add(u),i=function(){return t.config.namePrefix?eC+t.config.namePrefix:eC},t.automaticSession=new Zy,t.update=function(){t.automaticSession.getId()||function(){var e=c.get(i());if(e&&tu(e.split))l(e);else{var r=function(e,t){var r=Yy();if(null!==r)try{return r.getItem(t)}catch(t){Ry=!1,em(e,1,503,"Browser failed read of local storage. "+t)}return null}(s,i());r&&l(r)}t.automaticSession.getId()||d()}();var r=t.automaticSession,n=t.config,a=(new Date).getTime(),u=a-r.acquisitionDate>n.sessionExpirationMs,p=a-r.renewalDate>n.sessionRenewalMs;if(u||p)d();else{(!o||a-o>e.cookieUpdateInterval)&&(r.renewalDate=a,h(r.getId(),r.acquisitionDate,r.renewalDate))}},t.backup=function(){var e,r,n,o=t.automaticSession;e=o.getId(),r=o.acquisitionDate,n=o.renewalDate,function(e,t,r){var n=Yy();if(null!==n)try{return n.setItem(t,r),!0}catch(t){Ry=!1,em(e,1,504,"Browser failed write to local storage. "+t)}}(s,i(),[e,r,n].join("|"))}}))}return e.cookieUpdateInterval=6e4,e}(),rC=["AX","EX","SF","CS","CF","CT","CU","DC","DF","H5","HL","WS","WP"]; /** * SessionManager.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */function nC(e,t){void 0===t&&(t=rC);var r=null;if(e)for(var n=e.split(","),o=0;o<n.length;o++)oC(n[o],t)&&(r?r+=","+n[o]:r=n[o]);return r}function oC(e,t){if(void 0===t&&(t=rC),!e||e.length<4)return!1;for(var r=!1,n=e.substring(0,3).toString().toUpperCase(),o=0;o<t.length;o++)if(t[o]+":"===n&&e.length<=256){r=!0;break}return r}function iC(){return this.getExpId()}var aC=function(){function e(t,r,n){var o,i=null,a=rC.slice(0),s="Treatments",c=null;Qd(e,this,(function(e){var u,l;if(l=Mf(u=t,(function(){o=r&&r.getCookieMgr(),c=u||{},e.env=c.env||function(e){var t,r={},n=dl();if(n){t=n&&n.querySelectorAll("meta");for(var o=0;o<t.length;o++){var i=t[o];i.name&&0===i.name.toLowerCase().indexOf(e)&&(r[i.name.replace(e,"")]=i.content)}}return r}("awa-").env})),n&&n.add(l),ll()){var d=dl().documentElement;d&&(e.locale=d.lang)}function h(e){e!==i&&(i=nC(e,a))}e.getExpId=function(){return c.expId?(h(c.expId),i):(h(Iy(o,s)),i)}}))}return e.validateAppExpId=nC,e._staticInit=void Cu(e.prototype,"expId",{g:iC}),e}(),sC=function(){},cC=function(){}; /** * Cloud.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2020 */ /** * IntWeb.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */ function uC(){return this.getMsfpc()}function lC(){return this.getAnid()}var dC=function(){function e(t,r,n){var o;Qd(e,this,(function(e){var i,a;a=Mf(i=t,(function(){o=r&&r.getCookieMgr();var t=i||{};t.serviceName&&(e.serviceName=t.serviceName)})),n&&n.add(a),e.getMsfpc=function(){return Iy(o,"MSFPC")},e.getAnid=function(){return Iy(o,"ANON").slice(0,34)}}))}var t;return e._staticInit=(Cu(t=e.prototype,"msfpc",{g:uC}),void Cu(t,"anid",{g:lC})),e}(),hC=function(){var e=(new Date).getTimezoneOffset(),t=e%60,r=(e-t)/60,n="+";r>0&&(n="-"),r=Math.abs(r),t=Math.abs(t),this.tz=n+(r<10?"0"+r:r.toString())+":"+(t<10?"0"+t:t.toString())},pC={WIN:/(windows|win32)/i,WINRT:/ arm;/i,WINPHONE:/windows\sphone\s\d+\.\d+/i,OSX:/(macintosh|mac os x)/i,IOS:/(ipad|iphone|ipod)(?=.*like mac os x)/i,LINUX:/(linux|joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)/i,ANDROID:/android/i,CROS:/CrOS/i},gC={5.1:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1","10.0":"10"},fC="([\\d,.]+)",mC="([\\d,_,.]+)",vC="Unknown",yC=[{r:pC.WINPHONE,os:"Windows Phone"},{r:pC.WINRT,os:"Windows RT"},{r:pC.WIN,os:"Windows"},{r:pC.IOS,os:"iOS"},{r:pC.ANDROID,os:"Android"},{r:pC.LINUX,os:"Linux"},{r:pC.CROS,os:"Chrome OS"},{s:"x11",os:"Unix"},{s:"blackberry",os:"BlackBerry"},{s:"symbian",os:"Symbian"},{s:"nokia",os:"Nokia"},{r:pC.OSX,os:"Mac OS X"}]; /** * Loc.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */function CC(e,t){return"Windows"===t?TC(e,"Windows NT"):"Android"===t?TC(e,t):"Mac OS X"===t?function(e){var t=e.match(new RegExp("Mac OS X "+mC));if(t){var r=t[1].replace(/_/g,".");if(r){var n=IC(r);return n?r.split(n)[0]:r}}return vC}(e):"iOS"===t?function(e){var t=e.match(new RegExp("OS "+mC));if(t){var r=t[1].replace(/_/g,".");if(r){var n=IC(r);return n?r.split(n)[0]:r}}return vC}(e):vC}function TC(e,t){var r=e.match(new RegExp(t+" "+fC));return r?gC[r[1]]?gC[r[1]]:r[1]:vC}function IC(e){return e.indexOf(".")>-1?".":e.indexOf("_")>-1?"_":null}var wC=function(e,t){var r=null,n=null,o=null,i=null,a=Mf(e,(function(){if((e||{}).populateOperatingSystemInfo){var t=ml()||{},o=e.userAgent||t.userAgent||"",i=(e.userAgentData||{}).platform||(t.userAgentData||{}).platform;if(o){var a=function(e){for(var t=0;t<yC.length;t++){var r=yC[t];if(r.r&&e.match(r.r))return r.os;if(r.s&&-1!==e.indexOf(r.s))return r.os}return vC}(o.toLowerCase());r=a,n=CC(o,a)}r&&r!==vC||!eu(i)||(r=i)}}));t&&t.add(a),Cu(this,"name",{s:function(e){o=e},g:function(){return o||r}}),Cu(this,"ver",{s:function(e){i=e},g:function(){return i||n}})},EC="MicrosoftApplicationsTelemetryDeviceId"; /** * Sdk.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */var kC=function(){function e(t,r,n){var o,i=0;Qd(e,this,(function(e){e.seq=i,e.epoch=tf(!1).toString(),e.getSequenceId=function(){return++i};var a=Mf(t,(function(t){o=r&&r.getCookieMgr();var n=t.cfg.propertyStorageOverride;if(o.isEnabled()||n){var i=function(e,t,r){return t?t.getProperty(r)||"":Iy(e,r)}(o,n,EC);i||(i=Hm()),function(e,t,r,n){t?t.setProperty(r,n):e.set(r,n,31536e3)}(o,n,EC,i),e.installId=i}else o.purge(EC)}));n&&n.add(a)}))}return e.__ieDyn=1,e}(),SC=function(e,t,r,n,o){var i=this;i.traceId=t||Dm();var a=Mf(e,(function(){var t=e;if(t.enableDistributedTracing&&!r&&(r=Dm().substring(0,16)),i.parentId=i.parentId||r,t.enableApplicationInsightsTrace&&!n){var o=Hg();o&&o.pathname&&(n=o.pathname)}i.name=i.name||n}));o&&o.add(a)},bC="setLocalId"; /** * AITrace.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */function AC(){return this.getLocalId()}function _C(e){this[bC](e)}var RC=function(){function e(t,r,n,o){var i,a,s;Qd(e,this,(function(c){var u,l;if(l=Mf(u=r,(function(){if(s=n&&n.getCookieMgr(),i=u,a=null,s&&s.isEnabled()&&(h(),i.enableApplicationInsightsUser)){var r=Iy(s,e.userCookieName);if(r){var o=r.split(e.cookieSeparator);o.length>0&&(c.id=o[0])}if(!c.id){c.id=rf(t&&!Jc(t.idLength)?t.idLength:22);var l=pg(new Date);c.accountAcquisitionDate=l;var d=[c.id,l],p=i.cookieDomain?i.cookieDomain:void 0;s.set(e.userCookieName,d.join(e.cookieSeparator),31536e3,p)}}})),o&&o.add(l),"undefined"!=typeof navigator){var d=navigator;c.locale=d.userLanguage||d.language}function h(){if(!i.hashIdentifiers&&!i.dropIdentifiers){var e=Iy(s,"MUID");e&&(a="t:"+e)}return a}c.getLocalId=function(){return a||h()},c[bC]=function(e){a=e}}))}return e.cookieSeparator="|",e.userCookieName="ai_user",e._staticInit=void Cu(e.prototype,"localId",{g:AC,s:_C}),e}(),PC=function(e,t){var r=this;r.popSample=100;var n=Mf(e,(function(){r.eventFlags=0,e.hashIdentifiers&&(r.eventFlags=1048576|r.eventFlags),e.dropIdentifiers&&(r.eventFlags=2097152|r.eventFlags),e.scrubIpOnly&&(r.eventFlags=4194304|r.eventFlags)}));t&&t.add(n)},MC=["Required","Analytics","SocialMedia","Advertising"],NC="([\\d,.]+)",OC="Unknown",qC="Edg/",UC="EdgiOS/",xC=[{ua:"OPR/",b:"Opera"},{ua:"PhantomJS",b:"PhantomJS"},{ua:"Edge",b:"Edge"},{ua:qC,b:"Edge"},{ua:UC,b:"Edge"},{ua:"Electron",b:"Electron"},{ua:"Chrome",b:"Chrome"},{ua:"Trident",b:"MSIE"},{ua:"MSIE ",b:"MSIE"},{ua:"Firefox",b:"Firefox"},{ua:"Safari",b:"Safari"},{ua:"SkypeShell",b:"SkypeShell"}],LC=[{br:"Microsoft Edge",b:"Edge"},{br:"Google Chrome",b:"Chrome"},{br:"Opera",b:"Opera"}]; /** * Utc.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */function BC(e,t){return t.indexOf(e)>-1}function HC(e,t){for(var r=0;r<t.length;r++)if(e==t[r].brand)return t[r].version;return null}function DC(e,t){return"MSIE"===t?function(e){var t=e.match(new RegExp("MSIE "+NC));if(t)return t[1];var r=e.match(new RegExp("rv:"+NC));if(r)return r[1]}(e):function(e,t){"Safari"===e?e="Version":"Edge"===e&&(BC(qC,t)?e="Edg":BC(UC,t)&&(e="EdgiOS"));var r=t.match(new RegExp(e+"/"+NC));if(r)return r[1];if("Opera"===e&&(r=t.match(new RegExp("OPR/"+NC))))return r[1];return OC}(t,e)}function FC(){return this.getUserConsent()}var KC=function(){function e(t,r,n){Tm(r);var o=t||{},i=null,a=null,s=null,c=null,u=null,l=null,d=null;Qd(e,this,(function(e){var r,h;h=Mf(r=t,(function(){if((o=r).populateBrowserInfo){var e=o.userAgent,t=(o.userAgentData||{}).brands;if(e!==i||t!==a){if(!e||!t||0===t.length){var n=ml();n&&(e=e||n.userAgent||"",t=t||(n.userAgentData||{}).brands)}!function(e,t){if(nu(t))try{for(var r=0;r<LC.length;r++){var n=HC(LC[r].br,t);if(n)return u=LC[r].b,void(l=n)}}catch(e){}if(e){var o=function(e){if(e)for(var t=0;t<xC.length;t++)if(BC(xC[t].ua,e))return xC[t].b;return OC}(e);u=o,l=DC(e,o)}}(e,t),i=e,a=t}}d=au(o.gpcDataSharingOptIn)?o.gpcDataSharingOptIn:null})),n&&n.add(h);var p=Hg();if(p){var g=p.hostname;g&&(e.domain="file:"===p.protocol?"local":g)}var f=function(){var e={h:0,w:0},t=hl();return t&&t.screen&&(e.h=screen.height,e.w=screen.width),e}();e.screenRes=f.w+"X"+f.h,e.getUserConsent=function(){return!1},e.getUserConsentDetails=function(){var e=null;try{var t=o.callback;if(t&&t.userConsentDetails){var r=t.userConsentDetails();if(r){e=o.disableConsentDetailsSanitize?r:{};for(var n=0;n<MC.length;n++){var i=MC[n];e[i]=r[i]||!1}}}return null!==d&&((e=e||{}).GPC_DataSharingOptIn=!!d),e?JSON.stringify(e):null}catch(e){}};Tu(e,{userConsent:{g:e.getUserConsent},browser:{s:function(e){s=e},g:function(){return s||u}},browserVer:{s:function(e){c=e},g:function(){return c||l}},gpcDataSharingOptIn:{g:function(){return d},s:function(e){d=au(e)?e:null,o.gpcDataSharingOptIn=d}}})}))}return e._staticInit=void Cu(e.prototype,"userConsent",{g:FC}),e}(); /** * TelemetryContext.ts * @author Hector Hernandez (hectorh) * @copyright Microsoft 2019 */function zC(e,t,r,n,o){var i=t.ext[qy[e]];if(i)try{gu(n,(function(e,t){if(eu(t)||iu(t)||au(t)){var n=i[r[e]];!o&&(n||eu(n)||iu(n)||au(n))&&(t=n),i[r[e]]=t}}))}catch(e){}return i}var GC,QC=function(){function e(t,r,n,o){Qd(e,this,(function(e){e.app=new aC(r,n,o),e.cloud=new sC,e.user=new RC(t,r,n,o),e.os=new wC(r,o),e.web=new KC(r,n,o);var i=new kC(t,n,o),a=new dC(r,n,o),s=new PC(r,o);e.loc=new hC,e.device=new cC;var c=new tC(n,r,o);e.session=new Zy;var u,l,d,h=void 0,p=(u=new SC(r,h,h,h,o),l=m(),d=u||{},{getName:function(){return d.name},setName:function(e){l&&l.setName(e),d.name=e},getTraceId:function(){return d.traceId},setTraceId:function(e){l&&l.setTraceId(e),Gm(e)&&(d.traceId=e)},getSpanId:function(){return d.parentId},setSpanId:function(e){l&&l.setSpanId(e),Qm(e)&&(d.parentId=e)},getTraceFlags:function(){return d.traceFlags},setTraceFlags:function(e){l&&l.setTraceFlags(e),d.traceFlags=e}}),g=!(r||{}).eventContainExtFields;function f(){var t=e.session;if(t&&eu(t.customId))return t.customId;c.update();var r=c.automaticSession;if(r){var n=r.getId();n&&eu(n)&&(t.automaticId=n)}return t.automaticId}function m(){var e=p;return n&&n.getTraceCtx&&(e=n.getTraceCtx(!1)||p),e}e.getTraceCtx=function(){return p},e.getSessionId=f,e.applyApplicationContext=function(t){var r,n=e.app;zC(4,t,Uy,((r={})[0]=n.id,r[1]=n.ver,r[2]=n.name,r[3]=n.locale,r[4]=n.getExpId(),r[5]=n.env,r),g)},e.applyUserContext=function(t){var r,n=e.user;zC(0,t,Ly,((r={})[1]=n.getLocalId(),r[0]=n.locale,r[2]=n.id,r),g)},e.applyWebContext=function(t){var r,n=e.web;zC(3,t,xy,((r={})[0]=n.domain,r[1]=n.browser,r[2]=n.browserVer,r[3]=n.screenRes,r[5]=n.getUserConsentDetails(),r[4]=!1,r),g)},e.applyOsContext=function(t){var r,n=e.os;zC(5,t,By,((r={})[0]=n.name,r[1]=n.ver,r),g)},e.applySdkContext=function(e){var t;zC(6,e,Hy,((t={})[2]=i.installId,t[1]=i.getSequenceId(),t[3]=i.epoch,t),g)},e.applyIntWebContext=function(e){var t;zC(7,e,Dy,((t={})[0]=a.getMsfpc(),t[1]=a.getAnid(),t[2]=a.serviceName,t),g)},e.applyUtcContext=function(e){var t,r=((t={})[0]=s.popSample,t);s.eventFlags>0&&(r[1]=s.eventFlags),zC(8,e,Fy,r,g)},e.applyLocContext=function(t){var r;zC(9,t,Ky,((r={})[0]=e.loc.tz,r),g)},e.applySessionContext=function(e){var t;zC(4,e,zy,((t={})[0]=f(),t),g)},e.applyDeviceContext=function(t){var r,n=e.device;zC(1,t,Gy,((r={})[0]=n.localId,r[2]=n.make,r[3]=n.model,r[1]=n.deviceClass,r),g)},e.applyCloudContext=function(t){var r,n=e.cloud;zC(10,t,Qy,((r={})[0]=n.role,r[1]=n.roleInstance,r[2]=n.roleVer,r),g)},e.applyAITraceContext=function(e){var t;if(r.enableApplicationInsightsTrace){var n=m();n&&zC(2,e,jy,((t={})[0]=n.getTraceId(),t[1]=n.getName(),t[2]=n.getSpanId(),t),!1)}},e.applyDistributedTraceContext=function(e){var t,r=m();if(r){var n=((t={})[0]=r.getTraceId(),t[1]=r.getSpanId(),t),o=r.getTraceFlags();Xc(o)||(n[2]=o),zC(11,e,Wy,n,!1)}}}))}return e.__ieDyn=1,e}();var jC=[qy[4],qy[0],qy[3],qy[5],qy[6],qy[7],qy[8],qy[9],qy[1],qy[2],qy[11],qy[10]],WC=Ou({populateBrowserInfo:!1,populateOperatingSystemInfo:!1,userAgent:xf(),userAgentData:Uf({brands:GC,mobile:GC,platform:GC}),userConsentCookieName:xf(),userConsented:!1,serviceName:xf(),env:xf(),expId:xf(),sessionRenewalMs:18e5,sessionExpirationMs:864e5,sessionAsGuid:null,cookieDomain:xf(),namePrefix:xf(),enableApplicationInsightsTrace:!1,enableApplicationInsightsUser:!1,hashIdentifiers:!1,dropIdentifiers:!1,scrubIpOnly:!1,callback:Uf({userConsentDetails:null}),gpcDataSharingOptIn:GC,idLength:22,enableDistributedTracing:!1,eventContainExtFields:!1}),VC=function(e){function t(){var r,n,o,i=e.call(this)||this;return i.identifier="SystemPropertiesCollector",i.priority=3,i.version="4.3.3",Qd(t,i,(function(e,t){function i(){r=null,n={}}i(),e.initialize=function(n,i,a){t.initialize(n,i,a),function(t){var n=e.identifier,i=e.core;e._addHook(Mf(t,(function(){var e=rv(null,t,i);o=e.getExtCfg(n,WC)}))),r=new QC(t,o,i,e._unloadHooks),i&&i.setTraceCtx&&i.setTraceCtx(r.getTraceCtx())}(n)},e.processTelemetry=function(t,i){Sy(t,e.identifier),i=e._getTelCtx(i);var a,s,c=t.ext=t.ext?t.ext:{};t.data=t.data?t.data:{},Rl(jC,(function(e){c[e]=c[e]||{}})),r&&(r.applyUtcContext(t),r.applyApplicationContext(t),r.applyUserContext(t),r.applyWebContext(t),r.applyOsContext(t),r.applySdkContext(t),r.applyIntWebContext(t),r.applyLocContext(t),r.applySessionContext(t),r.applyDeviceContext(t),o.enableApplicationInsightsTrace&&r.applyAITraceContext(t),o.enableDistributedTracing&&r.applyDistributedTraceContext(t),r.applyCloudContext(t)),Rl(Nu(c),(function(e){0===Nu(c[e]).length&&delete c[e]})),a=n,s=t.data,a&&gu(a,(function(e,t){s[e]||(s[e]=t)})),e.processNext(t,i)},e.getPropertiesContext=function(){return r},e.setProperty=function(e,t){n[e]=t},e._doTeardown=function(e,t){var n=(e||{}).core();if(n&&n.getTraceCtx&&r){var o=n.getTraceCtx(!1);o&&o===r.getTraceCtx()&&n.setTraceCtx(null)}i()},e._getDbgPlgTargets=function(){return[o]}})),i}return pd(t,e),t.__ieDyn=1,t}(lv),YC="REAL_TIME",$C="",JC="drop",XC="send",ZC="requeue",eT="rspFail",tT="no-cache, no-store",rT="application/x-json-stream",nT="cache-control",oT="content-type",iT="kill-tokens",aT="kill-duration",sT="time-delta-millis",cT="client-version",uT="client-id",lT="time-delta-to-apply-millis",dT="upload-time",hT="apikey",pT="AuthMsaDeviceTicket",gT="WebAuthToken",fT="AuthXToken",mT="msfpc",vT="trace",yT="user",CT="allowRequestSending",TT="firstRequestSent",IT="shouldAddClockSkewHeaders",wT="getClockSkewHeaderValue",ET="setClockSkew",kT="length",ST="concat",bT="iKey",AT="count",_T="events",RT="push",PT="split",MT="splice",NT="toLowerCase",OT="hdrs",qT="useHdrs",UT="initialize",xT="setTimeoutOverride",LT="clearTimeoutOverride",BT="overrideEndpointUrl",HT="avoidOptions",DT="enableCompoundKey",FT="disableXhrSync",KT="disableFetchKeepAlive",zT="useSendBeacon",GT="fetchCredentials",QT="alwaysUseXhrOverride",jT="serializeOfflineEvt",WT="getOfflineRequestDetails",VT="createPayload",YT="createOneDSPayload",$T="payloadBlob",JT="headers",XT="_thePayload",ZT="urlString",eI="batches",tI="sendType",rI="addHeader",nI="canSendRequest",oI="sendQueuedRequests",iI="isCompletelyIdle",aI="setUnloading",sI="resume",cI="sendSynchronousBatch",uI="_transport",lI="getWParam",dI="isBeacon",hI="timings",pI="isTeardown",gI="isSync",fI="data",mI="_sendReason",vI="setKillSwitchTenants",yI="_backOffTransmission",CI="identifier",TI="eventsLimitInMem",II="autoFlushEventsLimit",wI="baseData",EI="sendAttempt",kI="latency",SI="sync"; /** * EventBatch.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2020 */ function bI(e){var t=(e.ext||{}).intweb;return t&&yy(t[mT])?t[mT]:null}function AI(e){for(var t=null,r=0;null===t&&r<e[kT];r++)t=bI(e[r]);return t}var _I=function(){function e(t,r){var n=r?[][ST](r):[],o=this,i=AI(n);o[bT]=function(){return t},o.Msfpc=function(){return i||$C},o[AT]=function(){return n[kT]},o[_T]=function(){return n},o.addEvent=function(e){return!!e&&(n[RT](e),i||(i=bI(e)),!0)},o[PT]=function(r,o){var a;if(r<n[kT]){var s=n[kT]-r;Xc(o)||(s=o<s?o:s),a=n[MT](r,s),i=AI(n)}return new e(t,a)}}return e.create=function(t,r){return new e(t,r)},e}(),RI=function(){function e(){var t=!0,r=!0,n=!0,o="use-collector-delta",i=!1;Qd(e,this,(function(e){e[CT]=function(){return t},e[TT]=function(){n&&(n=!1,i||(t=!1))},e[IT]=function(){return r},e[wT]=function(){return o},e[ET]=function(e){i||(e?(o=e,r=!0,i=!0):r=!1,t=!0)}}))}return e.__ieDyn=1,e}(),PI=function(){function e(){var t={};Qd(e,this,(function(e){e[vI]=function(e,r){if(e&&r)try{var n=(a=e[PT](","),s=[],a&&Rl(a,(function(e){s[RT](Gl(e))})),s);if("this-request-only"===r)return n;for(var o=1e3*parseInt(r,10),i=0;i<n[kT];++i)t[n[i]]=Bl()+o}catch(e){return[]}var a,s;return[]},e.isTenantKilled=function(e){var r=t,n=Gl(e);return void 0!==r[n]&&r[n]>Bl()||(delete r[n],!1)}}))}return e.__ieDyn=1,e}(); /** * ClockSkewManager.ts * @author Abhilash Panwar (abpanwar) * @copyright Microsoft 2018 */function MI(e){var t,r=Math.floor(1200*Math.random())+2400;return t=Math.pow(2,e)*r,Math.min(t,6e5)} /** * Serializer.ts * @author Abhilash Panwar (abpanwar); Hector Hernandez (hectorh); Nev Wylie (newylie) * @copyright Microsoft 2018-2020 */var NI,OI=2e6,qI=Math.min(OI,65e3),UI="metadata",xI="f",LI=/\./,BI=function(){function e(t,r,n,o,i,a){var s="data",c="baseData",u=!!o,l=r,d={},h=!!a,p=i||Ty;Qd(e,this,(function(e){function r(e,t,o,i,a,s,c){gu(e,(function(e,h){var p=null;if(h||yy(h)){var g=o,f=e,m=a,v=t;if(u&&!i&&LI.test(e)){var y=e.split("."),C=y.length;if(C>1){m&&(m=m.slice());for(var T=0;T<C-1;T++){var I=y[T];v=v[I]=v[I]||{},g+="."+I,m&&m.push(I)}f=y[C-1]}}var w=i&&function(e,t){var r=d[e];return void 0===r&&(e.length>=7&&(r=nd(e,"ext.metadata")||nd(e,"ext.web")),d[e]=r),r}(g);if(p=!w&&l&&l.handleField(g,f)?l.value(g,f,h,n):Cy(f,h,n)){var E=p.value;if(v[f]=E,s&&s(m,f,p),c&&"object"==typeof E&&!nu(E)){var k=m;k&&(k=k.slice()).push(f),r(h,E,g+"."+f,i,k,s,c)}}}}))}e.createPayload=function(e,t,r,n,o,i){return{apiKeys:[],payloadBlob:$C,overflow:null,sizeExceed:[],failedEvts:[],batches:[],numEvents:0,retryCnt:e,isTeardown:t,isSync:r,isBeacon:n,sendType:i,sendReason:o}},e.appendPayload=function(r,n,o){var i=r&&n&&!r.overflow;return i&&Bm(t,(function(){return"Serializer:appendPayload"}),(function(){for(var t=n.events(),i=r.payloadBlob,a=r.numEvents,s=!1,c=[],u=[],l=r.isBeacon,d=l?65e3:3984588,h=l?qI:OI,p=0,g=0;p<t.length;){var f=t[p];if(f){if(a>=o){r.overflow=n.split(p);break}var m=e.getEventBlob(f);if(m&&m.length<=h){var v=m.length;if(i.length+v>d){r.overflow=n.split(p);break}i&&(i+="\r\n"),i+=m,++g>20&&(Vu(i,0,1),g=0),s=!0,a++}else m?c.push(f):u.push(f),t.splice(p,1),p--}p++}if(c.length>0&&r.sizeExceed.push(_I.create(n.iKey(),c)),u.length>0&&r.failedEvts.push(_I.create(n.iKey(),u)),s){r.batches.push(n),r.payloadBlob=i,r.numEvents=a;var y=n.iKey();-1===Pl(r.apiKeys,y)&&r.apiKeys.push(y)}}),(function(){return{payload:r,theBatch:{iKey:n.iKey(),evts:n.events()},max:o}})),i},e.getEventBlob=function(e){try{return Bm(t,(function(){return"Serializer.getEventBlob"}),(function(){var t={};t.name=e.name,t.time=e.time,t.ver=e.ver,t.iKey="o:"+function(e){if(e){var t=rd(e,"-");if(t>-1)return $u(e,t)}return oy}(e.iKey);var n,o={};h||(n=function(e,t,r){!function(e,t,r,n,o){if(o&&t){var i=e(o.value,o.kind,o.propertyType);if(i>-1){var a=t[UI];a||(a=t[UI]={f:{}});var s=a[xI];if(s||(s=a[xI]={}),r)for(var c=0;c<r.length;c++){var u=r[c];s[u]||(s[u]={f:{}});var l=s[u][xI];l||(l=s[u][xI]={}),s=l}s=s[n]={},nu(o.value)?s.a={t:i}:s.t=i}}} /** * TimeoutOverrideWrapper.ts * @author Nev Wylie (newylie) * @copyright Microsoft 2022 * Simple internal timeout wrapper */(p,o,e,t,r)});var i=e.ext;i&&(t.ext=o,gu(i,(function(e,t){r(t,o[e]={},"ext."+e,!0,null,null,!0)})));var a=t[s]={};a.baseType=e.baseType;var u=a[c]={};return r(e.baseData,u,c,!1,[c],n,true),r(e.data,a,s,!1,[],n,true),JSON.stringify(t)}),(function(){return{item:e}}))}catch(e){return null}}}))}return e.__ieDyn=1,e}();function HI(e,t){return{set:function(r,n){for(var o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];return function(e,t,r){return ud(!0,e,Wc[Bc](arguments,1))}([e,t],r,n,o)}}}var DI="sendAttempt",FI="?cors=true&"+oT[NT]()+"="+rT,KI=((NI={})[1]=ZC,NI[100]=ZC,NI[200]="sent",NI[8004]=JC,NI[8003]=JC,NI),zI={},GI={};function QI(e,t,r){zI[e]=t,!1!==r&&(GI[t]=e)}function jI(e,t){var r=!1;if(e&&t){var n=Nu(e);if(n&&n[kT]>0)for(var o=t[NT](),i=0;i<n[kT];i++){var a=n[i];if(a&&du(t,a)&&a[NT]()===o){r=!0;break}}}return r}function WI(e,t,r,n){t&&r&&r[kT]>0&&(n&&zI[t]?(e[OT][zI[t]]=r,e[qT]=!0):e.url+="&"+t+"="+r)}QI(pT,pT,!1),QI(cT,cT),QI(uT,"Client-Id"),QI(hT,hT),QI(lT,lT),QI(dT,dT),QI(fT,fT);var VI=function(){function e(t,r,n,o){var i,a,s,c,u,l,d,h,p,g,f,m,v,y,C,T,I,w,E,k,S,b,A,_,R,P,M,N,O,q,U,x,L=!1;Qd(e,this,(function(e){!function(){var e;i=null,a=new PI,s=!1,c=new RI,L=!1,u=0,l=null,d=null,h=null,p=null,g=!0,f=[],m={},v=[],y=null,C=!1,T=null,I=!1,w=!1,E=e,k=e,S=e,b=e,A=e,_=[],R=e,P=e,M=[],N=!1,O=HI(),q=!1,U=null}();function B(e,t){try{return U&&U.getSenderInst(e,t)}catch(e){}return null}function H(){try{return{enableSendPromise:!1,isOneDs:!0,disableCredentials:!1,fetchCredentials:x,disableXhr:!1,disableBeacon:!L,disableBeaconSync:!L,disableFetchKeepAlive:S,timeWrapper:O,addNoResponse:A,senderOnCompleteCallBack:{xdrOnComplete:D,fetchOnComplete:F,xhrOnComplete:K,beaconOnRetry:G}}}catch(e){}return null}function D(e,t,r){var n=Cg(e);z(t,200,{},n),re(n)}function F(e,t,r,n){var o={},i=e[JT];i&&i.forEach((function(e,t){o[t]=e})),function(e,r,n){z(t,e,r,n),re(n)}(e.status,o,r||$C)}function K(e,t,r){var n=Cg(e);z(t,e.status,kg(e,!0),n),re(n)}function z(e,t,r,n){try{e(t,r,n)}catch(e){em(d,2,518,Su(e))}}function G(e,t,r){var n=200,o=e[XT],i=e[ZT]+(A?"&NoResponseBody=true":$C);try{var a=ml();if(o){var s=!!p.getPlugin("LocalStorage"),c=[],u=[];Rl(o[eI],(function(e){if(c&&e&&e[AT]()>0)for(var t=e[_T](),r=0;r<t[kT];r++){if(!a.sendBeacon(i,y.getEventBlob(t[r]))){c[RT](e[PT](r));break}u[RT](e[r])}else c[RT](e[PT](0))})),u[kT]>0&&(o.sentEvts=u),s||ne(c,8003,o[tI],!0)}else n=0}catch(e){tm(d,"Failed to send telemetry using sendBeacon API. Ex:"+Su(e)),n=0}finally{z(t,n,{},$C)}}function Q(e){return 2===e||3===e}function j(e){return I&&Q(e)&&(e=2),e}function W(){return!s&&u<r}function V(){var e=v;return v=[],e}function Y(e,t,r){var n=!1;return e&&e[kT]>0&&!s&&h[t]&&y&&(n=0!==t||W()&&(r>0||c[CT]())),n}function $(e){var t={};return e&&Rl(e,(function(e,r){t[r]={iKey:e[bT](),evts:e[_T]()}})),t}function J(e,r,n,o,i){if(e&&0!==e[kT])if(s)ne(e,1,o);else{o=j(o);try{var c=e,u=0!==o;Bm(p,(function(){return"HttpManager:_sendBatches"}),(function(s){s&&(e=e.slice(0));for(var c=[],l=null,d=ky(),p=h[o]||(u?h[1]:h[0]),g=p&&p[uI],f=b&&(I||Q(o)||3===g||p._isSync&&2===g);Y(e,o,r);){var m=e.shift();m&&m[AT]()>0&&(a.isTenantKilled(m[bT]())?c[RT](m):(l=l||y[VT](r,n,u,f,i,o),y.appendPayload(l,m,t)?null!==l.overflow&&(e=[l.overflow][ST](e),l.overflow=null,ee(l,d,ky(),i),d=ky(),l=null):(ee(l,d,ky(),i),d=ky(),e=[m][ST](e),l=null)))}l&&ee(l,d,ky(),i),e[kT]>0&&(v=e[ST](v)),ne(c,8004,o)}),(function(){return{batches:$(c),retryCount:r,isTeardown:n,isSynchronous:u,sendReason:i,useSendBeacon:Q(o),sendType:o}}),!u)}catch(e){em(d,2,48,"Unexpected Exception sending batch: "+Su(e))}}}function X(e,t){var r={url:i,hdrs:{},useHdrs:!1};t?(r[OT]=Ey(r[OT],m),r.useHdrs=Nu(r.hdrs)[kT]>0):gu(m,(function(e,t){GI[e]?WI(r,GI[e],t,!1):(r[OT][e]=t,r[qT]=!0)})),WI(r,uT,"NO_AUTH",t),WI(r,cT,fy,t);var n=$C;Rl(e.apiKeys,(function(e){n[kT]>0&&(n+=","),n+=e})),WI(r,hT,n,t),WI(r,dT,Bl().toString(),t);var o=function(e){for(var t=0;t<e.batches[kT];t++){var r=e[eI][t].Msfpc();if(r)return encodeURIComponent(r)}return $C}(e);if(yy(o)&&(r.url+="&ext.intweb.msfpc="+o),c[IT]()&&WI(r,lT,c[wT](),t),p[lI]){var a=p[lI]();a>=0&&(r.url+="&w="+a)}for(var s=0;s<f[kT];s++)r.url+="&"+f[s].name+"="+f[s].value;return r}function Z(e,t,r){e[t]=e[t]||{},e[t][l.identifier]=r}function ee(t,r,o,i){if(t&&t.payloadBlob&&t.payloadBlob[kT]>0){var s=!!R,f=h[t.sendType];!Q(t[tI])&&t[dI]&&2===t.sendReason&&(f=h[2]||h[3]||f);var m=w;(t.isBeacon||3===f[uI])&&(m=!1);var v=X(t,m);m=m||v[qT];var y=ky();Bm(p,(function(){return"HttpManager:_doPayloadSend"}),(function(){for(var h=0;h<t.batches[kT];h++)for(var T=t[eI][h][_T](),w=0;w<T[kT];w++){var b=T[w];if(C){var A=b[hI]=b[hI]||{};Z(A,"sendEventStart",y),Z(A,"serializationStart",r),Z(A,"serializationCompleted",o)}b[DI]>0?b[DI]++:b[DI]=1}ne(t[eI],1e3+(i||0),t[tI],!0);var _={data:t[$T],urlString:v.url,headers:v[OT],_thePayload:t,_sendReason:i,timeout:E,disableXhrSync:k,disableFetchKeepAlive:S};m&&(jI(_[JT],nT)||(_[JT][nT]=tT),jI(_[JT],oT)||(_[JT][oT]=rT));var M=null;f&&(M=function(r){c[TT]();var o=function(r,o){!function(t,r,o,i){var s=9e3,d=null,h=!1,p=!1;try{var g=!0;if(typeof t!==yc){if(r){c[ET](r[sT]);var f=r[aT]||r["kill-duration-seconds"];Rl(a[vI](r[iT],f),(function(e){Rl(o[eI],(function(t){if(t[bT]()===e){d=d||[];var r=t[PT](0);o.numEvents-=r[AT](),d[RT](r)}}))}))}if(200==t||204==t)return void(s=200);((v=t)>=300&&v<500&&429!=v||501==v||505==v||o.numEvents<=0)&&(g=!1),s=9e3+t%1e3}if(g){s=100;var m=o.retryCnt;0===o[tI]&&(m<n?(h=!0,te((function(){0===o[tI]&&u--,J(o[eI],m+1,o[pI],I?2:o[tI],5)}),I,MI(m))):(p=!0,I&&(s=8001)))}}finally{h||(c[ET](),function(t,r,n,o){try{o&&l[yI]();var i=t[eI];200===r&&(i=t.sentEvts||t[eI],o||t[gI]||l._clearBackOff(),function(e){if(C){var t=ky();Rl(e,(function(e){e&&e[AT]()>0&&function(e,t){C&&Rl(e,(function(e){Z(e[hI]=e[hI]||{},"sendEventCompleted",t)}))}(e[_T](),t)}))}}(i)),ne(i,r,t[tI],!0)}finally{0===t[tI]&&(u--,5!==n&&e.sendQueuedRequests(t[tI],n))}}(o,s,i,p)),ne(d,8004,o[tI])}var v}(r,o,t,i)},s=t[pI]||t[gI];try{f.sendPOST(r,o,s),P&&P(_,r,s,t[dI])}catch(e){tm(d,"Unexpected exception sending payload. Ex:"+Su(e)),z(o,0,{})}}),Bm(p,(function(){return"HttpManager:_doPayloadSend.sender"}),(function(){if(M)if(0===t[tI]&&u++,s&&!t.isBeacon&&3!==f[uI]){var e={data:_[fI],urlString:_[ZT],headers:Ey({},_[JT]),timeout:_.timeout,disableXhrSync:_[FT],disableFetchKeepAlive:_[KT]},r=!1;Bm(p,(function(){return"HttpManager:_doPayloadSend.sendHook"}),(function(){try{R(e,(function(e){r=!0,g||e[XT]||(e[XT]=e[XT]||_[XT],e[mI]=e[mI]||_[mI]),M(e)}),t.isSync||t[pI])}catch(e){r||M(_)}}))}else M(_)}))}),(function(){return{thePayload:t,serializationStart:r,serializationCompleted:o,sendReason:i}}),t[gI])}t.sizeExceed&&t.sizeExceed[kT]>0&&ne(t.sizeExceed,8003,t[tI]),t.failedEvts&&t.failedEvts[kT]>0&&ne(t.failedEvts,8002,t[tI])}function te(e,t,r){t?e():O.set(e,r)}function re(e){var t=M;try{for(var r=0;r<t[kT];r++)try{t[r](e)}catch(e){em(d,1,519,"Response handler failed: "+e)}if(e){var n=JSON.parse(e);yy(n.webResult)&&yy(n.webResult[mT])&&T.set("MSFPC",n.webResult[mT],31536e3)}}catch(e){}}function ne(e,t,r,n){if(e&&e[kT]>0&&o){var i=o[function(e){var t=KI[e];yy(t)||(t="oth",e>=9e3&&e<=9999?t=eT:e>=8e3&&e<=8999?t=JC:e>=1e3&&e<=1999&&(t=XC));return t}(t)];if(i){var a=0!==r;Bm(p,(function(){return"HttpManager:_sendBatchesNotification"}),(function(){te((function(){try{i.call(o,e,t,a,r)}catch(e){em(d,1,74,"send request notification failed: "+e)}}),n||a,0)}),(function(){return{batches:$(e),reason:t,isSync:a,sendSync:n,sendType:r}}),!a)}}}e[UT]=function(e,t,r){N||(p=t,T=t.getCookieMgr(),d=(l=r).diagLog(),_l(_,Mf(e,(function(e){var n,o=e.cfg,a=e.cfg.extensionConfig[r.identifier];O=HI(a[xT],a[LT]),yy(o.anonCookieName)?function(e,t,r){for(var n=0;n<e[kT];n++)if(e[n].name===t)return void(e[n].value=r);e[RT]({name:t,value:r})}(f,"anoncknm",o.anonCookieName):function(e,t){for(var r=0;r<e[kT];r++)if(e[r].name===t)return void e[MT](r,1)}(f,"anoncknm"),R=a.payloadPreprocessor,P=a.payloadListener;var s=a.httpXHROverride,c=a[BT]?a[BT]:o.endpointUrl;i=c+FI,w=!!Jc(a[HT])||!a[HT],C=!a.disableEventTimings;var u=a.valueSanitizer,l=a.stringifyObjects,m=!!o[DT];Jc(a[DT])||(m=!!a[DT]),E=a.xhrTimeout,k=!!a[FT],S=!!a[KT],A=!1!==a.addNoResponse,q=!!a.excludeCsMetaData,t.getPlugin("LocalStorage")&&(S=!0),L=!Fg(),y=new BI(p,u,l,m,Ty,q),Xc(a[zT])||(L=!!a[zT]),a[GT]&&(x=a[GT]);var v=H();U?U.SetConfig(v):(U=new Sv)[UT](v,d);var T=s,I=a[QT]?s:null,_=a[QT]?s:null,M=[3,2];if(!s){g=!1;var N=[];Fg()?(N=[2,1],M=[2,1,3]):N=[1,2,3],(s=B(N=Ig(N,a.transports),!1))||tm(d,"No available transport to send events"),T=B(N,!0)}I||(I=B(M=Ig(M,a.unloadTransports),!0)),b=!g&&(L&&zg()||!S&&Gg(!0)),(n={})[0]=s,n[1]=T||B([1,2,3],!0),n[2]=I||T||B([1],!0),n[3]=_||B([2,3],!0)||T||B([1],!0),h=n}))),N=!0)},e.addResponseHandler=function(e){return M[RT](e),{rm:function(){var t=M.indexOf(e);t>=0&&M[MT](t,1)}}},e[jT]=function(e){try{if(y)return y.getEventBlob(e)}catch(e){}return $C},e[WT]=function(){try{return X(y&&y[VT](0,!1,!1,!1,1,0),w)}catch(e){}return null},e[YT]=function(e,r){try{var n=[];Rl(e,(function(e){r&&(e=yg(e));var t=_I.create(e[bT],[e]);n[RT](t)}));for(var o=null;n[kT]>0&&y;){var i=n.shift();i&&i[AT]()>0&&(o=o||y[VT](0,!1,!1,!1,1,0),y.appendPayload(o,i,t))}var a=X(o,w),s={data:o[$T],urlString:a.url,headers:a[OT],timeout:E,disableXhrSync:k,disableFetchKeepAlive:S};return w&&(jI(s[JT],nT)||(s[JT][nT]=tT),jI(s[JT],oT)||(s[JT][oT]=rT)),s}catch(e){}return null},e._getDbgPlgTargets=function(){return[h[0],a,y,h,H(),i]},e[rI]=function(e,t){m[e]=t},e.removeHeader=function(e){delete m[e]},e[nI]=function(){return W()&&c[CT]()},e[oI]=function(e,t){Jc(e)&&(e=0),I&&(e=j(e),t=2),Y(v,e,0)&&J(V(),0,!1,e,t||0)},e[iI]=function(){return!s&&0===u&&0===v[kT]},e[aI]=function(e){I=e},e.addBatch=function(e){if(e&&e[AT]()>0){if(a.isTenantKilled(e[bT]()))return!1;v[RT](e)}return!0},e.teardown=function(){v[kT]>0&&J(V(),0,!0,2,2),Rl(_,(function(e){e&&e.rm&&e.rm()})),_=[]},e.pause=function(){s=!0},e[sI]=function(){s=!1,e[oI](0,4)},e[cI]=function(e,t,r){e&&e[AT]()>0&&(Xc(t)&&(t=1),I&&(t=j(t),r=2),J([e],0,!1,t,r||0))}}))}return e.__ieDyn=1,e}(),YI=1e4,$I="eventsDiscarded",JI=void 0,XI=Ou({eventsLimitInMem:{isVal:Ay,v:YI},immediateEventLimit:{isVal:Ay,v:500},autoFlushEventsLimit:{isVal:Ay,v:0},disableAutoBatchFlushLimit:!1,httpXHROverride:{isVal:function(e){return e&&e.sendPOST},v:JI},overrideInstrumentationKey:JI,overrideEndpointUrl:JI,disableTelemetry:!1,ignoreMc1Ms0CookieProcessing:!1,setTimeoutOverride:JI,clearTimeoutOverride:JI,payloadPreprocessor:JI,payloadListener:JI,disableEventTimings:JI,valueSanitizer:JI,stringifyObjects:JI,enableCompoundKey:JI,disableOptimizeObj:!1,fetchCredentials:JI,transports:JI,unloadTransports:JI,useSendBeacon:JI,disableFetchKeepAlive:JI,avoidOptions:!1,xhrTimeout:JI,disableXhrSync:JI,alwaysUseXhrOverride:!1,maxEventRetryAttempts:{isVal:iu,v:6},maxUnloadEventRetryAttempts:{isVal:iu,v:2},addNoResponse:JI,excludeCsMetaData:JI});var ZI=function(e){function t(){var r,n=e.call(this)||this;n.identifier="PostChannel",n.priority=1011,n.version="4.3.3";var o,i,a,s,c,u,l,d,h,p,g,f,m,v,y,C,T,I,w,E,k,S,b,A,_,R=!1,P=[],M=!1,N=0,O=0,q={},U=YC;return Qd(t,n,(function(e,t){function n(){Zv([xv,Uv,Ov],null,I),function(e,t){var r=Yv(Lv,t);Zv([Ov],e,r),Zv([Nv],null,r)}(null,I),function(e,t){var r=Yv(Bv,t);Zv([qv],e,r),Zv([Nv],null,r)}(null,I)}function x(e){var t="";return e&&e[kT]&&Rl(e,(function(e){t&&(t+="\r\n"),t+=e})),t}function L(e){var t="";try{D(e),t=d[jT](e)}catch(e){}return t}function B(e){"beforeunload"!==(e||hl().event).type&&(y=!0,d[aI](y)),V(2,2)}function H(e){y=!1,d[aI](y)}function D(e){e.ext&&e.ext[vT]&&delete e.ext[vT],e.ext&&e.ext[yT]&&e.ext[yT].id&&delete e.ext[yT].id,v&&(e.ext=yg(e.ext),e[wI]&&(e[wI]=yg(e[wI])),e[fI]&&(e[fI]=yg(e[fI])))}function F(e,t){if(e[EI]||(e[EI]=0),e[kI]||(e[kI]=1),D(e),e[SI])if(u||M)e[kI]=3,e[SI]=!1;else if(d)return v&&(e=yg(e)),void d[cI](_I.create(e[bT],[e]),!0===e[SI]?1:e[SI],3);var r=e[kI],n=O,o=a;4===r&&(n=N,o=i);var s=!1;if(n<o)s=!J(e,t);else{var c=1,l=20;4===r&&(c=4,l=1),s=!0,function(e,t,r,n){for(;r<=t;){var o=Y(e,t,!0);if(o&&o[AT]()>0){var i=o[PT](0,n),a=i[AT]();if(a>0)return 4===r?N-=a:O-=a,ae($I,[i],Yd.QueueFull),!0}r++}return X(),!1}(e[bT],e[kI],c,l)&&(s=!J(e,t))}s&&ie($I,[e],Yd.QueueFull)}function K(e,t,r){var n=Z(e,t,r);return d[oI](t,r),n}function z(){return O>0}function G(){if(f>=0&&Z(f,0,m)&&d[oI](0,m),N>0&&!c&&!M){var e=q[U][2];e>=0&&(c=j((function(){c=null,K(4,0,1),G()}),e))}var t=q[U][1];!s&&!o&&t>=0&&!M&&(z()?s=j((function(){s=null,K(0===l?3:1,0,1),l++,l%=2,G()}),t):l=0)}function Q(){r=null,R=!1,P=[],o=null,M=!1,N=0,i=500,O=0,a=YI,q={},U=YC,s=null,c=null,u=0,l=0,h={},p=0,b=!1,g=0,f=-1,m=null,v=!0,y=!1,C=6,T=2,I=null,A=null,_=!1,w=HI(),d=new VI(500,2,1,{requeue:ne,send:se,sent:ce,drop:ue,rspFail:le,oth:de}),re(),h[4]={batches:[],iKeyMap:{}},h[3]={batches:[],iKeyMap:{}},h[2]={batches:[],iKeyMap:{}},h[1]={batches:[],iKeyMap:{}},he()}function j(e,t){0===t&&u&&(t=1);var r=1e3;return u&&(r=MI(u-1)),w.set(e,t*r)}function W(){return null!==s&&(s.cancel(),s=null,l=0,!0)}function V(e,t){W(),o&&(o.cancel(),o=null),M||K(1,e,t)}function Y(e,t,r){var n=h[t];n||(n=h[t=1]);var o=n.iKeyMap[e];return!o&&r&&(o=_I.create(e),n.batches[RT](o),n.iKeyMap[e]=o),o}function $(t,r){d[nI]()&&!u&&(p>0&&O>p&&(r=!0),r&&null==o&&e.flush(t,(function(){}),20))}function J(e,t){v&&(e=yg(e));var r=e[kI],n=Y(e[bT],r,!0);return!!n.addEvent(e)&&(4!==r?(O++,t&&0===e[EI]&&$(!e.sync,g>0&&n[AT]()>=g)):N++,!0)}function X(){for(var e=0,t=0,r=function(r){var n=h[r];n&&n[eI]&&Rl(n[eI],(function(n){4===r?e+=n[AT]():t+=n[AT]()}))},n=1;n<=4;n++)r(n);O=t,N=e}function Z(t,r,n){var o=!1,i=0===r;return!i||d[nI]()?Bm(e.core,(function(){return"PostChannel._queueBatches"}),(function(){for(var e=[],r=4;r>=t;){var n=h[r];n&&n.batches&&n.batches[kT]>0&&(Rl(n[eI],(function(t){d.addBatch(t)?o=o||t&&t[AT]()>0:e=e[ST](t[_T]()),4===r?N-=t[AT]():O-=t[AT]()})),n[eI]=[],n.iKeyMap={}),r--}e[kT]>0&&ie($I,e,Yd.KillSwitch),o&&f>=t&&(f=-1,m=0)}),(function(){return{latency:t,sendType:r,sendReason:n}}),!i):(f=f>=0?Math.min(f,t):t,m=Math.max(m,n)),o}function ee(e,t){K(1,0,t),X(),te((function(){e&&e(),P[kT]>0?o=j((function(){o=null,ee(P.shift(),t)}),0):(o=null,G())}))}function te(e){d[iI]()?e():o=j((function(){o=null,te(e)}),.25)}function re(){(q={})[YC]=[2,1,0],q.NEAR_REAL_TIME=[6,3,0],q.BEST_EFFORT=[18,9,0]}function ne(t,r){var n=[],o=C;y&&(o=T),Rl(t,(function(t){t&&t[AT]()>0&&Rl(t[_T](),(function(t){t&&(t[SI]&&(t[kI]=4,t[SI]=!1),t[EI]<o?(Sy(t,e[CI]),F(t,!1)):n[RT](t))}))})),n[kT]>0&&ie($I,n,Yd.NonRetryableStatus),y&&V(2,2)}function oe(t,r){var n=S||{},o=n[t];if(o)try{o.apply(n,r)}catch(r){em(e.diagLog(),1,74,t+" notification failed: "+r)}}function ie(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t&&t[kT]>0&&oe(e,[t][ST](r))}function ae(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];t&&t[kT]>0&&Rl(t,(function(t){t&&t[AT]()>0&&oe(e,[t.events()][ST](r))}))}function se(e,t,r){e&&e[kT]>0&&oe("eventsSendRequest",[t>=1e3&&t<=1999?t-1e3:0,!0!==r])}function ce(e,t){ae("eventsSent",e,t),G()}function ue(e,t){ae($I,e,t>=8e3&&t<=8999?t-8e3:Yd.Unknown)}function le(e){ae($I,e,Yd.NonRetryableStatus),G()}function de(e,t){ae($I,e,Yd.Unknown),G()}function he(){g=k?0:Math.max(1500,a/6)}Q(),e._getDbgPlgTargets=function(){return[d,r]},e[UT]=function(o,s,c){Bm(s,(function(){return"PostChannel:initialize"}),(function(){t[UT](o,s,c),S=s.getNotifyMgr();try{I=Yv(cf(e[CI]),s.evtNamespace&&s.evtNamespace()),e._addHook(Mf(o,(function(t){var o=t.cfg,c=rv(null,o,s);r=c.getExtCfg(e[CI],XI),w=HI(r[xT],r[LT]),v=!r.disableOptimizeObj&&!!ul("chrome"),E=r.ignoreMc1Ms0CookieProcessing,function(e){var t=e[lI];e[lI]=function(){var r=0;return E&&(r|=2),r|t.call(e)}}(s),a=r[TI],i=r.immediateEventLimit,p=r[II],C=r.maxEventRetryAttempts,T=r.maxUnloadEventRetryAttempts,k=r.disableAutoBatchFlushLimit,cu(o.endpointUrl)?e.pause():M&&e[sI](),he(),A=r.overrideInstrumentationKey,_=!!r.disableTelemetry,b&&n();var u=o.disablePageUnloadEvents||[];b=ey(B,u,I),b=ty(B,u,I)||b,b=ry(H,o.disablePageShowEvents,I)||b}))),d[UT](o,e.core,e)}catch(t){throw e.setInitialized(!1),t}}),(function(){return{theConfig:o,core:s,extensions:c}}))},e.processTelemetry=function(t,r){Sy(t,e[CI]),r=r||e._getTelCtx(r);var n=t;_||R||(A&&(n[bT]=A),F(n,!0),y?V(2,2):G()),e.processNext(n,r)},e.getOfflineSupport=function(){try{var e=d&&d[WT]();if(d)return{getUrl:function(){return e?e.url:null},serialize:L,batch:x,shouldProcess:function(e){return!_},createPayload:function(e){return null},createOneDSPayload:function(e){if(d[YT])return d[YT](e,v)}}}catch(e){}return null},e._doTeardown=function(e,t){V(2,2),R=!0,d.teardown(),n(),Q()},e.setEventQueueLimits=function(e,t){r[TI]=a=Ay(e)?e:YI,r[II]=p=Ay(t)?t:0,he();var n=O>e;if(!n&&g>0)for(var o=1;!n&&o<=3;o++){var i=h[o];i&&i[eI]&&Rl(i[eI],(function(e){e&&e[AT]()>=g&&(n=!0)}))}$(!0,n)},e.pause=function(){W(),M=!0,d&&d.pause()},e[sI]=function(){M=!1,d&&d[sI](),G()},e._loadTransmitProfiles=function(e){W(),re(),U=YC,G(),gu(e,(function(e,t){var r=t[kT];if(r>=2){var n=r>2?t[2]:0;if(t[MT](0,r-2),t[1]<0&&(t[0]=-1),t[1]>0&&t[0]>0){var o=t[0]/t[1];t[0]=Math.ceil(o)*t[1]}n>=0&&t[1]>=0&&n>t[1]&&(n=t[1]),t[RT](n),q[e]=t}}))},e.flush=function(e,t,r){var n;if(void 0===e&&(e=!0),!M)if(r=r||1,e)t||(n=Bp((function(e){t=e}))),null==o?(W(),Z(1,0,r),o=j((function(){o=null,ee(t,r)}),0)):P[RT](t);else{var i=W();K(1,1,r),t&&t(),i&&G()}return n},e.setMsaAuthTicket=function(e){d[rI](pT,e)},e.setAuthPluginHeader=function(e){d[rI](gT,e)},e.removeAuthPluginHeader=function(){d.removeHeader(gT)},e.hasEvents=z,e._setTransmitProfile=function(e){U!==e&&void 0!==q[e]&&(W(),U=e,G())},vg(e,(function(){return d}),["addResponseHandler"]),e[yI]=function(){u<4&&(u++,W(),G())},e._clearBackOff=function(){u&&(u=0,W(),G())}})),n}return pd(t,e),t.__ieDyn=1,t}(lv),ew=Ou({cookieCfg:{ref:!0,v:{}},extensions:{rdOnly:!0,ref:!0,v:[]},channels:{rdOnly:!0,ref:!0,v:[]},extensionConfig:{ref:!0,v:{}}}),tw=function(e){function t(){var r,n,o=e.call(this)||this;return Qd(t,o,(function(e,t){e.initialize=function(e,i){var a=o;Bm(o,(function(){return"ApplicationInsights:initialize"}),(function(){e=Pf(e,ew,a.logger,!1).cfg,r=new ZI;var o=[n=new VC];i&&(o=o.concat(i)),e||bu("You must provide a config object!");var s=e.channels;if(s&&s.length>0){for(var c=!1,u=0;u<s[0].length;u++)if(s[0][u].identifier===r.identifier){c=!0;break}c||_l(s[0],r)}else e.channels.push([r]);var l=e.extensionConfig;l[r.identifier]=l[r.identifier]||e&&e.channelConfiguration||{},l[n.identifier]=l[n.identifier]||e&&e.propertyConfiguration||{};try{t.initialize(e,o),a.isInitialized()&&Tu(e,{channelConfiguration:{g:function(){return e.extensionConfig[r.identifier]}},propertyConfiguration:{g:function(){return e.extensionConfig[n.identifier]}}})}catch(e){em(a.logger,1,514,"Failed to initialize SDK."+Su(e))}}),(function(){return{config:e,extensions:i}}))},e.getPropertyManager=function(){return n},e.getPostChannel=function(){return r}})),o}return pd(t,e),t.__ieDyn=1,t}(Py);const rw="msal.request";function nw(e){try{return new es(e.cache?.temporaryCacheLocation||Ii.SessionStorage)}catch(e){return new $a}}function ow(e){return`${rw}.${e}`}const iw=`${rw}.mats-telemetry-profile-id`;class aw{constructor(e,t,r,n){this.logger=e,this.appName=r,this.appVersion=n,this.eventsToEmit=new Set(t),this.sessionId=Ra();const o={instrumentationKey:"faab4ead691e451eb230afc98a28e0f2-698cf73d-7930-426b-87d8-d36936f6912f-7401",endpointUrl:"https://eu-mobile.events.data.microsoft.com/OneCollector/1.0/",extensions:[],propertyConfiguration:{gpcDataSharingOptIn:!1},disableCookiesUsage:!0};this.appInsightsMATS=new tw,this.appInsightsMATS.initialize(o,[]),this.logger.verbose("MATSTelemetryReporter: Initialized");try{const e=new es(Ii.LocalStorage),t=e.getItem(iw);if(t?.length)this.profileTelemetryId=t;else{const t=Ra();this.profileTelemetryId=t,e.setItem(iw,t)}}catch(t){e.warning("MATSTelemetryReporter: local storage is not available"),this.profileTelemetryId=""}}sendCustomEvent(e){if(!this.eventsToEmit.has(e.name))return void this.logger.verbose(`MATSTelemetryReporter: Skipping telemetry for ${e.name}`,e.correlationId);const t={...e,appName:this.appName,appVersion:this.appVersion,libraryName:"MSAL-JS",profileTelemetryId:this.profileTelemetryId,sessionId:this.sessionId};delete t.context,delete t.errorStack;const r={name:"actionmsaljs".concat(e.name.toLowerCase()||""),data:t};this.logger.verbose(`MATSTelemetryReporter: Sending ${r.name} for tracking`),this.appInsightsMATS.track(r),e.name===gc.AcquireTokenPreRedirect&&this.appInsightsMATS.flush()}}class sw{constructor(e,t,r){this.synthetic=!1,this.redactionRatio=.1,this.logger=e,this.eventsToEmit=new Set(t);const n={instrumentationKey:"d634483c08244c1ca09af2b2d952c92e-ab2bba03-2ba3-49d8-a82c-ef6da750d8ab-7725",extensions:[],propertyConfiguration:{gpcDataSharingOptIn:!1},disableCookiesUsage:!0};this.appInsights=new tw,this.appInsights.initialize(n,[]),this.synthetic=r||!1,this.logger.verbose("PerformanceTelemetryReporter: Initialized")}sendCustomEvent(e){if(!this.eventsToEmit.has(e.name))return void this.logger.verbose(`PerformanceTelemetryReporter: Skipping telemetry for ${e.name}`,e.correlationId);let t;var r;!e.success||(r=this.redactionRatio,Math.random()<=r)?(t={...e,appName:void 0,synthetic:this.synthetic},this.logger.verbose(`PerformanceTelemetryReporter: Sending ${t.name} for tracking`)):(t={name:e.name,eventId:e.eventId,correlationId:e.correlationId,requestId:e.requestId,success:e.success,status:e.status,fromCache:e.fromCache,startPageVisibility:e.startPageVisibility,endPageVisibility:e.endPageVisibility,authority:e.authority,durationMs:e.durationMs,startTimeMs:e.startTimeMs,clientId:e.clientId,libraryName:e.libraryName,libraryVersion:e.libraryVersion,accountType:e.accountType,synthetic:this.synthetic,isBroker:e.isBroker,isBackground:e.isBackground},this.logger.verbose(`PerformanceTelemetryReporter: Sending redacted ${t.name} for tracking`));const n={name:e.name,data:t};this.appInsights.track(n),e.name===gc.AcquireTokenPreRedirect&&this.appInsights.flush()}}const cw=new Set([gc.AcquireTokenSilent,gc.AcquireTokenByCode,gc.AcquireTokenPopup,gc.AcquireTokenRedirect,gc.AcquireTokenPreRedirect,gc.PairwiseBrokerApplicationInitializeBrokering,gc.SsoSilent,gc.EmbeddedClientApplicationSendSSOSilentRequest,gc.EmbeddedClientApplicationSendPopupRequest,gc.EmbeddedClientApplicationSendRedirectRequest,gc.EmbeddedClientApplicationHandleRedirectRequest,gc.EmbeddedClientApplicationSendSilentRefreshRequest]);class uw{constructor(e,t){this.logger=e;const r=t?.eventsToEmit?.filter((e=>cw?.has(e)))||[...cw];this.matsTelemetryReporter=t?.enableMATS?new aw(e,r,t?.appName,t?.appVersion):null,this.perfTelemetryReporter=new sw(e,r,t?.synthetic)}sendCustomEvent(e){this.perfTelemetryReporter.sendCustomEvent(e),this.matsTelemetryReporter?.sendCustomEvent(e)}getTelemetryCallback(){this.logger.trace("TelemetryReporter: Attaching callback to send custom metrics.");return this.logger.verbose("TelemetryReporter: Returning callback as telemetry emitted."),e=>{e.forEach((e=>{e.name===gc.AcquireTokenByBroker&&(e.name=e.brokerEventName||e.name,e.isBroker=!0,delete e.brokerEventName,this.logger.verbosePii(`TelemetryReporter: Updated broker event ${JSON.stringify(e)}`,e.correlationId)),this.sendCustomEvent(e)}))}}}const lw=[Et.AzurePublic,Et.AzurePpe];class dw extends tc{constructor(e,t){let r;const n="undefined"!=typeof window;if(!t?.disabled&&function(e){return!e.auth.authority||lw.some((t=>0===e.auth.authority?.indexOf(t.toString())))}(e)&&n?(r=e.telemetry?.client||new dc(e,new Set(mc),new Map(fc)),super({...e,telemetry:{...e.telemetry,client:r}})):(super(e),r=new lo),this.performanceClient=r,n){const e=new uw(this.getLogger(),t);this.addPerformanceCallback(e.getTelemetryCallback())}}static async createPublicClientApplication(e,t,r){const n=new dw(e,t);return await n.initialize({correlationId:r}),n}}const hw="BrokerReady",pw="BrokerHandshakeRequest",gw="BrokerHandshakeResponse",fw="BrokerAuthRequest",mw="BrokerRedirectResponse",vw="BrokerHandleRedirectRequest",yw="BrokerAuthResult",Cw="EmbeddedLogoutRequest",Tw="EmbeddedLogoutResponse",Iw="BrokerAuthError",ww="InteractionRequiredAuthError",Ew="ServerError",kw="ClientAuthError",Sw="ClientConfigurationError",bw="BrowserAuthError",Aw="BrowserConfigurationError",_w="AuthError";class Rw{constructor(e){this.messageType=e}static validateMessage(e){if(!e.data||!e.data.messageType)return null;switch(e.data.messageType){case pw:case gw:case vw:case fw:case yw:case mw:case Cw:return e;default:return null}}}class Pw extends Rw{constructor(e,t,r=!1,n){super(pw),this.embeddedClientId=e,this.version=t,this.allowTelemetry=r,this.nonce=n}static validate(e){return e.data&&e.data.messageType===pw&&e.data.embeddedClientId&&e.data.version?new Pw(e.data.embeddedClientId,e.data.version,e.data.allowTelemetry,e.data.nonce):null}}class Mw extends Rw{constructor(e,t,r){super(gw),this.version=e,this.brokerOrigin=t,this.nonce=r}static validate(e,t){if(!t.includes(e.origin))return null;const r=Rw.validateMessage(e);return r&&r.data.messageType===gw&&r.data.version?new Mw(r.data.version,r.origin,r.data.nonce):null}}class Nw extends Rw{get embeddedAppOrigin(){return this._embeddedAppOrigin}constructor(e,t,r,n){super(fw),this.embeddedClientId=e,this._embeddedAppOrigin=n,this.interactionType=t,this.request=r}static validate(e,t){return e.data&&e.data.messageType===fw&&e.data.embeddedClientId&&e.data.interactionType&&e.data.request?new Nw(e.data.embeddedClientId,e.data.interactionType,e.data.request,t):null}}class Ow extends Rw{constructor(){super(mw)}static validate(e){return e.data&&e.data.messageType===mw?new Ow:null}}const qw={code:"no_embedded_app",desc:"The embedded application object was not created. Please ensure you have configured your application correctly for an embedded application: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/broker-v2/lib/msal-browser/docs/broker.md#brokered-application-configuration"},Uw={code:"broker_response_invalid",desc:"The broker response did not have the expected values."},xw={code:"broker_popup_will_redirect",desc:"The request for a brokered popup requires a redirect by the broker. If your app does not perform the redirect, please check the broker's logs."},Lw={code:"broker_timeout",desc:"Message broker timed out."},Bw={code:"broker_handshake_timeout",desc:"Broker handshake response timed out."},Hw={code:"broker_handshake_failed",desc:"Broker handshake failed. Please see logs for details."},Dw={code:"no_trusted_brokers_provided",desc:"No trusted brokers provided."},Fw={code:"brokering_disabled",desc:"Brokering is not enabled for the client application. Please check logs to see if handshake was performed."},Kw={code:"shr_generation_error",desc:"Error generating SHRs. Kid is missing in the request."};class zw extends Ie{constructor(e,t){super(e,t),Object.setPrototypeOf(this,zw.prototype),this.name=Iw}static createNoEmbeddedAppError(){return new zw(qw.code,qw.desc)}static createBrokerResponseInvalidError(){return new zw(Uw.code,`${Uw.desc}`)}static createBrokerPopupRequestRedirectingError(){return new zw(xw.code,xw.desc)}static createNoTrustedBrokersProvidedError(){return new zw(Dw.code,Dw.desc)}static createBrokeringDisabledError(){return new zw(Fw.code,`${Fw.desc}`)}static createMessageBrokerTimeoutError(){return new zw(Lw.code,Lw.desc)}static createMessageBrokerHandshakeTimeoutError(){return new zw(Bw.code,Bw.desc)}static createBrokerHandshakeFailedError(){return new zw(Hw.code,Hw.desc)}static createShrGenerationError(){return new zw(Kw.code,Kw.desc)}}class Gw extends Rw{constructor(e,t,r){if(super(yw),this.interactionType=e,this.result=t,r){const{setCorrelationId:e,...t}=r;this.errorPayload=t}}static validate(e){return e.data&&e.data.messageType===yw&&e.data.interactionType&&(e.data.result||e.data.errorPayload)?new Gw(e.data.interactionType,e.data.result,e.data.errorPayload):null}static detectError(e){let t;switch(e.name){case ww:t=new Dn(e.errorCode,e.errorMessage,e.subError);break;case Ew:t=new rn(e.errorCode,e.errorMessage,e.subError);break;case kw:t=new mt(e.errorCode,e.errorMessage);break;case Sw:t=new vr(e.errorCode);break;case bw:t=new di(e.errorCode);break;case Aw:t=new pa(e.errorCode,e.errorMessage);break;case Iw:t=new zw(e.errorCode,e.errorMessage);break;case _w:t=new Ie(e.errorCode,e.errorMessage,e.subError);break;default:t=new Ie(me,JSON.stringify(e))}return t.setCorrelationId(e.correlationId),t}}class Qw extends Rw{constructor(e,t){super(vw),this.embeddedClientId=e,this.version=t}static validate(e){return e.data&&e.data.messageType===vw&&e.data.embeddedClientId&&e.data.version?new Qw(e.data.embeddedClientId,e.data.version):null}}function jw(e){return{...{preferredInteractionType:null,brokerRedirectParams:{},actAsBroker:!1,allowBrokering:!1,trustedBrokerDomains:[],brokerHandshakeTimeout:e?.brokerHandshakeTimeout||2e3,brokerMessageTimeout:e?.brokerMessageTimeout||6e3,brokerInteractionTimeout:e?.brokerInteractionTimeout||3e5},...e}}class Ww extends Rw{constructor(e,t){super(Cw),this.version=e,this.correlationId=t}static validate(e){const t=Rw.validateMessage(e);return t&&t.data&&t.data.version?new Ww(t.data.version,t.data.correlationId):null}}const Vw="3.26.0";function Yw(e){const t=e.split("-",1)[0].split(".",3);return{major:parseInt(t[0]),minor:parseInt(t[1]),patch:parseInt(t[2])}}function $w(e){e.port1.close(),e.port2.close()}function Jw(e,t,r,n=20){if(0===e.length||r>n)return[0,r-1];let o=r,i=e.length;for(let a=0;a<e.length;a++){e[a].postMessage(t,"*");const[s,c]=Jw(e[a],t,r+1,n);i+=s,c>o&&(o=c)}return[i,o]}class Xw extends dw{constructor(e,t,r){super(e),this.currentBrokerRedirectResponse=void 0,this.hybridAuthPromise=void 0,this.pwbBrokerAppConfiguration=jw(t),this.redirectResponseMap=new Map,this.embeddedAppConfigMap=new Map,this.telemetryAllowedEmbeddedClients=new Set,this.logger=new Tt(e.system?.loggerOptions||{},"@azure/msal-browser-1p",Vw),this.eventHandler=r,this.messageListener=this.handleBrokerMessage.bind(this)}getRedirectCorrelationId(){const e=`msal.${this.getConfiguration().auth.clientId}`,t=nw(this.getConfiguration()).getItem(`${e}.request.native`);try{if(t){const e=JSON.parse(t);return e&&"object"==typeof e?e.correlationId:null}}catch(e){this.logger.error("BrokerClientApplication.getRedirectCorrelationId: Unable to parse native request")}return nw(this.getConfiguration()).getItem(`${e}.request.correlationId`)||""}async handleRedirectPromise(e){const t=this.getRedirectCorrelationId(),r=this.performanceClient.startMeasurement(gc.AcquireTokenByBroker,t);r.add({brokerEventName:gc.AcquireTokenRedirect});try{const t=super.handleRedirectPromise(e);this.currentBrokerRedirectResponse=t;const n=await this.currentBrokerRedirectResponse;if(this.currentBrokerRedirectResponse=void 0,n){const e=function(e){if(!e)return null;try{const t=window.atob(e),r=new Uint8Array(t.length);for(let e=0;e<r.length;e++)r[e]=t.charCodeAt(e);const n=(new TextDecoder).decode(r),o=JSON.parse(n);return o.hasOwnProperty("brokerState")?o:null}catch(e){return null}}(n.state);if(this.setActiveAccount(n.account),!e)return r.end({success:!0}),n;{const t={...n,state:e.userState};this.redirectResponseMap.set(e.brokerState.requestOrigin,t),r.add({embeddedClientId:e.brokerState.requestClientId,embeddedRedirectUri:e.brokerState.requestOrigin}),this.endBrokerPerformanceEvent(e.brokerState.requestClientId,r)}}else r.discard();return null}catch(e){throw e instanceof Ie&&e.setCorrelationId(t),r.end({success:!1},e),e}}async listenForBrokerMessage(e,t){return this.logger.verbose("listening for child broker messages."),window.addEventListener("message",this.messageListener),this.broadcastBrokerReadyMessage(window.frames,e,t),e&&e.codeRequest&&(this.hybridAuthPromise=this.acquireTokenByCode(e.codeRequest)),this.hybridAuthPromise}broadcastBrokerReadyMessage(e,t,r){this.logger.trace("Broadcasting broker ready message to child frames.");const n={messageType:hw};window.postMessage(n,"*");const[o,i]=Jw(e,n,1,t?.maxChildFrameDepth);r?.add({maxFrameDepthReached:i,framesNotified:o,maxFrameDepthConfigured:t?.maxChildFrameDepth}),this.logger.trace(`Broadcasted broker ready message to ${o} child frames with a max depth of ${i}`)}stopListeningForBrokerMessage(){this.logger.verbose("stop listening for child broker messages."),window.removeEventListener("message",this.messageListener),this.embeddedAppConfigMap.forEach((([e,t])=>{this.logger.verbose(`closing message port for ${e}`),t.close()})),this.embeddedAppConfigMap.clear()}async handleBrokerMessage(e){const t=Rw.validateMessage(e);if(t&&t.data.messageType)switch(this.logger.verbose(`Broker received message with type: ${t.data.messageType}`),t.data.messageType){case pw:return this.handleBrokerHandshake(t);case vw:const e=Qw.validate(t);if(!e)return;return this.handleBrokerRedirectResponse(e,t);case fw:const r=Nw.validate(t,this.embeddedAppConfigMap.get(t.data.embeddedClientId)?.[0]||t.origin);if(!r)return;r.request.correlationId||(r.request.correlationId=Ra());const n=this.performanceClient.startMeasurement(gc.AcquireTokenByBroker,r.request.correlationId),o=t.ports?.[0];try{return await this.handleBrokerAuthRequest(r,o),void this.endBrokerPerformanceEvent(r.embeddedClientId,n)}catch(e){throw this.endBrokerPerformanceEvent(r.embeddedClientId,n,e),e}default:return}}isDescendantFrame(e){const t=[];for(t.push(e.sourceFrame);t.length>0;){const r=t.pop();if(r)for(let n=0;n<r.frames.length;n++){const o=r.frames[n];if(o===e.targetFrame)return!0;o!==r&&t.push(o)}}return!1}async handleBrokerHandshake(e){if(!e.source||!e.source.window||e.source.window!==e.source)return void this.logger.warning("Broker handshake request validation failed. Message origin is not an iframe");const t=e.source;window===t||this.isDescendantFrame({sourceFrame:window,targetFrame:t})||this.logger.warning("Broker handshake request validation failed. Message origin is not a descendant iframe");const r=Pw.validate(e);if(!r)return void this.logger.warning("Broker handshake request validation failed. Message may not have come from MSAL.js.");const n=Ra(),o=this.performanceClient.startMeasurement(gc.BrokerClientApplicationHandleBrokerHandshake,n);try{if(o.add({embeddedClientId:r.embeddedClientId}),r.allowTelemetry&&this.telemetryAllowedEmbeddedClients.add(r.embeddedClientId),this.logger.verbose(`${r.messageType} validated for AppId: ${r.embeddedClientId}`),this.hybridAuthPromise)try{await this.hybridAuthPromise}catch(e){this.logger.error(`Broker could not obtain tokens using authorization code initializer: ${e}`)}const t=new Mw(Vw,"",e.data.nonce);this.logger.verbose(`Sending handshake response to ${e.origin}`);const n=e.ports?.[0];n&&(n.onmessage=this.messageListener,this.embeddedAppConfigMap.set(e.data.embeddedClientId,[e.origin,n]));const i=Yw(e.data.version);n&&3===i.major&&i.minor>=15&&i.minor<=19?n?.postMessage(t):e.source?.postMessage(t,e.origin)}catch(e){throw this.endBrokerPerformanceEvent(r.embeddedClientId,o,e),e}}async handleBrokerRedirectResponse(t,r){if(t){const n=this.embeddedAppConfigMap.get(t.embeddedClientId);let o,i;n?[i,o]=n:(i=r.origin,o=r.ports?.[0]),this.currentBrokerRedirectResponse&&await this.currentBrokerRedirectResponse;const a=this.redirectResponseMap.get(i),s=new Gw(e.InteractionType.Redirect,a||null);this.logger.verbose("Sending auth response"),o?.postMessage(s);const c=`msal.${this.getConfiguration().auth.clientId}`;nw(this.getConfiguration()).removeItem(`${c}.request.native`)}else;}async handleBrokerAuthRequest(t,r){this.currentBrokerRedirectResponse&&await this.currentBrokerRedirectResponse,t.request.correlationId||(t.request.correlationId=Ra());const n=t.request.correlationId,o=t.request.account||this.getActiveAccount();let i;switch(t.interactionType){case e.InteractionType.Silent:if(o){this.performanceClient.addFields({brokerEventName:gc.AcquireTokenSilent},n),i=this.brokeredSilentRequest(t,o,r);break}this.performanceClient.addFields({brokerEventName:gc.SsoSilent},n),i=this.brokeredSsoSilentRequest(t,r);break;case e.InteractionType.Redirect:case e.InteractionType.Popup:default:const a=this.getInteractionType(t.interactionType);this.performanceClient.addFields({brokerEventName:a===e.InteractionType.Redirect?gc.AcquireTokenRedirect:gc.AcquireTokenPopup},n),i=this.interactiveBrokerRequest(a,t,r)}return i}getInteractionType(e){const t=this.pwbBrokerAppConfiguration.preferredInteractionType;return t||e}async interactiveBrokerRequest(t,r,n){switch(t){case e.InteractionType.Redirect:return this.brokeredRedirectRequest(r,n);case e.InteractionType.Popup:return this.brokeredPopupRequest(r,n);case e.InteractionType.Silent:return void this.logger.error("Invalid code path. interactiveBrokerRequest() should only be called for interactive requests.");case e.InteractionType.None:return void this.logger.error("Broker is blocking interactive requests. Please attempt a silent request or sign into the broker first.");default:return void this.logger.error("Invalid code path. interactiveBrokerRequest() should only be called for interactive requests.")}}async brokeredRedirectRequest(t,r){this.logger.verbose("Brokered redirect request initiated.");const n=this.getAllAccounts();this.eventHandler.emitEvent(0===n.length?ds.LOGIN_START:ds.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t.request);const o=this.embeddedAppConfigMap.get(t.embeddedClientId)?.[1]||r;try{const e=new Ow;o?.postMessage(e),this.logger.verbose(`Sending redirect response: ${e}`);const r=this.addBrokerRequestProperties(t);return r.state=function(e,t){const r={userState:t,brokerState:{requestOrigin:e.embeddedAppOrigin,requestClientId:e.embeddedClientId}},n=JSON.stringify(r),o=(new TextEncoder).encode(n);return window.btoa(Array.from(o,(e=>String.fromCodePoint(e))).join(""))}(t,r.state),await super.acquireTokenRedirect(r)}catch(t){const r=new Gw(e.InteractionType.Redirect,null,t);this.logger.verbose(`Found auth error in redirect: ${t}`),o?.postMessage(r),this.eventHandler.emitEvent(0===n.length?ds.LOGIN_FAILURE:ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t)}}async brokeredPopupRequest(t,r){this.logger.verbose("Brokered popup request initiated.");const n=this.getAllAccounts();this.eventHandler.emitEvent(0===n.length?ds.LOGIN_START:ds.ACQUIRE_TOKEN_START,e.InteractionType.Popup,t.request);const o=this.embeddedAppConfigMap.get(t.embeddedClientId)?.[1]||r;try{const r=this.addBrokerRequestProperties(t),i=await super.acquireTokenPopup(r),a=new Gw(e.InteractionType.Popup,i);this.logger.verbosePii("Sending auth response"),o?.postMessage(a);const s=n.length<this.getAllAccounts().length;this.eventHandler.emitEvent(s?ds.LOGIN_SUCCESS:ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,i)}catch(t){const r=new Gw(e.InteractionType.Popup,null,t);this.logger.verbose(`Found auth error in popup: ${t}`),o?.postMessage(r),this.eventHandler.emitEvent(0===n.length?ds.LOGIN_FAILURE:ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t)}}async brokeredSsoSilentRequest(t,r){this.logger.verbose("Brokered SSO Silent request initiated."),this.eventHandler.emitEvent(ds.SSO_SILENT_START,e.InteractionType.Silent,t.request);const n=this.embeddedAppConfigMap.get(t.embeddedClientId)?.[1]||r;try{const r=this.addBrokerRequestProperties(t),o=await super.ssoSilent(r),i=new Gw(e.InteractionType.Silent,o);this.logger.verbosePii("Sending auth response"),n?.postMessage(i),this.eventHandler.emitEvent(ds.SSO_SILENT_SUCCESS,e.InteractionType.Silent,o)}catch(t){const r=new Gw(e.InteractionType.Silent,null,t);this.logger.verbose(`Found auth error in ssoSilent: ${t}`),n?.postMessage(r),this.eventHandler.emitEvent(ds.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,t)}}async brokeredSilentRequest(t,r,n){this.logger.verbose("Brokered Silent request initiated."),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Silent,t.request);const o=this.embeddedAppConfigMap.get(t.embeddedClientId)?.[1]||n;try{const n=this.addBrokerRequestProperties(t,r);n.cacheLookupPolicy=Gi.RefreshTokenAndNetwork;const i=await super.acquireTokenSilent(n),a=new Gw(e.InteractionType.Silent,i);o?.postMessage(a),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,i)}catch(t){const r=new Gw(e.InteractionType.Silent,null,t);this.logger.verbose(`Found auth error in silent: ${t}`),o?.postMessage(r),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t)}}getEmbeddedAppRedirectUri(e){const t=new Ur(e);return`brk-${this.getConfiguration().auth.clientId}://${t.getUrlComponents().HostNameAndPort}`}addBrokerRequestProperties(e,t){const r={...e.request};r.redirectUri=this.getEmbeddedAppRedirectUri(e.embeddedAppOrigin),r.extraQueryParameters={...r.extraQueryParameters,client_id:e.embeddedClientId,brk_client_id:this.getConfiguration().auth.clientId,brk_redirect_uri:this.getConfiguration().auth.redirectUri||Ca()},r.tokenBodyParameters={...r.tokenBodyParameters,client_id:e.embeddedClientId,brk_client_id:this.getConfiguration().auth.clientId,brk_redirect_uri:this.getConfiguration().auth.redirectUri||Ca()},r.storeInCache={idToken:!1,accessToken:!1};const n=t||this.getActiveAccount();return n&&(r.account=n),e.request.correlationId&&this.performanceClient.addFields({embeddedClientId:e.embeddedClientId,embeddedRedirectUri:e.embeddedAppOrigin},e.request.correlationId),r}async sendLogoutRequestToEmbeddedApps(e){this.logger.verbose("sendLogoutRequestToEmbeddedApps called"),await this.messageEmbeddedAppsToLogout(new Ww(Vw,e?.correlationId||Ra()))}async messageEmbeddedAppsToLogout(e){const t=[];this.embeddedAppConfigMap.forEach((r=>{t.push(new Promise(((t,n)=>{const o=window.setTimeout((()=>{t()}),200);try{r[1]?.postMessage(e),r[1].addEventListener("message",(e=>{e.data.messageType===Tw&&(this.logger.info(`Received logout response from embedded app: ${e.data.embeddedClientId}`),t(),clearTimeout(o))}))}catch(e){this.logger.error(`Could not logout application ${r[0]}. Error in message channel: ${e}`),n(e)}})))})),await Promise.all(t)}endBrokerPerformanceEvent(e,t,r){this.telemetryAllowedEmbeddedClients.has(e)||(this.logger.verbosePii(`TelemetryReporter: Skipping brokered event as not allowed by the client ${e}`,t.event.correlationId),t.discard()),r?t.end({success:!1},r):t.end({success:!0})}}class Zw extends Rw{constructor(e,t,r){super(Tw),this.version=e,this.correlationId=r,this.embeddedClientId=t}}const eE="brokerInteractionTimeoutMs",tE="brokerMessageTimeoutMs",rE="brokerIframeTimeoutMs",nE="brokerInteractionTimedOut",oE="brokerMessageTimedOut",iE="brokerIframeTimedOut";class aE{get trustedBrokersProvided(){return!!this.pwbBrokeredAppConfiguration.trustedBrokerDomains&&this.pwbBrokeredAppConfiguration.trustedBrokerDomains.length>=1}get brokerConnectionEstablished(){return!!this.brokerMetadata}constructor(e,t,r,n,o,i,a,s){this.pwbBrokeredAppConfiguration=r,this.clientId=e,this.logger=n,this.brokerMetadata=null,this.performanceClient=o,this.hydrateCache=a,this.clearCache=s,this.messageChannelList=[],this.messageChannel=new MessageChannel,this.resolvers=new Map,this.temporaryBrokerStorage=i,this.onWindowMessageCb=this.onWindowMessage.bind(this),this.handshakeMetadata={correlationId:t}}getAncestors(){const e=[];let t=window;for(;t&&t.parent&&t.parent.window!==t;)t=t.parent?.window,e.push(t);return this.logger.verbose(`Attempting to send handshake request to ${e.length} ancestors`),e}async initiateHandshake(e){if(!this.trustedBrokersProvided)throw zw.createNoTrustedBrokersProvidedError();return this.initMeasurement&&this.initMeasurement.discard(),this.initMeasurement=e,new Promise(((t,r)=>{const n=setTimeout((()=>{this.logger.warning("Broker handshake timed out"),e?.add({brokerHandshakeTimedOut:!0,brokerHandshakeTimeoutMs:this.pwbBrokeredAppConfiguration.brokerHandshakeTimeout}),r(zw.createMessageBrokerHandshakeTimeoutError())}),this.pwbBrokeredAppConfiguration.brokerHandshakeTimeout);this.handshakeMetadata.resolve=t,this.handshakeMetadata.reject=r,this.handshakeMetadata.timeoutId=n,window.addEventListener("message",this.onWindowMessageCb);const o=[];o.push(window),o.push(...this.getAncestors());for(let t=0;t<o.length;t++){const r=o[t],n=o.length-t-1;this.logger.verbose(`Sending handshake request to frame with depth = ${n}`),this.sendHandshakeRequest(r,n,void 0,e)}})).catch((e=>{const t=e;this.logger.error(t.message)}))}async onWindowMessage(e){if(e.data&&e.origin&&this.pwbBrokeredAppConfiguration.trustedBrokerDomains.includes(e.origin)){if(e.data.messageType===hw){this.logger.verbose("Broker is available.");const t=this.performanceClient.startMeasurement(gc.PairwiseBrokerApplicationInitializeBrokering,this.handshakeMetadata.correlationId);return this.handshakeMetadata.performanceEvent&&this.handshakeMetadata.performanceEvent.discard(),this.handshakeMetadata.performanceEvent=t,t.add({isBackground:!0}),this.sendHandshakeRequest(e.source,this.getFrameDepth(e.source),e.origin,t)}e.data.messageType===gw&&(this.handshakeMetadata.performanceEvent=this.initMeasurement,this.onHandshakeResponse(e))}}getFrameDepth(e){const t=[];t.push(window),t.push(...this.getAncestors());for(let r=0;r<t.length;r++){if(t[r]===e)return t.length-r-1}return 0}closeBrokerConnection(){this.logger.verbose("Closing broker connection."),this.brokerMetadata=null,$w(this.messageChannel),this.messageChannelList.forEach((e=>$w(e.channel))),window.removeEventListener("message",this.onWindowMessageCb)}async sendSsoSilentRequest(t){this.performanceEvent=this.performanceClient.startMeasurement(gc.EmbeddedClientApplicationSendSSOSilentRequest,t.correlationId),ba(!0),this.performanceEvent.increment({visibilityChangeCount:0});const r=()=>{this.trackPageVisibility()};document.addEventListener("visibilitychange",r);try{const r=await this.sendRequest(t,e.InteractionType.Silent,{type:rE,error:iE,value:Oa}),n=await this.handleResponse(r,t);if(!n)throw this.logger.errorPii(`Broker response is empty in brokered ssoSilent request: ${JSON.stringify(n)}`),zw.createBrokerResponseInvalidError();return this.performanceEvent.end({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker,requestId:n.requestId},t.correlationId),n}catch(e){throw this.performanceEvent.end({success:!1},e),e}finally{document.removeEventListener("visibilitychange",r)}}async sendPopupRequest(t){this.performanceEvent=this.performanceClient.startMeasurement(gc.EmbeddedClientApplicationSendPopupRequest,t.correlationId),ba(!0);try{const r=await this.sendRequest(t,e.InteractionType.Popup,{type:eE,error:nE,value:this.pwbBrokeredAppConfiguration.brokerInteractionTimeout}),n=await this.handleResponse(r,t);if(!n){if(!Ow.validate(r))throw this.logger.errorPii(`Broker response is empty in brokered popup request: ${JSON.stringify(n)}`),zw.createBrokerResponseInvalidError();throw this.logger.verbose("popupRequest requires a redirect by the broker, this app will now redirect."),zw.createBrokerPopupRequestRedirectingError()}return this.performanceEvent.end({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker,requestId:n.requestId}),n}catch(e){throw this.performanceEvent.end({success:!1},e),e}}async sendHandleRedirectRequest(e){this.performanceEvent=this.performanceClient.startMeasurement(gc.EmbeddedClientApplicationHandleRedirectRequest);try{const t=new Qw(this.clientId,Vw),r=await this.messageBroker(t,e.correlationId,{type:tE,error:oE,value:this.pwbBrokeredAppConfiguration.brokerMessageTimeout}),n=await this.handleResponse(r,e);return this.performanceEvent.end({success:!0,fromCache:n?.fromCache,accessTokenSize:n?.accessToken.length,idTokenSize:n?.idToken.length,isNativeBroker:n?.fromNativeBroker}),n}catch(e){throw this.performanceEvent.end({success:!1},e),e}}async sendSilentRefreshRequest(t){this.performanceEvent=this.performanceClient.startMeasurement(gc.EmbeddedClientApplicationSendSilentRefreshRequest,t.correlationId),ba(!0),this.performanceEvent.increment({visibilityChangeCount:0});const r=()=>this.trackPageVisibility();document.addEventListener("visibilitychange",r);try{const r=await this.sendRequest(t,e.InteractionType.Silent,{type:tE,error:oE,value:this.pwbBrokeredAppConfiguration.brokerMessageTimeout}),n=await this.handleResponse(r,t);if(!n)throw this.logger.errorPii(`Broker response is empty in brokered silent refresh request: ${JSON.stringify(n)}`),zw.createBrokerResponseInvalidError();return this.performanceEvent.end({success:!0,fromCache:n.fromCache,accessTokenSize:n.accessToken.length,idTokenSize:n.idToken.length,isNativeBroker:n.fromNativeBroker,requestId:n.requestId}),n}catch(e){throw this.performanceEvent.end({success:!1},e),e}finally{document.removeEventListener("visibilitychange",r)}}async sendRequest(e,t,r){if(e.authenticationScheme===W.POP){const t=new sc(e);e.popKid=await t.generatePublicKeyThumbprint();const r=ow(this.clientId);this.temporaryBrokerStorage.containsKey(r)&&this.temporaryBrokerStorage.setItem(r,JSON.stringify(e))}const n=new Nw(this.clientId,t,e,"");return this.messageBroker(n,e.correlationId,r)}getMessageChannelProperties(e){return e?this.messageChannelList.find((t=>t.nonce===e)):this.getMessageChannelPropertiesByDepth(0)}getMessageChannelPropertiesByDepth(e){return this.messageChannelList.find((t=>t.depth===e))}onHandshakeResponse(e){const{resolve:t,reject:r,performanceEvent:n,timeoutId:o}=this.handshakeMetadata;try{const r=Mw.validate(e,this.pwbBrokeredAppConfiguration.trustedBrokerDomains);if(r){const e=this.getMessageChannelProperties(r.nonce);if(!e)return this.logger.trace("No MessageChannel found, ignoring this response"),void n?.increment({handshakeIgnoredCount:1});if(r.nonce&&r.nonce!==e.nonce)return this.logger.trace("Received handshake response but there is a newer handshake request in flight, ignoring this one"),void n?.increment({handshakeIgnoredCount:1});o&&clearTimeout(o),this.logger.verbose("Received handshake response");const i=Yw(r.version);this.brokerMetadata={origin:r.brokerOrigin,version:r.version,semver:i,frameDepth:e.depth},i.major<=3&&i.minor<15&&$w(e.channel),$w(this.messageChannel),this.messageChannel=e.channel,t&&t(),n?.add({brokerFrameDepth:e.depth}),n?.end({success:!0})}}catch(e){const t=e;r&&r(t),this.logger.error(t.message),n?.end({success:!1},t)}}sendHandshakeRequest(e=window.top,t,r,n){if(this.logger.trace("Pairwise Broker - sendHandshakeRequest called."),!e)throw this.logger.error("Target frame is undefined."),zw.createBrokerHandshakeFailedError();let o=new MessageChannel;const i=Ra();o.port1.onmessage=async t=>{t.data&&(t.data.messageType===gw?(this.logger.warning("Received handshake response but the broker app is using a version of MSAL.js that does not report its origin, attempting direct communication with each trusted broker domain to resolve. This is a known issue with versions 3.15.0-3.19.1, consider asking the broker app to upgrade."),this.pwbBrokeredAppConfiguration.trustedBrokerDomains.forEach((t=>{const r=new MessageChannel;r.port1.onmessage=e=>{$w(o),o=r,this.onHandshakeResponse({...e,data:{...e.data},origin:t})},this.logger.verbose(`Sending handshake request to ${t}`),e?.postMessage(a,t,[r.port2])}))):await this.handleBrokerMessage(t))};const a=new Pw(this.clientId,Vw,!0,i),s=this.getMessageChannelPropertiesByDepth(t);s?($w(s.channel),s.channel=o,s.nonce=i):this.messageChannelList.push({channel:o,nonce:i,depth:t}),this.logger.verbose("Sending handshake request"),n?.increment({handshakeSentCount:1}),e?.postMessage(a,r||"*",[o.port2])}async handleBrokerMessage(t){const r=t.data?.result?.correlationId||t.data?.errorPayload?.correlationId,n=t.data.messageType;if(this.logger.verbose(`Received message from broker of type: ${n} with correlationId: ${r}`),!n)return;let o;if(n===Cw)return this.logger.verbose("Received logout message from broker."),await this.handleLogoutMessageFromBroker(t),void this.messageChannel.port1.postMessage(new Zw(Vw,this.clientId,r));if(n===yw&&t.data.interactionType===e.InteractionType.Redirect)this.logger.verbose("Received redirect response from broker."),o=e.InteractionType.Redirect;else{if(!r)return void this.logger.verbose(`No correlationId found in message: ${n}.`);this.logger.verbose(`Resolving message for ${r}.`),o=r}const i=this.resolvers.get(o);i?(clearTimeout(i.timeoutId),i.resolve(t),this.resolvers.delete(o)):this.logger.warning(`Cannot resolve message for ${r}. Ignoring.`)}async messageBroker(t,r,n={type:tE,error:oE,value:this.pwbBrokeredAppConfiguration.brokerMessageTimeout}){return new Promise(((o,i)=>{if(!this.brokerMetadata)return void i(zw.createBrokeringDisabledError());const a=setTimeout((()=>{const e={};e[n.error.toString()]=!0,this.performanceEvent?.add(e),i(zw.createMessageBrokerTimeoutError())}),n.value),s={};s[n.type.toString()]=n.value,this.performanceEvent?.add(s);const c=t.messageType===vw?e.InteractionType.Redirect:r;if(this.resolvers.set(c,{resolve:o,reject:i,timeoutId:a}),this.brokerMetadata.semver.major>=3&&this.brokerMetadata.semver.minor>=15)this.messageChannel.port1.postMessage(t);else{const e=new MessageChannel;e.port1.onmessage=this.handleBrokerMessage.bind(this),window.top?.postMessage(t,this.brokerMetadata.origin,[e.port2])}}))}async handleResponse(e,t){const r=Gw.validate(e);if(!r)return null;if(r.errorPayload)throw Gw.detectError(r.errorPayload);if(!r.result)throw zw.createBrokerResponseInvalidError();let n;if(await this.hydrateCache(r.result,t),t.authenticationScheme===W.POP){if(!t.popKid)throw zw.createShrGenerationError();const e=new sc(t);n=await e.signRequest(r.result.accessToken,t.popKid)}return{...r.result,accessToken:n||r.result.accessToken}}async handleLogoutMessageFromBroker(e){Ww.validate(e)&&(this.logger.verbose("Logout request received from broker and validated. Logging out embedded app."),await this.clearCache())}trackPageVisibility(){this.performanceEvent&&(this.logger.info("Embedded client: Visibility change detected"),this.performanceEvent.increment({visibilityChangeCount:1}))}}e.AccountEntity=Nr,e.ApiId=Bi,e.AuthError=Ie,e.AuthErrorCodes=ye,e.AuthErrorMessage=Te,e.AuthenticationHeaderParser=class{constructor(e){this.headers=e}getShrNonce(){const e=this.headers[h];if(e){const t=this.parseChallenges(e);if(t.nextnonce)return t.nextnonce;throw yr(lr)}const t=this.headers[d];if(t){const e=this.parseChallenges(t);if(e.nonce)return e.nonce;throw yr(lr)}throw yr(ur)}parseChallenges(e){const r=e.indexOf(" "),n=e.substr(r+1).split(","),o={};return n.forEach((e=>{const[r,n]=e.split("=");o[r]=unescape(n.replace(/['"]+/g,t.EMPTY_STRING))})),o}},e.AuthenticationScheme=W,e.AzureCloudInstance=Et,e.BrowserAuthError=di,e.BrowserAuthErrorCodes=si,e.BrowserAuthErrorMessage=li,e.BrowserCacheLocation=Ii,e.BrowserConfigurationAuthError=pa,e.BrowserConfigurationAuthErrorCodes=la,e.BrowserConfigurationAuthErrorMessage=ha,e.BrowserPerformanceClient=dc,e.BrowserPerformanceMeasurement=hc,e.BrowserStorage=es,e.BrowserUtils=Pa,e.CacheLookupPolicy=Gi,e.ClientAuthError=mt,e.ClientAuthErrorCodes=pt,e.ClientAuthErrorMessage=ft,e.ClientConfigurationError=vr,e.ClientConfigurationErrorCodes=gr,e.ClientConfigurationErrorMessage=mr,e.DEFAULT_IFRAME_TIMEOUT_MS=Oa,e.EventHandler=hs,e.EventMessageUtils=class{static getInteractionStatusFromEvent(t,r){switch(t.eventType){case ds.LOGIN_START:return Di.Login;case ds.SSO_SILENT_START:return Di.SsoSilent;case ds.ACQUIRE_TOKEN_START:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup)return Di.AcquireToken;break;case ds.HANDLE_REDIRECT_START:return Di.HandleRedirect;case ds.LOGOUT_START:return Di.Logout;case ds.SSO_SILENT_SUCCESS:case ds.SSO_SILENT_FAILURE:if(r&&r!==Di.SsoSilent)break;return Di.None;case ds.LOGOUT_END:if(r&&r!==Di.Logout)break;return Di.None;case ds.HANDLE_REDIRECT_END:if(r&&r!==Di.HandleRedirect)break;return Di.None;case ds.LOGIN_SUCCESS:case ds.LOGIN_FAILURE:case ds.ACQUIRE_TOKEN_SUCCESS:case ds.ACQUIRE_TOKEN_FAILURE:case ds.RESTORE_FROM_BFCACHE:if(t.interactionType===e.InteractionType.Redirect||t.interactionType===e.InteractionType.Popup){if(r&&r!==Di.Login&&r!==Di.AcquireToken)break;return Di.None}}return null}},e.EventType=ds,e.InteractionRequiredAuthError=Dn,e.InteractionRequiredAuthErrorCodes=Un,e.InteractionRequiredAuthErrorMessage=Hn,e.InteractionStatus=Di,e.JsonWebTokenTypes=fe,e.Logger=Tt,e.MemoryStorage=$a,e.NavigationClient=Ma,e.OIDC_DEFAULT_SCOPES=a,e.PairwiseBrokerApplication=class extends dw{constructor(e,t,r){super(e,r),this.pwbBrokerAppConfig=jw(t),this.temporaryBrokerStorage=nw(e),this.eventHandler=new hs(this.getLogger()),this.redirectResponse=new Map,this.initialized=!1}async initialize(e){await super.initialize(e),this.initialized=!0}async initializeBrokering(e,t){if("undefined"==typeof window)return;const r={...t,correlationId:t?.correlationId||Ra()},n=this.performanceClient.startMeasurement(gc.PairwiseBrokerApplicationInitializeBrokering,r.correlationId);n.add({isBackground:!1});try{this.pwbBrokerAppConfig.actAsBroker?(this.pwbBrokerAppConfig.allowBrokering&&this.getLogger().verbose("Running in top frame and both actAsBroker, allowBrokering flags set to true. actAsBroker takes precedence."),this.broker=new Xw(this.getConfiguration(),this.pwbBrokerAppConfig,this.eventHandler),this.getLogger().verbose("Acting as Broker"),this.getLogger().verbose("Initialize the extension for the new broker instance"),n.add({isBroker:!0}),await this.broker.initialize(r),await this.broker.listenForBrokerMessage(e,n),n.end({success:!0})):this.pwbBrokerAppConfig.allowBrokering&&(this.embeddedApp=new aE(this.getConfiguration().auth.clientId,r.correlationId,this.pwbBrokerAppConfig,this.getLogger(),this.performanceClient,this.temporaryBrokerStorage,this.hydrateCache.bind(this),this.clearCache.bind(this)),this.getLogger().verbose("Acting as child"),n.add({isBroker:!1}),await this.embeddedApp.initiateHandshake(n))}catch(e){throw n.end({success:!1},e),e}}async handleRedirectPromise(t){if(Sa(this.initialized),"undefined"!=typeof window){const r=t||"";let n=this.redirectResponse.get(r);if(void 0===n){this.eventHandler.emitEvent(ds.HANDLE_REDIRECT_START,e.InteractionType.Redirect);const o=this.getAllAccounts();n=this.handleRedirectPromiseInternal(t).then((t=>{if(!t)return null;const r=o.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(r?ds.LOGIN_SUCCESS:ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Redirect,t),t})).catch((t=>{throw this.eventHandler.emitEvent(o.length>0?ds.ACQUIRE_TOKEN_FAILURE:ds.LOGIN_FAILURE,e.InteractionType.Redirect,null,t),t})).finally((()=>{this.eventHandler.emitEvent(ds.HANDLE_REDIRECT_END,e.InteractionType.Redirect)})),this.redirectResponse.set(r,n)}return n}return null}async handleRedirectPromiseInternal(e){if(this.embeddedApp?.brokerConnectionEstablished){const e=ow(this.controller.getConfiguration().auth.clientId),t=this.temporaryBrokerStorage.getItem(e);if(t){const r=JSON.parse(t);return await this.embeddedApp.sendHandleRedirectRequest(r).catch((e=>{throw e instanceof Ie&&e.setCorrelationId(r.correlationId),e})).finally((()=>{this.temporaryBrokerStorage.removeItem(e)}))}return null}return this.broker?this.broker.handleRedirectPromise(e):super.handleRedirectPromise(e)}async loginRedirect(e){return this.acquireTokenRedirect(e||{scopes:a})}async acquireTokenRedirect(t){const r=0===this.getAllAccounts().length;return this.eventHandler.emitEvent(r?ds.LOGIN_START:ds.ACQUIRE_TOKEN_START,e.InteractionType.Redirect,t),super.acquireTokenRedirect(t).catch((t=>(this.eventHandler.emitEvent(r?ds.LOGIN_FAILURE:ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Redirect,null,t),Promise.reject(t))))}async loginPopup(e){return this.acquireTokenPopup(e||{scopes:a})}async acquireTokenPopup(t){ba(!0);const r={...t,correlationId:t.correlationId||Ra()},n=this.getAllAccounts();return this.eventHandler.emitEvent(0===n.length?ds.LOGIN_START:ds.ACQUIRE_TOKEN_START,e.InteractionType.Popup,r),this.acquireTokenPopupInternal(r).then((t=>{const r=n.length<this.getAllAccounts().length;return this.eventHandler.emitEvent(r?ds.LOGIN_SUCCESS:ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Popup,t),t})).catch((t=>{t instanceof Ie&&t.setCorrelationId(r.correlationId);const o=0===n.length;return this.eventHandler.emitEvent(o?ds.LOGIN_FAILURE:ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Popup,null,t),Promise.reject(t)}))}async acquireTokenPopupInternal(e){if(this.embeddedApp?.brokerConnectionEstablished){if(this.getLogger().verbose("pairwise broker (embedded app) acquireTokenPopup called",e.correlationId),!this.embeddedApp)throw zw.createNoEmbeddedAppError();const t=ow(this.controller.getConfiguration().auth.clientId);return this.temporaryBrokerStorage.setItem(t,JSON.stringify(e)),this.embeddedApp.sendPopupRequest(e).then((e=>(this.temporaryBrokerStorage.removeItem(t),e)))}return super.acquireTokenPopup(e)}async ssoSilent(t){ba(!0);const r={...t,correlationId:t.correlationId||Ra()};return this.eventHandler.emitEvent(ds.SSO_SILENT_START,e.InteractionType.Silent,r),this.ssoSilentInternal(r).then((t=>(this.eventHandler.emitEvent(ds.SSO_SILENT_SUCCESS,e.InteractionType.Silent,t),t))).catch((t=>{throw t instanceof Ie&&t.setCorrelationId(r.correlationId),this.eventHandler.emitEvent(ds.SSO_SILENT_FAILURE,e.InteractionType.Silent,null,t),t}))}async ssoSilentInternal(e){return this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished?(this.getLogger().verbose("ssoSilent called",e.correlationId),this.embeddedApp.sendSsoSilentRequest(e)):super.ssoSilent(e)}async acquireTokenSilent(t){ba(!0);const r={...t,correlationId:t.correlationId||Ra()};return this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_START,e.InteractionType.Silent,r),this.acquireTokenSilentInternal(r).then((t=>(this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_SUCCESS,e.InteractionType.Silent,t),t))).catch((t=>(t instanceof Ie&&t.setCorrelationId(r.correlationId),this.eventHandler.emitEvent(ds.ACQUIRE_TOKEN_FAILURE,e.InteractionType.Silent,null,t),Promise.reject(t))))}async acquireTokenSilentInternal(e){if(!this.embeddedApp?.brokerConnectionEstablished)return super.acquireTokenSilent(e);this.getLogger().verbose("acquireTokenSilent - attempting to acquire token from web flow");const t={...e,cacheLookupPolicy:Gi.AccessToken};let r;return r=e.cacheLookupPolicy===Gi.RefreshToken||e.cacheLookupPolicy===Gi.RefreshTokenAndNetwork||e.cacheLookupPolicy===Gi.Skip||e.forceRefresh?Promise.reject(new mt(tt)):super.acquireTokenSilent(t),r.catch((async t=>{if(e.cacheLookupPolicy===Gi.AccessToken)throw t;if(!this.embeddedApp)throw zw.createNoEmbeddedAppError();return this.embeddedApp.sendSilentRefreshRequest(e)}))}async logoutRedirect(e){if(this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished)this.getLogger().error("Embedded app is not allowed to logout while the broker app is logged in.");else if(this.broker)return await this.broker.sendLogoutRequestToEmbeddedApps(),super.logoutRedirect(e)}async logoutPopup(e){if(this.embeddedApp&&this.embeddedApp.brokerConnectionEstablished)this.getLogger().error("Embedded app is not allowed to logout while the broker app is logged in.");else if(this.broker)return await this.broker.sendLogoutRequestToEmbeddedApps(),super.logoutPopup(e)}setActiveAccount(e){this.broker&&this.broker.setActiveAccount(e),super.setActiveAccount(e)}addEventCallback(e,t=Object.values(ds)){const r=[ds.ACQUIRE_TOKEN_START,ds.ACQUIRE_TOKEN_SUCCESS,ds.ACQUIRE_TOKEN_FAILURE,ds.LOGIN_START,ds.LOGIN_SUCCESS,ds.LOGIN_FAILURE,ds.SSO_SILENT_START,ds.SSO_SILENT_SUCCESS,ds.SSO_SILENT_FAILURE,ds.HANDLE_REDIRECT_START,ds.HANDLE_REDIRECT_END],n=[],o=[];t.forEach((e=>{r.includes(e)?n.push(e):o.push(e)}));const i=super.addEventCallback(e,o);return i?(this.eventHandler.addEventCallback(e,n,i),i):null}removeEventCallback(e){super.removeEventCallback(e),this.eventHandler.removeEventCallback(e)}},e.PerformanceEvents=fn,e.PromptValue=A,e.ProtocolMode=Mr,e.PublicClientApplication=dw,e.PublicClientNext=ic,e.ServerError=rn,e.ServerResponseType=R,e.SignedHttpRequest=sc,e.StringUtils=Cr,e.StubPerformanceClient=lo,e.UrlString=Ur,e.WrapperSKU={React:"@azure/msal-react",Angular:"@azure/msal-angular"},e.createNestablePublicClientApplication=async function(e){const t=new ja(e);if(await t.initialize(),t.isAvailable()){const r=new Zs(t);return new tc(e,r)}return rc(e)},e.createStandardPublicClientApplication=rc,e.stubbedPublicClientApplication=ac,e.version=Vw})),function(e){function t(){return"true"===e.sessionStorage.getItem("MsalJsV3")}let r;function n(e,t,r){s({source:e,action:"MfaClaimsAdded",data:{reason:t,requestedTenant:r}})}async function o(t){const r=(t.requestHeaders||[]).concat([["Content-Type",t.contentType],["Authorization",t.authHeader],["x-ms-client-session-id",e.sessionStorage.getItem("Redirect_SessionId")]]),n=await fetch(t.uri,{method:t.httpMethod||"GET",headers:r,body:t.data}),o=await n.json(),i=n.headers;if(!n.ok)throw new Error(JSON.stringify({message:"RequestError",responseHeaders:i,responseText:o,status:n.status,statusText:n.statusText,uri:t.uri}));return{value:o,headers:i}}function i(e){let t;if(e)try{t=JSON.parse(e)}catch{}return t}e.useMsalJsV3InCurrentSession=t,function(e){const r=window.msalv2,n=window.msalv3;e.getPortalPCAppWrapper=(e,o,i,a)=>(o.endsWith("/")||(o+="/"),t()?new n.PairwiseBrokerApplication({auth:{clientId:e,authority:`${o}${i}`},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1},system:{allowNativeBroker:a}},{actAsBroker:!0,preferredInteractionType:n.InteractionType.Redirect},{disabled:!0}):new r.ExperimentalPublicClientApplication({auth:{clientId:e,authority:`${o}${i}`},cache:{cacheLocation:"sessionStorage",storeAuthStateInCookie:!1}},{brokerOptions:{actAsBroker:!0,preferredInteractionType:r.InteractionType.Redirect}})),e.loginRedirect=async(e,t)=>await e.portalPcApp.loginRedirect({redirectUri:`${window.location.origin}/auth/login/`,redirectStartPage:`${window.location.origin}/auth/login/`,scopes:[`${e.armAadResource}/.default`],...t}),e.handleRedirectPromise=async e=>await e.handleRedirectPromise(),e.acquireTokenSilent=async e=>{const{account:t,authority:r,forceRefresh:n,portalPcApp:o,scopes:i,cacheLookupPolicy:a}=e;return await o.acquireTokenSilent({account:t,authority:r,forceRefresh:n,scopes:i,cacheLookupPolicy:a})},e.initialize=async e=>await e.initialize()}(r=e.MsalWrappers||(e.MsalWrappers={})),e.request=o,e.parseJsonOrDefault=i;const a=i(e.sessionStorage.getItem("SavedLogs"))||[];function s(t){const{source:r,action:n,actionModifier:o,duration:i}=t,s=t.data||{};a.push({timestamp:Date.now(),source:r,action:n,actionModifier:o,duration:i,data:{...s,sessionId:e.sessionStorage.getItem("Redirect_SessionId")}});try{e.sessionStorage.setItem("SavedLogs",JSON.stringify(a))}catch{}}let c;function u(t){const{lookupPreservedOptionAcrossRedirect:r,portalServerMsalJsConfig:o,requestedTenant:a,source:s,userQueryStringInUrl:c}=t;let u,l,d;if(r&&(u=i(e.sessionStorage.getItem("MsalJsLoginParams")),u))return"organizations"===a?(delete u.extraQueryParameters?.acr_values,u):u;if("true"===e.extractValueFromQueryString(c,"selectAccount")?.toLowerCase())l="select_account";else{const t=e.extractValueFromQueryString(c,"loginHint".toLowerCase());t&&(d=decodeURIComponent(t))}const h=i(decodeURIComponent(e.extractValueFromQueryString(c,"signInParameters")));u={prompt:l,loginHint:d,extraQueryParameters:{site_id:o.site_id,...h}},o.cobrandid&&(u.extraQueryParameters.cobrandid=o.cobrandid),o.msafed&&(u.extraQueryParameters.msafed=o.msafed);const p=e.extractValueFromQueryString(c,"whr");p&&(u.extraQueryParameters.whr=p);let g=!1;return"true"===e.extractValueFromQueryString(c,"mfalogin")?.toLowerCase()&&a&&("organizations"===a?g=!0:(n(s,"MfaLoginPresentInQueryString",a),u.extraQueryParameters.acr_values="urn:microsoft:policies:mfa")),e.sessionStorage.setItem("MsalJsLoginParams",JSON.stringify({extraQueryParameters:{...u.extraQueryParameters,acr_values:g?"urn:microsoft:policies:mfa":void 0}})),u}e.saveLog=s,e.fetchCrossTenantSettings=async function(e){try{const t=`${location.protocol}//${location.host}`;c||(c=await o({uri:`${t}/api/Settings/Select`,httpMethod:"POST",authHeader:e.armAccessToken,contentType:"application/json",data:JSON.stringify(["CrossTenant"])}))}catch(t){e.onError(t.message||t.toString())}return c},e.buildMsaljsLoginRedirectParams=u,e.loginUsingMsalJs=async function(o){const{isNativeBrokerEnabled:a,loginStage:c,portalOptions:l,portalServerMsalJsConfig:d,source:h,userQueryStringInUrl:p}=o,g=l.portalRequestedTenantInfo.id,f=r.getPortalPCAppWrapper(l.portalClientId,l.authority,g,a);let m;const v={portalServerMsalJsConfig:d,requestedTenant:g,source:h,userQueryStringInUrl:p};switch(c.type){case"Startup":s({source:h,action:"Startup",data:{requestedTenant:g}}),m=u(v);break;case"HandleLoginRedirect":s({source:h,action:"HandleLoginRedirect",data:{requestedTenant:g}}),m=u({...v,lookupPreservedOptionAcrossRedirect:!0});break;case"MfaEnforcedSignIn":s({source:h,action:"MfaEnforcedSignIn",data:{requestedTenant:g}}),m=u({...v,lookupPreservedOptionAcrossRedirect:!0}),n(h,"MfaEnforcedSignInBeforeClientLoad",g),m.extraQueryParameters={...m.extraQueryParameters,acr_values:"urn:microsoft:policies:mfa"};break;case"SignInToDefault":{const t=c.signInToDefaultStageData;m={...i(e.sessionStorage.getItem("MsalJsLoginParams"))||{},loginHint:t.loginHint};break}}s({source:h,action:"MsalJsLoginInitiated",data:{tenant:g,loginStage:c.type}}),(t()||a)&&await r.initialize(f);const y=await r.handleRedirectPromise(f);if(!y||m.extraQueryParameters?.acr_values){"organizations"!==g&&e.sessionStorage.setItem("PortalRequestedTenant",JSON.stringify(l.portalRequestedTenantInfo));const t={};return l.forceSignInQueryStringValue&&(t.forcesignin=l.forceSignInQueryStringValue.toLowerCase()),a&&(t.nativebroker=a+""),e.sessionStorage.setItem("PreservedPortalQueryStrings",JSON.stringify(t)),s({source:h,action:"RedirectingToIdp",data:{tenant:g,loginStage:c.type}}),await r.loginRedirect({portalPcApp:f,armAadResource:l.armAadResource},m)}return s({source:h,action:"MsalJsLoginComplete",data:{tenant:g,loginStage:c.type,isNonEmptyAuthenticationResult:!!y}}),{portalPcApp:f,authenticationResult:y}}}(MsPortalImpl||(MsPortalImpl={})),function(e){e.getTokenExpirationInMs=function(e,t){const r=e.getTime()-Date.now(),n=r-t;return Math.floor(n<0?r:n)};e.AadIdentity=class{constructor(t){this._idTokenClaims=t,this.tenantRegionScope=t.tenant_region_scope,this.xmsWsit=t.xms_wsit,this.sid=t.sid,this.tid=t.tid,this.ctry=t.ctry,this.givenName=t.given_name,this.familyName=t.family_name,this.oid=t.oid,this.aai=t.aai,this.xmsEt=t.xms_et,this.gitHubUserId=null,t.prov_data?.length&&(this.gitHubUserId=t.prov_data.map((e=>{const t=e,r=e;return{prov:t.Prov||r.prov,altsecid:t.Altsecid||r.altsecid,at:t.At||r.at}})).find((e=>"github.com"===e.prov.toLowerCase()))?.altsecid??null),e.saveLog({source:"AadIdentity",action:"xms_et",data:{xms_et:this.xmsEt}})}tryGetPuid(){const e=this._idTokenClaims,t=e.idp,r=e.iss;let n=!1,o=!1,i="";if(t&&t!==r){const t=e.altsecid||"";if(t){const e=t.toLowerCase();if(e.startsWith("1:live.com:"))i=t.substring(11),n=!1,o=!0;else{if(!e.startsWith("5::"))throw e.startsWith("6:")?new Error(`The logged in user's claim includes an AAD intermediate Alternative Security ID claim (altSecId). The claim value was: ${t}`):new Error(`The logged in user's claim includes an Alternative Security Id claim (altsecid), but does not start with the expected prefixes '1:live.com:' or '5::'. The claim value was: ${t}`);i=t.substring(3),n=!0,o=!0}}}else o=!1,i=e.puid,n=!!i;return{puid:i,isOrgId:n,isForeignPrincipalObject:o}}getEmailAddress(e){const t=this._idTokenClaims,r=t.upn||"",n=t.email||"";return e?r||n:n||r}getFirstName(e){return this._idTokenClaims.given_name||this.getEmailAddress(e)}getIsMfa(t){const r=(this._idTokenClaims.acrs||[]).includes("p1"),n=(this._idTokenClaims.amr||[]).includes("mfa"),o=function(t){try{const e=t.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(window.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(r).amr.includes("mfa")}catch(t){e.saveLog({source:"AadIdentity",action:"errorParsingAccessToken",data:{exception:t}})}return!1}(t);return e.saveLog({source:"AadIdentity",action:"GetIsMfa",data:{idTokenAcrsP1:r,legacyIdTokenMfaIndicators:n,accessTokenMfaIndicator:o}}),r||n||o}getIsTenantAdmin(e){return!!e&&(this._idTokenClaims.wids||[]).some((t=>t===e))}getPreferredUsername(e){const t=this._idTokenClaims;return e?this.getEmailAddress(e):t.preferred_username||""}getRawName(){const e=this._idTokenClaims;return e.unique_name||e.preferred_username||""}}}(MsPortalImpl||(MsPortalImpl={})),function(e){let t=window,r=t.document,n=t.location,o=r.body;function i(e){return(e||"")+""}e.stringify=i;let a=i(navigator&&navigator.userAgent);function s(e,t){return e.includes(t)}const c=JSON.stringify,u=encodeURIComponent;e.cobrand=function(){};const l="Redirect_SomeRandomKey";function d(e){const t=s(a,"Windows");if((s(a,"Macintosh; Intel")||t)&&s(a,"Safari")&&!s(a,"Chrome")&&function(e){if(s(a,e)){const t=new RegExp(`\\s${e}/(\\d+)[\\.\\s$]`).exec(a),r=i(t&&t[1]);return parseInt(r,10)}}("Version")<=11)return e+"?reason=isSafari";const n=!!r.documentMode,o=/Trident\//i.test(a),c=s(a,"MSIE"),u=!Array.prototype.find;return n||o||c||u?e+"?reason=isIE":Promise&&Promise.prototype.finally&&Promise.allSettled&&Promise.any?"":e+"?reason=promise"}function h(e){return p("clearedStorage=true",`${e}/Html5StorageExceeded`,!0)}function p(t,r,o){return n.search.includes(t)?r:(o&&(e.localStorage.clear(),e.sessionStorage.clear()),(n.search&&n.search+"&"||"?")+t+n.hash)}function g(e,t){if(void 0!==e)return e;if(t&&t.startsWith("flight:")){const e=parseFloat(t.split(":")[1]);return Math.random()<e?"true":"false"}return t}e.redirect=async function(a){const s=a.portalServerConfig,f=a.portalServerFeatures,m=s.errorUri;if("true"===e.localStorage.getItem("MsalJsV3")?e.sessionStorage.setItem("MsalJsV3","true"):e.sessionStorage.removeItem("MsalJsV3"),"aad.portal.azure.com"===n.hostname.toLowerCase()&&["","#","#home"].includes(n.hash.toLowerCase()))return void(n.href=`https://entra.microsoft.com${n.pathname||""}${n.search||""}#view/Microsoft_AAD_IAM/TenantOverview.ReactView`);let v;try{const u=function(t){let r;try{[e.localStorage,e.sessionStorage].forEach((e=>{if(r=e.length,e.setItem(l,l),l!==e.getItem(l))throw l;e.removeItem(l)}))}catch(e){return 22===e.code&&r?h(t):p("storagepolyfill=true",`${t}/UE_NoHtml5Storage`)}}(m),y=s.portalQuery,C=s.applicationPath,T=s.supportedLanguages,I=e.parseQuery(t.location.search),w=[...I],E=s.unsupportedUri,k=(t,r)=>g(e.extractValueFromQueryString(w,"feature."+t),r),S=t=>e.getFirstQueryValue(w,t,!0);if(v=d(E)||function(e){return t.Intl?"":e+"?reason=intl"}(E)||u,!v){const u=e.sessionStorage,l=e.localStorage;l.removeItem("signOutAll");const d=S("Referrer");y.env=e.getPortalEnv(),"true"===S("feature.armbreakglass")&&u.setItem("Redirect_ArmBreakGlass","true");const h=S("sessionId"),p=FxImpl.createGuid(h,!0);u.setItem("Redirect_SessionId",p),e.trySaveAllowedState(s.environment,w,!0,y),e.savePageTelemetry("EntryPoint"),u.setItem("Redirect_Referrers",c([i(r.referrer),i(d)]));const E=`${n.protocol}//${n.host}${C}`,b=function(t,r){const n=[];return Object.keys(r).forEach((o=>{const i="feature."+o,a=g(e.extractValueFromQueryString(t,i),r[o]);a&&n.push(`${i}=${a}`)})),n.join("&")}(w,{settingsportalinstance:f.settingsPortalInstanceValue,inmemorysettings:f.inMemorySettingsValue,argsubscriptions:f.argSubscriptionsValue,showservicehealthalerts:f.showServiceHealthAlertsValue,prefetchtokens:f.prefetchTokensValue,internalgraphapiversion:f.internalGraphApiVersionValue,cae:f.caeValue,selftoken:f.selfTokenValue,globalresourcefilter:f.globalResourceFilterValue,msaljs:f.msalJsValue,fetchpolicyforrestypes:f.fetchPolicyForResTypesValue,testcrosscloudpuid:f.testCrossCloudPuidValue,useredirecthint:f.useRedirectHintValue,usetenanthint:f.useTenantHintValue,nativebroker:f.nativeBrokerValue,msaljswithfallback:f.msalJsWithFallbackValue});let A=e.getTenantFromPath(n.pathname,!0);const _=l.getItem("preferredPortalUri"),R=parseInt(function(e,t){const r=e.getItem(t);return e.removeItem(t),r}(u,"Redirect_PreferredPortalRedirectCount"))||0,P=k("useredirecthint",f.useRedirectHintValue),M=k("msaljs",f.msalJsValue);if(!A&&function(t){const r=e.sessionStorage.getItem("authState");if(r){try{const n=JSON.parse(r),o=n?.oAuthToken;let i=0;o?.authHeader&&(i=o.expiresAt);let a=o&&i>=Date.now();const s=n?.selfOAuthToken;if(s?.authHeader&&(a=a&&(s.expiresAt||0)>=Date.now()),a=t?a&&!!n.isInitializedUsingSpaAuthCode:a&&!!n.refreshToken,a)return e.localStorage.removeItem("authState"),!0}catch(e){}e.sessionStorage.removeItem("authState")}return!1}("true"===M))v=e.getPortalUri(E,T);else if("true"===P&&_&&_!==n.hostname&&!(w||[]).length&&!A&&R<3)u.setItem("Redirect_PreferredPortalRedirectCount",R+1+""),v=e.getPortalUri(_,T,{portalQuery:s.portalQuery});else{let r=parseInt(u.getItem("Redirect_IdpRedirectCount"))||0;A=/^#@([^/]*)|$/.exec(/#.*|$/.exec(t.location.href)[0])[1]||A;const c=k("usetenanthint",f.useTenantHintValue);let d="";const h=l.getItem("tenantHint");if("true"===c&&h&&(d=`&tenantHint=${h}`,l.removeItem("tenantHint"),u.setItem("usedTenantHint",h)),"true"===e.localStorage.getItem("MsalJsLoginEnabled"))try{let t=A.startsWith("@")?A.substring(1):A;t=t||"organizations";const r={armAadResource:s.armAadResource,authority:s.authority,forceSignInQueryStringValue:e.extractValueFromQueryString(I,"forcesignin")||"",portalClientId:s.portalClientId,portalRequestedTenantInfo:{id:t,domainName:"",displayName:""}};await e.loginUsingMsalJs({isNativeBrokerEnabled:e.useMsalJsV3InCurrentSession()&&"true"===k("nativebroker",f.nativeBrokerValue),portalOptions:r,portalServerMsalJsConfig:a.portalServerMsalJsConfig,source:"Startup",userQueryStringInUrl:I,loginStage:{type:"Startup"}})}catch(t){e.saveLog({source:"Startup",action:"FallbackToLegacySignIn",data:{errorMessage:t.message+(t.stack||"")||t.toString()}}),e.sessionStorage.removeItem("PortalRequestedTenant")}const g=t.document.createElement("script"),v=e.localStorage.getItem("SavedDefaultDirectory"),y=v?`&savedDefaultDirectory=${v}`:"",C=["signInParameters","loginHint","selectAccount","forcesignin","whr","slice","mfalogin"].reduce(((t,r)=>{const n=e.extractValueFromQueryString(I,r);return n&&(t+=`&${r}=${n}`),t}),"");g.src=`${s.signinUri}${A}?sessionId=${p}&${b}&idpc=${r}${d}${y}${C}`,o.appendChild(g),setTimeout((()=>{u.setItem("Redirect_IdpRedirectCount",i(++r)),r%3?n.reload():n.href=m+"/UE_IDP"}),6e4);const w=e.getPortalUri(E,T),S=new XMLHttpRequest;S.open("GET",w),S.send(null)}}}catch(e){if(22===(e=e||{}).code)v=h(m);else{let t=u(i(e));const r=e.message;r&&(t=u(r)+"&stack="+u(e.stack)),v=m+"/Unhandled?err="+t}}v&&(n.href=v)}}(MsPortalImpl||(MsPortalImpl={})); MsPortalImpl.redirect({"portalServerFeatures":{"settingsPortalInstanceValue":"mpac","argSubscriptionsValue":"true","showServiceHealthAlertsValue":"true","inMemorySettingsValue":"","prefetchTokensValue":"","internalGraphApiVersionValue":"true","caeValue":"","selfTokenValue":"true","globalResourceFilterValue":"true","msalJsValue":"true","fetchPolicyForResTypesValue":"true","testCrossCloudPuidValue":"true","useRedirectHintValue":"true","useTenantHintValue":"true","nativeBrokerValue":"","msalJsWithFallbackValue":""},"portalServerConfig":{"portalQuery":{"configHash":"K-62v6X10MMa","pageVersion":"14.272.0.19269666.241118-1951"},"environment":{"extensionsManifestHash":{"assetTypes":[["o89V6zi6YZp5","p-V2wfBf1GhD"],["bUKgn1jbYgfa","lyA4O2FSwZUg"],["grJJ3k5nr-pK","n40M4DFsnOgQ"],["VnEFIsffZJUz","D1wJc1xkipYb"],["DTMbTeLLMVd6","Apn2kZWS1UWK"],["uQmSoudaOEyi","AYMajiJnJyg4"],["4JzO90pG5hgr","efsAZZnpsZXe"],["8RbUnti-DrVh","CdzcuNws6KVY"],["J59VSKXylCjD","Yi8x4PKiQRbU"],["X-q8m6evP4GS","W7qxBPiOBCcr"],["61zwCpspl-N1","lbrA9rl5gLuv"],["SA_d-yJPSEWW","3VGMJtLGUO2M"],["zbYh9tcf2QnF","Pf1f6ToidgcG"],["BAwiZWp_NKkU","5iEdJKGJMu_x"],["nYecMkqgAE8P","vcjxS_bOv97s"],["D0NHEOkmF2Bs","i12Vkp5K82pQ"],["-OpAqJGWXk8B","xOYJP1rbaptK"],["9B9BHdnzzAbR","oacxd2ustARS"],["C_HfJ4akioi0","BvIcDk09BUMH"],["Pl9Ls3vmUlgc","GXb30Ne5oDzn"]],"assetTypesBrowse":[["EE2nRmh-anhE","_-aHN48ukK-2"],["sGcUThi45VRw","_UmO3mlupMKW"],["itXsDcJl0UZB","S1F3LWMphSuZ"],["tCdJ8Nj0YxR6","_h6pnAj9affL"],["w9tBPCKBt56I","Im1bx2A4bbjM"],["lIPzQMNB_i7h","UA-ZsF7bG5Ri"],["1apvEIeAAY1r","UY0xM4ljrxdQ"],["5CVVB4H0ycOB","sII5tAUcv9aA"],["9RDEoDvlAq-O","lqXVcvALkjZX"],["fiyEHFSKNted","IloJ0BEt5A4y"],["K11zaN1yyqo2","SqkpNnoizNSN"],["09SLlHfNg_ix","lIWEHFOtGuuz"],["eTETB9bu2FCC","FkS3i9W8ylKn"],["duB9MYqNXwuV","xOxx5WnQiOMC"],["tZmS-0mRZ_1Z","KwWnMZq5owHI"],["9KSTQqImuRV4","q6V4kcUMYxjW"],["xmo7i6j3CnVR","Rkg1I82a8ZrJ"],["q5HiUuD7BWJ4","wgl_DsTVVyPw"],["BzrRME6wtnAP","roIZBriqJ0dK"],["8YpIVuhGNRe8","TDhLOLUEtSGw"]],"assetTypesMenu":[["ke3onVEbrhz2","lLdwL3NGUoXf"],["fHsOa8jvCEqh","_W2Nz_BTTlmu"],["R1djZTFGRJ9l","uu9TkHeTJMpq"],["FG7mMh64ob8h","w-mwhkNDQfeE"],["FPUmtITsOaJ0","hsQx1l8_k61i"],["7UzNzTPmBU7Z","mTWm0K_2vvZ2"],["7FgnWYsp0RT4","MMQS1fkh6Aiy"],["EB3a0c3TR-hs","dJiijY6m6J_a"],["yLt8ADOnq1C3","8alN2zZaut5_"],["3Es9as2m8iiJ","d9DQn0xRdvkA"],["1D_f7LmowQ0z","zFpvose0D2dO"],["-j4RVsHez9uB","YH_XiuE7m9wF"],["pbyDgvBFX7g8","m1OWvVjgZczf"],["uoF8v_9B2WnD","yt_qOpu7VgZy"],["nAa2poMHeW0n","foBhpV-BdcFv"],["npzWUtbEn-MO","y2KT7lnxnp00"],["2kCYbSoL-Y6c","OuI-WO1qwzix"],["IMmTD2OtcTFJ","denPZpXBJatD"],["kGzSPncU9ngU","3I9HvpXuTob7"],["yBaQyo6xpHag","EqmsEKn1x_6w"]],"copilot":[["Maly_uz46IY1","3Nj3KqSgUnBO"],["HUxBaH3EiWwE","D31MJbU4dFl0"],["GWW5hnjJq_Tb","hdxoK4dRrCwU"],["NUUlb-DW-xP1","_u1G8248Y-0X"],["xXa9tctrRjW3","-26a9CiKfCZX"],["j3M2e-EKz3ET","3Tbx3bfHRQXp"],["BbSWQS2VhI2B","8bzAviBv0jKY"],["l9msTcMyToNO","PPHKlNJqBP_6"],["7SO7HGnAW-ua","ncKJb6HGlO5o"],["2nBYMlZ6Pt9J","v09VSXprrkzn"],["Db55U9h3vK64","A6bsc2KY3hh0"],["ZFYBh_OoiTFi","V6UteaO_9igz"],["L1YuY10-nW1Z","D72DLQkNBGIm"],["G9QuwlO7M4Nw","H-poq2oc3Mrl"],["6PMGz1_i1vGf","gE7ZP3jGkoyg"],["U8gvJvSKoQ4t","cEwXlatFhM3O"],["8H-22KAvmyFe","i5rY15uyV2FC"],["Z59zyNtBPirx","KBmgNzU7ZcFq"],["Z4GMAULBscZh","Be6lrCDMjAih"],["Maly_uz46IY1","3Nj3KqSgUnBO"]],"extensionConfiguration":[["Od2WYcIsOlsg","sWLexKrI-RwM"],["7czTdEw8xTLm","nYLUt_0vSQqy"],["q5WLtHfbCQzr","nVBIvYnrhTw3"],["gDEM3_xqjatC","2s6z02SD_pat"],["qB-ATNAYrSug","3zoBOt23-H5D"],["L6hMmpXzUwXw","tJP-mec3-J4r"],["9neWEqH8i0dR","F65r5jl-Qi93"],["uopwpGd2CEuB","ivOPnRRZiW9A"],["t1EP_0bJe5MP","5OqxI6JXKYaX"],["EPPIa0RWIimY","HwlrX5rrvirT"],["4IVmGZC5BQ1n","VvwSu_TdcNMc"],["nhm1AAm0cdgt","k8P9irnaBrjq"],["rhGh8gDSf2Nz","G7M-GcrPSIUA"],["xA-phkhhGO_8","63voxihe2RIf"],["0S7mqbGH0IyZ","A2skFDrpImrq"],["bXzmRkSY5ive","7mc728qF1152"],["SJ-lM1QdEeWm","zh85bFicfyNz"],["njwhHR8j_TNY","eS1J1m4ATEE8"],["cXqcx9rf_qC1","J06Zoa70fpFJ"],["Od2WYcIsOlsg","sWLexKrI-RwM"]],"featureCards":[["7245P3BWh2OA","j1x3eGxGCt5a"],["NcDrYh71WTXL","1Xlt4E1mCGeK"],["eJxmQ4ZJU5sd","ndESIzhXo632"],["NQS8DRhTZEqO","IiLQjyMTelu1"],["Z-zi5v4RWzA3","35r4jsmKySMn"],["_tGLl_1K8_D3","ya4V48WHxbLa"],["ywX8nKI4zJ6U","XQqHGfSPA07D"],["uGbQ1dOGvEIc","5JzUhMYHOjcz"],["92wWmAx1EjdN","eBDmBmSdbdW2"],["NcpKLEcERzBR","7uGUehQkdTz3"],["MpQDdOFb7ZSk","UDv20lqjj3tz"],["35ci133w0DEI","iGK_Y05LPbfq"],["P1pnhPLpVqMn","dtsbR7YK1utl"],["od-el4IjiRVs","dHTJRJq1MmGY"],["MFVuDa7vTcO5","PDw4VM6Mzue6"],["WCJUbDgH_b6B","aSk-_M_XPRBT"],["5kF92E-LutAJ","9gFoA_gcaF1n"],["0i0EVHF6Mgya","JwaHOyaR4aN7"],["_vnCDZXzQUks","OWT-5AKySCnf"],["JXUUvmUuRiNH","tL_qeU5TRTX0"]],"galleryParts":[["Rk2apJHP8xm3","ataixAIAoJfg"],["trH1dh7fs5Pk","QpPl1na74xB1"],["wot7kt4JeUp8","y17HkDYn5Rkw"],["Chf2fAnjdrGk","Nl1gSaYxukYN"],["OSIIWU1anmvV","zHa5wHvrTx6X"],["pt8KOOQ_1S58","fFalN6XRpWF0"],["xlZ5jlfxp1B1","Bja9HL75sPtg"],["87ozk8FoX_md","oNV9vVyuu2VX"],["yBM0zK3dW8HS","DTj9TX4rxTT0"],["ECouCmFVLN9e","rc0bimcm2evs"],["A4S_OyYeAfFD","ABJyQmMU3N9v"],["Q5OVCqd--ZwY","SW7haoSKHFyr"],["EQ69DPcPfqP5","ZpnvCGKXB-ca"],["sg9IIGB1jS4z","IIc_BkaiOS46"],["Ful4QG-uGoq-","40KMoJ0as7M9"],["C9w5MHG2gVE2","zXgKaP1AveAm"],["PxhEemhMv7QJ","pE1VgEdFOoLP"],["gkFbKu2yGV7b","5ig1DgGfuWpQ"],["DEYnxey57ohj","YQIs0rKjVv14"],["8fIMn7I_oB6V","kwsXr4pi4yKU"]],"surveys":[["0oJQr1c2S4I4"],["QtbO9K0MCaTp"],["DMIZGGTjgUo9"],["kWdkacopOevP"],["B3c5a-BIIouP"],["bHkZV8uwQj0W"],["noUCWqqiyaJS"],["TOokQM1h0WTn"],["z_esqJs9m6mI"],["KjHJmvCsp-Sa"],["CQQj1ZspVijP"],["yu-Kt5kgYcUv"],["MpdGNqCNKnbZ"],["TknUY3sG6erD"],["r9xK_lvkJWC0"],["Cvc-wNZzP1Ko"],["oqwg1BxcCUAt"],["-dvSiuMS3sam"],["JCmIbc8BYYRP"],["dWCzHYfp5oxp"]],"tourGuide":[["HVkLJXjFUNoP"],["ffgjA68rNVrf"],["bDTMNHS2-NZi"],["5VYw1KDRTC-R"],["9qhDDboQIZhQ"],["0Jlh1GDbrOJn"],["DBM64WHbOgQa"],["QVjbUWyaAqCJ"],["QRb9MuLGaASZ"],["aKuKePrS9j0n"],["lGGKyxhGgD3V"],["an9uzLYWMW48"],["nlqG8gmdpnIz"],["PfWqOQn-Raup"],["QEIo0EoWPMr1"],["m-noJO9y7U6u"],["olZtc5CViyyP"],["mcFHoHyqOzrA"],["0Q8CuCZKYggS"],["HVkLJXjFUNoP"]],"uiDefinition":[["GVKgn-67P1Zc"],["d1FV6VJY9bl2"],["6qE0KSY15WPr"],["ZsJ5LLQZ1Wo-"],["GklJVejVGOa3"],["1ZmFZvxYWik3"],["hPM5Z8qm-yzl"],["OqSMqi1QTJs0"],["1uz84tgJqt9E"],["oai41YMhkEr0"],["D-wB53g9Yr3d"],["cwYuL6-0rzI2"],["z_R28P0rhqsV"],["xEyR8CK5QOvY"],["9loIUfkZWAuB"],["0AhKbe6W0N2H"],["aD8H61_3zCXO"],["cgUNdwD2oAFS"],["xvJ2BfMFXASj"],["GVKgn-67P1Zc"]]},"extensionsPageVersion":{"AppInsightsExtension":["1.0.20241108.0025"],"AppPlatformExtension":["1.0.02867.308"],"AzureCacheExtension":["1.3.02875.422"],"AzureTfsExtension":["19.247.35422.10"],"Azure_Marketplace_Astronomer":["0.9.028731-484067"],"Azure_Marketplace_Confluent":["0.9.0287814-460370"],"Azure_Marketplace_Datadog":["2.2101.028732-8148805"],"Azure_Marketplace_Dell":["0.9.028251-109367"],"Azure_Marketplace_Dynatrace":["0.9.028731-80154"],"Azure_Marketplace_Elastic":["0.1.028752-867720"],"Azure_Marketplace_Informatica":["0.9.028801-5467"],"Azure_Marketplace_Liftr_Logz":["0.9.028681-288"],"Azure_Marketplace_Liftr_NewRelic":["0.9.028671-74442"],"Azure_MarketPlace_NativeISVService":["0.9.0287826-94422"],"Azure_Marketplace_Neon":["0.9.028581-742"],"Azure_Marketplace_NGINX":["2.2101.028681-150416"],"Azure_Marketplace_PaloAltoNetworks_Cloudngfw":["1.0.0.241114-0806"],"Azure_Marketplace_PureStorage":["0.9.028851-4243"],"Azure_Marketplace_Qumulo":["0.1.028732-427870"],"Azure_Marketplace_SamplePartner":["0.9.026611-97"],"Azure_Marketplace_SolarWindsObservability":["0.9.028741-97813"],"Azure_Marketplace_SplitIO":["1.0.028671-84714"],"DxExtension":["13.315.0.1644.240429-0537"],"HubsExtension":["14.272.0.19269666.241118-1951/i3qonfAbIsOX"],"Microsoft_AAD_AuthenticationMethods":["1.0.02811103"],"Microsoft_AAD_B2CAdmin":["1.1.705.0"],"Microsoft_AAD_ConditionalAccess":["1.0.02881795"],"Microsoft_AAD_Connect_Provisioning":["3.0.02879985"],"Microsoft_AAD_DecentralizedIdentity":["1.0.02851396"],"Microsoft_AAD_Devices":["1.0.02868505"],"Microsoft_AAD_DomainServices":["2.0.170.0"],"Microsoft_AAD_DXP":["1.0.02878.1283-"],"Microsoft_AAD_ERM":["1.2.870.355"],"Microsoft_AAD_HybridAuthentication":["1.0.02655.90"],"Microsoft_AAD_IAM":["3.0.028741722"],"Microsoft_AAD_IdentityProtection":["1.0.02872276"],"Microsoft_AAD_LifecycleManagement":["1.0.02871.236"],"Microsoft_AAD_RegisteredApps":["1.0.2874.1127"],"Microsoft_AAD_UsersAndTenants":["1.0.02875.1200-3076031"],"Microsoft_AzureCXP_BusinessReview":["0.1.4138"],"Microsoft_AzureCXP_Cpoe":["0.1.3992"],"Microsoft_AzureCXP_EngageHub":["0.1.4208"],"Microsoft_AzureCXP_EngageHubInsights":["0.1.4024"],"Microsoft_AzureCXP_EngageHub_Spaces":["0.1.3950"],"Microsoft_AzureCXP_EngageHub_Support":["0.1.4260"],"Microsoft_AzureStackHCI_PortalExtension":["1.0.028543062"],"Microsoft_AzureStack_LabHardware":["1.0.798.0"],"Microsoft_Azure_ActivityLog":["3.0.02782.235"],"Microsoft_Azure_AD":["1.0.4291.1"],"Microsoft_Azure_ADHybridHealth":["2.0.02872241"],"Microsoft_Azure_ADU":["3.0.0.4"],"Microsoft_Azure_AdvisorPortalExtension":["1.0.02850.280"],"Microsoft_Azure_AFDX":["1.8.028111370","1.8.028601424"],"Microsoft_Azure_AgFoodPlatform":["1.0.0.88"],"Microsoft_Azure_AnalysisServices":["1.2.2.63"],"Microsoft_Azure_Analytics":["1.0.02851.2"],"Microsoft_Azure_ANMVerifier":["1.0.02852.93-234"],"Microsoft_Azure_AO5GC":["1.0.0.0-2404250546"],"Microsoft_Azure_AP5GC":["2-2410080600","2-2411130747"],"Microsoft_Azure_ApiManagement":["1.1007.0.2"],"Microsoft_Azure_APISecurity":["1.24.11.132208","1.24.11.201835"],"Microsoft_Azure_AppComplianceAutomation":["202411190218"],"Microsoft_Azure_Appliance":["4.0.300.192","4.0.200.137"],"Microsoft_Azure_AppProtection":["1.0.02842.54"],"Microsoft_Azure_ArcCenterUX":["1.0.50.0"],"Microsoft_Azure_ArcClusterUX":["1.0.1063.0","1.0.1060"],"Microsoft_Azure_ArcNetworking":["1.4.1.11"],"Microsoft_Azure_ASCInformationProtection":["1.24.11.211137"],"Microsoft_Azure_Attestation":["1.0.14.232.0"],"Microsoft_Azure_AutoManagedVirtualMachines":["1.0.02854.456"],"Microsoft_Azure_AutomaticAKS":["4.12.0.2879"],"Microsoft_Azure_Automation":["7.3.2912.201.241101-0228","7.3.2932.0.241115-0022"],"Microsoft_Azure_AzConfig":["1.0.02872126-1"],"Microsoft_Azure_AzFleet":["5.13.393.1807-1729806492-"],"Microsoft_Azure_Batch":["1.1.02859.344"],"Microsoft_Azure_BCDRCenter":["1.0.02858.1262"],"Microsoft_Azure_Billing":["24.11.02879.163-0645","1.0.02882.1142-39"],"Microsoft_Azure_BotService":["1.4.1.397685"],"Microsoft_Azure_Capacity":["241122-0516"],"Microsoft_Azure_Cdn":["1.0.02838.370--8315","1.0.02857.380--983324"],"Microsoft_Azure_ChangeAnalysis":["1.0.02852.117"],"Microsoft_Azure_Chaos":["1.0.0-1.0.02839.1-20480","1.0.0-1.0.02859.2-20600"],"Microsoft_Azure_ClassicResources":["1.0.10.153"],"Microsoft_Azure_Classic_Compute":["5.13.393.1659"],"Microsoft_Azure_CloudforSovereignty":["1.0.241025.2416"],"Microsoft_Azure_CloudHSM":["1.0.02853.220","1.0.02861.221"],"Microsoft_Azure_CloudNative":["5.13.393.1819"],"Microsoft_Azure_CloudNativeTesting":["2024102820241028.1","2024102820241125.2"],"Microsoft_Azure_CloudPC":["1.0.241101.109936297"],"Microsoft_Azure_CloudServices":["5.13.393.1807-1729702289-"],"Microsoft_Azure_CloudServices_Arm":["5.13.393.1807-1729806510-"],"Microsoft_Azure_CloudTest":["2.0.20241126.2"],"Microsoft_Azure_CodeOptimizations":["1.0.02853.40"],"Microsoft_Azure_CodeSigning":["1.0.20241114.101"],"Microsoft_Azure_CommunicationServices":["1.0.20241115.1"],"Microsoft_Azure_CommunicationsGatewayExtension":["2.0.0.0"],"Microsoft_Azure_CommunityTraining":["1.0.6.0"],"Microsoft_Azure_ComplianceCenter":["1.0.0.20240918063735"],"Microsoft_Azure_Compute":["5.13.393.1807-1730314437-","5.13.393.1824"],"Microsoft_Azure_ComputeHub":["5.13.393.1807"],"Microsoft_Azure_ConfidentialLedger":["23.3.7.2"],"Microsoft_Azure_ConfigManager":["20241114.5"],"Microsoft_Azure_ContainerInsightsExt":["2.0.20241023.2014","2.0.20241101.1746"],"Microsoft_Azure_ContainerRegistries":["1.0.20240829.9"],"Microsoft_Azure_ContainerService":["4.60.1.101/1EqRKWy2d0SP","5.13.393.1835/ZgbF9T8qGp-e"],"Microsoft_Azure_ContainerStorage":["5.13.393.1697","5.13.393.1698"],"Microsoft_Azure_Copilot":["1.311.02882.591","1.200.02872.577"],"Microsoft_Azure_CostManagement":["241111-1900"],"Microsoft_Azure_CreateUIDef":["1.0.300.334","1.0.200.601"],"Microsoft_Azure_CtsExtension":["1.2.0.9"],"Microsoft_Azure_CustomerHub":["1.0.300.165"],"Microsoft_Azure_Dashboard":["2.0.1890.0"],"Microsoft_Azure_DatabaseInsights":["1.0.02854.428"],"Microsoft_Azure_Databricks":["1.0.02855.267"],"Microsoft_Azure_DataCollaboration":["2.0.20230315-0800"],"Microsoft_Azure_DataFactory":["1.0.20241024.1"],"Microsoft_Azure_DataLakeAnalytics":["20240906.1"],"Microsoft_Azure_DataLakeStore":["5.13.393.1735"],"Microsoft_Azure_DataProtection":["241029-102415"],"Microsoft_Azure_DataShare":["2.0.20241108-0418"],"Microsoft_Azure_Dedicated_ClusterStor":["240909-1921"],"Microsoft_Azure_Dedicated_Cray":["240909-1921"],"Microsoft_Azure_Dedicated_Monitoring":["240909-1921"],"Microsoft_Azure_DetonationService":["2.00.00.03"],"Microsoft_Azure_DevCenter":["14.170.0.1.241114-1814"],"Microsoft_Azure_DeviceRegistry":["1.0.02871.97-111120"],"Microsoft_Azure_DeviceUpdate":["1.0.02843.128-101415"],"Microsoft_Azure_DevOpsInfrastructure":["1.0.20241126.2"],"Microsoft_Azure_DevTestLab":["14.170.0.1.241122-0010"],"Microsoft_Azure_DevTunnels":["1.0.231005.2128","1.0.230613.1659"],"Microsoft_Azure_DigitalTwins":["1.0.02829.187-093022"],"Microsoft_Azure_DiskMgmt":["5.13.393.1804-1730162051-","5.13.393.1836"],"Microsoft_Azure_DMS":["5.1.6396.3"],"Microsoft_Azure_DNS":["1.0.02867.222"],"Microsoft_Azure_DNSManagedResolver":["1.0.02816.276","1.0.02852.278"],"Microsoft_Azure_DnsSecurityPolicy":["1.0.02878.100"],"Microsoft_Azure_DocumentDB":["2.0.20241115.7.0"],"Microsoft_Azure_DocumentManagement":["1.0.02852.2"],"Microsoft_Azure_Ea":["20241122.1"],"Microsoft_Azure_EASM":["1.0.02875.1442"],"Microsoft_Azure_ECE":["1.0.02748.15-652409","1.0.02844.22-206"],"Microsoft_Azure_EdgeAIExtension":["1.0.02851.5"],"Microsoft_Azure_EdgeGateway":["1.0.02825.1545"],"Microsoft_Azure_EdgeManagementCopilot":["1.0.02854.246"],"Microsoft_Azure_EdgeOrder":["1.0.02850369"],"Microsoft_Azure_Education":["2024.07.18-0115"],"Microsoft_Azure_ElasticSan":["5.13.393.1807-1731535885-"],"Microsoft_Azure_ELMAdmin":["2.75.02879.2025"],"Microsoft_Azure_EMA":["2.41007.1.19"],"Microsoft_Azure_EmailCommunicationServices":["65460497"],"Microsoft_Azure_EpicManagement":["1.2.10205.10621"],"Microsoft_Azure_EventGrid":["2.0.02851.230"],"Microsoft_Azure_EventHub":["2.0.02859.340"],"Microsoft_Azure_Experimentation":["2.0.02866.63"],"Microsoft_Azure_Expert":["1.20241028.1","1.20241101.1"],"Microsoft_Azure_ExpressPod":["2024.0.135.1"],"Microsoft_Azure_FairfieldGardens":["1.0.02837.66-100800"],"Microsoft_Azure_FileShare":["5.13.393.1803","5.13.393.1836"],"Microsoft_Azure_FileStorage":["5.13.393.1803","5.13.393.1836"],"Microsoft_Azure_FIST":["2024.10.02.160055","2024.06.13.181824"],"Microsoft_Azure_FlowLog":["2.0.0.306.241021-2045"],"Microsoft_Azure_FluidRelay":["1.0.2.4.241014-1713"],"Microsoft_Azure_Frontdoor":["1.0.02793.355--71340517","1.0.02858.386--179125"],"Microsoft_Azure_GeneratedExtension":["1.200.02858.681"],"Microsoft_Azure_GlobalView":["1.0.0.5"],"Microsoft_Azure_GraphDataConnect":["1.20241010.6.0"],"Microsoft_Azure_GTM":["24.11.02880.379-231252","1.0.02882.2566-577"],"Microsoft_Azure_HDInsight":["1.0.02859.1610"],"Microsoft_Azure_Health":["1.1.1.465","1.1.1.467"],"Microsoft_Azure_HealthBot":["1.0.0.111"],"Microsoft_Azure_HealthDataDeidentification":["1.0.48029.1"],"Microsoft_Azure_HealthModels":["0.2023.78.333"],"Microsoft_Azure_HybridCompute":["1.0.4224.0","1.0.4228.0"],"Microsoft_Azure_HybridData_Platform":["1.0.02854.204"],"Microsoft_Azure_HybridNetworking":["24.8.0.63-241023-2106","24.8.0.66-241101-1214"],"Microsoft_Azure_IacAutomation":["0.0.1.241017-0944","0.0.1.241018-0643"],"Microsoft_Azure_IdentityGovernance":["1.0.02871.241"],"Microsoft_Azure_IndustrySolutionCenter":["1.0.241111-0553"],"Microsoft_Azure_IoTCentral":["2.0.9070.41921"],"Microsoft_Azure_IotHub":["1.0.02860.545-103117"],"Microsoft_Azure_IoTOperations":["1.0.02881.174-112117"],"Microsoft_Azure_IoT_Defender":["2024-11-24--09-13-22"],"Microsoft_Azure_IPAddressManager":["1.0.02859.150-2636459"],"Microsoft_Azure_Kailani":["5.13.393.1803-1730160965-","5.13.393.1836"],"Microsoft_Azure_KeyVault":["1.2.298.0.241021-1530"],"Microsoft_Azure_Kusto":["1.0.2417.0"],"Microsoft_Azure_LocationServices":["3.0.02871.271"],"Microsoft_Azure_Lockbox":["2.62.0.0"],"Microsoft_Azure_Maintenance":["5.13.393.1807-1729702031-"],"Microsoft_Azure_ManagedHSM":["1.0.02834.376-077392","1.0.02882.439-1560503"],"Microsoft_Azure_ManagedLab":["14.115.0.1.241029-0043"],"Microsoft_Azure_ManagedNetwork":["1.0.02859.162-866"],"Microsoft_Azure_ManagedServiceIdentity":["2.1.8974.0"],"Microsoft_Azure_ManagedStorageClass":["1.4.0.202410290745"],"Microsoft_Azure_Marketplace":["50.0.02880.39-394","30.0.02880.32-72"],"Microsoft_Azure_MarketplaceTransact":["1.0.20241030.8471428"],"Microsoft_Azure_Media":["1.0.1416.0","1.0.1421.0"],"Microsoft_Azure_Migrate":["1.0.10.509"],"Microsoft_Azure_MigrateAssessment":["1.0.10.4"],"Microsoft_Azure_MigrateModernization":["1.51.1240903.11134"],"Microsoft_Azure_MLTeamAccounts":["1.0.0.241115-0947"],"Microsoft_Azure_ModSimWorkbench":["0.10.10.0"],"Microsoft_Azure_Monitoring":["22.20241023.2.0.02852.430","22.20241030.2.0.02859.431"],"Microsoft_Azure_MonitoringMetrics":["2.0.20241017.1618"],"Microsoft_Azure_Monitoring_Alerts":["1.0.02822.1328","1.0.02874.1367"],"Microsoft_Azure_NetApp":["2407.2.0.3"],"Microsoft_Azure_Network":["5.13.393.1821","5.13.393.1842"],"Microsoft_Azure_NetworkCloud":["5.9.0","5.831.0-1"],"Microsoft_Azure_NetworkCopilot":["1.0.02861.107-2554"],"Microsoft_Azure_NetworkCopilotExtension":["1.0.02860.38-55093"],"Microsoft_Azure_NetworkingCopilot":["1.0.02873.108-2"],"Microsoft_Azure_NetworkSecurityPerimeter":["1.34.0.153","1.35.0.157"],"Microsoft_Azure_Network_Access":["1.0.02871.1494"],"Microsoft_Azure_NotificationHubs":["20241121.1.241121-1144"],"Microsoft_Azure_OneInventory":["1.0.02845.214","1.0.02861.218"],"Microsoft_Azure_OneMigrate":["1.0.10.44"],"Microsoft_Azure_OpenEnergyPlatform":["1.0.196"],"Microsoft_Azure_OperationsMgr":["1.2.361.0"],"Microsoft_Azure_OpsMQ":["1.0.02734.96-062721"],"Microsoft_Azure_Orbital":["2024.10.02847.498"],"Microsoft_Azure_OSSDatabases":["2.1.02859122"],"Microsoft_Azure_PaasServerless":["5.246.1.3"],"Microsoft_Azure_Peering":["1.2.0.255"],"Microsoft_Azure_PIMCommon":["2.0.32.1768"],"Microsoft_Azure_PinToGrafana":["1.2.154.1"],"Microsoft_Azure_Playground":["14.115.4.1"],"Microsoft_Azure_PlaywrightService":["1.0.0.41"],"Microsoft_Azure_Policy":["1.0.9.704"],"Microsoft_Azure_PortalDashboard":["1.100.02850.547"],"Microsoft_Azure_PowerBIDedicated":["1.1.2823.1"],"Microsoft_Azure_PowerPlatform":["0.0.0.71"],"Microsoft_Azure_PrivateDNS":["1.0.02875.231"],"Microsoft_Azure_PrivateModSimWorkbench":["0.10.10.1"],"Microsoft_Azure_ProgrammableConnectivity":["1.1.74","2.85.0-1"],"Microsoft_Azure_ProjectBabylon":["1.0.20241107.418","1.0.20240729.400"],"Microsoft_Azure_ProjectOxford":["241113-0920"],"Microsoft_Azure_Quantum":["1.11.2.0"],"Microsoft_Azure_RecommendationsService":["9.32.02744.262"],"Microsoft_Azure_RecoveryServices":["3.40.2410.251"],"Microsoft_Azure_Relay":["2.0.02851.179"],"Microsoft_Azure_Reservations":["11.19.2024.2050"],"Microsoft_Azure_ResourceMove":["1.1.10909.10739"],"Microsoft_Azure_Resources":["1.0.100.994","1.0.100.999"],"Microsoft_Azure_RpExt":["2.0.0.0"],"Microsoft_Azure_SaasHub":["1.0.02810.51-45869"],"Microsoft_Azure_SapHanaInstances":["1.0.50.144"],"Microsoft_Azure_SAPManagement":["2.1.11015.10506"],"Microsoft_Azure_SAPMigrate":["1.2.10908.12138"],"Microsoft_Azure_Search":["149376413.20241114.1"],"Microsoft_Azure_Security":["1.24.11.251357"],"Microsoft_Azure_Security_AzureDefenderForData":["1.24.11.252320"],"Microsoft_Azure_Security_CloudNativeCompute":["1.24.11.251214"],"Microsoft_Azure_Security_DevOps":["1.24.11.132228"],"Microsoft_Azure_Security_Insights":["1.0.02879.444-241119-144406"],"Microsoft_Azure_Security_IoT":["2024-11-11--11-24-55"],"Microsoft_Azure_Security_R3":["1.24.11.201153"],"Microsoft_Azure_SentinelUS":["1.0.02879.5305-241119-1859"],"Microsoft_Azure_ServiceBus":["2.0.02859.210"],"Microsoft_Azure_ServiceFabric":["5.13.393.1807-1729806504-"],"Microsoft_Azure_ServiceHub":["1.300.02860.75"],"Microsoft_Azure_SignalR":["1.0.02880.70--9565"],"Microsoft_Azure_SiteManager":["1.0.02852561"],"Microsoft_Azure_SiteRecovery":["1.51.12410.198"],"Microsoft_Azure_SolutionCenter":["5.13.393.1780","4.12.0.2982"],"Microsoft_Azure_Sphere":["2.0.24305.1"],"Microsoft_Azure_SpringApps":["20241106.1"],"Microsoft_Azure_Stack_Migrate":["2.241029.1738.1"],"Microsoft_Azure_Storage":["5.13.393.1803-1730161979-","5.13.393.1837"],"Microsoft_Azure_StorageCache":["1.1.0.1069"],"Microsoft_Azure_StorageInsights":["4.13.393.1126"],"Microsoft_Azure_StorageMover":["5.13.393.1803","5.13.393.1836"],"Microsoft_Azure_StorageTasks":["5.13.393.1803-1729794100-","5.13.393.1836"],"Microsoft_Azure_StreamAnalytics":["20241119.2"],"Microsoft_Azure_SubscriptionManagement":["1.0.02880.232.20241120-0305"],"Microsoft_Azure_Support":["1.580.20241107.1","1.580.20241029.1"],"Microsoft_Azure_Surface":["2.53.0"],"Microsoft_Azure_Sustainability":["1.0.1.170","1.0.1.173"],"Microsoft_Azure_Synapse":["1.0.02832.1"],"Microsoft_Azure_TemplateSpecs":["1.0.1.91"],"Microsoft_Azure_Toolbox":["2.0.02847.298"],"Microsoft_Azure_UsageBilling":["1.0.02805.11"],"Microsoft_Azure_VirtualEnclaves":["2.1.155.0"],"Microsoft_Azure_VirtualVisitsBuilder":["1.0.0.20240509190151576"],"Microsoft_Azure_VnfManager":["1.9.0","1.59.0-1"],"Microsoft_Azure_WaveMigration":["1.0.10.6"],"Microsoft_Azure_WhatsNew":["1.0.02815116"],"Microsoft_Azure_Winfields":["1.0.028335"],"Microsoft_Azure_WorkbooksExtension":["1.24.02857.421","1.24.02860.423"],"Microsoft_Azure_WorkloadInsight":["1.0.02819.95"],"Microsoft_Azure_WorkloadInsights":["2.0.20241008.1902","2.0.20241030.1727"],"Microsoft_Azure_WorkloadMonitor":["1.2.10924.10947"],"Microsoft_Azure_WVD":["1.0.02872.560"],"Microsoft_Bing_Api":["241028-0015"],"Microsoft_CloudHealth_HealthModels":["1.0.02885.84"],"Microsoft_Cognition_MixedReality":["34.0.0.1"],"Microsoft_ConnectedCache_Ent":["1.0.0.2.25"],"Microsoft_ConnectedCache_Enterprise":["1.0.0.1.14"],"Microsoft_ConnectedCache_ISP":["1.0.0.1.48"],"Microsoft_EMM_ModernWorkplace":["1.2411.301.11"],"Microsoft_Entra_PM":["2024.9.26.1"],"Microsoft_Entra_PMAnalytics":["2024.10.11.1-105554065"],"Microsoft_Entra_PMDashboard":["2024.11.20.1-108585238"],"Microsoft_Healthcare_APIs":["1.0.554184.1","1.0.554553.1"],"Microsoft_Intune":["1.2411.32.3002.241119-0151"],"Microsoft_Intune_Apps":["2.2411.64.3002.241115-2340"],"Microsoft_Intune_DeviceExplorer":["1.0.241014.085748"],"Microsoft_Intune_Devices":["6.2411.43.3001.241116-2305"],"Microsoft_Intune_DeviceSettings":["1.2411.102.3002.241119-1850"],"Microsoft_Intune_Edu":["6.2411.20.3001.241116-2246"],"Microsoft_Intune_Enrollment":["7.2411.49.3003.241119-2205"],"Microsoft_Intune_MTM":["6.2409.1.85.241121-0625"],"Microsoft_Intune_Workflows":["1.2411.169.3002.241118-2147"],"Microsoft_ManufacturingPlatform_DMM":["19.11.2024"],"Microsoft_Marketplace_SolutionFinder":["1.0.20241118.1"],"Microsoft_OneFleet_DataHub":["1.0.02859.268"],"Microsoft_OperationsManagementSuite_Workspace":["3.0.02873.2158","3.0.02880.2169"],"Microsoft_Research_Genomics":["1.0.0.13929"],"Microsoft_Security_Copilot":["93"],"Microsoft_ServicesHub_Extension":["5.5.9.0"],"Microsoft_VideoIndexer":["1.0.02860.1-241031"],"Oracle_Databases_At_Azure":["1.155.0"],"ScanX_Management":["3.0.0.3"],"ServiceLinkerExtension":["2.0.20241119.1"],"SqlAzureExtension":["2.1.02851234"],"Universal_Print":["3.20241115.2"],"VLCentral_Agreement":["1.0.02882.1"],"VLCentral_Amendments":["1.0.02880.24"],"VLCentral_Approval":["1.0.02845.1"],"VLCentral_CaseManagement":["1.0.02879.2"],"VLCentral_HelpAndSupport":["1.0.02804.2"],"VLCentral_Home":["1.0.02804.2"],"VLCentral_OrderCredits":["1.0.02878.1","1.0.02846.1"],"VLCentral_Ordering":["15.0.02882.1"],"VLCentral_OrganizationManagementService":["1.0.02857.2"],"VLCentral_Platform":["1.0.02844.1"],"VLCentral_Quote":["1.0.02882.4"],"VLCentral_ReportingNAnalytics":["1.0.02882.2"],"VLCentral_UUM":["1.0.02865.54"],"VMCP":["1.2.02857.915","1.2.02866.925"],"WandiscoExtension":["1.14.16.0"],"WebsitesExtension":["5.246.2.8"]}},"signinUri":"/signin/idpRedirect.js/","errorUri":"/Error","unsupportedUri":"/Error/UE_Unsupported","applicationPath":"","supportedLanguages":["en","cs","de","es","fr","hu","id","it","ja","ko","nl","pl","pt-br","pt-pt","ru","sv","tr","zh-hans","zh-hant","qps-ploc"],"portalClientId":"c44b4083-3bb0-49c1-b47d-974e53cbdf3c","authority":"https://login.microsoftonline.com/","armAadResource":"https://management.core.windows.net/","tokenLifetimeClockSkewIntervalInMs":300000.0,"graphEndpoint":"https://graph.windows.net","orgIdChangePasswordUri":"https://go.microsoft.com/fwlink/?LinkID=522342","changePasswordUri":"https://go.microsoft.com/fwlink/?LinkID=522343","isAdfs":false,"roleIdForCompanyAdmin":"62e90394-69f5-4237-9190-012177145e10"},"portalServerMsalJsConfig":{"site_id":"501430","cobrandid":null,"msafed":null,"nativeBroker":0}}); </script></body></html>