jplan-pack 0.6.54 → 0.6.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AuthFailRoute-DNSeS3_5.js → AuthFailRoute-5APDckEh.js} +1 -1
- package/dist/{AuthFailRoute-ufs2z-PB.mjs → AuthFailRoute-B5uAzYov.mjs} +1 -1
- package/dist/{AuthRoute-ChfyW_YY.mjs → AuthRoute-BfsuFWJp.mjs} +1 -1
- package/dist/{AuthRoute-PkK6x6e9.js → AuthRoute-eqcW0KTB.js} +1 -1
- package/dist/{index-LMb42XWv.mjs → index-BHNA2OA1.mjs} +5 -5
- package/dist/{index-DnJTue5F.js → index-BfXkCROS.js} +2 -2
- package/dist/jplan-pack.cjs.js +1 -1
- package/dist/jplan-pack.es.js +1 -1
- package/package.json +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),l=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),l=require("./index-BfXkCROS.js"),d=require("vuetify/lib/components/VBtn/index.mjs");/*!
|
2
2
|
* vue-router v4.5.0
|
3
3
|
* (c) 2024 Eduardo San Martin Morote
|
4
4
|
* @license MIT
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { inject as u, openBlock as d, createElementBlock as a, createElementVNode as r, createVNode as p, withCtx as i, createTextVNode as f } from "vue";
|
2
|
-
import { _ as m } from "./index-
|
2
|
+
import { _ as m } from "./index-BHNA2OA1.mjs";
|
3
3
|
import { VBtn as _ } from "vuetify/lib/components/VBtn/index.mjs";
|
4
4
|
/*!
|
5
5
|
* vue-router v4.5.0
|
@@ -3,7 +3,7 @@ import "@vueuse/core";
|
|
3
3
|
import "vuetify/lib/components/VBtn/index.mjs";
|
4
4
|
import "vuetify/components";
|
5
5
|
import "vuetify/lib/components/VIcon/index.mjs";
|
6
|
-
import { m as t, S as g, _ as v } from "./index-
|
6
|
+
import { m as t, S as g, _ as v } from "./index-BHNA2OA1.mjs";
|
7
7
|
import "vuetify/lib/components/VCard/index.mjs";
|
8
8
|
import "vuetify/lib/components/VDialog/index.mjs";
|
9
9
|
import "vuetify/lib/components/VDivider/index.mjs";
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("@vueuse/core");require("vuetify/lib/components/VBtn/index.mjs");require("vuetify/components");require("vuetify/lib/components/VIcon/index.mjs");const t=require("./index-
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");require("@vueuse/core");require("vuetify/lib/components/VBtn/index.mjs");require("vuetify/components");require("vuetify/lib/components/VIcon/index.mjs");const t=require("./index-BfXkCROS.js");require("vuetify/lib/components/VCard/index.mjs");require("vuetify/lib/components/VDialog/index.mjs");require("vuetify/lib/components/VDivider/index.mjs");require("vuetify/lib/components/VGrid/index.mjs");require("vuetify/lib/components/VAvatar/index.mjs");require("vuetify/lib/components/VImg/index.mjs");require("vuetify/lib/components/VList/index.mjs");require("vuetify/lib/components/VMenu/index.mjs");require("vuetify/lib/components/VDataTable/index.mjs");require("vuetify/lib/components/VTextField/index.mjs");require("vuetify/lib/components/VSelect/index.mjs");require("vuetify/lib/components/VCheckbox/index.mjs");require("vuetify/lib/components/VChip/index.mjs");require("vuetify/lib/components/VLabel/index.mjs");require("vuetify/lib/components/VTextarea/index.mjs");require("vuetify/lib/components/VBtnToggle/index.mjs");const c={class:"overlay"},l={class:"text-white"},d={class:"text-white"},q=e.defineComponent({__name:"AuthRoute",setup(p){const s=r=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:window.location.href,extraQueryParameters:r}),i=e.ref(!1);async function u(){t.msal.getAllAccounts().length===0&&(i.value=!0);const r=await t.msal.handleRedirectPromise();if(!r){await t.msal.initialize();const n=s();await t.msal.loginRedirect(n);return}t.msal.setActiveAccount(r.account)}e.onMounted(async()=>{await t.msal.initialize(),await u()});const o=[{title:"Authenticating...",subtitle:"Please wait."},{title:"Authorized",subtitle:"If this window don't closed automatically, you can close it now."}],a=e.computed(()=>i.value?o[0]:o[1]);return(r,n)=>(e.openBlock(),e.createElementBlock("div",c,[e.createElementVNode("h3",l,e.toDisplayString(a.value.title),1),e.createVNode(e.unref(t.SpinnerLoader)),e.createElementVNode("p",d,e.toDisplayString(a.value.subtitle),1)]))}}),m=t._export_sfc(q,[["__scopeId","data-v-b7679fd7"]]);exports.default=m;
|
@@ -17958,8 +17958,8 @@ mk(() => wU(), 1e3);
|
|
17958
17958
|
function wU() {
|
17959
17959
|
var n, i;
|
17960
17960
|
if (!((i = (n = xn.value) == null ? void 0 : n.idTokenClaims) != null && i.exp)) return;
|
17961
|
-
const r = Math.floor(Date.now() / 1e3), t = xn.value.idTokenClaims.exp
|
17962
|
-
|
17961
|
+
const r = Math.floor(Date.now() / 1e3), e = 300, t = xn.value.idTokenClaims.exp;
|
17962
|
+
oh.value = t - r - e;
|
17963
17963
|
}
|
17964
17964
|
function hf() {
|
17965
17965
|
const { setJToken: r, jToken: e } = FC(), t = Ot(() => !!xn.value), n = Ot(() => xn.value);
|
@@ -18044,7 +18044,7 @@ function hf() {
|
|
18044
18044
|
}
|
18045
18045
|
};
|
18046
18046
|
xi(oh, async (p) => {
|
18047
|
-
p
|
18047
|
+
p <= 0 && ui.value === "updated" && await h();
|
18048
18048
|
});
|
18049
18049
|
const g = Ot(() => e.value);
|
18050
18050
|
return {
|
@@ -19743,11 +19743,11 @@ et.HttpStatusCode = uh;
|
|
19743
19743
|
et.default = et;
|
19744
19744
|
const Q2 = {
|
19745
19745
|
path: "/_/dashboard",
|
19746
|
-
component: () => import("./AuthRoute-
|
19746
|
+
component: () => import("./AuthRoute-BfsuFWJp.mjs"),
|
19747
19747
|
meta: { requiresAuth: !1 }
|
19748
19748
|
}, X2 = {
|
19749
19749
|
path: "/jplan-auth-fail",
|
19750
|
-
component: () => import("./AuthFailRoute-
|
19750
|
+
component: () => import("./AuthFailRoute-B5uAzYov.mjs"),
|
19751
19751
|
meta: { requiresAuth: !1 }
|
19752
19752
|
}, { isAuthenticated: Sv, handleRedirect: Z2 } = hf(), eH = vf();
|
19753
19753
|
function JH(r, e) {
|
@@ -53,12 +53,12 @@ Error Description: ${s.errorMessage}`);else{const l=s;this.logger.error(`A non-M
|
|
53
53
|
Error: ${l.name}
|
54
54
|
Error Description: ${l.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=St.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),n}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&ye.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let n;if(t&&t.azureCloudInstance!==eh.None){const i=t.tenant?t.tenant:P.DEFAULT_COMMON_TENANT;n=`${t.azureCloudInstance}/${i}/`}return n||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return P.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw B(vr)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return lC.has(e)}static isPublicCloudAuthority(e){return P.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,n){const i=new ye(e);i.validateAsUri();const s=i.getUrlComponents();let l=`${t}.${s.HostNameAndPort}`;this.isPublicCloudAuthority(s.HostNameAndPort)&&(l=`${t}.${P.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const d=ye.constructAuthorityUriFromObject({...i.getUrlComponents(),HostNameAndPort:l}).urlString;return n?`${d}?${n}`:d}static replaceWithRegionalInformation(e,t){const n={...e};return n.authorization_endpoint=St.buildRegionalAuthorityString(n.authorization_endpoint,t),n.token_endpoint=St.buildRegionalAuthorityString(n.token_endpoint,t),n.end_session_endpoint&&(n.end_session_endpoint=St.buildRegionalAuthorityString(n.end_session_endpoint,t)),n}static transformCIAMAuthority(e){let t=e;const i=new ye(e).getUrlComponents();if(i.PathSegments.length===0&&i.HostNameAndPort.endsWith(P.CIAM_AUTH_URL)){const s=i.HostNameAndPort.split(".")[0];t=`${t}${s}${P.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}St.reservedTenantDomains=new Set(["{tenant}","{tenantid}",zr.COMMON,zr.CONSUMERS,zr.ORGANIZATIONS]);function mx(r){var i;const n=(i=new ye(r).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:i.toLowerCase();switch(n){case zr.COMMON:case zr.ORGANIZATIONS:case zr.CONSUMERS:return;default:return n}}function fC(r){return r.endsWith(P.FORWARD_SLASH)?r:`${r}${P.FORWARD_SLASH}`}function px(r){const e=r.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Pe(oh)}return{canonicalAuthority:r.authority?fC(r.authority):void 0,knownAuthorities:r.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.0 2024-11-05 */async function gC(r,e,t,n,i,s,l){l==null||l.addQueueMeasurement(k.AuthorityFactoryCreateDiscoveredInstance,s);const d=St.transformCIAMAuthority(fC(r)),f=new St(d,e,t,n,i,s,l);try{return await F(f.resolveEndpointsAsync.bind(f),k.AuthorityResolveEndpointsAsync,i,l,s)(),f}catch{throw B(vr)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Gr extends He{constructor(e,t,n,i,s){super(e,t,n),this.name="ServerError",this.errorNo=i,this.status=s,Object.setPrototypeOf(this,Gr.prototype)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Jn{static generateThrottlingStorageKey(e){return`${ca.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var s;const n=Jn.generateThrottlingStorageKey(t),i=e.getThrottlingCache(n);if(i){if(i.throttleTime<Date.now()){e.removeItem(n);return}throw new Gr(((s=i.errorCodes)==null?void 0:s.join(" "))||P.EMPTY_STRING,i.errorMessage,i.subError)}}static postProcess(e,t,n){if(Jn.checkResponseStatus(n)||Jn.checkResponseForRetryAfter(n)){const i={throttleTime:Jn.calculateThrottleTime(parseInt(n.headers[Pt.RETRY_AFTER])),error:n.body.error,errorCodes:n.body.error_codes,errorMessage:n.body.error_description,subError:n.body.suberror};e.setThrottlingCache(Jn.generateThrottlingStorageKey(t),i)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Pt.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,n=Date.now()/1e3;return Math.floor(Math.min(n+(t||ca.DEFAULT_THROTTLE_TIME_SECONDS),n+ca.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,n,i){const s={clientId:t,authority:n.authority,scopes:n.scopes,homeAccountIdentifier:i,claims:n.claims,authenticationScheme:n.authenticationScheme,resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,sshKid:n.sshKid},l=this.generateThrottlingStorageKey(s);e.removeItem(l)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Dc extends He{constructor(e,t,n){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,Dc.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=n}}function dp(r,e,t){return new Dc(r,e,t)}/*! @azure/msal-common v14.16.0 2024-11-05 */class dh{constructor(e,t){this.config=bM(e),this.logger=new qr(this.config.loggerOptions,Ky,Zd),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[Pt.CONTENT_TYPE]=P.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case on.HOME_ACCOUNT_ID:try{const n=ai(e.credential);t[Pt.CCS_HEADER]=`Oid:${n.uid}@${n.utid}`}catch(n){this.logger.verbose("Could not parse home account ID for CCS Header: "+n)}break;case on.UPN:t[Pt.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,n,i,s,l){var f;l&&((f=this.performanceClient)==null||f.addQueueMeasurement(l,s));const d=await this.sendPostRequest(i,e,{body:t,headers:n},s);return this.config.serverTelemetryManager&&d.status<500&&d.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),d}async sendPostRequest(e,t,n,i){var l,d,f;Jn.preProcess(this.cacheManager,e);let s;try{s=await F(this.networkClient.sendPostRequestAsync.bind(this.networkClient),k.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,i)(t,n);const g=s.headers||{};(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((l=s.body.refresh_token)==null?void 0:l.length)||0,httpVerToken:g[Pt.X_MS_HTTP_VERSION]||"",requestId:g[Pt.X_MS_REQUEST_ID]||""},i)}catch(g){if(g instanceof Dc){const m=g.responseHeaders;throw m&&((f=this.performanceClient)==null||f.addFields({httpVerToken:m[Pt.X_MS_HTTP_VERSION]||"",requestId:m[Pt.X_MS_REQUEST_ID]||"",contentTypeHeader:m[Pt.CONTENT_TYPE]||void 0,contentLengthHeader:m[Pt.CONTENT_LENGTH]||void 0,httpStatus:g.httpStatus},i)),g.error}throw g instanceof He?g:B(ky)}return Jn.postProcess(this.cacheManager,e,s),s}async updateAuthority(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(k.UpdateTokenEndpointAuthority,t);const n=`https://${e}/${this.authority.tenant}/`,i=await gC(n,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=i}createTokenQueryParameters(e){const t=new la(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */const fc="no_tokens_found",mC="native_account_unavailable",hh="refresh_token_expired",vx="interaction_required",yx="consent_required",Cx="login_required",Lc="bad_token";/*! @azure/msal-common v14.16.0 2024-11-05 */const hp=[vx,yx,Cx,Lc],wx=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],_x={[fc]:"No refresh token found in the cache. Please sign-in.",[mC]:"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.",[hh]:"Refresh token has expired.",[Lc]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class Fn extends He{constructor(e,t,n,i,s,l,d,f){super(e,t,n),Object.setPrototypeOf(this,Fn.prototype),this.timestamp=i||P.EMPTY_STRING,this.traceId=s||P.EMPTY_STRING,this.correlationId=l||P.EMPTY_STRING,this.claims=d||P.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=f}}function fp(r,e,t){const n=!!r&&hp.indexOf(r)>-1,i=!!t&&wx.indexOf(t)>-1,s=!!e&&hp.some(l=>e.indexOf(l)>-1);return n||s||i}function vd(r){return new Fn(r,_x[r])}/*! @azure/msal-common v14.16.0 2024-11-05 */class Vn{static setRequestState(e,t,n){const i=Vn.generateLibraryState(e,n);return t?`${i}${P.RESOURCE_DELIM}${t}`:i}static generateLibraryState(e,t){if(!e)throw B(hd);const n={id:e.createNewGuid()};t&&(n.meta=t);const i=JSON.stringify(n);return e.base64Encode(i)}static parseRequestState(e,t){if(!e)throw B(hd);if(!t)throw B(fi);try{const n=t.split(P.RESOURCE_DELIM),i=n[0],s=n.length>1?n.slice(1).join(P.RESOURCE_DELIM):P.EMPTY_STRING,l=e.base64Decode(i),d=JSON.parse(l);return{userRequestState:s||P.EMPTY_STRING,libraryState:d}}catch{throw B(fi)}}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Tx={SW:"sw",UHW:"uhw"};class mi{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(k.PopTokenGenerateCnf,e.correlationId);const n=await F(this.generateKid.bind(this),k.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),i=this.cryptoUtils.base64UrlEncode(JSON.stringify(n));return{kid:n.kid,reqCnfString:i}}async generateKid(e){var n;return(n=this.performanceClient)==null||n.addQueueMeasurement(k.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:Tx.SW}}async signPopToken(e,t,n){return this.signPayload(e,t,n)}async signPayload(e,t,n,i){const{resourceRequestMethod:s,resourceRequestUri:l,shrClaims:d,shrNonce:f,shrOptions:g}=n,m=l?new ye(l):void 0,v=m==null?void 0:m.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:or(),m:s==null?void 0:s.toUpperCase(),u:v==null?void 0:v.HostNameAndPort,nonce:f||this.cryptoUtils.createNewGuid(),p:v==null?void 0:v.AbsolutePath,q:v!=null&&v.QueryString?[[],v.QueryString]:void 0,client_claims:d||void 0,...i},t,g,n.correlationId)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Ex{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.0 2024-11-05 */function Sx(r){var n,i;const e="code=",t=(n=r.error_uri)==null?void 0:n.lastIndexOf(e);return t&&t>=0?(i=r.error_uri)==null?void 0:i.substring(t+e.length):void 0}class po{constructor(e,t,n,i,s,l,d){this.clientId=e,this.cacheStorage=t,this.cryptoObj=n,this.logger=i,this.serializableCache=s,this.persistencePlugin=l,this.performanceClient=d}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?B(sc,"Cached State"):B(sc,"Server State");let n,i;try{n=decodeURIComponent(e.state)}catch{throw B(fi,e.state)}try{i=decodeURIComponent(t)}catch{throw B(fi,e.state)}if(n!==i)throw B(Ny);if(e.error||e.error_description||e.suberror){const s=Sx(e);throw fp(e.error,e.error_description,e.suberror)?new Fn(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",s):new Gr(e.error||"",e.error_description,e.suberror,s)}}validateTokenResponse(e,t){var n;if(e.error||e.error_description||e.suberror){const i=`Error(s): ${e.error_codes||P.NOT_AVAILABLE} - Timestamp: ${e.timestamp||P.NOT_AVAILABLE} - Description: ${e.error_description||P.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||P.NOT_AVAILABLE} - Trace ID: ${e.trace_id||P.NOT_AVAILABLE}`,s=(n=e.error_codes)!=null&&n.length?e.error_codes[0]:void 0,l=new Gr(e.error,i,e.suberror,s,e.status);if(t&&e.status&&e.status>=As.SERVER_ERROR_RANGE_START&&e.status<=As.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
|
55
55
|
${l}`);return}else if(t&&e.status&&e.status>=As.CLIENT_ERROR_RANGE_START&&e.status<=As.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
|
56
|
-
${l}`);return}throw fp(e.error,e.error_description,e.suberror)?new Fn(e.error,e.error_description,e.suberror,e.timestamp||P.EMPTY_STRING,e.trace_id||P.EMPTY_STRING,e.correlation_id||P.EMPTY_STRING,e.claims||P.EMPTY_STRING,s):l}}async handleServerTokenResponse(e,t,n,i,s,l,d,f,g){var _;(_=this.performanceClient)==null||_.addQueueMeasurement(k.HandleServerTokenResponse,e.correlation_id);let m;if(e.id_token){if(m=wo(e.id_token||P.EMPTY_STRING,this.cryptoObj.base64Decode),s&&s.nonce&&m.nonce!==s.nonce)throw B(Py);if(i.maxAge||i.maxAge===0){const b=m.auth_time;if(!b)throw B(Yd);zy(b,i.maxAge)}}this.homeAccountIdentifier=at.generateHomeAccountId(e.client_info||P.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,m);let v;s&&s.state&&(v=Vn.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||i.sshKid||void 0;const C=this.generateCacheRecord(e,t,n,i,m,l,s);let S;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),S=new Ex(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(S)),d&&!f&&C.account){const b=C.account.generateAccountKey();if(!this.cacheStorage.getAccount(b,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await po.generateAuthenticationResult(this.cryptoObj,t,C,!1,i,m,v,void 0,g)}await this.cacheStorage.saveCacheRecord(C,i.storeInCache,i.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&S&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(S))}return po.generateAuthenticationResult(this.cryptoObj,t,C,!1,i,m,v,e,g)}generateCacheRecord(e,t,n,i,s,l,d){const f=t.getPreferredCache();if(!f)throw B(Qd);const g=aC(s);let m,v;e.id_token&&s&&(m=Nc(this.homeAccountIdentifier,f,e.id_token,this.clientId,g||""),v=fh(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,s,e.client_info,f,g,d,void 0,this.logger));let C=null;if(e.access_token){const b=e.scope?Je.fromString(e.scope):new Je(i.scopes||[]),O=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,$=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,V=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,U=n+O,Q=U+$,se=V&&V>0?n+V:void 0;C=Pc(this.homeAccountIdentifier,f,e.access_token,this.clientId,g||t.tenant||"",b.printScopes(),U,Q,this.cryptoObj.base64Decode,se,e.token_type,l,e.key_id,i.claims,i.requestedClaimsHash)}let S=null;if(e.refresh_token){let b;if(e.refresh_token_expires_in){const O=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;b=n+O}S=Wy(this.homeAccountIdentifier,f,e.refresh_token,this.clientId,e.foci,l,b)}let _=null;return e.foci&&(_={clientId:this.clientId,environment:f,familyId:e.foci}),{account:v,idToken:m,accessToken:C,refreshToken:S,appMetadata:_}}static async generateAuthenticationResult(e,t,n,i,s,l,d,f,g){var U,Q,se,we,z;let m=P.EMPTY_STRING,v=[],C=null,S,_,b=P.EMPTY_STRING;if(n.accessToken){if(n.accessToken.tokenType===Oe.POP&&!s.popKid){const tt=new mi(e),{secret:Te,keyId:j}=n.accessToken;if(!j)throw B(Xd);m=await tt.signPopToken(Te,j,s)}else m=n.accessToken.secret;v=Je.fromString(n.accessToken.target).asArray(),C=new Date(Number(n.accessToken.expiresOn)*1e3),S=new Date(Number(n.accessToken.extendedExpiresOn)*1e3),n.accessToken.refreshOn&&(_=new Date(Number(n.accessToken.refreshOn)*1e3))}n.appMetadata&&(b=n.appMetadata.familyId===sa?sa:"");const O=(l==null?void 0:l.oid)||(l==null?void 0:l.sub)||"",$=(l==null?void 0:l.tid)||"";f!=null&&f.spa_accountid&&n.account&&(n.account.nativeAccountId=f==null?void 0:f.spa_accountid);const V=n.account?sh(n.account.getAccountInfo(),void 0,l,(U=n.idToken)==null?void 0:U.secret):null;return{authority:t.canonicalAuthority,uniqueId:O,tenantId:$,scopes:v,account:V,idToken:((Q=n==null?void 0:n.idToken)==null?void 0:Q.secret)||"",idTokenClaims:l||{},accessToken:m,fromCache:i,expiresOn:C,extExpiresOn:S,refreshOn:_,correlationId:s.correlationId,requestId:g||P.EMPTY_STRING,familyId:b,tokenType:((se=n.accessToken)==null?void 0:se.tokenType)||P.EMPTY_STRING,state:d?d.userRequestState:P.EMPTY_STRING,cloudGraphHostName:((we=n.account)==null?void 0:we.cloudGraphHostName)||P.EMPTY_STRING,msGraphHost:((z=n.account)==null?void 0:z.msGraphHost)||P.EMPTY_STRING,code:f==null?void 0:f.spa_code,fromNativeBroker:!1}}}function fh(r,e,t,n,i,s,l,d,f,g,m){m==null||m.verbose("setCachedAccount called");const C=r.getAccountKeys().find($=>$.startsWith(t));let S=null;C&&(S=r.getAccount(C,m));const _=S||at.createAccount({homeAccountId:t,idTokenClaims:i,clientInfo:s,environment:l,cloudGraphHostName:f==null?void 0:f.cloud_graph_host_name,msGraphHost:f==null?void 0:f.msgraph_host,nativeAccountId:g},e,n),b=_.tenantProfiles||[],O=d||_.realm;if(O&&!b.find($=>$.tenantId===O)){const $=ah(t,_.localAccountId,O,i);b.push($)}return _.tenantProfiles=b,_}/*! @azure/msal-common v14.16.0 2024-11-05 */async function pC(r,e,t){return typeof r=="string"?r:r({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class vC extends dh{constructor(e,t){var n;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(n=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:n.defaultScopes}async getAuthCodeUrl(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement(k.GetAuthCodeUrl,e.correlationId);const t=await F(this.createAuthCodeUrlQueryString.bind(this),k.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return ye.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,f;if((d=this.performanceClient)==null||d.addQueueMeasurement(k.AuthClientAcquireToken,e.correlationId),!e.code)throw B(Dy);const n=or(),i=await F(this.executeTokenRequest.bind(this),k.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),s=(f=i.headers)==null?void 0:f[Pt.X_MS_REQUEST_ID],l=new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return l.validateTokenResponse(i.body),F(l.handleServerTokenResponse.bind(l),k.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,n,e,t,void 0,void 0,void 0,s)}handleFragmentResponse(e,t){if(new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw B(Fy);return e}getLogoutUri(e){if(!e)throw Pe(Xy);const t=this.createLogoutUrlQueryString(e);return ye.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var g,m;(g=this.performanceClient)==null||g.addQueueMeasurement(k.AuthClientExecuteTokenRequest,t.correlationId);const n=this.createTokenQueryParameters(t),i=ye.appendQueryString(e.tokenEndpoint,n),s=await F(this.createTokenRequestBody.bind(this),k.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let l;if(t.clientInfo)try{const v=lc(t.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${v.uid}${bt.CLIENT_INFO_SEPARATOR}${v.utid}`,type:on.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(l||t.ccsCredential),f={clientId:((m=t.tokenBodyParameters)==null?void 0:m.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 F(this.executePostToTokenEndpoint.bind(this),k.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(i,s,d,f,t.correlationId,k.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(k.AuthClientCreateTokenRequestBody,e.correlationId);const t=new la(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[mo])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Xo.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&&!md(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 l=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await pC(l.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(l.assertionType)}if(t.addGrantType(Sy.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Oe.POP){const l=new mi(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await F(l.generateCnf.bind(l),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Oe.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Pe(Mc);(!Un.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{const l=lc(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${l.uid}${bt.CLIENT_INFO_SEPARATOR}${l.utid}`,type:on.HOME_ACCOUNT_ID}}catch(l){this.logger.verbose("Could not parse client info for CCS Header: "+l)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case on.HOME_ACCOUNT_ID:try{const l=ai(n.credential);t.addCcsOid(l)}catch(l){this.logger.verbose("Could not parse home account ID for CCS Header: "+l)}break;case on.UPN:t.addCcsUpn(n.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[up])&&t.addExtraQueryParameters({[up]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var s,l;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(s=this.performanceClient)==null||s.addQueueMeasurement(k.AuthClientCreateQueryString,t);const n=new la(t,this.performanceClient);n.addClientId(e.embeddedClientId||((l=e.extraQueryParameters)==null?void 0:l[mo])||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];if(n.addScopes(i,!0,this.oidcDefaultScopes),n.addRedirectUri(e.redirectUri),n.addCorrelationId(t),n.addResponseMode(e.responseMode),n.addResponseTypeCode(),n.addLibraryInfo(this.config.libraryInfo),md(this.config)||n.addApplicationTelemetry(this.config.telemetry.application),n.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&n.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&n.addPrompt(e.prompt),e.domainHint&&n.addDomainHint(e.domainHint),e.prompt!==dt.SELECT_ACCOUNT)if(e.sid&&e.prompt===dt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),n.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let f=this.extractLoginHint(e.account);if(f&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),f=null),f){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),n.addLoginHint(f);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===dt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),n.addSid(d);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{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"),n.addLoginHint(e.loginHint),n.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),n.addLoginHint(e.account.username);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{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"),n.addLoginHint(e.loginHint),n.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&n.addNonce(e.nonce),e.state&&n.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,n),e.nativeBroker&&(n.addNativeBroker(),e.authenticationScheme===Oe.POP)){const d=new mi(this.cryptoUtils);let f;e.popKid?f=this.cryptoUtils.encodeKid(e.popKid):f=(await F(d.generateCnf.bind(d),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(f)}return n.createQueryString()}createLogoutUrlQueryString(e){const t=new la(e.correlationId,this.performanceClient);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){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Ax=300;class yd extends dh{constructor(e,t){super(e,t)}async acquireToken(e){var l,d;(l=this.performanceClient)==null||l.addQueueMeasurement(k.RefreshTokenClientAcquireToken,e.correlationId);const t=or(),n=await F(this.executeTokenRequest.bind(this),k.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),i=(d=n.headers)==null?void 0:d[Pt.X_MS_REQUEST_ID],s=new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(n.body),F(s.handleServerTokenResponse.bind(s),k.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,i)}async acquireTokenByRefreshToken(e){var n;if(!e)throw Pe(Qy);if((n=this.performanceClient)==null||n.addQueueMeasurement(k.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw B(Jd);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){const s=i instanceof Fn&&i.errorCode===fc,l=i instanceof Gr&&i.errorCode===Jm.INVALID_GRANT_ERROR&&i.subError===Jm.CLIENT_MISMATCH_ERROR;if(s||l)return F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const n=_o(this.cacheManager.getRefreshToken.bind(this.cacheManager),k.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!n)throw vd(fc);if(n.expiresOn&&gd(n.expiresOn,e.refreshTokenExpirationOffsetSeconds||Ax))throw vd(hh);const i={...e,refreshToken:n.secret,authenticationScheme:e.authenticationScheme||Oe.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:on.HOME_ACCOUNT_ID}};try{return await F(this.acquireToken.bind(this),k.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(i)}catch(l){if(l instanceof Fn&&l.subError===Lc){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ii(n);this.cacheManager.removeRefreshToken(d)}throw l}}async executeTokenRequest(e,t){var f,g;(f=this.performanceClient)==null||f.addQueueMeasurement(k.RefreshTokenClientExecuteTokenRequest,e.correlationId);const n=this.createTokenQueryParameters(e),i=ye.appendQueryString(t.tokenEndpoint,n),s=await F(this.createTokenRequestBody.bind(this),k.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),l=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((g=e.tokenBodyParameters)==null?void 0:g.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 F(this.executePostToTokenEndpoint.bind(this),k.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(i,s,l,d,e.correlationId,k.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s,l;(i=this.performanceClient)==null||i.addQueueMeasurement(k.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,n=new la(t,this.performanceClient);if(n.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[mo])||this.config.authOptions.clientId),e.redirectUri&&n.addRedirectUri(e.redirectUri),n.addScopes(e.scopes,!0,(l=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),n.addGrantType(Sy.REFRESH_TOKEN_GRANT),n.addClientInfo(),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&!md(this.config)&&n.addServerTelemetry(this.serverTelemetryManager),n.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;n.addClientAssertion(await pC(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),n.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Oe.POP){const d=new mi(this.cryptoUtils,this.performanceClient);let f;e.popKid?f=this.cryptoUtils.encodeKid(e.popKid):f=(await F(d.generateCnf.bind(d),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(f)}else if(e.authenticationScheme===Oe.SSH)if(e.sshJwk)n.addSshJwk(e.sshJwk);else throw Pe(Mc);if((!Un.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case on.HOME_ACCOUNT_ID:try{const d=ai(e.ccsCredential.credential);n.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case on.UPN:n.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&n.addExtraQueryParameters(e.tokenBodyParameters),n.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class bx extends dh{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[n,i]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...yi]});return i===Br.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new yd(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),n}catch(n){if(n instanceof Oc&&n.errorCode===yr)return new yd(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw n}}async acquireCachedToken(e){var f;(f=this.performanceClient)==null||f.addQueueMeasurement(k.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Br.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Un.isEmptyObj(e.claims))throw this.setCacheOutcome(Br.FORCE_REFRESH_OR_CLAIMS,e.correlationId),B(yr);if(!e.account)throw B(Jd);const n=e.account.tenantId||mx(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,n,this.performanceClient,e.correlationId);if(s){if(tM(s.cachedAt)||gd(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Br.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),B(yr);s.refreshOn&&gd(s.refreshOn,0)&&(t=Br.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Br.NO_CACHED_ACCESS_TOKEN,e.correlationId),B(yr);const l=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,i,n,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(l)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await F(this.generateResultFromCacheRecord.bind(this),k.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var n,i;(n=this.serverTelemetryManager)==null||n.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},t),e!==Br.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(k.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let n;if(e.idToken&&(n=wo(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const s=n==null?void 0:n.auth_time;if(!s)throw B(Yd);zy(s,t.maxAge)}return po.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,n)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Ix={sendGetRequestAsync:()=>Promise.reject(B(ge)),sendPostRequestAsync:()=>Promise.reject(B(ge))};/*! @azure/msal-common v14.16.0 2024-11-05 */const gp=",",yC="|";function kx(r){const{skus:e,libraryName:t,libraryVersion:n,extensionName:i,extensionVersion:s}=r,l=new Map([[0,[t,n]],[2,[i,s]]]);let d=[];if(e!=null&&e.length){if(d=e.split(gp),d.length<4)return e}else d=Array.from({length:4},()=>yC);return l.forEach((f,g)=>{var m,v;f.length===2&&((m=f[0])!=null&&m.length)&&((v=f[1])!=null&&v.length)&&Rx({skuArr:d,index:g,skuName:f[0],skuVersion:f[1]})}),d.join(gp)}function Rx(r){const{skuArr:e,index:t,skuName:n,skuVersion:i}=r;t>=e.length||(e[t]=[n,i].join(yC))}class ma{constructor(e,t){this.cacheOutcome=Br.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||P.EMPTY_STRING,this.wrapperVer=e.wrapperVer||P.EMPTY_STRING,this.telemetryCacheKey=pt.CACHE_KEY+bt.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${pt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n!=null&&n.length&&t.push(`broker_error=${n}`);const i=t.join(pt.VALUE_SEPARATOR),s=this.getRegionDiscoveryFields(),l=[e,s].join(pt.VALUE_SEPARATOR);return[pt.SCHEMA_VERSION,l,i].join(pt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=ma.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*t).join(pt.VALUE_SEPARATOR),i=e.errors.slice(0,t).join(pt.VALUE_SEPARATOR),s=e.errors.length,l=t<s?pt.OVERFLOW_TRUE:pt.OVERFLOW_FALSE,d=[s,l].join(pt.VALUE_SEPARATOR);return[pt.SCHEMA_VERSION,e.cacheHits,n,i,d].join(pt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=pt.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 He?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(pt.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(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=ma.maxErrorsToSend(e),n=e.errors.length;if(t===n)this.cacheManager.removeItem(this.telemetryCacheKey);else{const i={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}}static maxErrorsToSend(e){let t,n=0,i=0;const s=e.errors.length;for(t=0;t<s;t++){const l=e.failedRequests[2*t]||P.EMPTY_STRING,d=e.failedRequests[2*t+1]||P.EMPTY_STRING,f=e.errors[t]||P.EMPTY_STRING;if(i+=l.toString().length+d.toString().length+f.length+3,i<pt.MAX_LAST_HEADER_BYTES)n+=1;else break}return n}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||P.EMPTY_STRING),e.push(this.regionSource||P.EMPTY_STRING),e.push(this.regionOutcome||P.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 kx(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const CC="missing_kid_error",wC="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const Ox={[CC]:"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.",[wC]:"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 gh extends He{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,gh.prototype)}}function mp(r){return new gh(r,Ox[r])}/*! @azure/msal-common v14.16.0 2024-11-05 */class mh{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw mp(CC);if(!e.alg)throw mp(wC);const t=new mh({typ:e.typ||V1.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class pp{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Nx{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:gx.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new pp}}startPerformanceMeasurement(){return new pp}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const ph="pkce_not_created",Cd="crypto_nonexistent",Bc="empty_navigate_uri",_C="hash_empty_error",vh="no_state_in_hash",TC="hash_does_not_contain_known_properties",EC="unable_to_parse_state",SC="state_interaction_type_mismatch",AC="interaction_in_progress",bC="popup_window_error",IC="empty_window_error",vo="user_cancelled",Px="monitor_popup_timeout",kC="monitor_window_timeout",RC="redirect_in_iframe",OC="block_iframe_reload",NC="block_nested_popups",Mx="iframe_closed_prematurely",Uc="silent_logout_unsupported",PC="no_account_error",xx="silent_prompt_value_error",MC="no_token_request_cache_error",xC="unable_to_parse_token_request_cache_error",yh="no_cached_authority_error",Dx="auth_request_not_set_error",Lx="invalid_cache_type",Vc="non_browser_environment",Zo="database_not_open",gc="no_network_connectivity",DC="post_request_failed",LC="get_request_failed",wd="failed_to_parse_response",BC="unable_to_load_token",Ch="crypto_key_not_found",UC="auth_code_required",VC="auth_code_or_nativeAccountId_required",FC="spa_code_and_nativeAccountId_present",wh="database_unavailable",HC="unable_to_acquire_token_from_native_platform",$C="native_handshake_timeout",KC="native_extension_not_installed",Sa="native_connection_not_established",zC="uninitialized_public_client_application",WC="native_prompt_not_supported",qC="invalid_base64_string",GC="invalid_pop_token_request",jC="failed_to_build_headers",YC="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const pr="For more visit: aka.ms/msaljs/browser-errors",Bx={[ph]:"The PKCE code challenge and verifier could not be generated.",[Cd]:"The crypto object or function is not available.",[Bc]:"Navigation URI is empty. Please check stack trace for more info.",[_C]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${pr}`,[vh]:"Hash does not contain state. Please verify that the request originated from msal.",[TC]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${pr}`,[EC]:"Unable to parse state. Please verify that the request originated from msal.",[SC]:"Hash contains state but the interaction type does not match the caller.",[AC]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${pr}`,[bC]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[IC]:"window.open returned null or undefined window object.",[vo]:"User cancelled the flow.",[Px]:`Token acquisition in popup failed due to timeout. ${pr}`,[kC]:`Token acquisition in iframe failed due to timeout. ${pr}`,[RC]:"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.",[OC]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${pr}`,[NC]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[Mx]:"The iframe being monitored was closed prematurely.",[Uc]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[PC]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[xx]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[MC]:"No token request found in cache.",[xC]:"The cached token request could not be parsed.",[yh]:"No cached authority found.",[Dx]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[Lx]:"Invalid cache type",[Vc]:"Login and token requests are not supported in non-browser environments.",[Zo]:"Database is not open!",[gc]:"No network connectivity. Check your internet connection.",[DC]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[LC]:"Network request failed. Please check the network trace to determine root cause.",[wd]:"Failed to parse network response. Check network trace.",[BC]:"Error loading token to cache.",[Ch]:"Cryptographic Key or Keypair not found in browser storage.",[UC]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[VC]:"An authorization code or nativeAccountId must be provided to this flow.",[FC]:"Request cannot contain both spa code and native account id.",[wh]:"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.",[HC]:`Unable to acquire token from native platform. ${pr}`,[$C]:"Timed out while attempting to establish connection to browser extension",[KC]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Sa]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${pr}`,[zC]:`You must call and await the initialize function before attempting to call any other MSAL API. ${pr}`,[WC]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[qC]:"Invalid base64 encoded string.",[GC]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[jC]:"Failed to build request headers object.",[YC]:"Failed to parse response headers"};class Aa extends He{constructor(e,t){super(e,Bx[e],t),Object.setPrototypeOf(this,Aa.prototype),this.name="BrowserAuthError"}}function G(r,e){return new Aa(r,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const tn={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"},si={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},uo={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ht={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},vp={GET:"GET",POST:"POST"},ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Lr={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Os={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},Le={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var J;(function(r){r.Redirect="redirect",r.Popup="popup",r.Silent="silent",r.None="none"})(J||(J={}));const yp={scopes:yi},JC="jwk",_d="msal.db",Ux=1,Vx=`${_d}.keys`,Zt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Fx=[Zt.Default,Zt.Skip,Zt.RefreshTokenAndNetwork],Hx="msal.browser.log.level",$x="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Ns(r){return encodeURIComponent(_h(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Fc(r){return QC(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function _h(r){return QC(new TextEncoder().encode(r))}function QC(r){const e=Array.from(r,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Kx="RSASSA-PKCS1-v1_5",XC="SHA-256",zx=2048,Wx=new Uint8Array([1,0,1]),Cp="0123456789abcdef",wp=new Uint32Array(1),qx="crypto_subtle_undefined",Th={name:Kx,hash:XC,modulusLength:zx,publicExponent:Wx};function Gx(r){if(!window)throw G(Vc);if(!window.crypto)throw G(Cd);if(!r&&!window.crypto.subtle)throw G(Cd,qx)}async function ZC(r,e,t){e==null||e.addQueueMeasurement(k.Sha256Digest,t);const i=new TextEncoder().encode(r);return window.crypto.subtle.digest(XC,i)}function jx(r){return window.crypto.getRandomValues(r)}function Uu(){return window.crypto.getRandomValues(wp),wp[0]}function Sr(){const r=Date.now(),e=Uu()*1024+(Uu()&1023),t=new Uint8Array(16),n=Math.trunc(e/2**30),i=e&2**30-1,s=Uu();t[0]=r/2**40,t[1]=r/2**32,t[2]=r/2**24,t[3]=r/2**16,t[4]=r/2**8,t[5]=r,t[6]=112|n>>>8,t[7]=n,t[8]=128|i>>>24,t[9]=i>>>16,t[10]=i>>>8,t[11]=i,t[12]=s>>>24,t[13]=s>>>16,t[14]=s>>>8,t[15]=s;let l="";for(let d=0;d<t.length;d++)l+=Cp.charAt(t[d]>>>4),l+=Cp.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(l+="-");return l}async function Yx(r,e){return window.crypto.subtle.generateKey(Th,r,e)}async function Vu(r){return window.crypto.subtle.exportKey(JC,r)}async function Jx(r,e,t){return window.crypto.subtle.importKey(JC,r,Th,e,t)}async function Qx(r,e){return window.crypto.subtle.sign(Th,r,e)}async function ew(r){const e=await ZC(r),t=new Uint8Array(e);return Fc(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const pa="storage_not_supported",Td="stubbed_public_client_application_called",mc="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const Gs={[pa]:"Given storage configuration option was not supported.",[Td]:"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",[mc]:"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."};Gs[pa],Gs[Td],Gs[mc];class Eh extends He{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Eh.prototype)}}function Sh(r){return new Eh(r,Gs[r])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Xx(r){r.location.hash="",typeof r.history.replaceState=="function"&&r.history.replaceState(null,"",`${r.location.origin}${r.location.pathname}${r.location.search}`)}function Zx(r){const e=r.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Ah(){return window.parent!==window}function eD(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${tn.POPUP_NAME_PREFIX}.`)===0}function Cr(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function tD(){const e=new ye(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function nD(){if(ye.hashContainsKnownProperties(window.location.hash)&&Ah())throw G(OC)}function rD(r){if(Ah()&&!r)throw G(RC)}function oD(){if(eD())throw G(NC)}function tw(){if(typeof window>"u")throw G(Vc)}function nw(r){if(!r)throw G(zC)}function bh(r){tw(),nD(),oD(),nw(r)}function _p(r,e){if(bh(r),rD(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ht.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Sh(mc)}function rw(r){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(r).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function iD(){return Sr()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pc{navigateInternal(e,t){return pc.defaultNavigateWindow(e,t)}navigateExternal(e,t){return pc.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(n=>{setTimeout(()=>{n(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class aD{async sendGetRequestAsync(e,t){let n,i={},s=0;const l=Tp(t);try{n=await fetch(e,{method:vp.GET,headers:l})}catch{throw G(window.navigator.onLine?LC:gc)}i=Ep(n.headers);try{return s=n.status,{headers:i,body:await n.json(),status:s}}catch{throw dp(G(wd),s,i)}}async sendPostRequestAsync(e,t){const n=t&&t.body||"",i=Tp(t);let s,l=0,d={};try{s=await fetch(e,{method:vp.POST,headers:i,body:n})}catch{throw G(window.navigator.onLine?DC:gc)}d=Ep(s.headers);try{return l=s.status,{headers:d,body:await s.json(),status:l}}catch{throw dp(G(wd),l,d)}}}function Tp(r){try{const e=new Headers;if(!(r&&r.headers))return e;const t=r.headers;return Object.entries(t).forEach(([n,i])=>{e.append(n,i)}),e}catch{throw G(jC)}}function Ep(r){try{const e={};return r.forEach((t,n)=>{e[n]=t}),e}catch{throw G(YC)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const sD=6e4,Ed=1e4,cD=3e4,lD=2e3;function uD({auth:r,cache:e,system:t,telemetry:n},i){const s={clientId:P.EMPTY_STRING,authority:`${P.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:P.EMPTY_STRING,authorityMetadata:P.EMPTY_STRING,redirectUri:typeof window<"u"?Cr():"",postLogoutRedirectUri:P.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Tr.AAD,OIDCOptions:{serverResponseType:Ea.FRAGMENT,defaultScopes:[P.OPENID_SCOPE,P.PROFILE_SCOPE,P.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:eh.None,tenant:P.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},l={cacheLocation:Ht.SessionStorage,temporaryCacheLocation:Ht.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Ht.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:xe.Info,piiLoggingEnabled:!1},g={...{...dC,loggerOptions:d,networkClient:i?new aD:Ix,navigationClient:new pc,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||sD,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Ed,navigateFrameWait:0,redirectNavigationTimeout:cD,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||lD,pollIntervalMilliseconds:tn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},m={application:{appName:P.EMPTY_STRING,appVersion:P.EMPTY_STRING},client:new Nx};if((r==null?void 0:r.protocolMode)!==Tr.OIDC&&(r!=null&&r.OIDCOptions)&&new qr(g.loggerOptions).warning(JSON.stringify(Pe(rC))),r!=null&&r.protocolMode&&r.protocolMode!==Tr.AAD&&(g!=null&&g.allowNativeBroker))throw Pe(oC);return{auth:{...s,...r,OIDCOptions:{...s.OIDCOptions,...r==null?void 0:r.OIDCOptions}},cache:{...l,...e},system:g,telemetry:{...m,...n}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dD="@azure/msal-browser",Hc="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ih{static loggerCallback(e,t){switch(e){case xe.Error:console.error(t);return;case xe.Info:console.info(t);return;case xe.Verbose:console.debug(t);return;case xe.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var f;this.browserEnvironment=typeof window<"u",this.config=uD(e,this.browserEnvironment);let t;try{t=window[Ht.SessionStorage]}catch{}const n=t==null?void 0:t.getItem(Hx),i=(f=t==null?void 0:t.getItem($x))==null?void 0:f.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,l={...this.config.system.loggerOptions},d=n&&Object.keys(xe).includes(n)?xe[n]:void 0;d&&(l.loggerCallback=Ih.loggerCallback,l.logLevel=d),s!==void 0&&(l.piiLoggingEnabled=s),this.logger=new qr(l,dD,Hc),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class yo extends Ih{getModuleName(){return yo.MODULE_NAME}getId(){return yo.ID}async initialize(){return this.available=typeof window<"u",this.available}}yo.MODULE_NAME="";yo.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function nr(r){return new TextDecoder().decode(hD(r))}function hD(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw G(qC)}const t=atob(e);return Uint8Array.from(t,n=>n.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fD{constructor(){this.dbName=_d,this.version=Ux,this.tableName=Vx,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const n=window.indexedDB.open(this.dbName,this.version);n.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),n.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),n.addEventListener("error",()=>t(G(wh)))})}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,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);l.addEventListener("success",d=>{const f=d;this.closeConnection(),t(f.target.result)}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((n,i)=>{if(!this.db)return i(G(Zo));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),n()}),d.addEventListener("error",f=>{this.closeConnection(),i(f)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);l.addEventListener("success",()=>{this.closeConnection(),t()}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(G(Zo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",l=>{const d=l;this.closeConnection(),e(d.target.result)}),s.addEventListener("error",l=>{this.closeConnection(),t(l)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);l.addEventListener("success",d=>{const f=d;this.closeConnection(),t(f.target.result===1)}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const n=window.indexedDB.deleteDatabase(_d),i=setTimeout(()=>t(!1),200);n.addEventListener("success",()=>(clearTimeout(i),e(!0))),n.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),n.addEventListener("error",()=>(clearTimeout(i),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Sd{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,n)=>{e.push(n)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gD{constructor(e){this.inMemoryCache=new Sd,this.indexedDBCache=new fD,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Aa&&e.errorCode===wh)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}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(n){this.handleDatabaseAccessError(n)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(n){this.handleDatabaseAccessError(n)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}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(n){this.handleDatabaseAccessError(n)}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.28.1 2025-01-14 */class pi{constructor(e,t,n){this.logger=e,Gx(n??!1),this.cache=new gD(this.logger),this.performanceClient=t}createNewGuid(){return Sr()}base64Encode(e){return _h(e)}base64Decode(e){return nr(e)}base64UrlEncode(e){return Ns(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var m;const t=(m=this.performanceClient)==null?void 0:m.startMeasurement(k.CryptoOptsGetPublicKeyThumbprint,e.correlationId),n=await Yx(pi.EXTRACTABLE,pi.POP_KEY_USAGES),i=await Vu(n.publicKey),s={e:i.e,kty:i.kty,n:i.n},l=Sp(s),d=await this.hashString(l),f=await Vu(n.privateKey),g=await Jx(f,!1,["sign"]);return await this.cache.setItem(d,{privateKey:g,publicKey:n.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!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,n,i){var U;const s=(U=this.performanceClient)==null?void 0:U.startMeasurement(k.CryptoOptsSignJwt,i),l=await this.cache.getItem(t);if(!l)throw G(Ch);const d=await Vu(l.publicKey),f=Sp(d),g=Ns(JSON.stringify({kid:t})),m=mh.getShrHeaderString({...n==null?void 0:n.header,alg:d.alg,kid:g}),v=Ns(m);e.cnf={jwk:JSON.parse(f)};const C=Ns(JSON.stringify(e)),S=`${v}.${C}`,b=new TextEncoder().encode(S),O=await Qx(l.privateKey,b),$=Fc(new Uint8Array(O)),V=`${S}.${$}`;return s&&s.end({success:!0}),V}async hashString(e){return ew(e)}}pi.POP_KEY_USAGES=["sign","verify"];pi.EXTRACTABLE=!0;function Sp(r){return JSON.stringify(r,Object.keys(r).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class mD{constructor(){if(!window.localStorage)throw Sh(pa)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pD{constructor(){if(!window.sessionStorage)throw Sh(pa)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function ow(r,e){if(!e)return null;try{return Vn.parseRequestState(r,e).libraryState.meta}catch{throw B(fi)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const vD=24*60*60*1e3;class yD{getItem(e){const t=`${encodeURIComponent(e)}`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){const s=n[i],[l,...d]=decodeURIComponent(s).trim().split("="),f=d.join("=");if(l===t)return f}return""}setItem(e,t,n,i=!0){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(n){const l=CD(n);s+=`expires=${l};`}i&&(s+="Secure;"),document.cookie=s}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(n=>{const i=decodeURIComponent(n).trim().split("=");t.push(i[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function CD(r){const e=new Date;return new Date(e.getTime()+r*vD).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ad extends gi{constructor(e,t,n,i,s,l){super(e,n,i,s),this.cacheConfig=t,this.logger=i,this.internalStorage=new Sd,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new yD,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=l}setupBrowserStorage(e){try{switch(e){case Ht.LocalStorage:return new mD;case Ht.SessionStorage:return new pD;case Ht.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=Ht.MemoryStorage,new Sd}migrateCacheEntries(){const e=`${P.CACHE_PREFIX}.${ct.ID_TOKEN}`,t=`${P.CACHE_PREFIX}.${ct.CLIENT_INFO}`,n=`${P.CACHE_PREFIX}.${ct.ERROR}`,i=`${P.CACHE_PREFIX}.${ct.ERROR_DESC}`,s=this.browserStorage.getItem(e),l=this.browserStorage.getItem(t),d=this.browserStorage.getItem(n),f=this.browserStorage.getItem(i),g=[s,l,d,f];[ct.ID_TOKEN,ct.CLIENT_INFO,ct.ERROR,ct.ERROR_DESC].forEach((v,C)=>{const S=g[C];S&&this.setTemporaryCache(v,S,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Lr.ACCOUNT_KEYS),t=this.getItem(`${Lr.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const l=this.validateAndParseJson(s);if(l&&l.hasOwnProperty("credentialType"))switch(l.credentialType){case ne.ID_TOKEN:if(tp(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.ID_TOKEN);return}else 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: ${i}`);break;case ne.ACCESS_TOKEN:case ne.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(ep(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.ACCESS_TOKEN);return}else 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: ${i}`);break;case ne.REFRESH_TOKEN:if(np(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.REFRESH_TOKEN);return}else 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: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const l=this.validateAndParseJson(s);l&&at.isAccountEntity(l)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{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 n=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,n,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const n=this.validateAndParseJson(t);return!n||!at.isAccountEntity(n)?(this.removeAccountKeyFromMap(e),null):gi.toObject(new at,n)}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(Lr.ACCOUNT_KEYS);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();t.indexOf(e)===-1?(t.push(e),this.setItem(Lr.ACCOUNT_KEYS,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(),n=t.indexOf(e);n>-1?(t.splice(n,1),this.setItem(Lr.ACCOUNT_KEYS,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,ne.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ne.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ne.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Lr.TOKEN_KEYS}.${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 n=this.getTokenKeys();switch(t){case ne.ID_TOKEN:n.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),n.idToken.push(e));break;case ne.ACCESS_TOKEN:n.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),n.accessToken.push(e));break;case ne.REFRESH_TOKEN:n.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),n.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),B(fd)}this.setItem(`${Lr.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(n))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const n=this.getTokenKeys();switch(t){case ne.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=n.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),n.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ne.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=n.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),n.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ne.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const l=n.refreshToken.indexOf(e);l>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),n.refreshToken.splice(l,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}`),B(fd)}this.setItem(`${Lr.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(n))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ID_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!tp(n)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),n)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ACCESS_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!ep(n)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),n)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.REFRESH_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!np(n)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),n)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const n=this.validateAndParseJson(t);return!n||!uM(e,n)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),n)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=lM(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 n=this.validateAndParseJson(t);return!n||!sM(e,n)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),n)}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 n=this.validateAndParseJson(t);return n&&dM(e,n)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),n):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Os.WRAPPER_SKU,e),this.internalStorage.setItem(Os.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Os.WRAPPER_SKU)||P.EMPTY_STRING,t=this.internalStorage.getItem(Os.WRAPPER_VER)||P.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(ct.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");const i=this.generateCacheKey(ct.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const l=this.getAccountInfoFilteredBy({localAccountId:s});return l?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(l),l):null}const n=this.validateAndParseJson(t);return n?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:n.homeAccountId,localAccountId:n.localAccountId,tenantId:n.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(ct.ACTIVE_ACCOUNT_FILTERS),n=this.generateCacheKey(ct.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(i)),this.browserStorage.setItem(n,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(n)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const n=this.validateAndParseJson(t);return!n||!cM(e,n)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),n)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const n=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const s=this.cookieStorage.getItem(n);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),s}const i=this.temporaryCacheStorage.getItem(n);if(!i){if(this.cacheConfig.cacheLocation===Ht.LocalStorage){const s=this.browserStorage.getItem(n);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}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}setTemporaryCache(e,t,n){const i=n?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(i,t,void 0,this.cacheConfig.secureCookies))}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.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(P.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(P.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(k.ClearTokensAndKeysWithClaims,t);const n=this.getTokenKeys(),i=[];n.accessToken.forEach(s=>{const l=this.getAccessTokenCredential(s);l!=null&&l.requestedClaimsHash&&s.includes(l.requestedClaimsHash.toLowerCase())&&i.push(this.removeAccessToken(s))}),await Promise.all(i),i.length>0&&this.logger.warning(`${i.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Un.startsWith(e,P.CACHE_PREFIX)||Un.startsWith(e,ct.ADAL_ID_TOKEN)?e:`${P.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),n=this.getTemporaryCache(t);if(!n)return null;const i=this.generateAuthorityKey(n);return this.getTemporaryCache(i)}updateCacheEntries(e,t,n,i,s){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const l=this.generateStateKey(e);this.setTemporaryCache(l,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const f=this.generateAuthorityKey(e);if(this.setTemporaryCache(f,n,!1),s){const g={credential:s.homeAccountId,type:on.HOME_ACCOUNT_ID};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(g),!0)}else if(i){const g={credential:i,type:on.UPN};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(g),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),n=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${n}`),this.resetRequestCache(n||P.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(ke.REQUEST_STATE)===-1)return;const n=this.temporaryCacheStorage.getItem(t);if(!n)return;const i=ow(this.cryptoImpl,n);i&&i.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${n}`),this.resetRequestCache(n))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=_h(JSON.stringify(e));this.setTemporaryCache(ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(ke.REQUEST_PARAMS,!0);if(!t)throw G(MC);let n;try{n=JSON.parse(nr(t))}catch(i){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${i}`),G(xC)}if(this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),!n.authority){const i=this.generateAuthorityKey(e),s=this.getTemporaryCache(i);if(!s)throw G(yh);n.authority=s}return n}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(ke.NATIVE_REQUEST,!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=`${P.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${P.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw G(AC);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(ct.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(ct.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(ct.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(ct.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const n=t||e;if(n){const i=wo(n,nr);if(i.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),i.preferred_username;if(i.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),i.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 n=ii(t);if(e!==n){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(n,i),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),n;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){var d,f,g;const n=Nc((d=e.account)==null?void 0:d.homeAccountId,(f=e.account)==null?void 0:f.environment,e.idToken,this.clientId,e.tenantId);let i;t.claims&&(i=await this.cryptoImpl.hashString(t.claims));const s=Pc((g=e.account)==null?void 0:g.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,nr,void 0,e.tokenType,void 0,t.sshKid,t.claims,i),l={idToken:n,accessToken:s};return this.saveCacheRecord(l)}async saveCacheRecord(e,t,n){try{await super.saveCacheRecord(e,t,n)}catch(i){if(i instanceof li&&this.performanceClient&&n)try{const s=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:s.refreshToken.length,cacheIdCount:s.idToken.length,cacheAtCount:s.accessToken.length},n)}catch{}throw i}}}const wD=(r,e)=>{const t={cacheLocation:Ht.MemoryStorage,temporaryCacheLocation:Ht.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Ad(r,t,cc,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function _D(r,e,t,n){return r.verbose("getAllAccounts called"),t?e.getAllAccounts(n):[]}function TD(r,e,t){if(e.trace("getAccount called"),Object.keys(r).length===0)return e.warning("getAccount: No accountFilter provided"),null;const n=t.getAccountInfoFilteredBy(r);return n?(e.verbose("getAccount: Account matching provided filter found, returning"),n):(e.verbose("getAccount: No matching account found, returning null"),null)}function ED(r,e,t){if(e.trace("getAccountByUsername called"),!r)return e.warning("getAccountByUsername: No username provided"),null;const n=t.getAccountInfoFilteredBy({username:r});return n?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${r}`),n):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function SD(r,e,t){if(e.trace("getAccountByHomeId called"),!r)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const n=t.getAccountInfoFilteredBy({homeAccountId:r});return n?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${r}`),n):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function AD(r,e,t){if(e.trace("getAccountByLocalId called"),!r)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const n=t.getAccountInfoFilteredBy({localAccountId:r});return n?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${r}`),n):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function bD(r,e){e.setActiveAccount(r)}function ID(r){return r.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const te={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.28.1 2025-01-14 */class kD{constructor(e){this.eventCallbacks=new Map,this.logger=e||new qr({})}addEventCallback(e,t,n){if(typeof window<"u"){const i=n||iD();return this.eventCallbacks.has(i)?(this.logger.error(`Event callback with id: ${i} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(i,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${i}`),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,n,i){if(typeof window<"u"){const s={eventType:e,interactionType:t||null,payload:n||null,error:i||null,timestamp:Date.now()};this.eventCallbacks.forEach(([l,d],f)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${f}: ${e}`),l.apply(null,[s]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class iw{constructor(e,t,n,i,s,l,d,f,g){this.config=e,this.browserStorage=t,this.browserCrypto=n,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=l,this.nativeMessageHandler=f,this.correlationId=g||Sr(),this.logger=i.clone(tn.MSAL_SKU,Hc,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){at.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(at.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{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{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;return ye.getAbsoluteUrl(t,Cr())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const n={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 ma(n,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,n=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(k.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={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},s=e.requestAuthority||this.config.auth.authority,l=n!=null&&n.length?n==="true":this.config.auth.instanceAware,d=t&&l?this.config.auth.authority.replace(ye.getDomainFromUrl(s),t.environment):s,f=St.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),g=await F(gC,k.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(f,this.config.system.networkClient,this.browserStorage,i,this.logger,this.correlationId,this.performanceClient);if(t&&!g.isAlias(t.environment))throw Pe(iC);return g}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const RD=32;async function OD(r,e,t){r.addQueueMeasurement(k.GeneratePkceCodes,t);const n=_o(ND,k.GenerateCodeVerifier,e,r,t)(r,e,t),i=await F(PD,k.GenerateCodeChallengeFromVerifier,e,r,t)(n,r,e,t);return{verifier:n,challenge:i}}function ND(r,e,t){try{const n=new Uint8Array(RD);return _o(jx,k.GetRandomValues,e,r,t)(n),Fc(n)}catch{throw G(ph)}}async function PD(r,e,t,n){e.addQueueMeasurement(k.GenerateCodeChallengeFromVerifier,n);try{const i=await F(ZC,k.Sha256Digest,t,e,n)(r,e,n);return Fc(new Uint8Array(i))}catch{throw G(ph)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function kh(r,e,t,n){t.addQueueMeasurement(k.InitializeBaseRequest,r.correlationId);const i=r.authority||e.auth.authority,s=[...r&&r.scopes||[]],l={...r,correlationId:r.correlationId,authority:i,scopes:s};if(!l.authenticationScheme)l.authenticationScheme=Oe.BEARER,n.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(l.authenticationScheme===Oe.SSH){if(!r.sshJwk)throw Pe(Mc);if(!r.sshKid)throw Pe(nC)}n.verbose(`Authentication Scheme set to "${l.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&r.claims&&!Un.isEmptyObj(r.claims)&&(l.requestedClaimsHash=await ew(r.claims)),l}async function MD(r,e,t,n,i){n.addQueueMeasurement(k.InitializeSilentRequest,r.correlationId);const s=await F(kh,k.InitializeBaseRequest,i,n,r.correlationId)(r,t,n,i);return{...r,...s,account:e,forceRefresh:r.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ci extends iw{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await F(OD,k.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),n={...e,redirectUri:e.redirectUri,code:P.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=P.S256_CODE_CHALLENGE_METHOD,n}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||Sr(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const n=this.getLogoutHintFromIdTokenClaims(e.account);n&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=n)}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||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=ye.getAbsoluteUrl(e.postLogoutRedirectUri,Cr())):this.config.auth.postLogoutRedirectUri===null?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=ye.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Cr())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=ye.getAbsoluteUrl(Cr(),Cr())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),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(k.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new vC(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:n,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:l}=e;this.performanceClient.addQueueMeasurement(k.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await F(this.getDiscoveredAuthority.bind(this),k.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:n,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:l}),f=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:f.loggerCallback,piiLoggingEnabled:f.piiLoggingEnabled,logLevel:f.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:tn.MSAL_SKU,version:Hc,cpu:P.EMPTY_STRING,os:P.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(k.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const n=this.getRedirectUri(e.redirectUri),i={interactionType:t},s=Vn.setRequestState(this.browserCrypto,e&&e.state||P.EMPTY_STRING,i),d={...await F(kh,k.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:n,state:s,nonce:e.nonce||Sr(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const f=e.account||this.browserStorage.getActiveAccount();if(f&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${f.homeAccountId}`,this.correlationId),d.account=f),!d.loginHint&&!f){const g=this.browserStorage.getLegacyLoginHint();g&&(d.loginHint=g)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const xD="ContentError",aw="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const DD="USER_INTERACTION_REQUIRED",LD="USER_CANCEL",BD="NO_NETWORK",UD="PERSISTENT_ERROR",VD="DISABLED",FD="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const HD=-2147186943,$D={[aw]:"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 Qn extends He{constructor(e,t,n){super(e,t),Object.setPrototypeOf(this,Qn.prototype),this.name="NativeAuthError",this.ext=n}}function ei(r){if(r.ext&&r.ext.status&&(r.ext.status===UD||r.ext.status===VD)||r.ext&&r.ext.error&&r.ext.error===HD)return!0;switch(r.errorCode){case xD:return!0;default:return!1}}function bd(r,e,t){if(t&&t.status)switch(t.status){case FD:return vd(mC);case DD:return new Fn(r,e);case LD:return G(vo);case BD:return G(gc)}return new Qn(r,$D[r]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class sw extends Ci{async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(Le.acquireTokenSilent_silentFlow),n=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new bx(n,this.performanceClient);this.logger.verbose("Silent auth client created");try{const l=(await F(i.acquireCachedToken.bind(i),k.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),l}catch(s){throw s instanceof Aa&&s.errorCode===Ch&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ui extends iw{constructor(e,t,n,i,s,l,d,f,g,m,v,C){var _;super(e,t,n,i,s,l,f,g,C),this.apiId=d,this.accountId=m,this.nativeMessageHandler=g,this.nativeStorageManager=v,this.silentCacheClient=new sw(e,this.nativeStorageManager,n,i,s,l,f,g,C),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const S=this.nativeMessageHandler.getExtensionId()===si.PREFERRED_EXTENSION_ID?"chrome":(_=this.nativeMessageHandler.getExtensionId())!=null&&_.length?"unknown":void 0;this.skus=ma.makeExtraSkuString({libraryName:tn.MSAL_SKU,libraryVersion:Hc,extensionName:S,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[lx]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(k.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(k.NativeInteractionClientAcquireToken,e.correlationId),n=or();try{const i=await this.initializeNativeRequest(e);try{const g=await this.acquireTokensFromCache(this.accountId,i);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),g}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...s}=i,l={method:uo.GetToken,request:s},d=await this.nativeMessageHandler.sendMessage(l),f=this.validateNativeResponse(d);return await this.handleNativeResponse(f,i,n).then(g=>(t.end({success:!0,isNativeBroker:!0,requestId:g.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),g)).catch(g=>{throw t.end({success:!1,errorCode:g.errorCode,subErrorCode:g.subError,isNativeBroker:!0}),g})}catch(i){throw i instanceof Qn&&this.serverTelemetryManager.setNativeBrokerErrorCode(i.errorCode),i}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Je.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),B(dd);const n=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!n)throw B(dd);try{const i=this.createSilentCacheRequest(t,n),s=await this.silentCacheClient.acquireToken(i),l={...n,idTokenClaims:s==null?void 0:s.idTokenClaims,idToken:s==null?void 0:s.idToken};return{...s,account:l}}catch(i){throw i}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...n}=e;delete n.onRedirectNavigate;const i=await this.initializeNativeRequest(n),s={method:uo.GetToken,request:i};try{const f=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(f)}catch(f){if(f instanceof Qn&&(this.serverTelemetryManager.setNativeBrokerErrorCode(f.errorCode),ei(f)))throw f}this.browserStorage.setTemporaryCache(ke.NATIVE_REQUEST,JSON.stringify(i),!0);const l={apiId:Le.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,l)}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 n=this.browserStorage.getCachedNativeRequest();if(!n)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:i,...s}=n;i&&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(ke.NATIVE_REQUEST));const l={method:uo.GetToken,request:s},d=or();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const f=await this.nativeMessageHandler.sendMessage(l);this.validateNativeResponse(f);const g=this.handleNativeResponse(f,s,d);this.browserStorage.setInteractionInProgress(!1);const m=await g;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),m}catch(f){throw this.browserStorage.setInteractionInProgress(!1),f}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,n){var m;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const i=wo(e.id_token,nr),s=this.createHomeAccountIdentifier(e,i),l=(m=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:m.homeAccountId;if(s!==l&&e.account.id!==t.accountId)throw bd(aw);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),f=fh(this.browserStorage,d,s,nr,i,e.client_info,void 0,i.tid,void 0,e.account.id,this.logger),g=await this.generateAuthenticationResult(e,t,i,f,d.canonicalAuthority,n);return this.cacheAccount(f),this.cacheNativeTokens(e,t,s,i,e.access_token,g.tenantId,n),g}createHomeAccountIdentifier(e,t){return at.generateHomeAccountId(e.client_info||P.EMPTY_STRING,Dn.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Je.fromString(e.scope):Je.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Oe.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const n=new mi(this.browserCrypto),i={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw B(Xd);return n.signPopToken(e.access_token,t.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,t,n,i,s,l){const d=this.addTelemetryFromNativeResponse(e),f=e.scope?Je.fromString(e.scope):Je.fromString(t.scope),g=e.account.properties||{},m=g.UID||n.oid||n.sub||P.EMPTY_STRING,v=g.TenantId||n.tid||P.EMPTY_STRING,C=sh(i.getAccountInfo(),void 0,n,e.id_token);C.nativeAccountId!==e.account.id&&(C.nativeAccountId=e.account.id);const S=await this.generatePopAccessToken(e,t),_=t.tokenType===Oe.POP?Oe.POP:Oe.BEARER;return{authority:s,uniqueId:m,tenantId:v,scopes:f.asArray(),account:C,idToken:e.id_token,idTokenClaims:n,accessToken:S,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(l+e.expires_in)*1e3),tokenType:_,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,n,i,s,l,d){const f=Nc(n,t.authority,e.id_token||"",t.clientId,i.tid||""),g=t.tokenType===Oe.POP?P.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,m=d+g,v=this.generateScopes(e,t),C=Pc(n,t.authority,s,t.clientId,i.tid||l,v.printScopes(),m,0,nr,void 0,t.tokenType,void 0,t.keyId),S={idToken:f,accessToken:C};this.nativeStorageManager.saveCacheRecord(S,t.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 Ay(qd,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(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 n=new ye(t);n.validateAsUri();const{scopes:i,...s}=e,l=new Je(i||[]);l.appendScopes(yi);const d=()=>{switch(this.apiId){case Le.ssoSilent:case Le.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),dt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case dt.NONE:case dt.CONSENT:case dt.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`),G(WC)}},f={...s,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:l.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(f.signPopToken&&e.popKid)throw G(GC);if(this.handleExtraBrokerParams(f),f.extraParameters=f.extraParameters||{},f.extraParameters.telemetry=si.MATS_TELEMETRY,e.authenticationScheme===Oe.POP){const g={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},m=new mi(this.browserCrypto);let v;if(f.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:f.keyId})),f.signPopToken=!1;else{const C=await F(m.generateCnf.bind(m),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(g,this.logger);v=C.reqCnfString,f.keyId=C.kid,f.signPopToken=!0}f.reqCnf=v}return this.addRequestSKUs(f),f}handleExtraBrokerParams(e){var s;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(uh)&&e.extraParameters.hasOwnProperty(pd)&&e.extraParameters.hasOwnProperty(mo);if(!e.embeddedClientId&&!t)return;let n="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,n=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[pd],n=e.extraParameters[mo]),e.extraParameters={child_client_id:n,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:n,embeddedRedirectUri:i},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Xn{constructor(e,t,n,i){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=n,this.handshakeEvent=n.startMeasurement(k.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:si.CHANNEL_ID,extensionId:this.extensionId,responseId:Sr(),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((n,i)=>{this.resolvers.set(t.responseId,{resolve:n,reject:i})})}static async createProvider(e,t,n){e.trace("NativeMessageHandler - createProvider called.");try{const i=new Xn(e,t,n,si.PREFERRED_EXTENSION_ID);return await i.sendHandshakeRequest(),i}catch{const s=new Xn(e,t,n);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:si.CHANNEL_ID,extensionId:this.extensionId,responseId:Sr(),body:{method:uo.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,n)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:n}),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}),n(G($C)),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!==si.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===uo.HandshakeRequest){const n=this.handshakeResolvers.get(t.responseId);if(!n){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}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}),n.reject(G(KC))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,n=this.resolvers.get(t.responseId),i=this.handshakeResolvers.get(t.responseId);try{const s=t.body.method;if(s===uo.Response){if(!n)return;const l=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(l)}`),l.status!=="Success")n.reject(bd(l.code,l.description,l.ext));else if(l.result)l.result.code&&l.result.description?n.reject(bd(l.result.code,l.result.description,l.result.ext)):n.resolve(l.result);else throw Ay(qd,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(s===uo.HandshakeResponse){if(!i){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);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.end({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${s}`),this.logger.errorPii(`Unable to parse ${e}`),n?n.reject(s):i&&i.reject(s)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,n,i){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!n)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Oe.BEARER:case Oe.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.28.1 2025-01-14 */class Rh{constructor(e,t,n,i,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=n,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(k.HandleCodeResponse,t.correlationId);let n;try{n=this.authModule.handleFragmentResponse(e,t.state)}catch(i){throw i instanceof Gr&&i.subError===vo?G(vo):i}return F(this.handleCodeResponseFromServer.bind(this),k.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(n,t)}async handleCodeResponseFromServer(e,t,n=!0){if(this.performanceClient.addQueueMeasurement(k.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await F(this.authModule.updateAuthority.bind(this.authModule),k.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),n&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const s=this.createCcsCredentials(t);s&&(this.authCodeRequest.ccsCredential=s)}return await F(this.authModule.acquireToken.bind(this.authModule),k.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:on.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:on.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function cw(r,e,t){const n=dc(r);if(!n)throw sC(r)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${r}`),G(TC)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),G(_C));return n}function KD(r,e,t){if(!r.state)throw G(vh);const n=ow(e,r.state);if(!n)throw G(EC);if(n.interactionType!==t)throw G(SC)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class zD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,d,g,m),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=f}acquireToken(e){try{const n={popupName:this.generatePopupName(e.scopes||yi,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,n)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),n.popup=this.openSizedPopup("about:blank",n),this.acquireTokenPopupAsync(e,n))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),n={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,n,i,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),n.popup=this.openSizedPopup("about:blank",n),this.logoutPopupAsync(t,n,i,s))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var s;this.logger.verbose("acquireTokenPopupAsync called");const n=this.initializeServerTelemetryManager(Le.acquireTokenPopup),i=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,J.Popup);rw(i.authority);try{const l=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(i),d=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),f=Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let g;f&&(g=this.performanceClient.startMeasurement(k.FetchAccountIdWithNativeBroker,e.correlationId));const m=await d.getAuthCodeUrl({...i,nativeBroker:f}),v=new Rh(d,this.browserStorage,l,this.logger,this.performanceClient),C=this.initiateAuthRequest(m,t);this.eventHandler.emitEvent(te.POPUP_OPENED,J.Popup,{popupWindow:C},null);const S=await this.monitorPopupForHash(C,t.popupWindowParent),_=_o(cw,k.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(S,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Jn.removeThrottle(this.browserStorage,this.config.auth.clientId,l),_.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),g&&g.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw G(Sa);const O=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,_.accountId,this.nativeStorage,i.correlationId),{userRequestState:$}=Vn.parseRequestState(this.browserCrypto,i.state);return await O.acquireToken({...i,state:$,prompt:void 0})}return await v.handleCodeResponse(_,i)}catch(l){throw(s=t.popup)==null||s.close(),l instanceof He&&(l.setCorrelationId(this.correlationId),n.cacheFailedRequest(l)),l}}async logoutPopupAsync(e,t,n,i){var l,d,f,g;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(te.LOGOUT_START,J.Popup,e);const s=this.initializeServerTelemetryManager(Le.logoutPopup);try{await this.clearCacheOnLogout(e.account);const m=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:n,account:e.account||void 0});try{m.authority.endSessionEndpoint}catch{if((l=e.account)!=null&&l.homeAccountId&&e.postLogoutRedirectUri&&m.authority.protocolMode===Tr.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Popup,e),i){const S={apiId:Le.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},_=ye.getAbsoluteUrl(i,Cr());await this.navigationClient.navigateInternal(_,S)}(f=t.popup)==null||f.close();return}}const v=m.getLogoutUri(e);this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Popup,e);const C=this.openPopup(v,t);if(this.eventHandler.emitEvent(te.POPUP_OPENED,J.Popup,{popupWindow:C},null),await this.monitorPopupForHash(C,t.popupWindowParent).catch(()=>{}),i){const S={apiId:Le.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},_=ye.getAbsoluteUrl(i,Cr());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${_}`),await this.navigationClient.navigateInternal(_,S)}else this.logger.verbose("No main window navigation requested")}catch(m){throw(g=t.popup)==null||g.close(),m instanceof He&&(m.setCorrelationId(this.correlationId),s.cacheFailedRequest(m)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(te.LOGOUT_FAILURE,J.Popup,null,m),this.eventHandler.emitEvent(te.LOGOUT_END,J.Popup),m}this.eventHandler.emitEvent(te.LOGOUT_END,J.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"),G(Bc)}monitorPopupForHash(e,t){return new Promise((n,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),i(G(vo));return}let l="";try{l=e.location.href}catch{}if(!l||l==="about:blank")return;clearInterval(s);let d="";const f=this.config.auth.OIDCOptions.serverResponseType;e&&(f===Ea.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),n(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let n;if(t.popup?(n=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),n.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),n=this.openSizedPopup(e,t)),!n)throw G(IC);return n.focus&&n.focus(),this.currentWindow=n,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),n}catch(n){throw this.logger.error("error opening popup "+n.message),this.browserStorage.setInteractionInProgress(!1),G(bC)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:n,popupWindowParent:i}){var S,_,b,O;const s=i.screenLeft?i.screenLeft:i.screenX,l=i.screenTop?i.screenTop:i.screenY,d=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let g=(S=n.popupSize)==null?void 0:S.width,m=(_=n.popupSize)==null?void 0:_.height,v=(b=n.popupPosition)==null?void 0:b.top,C=(O=n.popupPosition)==null?void 0:O.left;return(!g||g<0||g>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),g=tn.POPUP_WIDTH),(!m||m<0||m>f)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),m=tn.POPUP_HEIGHT),(!v||v<0||v>f)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,f/2-tn.POPUP_HEIGHT/2+l)),(!C||C<0||C>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),C=Math.max(0,d/2-tn.POPUP_WIDTH/2+s)),i.open(e,t,`width=${g}, height=${m}, top=${v}, left=${C}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(J.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${tn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${tn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ap{constructor(e,t,n,i,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=n,this.logger=i,this.performanceClient=s}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(ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const n={apiId:Le.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,n);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,n);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),G(Bc)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const n=this.browserStorage.generateStateKey(t),i=this.browserStorage.getTemporaryCache(n);if(!i)throw B(sc,"Cached State");let s;try{s=this.authModule.handleFragmentResponse(e,i)}catch(g){throw g instanceof Gr&&g.subError===vo?G(vo):g}const l=this.browserStorage.generateNonceKey(i),d=this.browserStorage.getTemporaryCache(l);if(this.authCodeRequest.code=s.code,s.cloud_instance_host_name&&await F(this.authModule.updateAuthority.bind(this.authModule),k.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(s.cloud_instance_host_name,this.authCodeRequest.correlationId),s.nonce=d||void 0,s.state=i,s.client_info)this.authCodeRequest.clientInfo=s.client_info;else{const g=this.checkCcsCredentials();g&&(this.authCodeRequest.ccsCredential=g)}const f=await this.authModule.acquireToken(this.authCodeRequest,s);return this.browserStorage.cleanRequestByState(t),f}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{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.28.1 2025-01-14 */function WD(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const r=window.performance.getEntriesByType("navigation"),e=r.length?r[0]:void 0;return e==null?void 0:e.type}class qD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,d,g,m),this.nativeStorage=f}async acquireToken(e){const t=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,J.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const n=this.initializeServerTelemetryManager(Le.acquireTokenRedirect),i=s=>{s.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(te.RESTORE_FROM_BFCACHE,J.Redirect))};try{const s=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),l=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new Ap(l,this.browserStorage,s,this.logger,this.performanceClient),f=await l.getAuthCodeUrl({...t,nativeBroker:Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),g=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${g}`),window.addEventListener("pageshow",i),await d.initiateAuthRequest(f,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:g,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(s){throw s instanceof He&&(s.setCorrelationId(this.correlationId),n.cacheFailedRequest(s)),window.removeEventListener("pageshow",i),this.browserStorage.cleanRequestByState(t.state),s}}async handleRedirectPromise(e="",t){const n=this.initializeServerTelemetryManager(Le.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,s]=this.getRedirectResponse(e||"");if(!i)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(J.Redirect),WD()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const l=this.browserStorage.getTemporaryCache(ke.ORIGIN_URI,!0)||P.EMPTY_STRING,d=ye.removeHashFromUrl(l),f=ye.removeHashFromUrl(window.location.href);if(d===f&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),l.indexOf("#")>-1&&Zx(l),await this.handleResponse(i,n);if(this.config.auth.navigateToLoginRequestUrl){if(!Ah()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(ke.URL_HASH,s,!0);const g={apiId:Le.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let m=!0;if(!l||l==="null"){const v=tD();this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),m=await this.navigationClient.navigateInternal(v,g)}else this.logger.verbose(`Navigating to loginRequestUrl: ${l}`),m=await this.navigationClient.navigateInternal(l,g);if(!m)return await this.handleResponse(i,n)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(i,n);return null}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i)),this.browserStorage.cleanRequestByInteractionType(J.Redirect),i}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Ea.QUERY?t=window.location.search:t=window.location.hash);let n=dc(t);if(n){try{KD(n,this.browserCrypto,J.Redirect)}catch(s){return s instanceof He&&this.logger.error(`Interaction type validation failed due to ${s.errorCode}: ${s.errorMessage}`),[null,""]}return Xx(window),this.logger.verbose("Hash contains known properties, returning response hash"),[n,t]}const i=this.browserStorage.getTemporaryCache(ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.URL_HASH)),i&&(n=dc(i),n)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[n,i]):[null,""]}async handleResponse(e,t){const n=e.state;if(!n)throw G(vh);const i=this.browserStorage.getCachedRequest(n);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 G(Sa);const f=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,i.correlationId),{userRequestState:g}=Vn.parseRequestState(this.browserCrypto,n);return f.acquireToken({...i,state:g,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(n)})}const s=this.browserStorage.getCachedAuthority(n);if(!s)throw G(yh);const l=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:s});return Jn.removeThrottle(this.browserStorage,this.config.auth.clientId,i),new Ap(l,this.browserStorage,i,this.logger,this.performanceClient).handleCodeResponse(e,n)}async logout(e){var i,s;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),n=this.initializeServerTelemetryManager(Le.logout);try{this.eventHandler.emitEvent(te.LOGOUT_START,J.Redirect,e),await this.clearCacheOnLogout(t.account);const l={apiId:Le.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===Tr.OIDC)try{d.authority.endSessionEndpoint}catch{if((i=t.account)!=null&&i.homeAccountId){this.browserStorage.removeAccount((s=t.account)==null?void 0:s.homeAccountId),this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Redirect,t);return}}const f=d.getLogoutUri(t);if(this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(f)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(f,l);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(f,l);return}}catch(l){throw l instanceof He&&(l.setCorrelationId(this.correlationId),n.cacheFailedRequest(l)),this.eventHandler.emitEvent(te.LOGOUT_FAILURE,J.Redirect,null,l),this.eventHandler.emitEvent(te.LOGOUT_END,J.Redirect),l}this.eventHandler.emitEvent(te.LOGOUT_END,J.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return ye.getAbsoluteUrl(t,Cr())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function GD(r,e,t,n,i){if(e.addQueueMeasurement(k.SilentHandlerInitiateAuthRequest,n),!r)throw t.info("Navigate url is empty"),G(Bc);return i?F(YD,k.SilentHandlerLoadFrame,t,e,n)(r,i,e,n):_o(JD,k.SilentHandlerLoadFrameSync,t,e,n)(r)}async function jD(r,e,t,n,i,s,l){return n.addQueueMeasurement(k.SilentHandlerMonitorIframeForHash,s),new Promise((d,f)=>{e<Ed&&i.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Ed}ms). This may result in timeouts.`);const g=window.setTimeout(()=>{window.clearInterval(m),f(G(kC))},e),m=window.setInterval(()=>{let v="";const C=r.contentWindow;try{v=C?C.location.href:""}catch{}if(!v||v==="about:blank")return;let S="";C&&(l===Ea.QUERY?S=C.location.search:S=C.location.hash),window.clearTimeout(g),window.clearInterval(m),d(S)},t)}).finally(()=>{_o(QD,k.RemoveHiddenIframe,i,n,s)(r)})}function YD(r,e,t,n){return t.addQueueMeasurement(k.SilentHandlerLoadFrame,n),new Promise((i,s)=>{const l=lw();window.setTimeout(()=>{if(!l){s("Unable to load iframe");return}l.src=r,i(l)},e)})}function JD(r){const e=lw();return e.src=r,e}function lw(){const r=document.createElement("iframe");return r.className="msalSilentIframe",r.style.visibility="hidden",r.style.position="absolute",r.style.width=r.style.height="0",r.style.border="0",r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(r),r}function QD(r){document.body===r.parentNode&&document.body.removeChild(r)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class XD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m,v){super(e,t,n,i,s,l,f,m,v),this.apiId=d,this.nativeStorage=g}async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==dt.NONE&&t.prompt!==dt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${dt.NONE}`),t.prompt=dt.NONE):t.prompt=dt.NONE;const n=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,J.Silent);rw(n.authority);const i=this.initializeServerTelemetryManager(this.apiId);let s;try{return s=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),await F(this.silentTokenHelper.bind(this),k.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(l){if(l instanceof He&&(l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l)),!s||!(l instanceof He)||l.errorCode!==tn.INVALID_GRANT_ERROR)throw l;this.performanceClient.addFields({retryError:l.errorCode},this.correlationId);const d=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,J.Silent);return await F(this.silentTokenHelper.bind(this),k.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(s,d)}}logout(){return Promise.reject(G(Uc))}async silentTokenHelper(e,t){const n=t.correlationId;this.performanceClient.addQueueMeasurement(k.SilentIframeClientTokenHelper,n);const i=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,n)(t),s=await F(e.getAuthCodeUrl.bind(e),k.GetAuthCodeUrl,this.logger,this.performanceClient,n)({...t,nativeBroker:Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),l=new Rh(e,this.browserStorage,i,this.logger,this.performanceClient),d=await F(GD,k.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(s,this.performanceClient,this.logger,n,this.config.system.navigateFrameWait),f=this.config.auth.OIDCOptions.serverResponseType,g=await F(jD,k.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,f),m=_o(cw,k.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(g,f,this.logger);if(m.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw G(Sa);const v=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,m.accountId,this.browserStorage,n),{userRequestState:C}=Vn.parseRequestState(this.browserCrypto,t.state);return F(v.acquireToken.bind(v),k.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,n)({...t,state:C,prompt:t.prompt||dt.NONE})}return F(l.handleCodeResponse.bind(l),k.HandleCodeResponse,this.logger,this.performanceClient,n)(m,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ZD extends Ci{async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentRefreshClientAcquireToken,e.correlationId);const t=await F(kh,k.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),n={...e,...t};e.redirectUri&&(n.redirectUri=this.getRedirectUri(e.redirectUri));const i=this.initializeServerTelemetryManager(Le.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:n.authority,azureCloudOptions:n.azureCloudOptions,account:n.account});return F(s.acquireTokenByRefreshToken.bind(s),k.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(n).catch(l=>{throw l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),l})}logout(){return Promise.reject(G(Uc))}async createRefreshTokenClient(e){const t=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new yd(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class eL{constructor(e,t,n,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=n,this.cryptoObj=i}loadExternalTokens(e,t,n){if(!this.isBrowserEnvironment)throw G(Vc);const i=t.id_token?wo(t.id_token,nr):void 0,s={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},l=e.authority?new St(St.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Sr()):void 0,d=this.loadAccount(e,n.clientInfo||t.client_info||"",i,l),f=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),g=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,n),m=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:f,accessToken:g,refreshToken:m},i,l)}loadAccount(e,t,n,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const f=at.createFromAccountInfo(e.account);return this.storage.setAccount(f),f}else if(!i||!t&&!n)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),G(BC);const s=at.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,n),l=n==null?void 0:n.tid,d=fh(this.storage,i,s,nr,n,t,i.hostnameAndPort,l,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,n,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Nc(t,n,e.id_token,this.config.auth.clientId,i);return this.storage.setIdTokenCredential(s),s}loadAccessToken(e,t,n,i,s,l){if(t.access_token)if(t.expires_in){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}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?Je.fromString(t.scope):new Je(e.scopes),f=l.expiresOn||t.expires_in+new Date().getTime()/1e3,g=l.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,m=Pc(n,i,t.access_token,this.config.auth.clientId,s,d.printScopes(),f,g,nr);return this.storage.setAccessTokenCredential(m),m}loadRefreshToken(e,t,n){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Wy(t,n,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i),i}generateAuthenticationResult(e,t,n,i){var m,v,C;let s="",l=[],d=null,f;t!=null&&t.accessToken&&(s=t.accessToken.secret,l=Je.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),f=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const g=t.account;return{authority:i?i.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:l,account:g.getAccountInfo(),idToken:((m=t.idToken)==null?void 0:m.secret)||"",idTokenClaims:n||{},accessToken:s,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:f,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((C=t==null?void 0:t.accessToken)==null?void 0:C.tokenType)||"",state:e.state||"",cloudGraphHostName:g.cloudGraphHostName||"",msGraphHost:g.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class tL extends vC{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class nL extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,f,g,m),this.apiId=d}async acquireToken(e){if(!e.code)throw G(UC);const t=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,J.Silent),n=this.initializeServerTelemetryManager(this.apiId);try{const i={...t,code:e.code},s=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),l=new tL(s);this.logger.verbose("Auth code client created");const d=new Rh(l,this.browserStorage,i,this.logger,this.performanceClient);return await F(d.handleCodeResponseFromServer.bind(d),k.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i)),i}}logout(){return Promise.reject(G(Uc))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Gn(r){const e=r==null?void 0:r.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Ps(r,e){try{bh(r)}catch(t){throw e.end({success:!1},t),t}}class $c{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 pi(this.logger,this.performanceClient):cc,this.eventHandler=new kD(this.logger),this.browserStorage=this.isBrowserEnvironment?new Ad(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,px(this.config.auth),this.performanceClient):wD(this.config.auth.clientId,this.logger);const t={cacheLocation:Ht.MemoryStorage,temporaryCacheLocation:Ht.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Ad(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new eL(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 n=new $c(e);return await n.initialize(t),n}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){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(te.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),n=this.config.system.allowNativeBroker,i=this.performanceClient.startMeasurement(k.InitializeClientApplication,t);if(this.eventHandler.emitEvent(te.INITIALIZE_START),n)try{this.nativeExtensionProvider=await Xn.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(s){this.logger.verbose(s)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await F(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),k.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(te.INITIALIZE_END),i.end({allowNativeBroker:n,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),nw(this.initialized),this.isBrowserEnvironment){const t=e||"";let n=this.redirectResponse.get(t);return typeof n>"u"?(n=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,n),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"),n}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),n=this.browserStorage.getCachedNativeRequest(),i=n&&Xn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,s=i?n==null?void 0:n.correlationId:this.browserStorage.getTemporaryCache(ke.CORRELATION_ID,!0)||"",l=this.performanceClient.startMeasurement(k.AcquireTokenRedirect,s);this.eventHandler.emitEvent(te.HANDLE_REDIRECT_START,J.Redirect);let d;if(i&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const f=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,n.accountId,this.nativeInternalStorage,n.correlationId);d=F(f.handleRedirectPromise.bind(f),k.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,l.event.correlationId)(this.performanceClient,l.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const f=this.createRedirectClient(s);d=F(f.handleRedirectPromise.bind(f),k.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,l.event.correlationId)(e,l)}return d.then(f=>(f?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(te.LOGIN_SUCCESS,J.Redirect,f),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Redirect,f),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),l.end({success:!0,accountType:Gn(f.account)})):l.event.errorCode?l.end({success:!1}):l.discard(),this.eventHandler.emitEvent(te.HANDLE_REDIRECT_END,J.Redirect),f)).catch(f=>{const g=f;throw t.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Redirect,null,g):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Redirect,null,g),this.eventHandler.emitEvent(te.HANDLE_REDIRECT_END,J.Redirect),l.end({success:!1},g),f})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const n=this.performanceClient.startMeasurement(k.AcquireTokenPreRedirect,t);n.add({accountType:Gn(e.account),scenarioId:e.scenarioId});const i=e.onRedirectNavigate;if(i)e.onRedirectNavigate=l=>{const d=typeof i=="function"?i(l):void 0;return d!==!1?n.end({success:!0}):n.discard(),d};else{const l=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const f=typeof l=="function"?l(d):void 0;return f!==!1?n.end({success:!0}):n.discard(),f}}const s=this.getAllAccounts().length>0;try{_p(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),s?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Redirect,e):this.eventHandler.emitEvent(te.LOGIN_START,J.Redirect,e);let l;return this.nativeExtensionProvider&&this.canUseNative(e)?l=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,n).catch(f=>{if(f instanceof Qn&&ei(f))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(f instanceof Fn)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),f}):l=this.createRedirectClient(t).acquireToken(e),await l}catch(l){throw n.end({success:!1},l),s?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Redirect,null,l):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Redirect,null,l),l}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(k.AcquireTokenPopup,t);n.add({scenarioId:e.scenarioId,accountType:Gn(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Ps(this.initialized,n),this.browserStorage.setInteractionInProgress(!0)}catch(l){return Promise.reject(l)}const i=this.getAllAccounts();i.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Popup,e):this.eventHandler.emitEvent(te.LOGIN_START,J.Popup,e);let s;return this.canUseNative(e)?s=this.acquireTokenNative({...e,correlationId:t},Le.acquireTokenPopup).then(l=>(this.browserStorage.setInteractionInProgress(!1),n.end({success:!0,isNativeBroker:!0,accountType:Gn(l.account)}),l)).catch(l=>{if(l instanceof Qn&&ei(l))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(l instanceof Fn)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),l}):s=this.createPopupClient(t).acquireToken(e),s.then(l=>(i.length<this.getAllAccounts().length?this.eventHandler.emitEvent(te.LOGIN_SUCCESS,J.Popup,l):this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Popup,l),n.end({success:!0,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length,accountType:Gn(l.account)}),l)).catch(l=>(i.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Popup,null,l):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Popup,null,l),n.end({success:!1},l),Promise.reject(l)))}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(e){var s,l;const t=this.getRequestCorrelationId(e),n={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(k.SsoSilent,t),(s=this.ssoSilentMeasurement)==null||s.add({scenarioId:e.scenarioId,accountType:Gn(e.account)}),Ps(this.initialized,this.ssoSilentMeasurement),(l=this.ssoSilentMeasurement)==null||l.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(te.SSO_SILENT_START,J.Silent,n);let i;return this.canUseNative(n)?i=this.acquireTokenNative(n,Le.ssoSilent).catch(d=>{if(d instanceof Qn&&ei(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(n.correlationId).acquireToken(n);throw d}):i=this.createSilentIframeClient(n.correlationId).acquireToken(n),i.then(d=>{var f;return this.eventHandler.emitEvent(te.SSO_SILENT_SUCCESS,J.Silent,d),(f=this.ssoSilentMeasurement)==null||f.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Gn(d.account)}),d}).catch(d=>{var f;throw this.eventHandler.emitEvent(te.SSO_SILENT_FAILURE,J.Silent,null,d),(f=this.ssoSilentMeasurement)==null||f.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const n=this.performanceClient.startMeasurement(k.AcquireTokenByCode,t);Ps(this.initialized,n),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_START,J.Silent,e),n.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw G(FC);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("Existing acquireTokenByCode request found",t),n.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),s=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(l=>(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_SUCCESS,J.Silent,l),this.hybridAuthCodeResponses.delete(i),n.end({success:!0,isNativeBroker:l.fromNativeBroker,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length,accountType:Gn(l.account)}),l)).catch(l=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_FAILURE,J.Silent,null,l),n.end({success:!1},l),l}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const i=await this.acquireTokenNative({...e,correlationId:t},Le.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw s instanceof Qn&&ei(s)&&(this.nativeExtensionProvider=void 0),s});return n.end({accountType:Gn(i.account),success:!0}),i}else throw G(HC);else throw G(VC)}catch(i){throw this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_FAILURE,J.Silent,null,i),n.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var i;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(k.AcquireTokenByCodeAsync,e.correlationId),(i=this.acquireTokenByCodeAsyncMeasurement)==null||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(s=>{var l;return(l=this.acquireTokenByCodeAsyncMeasurement)==null||l.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker}),s}).catch(s=>{var l;throw(l=this.acquireTokenByCodeAsyncMeasurement)==null||l.end({success:!1},s),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(k.AcquireTokenFromCache,e.correlationId),t){case Zt.Default:case Zt.AccessToken:case Zt.AccessTokenAndRefreshToken:const n=this.createSilentCacheClient(e.correlationId);return F(n.acquireToken.bind(n),k.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw B(yr)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(k.AcquireTokenByRefreshToken,e.correlationId),t){case Zt.Default:case Zt.AccessTokenAndRefreshToken:case Zt.RefreshToken:case Zt.RefreshTokenAndNetwork:const n=this.createSilentRefreshClient(e.correlationId);return F(n.acquireToken.bind(n),k.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw B(yr)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(k.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return F(t.acquireToken.bind(t),k.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);return _p(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return bh(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return _D(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return TD(e,this.logger,this.browserStorage)}getAccountByUsername(e){return ED(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return SD(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return AD(e,this.logger,this.browserStorage)}setActiveAccount(e){bD(e,this.browserStorage)}getActiveAccount(){return ID(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const n=at.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(n),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,n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw G(Sa);return new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,n||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Xn.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 dt.NONE:case dt.CONSENT:case dt.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):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new zD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new qD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new XD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new sw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new ZD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new nL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return tw(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(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(){typeof window>"u"||(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){var t;try{(t=e.key)!=null&&t.includes(ct.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(te.ACTIVE_ACCOUNT_CHANGED);const n=e.newValue||e.oldValue;if(!n)return;const i=JSON.parse(n);if(typeof i!="object"||!at.isAccountEntity(i))return;const l=gi.toObject(new at,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(te.ACCOUNT_ADDED,void 0,l)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(te.ACCOUNT_REMOVED,void 0,l))}catch{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!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Sr():P.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||yp})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||yp})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(k.AcquireTokenSilent,t);n.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Ps(this.initialized,n),this.logger.verbose("acquireTokenSilent called",t);const i=e.account||this.getActiveAccount();if(!i)throw G(PC);n.add({accountType:Gn(i)});const s={clientId:this.config.auth.clientId,authority:e.authority||P.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:i.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},l=JSON.stringify(s),d=this.activeSilentTokenRequests.get(l);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const f=F(this.acquireTokenSilentAsync.bind(this),k.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},i).then(g=>(this.activeSilentTokenRequests.delete(l),n.end({success:!0,fromCache:g.fromCache,isNativeBroker:g.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:g.accessToken.length,idTokenSize:g.idToken.length}),g)).catch(g=>{throw this.activeSilentTokenRequests.delete(l),n.end({success:!1},g),g});return this.activeSilentTokenRequests.set(l,f),{...await f,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),n.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const n=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(k.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",n);const i=await F(MD,k.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||Zt.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async d=>{if(rL(d,s))if(this.activeIframeRequest)if(s!==Zt.Skip){const[g,m]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${m}`,i.correlationId);const v=this.performanceClient.startMeasurement(k.AwaitConcurrentIframe,i.correlationId);v.add({awaitIframeCorrelationId:m});const C=await g;if(v.end({success:C}),C)return this.logger.verbose(`Parallel iframe request with correlationId: ${m} succeeded. Retrying cache and/or RT redemption`,i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info(`Iframe request with correlationId: ${m} failed. Interaction is required.`),d}else 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.",i.correlationId),F(this.acquireTokenBySilentIframe.bind(this),k.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i);else{let g;return this.activeIframeRequest=[new Promise(m=>{g=m}),i.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",i.correlationId),F(this.acquireTokenBySilentIframe.bind(this),k.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i).then(m=>(g(!0),m)).catch(m=>{throw g(!1),m}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",n)})}async acquireTokenSilentNoIframe(e,t){return Xn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Le.acquireTokenSilent_silentFlow).catch(async n=>{throw n instanceof Qn&&ei(n)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,B(yr)):n})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),F(this.acquireTokenFromCache.bind(this),k.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(n=>{if(t===Zt.AccessToken)throw n;return this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_NETWORK_START,J.Silent,e),F(this.acquireTokenByRefreshToken.bind(this),k.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function rL(r,e){const t=!(r instanceof Fn&&r.subError!==Lc),n=r.errorCode===tn.INVALID_GRANT_ERROR||r.errorCode===yr,i=t&&n||r.errorCode===fc||r.errorCode===hh,s=Fx.includes(e);return i&&s}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function oL(r,e){const t=new yo(r);return await t.initialize(),$c.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Oh{static async createPublicClientApplication(e){const t=await oL(e);return new Oh(e,t)}constructor(e,t){this.controller=t||new $c(new yo(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)}}const Fu=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",iL=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",aL=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",bp=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",sL={auth:{clientId:iL,authority:`https://${Fu}.b2clogin.com/${Fu}.onmicrosoft.com/${aL}`,knownAuthorities:[`${Fu}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${bp}/_/dashboard`:bp},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(r,e)=>{r===xe.Error&&console.error(e)},logLevel:xe.Warning}}},uw=r=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:"/_/dashboard",extraQueryParameters:r}),yt=new Oh(sL),Ip=c.ref(null);function dw(){async function r(e){var t;if(e)try{const n=e.idTokenClaims;if(!(n!=null&&n.aud))throw new Error("User audience (aud) is missing in ID token claims");const i=localStorage.getItem(`msal.token.keys.${n.aud}`);if(!i)throw new Error(`Token keys para ${n.aud} não encontrados no localStorage`);const s=JSON.parse(i),l=(t=s==null?void 0:s.idToken)==null?void 0:t[0];if(!l)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(l);if(!d)throw new Error(`Dados do token para ID ${l} não encontrados no localStorage`);const f=JSON.parse(d),g=f==null?void 0:f.secret;if(!g)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),Ip.value=g}catch(n){console.error("Erro ao obter token de acesso:",n)}}return{jToken:Ip,setJToken:r}}const cL=()=>process.env.JPLAN_WEBAPP__URL_AUTH||"http://localhost:5173/_/dashboard",En=c.ref(null),Wo=c.ref(null),Id=c.ref(Math.floor(Date.now()/1e3));xd.useIntervalFn(()=>lL(),1e3);function lL(){var n,i;if(!((i=(n=En.value)==null?void 0:n.idTokenClaims)!=null&&i.exp))return;const r=Math.floor(Date.now()/1e3),t=En.value.idTokenClaims.exp-300;return Id.value=r-t}function Kc(){const{setJToken:r,jToken:e}=dw(),t=c.computed(()=>!!En.value),n=c.computed(()=>En.value);async function i(v){if(!t.value)switch(v){case"redirect":await d();break;case"tab":await s();break;default:await d();break}}const s=async()=>new Promise((v,C)=>{try{localStorage.clear();const S=window.open(cL());if(!S){console.error("Failed to open authentication window"),C("Failed to open authentication window");return}const _=Date.now(),b=6e4,O=setInterval(()=>{if(Date.now()-_>b||S.closed){clearInterval(O),console.error("Authentication canceled or timeout reached."),C("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(V=>V.startsWith("msal.account.keys"))&&(clearInterval(O),l(),S.close(),v())},500)}catch(S){console.error("Error in handleRedirect:",S),C(S)}}),l=async()=>{try{await yt.initialize();const v=yt.getActiveAccount();if(v)En.value=v;else{const C=await yt.handleRedirectPromise();C?(yt.setActiveAccount(C.account),En.value=yt.getActiveAccount()):console.error("Falha na autenticação")}}catch(v){console.error("Erro no processo de autenticação:",v)}En.value&&await r(En.value)},d=async()=>{try{await yt.initialize();const v=await yt.handleRedirectPromise();if(!v||yt.getAllAccounts().length===0){const C=uw();await yt.loginRedirect(C);return}yt.setActiveAccount(v.account),En.value=yt.getActiveAccount(),En.value&&await r(En.value),Wo.value="updated"}catch(v){console.error("handleRedirect failed",v)}};async function f(){Wo.value="updating";try{const v=await yt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});yt.setActiveAccount(v.account),await r(En.value),Wo.value="updated"}catch(v){console.error("Falha ao renovar token, forçando novo login.",v),Wo.value="error",await i()}}const g=async()=>{try{await yt.initialize(),localStorage.clear(),await yt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(v){console.error("Logout error",v)}};c.watch(Id,async v=>{v<0&&Wo.value==="updated"&&await f()});const m=c.computed(()=>e.value);return{isAuthenticated:t,authState:Wo,account:n,token:m,refreshToken:f,handleRedirect:i,logout:g,refreshTime:Id}}function hw(r,e){return function(){return r.apply(e,arguments)}}const{toString:uL}=Object.prototype,{getPrototypeOf:Nh}=Object,zc=(r=>e=>{const t=uL.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=r=>(r=r.toLowerCase(),e=>zc(e)===r),Wc=r=>e=>typeof e===r,{isArray:wi}=Array,va=Wc("undefined");function dL(r){return r!==null&&!va(r)&&r.constructor!==null&&!va(r.constructor)&&an(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const fw=Kn("ArrayBuffer");function hL(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&fw(r.buffer),e}const fL=Wc("string"),an=Wc("function"),gw=Wc("number"),qc=r=>r!==null&&typeof r=="object",gL=r=>r===!0||r===!1,js=r=>{if(zc(r)!=="object")return!1;const e=Nh(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},mL=Kn("Date"),pL=Kn("File"),vL=Kn("Blob"),yL=Kn("FileList"),CL=r=>qc(r)&&an(r.pipe),wL=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||an(r.append)&&((e=zc(r))==="formdata"||e==="object"&&an(r.toString)&&r.toString()==="[object FormData]"))},_L=Kn("URLSearchParams"),[TL,EL,SL,AL]=["ReadableStream","Request","Response","Headers"].map(Kn),bL=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ba(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),wi(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{const s=t?Object.getOwnPropertyNames(r):Object.keys(r),l=s.length;let d;for(n=0;n<l;n++)d=s[n],e.call(null,r[d],d,r)}}function mw(r,e){e=e.toLowerCase();const t=Object.keys(r);let n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}const ho=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pw=r=>!va(r)&&r!==ho;function kd(){const{caseless:r}=pw(this)&&this||{},e={},t=(n,i)=>{const s=r&&mw(e,i)||i;js(e[s])&&js(n)?e[s]=kd(e[s],n):js(n)?e[s]=kd({},n):wi(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ba(arguments[n],t);return e}const IL=(r,e,t,{allOwnKeys:n}={})=>(ba(e,(i,s)=>{t&&an(i)?r[s]=hw(i,t):r[s]=i},{allOwnKeys:n}),r),kL=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),RL=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},OL=(r,e,t,n)=>{let i,s,l;const d={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)l=i[s],(!n||n(l,r,e))&&!d[l]&&(e[l]=r[l],d[l]=!0);r=t!==!1&&Nh(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},NL=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},PL=r=>{if(!r)return null;if(wi(r))return r;let e=r.length;if(!gw(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},ML=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Nh(Uint8Array)),xL=(r,e)=>{const n=(r&&r[Symbol.iterator]).call(r);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(r,s[0],s[1])}},DL=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},LL=Kn("HTMLFormElement"),BL=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),kp=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),UL=Kn("RegExp"),vw=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};ba(t,(i,s)=>{let l;(l=e(i,s,r))!==!1&&(n[s]=l||i)}),Object.defineProperties(r,n)},VL=r=>{vw(r,(e,t)=>{if(an(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(an(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},FL=(r,e)=>{const t={},n=i=>{i.forEach(s=>{t[s]=!0})};return wi(r)?n(r):n(String(r).split(e)),t},HL=()=>{},$L=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,Hu="abcdefghijklmnopqrstuvwxyz",Rp="0123456789",yw={DIGIT:Rp,ALPHA:Hu,ALPHA_DIGIT:Hu+Hu.toUpperCase()+Rp},KL=(r=16,e=yw.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function zL(r){return!!(r&&an(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const WL=r=>{const e=new Array(10),t=(n,i)=>{if(qc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=wi(n)?[]:{};return ba(n,(l,d)=>{const f=t(l,i+1);!va(f)&&(s[d]=f)}),e[i]=void 0,s}}return n};return t(r,0)},qL=Kn("AsyncFunction"),GL=r=>r&&(qc(r)||an(r))&&an(r.then)&&an(r.catch),Cw=((r,e)=>r?setImmediate:e?((t,n)=>(ho.addEventListener("message",({source:i,data:s})=>{i===ho&&s===t&&n.length&&n.shift()()},!1),i=>{n.push(i),ho.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",an(ho.postMessage)),jL=typeof queueMicrotask<"u"?queueMicrotask.bind(ho):typeof process<"u"&&process.nextTick||Cw,N={isArray:wi,isArrayBuffer:fw,isBuffer:dL,isFormData:wL,isArrayBufferView:hL,isString:fL,isNumber:gw,isBoolean:gL,isObject:qc,isPlainObject:js,isReadableStream:TL,isRequest:EL,isResponse:SL,isHeaders:AL,isUndefined:va,isDate:mL,isFile:pL,isBlob:vL,isRegExp:UL,isFunction:an,isStream:CL,isURLSearchParams:_L,isTypedArray:ML,isFileList:yL,forEach:ba,merge:kd,extend:IL,trim:bL,stripBOM:kL,inherits:RL,toFlatObject:OL,kindOf:zc,kindOfTest:Kn,endsWith:NL,toArray:PL,forEachEntry:xL,matchAll:DL,isHTMLForm:LL,hasOwnProperty:kp,hasOwnProp:kp,reduceDescriptors:vw,freezeMethods:VL,toObjectSet:FL,toCamelCase:BL,noop:HL,toFiniteNumber:$L,findKey:mw,global:ho,isContextDefined:pw,ALPHABET:yw,generateString:KL,isSpecCompliantForm:zL,toJSONObject:WL,isAsyncFn:qL,isThenable:GL,setImmediate:Cw,asap:jL};function ue(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}N.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.status}}});const ww=ue.prototype,_w={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{_w[r]={value:r}});Object.defineProperties(ue,_w);Object.defineProperty(ww,"isAxiosError",{value:!0});ue.from=(r,e,t,n,i,s)=>{const l=Object.create(ww);return N.toFlatObject(r,l,function(f){return f!==Error.prototype},d=>d!=="isAxiosError"),ue.call(l,r.message,e,t,n,i),l.cause=r,l.name=r.name,s&&Object.assign(l,s),l};const YL=null;function Rd(r){return N.isPlainObject(r)||N.isArray(r)}function Tw(r){return N.endsWith(r,"[]")?r.slice(0,-2):r}function Op(r,e,t){return r?r.concat(e).map(function(i,s){return i=Tw(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function JL(r){return N.isArray(r)&&!r.some(Rd)}const QL=N.toFlatObject(N,{},null,function(e){return/^is[A-Z]/.test(e)});function Gc(r,e,t){if(!N.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=N.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!N.isUndefined(O[b])});const n=t.metaTokens,i=t.visitor||m,s=t.dots,l=t.indexes,f=(t.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(e);if(!N.isFunction(i))throw new TypeError("visitor must be a function");function g(_){if(_===null)return"";if(N.isDate(_))return _.toISOString();if(!f&&N.isBlob(_))throw new ue("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(_)||N.isTypedArray(_)?f&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function m(_,b,O){let $=_;if(_&&!O&&typeof _=="object"){if(N.endsWith(b,"{}"))b=n?b:b.slice(0,-2),_=JSON.stringify(_);else if(N.isArray(_)&&JL(_)||(N.isFileList(_)||N.endsWith(b,"[]"))&&($=N.toArray(_)))return b=Tw(b),$.forEach(function(U,Q){!(N.isUndefined(U)||U===null)&&e.append(l===!0?Op([b],Q,s):l===null?b:b+"[]",g(U))}),!1}return Rd(_)?!0:(e.append(Op(O,b,s),g(_)),!1)}const v=[],C=Object.assign(QL,{defaultVisitor:m,convertValue:g,isVisitable:Rd});function S(_,b){if(!N.isUndefined(_)){if(v.indexOf(_)!==-1)throw Error("Circular reference detected in "+b.join("."));v.push(_),N.forEach(_,function($,V){(!(N.isUndefined($)||$===null)&&i.call(e,$,N.isString(V)?V.trim():V,b,C))===!0&&S($,b?b.concat(V):[V])}),v.pop()}}if(!N.isObject(r))throw new TypeError("data must be an object");return S(r),e}function Np(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ph(r,e){this._pairs=[],r&&Gc(r,this,e)}const Ew=Ph.prototype;Ew.append=function(e,t){this._pairs.push([e,t])};Ew.toString=function(e){const t=e?function(n){return e.call(this,n,Np)}:Np;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function XL(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Sw(r,e,t){if(!e)return r;const n=t&&t.encode||XL;N.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let s;if(i?s=i(e,t):s=N.isURLSearchParams(e)?e.toString():new Ph(e,t).toString(n),s){const l=r.indexOf("#");l!==-1&&(r=r.slice(0,l)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class Pp{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){N.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Aw={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ZL=typeof URLSearchParams<"u"?URLSearchParams:Ph,eB=typeof FormData<"u"?FormData:null,tB=typeof Blob<"u"?Blob:null,nB={isBrowser:!0,classes:{URLSearchParams:ZL,FormData:eB,Blob:tB},protocols:["http","https","file","blob","url","data"]},Mh=typeof window<"u"&&typeof document<"u",Od=typeof navigator=="object"&&navigator||void 0,rB=Mh&&(!Od||["ReactNative","NativeScript","NS"].indexOf(Od.product)<0),oB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iB=Mh&&window.location.href||"http://localhost",aB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mh,hasStandardBrowserEnv:rB,hasStandardBrowserWebWorkerEnv:oB,navigator:Od,origin:iB},Symbol.toStringTag,{value:"Module"})),It={...aB,...nB};function sB(r,e){return Gc(r,new It.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,s){return It.isNode&&N.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function cB(r){return N.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function lB(r){const e={},t=Object.keys(r);let n;const i=t.length;let s;for(n=0;n<i;n++)s=t[n],e[s]=r[s];return e}function bw(r){function e(t,n,i,s){let l=t[s++];if(l==="__proto__")return!0;const d=Number.isFinite(+l),f=s>=t.length;return l=!l&&N.isArray(i)?i.length:l,f?(N.hasOwnProp(i,l)?i[l]=[i[l],n]:i[l]=n,!d):((!i[l]||!N.isObject(i[l]))&&(i[l]=[]),e(t,n,i[l],s)&&N.isArray(i[l])&&(i[l]=lB(i[l])),!d)}if(N.isFormData(r)&&N.isFunction(r.entries)){const t={};return N.forEachEntry(r,(n,i)=>{e(cB(n),i,t,0)}),t}return null}function uB(r,e,t){if(N.isString(r))try{return(e||JSON.parse)(r),N.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const Ia={transitional:Aw,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=N.isObject(e);if(s&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return i?JSON.stringify(bw(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)||N.isReadableStream(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return sB(e,this.formSerializer).toString();if((d=N.isFileList(e))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Gc(d?{"files[]":e}:e,f&&new f,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),uB(e)):e}],transformResponse:[function(e){const t=this.transitional||Ia.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(N.isResponse(e)||N.isReadableStream(e))return e;if(e&&N.isString(e)&&(n&&!this.responseType||i)){const l=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(d){if(l)throw d.name==="SyntaxError"?ue.from(d,ue.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],r=>{Ia.headers[r]={}});const dB=N.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hB=r=>{const e={};let t,n,i;return r&&r.split(`
|
56
|
+
${l}`);return}throw fp(e.error,e.error_description,e.suberror)?new Fn(e.error,e.error_description,e.suberror,e.timestamp||P.EMPTY_STRING,e.trace_id||P.EMPTY_STRING,e.correlation_id||P.EMPTY_STRING,e.claims||P.EMPTY_STRING,s):l}}async handleServerTokenResponse(e,t,n,i,s,l,d,f,g){var _;(_=this.performanceClient)==null||_.addQueueMeasurement(k.HandleServerTokenResponse,e.correlation_id);let m;if(e.id_token){if(m=wo(e.id_token||P.EMPTY_STRING,this.cryptoObj.base64Decode),s&&s.nonce&&m.nonce!==s.nonce)throw B(Py);if(i.maxAge||i.maxAge===0){const b=m.auth_time;if(!b)throw B(Yd);zy(b,i.maxAge)}}this.homeAccountIdentifier=at.generateHomeAccountId(e.client_info||P.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,m);let v;s&&s.state&&(v=Vn.parseRequestState(this.cryptoObj,s.state)),e.key_id=e.key_id||i.sshKid||void 0;const C=this.generateCacheRecord(e,t,n,i,m,l,s);let S;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),S=new Ex(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(S)),d&&!f&&C.account){const b=C.account.generateAccountKey();if(!this.cacheStorage.getAccount(b,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await po.generateAuthenticationResult(this.cryptoObj,t,C,!1,i,m,v,void 0,g)}await this.cacheStorage.saveCacheRecord(C,i.storeInCache,i.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&S&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(S))}return po.generateAuthenticationResult(this.cryptoObj,t,C,!1,i,m,v,e,g)}generateCacheRecord(e,t,n,i,s,l,d){const f=t.getPreferredCache();if(!f)throw B(Qd);const g=aC(s);let m,v;e.id_token&&s&&(m=Nc(this.homeAccountIdentifier,f,e.id_token,this.clientId,g||""),v=fh(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,s,e.client_info,f,g,d,void 0,this.logger));let C=null;if(e.access_token){const b=e.scope?Je.fromString(e.scope):new Je(i.scopes||[]),O=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,$=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,V=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,U=n+O,Q=U+$,se=V&&V>0?n+V:void 0;C=Pc(this.homeAccountIdentifier,f,e.access_token,this.clientId,g||t.tenant||"",b.printScopes(),U,Q,this.cryptoObj.base64Decode,se,e.token_type,l,e.key_id,i.claims,i.requestedClaimsHash)}let S=null;if(e.refresh_token){let b;if(e.refresh_token_expires_in){const O=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;b=n+O}S=Wy(this.homeAccountIdentifier,f,e.refresh_token,this.clientId,e.foci,l,b)}let _=null;return e.foci&&(_={clientId:this.clientId,environment:f,familyId:e.foci}),{account:v,idToken:m,accessToken:C,refreshToken:S,appMetadata:_}}static async generateAuthenticationResult(e,t,n,i,s,l,d,f,g){var U,Q,se,we,z;let m=P.EMPTY_STRING,v=[],C=null,S,_,b=P.EMPTY_STRING;if(n.accessToken){if(n.accessToken.tokenType===Oe.POP&&!s.popKid){const tt=new mi(e),{secret:Te,keyId:j}=n.accessToken;if(!j)throw B(Xd);m=await tt.signPopToken(Te,j,s)}else m=n.accessToken.secret;v=Je.fromString(n.accessToken.target).asArray(),C=new Date(Number(n.accessToken.expiresOn)*1e3),S=new Date(Number(n.accessToken.extendedExpiresOn)*1e3),n.accessToken.refreshOn&&(_=new Date(Number(n.accessToken.refreshOn)*1e3))}n.appMetadata&&(b=n.appMetadata.familyId===sa?sa:"");const O=(l==null?void 0:l.oid)||(l==null?void 0:l.sub)||"",$=(l==null?void 0:l.tid)||"";f!=null&&f.spa_accountid&&n.account&&(n.account.nativeAccountId=f==null?void 0:f.spa_accountid);const V=n.account?sh(n.account.getAccountInfo(),void 0,l,(U=n.idToken)==null?void 0:U.secret):null;return{authority:t.canonicalAuthority,uniqueId:O,tenantId:$,scopes:v,account:V,idToken:((Q=n==null?void 0:n.idToken)==null?void 0:Q.secret)||"",idTokenClaims:l||{},accessToken:m,fromCache:i,expiresOn:C,extExpiresOn:S,refreshOn:_,correlationId:s.correlationId,requestId:g||P.EMPTY_STRING,familyId:b,tokenType:((se=n.accessToken)==null?void 0:se.tokenType)||P.EMPTY_STRING,state:d?d.userRequestState:P.EMPTY_STRING,cloudGraphHostName:((we=n.account)==null?void 0:we.cloudGraphHostName)||P.EMPTY_STRING,msGraphHost:((z=n.account)==null?void 0:z.msGraphHost)||P.EMPTY_STRING,code:f==null?void 0:f.spa_code,fromNativeBroker:!1}}}function fh(r,e,t,n,i,s,l,d,f,g,m){m==null||m.verbose("setCachedAccount called");const C=r.getAccountKeys().find($=>$.startsWith(t));let S=null;C&&(S=r.getAccount(C,m));const _=S||at.createAccount({homeAccountId:t,idTokenClaims:i,clientInfo:s,environment:l,cloudGraphHostName:f==null?void 0:f.cloud_graph_host_name,msGraphHost:f==null?void 0:f.msgraph_host,nativeAccountId:g},e,n),b=_.tenantProfiles||[],O=d||_.realm;if(O&&!b.find($=>$.tenantId===O)){const $=ah(t,_.localAccountId,O,i);b.push($)}return _.tenantProfiles=b,_}/*! @azure/msal-common v14.16.0 2024-11-05 */async function pC(r,e,t){return typeof r=="string"?r:r({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class vC extends dh{constructor(e,t){var n;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(n=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:n.defaultScopes}async getAuthCodeUrl(e){var n;(n=this.performanceClient)==null||n.addQueueMeasurement(k.GetAuthCodeUrl,e.correlationId);const t=await F(this.createAuthCodeUrlQueryString.bind(this),k.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return ye.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,f;if((d=this.performanceClient)==null||d.addQueueMeasurement(k.AuthClientAcquireToken,e.correlationId),!e.code)throw B(Dy);const n=or(),i=await F(this.executeTokenRequest.bind(this),k.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),s=(f=i.headers)==null?void 0:f[Pt.X_MS_REQUEST_ID],l=new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return l.validateTokenResponse(i.body),F(l.handleServerTokenResponse.bind(l),k.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(i.body,this.authority,n,e,t,void 0,void 0,void 0,s)}handleFragmentResponse(e,t){if(new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw B(Fy);return e}getLogoutUri(e){if(!e)throw Pe(Xy);const t=this.createLogoutUrlQueryString(e);return ye.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var g,m;(g=this.performanceClient)==null||g.addQueueMeasurement(k.AuthClientExecuteTokenRequest,t.correlationId);const n=this.createTokenQueryParameters(t),i=ye.appendQueryString(e.tokenEndpoint,n),s=await F(this.createTokenRequestBody.bind(this),k.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let l;if(t.clientInfo)try{const v=lc(t.clientInfo,this.cryptoUtils.base64Decode);l={credential:`${v.uid}${bt.CLIENT_INFO_SEPARATOR}${v.utid}`,type:on.HOME_ACCOUNT_ID}}catch(v){this.logger.verbose("Could not parse client info for CCS Header: "+v)}const d=this.createTokenRequestHeaders(l||t.ccsCredential),f={clientId:((m=t.tokenBodyParameters)==null?void 0:m.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 F(this.executePostToTokenEndpoint.bind(this),k.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(i,s,d,f,t.correlationId,k.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s;(i=this.performanceClient)==null||i.addQueueMeasurement(k.AuthClientCreateTokenRequestBody,e.correlationId);const t=new la(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[mo])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):Xo.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&&!md(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 l=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await pC(l.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(l.assertionType)}if(t.addGrantType(Sy.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Oe.POP){const l=new mi(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await F(l.generateCnf.bind(l),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Oe.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Pe(Mc);(!Un.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let n;if(e.clientInfo)try{const l=lc(e.clientInfo,this.cryptoUtils.base64Decode);n={credential:`${l.uid}${bt.CLIENT_INFO_SEPARATOR}${l.utid}`,type:on.HOME_ACCOUNT_ID}}catch(l){this.logger.verbose("Could not parse client info for CCS Header: "+l)}else n=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&n)switch(n.type){case on.HOME_ACCOUNT_ID:try{const l=ai(n.credential);t.addCcsOid(l)}catch(l){this.logger.verbose("Could not parse home account ID for CCS Header: "+l)}break;case on.UPN:t.addCcsUpn(n.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[up])&&t.addExtraQueryParameters({[up]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var s,l;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(s=this.performanceClient)==null||s.addQueueMeasurement(k.AuthClientCreateQueryString,t);const n=new la(t,this.performanceClient);n.addClientId(e.embeddedClientId||((l=e.extraQueryParameters)==null?void 0:l[mo])||this.config.authOptions.clientId);const i=[...e.scopes||[],...e.extraScopesToConsent||[]];if(n.addScopes(i,!0,this.oidcDefaultScopes),n.addRedirectUri(e.redirectUri),n.addCorrelationId(t),n.addResponseMode(e.responseMode),n.addResponseTypeCode(),n.addLibraryInfo(this.config.libraryInfo),md(this.config)||n.addApplicationTelemetry(this.config.telemetry.application),n.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&n.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&n.addPrompt(e.prompt),e.domainHint&&n.addDomainHint(e.domainHint),e.prompt!==dt.SELECT_ACCOUNT)if(e.sid&&e.prompt===dt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),n.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let f=this.extractLoginHint(e.account);if(f&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),f=null),f){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),n.addLoginHint(f);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===dt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),n.addSid(d);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{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"),n.addLoginHint(e.loginHint),n.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),n.addLoginHint(e.account.username);try{const g=ai(e.account.homeAccountId);n.addCcsOid(g)}catch{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"),n.addLoginHint(e.loginHint),n.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&n.addNonce(e.nonce),e.state&&n.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,n),e.nativeBroker&&(n.addNativeBroker(),e.authenticationScheme===Oe.POP)){const d=new mi(this.cryptoUtils);let f;e.popKid?f=this.cryptoUtils.encodeKid(e.popKid):f=(await F(d.generateCnf.bind(d),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(f)}return n.createQueryString()}createLogoutUrlQueryString(e){const t=new la(e.correlationId,this.performanceClient);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){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Ax=300;class yd extends dh{constructor(e,t){super(e,t)}async acquireToken(e){var l,d;(l=this.performanceClient)==null||l.addQueueMeasurement(k.RefreshTokenClientAcquireToken,e.correlationId);const t=or(),n=await F(this.executeTokenRequest.bind(this),k.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),i=(d=n.headers)==null?void 0:d[Pt.X_MS_REQUEST_ID],s=new po(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return s.validateTokenResponse(n.body),F(s.handleServerTokenResponse.bind(s),k.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(n.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,i)}async acquireTokenByRefreshToken(e){var n;if(!e)throw Pe(Qy);if((n=this.performanceClient)==null||n.addQueueMeasurement(k.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw B(Jd);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(i){const s=i instanceof Fn&&i.errorCode===fc,l=i instanceof Gr&&i.errorCode===Jm.INVALID_GRANT_ERROR&&i.subError===Jm.CLIENT_MISMATCH_ERROR;if(s||l)return F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw i}return F(this.acquireTokenWithCachedRefreshToken.bind(this),k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var s;(s=this.performanceClient)==null||s.addQueueMeasurement(k.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const n=_o(this.cacheManager.getRefreshToken.bind(this.cacheManager),k.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!n)throw vd(fc);if(n.expiresOn&&gd(n.expiresOn,e.refreshTokenExpirationOffsetSeconds||Ax))throw vd(hh);const i={...e,refreshToken:n.secret,authenticationScheme:e.authenticationScheme||Oe.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:on.HOME_ACCOUNT_ID}};try{return await F(this.acquireToken.bind(this),k.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(i)}catch(l){if(l instanceof Fn&&l.subError===Lc){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ii(n);this.cacheManager.removeRefreshToken(d)}throw l}}async executeTokenRequest(e,t){var f,g;(f=this.performanceClient)==null||f.addQueueMeasurement(k.RefreshTokenClientExecuteTokenRequest,e.correlationId);const n=this.createTokenQueryParameters(e),i=ye.appendQueryString(t.tokenEndpoint,n),s=await F(this.createTokenRequestBody.bind(this),k.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),l=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((g=e.tokenBodyParameters)==null?void 0:g.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 F(this.executePostToTokenEndpoint.bind(this),k.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(i,s,l,d,e.correlationId,k.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var i,s,l;(i=this.performanceClient)==null||i.addQueueMeasurement(k.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,n=new la(t,this.performanceClient);if(n.addClientId(e.embeddedClientId||((s=e.tokenBodyParameters)==null?void 0:s[mo])||this.config.authOptions.clientId),e.redirectUri&&n.addRedirectUri(e.redirectUri),n.addScopes(e.scopes,!0,(l=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:l.defaultScopes),n.addGrantType(Sy.REFRESH_TOKEN_GRANT),n.addClientInfo(),n.addLibraryInfo(this.config.libraryInfo),n.addApplicationTelemetry(this.config.telemetry.application),n.addThrottling(),this.serverTelemetryManager&&!md(this.config)&&n.addServerTelemetry(this.serverTelemetryManager),n.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&n.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;n.addClientAssertion(await pC(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),n.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Oe.POP){const d=new mi(this.cryptoUtils,this.performanceClient);let f;e.popKid?f=this.cryptoUtils.encodeKid(e.popKid):f=(await F(d.generateCnf.bind(d),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,n.addPopToken(f)}else if(e.authenticationScheme===Oe.SSH)if(e.sshJwk)n.addSshJwk(e.sshJwk);else throw Pe(Mc);if((!Un.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&n.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case on.HOME_ACCOUNT_ID:try{const d=ai(e.ccsCredential.credential);n.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case on.UPN:n.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&n.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&n.addExtraQueryParameters(e.tokenBodyParameters),n.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class bx extends dh{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[n,i]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...yi]});return i===Br.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new yd(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),n}catch(n){if(n instanceof Oc&&n.errorCode===yr)return new yd(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw n}}async acquireCachedToken(e){var f;(f=this.performanceClient)==null||f.addQueueMeasurement(k.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Br.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!Un.isEmptyObj(e.claims))throw this.setCacheOutcome(Br.FORCE_REFRESH_OR_CLAIMS,e.correlationId),B(yr);if(!e.account)throw B(Jd);const n=e.account.tenantId||mx(e.authority),i=this.cacheManager.getTokenKeys(),s=this.cacheManager.getAccessToken(e.account,e,i,n,this.performanceClient,e.correlationId);if(s){if(tM(s.cachedAt)||gd(s.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Br.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),B(yr);s.refreshOn&&gd(s.refreshOn,0)&&(t=Br.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Br.NO_CACHED_ACCESS_TOKEN,e.correlationId),B(yr);const l=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:s,idToken:this.cacheManager.getIdToken(e.account,i,n,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(l)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await F(this.generateResultFromCacheRecord.bind(this),k.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var n,i;(n=this.serverTelemetryManager)==null||n.setCacheOutcome(e),(i=this.performanceClient)==null||i.addFields({cacheOutcome:e},t),e!==Br.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var i;(i=this.performanceClient)==null||i.addQueueMeasurement(k.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let n;if(e.idToken&&(n=wo(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const s=n==null?void 0:n.auth_time;if(!s)throw B(Yd);zy(s,t.maxAge)}return po.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,n)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const Ix={sendGetRequestAsync:()=>Promise.reject(B(ge)),sendPostRequestAsync:()=>Promise.reject(B(ge))};/*! @azure/msal-common v14.16.0 2024-11-05 */const gp=",",yC="|";function kx(r){const{skus:e,libraryName:t,libraryVersion:n,extensionName:i,extensionVersion:s}=r,l=new Map([[0,[t,n]],[2,[i,s]]]);let d=[];if(e!=null&&e.length){if(d=e.split(gp),d.length<4)return e}else d=Array.from({length:4},()=>yC);return l.forEach((f,g)=>{var m,v;f.length===2&&((m=f[0])!=null&&m.length)&&((v=f[1])!=null&&v.length)&&Rx({skuArr:d,index:g,skuName:f[0],skuVersion:f[1]})}),d.join(gp)}function Rx(r){const{skuArr:e,index:t,skuName:n,skuVersion:i}=r;t>=e.length||(e[t]=[n,i].join(yC))}class ma{constructor(e,t){this.cacheOutcome=Br.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||P.EMPTY_STRING,this.wrapperVer=e.wrapperVer||P.EMPTY_STRING,this.telemetryCacheKey=pt.CACHE_KEY+bt.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${pt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],n=this.getNativeBrokerErrorCode();n!=null&&n.length&&t.push(`broker_error=${n}`);const i=t.join(pt.VALUE_SEPARATOR),s=this.getRegionDiscoveryFields(),l=[e,s].join(pt.VALUE_SEPARATOR);return[pt.SCHEMA_VERSION,l,i].join(pt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=ma.maxErrorsToSend(e),n=e.failedRequests.slice(0,2*t).join(pt.VALUE_SEPARATOR),i=e.errors.slice(0,t).join(pt.VALUE_SEPARATOR),s=e.errors.length,l=t<s?pt.OVERFLOW_TRUE:pt.OVERFLOW_FALSE,d=[s,l].join(pt.VALUE_SEPARATOR);return[pt.SCHEMA_VERSION,e.cacheHits,n,i,d].join(pt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=pt.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 He?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(pt.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(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=ma.maxErrorsToSend(e),n=e.errors.length;if(t===n)this.cacheManager.removeItem(this.telemetryCacheKey);else{const i={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,i)}}static maxErrorsToSend(e){let t,n=0,i=0;const s=e.errors.length;for(t=0;t<s;t++){const l=e.failedRequests[2*t]||P.EMPTY_STRING,d=e.failedRequests[2*t+1]||P.EMPTY_STRING,f=e.errors[t]||P.EMPTY_STRING;if(i+=l.toString().length+d.toString().length+f.length+3,i<pt.MAX_LAST_HEADER_BYTES)n+=1;else break}return n}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||P.EMPTY_STRING),e.push(this.regionSource||P.EMPTY_STRING),e.push(this.regionOutcome||P.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 kx(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const CC="missing_kid_error",wC="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const Ox={[CC]:"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.",[wC]:"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 gh extends He{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,gh.prototype)}}function mp(r){return new gh(r,Ox[r])}/*! @azure/msal-common v14.16.0 2024-11-05 */class mh{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw mp(CC);if(!e.alg)throw mp(wC);const t=new mh({typ:e.typ||V1.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class pp{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class Nx{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:gx.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new pp}}startPerformanceMeasurement(){return new pp}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const ph="pkce_not_created",Cd="crypto_nonexistent",Bc="empty_navigate_uri",_C="hash_empty_error",vh="no_state_in_hash",TC="hash_does_not_contain_known_properties",EC="unable_to_parse_state",SC="state_interaction_type_mismatch",AC="interaction_in_progress",bC="popup_window_error",IC="empty_window_error",vo="user_cancelled",Px="monitor_popup_timeout",kC="monitor_window_timeout",RC="redirect_in_iframe",OC="block_iframe_reload",NC="block_nested_popups",Mx="iframe_closed_prematurely",Uc="silent_logout_unsupported",PC="no_account_error",xx="silent_prompt_value_error",MC="no_token_request_cache_error",xC="unable_to_parse_token_request_cache_error",yh="no_cached_authority_error",Dx="auth_request_not_set_error",Lx="invalid_cache_type",Vc="non_browser_environment",Zo="database_not_open",gc="no_network_connectivity",DC="post_request_failed",LC="get_request_failed",wd="failed_to_parse_response",BC="unable_to_load_token",Ch="crypto_key_not_found",UC="auth_code_required",VC="auth_code_or_nativeAccountId_required",FC="spa_code_and_nativeAccountId_present",wh="database_unavailable",HC="unable_to_acquire_token_from_native_platform",$C="native_handshake_timeout",KC="native_extension_not_installed",Sa="native_connection_not_established",zC="uninitialized_public_client_application",WC="native_prompt_not_supported",qC="invalid_base64_string",GC="invalid_pop_token_request",jC="failed_to_build_headers",YC="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const pr="For more visit: aka.ms/msaljs/browser-errors",Bx={[ph]:"The PKCE code challenge and verifier could not be generated.",[Cd]:"The crypto object or function is not available.",[Bc]:"Navigation URI is empty. Please check stack trace for more info.",[_C]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${pr}`,[vh]:"Hash does not contain state. Please verify that the request originated from msal.",[TC]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${pr}`,[EC]:"Unable to parse state. Please verify that the request originated from msal.",[SC]:"Hash contains state but the interaction type does not match the caller.",[AC]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${pr}`,[bC]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[IC]:"window.open returned null or undefined window object.",[vo]:"User cancelled the flow.",[Px]:`Token acquisition in popup failed due to timeout. ${pr}`,[kC]:`Token acquisition in iframe failed due to timeout. ${pr}`,[RC]:"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.",[OC]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${pr}`,[NC]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[Mx]:"The iframe being monitored was closed prematurely.",[Uc]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[PC]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[xx]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[MC]:"No token request found in cache.",[xC]:"The cached token request could not be parsed.",[yh]:"No cached authority found.",[Dx]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[Lx]:"Invalid cache type",[Vc]:"Login and token requests are not supported in non-browser environments.",[Zo]:"Database is not open!",[gc]:"No network connectivity. Check your internet connection.",[DC]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[LC]:"Network request failed. Please check the network trace to determine root cause.",[wd]:"Failed to parse network response. Check network trace.",[BC]:"Error loading token to cache.",[Ch]:"Cryptographic Key or Keypair not found in browser storage.",[UC]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[VC]:"An authorization code or nativeAccountId must be provided to this flow.",[FC]:"Request cannot contain both spa code and native account id.",[wh]:"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.",[HC]:`Unable to acquire token from native platform. ${pr}`,[$C]:"Timed out while attempting to establish connection to browser extension",[KC]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[Sa]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${pr}`,[zC]:`You must call and await the initialize function before attempting to call any other MSAL API. ${pr}`,[WC]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[qC]:"Invalid base64 encoded string.",[GC]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[jC]:"Failed to build request headers object.",[YC]:"Failed to parse response headers"};class Aa extends He{constructor(e,t){super(e,Bx[e],t),Object.setPrototypeOf(this,Aa.prototype),this.name="BrowserAuthError"}}function G(r,e){return new Aa(r,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const tn={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"},si={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},uo={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},Ht={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},vp={GET:"GET",POST:"POST"},ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Lr={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Os={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},Le={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var J;(function(r){r.Redirect="redirect",r.Popup="popup",r.Silent="silent",r.None="none"})(J||(J={}));const yp={scopes:yi},JC="jwk",_d="msal.db",Ux=1,Vx=`${_d}.keys`,Zt={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},Fx=[Zt.Default,Zt.Skip,Zt.RefreshTokenAndNetwork],Hx="msal.browser.log.level",$x="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Ns(r){return encodeURIComponent(_h(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function Fc(r){return QC(r).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function _h(r){return QC(new TextEncoder().encode(r))}function QC(r){const e=Array.from(r,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Kx="RSASSA-PKCS1-v1_5",XC="SHA-256",zx=2048,Wx=new Uint8Array([1,0,1]),Cp="0123456789abcdef",wp=new Uint32Array(1),qx="crypto_subtle_undefined",Th={name:Kx,hash:XC,modulusLength:zx,publicExponent:Wx};function Gx(r){if(!window)throw G(Vc);if(!window.crypto)throw G(Cd);if(!r&&!window.crypto.subtle)throw G(Cd,qx)}async function ZC(r,e,t){e==null||e.addQueueMeasurement(k.Sha256Digest,t);const i=new TextEncoder().encode(r);return window.crypto.subtle.digest(XC,i)}function jx(r){return window.crypto.getRandomValues(r)}function Uu(){return window.crypto.getRandomValues(wp),wp[0]}function Sr(){const r=Date.now(),e=Uu()*1024+(Uu()&1023),t=new Uint8Array(16),n=Math.trunc(e/2**30),i=e&2**30-1,s=Uu();t[0]=r/2**40,t[1]=r/2**32,t[2]=r/2**24,t[3]=r/2**16,t[4]=r/2**8,t[5]=r,t[6]=112|n>>>8,t[7]=n,t[8]=128|i>>>24,t[9]=i>>>16,t[10]=i>>>8,t[11]=i,t[12]=s>>>24,t[13]=s>>>16,t[14]=s>>>8,t[15]=s;let l="";for(let d=0;d<t.length;d++)l+=Cp.charAt(t[d]>>>4),l+=Cp.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(l+="-");return l}async function Yx(r,e){return window.crypto.subtle.generateKey(Th,r,e)}async function Vu(r){return window.crypto.subtle.exportKey(JC,r)}async function Jx(r,e,t){return window.crypto.subtle.importKey(JC,r,Th,e,t)}async function Qx(r,e){return window.crypto.subtle.sign(Th,r,e)}async function ew(r){const e=await ZC(r),t=new Uint8Array(e);return Fc(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const pa="storage_not_supported",Td="stubbed_public_client_application_called",mc="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const Gs={[pa]:"Given storage configuration option was not supported.",[Td]:"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",[mc]:"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."};Gs[pa],Gs[Td],Gs[mc];class Eh extends He{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Eh.prototype)}}function Sh(r){return new Eh(r,Gs[r])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Xx(r){r.location.hash="",typeof r.history.replaceState=="function"&&r.history.replaceState(null,"",`${r.location.origin}${r.location.pathname}${r.location.search}`)}function Zx(r){const e=r.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Ah(){return window.parent!==window}function eD(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${tn.POPUP_NAME_PREFIX}.`)===0}function Cr(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function tD(){const e=new ye(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function nD(){if(ye.hashContainsKnownProperties(window.location.hash)&&Ah())throw G(OC)}function rD(r){if(Ah()&&!r)throw G(RC)}function oD(){if(eD())throw G(NC)}function tw(){if(typeof window>"u")throw G(Vc)}function nw(r){if(!r)throw G(zC)}function bh(r){tw(),nD(),oD(),nw(r)}function _p(r,e){if(bh(r),rD(e.system.allowRedirectInIframe),e.cache.cacheLocation===Ht.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw Sh(mc)}function rw(r){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(r).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function iD(){return Sr()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pc{navigateInternal(e,t){return pc.defaultNavigateWindow(e,t)}navigateExternal(e,t){return pc.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(n=>{setTimeout(()=>{n(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class aD{async sendGetRequestAsync(e,t){let n,i={},s=0;const l=Tp(t);try{n=await fetch(e,{method:vp.GET,headers:l})}catch{throw G(window.navigator.onLine?LC:gc)}i=Ep(n.headers);try{return s=n.status,{headers:i,body:await n.json(),status:s}}catch{throw dp(G(wd),s,i)}}async sendPostRequestAsync(e,t){const n=t&&t.body||"",i=Tp(t);let s,l=0,d={};try{s=await fetch(e,{method:vp.POST,headers:i,body:n})}catch{throw G(window.navigator.onLine?DC:gc)}d=Ep(s.headers);try{return l=s.status,{headers:d,body:await s.json(),status:l}}catch{throw dp(G(wd),l,d)}}}function Tp(r){try{const e=new Headers;if(!(r&&r.headers))return e;const t=r.headers;return Object.entries(t).forEach(([n,i])=>{e.append(n,i)}),e}catch{throw G(jC)}}function Ep(r){try{const e={};return r.forEach((t,n)=>{e[n]=t}),e}catch{throw G(YC)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const sD=6e4,Ed=1e4,cD=3e4,lD=2e3;function uD({auth:r,cache:e,system:t,telemetry:n},i){const s={clientId:P.EMPTY_STRING,authority:`${P.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:P.EMPTY_STRING,authorityMetadata:P.EMPTY_STRING,redirectUri:typeof window<"u"?Cr():"",postLogoutRedirectUri:P.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:Tr.AAD,OIDCOptions:{serverResponseType:Ea.FRAGMENT,defaultScopes:[P.OPENID_SCOPE,P.PROFILE_SCOPE,P.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:eh.None,tenant:P.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},l={cacheLocation:Ht.SessionStorage,temporaryCacheLocation:Ht.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===Ht.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:xe.Info,piiLoggingEnabled:!1},g={...{...dC,loggerOptions:d,networkClient:i?new aD:Ix,navigationClient:new pc,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||sD,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||Ed,navigateFrameWait:0,redirectNavigationTimeout:cD,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||lD,pollIntervalMilliseconds:tn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},m={application:{appName:P.EMPTY_STRING,appVersion:P.EMPTY_STRING},client:new Nx};if((r==null?void 0:r.protocolMode)!==Tr.OIDC&&(r!=null&&r.OIDCOptions)&&new qr(g.loggerOptions).warning(JSON.stringify(Pe(rC))),r!=null&&r.protocolMode&&r.protocolMode!==Tr.AAD&&(g!=null&&g.allowNativeBroker))throw Pe(oC);return{auth:{...s,...r,OIDCOptions:{...s.OIDCOptions,...r==null?void 0:r.OIDCOptions}},cache:{...l,...e},system:g,telemetry:{...m,...n}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const dD="@azure/msal-browser",Hc="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ih{static loggerCallback(e,t){switch(e){case xe.Error:console.error(t);return;case xe.Info:console.info(t);return;case xe.Verbose:console.debug(t);return;case xe.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var f;this.browserEnvironment=typeof window<"u",this.config=uD(e,this.browserEnvironment);let t;try{t=window[Ht.SessionStorage]}catch{}const n=t==null?void 0:t.getItem(Hx),i=(f=t==null?void 0:t.getItem($x))==null?void 0:f.toLowerCase(),s=i==="true"?!0:i==="false"?!1:void 0,l={...this.config.system.loggerOptions},d=n&&Object.keys(xe).includes(n)?xe[n]:void 0;d&&(l.loggerCallback=Ih.loggerCallback,l.logLevel=d),s!==void 0&&(l.piiLoggingEnabled=s),this.logger=new qr(l,dD,Hc),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class yo extends Ih{getModuleName(){return yo.MODULE_NAME}getId(){return yo.ID}async initialize(){return this.available=typeof window<"u",this.available}}yo.MODULE_NAME="";yo.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function nr(r){return new TextDecoder().decode(hD(r))}function hD(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw G(qC)}const t=atob(e);return Uint8Array.from(t,n=>n.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fD{constructor(){this.dbName=_d,this.version=Ux,this.tableName=Vx,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const n=window.indexedDB.open(this.dbName,this.version);n.addEventListener("upgradeneeded",i=>{i.target.result.createObjectStore(this.tableName)}),n.addEventListener("success",i=>{const s=i;this.db=s.target.result,this.dbOpen=!0,e()}),n.addEventListener("error",()=>t(G(wh)))})}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,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);l.addEventListener("success",d=>{const f=d;this.closeConnection(),t(f.target.result)}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((n,i)=>{if(!this.db)return i(G(Zo));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),n()}),d.addEventListener("error",f=>{this.closeConnection(),i(f)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);l.addEventListener("success",()=>{this.closeConnection(),t()}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(G(Zo));const s=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();s.addEventListener("success",l=>{const d=l;this.closeConnection(),e(d.target.result)}),s.addEventListener("error",l=>{this.closeConnection(),t(l)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,n)=>{if(!this.db)return n(G(Zo));const l=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);l.addEventListener("success",d=>{const f=d;this.closeConnection(),t(f.target.result===1)}),l.addEventListener("error",d=>{this.closeConnection(),n(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const n=window.indexedDB.deleteDatabase(_d),i=setTimeout(()=>t(!1),200);n.addEventListener("success",()=>(clearTimeout(i),e(!0))),n.addEventListener("blocked",()=>(clearTimeout(i),e(!0))),n.addEventListener("error",()=>(clearTimeout(i),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Sd{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,n)=>{e.push(n)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gD{constructor(e){this.inMemoryCache=new Sd,this.indexedDBCache=new fD,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Aa&&e.errorCode===wh)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}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(n){this.handleDatabaseAccessError(n)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(n){this.handleDatabaseAccessError(n)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}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(n){this.handleDatabaseAccessError(n)}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.28.1 2025-01-14 */class pi{constructor(e,t,n){this.logger=e,Gx(n??!1),this.cache=new gD(this.logger),this.performanceClient=t}createNewGuid(){return Sr()}base64Encode(e){return _h(e)}base64Decode(e){return nr(e)}base64UrlEncode(e){return Ns(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var m;const t=(m=this.performanceClient)==null?void 0:m.startMeasurement(k.CryptoOptsGetPublicKeyThumbprint,e.correlationId),n=await Yx(pi.EXTRACTABLE,pi.POP_KEY_USAGES),i=await Vu(n.publicKey),s={e:i.e,kty:i.kty,n:i.n},l=Sp(s),d=await this.hashString(l),f=await Vu(n.privateKey),g=await Jx(f,!1,["sign"]);return await this.cache.setItem(d,{privateKey:g,publicKey:n.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!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,n,i){var U;const s=(U=this.performanceClient)==null?void 0:U.startMeasurement(k.CryptoOptsSignJwt,i),l=await this.cache.getItem(t);if(!l)throw G(Ch);const d=await Vu(l.publicKey),f=Sp(d),g=Ns(JSON.stringify({kid:t})),m=mh.getShrHeaderString({...n==null?void 0:n.header,alg:d.alg,kid:g}),v=Ns(m);e.cnf={jwk:JSON.parse(f)};const C=Ns(JSON.stringify(e)),S=`${v}.${C}`,b=new TextEncoder().encode(S),O=await Qx(l.privateKey,b),$=Fc(new Uint8Array(O)),V=`${S}.${$}`;return s&&s.end({success:!0}),V}async hashString(e){return ew(e)}}pi.POP_KEY_USAGES=["sign","verify"];pi.EXTRACTABLE=!0;function Sp(r){return JSON.stringify(r,Object.keys(r).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class mD{constructor(){if(!window.localStorage)throw Sh(pa)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class pD{constructor(){if(!window.sessionStorage)throw Sh(pa)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function ow(r,e){if(!e)return null;try{return Vn.parseRequestState(r,e).libraryState.meta}catch{throw B(fi)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const vD=24*60*60*1e3;class yD{getItem(e){const t=`${encodeURIComponent(e)}`,n=document.cookie.split(";");for(let i=0;i<n.length;i++){const s=n[i],[l,...d]=decodeURIComponent(s).trim().split("="),f=d.join("=");if(l===t)return f}return""}setItem(e,t,n,i=!0){let s=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(n){const l=CD(n);s+=`expires=${l};`}i&&(s+="Secure;"),document.cookie=s}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(n=>{const i=decodeURIComponent(n).trim().split("=");t.push(i[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function CD(r){const e=new Date;return new Date(e.getTime()+r*vD).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ad extends gi{constructor(e,t,n,i,s,l){super(e,n,i,s),this.cacheConfig=t,this.logger=i,this.internalStorage=new Sd,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new yD,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=l}setupBrowserStorage(e){try{switch(e){case Ht.LocalStorage:return new mD;case Ht.SessionStorage:return new pD;case Ht.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=Ht.MemoryStorage,new Sd}migrateCacheEntries(){const e=`${P.CACHE_PREFIX}.${ct.ID_TOKEN}`,t=`${P.CACHE_PREFIX}.${ct.CLIENT_INFO}`,n=`${P.CACHE_PREFIX}.${ct.ERROR}`,i=`${P.CACHE_PREFIX}.${ct.ERROR_DESC}`,s=this.browserStorage.getItem(e),l=this.browserStorage.getItem(t),d=this.browserStorage.getItem(n),f=this.browserStorage.getItem(i),g=[s,l,d,f];[ct.ID_TOKEN,ct.CLIENT_INFO,ct.ERROR,ct.ERROR_DESC].forEach((v,C)=>{const S=g[C];S&&this.setTemporaryCache(v,S,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Lr.ACCOUNT_KEYS),t=this.getItem(`${Lr.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(i=>{if(this.isCredentialKey(i)){const s=this.getItem(i);if(s){const l=this.validateAndParseJson(s);if(l&&l.hasOwnProperty("credentialType"))switch(l.credentialType){case ne.ID_TOKEN:if(tp(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.ID_TOKEN);return}else 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: ${i}`);break;case ne.ACCESS_TOKEN:case ne.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(ep(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.ACCESS_TOKEN);return}else 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: ${i}`);break;case ne.REFRESH_TOKEN:if(np(l)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${i} found, saving key to token key map`);const d=l,f=this.updateCredentialCacheKey(i,d);this.addTokenKey(f,ne.REFRESH_TOKEN);return}else 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: ${i}`);break}}}if(this.isAccountKey(i)){const s=this.getItem(i);if(s){const l=this.validateAndParseJson(s);l&&at.isAccountEntity(l)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${i} found, saving key to account key map`),this.addAccountKeyToMap(i))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{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 n=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,n,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const n=this.validateAndParseJson(t);return!n||!at.isAccountEntity(n)?(this.removeAccountKeyFromMap(e),null):gi.toObject(new at,n)}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(Lr.ACCOUNT_KEYS);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();t.indexOf(e)===-1?(t.push(e),this.setItem(Lr.ACCOUNT_KEYS,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(),n=t.indexOf(e);n>-1?(t.splice(n,1),this.setItem(Lr.ACCOUNT_KEYS,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,ne.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ne.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ne.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Lr.TOKEN_KEYS}.${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 n=this.getTokenKeys();switch(t){case ne.ID_TOKEN:n.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),n.idToken.push(e));break;case ne.ACCESS_TOKEN:n.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),n.accessToken.push(e));break;case ne.REFRESH_TOKEN:n.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),n.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),B(fd)}this.setItem(`${Lr.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(n))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const n=this.getTokenKeys();switch(t){case ne.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const i=n.idToken.indexOf(e);i>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),n.idToken.splice(i,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ne.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const s=n.accessToken.indexOf(e);s>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),n.accessToken.splice(s,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ne.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const l=n.refreshToken.indexOf(e);l>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),n.refreshToken.splice(l,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}`),B(fd)}this.setItem(`${Lr.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(n))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ID_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!tp(n)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),n)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ACCESS_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!ep(n)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),n)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.REFRESH_TOKEN),null;const n=this.validateAndParseJson(t);return!n||!np(n)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ne.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),n)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ii(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ne.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const n=this.validateAndParseJson(t);return!n||!uM(e,n)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),n)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=lM(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 n=this.validateAndParseJson(t);return!n||!sM(e,n)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),n)}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 n=this.validateAndParseJson(t);return n&&dM(e,n)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),n):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Os.WRAPPER_SKU,e),this.internalStorage.setItem(Os.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Os.WRAPPER_SKU)||P.EMPTY_STRING,t=this.internalStorage.getItem(Os.WRAPPER_VER)||P.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(ct.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");const i=this.generateCacheKey(ct.ACTIVE_ACCOUNT),s=this.getItem(i);if(!s)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const l=this.getAccountInfoFilteredBy({localAccountId:s});return l?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(l),l):null}const n=this.validateAndParseJson(t);return n?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:n.homeAccountId,localAccountId:n.localAccountId,tenantId:n.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(ct.ACTIVE_ACCOUNT_FILTERS),n=this.generateCacheKey(ct.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const i={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(i)),this.browserStorage.setItem(n,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(n)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const n=this.validateAndParseJson(t);return!n||!cM(e,n)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),n)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const n=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const s=this.cookieStorage.getItem(n);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),s}const i=this.temporaryCacheStorage.getItem(n);if(!i){if(this.cacheConfig.cacheLocation===Ht.LocalStorage){const s=this.browserStorage.getItem(n);if(s)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),s}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}setTemporaryCache(e,t,n){const i=n?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(i,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(i,t,void 0,this.cacheConfig.secureCookies))}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.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(P.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(P.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(k.ClearTokensAndKeysWithClaims,t);const n=this.getTokenKeys(),i=[];n.accessToken.forEach(s=>{const l=this.getAccessTokenCredential(s);l!=null&&l.requestedClaimsHash&&s.includes(l.requestedClaimsHash.toLowerCase())&&i.push(this.removeAccessToken(s))}),await Promise.all(i),i.length>0&&this.logger.warning(`${i.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):Un.startsWith(e,P.CACHE_PREFIX)||Un.startsWith(e,ct.ADAL_ID_TOKEN)?e:`${P.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Vn.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),n=this.getTemporaryCache(t);if(!n)return null;const i=this.generateAuthorityKey(n);return this.getTemporaryCache(i)}updateCacheEntries(e,t,n,i,s){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const l=this.generateStateKey(e);this.setTemporaryCache(l,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const f=this.generateAuthorityKey(e);if(this.setTemporaryCache(f,n,!1),s){const g={credential:s.homeAccountId,type:on.HOME_ACCOUNT_ID};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(g),!0)}else if(i){const g={credential:i,type:on.UPN};this.setTemporaryCache(ke.CCS_CREDENTIAL,JSON.stringify(g),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),n=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${n}`),this.resetRequestCache(n||P.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(ke.REQUEST_STATE)===-1)return;const n=this.temporaryCacheStorage.getItem(t);if(!n)return;const i=ow(this.cryptoImpl,n);i&&i.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${n}`),this.resetRequestCache(n))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=_h(JSON.stringify(e));this.setTemporaryCache(ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(ke.REQUEST_PARAMS,!0);if(!t)throw G(MC);let n;try{n=JSON.parse(nr(t))}catch(i){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${i}`),G(xC)}if(this.removeTemporaryItem(this.generateCacheKey(ke.REQUEST_PARAMS)),!n.authority){const i=this.generateAuthorityKey(e),s=this.getTemporaryCache(i);if(!s)throw G(yh);n.authority=s}return n}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(ke.NATIVE_REQUEST,!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=`${P.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${P.CACHE_PREFIX}.${ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw G(AC);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(ct.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(ct.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(ct.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(ct.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const n=t||e;if(n){const i=wo(n,nr);if(i.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),i.preferred_username;if(i.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),i.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 n=ii(t);if(e!==n){const i=this.getItem(e);if(i)return this.browserStorage.removeItem(e),this.setItem(n,i),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),n;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){var d,f,g;const n=Nc((d=e.account)==null?void 0:d.homeAccountId,(f=e.account)==null?void 0:f.environment,e.idToken,this.clientId,e.tenantId);let i;t.claims&&(i=await this.cryptoImpl.hashString(t.claims));const s=Pc((g=e.account)==null?void 0:g.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,nr,void 0,e.tokenType,void 0,t.sshKid,t.claims,i),l={idToken:n,accessToken:s};return this.saveCacheRecord(l)}async saveCacheRecord(e,t,n){try{await super.saveCacheRecord(e,t,n)}catch(i){if(i instanceof li&&this.performanceClient&&n)try{const s=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:s.refreshToken.length,cacheIdCount:s.idToken.length,cacheAtCount:s.accessToken.length},n)}catch{}throw i}}}const wD=(r,e)=>{const t={cacheLocation:Ht.MemoryStorage,temporaryCacheLocation:Ht.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new Ad(r,t,cc,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function _D(r,e,t,n){return r.verbose("getAllAccounts called"),t?e.getAllAccounts(n):[]}function TD(r,e,t){if(e.trace("getAccount called"),Object.keys(r).length===0)return e.warning("getAccount: No accountFilter provided"),null;const n=t.getAccountInfoFilteredBy(r);return n?(e.verbose("getAccount: Account matching provided filter found, returning"),n):(e.verbose("getAccount: No matching account found, returning null"),null)}function ED(r,e,t){if(e.trace("getAccountByUsername called"),!r)return e.warning("getAccountByUsername: No username provided"),null;const n=t.getAccountInfoFilteredBy({username:r});return n?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${r}`),n):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function SD(r,e,t){if(e.trace("getAccountByHomeId called"),!r)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const n=t.getAccountInfoFilteredBy({homeAccountId:r});return n?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${r}`),n):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function AD(r,e,t){if(e.trace("getAccountByLocalId called"),!r)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const n=t.getAccountInfoFilteredBy({localAccountId:r});return n?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${r}`),n):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function bD(r,e){e.setActiveAccount(r)}function ID(r){return r.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const te={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.28.1 2025-01-14 */class kD{constructor(e){this.eventCallbacks=new Map,this.logger=e||new qr({})}addEventCallback(e,t,n){if(typeof window<"u"){const i=n||iD();return this.eventCallbacks.has(i)?(this.logger.error(`Event callback with id: ${i} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(i,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${i}`),i)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,n,i){if(typeof window<"u"){const s={eventType:e,interactionType:t||null,payload:n||null,error:i||null,timestamp:Date.now()};this.eventCallbacks.forEach(([l,d],f)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${f}: ${e}`),l.apply(null,[s]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class iw{constructor(e,t,n,i,s,l,d,f,g){this.config=e,this.browserStorage=t,this.browserCrypto=n,this.networkClient=this.config.system.networkClient,this.eventHandler=s,this.navigationClient=l,this.nativeMessageHandler=f,this.correlationId=g||Sr(),this.logger=i.clone(tn.MSAL_SKU,Hc,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){at.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(at.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{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{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;return ye.getAbsoluteUrl(t,Cr())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const n={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 ma(n,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,n=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(k.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const i={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},s=e.requestAuthority||this.config.auth.authority,l=n!=null&&n.length?n==="true":this.config.auth.instanceAware,d=t&&l?this.config.auth.authority.replace(ye.getDomainFromUrl(s),t.environment):s,f=St.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),g=await F(gC,k.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(f,this.config.system.networkClient,this.browserStorage,i,this.logger,this.correlationId,this.performanceClient);if(t&&!g.isAlias(t.environment))throw Pe(iC);return g}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const RD=32;async function OD(r,e,t){r.addQueueMeasurement(k.GeneratePkceCodes,t);const n=_o(ND,k.GenerateCodeVerifier,e,r,t)(r,e,t),i=await F(PD,k.GenerateCodeChallengeFromVerifier,e,r,t)(n,r,e,t);return{verifier:n,challenge:i}}function ND(r,e,t){try{const n=new Uint8Array(RD);return _o(jx,k.GetRandomValues,e,r,t)(n),Fc(n)}catch{throw G(ph)}}async function PD(r,e,t,n){e.addQueueMeasurement(k.GenerateCodeChallengeFromVerifier,n);try{const i=await F(ZC,k.Sha256Digest,t,e,n)(r,e,n);return Fc(new Uint8Array(i))}catch{throw G(ph)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function kh(r,e,t,n){t.addQueueMeasurement(k.InitializeBaseRequest,r.correlationId);const i=r.authority||e.auth.authority,s=[...r&&r.scopes||[]],l={...r,correlationId:r.correlationId,authority:i,scopes:s};if(!l.authenticationScheme)l.authenticationScheme=Oe.BEARER,n.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(l.authenticationScheme===Oe.SSH){if(!r.sshJwk)throw Pe(Mc);if(!r.sshKid)throw Pe(nC)}n.verbose(`Authentication Scheme set to "${l.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&r.claims&&!Un.isEmptyObj(r.claims)&&(l.requestedClaimsHash=await ew(r.claims)),l}async function MD(r,e,t,n,i){n.addQueueMeasurement(k.InitializeSilentRequest,r.correlationId);const s=await F(kh,k.InitializeBaseRequest,i,n,r.correlationId)(r,t,n,i);return{...r,...s,account:e,forceRefresh:r.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ci extends iw{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await F(OD,k.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),n={...e,redirectUri:e.redirectUri,code:P.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=P.S256_CODE_CHALLENGE_METHOD,n}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||Sr(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const n=this.getLogoutHintFromIdTokenClaims(e.account);n&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=n)}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||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=ye.getAbsoluteUrl(e.postLogoutRedirectUri,Cr())):this.config.auth.postLogoutRedirectUri===null?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=ye.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,Cr())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=ye.getAbsoluteUrl(Cr(),Cr())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),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(k.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new vC(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:n,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:l}=e;this.performanceClient.addQueueMeasurement(k.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await F(this.getDiscoveredAuthority.bind(this),k.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:n,requestAzureCloudOptions:i,requestExtraQueryParameters:s,account:l}),f=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:f.loggerCallback,piiLoggingEnabled:f.piiLoggingEnabled,logLevel:f.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:tn.MSAL_SKU,version:Hc,cpu:P.EMPTY_STRING,os:P.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(k.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const n=this.getRedirectUri(e.redirectUri),i={interactionType:t},s=Vn.setRequestState(this.browserCrypto,e&&e.state||P.EMPTY_STRING,i),d={...await F(kh,k.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:n,state:s,nonce:e.nonce||Sr(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const f=e.account||this.browserStorage.getActiveAccount();if(f&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${f.homeAccountId}`,this.correlationId),d.account=f),!d.loginHint&&!f){const g=this.browserStorage.getLegacyLoginHint();g&&(d.loginHint=g)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const xD="ContentError",aw="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const DD="USER_INTERACTION_REQUIRED",LD="USER_CANCEL",BD="NO_NETWORK",UD="PERSISTENT_ERROR",VD="DISABLED",FD="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const HD=-2147186943,$D={[aw]:"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 Qn extends He{constructor(e,t,n){super(e,t),Object.setPrototypeOf(this,Qn.prototype),this.name="NativeAuthError",this.ext=n}}function ei(r){if(r.ext&&r.ext.status&&(r.ext.status===UD||r.ext.status===VD)||r.ext&&r.ext.error&&r.ext.error===HD)return!0;switch(r.errorCode){case xD:return!0;default:return!1}}function bd(r,e,t){if(t&&t.status)switch(t.status){case FD:return vd(mC);case DD:return new Fn(r,e);case LD:return G(vo);case BD:return G(gc)}return new Qn(r,$D[r]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class sw extends Ci{async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(Le.acquireTokenSilent_silentFlow),n=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),i=new bx(n,this.performanceClient);this.logger.verbose("Silent auth client created");try{const l=(await F(i.acquireCachedToken.bind(i),k.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),l}catch(s){throw s instanceof Aa&&s.errorCode===Ch&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),s}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ui extends iw{constructor(e,t,n,i,s,l,d,f,g,m,v,C){var _;super(e,t,n,i,s,l,f,g,C),this.apiId=d,this.accountId=m,this.nativeMessageHandler=g,this.nativeStorageManager=v,this.silentCacheClient=new sw(e,this.nativeStorageManager,n,i,s,l,f,g,C),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const S=this.nativeMessageHandler.getExtensionId()===si.PREFERRED_EXTENSION_ID?"chrome":(_=this.nativeMessageHandler.getExtensionId())!=null&&_.length?"unknown":void 0;this.skus=ma.makeExtraSkuString({libraryName:tn.MSAL_SKU,libraryVersion:Hc,extensionName:S,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[lx]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(k.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(k.NativeInteractionClientAcquireToken,e.correlationId),n=or();try{const i=await this.initializeNativeRequest(e);try{const g=await this.acquireTokensFromCache(this.accountId,i);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),g}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...s}=i,l={method:uo.GetToken,request:s},d=await this.nativeMessageHandler.sendMessage(l),f=this.validateNativeResponse(d);return await this.handleNativeResponse(f,i,n).then(g=>(t.end({success:!0,isNativeBroker:!0,requestId:g.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),g)).catch(g=>{throw t.end({success:!1,errorCode:g.errorCode,subErrorCode:g.subError,isNativeBroker:!0}),g})}catch(i){throw i instanceof Qn&&this.serverTelemetryManager.setNativeBrokerErrorCode(i.errorCode),i}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:Je.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),B(dd);const n=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!n)throw B(dd);try{const i=this.createSilentCacheRequest(t,n),s=await this.silentCacheClient.acquireToken(i),l={...n,idTokenClaims:s==null?void 0:s.idTokenClaims,idToken:s==null?void 0:s.idToken};return{...s,account:l}}catch(i){throw i}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...n}=e;delete n.onRedirectNavigate;const i=await this.initializeNativeRequest(n),s={method:uo.GetToken,request:i};try{const f=await this.nativeMessageHandler.sendMessage(s);this.validateNativeResponse(f)}catch(f){if(f instanceof Qn&&(this.serverTelemetryManager.setNativeBrokerErrorCode(f.errorCode),ei(f)))throw f}this.browserStorage.setTemporaryCache(ke.NATIVE_REQUEST,JSON.stringify(i),!0);const l={apiId:Le.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,l)}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 n=this.browserStorage.getCachedNativeRequest();if(!n)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:i,...s}=n;i&&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(ke.NATIVE_REQUEST));const l={method:uo.GetToken,request:s},d=or();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const f=await this.nativeMessageHandler.sendMessage(l);this.validateNativeResponse(f);const g=this.handleNativeResponse(f,s,d);this.browserStorage.setInteractionInProgress(!1);const m=await g;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),m}catch(f){throw this.browserStorage.setInteractionInProgress(!1),f}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,n){var m;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const i=wo(e.id_token,nr),s=this.createHomeAccountIdentifier(e,i),l=(m=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:m.homeAccountId;if(s!==l&&e.account.id!==t.accountId)throw bd(aw);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),f=fh(this.browserStorage,d,s,nr,i,e.client_info,void 0,i.tid,void 0,e.account.id,this.logger),g=await this.generateAuthenticationResult(e,t,i,f,d.canonicalAuthority,n);return this.cacheAccount(f),this.cacheNativeTokens(e,t,s,i,e.access_token,g.tenantId,n),g}createHomeAccountIdentifier(e,t){return at.generateHomeAccountId(e.client_info||P.EMPTY_STRING,Dn.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?Je.fromString(e.scope):Je.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Oe.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const n=new mi(this.browserCrypto),i={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw B(Xd);return n.signPopToken(e.access_token,t.keyId,i)}else return e.access_token}async generateAuthenticationResult(e,t,n,i,s,l){const d=this.addTelemetryFromNativeResponse(e),f=e.scope?Je.fromString(e.scope):Je.fromString(t.scope),g=e.account.properties||{},m=g.UID||n.oid||n.sub||P.EMPTY_STRING,v=g.TenantId||n.tid||P.EMPTY_STRING,C=sh(i.getAccountInfo(),void 0,n,e.id_token);C.nativeAccountId!==e.account.id&&(C.nativeAccountId=e.account.id);const S=await this.generatePopAccessToken(e,t),_=t.tokenType===Oe.POP?Oe.POP:Oe.BEARER;return{authority:s,uniqueId:m,tenantId:v,scopes:f.asArray(),account:C,idToken:e.id_token,idTokenClaims:n,accessToken:S,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(l+e.expires_in)*1e3),tokenType:_,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,n,i,s,l,d){const f=Nc(n,t.authority,e.id_token||"",t.clientId,i.tid||""),g=t.tokenType===Oe.POP?P.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,m=d+g,v=this.generateScopes(e,t),C=Pc(n,t.authority,s,t.clientId,i.tid||l,v.printScopes(),m,0,nr,void 0,t.tokenType,void 0,t.keyId),S={idToken:f,accessToken:C};this.nativeStorageManager.saveCacheRecord(S,t.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 Ay(qd,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(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 n=new ye(t);n.validateAsUri();const{scopes:i,...s}=e,l=new Je(i||[]);l.appendScopes(yi);const d=()=>{switch(this.apiId){case Le.ssoSilent:case Le.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),dt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case dt.NONE:case dt.CONSENT:case dt.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`),G(WC)}},f={...s,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:l.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(f.signPopToken&&e.popKid)throw G(GC);if(this.handleExtraBrokerParams(f),f.extraParameters=f.extraParameters||{},f.extraParameters.telemetry=si.MATS_TELEMETRY,e.authenticationScheme===Oe.POP){const g={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},m=new mi(this.browserCrypto);let v;if(f.keyId)v=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:f.keyId})),f.signPopToken=!1;else{const C=await F(m.generateCnf.bind(m),k.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(g,this.logger);v=C.reqCnfString,f.keyId=C.kid,f.signPopToken=!0}f.reqCnf=v}return this.addRequestSKUs(f),f}handleExtraBrokerParams(e){var s;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(uh)&&e.extraParameters.hasOwnProperty(pd)&&e.extraParameters.hasOwnProperty(mo);if(!e.embeddedClientId&&!t)return;let n="";const i=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,n=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[pd],n=e.extraParameters[mo]),e.extraParameters={child_client_id:n,child_redirect_uri:i},(s=this.performanceClient)==null||s.addFields({embeddedClientId:n,embeddedRedirectUri:i},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Xn{constructor(e,t,n,i){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=i,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=n,this.handshakeEvent=n.startMeasurement(k.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:si.CHANNEL_ID,extensionId:this.extensionId,responseId:Sr(),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((n,i)=>{this.resolvers.set(t.responseId,{resolve:n,reject:i})})}static async createProvider(e,t,n){e.trace("NativeMessageHandler - createProvider called.");try{const i=new Xn(e,t,n,si.PREFERRED_EXTENSION_ID);return await i.sendHandshakeRequest(),i}catch{const s=new Xn(e,t,n);return await s.sendHandshakeRequest(),s}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:si.CHANNEL_ID,extensionId:this.extensionId,responseId:Sr(),body:{method:uo.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,n)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:n}),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}),n(G($C)),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!==si.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===uo.HandshakeRequest){const n=this.handshakeResolvers.get(t.responseId);if(!n){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}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}),n.reject(G(KC))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,n=this.resolvers.get(t.responseId),i=this.handshakeResolvers.get(t.responseId);try{const s=t.body.method;if(s===uo.Response){if(!n)return;const l=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(l)}`),l.status!=="Success")n.reject(bd(l.code,l.description,l.ext));else if(l.result)l.result.code&&l.result.description?n.reject(bd(l.result.code,l.result.description,l.result.ext)):n.resolve(l.result);else throw Ay(qd,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(s===uo.HandshakeResponse){if(!i){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);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.end({extensionInstalled:!0,success:!0}),i.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(s){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${s}`),this.logger.errorPii(`Unable to parse ${e}`),n?n.reject(s):i&&i.reject(s)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,n,i){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!n)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(i)switch(i){case Oe.BEARER:case Oe.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.28.1 2025-01-14 */class Rh{constructor(e,t,n,i,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=n,this.logger=i,this.performanceClient=s}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(k.HandleCodeResponse,t.correlationId);let n;try{n=this.authModule.handleFragmentResponse(e,t.state)}catch(i){throw i instanceof Gr&&i.subError===vo?G(vo):i}return F(this.handleCodeResponseFromServer.bind(this),k.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(n,t)}async handleCodeResponseFromServer(e,t,n=!0){if(this.performanceClient.addQueueMeasurement(k.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await F(this.authModule.updateAuthority.bind(this.authModule),k.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),n&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const s=this.createCcsCredentials(t);s&&(this.authCodeRequest.ccsCredential=s)}return await F(this.authModule.acquireToken.bind(this.authModule),k.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:on.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:on.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function cw(r,e,t){const n=dc(r);if(!n)throw sC(r)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${r}`),G(TC)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),G(_C));return n}function KD(r,e,t){if(!r.state)throw G(vh);const n=ow(e,r.state);if(!n)throw G(EC);if(n.interactionType!==t)throw G(SC)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class zD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,d,g,m),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=f}acquireToken(e){try{const n={popupName:this.generatePopupName(e.scopes||yi,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,n)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),n.popup=this.openSizedPopup("about:blank",n),this.acquireTokenPopupAsync(e,n))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),n={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},i=e&&e.authority,s=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,n,i,s)):(this.logger.verbose("asyncPopup set to false, opening popup"),n.popup=this.openSizedPopup("about:blank",n),this.logoutPopupAsync(t,n,i,s))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var s;this.logger.verbose("acquireTokenPopupAsync called");const n=this.initializeServerTelemetryManager(Le.acquireTokenPopup),i=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,J.Popup);rw(i.authority);try{const l=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(i),d=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:i.authority,requestAzureCloudOptions:i.azureCloudOptions,requestExtraQueryParameters:i.extraQueryParameters,account:i.account}),f=Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let g;f&&(g=this.performanceClient.startMeasurement(k.FetchAccountIdWithNativeBroker,e.correlationId));const m=await d.getAuthCodeUrl({...i,nativeBroker:f}),v=new Rh(d,this.browserStorage,l,this.logger,this.performanceClient),C=this.initiateAuthRequest(m,t);this.eventHandler.emitEvent(te.POPUP_OPENED,J.Popup,{popupWindow:C},null);const S=await this.monitorPopupForHash(C,t.popupWindowParent),_=_o(cw,k.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(S,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Jn.removeThrottle(this.browserStorage,this.config.auth.clientId,l),_.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),g&&g.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw G(Sa);const O=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,_.accountId,this.nativeStorage,i.correlationId),{userRequestState:$}=Vn.parseRequestState(this.browserCrypto,i.state);return await O.acquireToken({...i,state:$,prompt:void 0})}return await v.handleCodeResponse(_,i)}catch(l){throw(s=t.popup)==null||s.close(),l instanceof He&&(l.setCorrelationId(this.correlationId),n.cacheFailedRequest(l)),l}}async logoutPopupAsync(e,t,n,i){var l,d,f,g;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(te.LOGOUT_START,J.Popup,e);const s=this.initializeServerTelemetryManager(Le.logoutPopup);try{await this.clearCacheOnLogout(e.account);const m=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:s,requestAuthority:n,account:e.account||void 0});try{m.authority.endSessionEndpoint}catch{if((l=e.account)!=null&&l.homeAccountId&&e.postLogoutRedirectUri&&m.authority.protocolMode===Tr.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Popup,e),i){const S={apiId:Le.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},_=ye.getAbsoluteUrl(i,Cr());await this.navigationClient.navigateInternal(_,S)}(f=t.popup)==null||f.close();return}}const v=m.getLogoutUri(e);this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Popup,e);const C=this.openPopup(v,t);if(this.eventHandler.emitEvent(te.POPUP_OPENED,J.Popup,{popupWindow:C},null),await this.monitorPopupForHash(C,t.popupWindowParent).catch(()=>{}),i){const S={apiId:Le.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},_=ye.getAbsoluteUrl(i,Cr());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${_}`),await this.navigationClient.navigateInternal(_,S)}else this.logger.verbose("No main window navigation requested")}catch(m){throw(g=t.popup)==null||g.close(),m instanceof He&&(m.setCorrelationId(this.correlationId),s.cacheFailedRequest(m)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(te.LOGOUT_FAILURE,J.Popup,null,m),this.eventHandler.emitEvent(te.LOGOUT_END,J.Popup),m}this.eventHandler.emitEvent(te.LOGOUT_END,J.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"),G(Bc)}monitorPopupForHash(e,t){return new Promise((n,i)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const s=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(s),i(G(vo));return}let l="";try{l=e.location.href}catch{}if(!l||l==="about:blank")return;clearInterval(s);let d="";const f=this.config.auth.OIDCOptions.serverResponseType;e&&(f===Ea.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),n(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let n;if(t.popup?(n=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),n.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),n=this.openSizedPopup(e,t)),!n)throw G(IC);return n.focus&&n.focus(),this.currentWindow=n,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),n}catch(n){throw this.logger.error("error opening popup "+n.message),this.browserStorage.setInteractionInProgress(!1),G(bC)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:n,popupWindowParent:i}){var S,_,b,O;const s=i.screenLeft?i.screenLeft:i.screenX,l=i.screenTop?i.screenTop:i.screenY,d=i.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=i.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let g=(S=n.popupSize)==null?void 0:S.width,m=(_=n.popupSize)==null?void 0:_.height,v=(b=n.popupPosition)==null?void 0:b.top,C=(O=n.popupPosition)==null?void 0:O.left;return(!g||g<0||g>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),g=tn.POPUP_WIDTH),(!m||m<0||m>f)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),m=tn.POPUP_HEIGHT),(!v||v<0||v>f)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),v=Math.max(0,f/2-tn.POPUP_HEIGHT/2+l)),(!C||C<0||C>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),C=Math.max(0,d/2-tn.POPUP_WIDTH/2+s)),i.open(e,t,`width=${g}, height=${m}, top=${v}, left=${C}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(J.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${tn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${tn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ap{constructor(e,t,n,i,s){this.authModule=e,this.browserStorage=t,this.authCodeRequest=n,this.logger=i,this.performanceClient=s}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(ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const n={apiId:Le.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,n);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,n);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),G(Bc)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const n=this.browserStorage.generateStateKey(t),i=this.browserStorage.getTemporaryCache(n);if(!i)throw B(sc,"Cached State");let s;try{s=this.authModule.handleFragmentResponse(e,i)}catch(g){throw g instanceof Gr&&g.subError===vo?G(vo):g}const l=this.browserStorage.generateNonceKey(i),d=this.browserStorage.getTemporaryCache(l);if(this.authCodeRequest.code=s.code,s.cloud_instance_host_name&&await F(this.authModule.updateAuthority.bind(this.authModule),k.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(s.cloud_instance_host_name,this.authCodeRequest.correlationId),s.nonce=d||void 0,s.state=i,s.client_info)this.authCodeRequest.clientInfo=s.client_info;else{const g=this.checkCcsCredentials();g&&(this.authCodeRequest.ccsCredential=g)}const f=await this.authModule.acquireToken(this.authCodeRequest,s);return this.browserStorage.cleanRequestByState(t),f}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{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.28.1 2025-01-14 */function WD(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const r=window.performance.getEntriesByType("navigation"),e=r.length?r[0]:void 0;return e==null?void 0:e.type}class qD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,d,g,m),this.nativeStorage=f}async acquireToken(e){const t=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,J.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const n=this.initializeServerTelemetryManager(Le.acquireTokenRedirect),i=s=>{s.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(te.RESTORE_FROM_BFCACHE,J.Redirect))};try{const s=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),l=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new Ap(l,this.browserStorage,s,this.logger,this.performanceClient),f=await l.getAuthCodeUrl({...t,nativeBroker:Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),g=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${g}`),window.addEventListener("pageshow",i),await d.initiateAuthRequest(f,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:g,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(s){throw s instanceof He&&(s.setCorrelationId(this.correlationId),n.cacheFailedRequest(s)),window.removeEventListener("pageshow",i),this.browserStorage.cleanRequestByState(t.state),s}}async handleRedirectPromise(e="",t){const n=this.initializeServerTelemetryManager(Le.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,s]=this.getRedirectResponse(e||"");if(!i)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(J.Redirect),WD()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const l=this.browserStorage.getTemporaryCache(ke.ORIGIN_URI,!0)||P.EMPTY_STRING,d=ye.removeHashFromUrl(l),f=ye.removeHashFromUrl(window.location.href);if(d===f&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),l.indexOf("#")>-1&&Zx(l),await this.handleResponse(i,n);if(this.config.auth.navigateToLoginRequestUrl){if(!Ah()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(ke.URL_HASH,s,!0);const g={apiId:Le.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let m=!0;if(!l||l==="null"){const v=tD();this.browserStorage.setTemporaryCache(ke.ORIGIN_URI,v,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),m=await this.navigationClient.navigateInternal(v,g)}else this.logger.verbose(`Navigating to loginRequestUrl: ${l}`),m=await this.navigationClient.navigateInternal(l,g);if(!m)return await this.handleResponse(i,n)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(i,n);return null}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i)),this.browserStorage.cleanRequestByInteractionType(J.Redirect),i}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Ea.QUERY?t=window.location.search:t=window.location.hash);let n=dc(t);if(n){try{KD(n,this.browserCrypto,J.Redirect)}catch(s){return s instanceof He&&this.logger.error(`Interaction type validation failed due to ${s.errorCode}: ${s.errorMessage}`),[null,""]}return Xx(window),this.logger.verbose("Hash contains known properties, returning response hash"),[n,t]}const i=this.browserStorage.getTemporaryCache(ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(ke.URL_HASH)),i&&(n=dc(i),n)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[n,i]):[null,""]}async handleResponse(e,t){const n=e.state;if(!n)throw G(vh);const i=this.browserStorage.getCachedRequest(n);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 G(Sa);const f=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,i.correlationId),{userRequestState:g}=Vn.parseRequestState(this.browserCrypto,n);return f.acquireToken({...i,state:g,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(n)})}const s=this.browserStorage.getCachedAuthority(n);if(!s)throw G(yh);const l=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:s});return Jn.removeThrottle(this.browserStorage,this.config.auth.clientId,i),new Ap(l,this.browserStorage,i,this.logger,this.performanceClient).handleCodeResponse(e,n)}async logout(e){var i,s;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),n=this.initializeServerTelemetryManager(Le.logout);try{this.eventHandler.emitEvent(te.LOGOUT_START,J.Redirect,e),await this.clearCacheOnLogout(t.account);const l={apiId:Le.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===Tr.OIDC)try{d.authority.endSessionEndpoint}catch{if((i=t.account)!=null&&i.homeAccountId){this.browserStorage.removeAccount((s=t.account)==null?void 0:s.homeAccountId),this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Redirect,t);return}}const f=d.getLogoutUri(t);if(this.eventHandler.emitEvent(te.LOGOUT_SUCCESS,J.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(f)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(f,l);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(f,l);return}}catch(l){throw l instanceof He&&(l.setCorrelationId(this.correlationId),n.cacheFailedRequest(l)),this.eventHandler.emitEvent(te.LOGOUT_FAILURE,J.Redirect,null,l),this.eventHandler.emitEvent(te.LOGOUT_END,J.Redirect),l}this.eventHandler.emitEvent(te.LOGOUT_END,J.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return ye.getAbsoluteUrl(t,Cr())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function GD(r,e,t,n,i){if(e.addQueueMeasurement(k.SilentHandlerInitiateAuthRequest,n),!r)throw t.info("Navigate url is empty"),G(Bc);return i?F(YD,k.SilentHandlerLoadFrame,t,e,n)(r,i,e,n):_o(JD,k.SilentHandlerLoadFrameSync,t,e,n)(r)}async function jD(r,e,t,n,i,s,l){return n.addQueueMeasurement(k.SilentHandlerMonitorIframeForHash,s),new Promise((d,f)=>{e<Ed&&i.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${Ed}ms). This may result in timeouts.`);const g=window.setTimeout(()=>{window.clearInterval(m),f(G(kC))},e),m=window.setInterval(()=>{let v="";const C=r.contentWindow;try{v=C?C.location.href:""}catch{}if(!v||v==="about:blank")return;let S="";C&&(l===Ea.QUERY?S=C.location.search:S=C.location.hash),window.clearTimeout(g),window.clearInterval(m),d(S)},t)}).finally(()=>{_o(QD,k.RemoveHiddenIframe,i,n,s)(r)})}function YD(r,e,t,n){return t.addQueueMeasurement(k.SilentHandlerLoadFrame,n),new Promise((i,s)=>{const l=lw();window.setTimeout(()=>{if(!l){s("Unable to load iframe");return}l.src=r,i(l)},e)})}function JD(r){const e=lw();return e.src=r,e}function lw(){const r=document.createElement("iframe");return r.className="msalSilentIframe",r.style.visibility="hidden",r.style.position="absolute",r.style.width=r.style.height="0",r.style.border="0",r.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(r),r}function QD(r){document.body===r.parentNode&&document.body.removeChild(r)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class XD extends Ci{constructor(e,t,n,i,s,l,d,f,g,m,v){super(e,t,n,i,s,l,f,m,v),this.apiId=d,this.nativeStorage=g}async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==dt.NONE&&t.prompt!==dt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${dt.NONE}`),t.prompt=dt.NONE):t.prompt=dt.NONE;const n=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,J.Silent);rw(n.authority);const i=this.initializeServerTelemetryManager(this.apiId);let s;try{return s=await F(this.createAuthCodeClient.bind(this),k.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:i,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),await F(this.silentTokenHelper.bind(this),k.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(s,n)}catch(l){if(l instanceof He&&(l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l)),!s||!(l instanceof He)||l.errorCode!==tn.INVALID_GRANT_ERROR)throw l;this.performanceClient.addFields({retryError:l.errorCode},this.correlationId);const d=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,J.Silent);return await F(this.silentTokenHelper.bind(this),k.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(s,d)}}logout(){return Promise.reject(G(Uc))}async silentTokenHelper(e,t){const n=t.correlationId;this.performanceClient.addQueueMeasurement(k.SilentIframeClientTokenHelper,n);const i=await F(this.initializeAuthorizationCodeRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,n)(t),s=await F(e.getAuthCodeUrl.bind(e),k.GetAuthCodeUrl,this.logger,this.performanceClient,n)({...t,nativeBroker:Xn.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),l=new Rh(e,this.browserStorage,i,this.logger,this.performanceClient),d=await F(GD,k.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,n)(s,this.performanceClient,this.logger,n,this.config.system.navigateFrameWait),f=this.config.auth.OIDCOptions.serverResponseType,g=await F(jD,k.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,n)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,n,f),m=_o(cw,k.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(g,f,this.logger);if(m.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw G(Sa);const v=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,m.accountId,this.browserStorage,n),{userRequestState:C}=Vn.parseRequestState(this.browserCrypto,t.state);return F(v.acquireToken.bind(v),k.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,n)({...t,state:C,prompt:t.prompt||dt.NONE})}return F(l.handleCodeResponse.bind(l),k.HandleCodeResponse,this.logger,this.performanceClient,n)(m,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class ZD extends Ci{async acquireToken(e){this.performanceClient.addQueueMeasurement(k.SilentRefreshClientAcquireToken,e.correlationId);const t=await F(kh,k.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),n={...e,...t};e.redirectUri&&(n.redirectUri=this.getRedirectUri(e.redirectUri));const i=this.initializeServerTelemetryManager(Le.acquireTokenSilent_silentFlow),s=await this.createRefreshTokenClient({serverTelemetryManager:i,authorityUrl:n.authority,azureCloudOptions:n.azureCloudOptions,account:n.account});return F(s.acquireTokenByRefreshToken.bind(s),k.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(n).catch(l=>{throw l.setCorrelationId(this.correlationId),i.cacheFailedRequest(l),l})}logout(){return Promise.reject(G(Uc))}async createRefreshTokenClient(e){const t=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new yd(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class eL{constructor(e,t,n,i){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=n,this.cryptoObj=i}loadExternalTokens(e,t,n){if(!this.isBrowserEnvironment)throw G(Vc);const i=t.id_token?wo(t.id_token,nr):void 0,s={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},l=e.authority?new St(St.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,s,this.logger,e.correlationId||Sr()):void 0,d=this.loadAccount(e,n.clientInfo||t.client_info||"",i,l),f=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),g=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,n),m=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:f,accessToken:g,refreshToken:m},i,l)}loadAccount(e,t,n,i){if(this.logger.verbose("TokenCache - loading account"),e.account){const f=at.createFromAccountInfo(e.account);return this.storage.setAccount(f),f}else if(!i||!t&&!n)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),G(BC);const s=at.generateHomeAccountId(t,i.authorityType,this.logger,this.cryptoObj,n),l=n==null?void 0:n.tid,d=fh(this.storage,i,s,nr,n,t,i.hostnameAndPort,l,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,n,i){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const s=Nc(t,n,e.id_token,this.config.auth.clientId,i);return this.storage.setIdTokenCredential(s),s}loadAccessToken(e,t,n,i,s,l){if(t.access_token)if(t.expires_in){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}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?Je.fromString(t.scope):new Je(e.scopes),f=l.expiresOn||t.expires_in+new Date().getTime()/1e3,g=l.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,m=Pc(n,i,t.access_token,this.config.auth.clientId,s,d.printScopes(),f,g,nr);return this.storage.setAccessTokenCredential(m),m}loadRefreshToken(e,t,n){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const i=Wy(t,n,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(i),i}generateAuthenticationResult(e,t,n,i){var m,v,C;let s="",l=[],d=null,f;t!=null&&t.accessToken&&(s=t.accessToken.secret,l=Je.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),f=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const g=t.account;return{authority:i?i.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:l,account:g.getAccountInfo(),idToken:((m=t.idToken)==null?void 0:m.secret)||"",idTokenClaims:n||{},accessToken:s,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:f,familyId:((v=t.refreshToken)==null?void 0:v.familyId)||"",tokenType:((C=t==null?void 0:t.accessToken)==null?void 0:C.tokenType)||"",state:e.state||"",cloudGraphHostName:g.cloudGraphHostName||"",msGraphHost:g.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class tL extends vC{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class nL extends Ci{constructor(e,t,n,i,s,l,d,f,g,m){super(e,t,n,i,s,l,f,g,m),this.apiId=d}async acquireToken(e){if(!e.code)throw G(UC);const t=await F(this.initializeAuthorizationRequest.bind(this),k.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,J.Silent),n=this.initializeServerTelemetryManager(this.apiId);try{const i={...t,code:e.code},s=await F(this.getClientConfiguration.bind(this),k.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:n,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),l=new tL(s);this.logger.verbose("Auth code client created");const d=new Rh(l,this.browserStorage,i,this.logger,this.performanceClient);return await F(d.handleCodeResponseFromServer.bind(d),k.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(i){throw i instanceof He&&(i.setCorrelationId(this.correlationId),n.cacheFailedRequest(i)),i}}logout(){return Promise.reject(G(Uc))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Gn(r){const e=r==null?void 0:r.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Ps(r,e){try{bh(r)}catch(t){throw e.end({success:!1},t),t}}class $c{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 pi(this.logger,this.performanceClient):cc,this.eventHandler=new kD(this.logger),this.browserStorage=this.isBrowserEnvironment?new Ad(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,px(this.config.auth),this.performanceClient):wD(this.config.auth.clientId,this.logger);const t={cacheLocation:Ht.MemoryStorage,temporaryCacheLocation:Ht.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new Ad(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new eL(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 n=new $c(e);return await n.initialize(t),n}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){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(te.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),n=this.config.system.allowNativeBroker,i=this.performanceClient.startMeasurement(k.InitializeClientApplication,t);if(this.eventHandler.emitEvent(te.INITIALIZE_START),n)try{this.nativeExtensionProvider=await Xn.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(s){this.logger.verbose(s)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await F(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),k.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(te.INITIALIZE_END),i.end({allowNativeBroker:n,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),nw(this.initialized),this.isBrowserEnvironment){const t=e||"";let n=this.redirectResponse.get(t);return typeof n>"u"?(n=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,n),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"),n}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),n=this.browserStorage.getCachedNativeRequest(),i=n&&Xn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,s=i?n==null?void 0:n.correlationId:this.browserStorage.getTemporaryCache(ke.CORRELATION_ID,!0)||"",l=this.performanceClient.startMeasurement(k.AcquireTokenRedirect,s);this.eventHandler.emitEvent(te.HANDLE_REDIRECT_START,J.Redirect);let d;if(i&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const f=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,n.accountId,this.nativeInternalStorage,n.correlationId);d=F(f.handleRedirectPromise.bind(f),k.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,l.event.correlationId)(this.performanceClient,l.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const f=this.createRedirectClient(s);d=F(f.handleRedirectPromise.bind(f),k.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,l.event.correlationId)(e,l)}return d.then(f=>(f?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(te.LOGIN_SUCCESS,J.Redirect,f),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Redirect,f),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),l.end({success:!0,accountType:Gn(f.account)})):l.event.errorCode?l.end({success:!1}):l.discard(),this.eventHandler.emitEvent(te.HANDLE_REDIRECT_END,J.Redirect),f)).catch(f=>{const g=f;throw t.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Redirect,null,g):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Redirect,null,g),this.eventHandler.emitEvent(te.HANDLE_REDIRECT_END,J.Redirect),l.end({success:!1},g),f})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const n=this.performanceClient.startMeasurement(k.AcquireTokenPreRedirect,t);n.add({accountType:Gn(e.account),scenarioId:e.scenarioId});const i=e.onRedirectNavigate;if(i)e.onRedirectNavigate=l=>{const d=typeof i=="function"?i(l):void 0;return d!==!1?n.end({success:!0}):n.discard(),d};else{const l=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const f=typeof l=="function"?l(d):void 0;return f!==!1?n.end({success:!0}):n.discard(),f}}const s=this.getAllAccounts().length>0;try{_p(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),s?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Redirect,e):this.eventHandler.emitEvent(te.LOGIN_START,J.Redirect,e);let l;return this.nativeExtensionProvider&&this.canUseNative(e)?l=new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,n).catch(f=>{if(f instanceof Qn&&ei(f))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(f instanceof Fn)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),f}):l=this.createRedirectClient(t).acquireToken(e),await l}catch(l){throw n.end({success:!1},l),s?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Redirect,null,l):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Redirect,null,l),l}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(k.AcquireTokenPopup,t);n.add({scenarioId:e.scenarioId,accountType:Gn(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Ps(this.initialized,n),this.browserStorage.setInteractionInProgress(!0)}catch(l){return Promise.reject(l)}const i=this.getAllAccounts();i.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Popup,e):this.eventHandler.emitEvent(te.LOGIN_START,J.Popup,e);let s;return this.canUseNative(e)?s=this.acquireTokenNative({...e,correlationId:t},Le.acquireTokenPopup).then(l=>(this.browserStorage.setInteractionInProgress(!1),n.end({success:!0,isNativeBroker:!0,accountType:Gn(l.account)}),l)).catch(l=>{if(l instanceof Qn&&ei(l))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(l instanceof Fn)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),l}):s=this.createPopupClient(t).acquireToken(e),s.then(l=>(i.length<this.getAllAccounts().length?this.eventHandler.emitEvent(te.LOGIN_SUCCESS,J.Popup,l):this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Popup,l),n.end({success:!0,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length,accountType:Gn(l.account)}),l)).catch(l=>(i.length>0?this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Popup,null,l):this.eventHandler.emitEvent(te.LOGIN_FAILURE,J.Popup,null,l),n.end({success:!1},l),Promise.reject(l)))}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(e){var s,l;const t=this.getRequestCorrelationId(e),n={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(k.SsoSilent,t),(s=this.ssoSilentMeasurement)==null||s.add({scenarioId:e.scenarioId,accountType:Gn(e.account)}),Ps(this.initialized,this.ssoSilentMeasurement),(l=this.ssoSilentMeasurement)==null||l.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(te.SSO_SILENT_START,J.Silent,n);let i;return this.canUseNative(n)?i=this.acquireTokenNative(n,Le.ssoSilent).catch(d=>{if(d instanceof Qn&&ei(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(n.correlationId).acquireToken(n);throw d}):i=this.createSilentIframeClient(n.correlationId).acquireToken(n),i.then(d=>{var f;return this.eventHandler.emitEvent(te.SSO_SILENT_SUCCESS,J.Silent,d),(f=this.ssoSilentMeasurement)==null||f.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Gn(d.account)}),d}).catch(d=>{var f;throw this.eventHandler.emitEvent(te.SSO_SILENT_FAILURE,J.Silent,null,d),(f=this.ssoSilentMeasurement)==null||f.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const n=this.performanceClient.startMeasurement(k.AcquireTokenByCode,t);Ps(this.initialized,n),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_START,J.Silent,e),n.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw G(FC);if(e.code){const i=e.code;let s=this.hybridAuthCodeResponses.get(i);return s?(this.logger.verbose("Existing acquireTokenByCode request found",t),n.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),s=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(l=>(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_SUCCESS,J.Silent,l),this.hybridAuthCodeResponses.delete(i),n.end({success:!0,isNativeBroker:l.fromNativeBroker,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length,accountType:Gn(l.account)}),l)).catch(l=>{throw this.hybridAuthCodeResponses.delete(i),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_FAILURE,J.Silent,null,l),n.end({success:!1},l),l}),this.hybridAuthCodeResponses.set(i,s)),await s}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const i=await this.acquireTokenNative({...e,correlationId:t},Le.acquireTokenByCode,e.nativeAccountId).catch(s=>{throw s instanceof Qn&&ei(s)&&(this.nativeExtensionProvider=void 0),s});return n.end({accountType:Gn(i.account),success:!0}),i}else throw G(HC);else throw G(VC)}catch(i){throw this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_BY_CODE_FAILURE,J.Silent,null,i),n.end({success:!1},i),i}}async acquireTokenByCodeAsync(e){var i;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(k.AcquireTokenByCodeAsync,e.correlationId),(i=this.acquireTokenByCodeAsyncMeasurement)==null||i.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(s=>{var l;return(l=this.acquireTokenByCodeAsyncMeasurement)==null||l.end({success:!0,fromCache:s.fromCache,isNativeBroker:s.fromNativeBroker}),s}).catch(s=>{var l;throw(l=this.acquireTokenByCodeAsyncMeasurement)==null||l.end({success:!1},s),s}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(k.AcquireTokenFromCache,e.correlationId),t){case Zt.Default:case Zt.AccessToken:case Zt.AccessTokenAndRefreshToken:const n=this.createSilentCacheClient(e.correlationId);return F(n.acquireToken.bind(n),k.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw B(yr)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(k.AcquireTokenByRefreshToken,e.correlationId),t){case Zt.Default:case Zt.AccessTokenAndRefreshToken:case Zt.RefreshToken:case Zt.RefreshTokenAndNetwork:const n=this.createSilentRefreshClient(e.correlationId);return F(n.acquireToken.bind(n),k.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw B(yr)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(k.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return F(t.acquireToken.bind(t),k.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);return _p(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return bh(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return _D(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return TD(e,this.logger,this.browserStorage)}getAccountByUsername(e){return ED(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return SD(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return AD(e,this.logger,this.browserStorage)}setActiveAccount(e){bD(e,this.browserStorage)}getActiveAccount(){return ID(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const n=at.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(n),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,n){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw G(Sa);return new ui(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,n||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Xn.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 dt.NONE:case dt.CONSENT:case dt.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):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new zD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new qD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new XD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new sw(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new ZD(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new nL(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,Le.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return tw(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(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(){typeof window>"u"||(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){var t;try{(t=e.key)!=null&&t.includes(ct.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(te.ACTIVE_ACCOUNT_CHANGED);const n=e.newValue||e.oldValue;if(!n)return;const i=JSON.parse(n);if(typeof i!="object"||!at.isAccountEntity(i))return;const l=gi.toObject(new at,i).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(te.ACCOUNT_ADDED,void 0,l)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(te.ACCOUNT_REMOVED,void 0,l))}catch{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!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?Sr():P.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||yp})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||yp})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),n=this.performanceClient.startMeasurement(k.AcquireTokenSilent,t);n.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Ps(this.initialized,n),this.logger.verbose("acquireTokenSilent called",t);const i=e.account||this.getActiveAccount();if(!i)throw G(PC);n.add({accountType:Gn(i)});const s={clientId:this.config.auth.clientId,authority:e.authority||P.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:i.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},l=JSON.stringify(s),d=this.activeSilentTokenRequests.get(l);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const f=F(this.acquireTokenSilentAsync.bind(this),k.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},i).then(g=>(this.activeSilentTokenRequests.delete(l),n.end({success:!0,fromCache:g.fromCache,isNativeBroker:g.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:g.accessToken.length,idTokenSize:g.idToken.length}),g)).catch(g=>{throw this.activeSilentTokenRequests.delete(l),n.end({success:!1},g),g});return this.activeSilentTokenRequests.set(l,f),{...await f,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),n.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const n=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(k.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_START,J.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",n);const i=await F(MD,k.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),s=e.cacheLookupPolicy||Zt.Default;return this.acquireTokenSilentNoIframe(i,s).catch(async d=>{if(rL(d,s))if(this.activeIframeRequest)if(s!==Zt.Skip){const[g,m]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${m}`,i.correlationId);const v=this.performanceClient.startMeasurement(k.AwaitConcurrentIframe,i.correlationId);v.add({awaitIframeCorrelationId:m});const C=await g;if(v.end({success:C}),C)return this.logger.verbose(`Parallel iframe request with correlationId: ${m} succeeded. Retrying cache and/or RT redemption`,i.correlationId),this.acquireTokenSilentNoIframe(i,s);throw this.logger.info(`Iframe request with correlationId: ${m} failed. Interaction is required.`),d}else 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.",i.correlationId),F(this.acquireTokenBySilentIframe.bind(this),k.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i);else{let g;return this.activeIframeRequest=[new Promise(m=>{g=m}),i.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",i.correlationId),F(this.acquireTokenBySilentIframe.bind(this),k.AcquireTokenBySilentIframe,this.logger,this.performanceClient,i.correlationId)(i).then(m=>(g(!0),m)).catch(m=>{throw g(!1),m}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_SUCCESS,J.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_FAILURE,J.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",n)})}async acquireTokenSilentNoIframe(e,t){return Xn.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,Le.acquireTokenSilent_silentFlow).catch(async n=>{throw n instanceof Qn&&ei(n)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,B(yr)):n})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),F(this.acquireTokenFromCache.bind(this),k.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(n=>{if(t===Zt.AccessToken)throw n;return this.eventHandler.emitEvent(te.ACQUIRE_TOKEN_NETWORK_START,J.Silent,e),F(this.acquireTokenByRefreshToken.bind(this),k.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function rL(r,e){const t=!(r instanceof Fn&&r.subError!==Lc),n=r.errorCode===tn.INVALID_GRANT_ERROR||r.errorCode===yr,i=t&&n||r.errorCode===fc||r.errorCode===hh,s=Fx.includes(e);return i&&s}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function oL(r,e){const t=new yo(r);return await t.initialize(),$c.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Oh{static async createPublicClientApplication(e){const t=await oL(e);return new Oh(e,t)}constructor(e,t){this.controller=t||new $c(new yo(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)}}const Fu=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",iL=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",aL=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",bp=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",sL={auth:{clientId:iL,authority:`https://${Fu}.b2clogin.com/${Fu}.onmicrosoft.com/${aL}`,knownAuthorities:[`${Fu}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${bp}/_/dashboard`:bp},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(r,e)=>{r===xe.Error&&console.error(e)},logLevel:xe.Warning}}},uw=r=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:"/_/dashboard",extraQueryParameters:r}),yt=new Oh(sL),Ip=c.ref(null);function dw(){async function r(e){var t;if(e)try{const n=e.idTokenClaims;if(!(n!=null&&n.aud))throw new Error("User audience (aud) is missing in ID token claims");const i=localStorage.getItem(`msal.token.keys.${n.aud}`);if(!i)throw new Error(`Token keys para ${n.aud} não encontrados no localStorage`);const s=JSON.parse(i),l=(t=s==null?void 0:s.idToken)==null?void 0:t[0];if(!l)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(l);if(!d)throw new Error(`Dados do token para ID ${l} não encontrados no localStorage`);const f=JSON.parse(d),g=f==null?void 0:f.secret;if(!g)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),Ip.value=g}catch(n){console.error("Erro ao obter token de acesso:",n)}}return{jToken:Ip,setJToken:r}}const cL=()=>process.env.JPLAN_WEBAPP__URL_AUTH||"http://localhost:5173/_/dashboard",En=c.ref(null),Wo=c.ref(null),Id=c.ref(Math.floor(Date.now()/1e3));xd.useIntervalFn(()=>lL(),1e3);function lL(){var n,i;if(!((i=(n=En.value)==null?void 0:n.idTokenClaims)!=null&&i.exp))return;const r=Math.floor(Date.now()/1e3),e=300,t=En.value.idTokenClaims.exp;Id.value=t-r-e}function Kc(){const{setJToken:r,jToken:e}=dw(),t=c.computed(()=>!!En.value),n=c.computed(()=>En.value);async function i(v){if(!t.value)switch(v){case"redirect":await d();break;case"tab":await s();break;default:await d();break}}const s=async()=>new Promise((v,C)=>{try{localStorage.clear();const S=window.open(cL());if(!S){console.error("Failed to open authentication window"),C("Failed to open authentication window");return}const _=Date.now(),b=6e4,O=setInterval(()=>{if(Date.now()-_>b||S.closed){clearInterval(O),console.error("Authentication canceled or timeout reached."),C("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(V=>V.startsWith("msal.account.keys"))&&(clearInterval(O),l(),S.close(),v())},500)}catch(S){console.error("Error in handleRedirect:",S),C(S)}}),l=async()=>{try{await yt.initialize();const v=yt.getActiveAccount();if(v)En.value=v;else{const C=await yt.handleRedirectPromise();C?(yt.setActiveAccount(C.account),En.value=yt.getActiveAccount()):console.error("Falha na autenticação")}}catch(v){console.error("Erro no processo de autenticação:",v)}En.value&&await r(En.value)},d=async()=>{try{await yt.initialize();const v=await yt.handleRedirectPromise();if(!v||yt.getAllAccounts().length===0){const C=uw();await yt.loginRedirect(C);return}yt.setActiveAccount(v.account),En.value=yt.getActiveAccount(),En.value&&await r(En.value),Wo.value="updated"}catch(v){console.error("handleRedirect failed",v)}};async function f(){Wo.value="updating";try{const v=await yt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});yt.setActiveAccount(v.account),await r(En.value),Wo.value="updated"}catch(v){console.error("Falha ao renovar token, forçando novo login.",v),Wo.value="error",await i()}}const g=async()=>{try{await yt.initialize(),localStorage.clear(),await yt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(v){console.error("Logout error",v)}};c.watch(Id,async v=>{v<=0&&Wo.value==="updated"&&await f()});const m=c.computed(()=>e.value);return{isAuthenticated:t,authState:Wo,account:n,token:m,refreshToken:f,handleRedirect:i,logout:g,refreshTime:Id}}function hw(r,e){return function(){return r.apply(e,arguments)}}const{toString:uL}=Object.prototype,{getPrototypeOf:Nh}=Object,zc=(r=>e=>{const t=uL.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Kn=r=>(r=r.toLowerCase(),e=>zc(e)===r),Wc=r=>e=>typeof e===r,{isArray:wi}=Array,va=Wc("undefined");function dL(r){return r!==null&&!va(r)&&r.constructor!==null&&!va(r.constructor)&&an(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const fw=Kn("ArrayBuffer");function hL(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&fw(r.buffer),e}const fL=Wc("string"),an=Wc("function"),gw=Wc("number"),qc=r=>r!==null&&typeof r=="object",gL=r=>r===!0||r===!1,js=r=>{if(zc(r)!=="object")return!1;const e=Nh(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},mL=Kn("Date"),pL=Kn("File"),vL=Kn("Blob"),yL=Kn("FileList"),CL=r=>qc(r)&&an(r.pipe),wL=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||an(r.append)&&((e=zc(r))==="formdata"||e==="object"&&an(r.toString)&&r.toString()==="[object FormData]"))},_L=Kn("URLSearchParams"),[TL,EL,SL,AL]=["ReadableStream","Request","Response","Headers"].map(Kn),bL=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ba(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),wi(r))for(n=0,i=r.length;n<i;n++)e.call(null,r[n],n,r);else{const s=t?Object.getOwnPropertyNames(r):Object.keys(r),l=s.length;let d;for(n=0;n<l;n++)d=s[n],e.call(null,r[d],d,r)}}function mw(r,e){e=e.toLowerCase();const t=Object.keys(r);let n=t.length,i;for(;n-- >0;)if(i=t[n],e===i.toLowerCase())return i;return null}const ho=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,pw=r=>!va(r)&&r!==ho;function kd(){const{caseless:r}=pw(this)&&this||{},e={},t=(n,i)=>{const s=r&&mw(e,i)||i;js(e[s])&&js(n)?e[s]=kd(e[s],n):js(n)?e[s]=kd({},n):wi(n)?e[s]=n.slice():e[s]=n};for(let n=0,i=arguments.length;n<i;n++)arguments[n]&&ba(arguments[n],t);return e}const IL=(r,e,t,{allOwnKeys:n}={})=>(ba(e,(i,s)=>{t&&an(i)?r[s]=hw(i,t):r[s]=i},{allOwnKeys:n}),r),kL=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),RL=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},OL=(r,e,t,n)=>{let i,s,l;const d={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),s=i.length;s-- >0;)l=i[s],(!n||n(l,r,e))&&!d[l]&&(e[l]=r[l],d[l]=!0);r=t!==!1&&Nh(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},NL=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},PL=r=>{if(!r)return null;if(wi(r))return r;let e=r.length;if(!gw(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},ML=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Nh(Uint8Array)),xL=(r,e)=>{const n=(r&&r[Symbol.iterator]).call(r);let i;for(;(i=n.next())&&!i.done;){const s=i.value;e.call(r,s[0],s[1])}},DL=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},LL=Kn("HTMLFormElement"),BL=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),kp=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),UL=Kn("RegExp"),vw=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};ba(t,(i,s)=>{let l;(l=e(i,s,r))!==!1&&(n[s]=l||i)}),Object.defineProperties(r,n)},VL=r=>{vw(r,(e,t)=>{if(an(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(an(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},FL=(r,e)=>{const t={},n=i=>{i.forEach(s=>{t[s]=!0})};return wi(r)?n(r):n(String(r).split(e)),t},HL=()=>{},$L=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e,Hu="abcdefghijklmnopqrstuvwxyz",Rp="0123456789",yw={DIGIT:Rp,ALPHA:Hu,ALPHA_DIGIT:Hu+Hu.toUpperCase()+Rp},KL=(r=16,e=yw.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;r--;)t+=e[Math.random()*n|0];return t};function zL(r){return!!(r&&an(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const WL=r=>{const e=new Array(10),t=(n,i)=>{if(qc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const s=wi(n)?[]:{};return ba(n,(l,d)=>{const f=t(l,i+1);!va(f)&&(s[d]=f)}),e[i]=void 0,s}}return n};return t(r,0)},qL=Kn("AsyncFunction"),GL=r=>r&&(qc(r)||an(r))&&an(r.then)&&an(r.catch),Cw=((r,e)=>r?setImmediate:e?((t,n)=>(ho.addEventListener("message",({source:i,data:s})=>{i===ho&&s===t&&n.length&&n.shift()()},!1),i=>{n.push(i),ho.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",an(ho.postMessage)),jL=typeof queueMicrotask<"u"?queueMicrotask.bind(ho):typeof process<"u"&&process.nextTick||Cw,N={isArray:wi,isArrayBuffer:fw,isBuffer:dL,isFormData:wL,isArrayBufferView:hL,isString:fL,isNumber:gw,isBoolean:gL,isObject:qc,isPlainObject:js,isReadableStream:TL,isRequest:EL,isResponse:SL,isHeaders:AL,isUndefined:va,isDate:mL,isFile:pL,isBlob:vL,isRegExp:UL,isFunction:an,isStream:CL,isURLSearchParams:_L,isTypedArray:ML,isFileList:yL,forEach:ba,merge:kd,extend:IL,trim:bL,stripBOM:kL,inherits:RL,toFlatObject:OL,kindOf:zc,kindOfTest:Kn,endsWith:NL,toArray:PL,forEachEntry:xL,matchAll:DL,isHTMLForm:LL,hasOwnProperty:kp,hasOwnProp:kp,reduceDescriptors:vw,freezeMethods:VL,toObjectSet:FL,toCamelCase:BL,noop:HL,toFiniteNumber:$L,findKey:mw,global:ho,isContextDefined:pw,ALPHABET:yw,generateString:KL,isSpecCompliantForm:zL,toJSONObject:WL,isAsyncFn:qL,isThenable:GL,setImmediate:Cw,asap:jL};function ue(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}N.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.status}}});const ww=ue.prototype,_w={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{_w[r]={value:r}});Object.defineProperties(ue,_w);Object.defineProperty(ww,"isAxiosError",{value:!0});ue.from=(r,e,t,n,i,s)=>{const l=Object.create(ww);return N.toFlatObject(r,l,function(f){return f!==Error.prototype},d=>d!=="isAxiosError"),ue.call(l,r.message,e,t,n,i),l.cause=r,l.name=r.name,s&&Object.assign(l,s),l};const YL=null;function Rd(r){return N.isPlainObject(r)||N.isArray(r)}function Tw(r){return N.endsWith(r,"[]")?r.slice(0,-2):r}function Op(r,e,t){return r?r.concat(e).map(function(i,s){return i=Tw(i),!t&&s?"["+i+"]":i}).join(t?".":""):e}function JL(r){return N.isArray(r)&&!r.some(Rd)}const QL=N.toFlatObject(N,{},null,function(e){return/^is[A-Z]/.test(e)});function Gc(r,e,t){if(!N.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=N.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,O){return!N.isUndefined(O[b])});const n=t.metaTokens,i=t.visitor||m,s=t.dots,l=t.indexes,f=(t.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(e);if(!N.isFunction(i))throw new TypeError("visitor must be a function");function g(_){if(_===null)return"";if(N.isDate(_))return _.toISOString();if(!f&&N.isBlob(_))throw new ue("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(_)||N.isTypedArray(_)?f&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function m(_,b,O){let $=_;if(_&&!O&&typeof _=="object"){if(N.endsWith(b,"{}"))b=n?b:b.slice(0,-2),_=JSON.stringify(_);else if(N.isArray(_)&&JL(_)||(N.isFileList(_)||N.endsWith(b,"[]"))&&($=N.toArray(_)))return b=Tw(b),$.forEach(function(U,Q){!(N.isUndefined(U)||U===null)&&e.append(l===!0?Op([b],Q,s):l===null?b:b+"[]",g(U))}),!1}return Rd(_)?!0:(e.append(Op(O,b,s),g(_)),!1)}const v=[],C=Object.assign(QL,{defaultVisitor:m,convertValue:g,isVisitable:Rd});function S(_,b){if(!N.isUndefined(_)){if(v.indexOf(_)!==-1)throw Error("Circular reference detected in "+b.join("."));v.push(_),N.forEach(_,function($,V){(!(N.isUndefined($)||$===null)&&i.call(e,$,N.isString(V)?V.trim():V,b,C))===!0&&S($,b?b.concat(V):[V])}),v.pop()}}if(!N.isObject(r))throw new TypeError("data must be an object");return S(r),e}function Np(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ph(r,e){this._pairs=[],r&&Gc(r,this,e)}const Ew=Ph.prototype;Ew.append=function(e,t){this._pairs.push([e,t])};Ew.toString=function(e){const t=e?function(n){return e.call(this,n,Np)}:Np;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function XL(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Sw(r,e,t){if(!e)return r;const n=t&&t.encode||XL;N.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let s;if(i?s=i(e,t):s=N.isURLSearchParams(e)?e.toString():new Ph(e,t).toString(n),s){const l=r.indexOf("#");l!==-1&&(r=r.slice(0,l)),r+=(r.indexOf("?")===-1?"?":"&")+s}return r}class Pp{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){N.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Aw={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ZL=typeof URLSearchParams<"u"?URLSearchParams:Ph,eB=typeof FormData<"u"?FormData:null,tB=typeof Blob<"u"?Blob:null,nB={isBrowser:!0,classes:{URLSearchParams:ZL,FormData:eB,Blob:tB},protocols:["http","https","file","blob","url","data"]},Mh=typeof window<"u"&&typeof document<"u",Od=typeof navigator=="object"&&navigator||void 0,rB=Mh&&(!Od||["ReactNative","NativeScript","NS"].indexOf(Od.product)<0),oB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",iB=Mh&&window.location.href||"http://localhost",aB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Mh,hasStandardBrowserEnv:rB,hasStandardBrowserWebWorkerEnv:oB,navigator:Od,origin:iB},Symbol.toStringTag,{value:"Module"})),It={...aB,...nB};function sB(r,e){return Gc(r,new It.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,s){return It.isNode&&N.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function cB(r){return N.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function lB(r){const e={},t=Object.keys(r);let n;const i=t.length;let s;for(n=0;n<i;n++)s=t[n],e[s]=r[s];return e}function bw(r){function e(t,n,i,s){let l=t[s++];if(l==="__proto__")return!0;const d=Number.isFinite(+l),f=s>=t.length;return l=!l&&N.isArray(i)?i.length:l,f?(N.hasOwnProp(i,l)?i[l]=[i[l],n]:i[l]=n,!d):((!i[l]||!N.isObject(i[l]))&&(i[l]=[]),e(t,n,i[l],s)&&N.isArray(i[l])&&(i[l]=lB(i[l])),!d)}if(N.isFormData(r)&&N.isFunction(r.entries)){const t={};return N.forEachEntry(r,(n,i)=>{e(cB(n),i,t,0)}),t}return null}function uB(r,e,t){if(N.isString(r))try{return(e||JSON.parse)(r),N.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const Ia={transitional:Aw,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,s=N.isObject(e);if(s&&N.isHTMLForm(e)&&(e=new FormData(e)),N.isFormData(e))return i?JSON.stringify(bw(e)):e;if(N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)||N.isReadableStream(e))return e;if(N.isArrayBufferView(e))return e.buffer;if(N.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return sB(e,this.formSerializer).toString();if((d=N.isFileList(e))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Gc(d?{"files[]":e}:e,f&&new f,this.formSerializer)}}return s||i?(t.setContentType("application/json",!1),uB(e)):e}],transformResponse:[function(e){const t=this.transitional||Ia.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(N.isResponse(e)||N.isReadableStream(e))return e;if(e&&N.isString(e)&&(n&&!this.responseType||i)){const l=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(d){if(l)throw d.name==="SyntaxError"?ue.from(d,ue.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],r=>{Ia.headers[r]={}});const dB=N.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hB=r=>{const e={};let t,n,i;return r&&r.split(`
|
57
57
|
`).forEach(function(l){i=l.indexOf(":"),t=l.substring(0,i).trim().toLowerCase(),n=l.substring(i+1).trim(),!(!t||e[t]&&dB[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},Mp=Symbol("internals");function ji(r){return r&&String(r).trim().toLowerCase()}function Ys(r){return r===!1||r==null?r:N.isArray(r)?r.map(Ys):String(r)}function fB(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const gB=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function $u(r,e,t,n,i){if(N.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!N.isString(e)){if(N.isString(n))return e.indexOf(n)!==-1;if(N.isRegExp(n))return n.test(e)}}function mB(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function pB(r,e){const t=N.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,s,l){return this[n].call(this,e,i,s,l)},configurable:!0})})}class $t{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function s(d,f,g){const m=ji(f);if(!m)throw new Error("header name must be a non-empty string");const v=N.findKey(i,m);(!v||i[v]===void 0||g===!0||g===void 0&&i[v]!==!1)&&(i[v||f]=Ys(d))}const l=(d,f)=>N.forEach(d,(g,m)=>s(g,m,f));if(N.isPlainObject(e)||e instanceof this.constructor)l(e,t);else if(N.isString(e)&&(e=e.trim())&&!gB(e))l(hB(e),t);else if(N.isHeaders(e))for(const[d,f]of e.entries())s(f,d,n);else e!=null&&s(t,e,n);return this}get(e,t){if(e=ji(e),e){const n=N.findKey(this,e);if(n){const i=this[n];if(!t)return i;if(t===!0)return fB(i);if(N.isFunction(t))return t.call(this,i,n);if(N.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ji(e),e){const n=N.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||$u(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let i=!1;function s(l){if(l=ji(l),l){const d=N.findKey(n,l);d&&(!t||$u(n,n[d],d,t))&&(delete n[d],i=!0)}}return N.isArray(e)?e.forEach(s):s(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const s=t[n];(!e||$u(this,this[s],s,e,!0))&&(delete this[s],i=!0)}return i}normalize(e){const t=this,n={};return N.forEach(this,(i,s)=>{const l=N.findKey(n,s);if(l){t[l]=Ys(i),delete t[s];return}const d=e?mB(s):String(s).trim();d!==s&&delete t[s],t[d]=Ys(i),n[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return N.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&N.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
58
58
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[Mp]=this[Mp]={accessors:{}}).accessors,i=this.prototype;function s(l){const d=ji(l);n[d]||(pB(i,l),n[d]=!0)}return N.isArray(e)?e.forEach(s):s(e),this}}$t.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);N.reduceDescriptors($t.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}});N.freezeMethods($t);function Ku(r,e){const t=this||Ia,n=e||t,i=$t.from(n.headers);let s=n.data;return N.forEach(r,function(d){s=d.call(t,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Iw(r){return!!(r&&r.__CANCEL__)}function _i(r,e,t){ue.call(this,r??"canceled",ue.ERR_CANCELED,e,t),this.name="CanceledError"}N.inherits(_i,ue,{__CANCEL__:!0});function kw(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new ue("Request failed with status code "+t.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function vB(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function yB(r,e){r=r||10;const t=new Array(r),n=new Array(r);let i=0,s=0,l;return e=e!==void 0?e:1e3,function(f){const g=Date.now(),m=n[s];l||(l=g),t[i]=f,n[i]=g;let v=s,C=0;for(;v!==i;)C+=t[v++],v=v%r;if(i=(i+1)%r,i===s&&(s=(s+1)%r),g-l<e)return;const S=m&&g-m;return S?Math.round(C*1e3/S):void 0}}function CB(r,e){let t=0,n=1e3/e,i,s;const l=(g,m=Date.now())=>{t=m,i=null,s&&(clearTimeout(s),s=null),r.apply(null,g)};return[(...g)=>{const m=Date.now(),v=m-t;v>=n?l(g,m):(i=g,s||(s=setTimeout(()=>{s=null,l(i)},n-v)))},()=>i&&l(i)]}const vc=(r,e,t=3)=>{let n=0;const i=yB(50,250);return CB(s=>{const l=s.loaded,d=s.lengthComputable?s.total:void 0,f=l-n,g=i(f),m=l<=d;n=l;const v={loaded:l,total:d,progress:d?l/d:void 0,bytes:f,rate:g||void 0,estimated:g&&d&&m?(d-l)/g:void 0,event:s,lengthComputable:d!=null,[e?"download":"upload"]:!0};r(v)},t)},xp=(r,e)=>{const t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},Dp=r=>(...e)=>N.asap(()=>r(...e)),wB=It.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,It.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(It.origin),It.navigator&&/(msie|trident)/i.test(It.navigator.userAgent)):()=>!0,_B=It.hasStandardBrowserEnv?{write(r,e,t,n,i,s){const l=[r+"="+encodeURIComponent(e)];N.isNumber(t)&&l.push("expires="+new Date(t).toGMTString()),N.isString(n)&&l.push("path="+n),N.isString(i)&&l.push("domain="+i),s===!0&&l.push("secure"),document.cookie=l.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function TB(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function EB(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function Rw(r,e){return r&&!TB(e)?EB(r,e):e}const Lp=r=>r instanceof $t?{...r}:r;function Co(r,e){e=e||{};const t={};function n(g,m,v,C){return N.isPlainObject(g)&&N.isPlainObject(m)?N.merge.call({caseless:C},g,m):N.isPlainObject(m)?N.merge({},m):N.isArray(m)?m.slice():m}function i(g,m,v,C){if(N.isUndefined(m)){if(!N.isUndefined(g))return n(void 0,g,v,C)}else return n(g,m,v,C)}function s(g,m){if(!N.isUndefined(m))return n(void 0,m)}function l(g,m){if(N.isUndefined(m)){if(!N.isUndefined(g))return n(void 0,g)}else return n(void 0,m)}function d(g,m,v){if(v in e)return n(g,m);if(v in r)return n(void 0,g)}const f={url:s,method:s,data:s,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:d,headers:(g,m,v)=>i(Lp(g),Lp(m),v,!0)};return N.forEach(Object.keys(Object.assign({},r,e)),function(m){const v=f[m]||i,C=v(r[m],e[m],m);N.isUndefined(C)&&v!==d||(t[m]=C)}),t}const Ow=r=>{const e=Co({},r);let{data:t,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:s,headers:l,auth:d}=e;e.headers=l=$t.from(l),e.url=Sw(Rw(e.baseURL,e.url),r.params,r.paramsSerializer),d&&l.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let f;if(N.isFormData(t)){if(It.hasStandardBrowserEnv||It.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if((f=l.getContentType())!==!1){const[g,...m]=f?f.split(";").map(v=>v.trim()).filter(Boolean):[];l.setContentType([g||"multipart/form-data",...m].join("; "))}}if(It.hasStandardBrowserEnv&&(n&&N.isFunction(n)&&(n=n(e)),n||n!==!1&&wB(e.url))){const g=i&&s&&_B.read(s);g&&l.set(i,g)}return e},SB=typeof XMLHttpRequest<"u",AB=SB&&function(r){return new Promise(function(t,n){const i=Ow(r);let s=i.data;const l=$t.from(i.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:g}=i,m,v,C,S,_;function b(){S&&S(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(m),i.signal&&i.signal.removeEventListener("abort",m)}let O=new XMLHttpRequest;O.open(i.method.toUpperCase(),i.url,!0),O.timeout=i.timeout;function $(){if(!O)return;const U=$t.from("getAllResponseHeaders"in O&&O.getAllResponseHeaders()),se={data:!d||d==="text"||d==="json"?O.responseText:O.response,status:O.status,statusText:O.statusText,headers:U,config:r,request:O};kw(function(z){t(z),b()},function(z){n(z),b()},se),O=null}"onloadend"in O?O.onloadend=$:O.onreadystatechange=function(){!O||O.readyState!==4||O.status===0&&!(O.responseURL&&O.responseURL.indexOf("file:")===0)||setTimeout($)},O.onabort=function(){O&&(n(new ue("Request aborted",ue.ECONNABORTED,r,O)),O=null)},O.onerror=function(){n(new ue("Network Error",ue.ERR_NETWORK,r,O)),O=null},O.ontimeout=function(){let Q=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const se=i.transitional||Aw;i.timeoutErrorMessage&&(Q=i.timeoutErrorMessage),n(new ue(Q,se.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,r,O)),O=null},s===void 0&&l.setContentType(null),"setRequestHeader"in O&&N.forEach(l.toJSON(),function(Q,se){O.setRequestHeader(se,Q)}),N.isUndefined(i.withCredentials)||(O.withCredentials=!!i.withCredentials),d&&d!=="json"&&(O.responseType=i.responseType),g&&([C,_]=vc(g,!0),O.addEventListener("progress",C)),f&&O.upload&&([v,S]=vc(f),O.upload.addEventListener("progress",v),O.upload.addEventListener("loadend",S)),(i.cancelToken||i.signal)&&(m=U=>{O&&(n(!U||U.type?new _i(null,r,O):U),O.abort(),O=null)},i.cancelToken&&i.cancelToken.subscribe(m),i.signal&&(i.signal.aborted?m():i.signal.addEventListener("abort",m)));const V=vB(i.url);if(V&&It.protocols.indexOf(V)===-1){n(new ue("Unsupported protocol "+V+":",ue.ERR_BAD_REQUEST,r));return}O.send(s||null)})},bB=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,i;const s=function(g){if(!i){i=!0,d();const m=g instanceof Error?g:this.reason;n.abort(m instanceof ue?m:new _i(m instanceof Error?m.message:m))}};let l=e&&setTimeout(()=>{l=null,s(new ue(`timeout ${e} of ms exceeded`,ue.ETIMEDOUT))},e);const d=()=>{r&&(l&&clearTimeout(l),l=null,r.forEach(g=>{g.unsubscribe?g.unsubscribe(s):g.removeEventListener("abort",s)}),r=null)};r.forEach(g=>g.addEventListener("abort",s));const{signal:f}=n;return f.unsubscribe=()=>N.asap(d),f}},IB=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let n=0,i;for(;n<t;)i=n+e,yield r.slice(n,i),n=i},kB=async function*(r,e){for await(const t of RB(r))yield*IB(t,e)},RB=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Bp=(r,e,t,n)=>{const i=kB(r,e);let s=0,l,d=f=>{l||(l=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:g,value:m}=await i.next();if(g){d(),f.close();return}let v=m.byteLength;if(t){let C=s+=v;t(C)}f.enqueue(new Uint8Array(m))}catch(g){throw d(g),g}},cancel(f){return d(f),i.return()}},{highWaterMark:2})},jc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Nw=jc&&typeof ReadableStream=="function",OB=jc&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),Pw=(r,...e)=>{try{return!!r(...e)}catch{return!1}},NB=Nw&&Pw(()=>{let r=!1;const e=new Request(It.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e}),Up=64*1024,Nd=Nw&&Pw(()=>N.isReadableStream(new Response("").body)),yc={stream:Nd&&(r=>r.body)};jc&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!yc[e]&&(yc[e]=N.isFunction(r[e])?t=>t[e]():(t,n)=>{throw new ue(`Response type '${e}' is not supported`,ue.ERR_NOT_SUPPORT,n)})})})(new Response);const PB=async r=>{if(r==null)return 0;if(N.isBlob(r))return r.size;if(N.isSpecCompliantForm(r))return(await new Request(It.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(N.isArrayBufferView(r)||N.isArrayBuffer(r))return r.byteLength;if(N.isURLSearchParams(r)&&(r=r+""),N.isString(r))return(await OB(r)).byteLength},MB=async(r,e)=>{const t=N.toFiniteNumber(r.getContentLength());return t??PB(e)},xB=jc&&(async r=>{let{url:e,method:t,data:n,signal:i,cancelToken:s,timeout:l,onDownloadProgress:d,onUploadProgress:f,responseType:g,headers:m,withCredentials:v="same-origin",fetchOptions:C}=Ow(r);g=g?(g+"").toLowerCase():"text";let S=bB([i,s&&s.toAbortSignal()],l),_;const b=S&&S.unsubscribe&&(()=>{S.unsubscribe()});let O;try{if(f&&NB&&t!=="get"&&t!=="head"&&(O=await MB(m,n))!==0){let se=new Request(e,{method:"POST",body:n,duplex:"half"}),we;if(N.isFormData(n)&&(we=se.headers.get("content-type"))&&m.setContentType(we),se.body){const[z,tt]=xp(O,vc(Dp(f)));n=Bp(se.body,Up,z,tt)}}N.isString(v)||(v=v?"include":"omit");const $="credentials"in Request.prototype;_=new Request(e,{...C,signal:S,method:t.toUpperCase(),headers:m.normalize().toJSON(),body:n,duplex:"half",credentials:$?v:void 0});let V=await fetch(_);const U=Nd&&(g==="stream"||g==="response");if(Nd&&(d||U&&b)){const se={};["status","statusText","headers"].forEach(Te=>{se[Te]=V[Te]});const we=N.toFiniteNumber(V.headers.get("content-length")),[z,tt]=d&&xp(we,vc(Dp(d),!0))||[];V=new Response(Bp(V.body,Up,z,()=>{tt&&tt(),b&&b()}),se)}g=g||"text";let Q=await yc[N.findKey(yc,g)||"text"](V,r);return!U&&b&&b(),await new Promise((se,we)=>{kw(se,we,{data:Q,headers:$t.from(V.headers),status:V.status,statusText:V.statusText,config:r,request:_})})}catch($){throw b&&b(),$&&$.name==="TypeError"&&/fetch/i.test($.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,r,_),{cause:$.cause||$}):ue.from($,$&&$.code,r,_)}}),Pd={http:YL,xhr:AB,fetch:xB};N.forEach(Pd,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const Vp=r=>`- ${r}`,DB=r=>N.isFunction(r)||r===null||r===!1,Mw={getAdapter:r=>{r=N.isArray(r)?r:[r];const{length:e}=r;let t,n;const i={};for(let s=0;s<e;s++){t=r[s];let l;if(n=t,!DB(t)&&(n=Pd[(l=String(t)).toLowerCase()],n===void 0))throw new ue(`Unknown adapter '${l}'`);if(n)break;i[l||"#"+s]=n}if(!n){const s=Object.entries(i).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let l=e?s.length>1?`since :
|
59
59
|
`+s.map(Vp).join(`
|
60
60
|
`):" "+Vp(s[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return n},adapters:Pd};function zu(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new _i(null,r)}function Fp(r){return zu(r),r.headers=$t.from(r.headers),r.data=Ku.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Mw.getAdapter(r.adapter||Ia.adapter)(r).then(function(n){return zu(r),n.data=Ku.call(r,r.transformResponse,n),n.headers=$t.from(n.headers),n},function(n){return Iw(n)||(zu(r),n&&n.response&&(n.response.data=Ku.call(r,r.transformResponse,n.response),n.response.headers=$t.from(n.response.headers))),Promise.reject(n)})}const xw="1.7.9",Yc={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Yc[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});const Hp={};Yc.transitional=function(e,t,n){function i(s,l){return"[Axios v"+xw+"] Transitional option '"+s+"'"+l+(n?". "+n:"")}return(s,l,d)=>{if(e===!1)throw new ue(i(l," has been removed"+(t?" in "+t:"")),ue.ERR_DEPRECATED);return t&&!Hp[l]&&(Hp[l]=!0,console.warn(i(l," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,l,d):!0}};Yc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function LB(r,e,t){if(typeof r!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const n=Object.keys(r);let i=n.length;for(;i-- >0;){const s=n[i],l=e[s];if(l){const d=r[s],f=d===void 0||l(d,s,r);if(f!==!0)throw new ue("option "+s+" must be "+f,ue.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new ue("Unknown option "+s,ue.ERR_BAD_OPTION)}}const Js={assertOptions:LB,validators:Yc},jn=Js.validators;class go{constructor(e){this.defaults=e,this.interceptors={request:new Pp,response:new Pp}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
61
|
-
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Co(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&Js.assertOptions(n,{silentJSONParsing:jn.transitional(jn.boolean),forcedJSONParsing:jn.transitional(jn.boolean),clarifyTimeoutError:jn.transitional(jn.boolean)},!1),i!=null&&(N.isFunction(i)?t.paramsSerializer={serialize:i}:Js.assertOptions(i,{encode:jn.function,serialize:jn.function},!0)),Js.assertOptions(t,{baseUrl:jn.spelling("baseURL"),withXsrfToken:jn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=s&&N.merge(s.common,s[t.method]);s&&N.forEach(["delete","get","head","post","put","patch","common"],_=>{delete s[_]}),t.headers=$t.concat(l,s);const d=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(f=f&&b.synchronous,d.unshift(b.fulfilled,b.rejected))});const g=[];this.interceptors.response.forEach(function(b){g.push(b.fulfilled,b.rejected)});let m,v=0,C;if(!f){const _=[Fp.bind(this),void 0];for(_.unshift.apply(_,d),_.push.apply(_,g),C=_.length,m=Promise.resolve(t);v<C;)m=m.then(_[v++],_[v++]);return m}C=d.length;let S=t;for(v=0;v<C;){const _=d[v++],b=d[v++];try{S=_(S)}catch(O){b.call(this,O);break}}try{m=Fp.call(this,S)}catch(_){return Promise.reject(_)}for(v=0,C=g.length;v<C;)m=m.then(g[v++],g[v++]);return m}getUri(e){e=Co(this.defaults,e);const t=Rw(e.baseURL,e.url);return Sw(t,e.params,e.paramsSerializer)}}N.forEach(["delete","get","head","options"],function(e){go.prototype[e]=function(t,n){return this.request(Co(n||{},{method:e,url:t,data:(n||{}).data}))}});N.forEach(["post","put","patch"],function(e){function t(n){return function(s,l,d){return this.request(Co(d||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}go.prototype[e]=t(),go.prototype[e+"Form"]=t(!0)});class xh{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const l=new Promise(d=>{n.subscribe(d),s=d}).then(i);return l.cancel=function(){n.unsubscribe(s)},l},e(function(s,l,d){n.reason||(n.reason=new _i(s,l,d),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xh(function(i){e=i}),cancel:e}}}function BB(r){return function(t){return r.apply(null,t)}}function UB(r){return N.isObject(r)&&r.isAxiosError===!0}const Md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Md).forEach(([r,e])=>{Md[e]=r});function Dw(r){const e=new go(r),t=hw(go.prototype.request,e);return N.extend(t,go.prototype,e,{allOwnKeys:!0}),N.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Dw(Co(r,i))},t}const Ke=Dw(Ia);Ke.Axios=go;Ke.CanceledError=_i;Ke.CancelToken=xh;Ke.isCancel=Iw;Ke.VERSION=xw;Ke.toFormData=Gc;Ke.AxiosError=ue;Ke.Cancel=Ke.CanceledError;Ke.all=function(e){return Promise.all(e)};Ke.spread=BB;Ke.isAxiosError=UB;Ke.mergeConfig=Co;Ke.AxiosHeaders=$t;Ke.formToJSON=r=>bw(N.isHTMLForm(r)?new FormData(r):r);Ke.getAdapter=Mw.getAdapter;Ke.HttpStatusCode=Md;Ke.default=Ke;const VB={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-
|
61
|
+
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Co(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:s}=t;n!==void 0&&Js.assertOptions(n,{silentJSONParsing:jn.transitional(jn.boolean),forcedJSONParsing:jn.transitional(jn.boolean),clarifyTimeoutError:jn.transitional(jn.boolean)},!1),i!=null&&(N.isFunction(i)?t.paramsSerializer={serialize:i}:Js.assertOptions(i,{encode:jn.function,serialize:jn.function},!0)),Js.assertOptions(t,{baseUrl:jn.spelling("baseURL"),withXsrfToken:jn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let l=s&&N.merge(s.common,s[t.method]);s&&N.forEach(["delete","get","head","post","put","patch","common"],_=>{delete s[_]}),t.headers=$t.concat(l,s);const d=[];let f=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(f=f&&b.synchronous,d.unshift(b.fulfilled,b.rejected))});const g=[];this.interceptors.response.forEach(function(b){g.push(b.fulfilled,b.rejected)});let m,v=0,C;if(!f){const _=[Fp.bind(this),void 0];for(_.unshift.apply(_,d),_.push.apply(_,g),C=_.length,m=Promise.resolve(t);v<C;)m=m.then(_[v++],_[v++]);return m}C=d.length;let S=t;for(v=0;v<C;){const _=d[v++],b=d[v++];try{S=_(S)}catch(O){b.call(this,O);break}}try{m=Fp.call(this,S)}catch(_){return Promise.reject(_)}for(v=0,C=g.length;v<C;)m=m.then(g[v++],g[v++]);return m}getUri(e){e=Co(this.defaults,e);const t=Rw(e.baseURL,e.url);return Sw(t,e.params,e.paramsSerializer)}}N.forEach(["delete","get","head","options"],function(e){go.prototype[e]=function(t,n){return this.request(Co(n||{},{method:e,url:t,data:(n||{}).data}))}});N.forEach(["post","put","patch"],function(e){function t(n){return function(s,l,d){return this.request(Co(d||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:l}))}}go.prototype[e]=t(),go.prototype[e+"Form"]=t(!0)});class xh{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(i=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](i);n._listeners=null}),this.promise.then=i=>{let s;const l=new Promise(d=>{n.subscribe(d),s=d}).then(i);return l.cancel=function(){n.unsubscribe(s)},l},e(function(s,l,d){n.reason||(n.reason=new _i(s,l,d),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new xh(function(i){e=i}),cancel:e}}}function BB(r){return function(t){return r.apply(null,t)}}function UB(r){return N.isObject(r)&&r.isAxiosError===!0}const Md={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Md).forEach(([r,e])=>{Md[e]=r});function Dw(r){const e=new go(r),t=hw(go.prototype.request,e);return N.extend(t,go.prototype,e,{allOwnKeys:!0}),N.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Dw(Co(r,i))},t}const Ke=Dw(Ia);Ke.Axios=go;Ke.CanceledError=_i;Ke.CancelToken=xh;Ke.isCancel=Iw;Ke.VERSION=xw;Ke.toFormData=Gc;Ke.AxiosError=ue;Ke.Cancel=Ke.CanceledError;Ke.all=function(e){return Promise.all(e)};Ke.spread=BB;Ke.isAxiosError=UB;Ke.mergeConfig=Co;Ke.AxiosHeaders=$t;Ke.formToJSON=r=>bw(N.isHTMLForm(r)?new FormData(r):r);Ke.getAdapter=Mw.getAdapter;Ke.HttpStatusCode=Md;Ke.default=Ke;const VB={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-eqcW0KTB.js")),meta:{requiresAuth:!1}},FB={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-5APDckEh.js")),meta:{requiresAuth:!1}},{isAuthenticated:$p,handleRedirect:HB}=Kc(),$B=Jc();function KB(r,e){r.addRoute(VB),r.addRoute(FB),r.beforeEach(async(t,n,i)=>{function s(d){return d.matched.some(f=>f.meta.requiresAuth)}if(!s(t))return i();if(!$p.value){ie.value=!0;try{await HB(e),await $B.__init__()}catch(d){console.error("Fail to authenticate",d),await r.push("/jplan-auth-fail")}ie.value=!1}$p.value&&i()})}const{jToken:Kp}=dw();Kc();const Dh=()=>{const r=Ke.create({headers:{"Content-Type":"application/json"}});c.watch(Kp,i=>{r.interceptors.request.use(s=>(i&&(s.headers.Authorization=`Bearer ${i}`),s))},{immediate:!0});let e=1;r.interceptors.response.use(async i=>i,async i=>{var s;if(i.config&&i.config.headers){const l=i.config;if(((s=i.response)==null?void 0:s.status)===401&&e>0){e--;try{return l.headers.Authorization=`Bearer ${Kp.value}`,await r(l)}catch(d){return Promise.reject(d)}}}return Promise.reject(i)});async function t({url:i,method:s,header:l={},body:d,baseURL:f}){try{return f&&(r.defaults.baseURL=f),(await r({url:i,method:s,headers:l,data:d})).data}catch(g){if(console.error(`Request error [${s} ${i}]:`,g),Ke.isAxiosError(g)){const{response:m,message:v}=g;throw new Error(`Axios error: ${v}, Status: ${m==null?void 0:m.status}, URL: ${i}`)}throw g}}async function n({url:i,method:s,header:l,body:d,baseURL:f}){try{f&&(r.defaults.baseURL=f);const g=await r({url:i,method:s,headers:l,data:d});return{status:g.status,header:g.headers,body:g.data}}catch(g){if(Ke.isAxiosError(g)){const{response:m,message:v}=g;console.error(`Raw Request Error: ${v}, Status: ${m==null?void 0:m.status}`)}return Promise.reject(g)}}return Object.assign(r,{_request:t,rawRequest:n})},{request:zp}=Dh(),Wp=c.ref(null),qp=c.ref("default"),Wu=c.ref(null),qu=c.ref({scope_type:"org"});function Jc(){var C,S;const{handleRedirect:r,account:e,logout:t}=Kc(),n=(S=(C=e.value)==null?void 0:C.idTokenClaims)==null?void 0:S.domain,i=c.computed(()=>({domain:n,environment:qp.value,...qu.value})),s=c.computed(()=>qu.value);async function l(){var _;(!e.value||!((_=e.value.idTokenClaims)!=null&&_.email))&&await r();try{await d(),await f()}catch{}}async function d(){var _,b;try{const O=(b=(_=e.value)==null?void 0:_.idTokenClaims)==null?void 0:b.email;if(!O)throw new Error("Email is undefined");const $=await zp({url:`https://api.jplan.com.br/platform/user/profile/?email=${O}`,method:"GET"});Wu.value=$.data??null}catch(O){console.error("Failed to fetch user profile:",O)}}async function f(){var _;try{if(!((_=Wu.value)!=null&&_.email))throw new Error("User email is undefined");const b=await zp({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});Wp.value=b.data??[]}catch(b){console.error("Failed to fetch user domains:",b)}}function g(_){qu.value=_}function m(_){qp.value=_,g(i.value)}async function v(_){const b=uw({request_domain:_});await yt.loginRedirect(b)}return{__init__:l,user:Wu,userDomains:Wp,setEnv:m,setScope:g,changeDomain:v,session:i,scope:s,logout:t}}var Ms=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zB(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var ea={exports:{}};/**
|
62
62
|
* @license
|
63
63
|
* Lodash <https://lodash.com/>
|
64
64
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
package/dist/jplan-pack.cjs.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-BfXkCROS.js");require("@vueuse/core");exports.AvatarPicture=e._sfc_main$21;exports.ColumnSettingsDialog=e._sfc_main$2;exports.ConfirmDialog=e._sfc_main$4;exports.ContextMenu=e.ContextMenu;exports.CopyButton=e._sfc_main$5;exports.DeleteAllBtn=e._sfc_main$10;exports.DotsMenu=e._sfc_main$6;exports.DotsMenuV1=e._sfc_main$7;exports.EditButton=e._sfc_main$11;exports.EventBus=e.EventBus;exports.FormHeadless=e.FormHeadless;exports.FormMetadata=e._sfc_main$8;exports.GlobalScopeFilter=e._sfc_main$22;exports.GlobalSpinner=e._sfc_main$23;exports.HttpCore=e.HttpCore;exports.JAvatar=e._sfc_main$20;exports.JBtn=e._sfc_main$9;exports.JDialog=e._sfc_main$12;exports.JForm=e._sfc_main$17;exports.JIconBtn=e._sfc_main$13;exports.JSelect=e._sfc_main$14;exports.JTextArea=e._sfc_main$15;exports.JTextField=e._sfc_main$16;Object.defineProperty(exports,"POSITION",{enumerable:!0,get:()=>e.POSITION});exports.ParentCard=e._sfc_main$19;exports.SpinnerLoader=e.SpinnerLoader;Object.defineProperty(exports,"TYPE",{enumerable:!0,get:()=>e.TYPE});exports.TabFormHeader=e._sfc_main$18;exports.TableAdvanced=e._sfc_main$1;exports.TableCard=e._sfc_main$3;exports.TableCardsView=e.TableCardsView;exports.TableHeader=e.TableHeader;exports.UiTable=e._sfc_main;exports.__spinner=e.__spinner;exports.branchInstance=e.branchInstance;exports.coreClient=e.coreClient;exports.createToastInterface=e.createToastInterface;exports.dateFormat=e.dateFormat;exports.default=e.index;exports.divisionInstance=e.divisionInstance;exports.filterQuery=e.filterQuery;exports.globalEventBus=e.globalEventBus;exports.manageUserInstance=e.manageUserInstance;exports.orgInstance=e.orgInstance;exports.provideToast=e.provideToast;exports.scopedClient=e.scopedClient;exports.setupAuthGuard=e.setupAuthGuard;exports.teamInstance=e.teamInstance;exports.toastInjectionKey=e.toastInjectionKey;exports.useAuth=e.useAuth;exports.useBranchStore=e.useBranchStore;exports.useCustomizer=e.useCustomizer;exports.useDialog=e.useDialog;exports.useDivisionStore=e.useDivisionStore;exports.useManageUserStore=e.useManageUserStore;exports.useOrganizationStore=e.useOrganizationStore;exports.useSession=e.useSession;exports.useTeamStore=e.useTeamStore;exports.useToast=e.useToast;
|
package/dist/jplan-pack.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { D as t, e as n, h as o, C as r, j as i, p as l, k as u, l as d, q as c, O as T, F as m, n as S, E as p, G as C, L as b, B as g, o as I, r as v, y as B, t as D, v as J, w as A, x as F, P as f, A as M, S as h, Q as x, z as E, d as H, f as P, g as y, T as G, b as O, K as U, Z as z, c as V, R as j, N as w, i as K, X as L, M as N, U as Q, a0 as Y, Y as _, V as k, a6 as q, s as R, $ as W, W as X, a as Z, a3 as $, H as aa, I as sa, a1 as ea, a5 as ta, a2 as na, u as oa, a4 as ra, J as ia } from "./index-
|
1
|
+
import { D as t, e as n, h as o, C as r, j as i, p as l, k as u, l as d, q as c, O as T, F as m, n as S, E as p, G as C, L as b, B as g, o as I, r as v, y as B, t as D, v as J, w as A, x as F, P as f, A as M, S as h, Q as x, z as E, d as H, f as P, g as y, T as G, b as O, K as U, Z as z, c as V, R as j, N as w, i as K, X as L, M as N, U as Q, a0 as Y, Y as _, V as k, a6 as q, s as R, $ as W, W as X, a as Z, a3 as $, H as aa, I as sa, a1 as ea, a5 as ta, a2 as na, u as oa, a4 as ra, J as ia } from "./index-BHNA2OA1.mjs";
|
2
2
|
import "@vueuse/core";
|
3
3
|
export {
|
4
4
|
t as AvatarPicture,
|