{"version":3,"file":"443.ac72c92331e21d70.js","sources":["webpack://storefronts/./node_modules/@azure/msal-react/dist/MsalContext.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/utils/utilities.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/packageMetadata.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/MsalProvider.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/hooks/useMsal.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/hooks/useIsAuthenticated.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/components/AuthenticatedTemplate.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/components/UnauthenticatedTemplate.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/hooks/useAccount.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/error/ReactAuthError.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/hooks/useMsalAuthentication.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/components/MsalAuthenticationTemplate.js","webpack://storefronts/./node_modules/@azure/msal-react/dist/components/withMsal.js"],"sourcesContent":["/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport * as React from 'react';\nimport { stubbedPublicClientApplication, InteractionStatus, Logger } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/*\r\n * Stubbed context implementation\r\n * Only used when there is no provider, which is an unsupported scenario\r\n */\r\nconst defaultMsalContext = {\r\n instance: stubbedPublicClientApplication,\r\n inProgress: InteractionStatus.None,\r\n accounts: [],\r\n logger: new Logger({}),\r\n};\r\nconst MsalContext = React.createContext(defaultMsalContext);\r\nconst MsalConsumer = MsalContext.Consumer;\n\nexport { MsalConsumer, MsalContext };\n//# sourceMappingURL=MsalContext.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction getChildrenOrFunction(children, args) {\r\n if (typeof children === \"function\") {\r\n return children(args);\r\n }\r\n return children;\r\n}\r\n/**\r\n * Helper function to determine whether 2 arrays are equal\r\n * Used to avoid unnecessary state updates\r\n * @param arrayA\r\n * @param arrayB\r\n */\r\nfunction accountArraysAreEqual(arrayA, arrayB) {\r\n if (arrayA.length !== arrayB.length) {\r\n return false;\r\n }\r\n const comparisonArray = [...arrayB];\r\n return arrayA.every((elementA) => {\r\n const elementB = comparisonArray.shift();\r\n if (!elementA || !elementB) {\r\n return false;\r\n }\r\n return (elementA.homeAccountId === elementB.homeAccountId &&\r\n elementA.localAccountId === elementB.localAccountId &&\r\n elementA.username === elementB.username);\r\n });\r\n}\r\nfunction getAccountByIdentifiers(allAccounts, accountIdentifiers) {\r\n if (allAccounts.length > 0 &&\r\n (accountIdentifiers.homeAccountId ||\r\n accountIdentifiers.localAccountId ||\r\n accountIdentifiers.username)) {\r\n const matchedAccounts = allAccounts.filter((accountObj) => {\r\n if (accountIdentifiers.username &&\r\n accountIdentifiers.username.toLowerCase() !==\r\n accountObj.username.toLowerCase()) {\r\n return false;\r\n }\r\n if (accountIdentifiers.homeAccountId &&\r\n accountIdentifiers.homeAccountId.toLowerCase() !==\r\n accountObj.homeAccountId.toLowerCase()) {\r\n return false;\r\n }\r\n if (accountIdentifiers.localAccountId &&\r\n accountIdentifiers.localAccountId.toLowerCase() !==\r\n accountObj.localAccountId.toLowerCase()) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n return matchedAccounts[0] || null;\r\n }\r\n else {\r\n return null;\r\n }\r\n}\n\nexport { accountArraysAreEqual, getAccountByIdentifiers, getChildrenOrFunction };\n//# sourceMappingURL=utilities.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\n/* eslint-disable header/header */\r\nconst name = \"@azure/msal-react\";\r\nconst version = \"2.2.0\";\n\nexport { name, version };\n//# sourceMappingURL=packageMetadata.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport React__default, { useEffect, useMemo, useReducer } from 'react';\nimport { WrapperSKU, InteractionStatus, EventMessageUtils } from '@azure/msal-browser';\nimport { MsalContext } from './MsalContext.js';\nimport { accountArraysAreEqual } from './utils/utilities.js';\nimport { version, name } from './packageMetadata.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst MsalProviderActionType = {\r\n UNBLOCK_INPROGRESS: \"UNBLOCK_INPROGRESS\",\r\n EVENT: \"EVENT\",\r\n};\r\n/**\r\n * Returns the next inProgress and accounts state based on event message\r\n * @param previousState\r\n * @param action\r\n */\r\nconst reducer = (previousState, action) => {\r\n const { type, payload } = action;\r\n let newInProgress = previousState.inProgress;\r\n switch (type) {\r\n case MsalProviderActionType.UNBLOCK_INPROGRESS:\r\n if (previousState.inProgress === InteractionStatus.Startup) {\r\n newInProgress = InteractionStatus.None;\r\n payload.logger.info(\"MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'\");\r\n }\r\n break;\r\n case MsalProviderActionType.EVENT:\r\n const message = payload.message;\r\n const status = EventMessageUtils.getInteractionStatusFromEvent(message, previousState.inProgress);\r\n if (status) {\r\n payload.logger.info(`MsalProvider - ${message.eventType} results in setting inProgress from ${previousState.inProgress} to ${status}`);\r\n newInProgress = status;\r\n }\r\n break;\r\n default:\r\n throw new Error(`Unknown action type: ${type}`);\r\n }\r\n const currentAccounts = payload.instance.getAllAccounts();\r\n if (newInProgress !== previousState.inProgress &&\r\n !accountArraysAreEqual(currentAccounts, previousState.accounts)) {\r\n // Both inProgress and accounts changed\r\n return {\r\n ...previousState,\r\n inProgress: newInProgress,\r\n accounts: currentAccounts,\r\n };\r\n }\r\n else if (newInProgress !== previousState.inProgress) {\r\n // Only only inProgress changed\r\n return {\r\n ...previousState,\r\n inProgress: newInProgress,\r\n };\r\n }\r\n else if (!accountArraysAreEqual(currentAccounts, previousState.accounts)) {\r\n // Only accounts changed\r\n return {\r\n ...previousState,\r\n accounts: currentAccounts,\r\n };\r\n }\r\n else {\r\n // Nothing changed\r\n return previousState;\r\n }\r\n};\r\n/**\r\n * MSAL context provider component. This must be rendered above any other components that use MSAL.\r\n */\r\nfunction MsalProvider({ instance, children, }) {\r\n useEffect(() => {\r\n instance.initializeWrapperLibrary(WrapperSKU.React, version);\r\n }, [instance]);\r\n // Create a logger instance for msal-react with the same options as PublicClientApplication\r\n const logger = useMemo(() => {\r\n return instance.getLogger().clone(name, version);\r\n }, [instance]);\r\n const [state, updateState] = useReducer(reducer, undefined, () => {\r\n // Lazy initialization of the initial state\r\n return {\r\n inProgress: InteractionStatus.Startup,\r\n accounts: instance.getAllAccounts(),\r\n };\r\n });\r\n useEffect(() => {\r\n const callbackId = instance.addEventCallback((message) => {\r\n updateState({\r\n payload: {\r\n instance,\r\n logger,\r\n message,\r\n },\r\n type: MsalProviderActionType.EVENT,\r\n });\r\n });\r\n logger.verbose(`MsalProvider - Registered event callback with id: ${callbackId}`);\r\n instance\r\n .initialize()\r\n .then(() => {\r\n instance\r\n .handleRedirectPromise()\r\n .catch(() => {\r\n // Errors should be handled by listening to the LOGIN_FAILURE event\r\n return;\r\n })\r\n .finally(() => {\r\n /*\r\n * If handleRedirectPromise returns a cached promise the necessary events may not be fired\r\n * This is a fallback to prevent inProgress from getting stuck in 'startup'\r\n */\r\n updateState({\r\n payload: {\r\n instance,\r\n logger,\r\n },\r\n type: MsalProviderActionType.UNBLOCK_INPROGRESS,\r\n });\r\n });\r\n })\r\n .catch(() => {\r\n // Errors should be handled by listening to the LOGIN_FAILURE event\r\n return;\r\n });\r\n return () => {\r\n // Remove callback when component unmounts or accounts change\r\n if (callbackId) {\r\n logger.verbose(`MsalProvider - Removing event callback ${callbackId}`);\r\n instance.removeEventCallback(callbackId);\r\n }\r\n };\r\n }, [instance, logger]);\r\n const contextValue = {\r\n instance,\r\n inProgress: state.inProgress,\r\n accounts: state.accounts,\r\n logger,\r\n };\r\n return (React__default.createElement(MsalContext.Provider, { value: contextValue }, children));\r\n}\n\nexport { MsalProvider };\n//# sourceMappingURL=MsalProvider.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport { useContext } from 'react';\nimport { MsalContext } from '../MsalContext.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns Msal Context values\r\n */\r\nconst useMsal = () => useContext(MsalContext);\n\nexport { useMsal };\n//# sourceMappingURL=useMsal.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport { useMemo } from 'react';\nimport { useMsal } from './useMsal.js';\nimport { InteractionStatus } from '@azure/msal-browser';\nimport { getAccountByIdentifiers } from '../utils/utilities.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isAuthenticated(allAccounts, matchAccount) {\r\n if (matchAccount &&\r\n (matchAccount.username ||\r\n matchAccount.homeAccountId ||\r\n matchAccount.localAccountId)) {\r\n return !!getAccountByIdentifiers(allAccounts, matchAccount);\r\n }\r\n return allAccounts.length > 0;\r\n}\r\n/**\r\n * Returns whether or not a user is currently signed-in. Optionally provide 1 or more accountIdentifiers to determine if a specific user is signed-in\r\n * @param matchAccount\r\n */\r\nfunction useIsAuthenticated(matchAccount) {\r\n const { accounts: allAccounts, inProgress } = useMsal();\r\n const isUserAuthenticated = useMemo(() => {\r\n if (inProgress === InteractionStatus.Startup) {\r\n return false;\r\n }\r\n return isAuthenticated(allAccounts, matchAccount);\r\n }, [allAccounts, inProgress, matchAccount]);\r\n return isUserAuthenticated;\r\n}\n\nexport { useIsAuthenticated };\n//# sourceMappingURL=useIsAuthenticated.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport React__default, { useMemo } from 'react';\nimport { getChildrenOrFunction } from '../utils/utilities.js';\nimport { useMsal } from '../hooks/useMsal.js';\nimport { useIsAuthenticated } from '../hooks/useIsAuthenticated.js';\nimport { InteractionStatus } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Renders child components if user is authenticated\r\n * @param props\r\n */\r\nfunction AuthenticatedTemplate({ username, homeAccountId, localAccountId, children, }) {\r\n const context = useMsal();\r\n const accountIdentifier = useMemo(() => {\r\n return {\r\n username,\r\n homeAccountId,\r\n localAccountId,\r\n };\r\n }, [username, homeAccountId, localAccountId]);\r\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\r\n if (isAuthenticated && context.inProgress !== InteractionStatus.Startup) {\r\n return (React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context)));\r\n }\r\n return null;\r\n}\n\nexport { AuthenticatedTemplate };\n//# sourceMappingURL=AuthenticatedTemplate.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport React__default, { useMemo } from 'react';\nimport { useMsal } from '../hooks/useMsal.js';\nimport { useIsAuthenticated } from '../hooks/useIsAuthenticated.js';\nimport { getChildrenOrFunction } from '../utils/utilities.js';\nimport { InteractionStatus } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Renders child components if user is unauthenticated\r\n * @param props\r\n */\r\nfunction UnauthenticatedTemplate({ username, homeAccountId, localAccountId, children, }) {\r\n const context = useMsal();\r\n const accountIdentifier = useMemo(() => {\r\n return {\r\n username,\r\n homeAccountId,\r\n localAccountId,\r\n };\r\n }, [username, homeAccountId, localAccountId]);\r\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\r\n if (!isAuthenticated &&\r\n context.inProgress !== InteractionStatus.Startup &&\r\n context.inProgress !== InteractionStatus.HandleRedirect) {\r\n return (React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context)));\r\n }\r\n return null;\r\n}\n\nexport { UnauthenticatedTemplate };\n//# sourceMappingURL=UnauthenticatedTemplate.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport { useState, useEffect } from 'react';\nimport { AccountEntity } from '@azure/msal-browser';\nimport { useMsal } from './useMsal.js';\nimport { getAccountByIdentifiers } from '../utils/utilities.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction getAccount(instance, accountIdentifiers) {\r\n if (!accountIdentifiers ||\r\n (!accountIdentifiers.homeAccountId &&\r\n !accountIdentifiers.localAccountId &&\r\n !accountIdentifiers.username)) {\r\n // If no account identifiers are provided, return active account\r\n return instance.getActiveAccount();\r\n }\r\n return getAccountByIdentifiers(instance.getAllAccounts(), accountIdentifiers);\r\n}\r\n/**\r\n * Given 1 or more accountIdentifiers, returns the Account object if the user is signed-in\r\n * @param accountIdentifiers\r\n */\r\nfunction useAccount(accountIdentifiers) {\r\n const { instance, inProgress, logger } = useMsal();\r\n const [account, setAccount] = useState(() => getAccount(instance, accountIdentifiers));\r\n useEffect(() => {\r\n setAccount((currentAccount) => {\r\n const nextAccount = getAccount(instance, accountIdentifiers);\r\n if (!AccountEntity.accountInfoIsEqual(currentAccount, nextAccount, true)) {\r\n logger.info(\"useAccount - Updating account\");\r\n return nextAccount;\r\n }\r\n return currentAccount;\r\n });\r\n }, [inProgress, accountIdentifiers, instance, logger]);\r\n return account;\r\n}\n\nexport { useAccount };\n//# sourceMappingURL=useAccount.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport { AuthError } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst ReactAuthErrorMessage = {\r\n invalidInteractionType: {\r\n code: \"invalid_interaction_type\",\r\n desc: \"The provided interaction type is invalid.\",\r\n },\r\n unableToFallbackToInteraction: {\r\n code: \"unable_to_fallback_to_interaction\",\r\n desc: \"Interaction is required but another interaction is already in progress. Please try again when the current interaction is complete.\",\r\n },\r\n};\r\nclass ReactAuthError extends AuthError {\r\n constructor(errorCode, errorMessage) {\r\n super(errorCode, errorMessage);\r\n Object.setPrototypeOf(this, ReactAuthError.prototype);\r\n this.name = \"ReactAuthError\";\r\n }\r\n static createInvalidInteractionTypeError() {\r\n return new ReactAuthError(ReactAuthErrorMessage.invalidInteractionType.code, ReactAuthErrorMessage.invalidInteractionType.desc);\r\n }\r\n static createUnableToFallbackToInteractionError() {\r\n return new ReactAuthError(ReactAuthErrorMessage.unableToFallbackToInteraction.code, ReactAuthErrorMessage.unableToFallbackToInteraction.desc);\r\n }\r\n}\n\nexport { ReactAuthError, ReactAuthErrorMessage };\n//# sourceMappingURL=ReactAuthError.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport { useState, useRef, useEffect, useCallback } from 'react';\nimport { InteractionStatus, InteractionType, EventType, OIDC_DEFAULT_SCOPES, InteractionRequiredAuthError } from '@azure/msal-browser';\nimport { useIsAuthenticated } from './useIsAuthenticated.js';\nimport { useMsal } from './useMsal.js';\nimport { useAccount } from './useAccount.js';\nimport { ReactAuthError } from '../error/ReactAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * If a user is not currently signed in this hook invokes a login. Failed logins can be retried using the login callback returned.\r\n * If a user is currently signed in this hook attempts to acquire a token. Subsequent token requests can use the acquireToken callback returned.\r\n * Optionally provide a request object to be used in the login/acquireToken call.\r\n * Optionally provide a specific user that should be logged in.\r\n * @param interactionType\r\n * @param authenticationRequest\r\n * @param accountIdentifiers\r\n */\r\nfunction useMsalAuthentication(interactionType, authenticationRequest, accountIdentifiers) {\r\n const { instance, inProgress, logger } = useMsal();\r\n const isAuthenticated = useIsAuthenticated(accountIdentifiers);\r\n const account = useAccount(accountIdentifiers);\r\n const [[result, error], setResponse] = useState([null, null]);\r\n // Used to prevent state updates after unmount\r\n const mounted = useRef(true);\r\n useEffect(() => {\r\n return () => {\r\n mounted.current = false;\r\n };\r\n }, []);\r\n // Boolean used to check if interaction is in progress in acquireTokenSilent fallback. Use Ref instead of state to prevent acquireToken function from being regenerated on each change to interactionInProgress value\r\n const interactionInProgress = useRef(inProgress !== InteractionStatus.None);\r\n useEffect(() => {\r\n interactionInProgress.current = inProgress !== InteractionStatus.None;\r\n }, [inProgress]);\r\n // Flag used to control when the hook calls login/acquireToken\r\n const shouldAcquireToken = useRef(true);\r\n useEffect(() => {\r\n if (!!error) {\r\n // Errors should be handled by consuming component\r\n shouldAcquireToken.current = false;\r\n return;\r\n }\r\n if (!!result) {\r\n // Token has already been acquired, consuming component/application is responsible for renewing\r\n shouldAcquireToken.current = false;\r\n return;\r\n }\r\n }, [error, result]);\r\n const login = useCallback(async (callbackInteractionType, callbackRequest) => {\r\n const loginType = callbackInteractionType || interactionType;\r\n const loginRequest = callbackRequest || authenticationRequest;\r\n switch (loginType) {\r\n case InteractionType.Popup:\r\n logger.verbose(\"useMsalAuthentication - Calling loginPopup\");\r\n return instance.loginPopup(loginRequest);\r\n case InteractionType.Redirect:\r\n // This promise is not expected to resolve due to full frame redirect\r\n logger.verbose(\"useMsalAuthentication - Calling loginRedirect\");\r\n return instance\r\n .loginRedirect(loginRequest)\r\n .then(null);\r\n case InteractionType.Silent:\r\n logger.verbose(\"useMsalAuthentication - Calling ssoSilent\");\r\n return instance.ssoSilent(loginRequest);\r\n default:\r\n throw ReactAuthError.createInvalidInteractionTypeError();\r\n }\r\n }, [instance, interactionType, authenticationRequest, logger]);\r\n const acquireToken = useCallback(async (callbackInteractionType, callbackRequest) => {\r\n const fallbackInteractionType = callbackInteractionType || interactionType;\r\n let tokenRequest;\r\n if (callbackRequest) {\r\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the callback\");\r\n tokenRequest = {\r\n ...callbackRequest,\r\n };\r\n }\r\n else if (authenticationRequest) {\r\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the hook\");\r\n tokenRequest = {\r\n ...authenticationRequest,\r\n scopes: authenticationRequest.scopes || OIDC_DEFAULT_SCOPES,\r\n };\r\n }\r\n else {\r\n logger.trace(\"useMsalAuthentication - acquireToken - No request object provided, using default request.\");\r\n tokenRequest = {\r\n scopes: OIDC_DEFAULT_SCOPES,\r\n };\r\n }\r\n if (!tokenRequest.account && account) {\r\n logger.trace(\"useMsalAuthentication - acquireToken - Attaching account to request\");\r\n tokenRequest.account = account;\r\n }\r\n const getToken = async () => {\r\n logger.verbose(\"useMsalAuthentication - Calling acquireTokenSilent\");\r\n return instance\r\n .acquireTokenSilent(tokenRequest)\r\n .catch(async (e) => {\r\n if (e instanceof InteractionRequiredAuthError) {\r\n if (!interactionInProgress.current) {\r\n logger.error(\"useMsalAuthentication - Interaction required, falling back to interaction\");\r\n return login(fallbackInteractionType, tokenRequest);\r\n }\r\n else {\r\n logger.error(\"useMsalAuthentication - Interaction required but is already in progress. Please try again, if needed, after interaction completes.\");\r\n throw ReactAuthError.createUnableToFallbackToInteractionError();\r\n }\r\n }\r\n throw e;\r\n });\r\n };\r\n return getToken()\r\n .then((response) => {\r\n if (mounted.current) {\r\n setResponse([response, null]);\r\n }\r\n return response;\r\n })\r\n .catch((e) => {\r\n if (mounted.current) {\r\n setResponse([null, e]);\r\n }\r\n throw e;\r\n });\r\n }, [\r\n instance,\r\n interactionType,\r\n authenticationRequest,\r\n logger,\r\n account,\r\n login,\r\n ]);\r\n useEffect(() => {\r\n const callbackId = instance.addEventCallback((message) => {\r\n switch (message.eventType) {\r\n case EventType.LOGIN_SUCCESS:\r\n case EventType.SSO_SILENT_SUCCESS:\r\n if (message.payload) {\r\n setResponse([\r\n message.payload,\r\n null,\r\n ]);\r\n }\r\n break;\r\n case EventType.LOGIN_FAILURE:\r\n case EventType.SSO_SILENT_FAILURE:\r\n if (message.error) {\r\n setResponse([null, message.error]);\r\n }\r\n break;\r\n }\r\n });\r\n logger.verbose(`useMsalAuthentication - Registered event callback with id: ${callbackId}`);\r\n return () => {\r\n if (callbackId) {\r\n logger.verbose(`useMsalAuthentication - Removing event callback ${callbackId}`);\r\n instance.removeEventCallback(callbackId);\r\n }\r\n };\r\n }, [instance, logger]);\r\n useEffect(() => {\r\n if (shouldAcquireToken.current &&\r\n inProgress === InteractionStatus.None) {\r\n shouldAcquireToken.current = false;\r\n if (!isAuthenticated) {\r\n logger.info(\"useMsalAuthentication - No user is authenticated, attempting to login\");\r\n login().catch(() => {\r\n // Errors are saved in state above\r\n return;\r\n });\r\n }\r\n else if (account) {\r\n logger.info(\"useMsalAuthentication - User is authenticated, attempting to acquire token\");\r\n acquireToken().catch(() => {\r\n // Errors are saved in state above\r\n return;\r\n });\r\n }\r\n }\r\n }, [isAuthenticated, account, inProgress, login, acquireToken, logger]);\r\n return {\r\n login,\r\n acquireToken,\r\n result,\r\n error,\r\n };\r\n}\n\nexport { useMsalAuthentication };\n//# sourceMappingURL=useMsalAuthentication.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport React__default, { useMemo } from 'react';\nimport { getChildrenOrFunction } from '../utils/utilities.js';\nimport { useMsal } from '../hooks/useMsal.js';\nimport { useMsalAuthentication } from '../hooks/useMsalAuthentication.js';\nimport { useIsAuthenticated } from '../hooks/useIsAuthenticated.js';\nimport { InteractionStatus } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Attempts to authenticate user if not already authenticated, then renders child components\r\n * @param props\r\n */\r\nfunction MsalAuthenticationTemplate({ interactionType, username, homeAccountId, localAccountId, authenticationRequest, loadingComponent: LoadingComponent, errorComponent: ErrorComponent, children, }) {\r\n const accountIdentifier = useMemo(() => {\r\n return {\r\n username,\r\n homeAccountId,\r\n localAccountId,\r\n };\r\n }, [username, homeAccountId, localAccountId]);\r\n const context = useMsal();\r\n const msalAuthResult = useMsalAuthentication(interactionType, authenticationRequest, accountIdentifier);\r\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\r\n if (msalAuthResult.error && context.inProgress === InteractionStatus.None) {\r\n if (!!ErrorComponent) {\r\n return React__default.createElement(ErrorComponent, { ...msalAuthResult });\r\n }\r\n throw msalAuthResult.error;\r\n }\r\n if (isAuthenticated) {\r\n return (React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, msalAuthResult)));\r\n }\r\n if (!!LoadingComponent && context.inProgress !== InteractionStatus.None) {\r\n return React__default.createElement(LoadingComponent, { ...context });\r\n }\r\n return null;\r\n}\n\nexport { MsalAuthenticationTemplate };\n//# sourceMappingURL=MsalAuthenticationTemplate.js.map\n","/*! @azure/msal-react v2.2.0 2024-11-05 */\n'use strict';\nimport React__default from 'react';\nimport { useMsal } from '../hooks/useMsal.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Higher order component wraps provided component with msal by injecting msal context values into the component's props\r\n * @param Component\r\n */\r\nconst withMsal = (Component) => {\r\n const ComponentWithMsal = (props) => {\r\n const msal = useMsal();\r\n return React__default.createElement(Component, { ...props, msalContext: msal });\r\n };\r\n const componentName = Component.displayName || Component.name || \"Component\";\r\n ComponentWithMsal.displayName = `withMsal(${componentName})`;\r\n return ComponentWithMsal;\r\n};\n\nexport { withMsal };\n//# sourceMappingURL=withMsal.js.map\n"],"names":["defaultMsalContext","MsalContext","MsalConsumer","getChildrenOrFunction","children","args","accountArraysAreEqual","arrayA","arrayB","comparisonArray","elementA","elementB","getAccountByIdentifiers","allAccounts","accountIdentifiers","matchedAccounts","accountObj","version","MsalProviderActionType","reducer","previousState","action","type","payload","newInProgress","message","status","Error","currentAccounts","MsalProvider","instance","logger","state","updateState","undefined","callbackId","contextValue","useMsal","useIsAuthenticated","matchAccount","inProgress","AuthenticatedTemplate","username","homeAccountId","localAccountId","context","isAuthenticated","UnauthenticatedTemplate","getAccount","useAccount","account","setAccount","currentAccount","nextAccount","ReactAuthError","errorCode","errorMessage","Object","useMsalAuthentication","interactionType","authenticationRequest","result","error","setResponse","mounted","interactionInProgress","shouldAcquireToken","login","callbackInteractionType","callbackRequest","loginRequest","acquireToken","tokenRequest","fallbackInteractionType","getToken","e","response","MsalAuthenticationTemplate","LoadingComponent","ErrorComponent","accountIdentifier","msalAuthResult","withMsal","Component","ComponentWithMsal","props","msal","componentName"],"mappings":"gaAaA,IAAMA,EAAqB,CACvB,SAAU,gCAA8B,CACxC,WAAY,wBAAsB,CAClC,SAAU,EAAE,CACZ,OAAQ,IAAI,QAAM,CAAC,CAAC,EACxB,EACMC,EAAc,eAAmB,CAACD,GAClCE,EAAeD,EAAY,QAAQ,CCdzC,SAASE,EAAsBC,CAAQ,CAAEC,CAAI,QACzC,AAAI,AAAoB,YAApB,OAAOD,EACAA,EAASC,GAEbD,CACX,CAOA,SAASE,EAAsBC,CAAM,CAAEC,CAAM,EACzC,GAAID,EAAO,MAAM,GAAKC,EAAO,MAAM,CAC/B,MAAO,GAEX,IAAMC,EAAkB,IAAID,EAAO,CACnC,OAAOD,EAAO,KAAK,CAAC,AAACG,IACjB,IAAMC,EAAWF,EAAgB,KAAK,SACtC,EAAKC,KAAaC,GAGVD,EAAS,aAAa,GAAKC,EAAS,aAAa,EACrDD,EAAS,cAAc,GAAKC,EAAS,cAAc,EACnDD,EAAS,QAAQ,GAAKC,EAAS,QAAQ,AAC/C,EACJ,CACA,SAASC,EAAwBC,CAAW,CAAEC,CAAkB,SAC5D,AAAID,EAAY,MAAM,CAAG,GACpBC,CAAAA,EAAmB,aAAa,EAC7BA,EAAmB,cAAc,EACjCA,EAAmB,QAAQ,AAAD,GAmBvBC,AAlBiBF,EAAY,MAAM,CAAC,AAACG,GACpCF,CAAAA,CAAAA,EAAmB,QAAQ,EAC3BA,EAAmB,QAAQ,CAAC,WAAW,KACnCE,EAAW,QAAQ,CAAC,WAAW,EAAC,GAGpCF,CAAAA,CAAAA,EAAmB,aAAa,EAChCA,EAAmB,aAAa,CAAC,WAAW,KACxCE,EAAW,aAAa,CAAC,WAAW,EA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