{"version":3,"file":"vendor-C5NFNwzY.js","sources":["../../node_modules/object-assign/index.js","../../node_modules/react/cjs/react.production.min.js","../../node_modules/react/index.js","../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../node_modules/react/jsx-runtime.js","../../node_modules/scheduler/cjs/scheduler.production.min.js","../../node_modules/scheduler/index.js","../../node_modules/react-dom/cjs/react-dom.production.min.js","../../node_modules/react-dom/index.js","../../node_modules/tslib/tslib.es6.mjs","../../node_modules/react-use/esm/useMountedState.js","../../node_modules/react-use/esm/useAsyncFn.js","../../node_modules/react-use/esm/useAsync.js","../../node_modules/react-use/esm/misc/util.js","../../node_modules/react-use/esm/useToggle.js","../../node_modules/react-use/esm/useTimeoutFn.js","../../node_modules/react-use/esm/useDebounce.js","../../node_modules/react-use/esm/useEffectOnce.js","../../node_modules/react-use/esm/useLocalStorage.js","../../node_modules/react-use/esm/useMount.js","../../node_modules/@azure/msal-browser/dist/_virtual/_tslib.js","../../node_modules/@azure/msal-common/dist/_virtual/_tslib.js","../../node_modules/@azure/msal-common/dist/utils/Constants.js","../../node_modules/@azure/msal-common/dist/error/AuthError.js","../../node_modules/@azure/msal-common/dist/crypto/ICrypto.js","../../node_modules/@azure/msal-common/dist/error/ClientAuthError.js","../../node_modules/@azure/msal-common/dist/utils/StringUtils.js","../../node_modules/@azure/msal-common/dist/logger/Logger.js","../../node_modules/@azure/msal-common/dist/packageMetadata.js","../../node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js","../../node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js","../../node_modules/@azure/msal-common/dist/request/ScopeSet.js","../../node_modules/@azure/msal-common/dist/account/ClientInfo.js","../../node_modules/@azure/msal-common/dist/authority/AuthorityType.js","../../node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js","../../node_modules/@azure/msal-common/dist/account/AuthToken.js","../../node_modules/@azure/msal-common/dist/cache/CacheManager.js","../../node_modules/@azure/msal-common/dist/config/ClientConfiguration.js","../../node_modules/@azure/msal-common/dist/error/ServerError.js","../../node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js","../../node_modules/@azure/msal-common/dist/network/NetworkManager.js","../../node_modules/@azure/msal-common/dist/account/CcsCredential.js","../../node_modules/@azure/msal-common/dist/request/RequestValidator.js","../../node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js","../../node_modules/@azure/msal-common/dist/client/BaseClient.js","../../node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js","../../node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js","../../node_modules/@azure/msal-common/dist/utils/TimeUtils.js","../../node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js","../../node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js","../../node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js","../../node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js","../../node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js","../../node_modules/@azure/msal-common/dist/url/UrlString.js","../../node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js","../../node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js","../../node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js","../../node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js","../../node_modules/@azure/msal-common/dist/response/ResponseHandler.js","../../node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js","../../node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js","../../node_modules/@azure/msal-common/dist/client/SilentFlowClient.js","../../node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js","../../node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js","../../node_modules/@azure/msal-common/dist/authority/ProtocolMode.js","../../node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js","../../node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js","../../node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js","../../node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js","../../node_modules/@azure/msal-common/dist/authority/Authority.js","../../node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js","../../node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js","../../node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js","../../node_modules/@azure/msal-common/dist/network/INetworkModule.js","../../node_modules/@azure/msal-common/dist/error/JoseHeaderError.js","../../node_modules/@azure/msal-common/dist/crypto/JoseHeader.js","../../node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js","../../node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js","../../node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js","../../node_modules/@azure/msal-browser/dist/error/BrowserAuthError.js","../../node_modules/@azure/msal-browser/dist/utils/BrowserConstants.js","../../node_modules/@azure/msal-browser/dist/error/BrowserConfigurationAuthError.js","../../node_modules/@azure/msal-browser/dist/cache/BrowserStorage.js","../../node_modules/@azure/msal-browser/dist/cache/MemoryStorage.js","../../node_modules/@azure/msal-browser/dist/utils/BrowserProtocolUtils.js","../../node_modules/@azure/msal-browser/dist/cache/BrowserCacheManager.js","../../node_modules/@azure/msal-browser/dist/packageMetadata.js","../../node_modules/@azure/msal-browser/dist/network/FetchClient.js","../../node_modules/@azure/msal-browser/dist/network/XhrClient.js","../../node_modules/@azure/msal-browser/dist/utils/BrowserUtils.js","../../node_modules/@azure/msal-browser/dist/interaction_client/BaseInteractionClient.js","../../node_modules/@azure/msal-browser/dist/interaction_client/StandardInteractionClient.js","../../node_modules/@azure/msal-browser/dist/interaction_handler/InteractionHandler.js","../../node_modules/@azure/msal-browser/dist/interaction_handler/RedirectHandler.js","../../node_modules/@azure/msal-browser/dist/event/EventType.js","../../node_modules/@azure/msal-browser/dist/error/NativeAuthError.js","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentCacheClient.js","../../node_modules/@azure/msal-browser/dist/interaction_client/NativeInteractionClient.js","../../node_modules/@azure/msal-browser/dist/broker/nativeBroker/NativeMessageHandler.js","../../node_modules/@azure/msal-browser/dist/interaction_client/RedirectClient.js","../../node_modules/@azure/msal-browser/dist/interaction_client/PopupClient.js","../../node_modules/@azure/msal-browser/dist/navigation/NavigationClient.js","../../node_modules/@azure/msal-browser/dist/config/Configuration.js","../../node_modules/@azure/msal-browser/dist/interaction_handler/SilentHandler.js","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentIframeClient.js","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentRefreshClient.js","../../node_modules/@azure/msal-browser/dist/event/EventHandler.js","../../node_modules/@azure/msal-browser/dist/utils/MathUtils.js","../../node_modules/@azure/msal-browser/dist/crypto/GuidGenerator.js","../../node_modules/@azure/msal-browser/dist/utils/BrowserStringUtils.js","../../node_modules/@azure/msal-browser/dist/encode/Base64Encode.js","../../node_modules/@azure/msal-browser/dist/encode/Base64Decode.js","../../node_modules/@azure/msal-browser/dist/crypto/PkceGenerator.js","../../node_modules/@azure/msal-browser/dist/crypto/ModernBrowserCrypto.js","../../node_modules/@azure/msal-browser/dist/crypto/MsrBrowserCrypto.js","../../node_modules/@azure/msal-browser/dist/crypto/MsBrowserCrypto.js","../../node_modules/@azure/msal-browser/dist/crypto/BrowserCrypto.js","../../node_modules/@azure/msal-browser/dist/cache/DatabaseStorage.js","../../node_modules/@azure/msal-browser/dist/cache/AsyncMemoryStorage.js","../../node_modules/@azure/msal-browser/dist/cache/CryptoKeyStore.js","../../node_modules/@azure/msal-browser/dist/crypto/CryptoOps.js","../../node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceMeasurement.js","../../node_modules/@azure/msal-browser/dist/telemetry/BrowserPerformanceClient.js","../../node_modules/@azure/msal-browser/dist/cache/TokenCache.js","../../node_modules/@azure/msal-browser/dist/interaction_client/HybridSpaAuthorizationCodeClient.js","../../node_modules/@azure/msal-browser/dist/interaction_client/SilentAuthCodeClient.js","../../node_modules/@azure/msal-browser/dist/app/ClientApplication.js","../../node_modules/@azure/msal-browser/dist/app/PublicClientApplication.js","../../node_modules/@azure/msal-browser/dist/app/IPublicClientApplication.js","../../node_modules/@azure/msal-browser/dist/event/EventMessage.js","../../node_modules/@azure/msal-react/dist/msal-react.esm.js","../../node_modules/@bps/msal/dist/lib/_virtual/_tslib.js","../../node_modules/@bps/msal/dist/lib/Authenticator.js","../../node_modules/@bps/msal/node_modules/@azure/msal-react/dist/msal-react.esm.js","../../node_modules/@mui/material/colors/common.js","../../node_modules/@mui/material/colors/red.js","../../node_modules/@mui/material/colors/purple.js","../../node_modules/@mui/material/colors/blue.js","../../node_modules/@mui/material/colors/lightBlue.js","../../node_modules/@mui/material/colors/teal.js","../../node_modules/@mui/material/colors/green.js","../../node_modules/@mui/material/colors/orange.js","../../node_modules/@mui/material/colors/grey.js","../../node_modules/@mui/utils/esm/formatMuiErrorMessage/formatMuiErrorMessage.js","../../node_modules/@mui/material/styles/identifier.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js","../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js","../../node_modules/@emotion/react/dist/emotion-element-5486c51c.browser.esm.js","../../node_modules/@babel/runtime/helpers/extends.js","../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js","../../node_modules/@emotion/styled/dist/emotion-styled.browser.esm.js","../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../node_modules/prop-types/factoryWithThrowingShims.js","../../node_modules/prop-types/index.js","../../node_modules/@mui/styled-engine/StyledEngineProvider/StyledEngineProvider.js","../../node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/styled-engine/index.js","../../node_modules/@mui/utils/esm/deepmerge/deepmerge.js","../../node_modules/@mui/system/esm/createTheme/createBreakpoints.js","../../node_modules/@mui/system/esm/createTheme/shape.js","../../node_modules/@mui/system/esm/merge.js","../../node_modules/@mui/system/esm/breakpoints.js","../../node_modules/@mui/utils/esm/capitalize/capitalize.js","../../node_modules/@mui/system/esm/style.js","../../node_modules/@mui/system/esm/memoize.js","../../node_modules/@mui/system/esm/spacing.js","../../node_modules/@mui/system/esm/createTheme/createSpacing.js","../../node_modules/@mui/system/esm/compose.js","../../node_modules/@mui/system/esm/borders.js","../../node_modules/@mui/system/esm/cssGrid.js","../../node_modules/@mui/system/esm/palette.js","../../node_modules/@mui/system/esm/sizing.js","../../node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js","../../node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js","../../node_modules/@mui/system/esm/createTheme/applyStyles.js","../../node_modules/@mui/system/esm/createTheme/createTheme.js","../../node_modules/@mui/system/esm/useThemeWithoutDefault.js","../../node_modules/@mui/system/esm/useTheme.js","../../node_modules/@mui/system/esm/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js","../../node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js","../../node_modules/@mui/system/node_modules/clsx/dist/clsx.mjs","../../node_modules/@mui/system/esm/createBox.js","../../node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js","../../node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js","../../node_modules/@mui/system/esm/Box/boxClasses.js","../../node_modules/@mui/system/esm/Box/Box.js","../../node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/react-is/index.js","../../node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js","../../node_modules/@mui/system/esm/createStyled.js","../../node_modules/@mui/system/esm/styled.js","../../node_modules/@mui/utils/esm/resolveProps/resolveProps.js","../../node_modules/@mui/system/esm/useThemeProps/getThemeProps.js","../../node_modules/@mui/system/esm/useThemeProps/useThemeProps.js","../../node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../node_modules/@mui/system/esm/useMediaQuery/useMediaQuery.js","../../node_modules/@mui/utils/esm/clamp/clamp.js","../../node_modules/@mui/system/esm/colorManipulator.js","../../node_modules/@mui/utils/esm/createChainedFunction/createChainedFunction.js","../../node_modules/@mui/utils/esm/debounce/debounce.js","../../node_modules/@mui/utils/esm/deprecatedPropType/deprecatedPropType.js","../../node_modules/@mui/utils/esm/isMuiElement/isMuiElement.js","../../node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js","../../node_modules/@mui/utils/esm/ownerWindow/ownerWindow.js","../../node_modules/@mui/utils/esm/requirePropFactory/requirePropFactory.js","../../node_modules/@mui/utils/esm/setRef/setRef.js","../../node_modules/@mui/utils/esm/useId/useId.js","../../node_modules/@mui/utils/esm/unsupportedProp/unsupportedProp.js","../../node_modules/@mui/utils/esm/useControlled/useControlled.js","../../node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../node_modules/@mui/utils/esm/useLazyRef/useLazyRef.js","../../node_modules/@mui/utils/esm/useOnMount/useOnMount.js","../../node_modules/@mui/utils/esm/useTimeout/useTimeout.js","../../node_modules/@mui/utils/esm/useIsFocusVisible/useIsFocusVisible.js","../../node_modules/@mui/utils/esm/getScrollbarSize/getScrollbarSize.js","../../node_modules/@mui/utils/esm/scrollLeft/scrollLeft.js","../../node_modules/@mui/utils/esm/usePreviousProps/usePreviousProps.js","../../node_modules/@mui/utils/esm/composeClasses/composeClasses.js","../../node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js","../../node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js","../../node_modules/@mui/utils/node_modules/clsx/dist/clsx.mjs","../../node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js","../../node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js","../../node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js","../../node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js","../../node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js","../../node_modules/@mui/private-theming/useTheme/ThemeContext.js","../../node_modules/@mui/private-theming/useTheme/useTheme.js","../../node_modules/@mui/private-theming/ThemeProvider/nested.js","../../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js","../../node_modules/@mui/system/esm/RtlProvider/index.js","../../node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js","../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js","../../node_modules/@mui/system/esm/Container/createContainer.js","../../node_modules/@mui/system/esm/Stack/createStack.js","../../node_modules/@mui/material/styles/createMixins.js","../../node_modules/@babel/runtime/helpers/interopRequireDefault.js","../../node_modules/@mui/system/colorManipulator.js","../../node_modules/@mui/material/styles/createPalette.js","../../node_modules/@mui/material/styles/createTypography.js","../../node_modules/@mui/material/styles/shadows.js","../../node_modules/@mui/material/styles/createTransitions.js","../../node_modules/@mui/material/styles/zIndex.js","../../node_modules/@mui/material/styles/createTheme.js","../../node_modules/@mui/material/styles/cssUtils.js","../../node_modules/@mui/material/styles/defaultTheme.js","../../node_modules/@mui/material/styles/useTheme.js","../../node_modules/@mui/material/styles/useThemeProps.js","../../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js","../../node_modules/@mui/system/createStyled.js","../../node_modules/@mui/material/styles/slotShouldForwardProp.js","../../node_modules/@mui/material/styles/rootShouldForwardProp.js","../../node_modules/@mui/material/styles/styled.js","../../node_modules/@mui/material/styles/ThemeProvider.js","../../node_modules/@mui/material/styles/getOverlayAlpha.js","../../node_modules/@mui/material/node_modules/clsx/dist/clsx.mjs","../../node_modules/@mui/material/DefaultPropsProvider/DefaultPropsProvider.js","../../node_modules/@mui/material/SvgIcon/svgIconClasses.js","../../node_modules/@mui/material/SvgIcon/SvgIcon.js","../../node_modules/@mui/material/utils/createSvgIcon.js","../../node_modules/@mui/material/utils/index.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../node_modules/dom-helpers/esm/hasClass.js","../../node_modules/dom-helpers/esm/addClass.js","../../node_modules/dom-helpers/esm/removeClass.js","../../node_modules/react-transition-group/esm/config.js","../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../node_modules/react-transition-group/esm/utils/reflow.js","../../node_modules/react-transition-group/esm/Transition.js","../../node_modules/react-transition-group/esm/CSSTransition.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/react-transition-group/esm/utils/ChildMapping.js","../../node_modules/react-transition-group/esm/TransitionGroup.js","../../node_modules/@mui/material/transitions/utils.js","../../node_modules/@mui/material/Collapse/collapseClasses.js","../../node_modules/@mui/material/Collapse/Collapse.js","../../node_modules/@mui/material/Paper/paperClasses.js","../../node_modules/@mui/material/Paper/Paper.js","../../node_modules/@mui/material/Accordion/AccordionContext.js","../../node_modules/@mui/material/utils/useSlot.js","../../node_modules/@mui/material/Accordion/accordionClasses.js","../../node_modules/@mui/material/Accordion/Accordion.js","../../node_modules/@mui/material/AccordionDetails/accordionDetailsClasses.js","../../node_modules/@mui/material/AccordionDetails/AccordionDetails.js","../../node_modules/@mui/material/ButtonBase/Ripple.js","../../node_modules/@mui/material/ButtonBase/touchRippleClasses.js","../../node_modules/@mui/material/ButtonBase/TouchRipple.js","../../node_modules/@mui/material/ButtonBase/buttonBaseClasses.js","../../node_modules/@mui/material/ButtonBase/ButtonBase.js","../../node_modules/@mui/material/AccordionSummary/accordionSummaryClasses.js","../../node_modules/@mui/material/AccordionSummary/AccordionSummary.js","../../node_modules/@mui/material/Alert/alertClasses.js","../../node_modules/@mui/material/IconButton/iconButtonClasses.js","../../node_modules/@mui/material/IconButton/IconButton.js","../../node_modules/@mui/material/internal/svg-icons/SuccessOutlined.js","../../node_modules/@mui/material/internal/svg-icons/ReportProblemOutlined.js","../../node_modules/@mui/material/internal/svg-icons/ErrorOutline.js","../../node_modules/@mui/material/internal/svg-icons/InfoOutlined.js","../../node_modules/@mui/material/internal/svg-icons/Close.js","../../node_modules/@mui/material/Alert/Alert.js","../../node_modules/@mui/material/Typography/typographyClasses.js","../../node_modules/@mui/material/Typography/Typography.js","../../node_modules/@mui/material/AlertTitle/alertTitleClasses.js","../../node_modules/@mui/material/AlertTitle/AlertTitle.js","../../node_modules/@mui/material/AppBar/appBarClasses.js","../../node_modules/@mui/material/AppBar/AppBar.js","../../node_modules/@mui/material/useAutocomplete/useAutocomplete.js","../../node_modules/@mui/system/useThemeWithoutDefault.js","../../node_modules/@popperjs/core/lib/enums.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js","../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../node_modules/@popperjs/core/lib/utils/math.js","../../node_modules/@popperjs/core/lib/utils/userAgent.js","../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../node_modules/@popperjs/core/lib/utils/within.js","../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../node_modules/@popperjs/core/lib/utils/debounce.js","../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../node_modules/@popperjs/core/lib/createPopper.js","../../node_modules/@popperjs/core/lib/popper.js","../../node_modules/@mui/material/Portal/Portal.js","../../node_modules/@mui/material/Popper/popperClasses.js","../../node_modules/@mui/material/Popper/BasePopper.js","../../node_modules/@mui/material/Popper/Popper.js","../../node_modules/@mui/material/ListSubheader/listSubheaderClasses.js","../../node_modules/@mui/material/ListSubheader/ListSubheader.js","../../node_modules/@mui/material/internal/svg-icons/Cancel.js","../../node_modules/@mui/material/Chip/chipClasses.js","../../node_modules/@mui/material/Chip/Chip.js","../../node_modules/@mui/material/TextareaAutosize/TextareaAutosize.js","../../node_modules/@mui/material/FormControl/formControlState.js","../../node_modules/@mui/material/FormControl/FormControlContext.js","../../node_modules/@mui/material/FormControl/useFormControl.js","../../node_modules/@mui/material/GlobalStyles/GlobalStyles.js","../../node_modules/@mui/material/InputBase/utils.js","../../node_modules/@mui/material/InputBase/inputBaseClasses.js","../../node_modules/@mui/material/InputBase/InputBase.js","../../node_modules/@mui/material/Input/inputClasses.js","../../node_modules/@mui/material/OutlinedInput/outlinedInputClasses.js","../../node_modules/@mui/material/FilledInput/filledInputClasses.js","../../node_modules/@mui/material/internal/svg-icons/ArrowDropDown.js","../../node_modules/@mui/material/Autocomplete/autocompleteClasses.js","../../node_modules/@mui/material/Autocomplete/Autocomplete.js","../../node_modules/@mui/material/internal/svg-icons/Person.js","../../node_modules/@mui/material/Avatar/avatarClasses.js","../../node_modules/@mui/material/Avatar/Avatar.js","../../node_modules/@mui/material/Fade/Fade.js","../../node_modules/@mui/material/Backdrop/backdropClasses.js","../../node_modules/@mui/material/Backdrop/Backdrop.js","../../node_modules/@mui/material/Badge/useBadge.js","../../node_modules/@mui/material/Badge/badgeClasses.js","../../node_modules/@mui/material/Badge/Badge.js","../../node_modules/@mui/material/Box/boxClasses.js","../../node_modules/@mui/material/Box/Box.js","../../node_modules/@mui/material/internal/svg-icons/MoreHoriz.js","../../node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed.js","../../node_modules/@mui/material/Breadcrumbs/breadcrumbsClasses.js","../../node_modules/@mui/material/Breadcrumbs/Breadcrumbs.js","../../node_modules/@mui/material/Button/buttonClasses.js","../../node_modules/@mui/material/ButtonGroup/ButtonGroupContext.js","../../node_modules/@mui/material/ButtonGroup/ButtonGroupButtonContext.js","../../node_modules/@mui/material/Button/Button.js","../../node_modules/@mui/material/Card/cardClasses.js","../../node_modules/@mui/material/Card/Card.js","../../node_modules/@mui/material/internal/switchBaseClasses.js","../../node_modules/@mui/material/internal/SwitchBase.js","../../node_modules/@mui/material/internal/svg-icons/CheckBoxOutlineBlank.js","../../node_modules/@mui/material/internal/svg-icons/CheckBox.js","../../node_modules/@mui/material/internal/svg-icons/IndeterminateCheckBox.js","../../node_modules/@mui/material/Checkbox/checkboxClasses.js","../../node_modules/@mui/material/Checkbox/Checkbox.js","../../node_modules/@mui/material/CircularProgress/circularProgressClasses.js","../../node_modules/@mui/material/CircularProgress/CircularProgress.js","../../node_modules/@mui/material/ClickAwayListener/ClickAwayListener.js","../../node_modules/@mui/material/Container/Container.js","../../node_modules/@mui/material/CssBaseline/CssBaseline.js","../../node_modules/@mui/material/Modal/ModalManager.js","../../node_modules/@mui/material/Unstable_TrapFocus/FocusTrap.js","../../node_modules/@mui/material/Modal/useModal.js","../../node_modules/@mui/material/Modal/modalClasses.js","../../node_modules/@mui/material/Modal/Modal.js","../../node_modules/@mui/material/Dialog/dialogClasses.js","../../node_modules/@mui/material/Dialog/DialogContext.js","../../node_modules/@mui/material/Dialog/Dialog.js","../../node_modules/@mui/material/DialogActions/dialogActionsClasses.js","../../node_modules/@mui/material/DialogActions/DialogActions.js","../../node_modules/@mui/material/DialogContent/dialogContentClasses.js","../../node_modules/@mui/material/DialogTitle/dialogTitleClasses.js","../../node_modules/@mui/material/DialogContent/DialogContent.js","../../node_modules/@mui/material/DialogContentText/dialogContentTextClasses.js","../../node_modules/@mui/material/DialogContentText/DialogContentText.js","../../node_modules/@mui/material/DialogTitle/DialogTitle.js","../../node_modules/@mui/material/Divider/dividerClasses.js","../../node_modules/@mui/material/Divider/Divider.js","../../node_modules/@mui/material/Slide/Slide.js","../../node_modules/@mui/material/Drawer/drawerClasses.js","../../node_modules/@mui/material/Drawer/Drawer.js","../../node_modules/@mui/material/Fab/fabClasses.js","../../node_modules/@mui/material/Fab/Fab.js","../../node_modules/@mui/material/FilledInput/FilledInput.js","../../node_modules/@mui/material/FormControl/formControlClasses.js","../../node_modules/@mui/material/FormControl/FormControl.js","../../node_modules/@mui/material/Stack/Stack.js","../../node_modules/@mui/material/FormControlLabel/formControlLabelClasses.js","../../node_modules/@mui/material/FormControlLabel/FormControlLabel.js","../../node_modules/@mui/material/FormGroup/formGroupClasses.js","../../node_modules/@mui/material/FormGroup/FormGroup.js","../../node_modules/@mui/material/FormHelperText/formHelperTextClasses.js","../../node_modules/@mui/material/FormHelperText/FormHelperText.js","../../node_modules/@mui/material/FormLabel/formLabelClasses.js","../../node_modules/@mui/material/FormLabel/FormLabel.js","../../node_modules/@mui/material/Grid/GridContext.js","../../node_modules/@mui/material/Grid/gridClasses.js","../../node_modules/@mui/material/Grid/Grid.js","../../node_modules/@mui/material/Grow/Grow.js","../../node_modules/@mui/material/Input/Input.js","../../node_modules/@mui/material/InputLabel/inputLabelClasses.js","../../node_modules/@mui/material/InputLabel/InputLabel.js","../../node_modules/@mui/material/LinearProgress/linearProgressClasses.js","../../node_modules/@mui/material/LinearProgress/LinearProgress.js","../../node_modules/@mui/material/Link/linkClasses.js","../../node_modules/@mui/material/Link/getTextDecoration.js","../../node_modules/@mui/material/Link/Link.js","../../node_modules/@mui/material/List/ListContext.js","../../node_modules/@mui/material/List/listClasses.js","../../node_modules/@mui/material/List/List.js","../../node_modules/@mui/material/ListItem/listItemClasses.js","../../node_modules/@mui/material/ListItemButton/listItemButtonClasses.js","../../node_modules/@mui/material/ListItemButton/ListItemButton.js","../../node_modules/@mui/material/ListItemSecondaryAction/listItemSecondaryActionClasses.js","../../node_modules/@mui/material/ListItemSecondaryAction/ListItemSecondaryAction.js","../../node_modules/@mui/material/ListItem/ListItem.js","../../node_modules/@mui/material/ListItemAvatar/listItemAvatarClasses.js","../../node_modules/@mui/material/ListItemAvatar/ListItemAvatar.js","../../node_modules/@mui/material/ListItemIcon/listItemIconClasses.js","../../node_modules/@mui/material/ListItemIcon/ListItemIcon.js","../../node_modules/@mui/material/ListItemText/listItemTextClasses.js","../../node_modules/@mui/material/ListItemText/ListItemText.js","../../node_modules/@mui/material/MenuList/MenuList.js","../../node_modules/@mui/material/Popover/popoverClasses.js","../../node_modules/@mui/material/Popover/Popover.js","../../node_modules/@mui/material/Menu/menuClasses.js","../../node_modules/@mui/material/Menu/Menu.js","../../node_modules/@mui/material/MenuItem/menuItemClasses.js","../../node_modules/@mui/material/MenuItem/MenuItem.js","../../node_modules/@mui/material/NativeSelect/nativeSelectClasses.js","../../node_modules/@mui/material/NativeSelect/NativeSelectInput.js","../../node_modules/@mui/material/OutlinedInput/NotchedOutline.js","../../node_modules/@mui/material/OutlinedInput/OutlinedInput.js","../../node_modules/@mui/material/Select/selectClasses.js","../../node_modules/@mui/material/Select/SelectInput.js","../../node_modules/@mui/material/Select/Select.js","../../node_modules/@mui/material/Skeleton/skeletonClasses.js","../../node_modules/@mui/material/Skeleton/Skeleton.js","../../node_modules/@mui/material/Snackbar/useSnackbar.js","../../node_modules/@mui/material/SnackbarContent/snackbarContentClasses.js","../../node_modules/@mui/material/SnackbarContent/SnackbarContent.js","../../node_modules/@mui/material/Snackbar/snackbarClasses.js","../../node_modules/@mui/material/Snackbar/Snackbar.js","../../node_modules/@mui/material/Tooltip/tooltipClasses.js","../../node_modules/@mui/material/Tooltip/Tooltip.js","../../node_modules/@mui/material/Switch/switchClasses.js","../../node_modules/@mui/material/Switch/Switch.js","../../node_modules/@mui/material/Tab/tabClasses.js","../../node_modules/@mui/material/Tab/Tab.js","../../node_modules/@mui/material/Toolbar/toolbarClasses.js","../../node_modules/@mui/material/Toolbar/Toolbar.js","../../node_modules/@mui/material/internal/svg-icons/KeyboardArrowLeft.js","../../node_modules/@mui/material/internal/svg-icons/KeyboardArrowRight.js","../../node_modules/@mui/material/internal/animate.js","../../node_modules/@mui/material/Tabs/ScrollbarSize.js","../../node_modules/@mui/material/TabScrollButton/tabScrollButtonClasses.js","../../node_modules/@mui/material/TabScrollButton/TabScrollButton.js","../../node_modules/@mui/material/Tabs/tabsClasses.js","../../node_modules/@mui/material/Tabs/Tabs.js","../../node_modules/@mui/material/TextField/textFieldClasses.js","../../node_modules/@mui/material/TextField/TextField.js","../../node_modules/luxon/src/errors.js","../../node_modules/luxon/src/impl/formats.js","../../node_modules/luxon/src/zone.js","../../node_modules/luxon/src/zones/systemZone.js","../../node_modules/luxon/src/zones/IANAZone.js","../../node_modules/luxon/src/impl/locale.js","../../node_modules/luxon/src/zones/fixedOffsetZone.js","../../node_modules/luxon/src/zones/invalidZone.js","../../node_modules/luxon/src/impl/zoneUtil.js","../../node_modules/luxon/src/impl/digits.js","../../node_modules/luxon/src/settings.js","../../node_modules/luxon/src/impl/invalid.js","../../node_modules/luxon/src/impl/conversions.js","../../node_modules/luxon/src/impl/util.js","../../node_modules/luxon/src/impl/english.js","../../node_modules/luxon/src/impl/formatter.js","../../node_modules/luxon/src/impl/regexParser.js","../../node_modules/luxon/src/duration.js","../../node_modules/luxon/src/interval.js","../../node_modules/luxon/src/info.js","../../node_modules/luxon/src/impl/diff.js","../../node_modules/luxon/src/impl/tokenParser.js","../../node_modules/luxon/src/datetime.js","../../node_modules/luxon/src/luxon.js","../../node_modules/mobx/dist/mobx.esm.js","../../node_modules/strict-uri-encode/index.js","../../node_modules/decode-uri-component/index.js","../../node_modules/split-on-first/index.js","../../node_modules/filter-obj/index.js","../../node_modules/query-string/index.js","../../node_modules/url-join/lib/url-join.js","../../node_modules/nanoclone/src/index.js","../../node_modules/yup/es/util/printValue.js","../../node_modules/yup/es/locale.js","../../node_modules/lodash/_baseHas.js","../../node_modules/lodash/isArray.js","../../node_modules/lodash/_freeGlobal.js","../../node_modules/lodash/_root.js","../../node_modules/lodash/_Symbol.js","../../node_modules/lodash/_getRawTag.js","../../node_modules/lodash/_objectToString.js","../../node_modules/lodash/_baseGetTag.js","../../node_modules/lodash/isObjectLike.js","../../node_modules/lodash/isSymbol.js","../../node_modules/lodash/_isKey.js","../../node_modules/lodash/isObject.js","../../node_modules/lodash/isFunction.js","../../node_modules/lodash/_coreJsData.js","../../node_modules/lodash/_isMasked.js","../../node_modules/lodash/_toSource.js","../../node_modules/lodash/_baseIsNative.js","../../node_modules/lodash/_getValue.js","../../node_modules/lodash/_getNative.js","../../node_modules/lodash/_nativeCreate.js","../../node_modules/lodash/_hashClear.js","../../node_modules/lodash/_hashDelete.js","../../node_modules/lodash/_hashGet.js","../../node_modules/lodash/_hashHas.js","../../node_modules/lodash/_hashSet.js","../../node_modules/lodash/_Hash.js","../../node_modules/lodash/_listCacheClear.js","../../node_modules/lodash/eq.js","../../node_modules/lodash/_assocIndexOf.js","../../node_modules/lodash/_listCacheDelete.js","../../node_modules/lodash/_listCacheGet.js","../../node_modules/lodash/_listCacheHas.js","../../node_modules/lodash/_listCacheSet.js","../../node_modules/lodash/_ListCache.js","../../node_modules/lodash/_Map.js","../../node_modules/lodash/_mapCacheClear.js","../../node_modules/lodash/_isKeyable.js","../../node_modules/lodash/_getMapData.js","../../node_modules/lodash/_mapCacheDelete.js","../../node_modules/lodash/_mapCacheGet.js","../../node_modules/lodash/_mapCacheHas.js","../../node_modules/lodash/_mapCacheSet.js","../../node_modules/lodash/_MapCache.js","../../node_modules/lodash/memoize.js","../../node_modules/lodash/_memoizeCapped.js","../../node_modules/lodash/_stringToPath.js","../../node_modules/lodash/_arrayMap.js","../../node_modules/lodash/_baseToString.js","../../node_modules/lodash/toString.js","../../node_modules/lodash/_castPath.js","../../node_modules/lodash/_baseIsArguments.js","../../node_modules/lodash/isArguments.js","../../node_modules/lodash/_isIndex.js","../../node_modules/lodash/isLength.js","../../node_modules/lodash/_toKey.js","../../node_modules/lodash/_hasPath.js","../../node_modules/lodash/has.js","../../node_modules/yup/es/util/isSchema.js","../../node_modules/yup/es/Condition.js","../../node_modules/yup/es/util/toArray.js","../../node_modules/yup/es/ValidationError.js","../../node_modules/yup/es/util/runTests.js","../../node_modules/lodash/_defineProperty.js","../../node_modules/lodash/_baseAssignValue.js","../../node_modules/lodash/_createBaseFor.js","../../node_modules/lodash/_baseFor.js","../../node_modules/lodash/_baseTimes.js","../../node_modules/lodash/stubFalse.js","../../node_modules/lodash/isBuffer.js","../../node_modules/lodash/_baseIsTypedArray.js","../../node_modules/lodash/_baseUnary.js","../../node_modules/lodash/_nodeUtil.js","../../node_modules/lodash/isTypedArray.js","../../node_modules/lodash/_arrayLikeKeys.js","../../node_modules/lodash/_isPrototype.js","../../node_modules/lodash/_overArg.js","../../node_modules/lodash/_nativeKeys.js","../../node_modules/lodash/_baseKeys.js","../../node_modules/lodash/isArrayLike.js","../../node_modules/lodash/keys.js","../../node_modules/lodash/_baseForOwn.js","../../node_modules/lodash/_stackClear.js","../../node_modules/lodash/_stackDelete.js","../../node_modules/lodash/_stackGet.js","../../node_modules/lodash/_stackHas.js","../../node_modules/lodash/_stackSet.js","../../node_modules/lodash/_Stack.js","../../node_modules/lodash/_setCacheAdd.js","../../node_modules/lodash/_setCacheHas.js","../../node_modules/lodash/_SetCache.js","../../node_modules/lodash/_arraySome.js","../../node_modules/lodash/_cacheHas.js","../../node_modules/lodash/_equalArrays.js","../../node_modules/lodash/_Uint8Array.js","../../node_modules/lodash/_mapToArray.js","../../node_modules/lodash/_setToArray.js","../../node_modules/lodash/_equalByTag.js","../../node_modules/lodash/_arrayPush.js","../../node_modules/lodash/_baseGetAllKeys.js","../../node_modules/lodash/_arrayFilter.js","../../node_modules/lodash/stubArray.js","../../node_modules/lodash/_getSymbols.js","../../node_modules/lodash/_getAllKeys.js","../../node_modules/lodash/_equalObjects.js","../../node_modules/lodash/_DataView.js","../../node_modules/lodash/_Promise.js","../../node_modules/lodash/_Set.js","../../node_modules/lodash/_WeakMap.js","../../node_modules/lodash/_getTag.js","../../node_modules/lodash/_baseIsEqualDeep.js","../../node_modules/lodash/_baseIsEqual.js","../../node_modules/lodash/_baseIsMatch.js","../../node_modules/lodash/_isStrictComparable.js","../../node_modules/lodash/_getMatchData.js","../../node_modules/lodash/_matchesStrictComparable.js","../../node_modules/lodash/_baseMatches.js","../../node_modules/lodash/_baseGet.js","../../node_modules/lodash/get.js","../../node_modules/lodash/_baseHasIn.js","../../node_modules/lodash/hasIn.js","../../node_modules/lodash/_baseMatchesProperty.js","../../node_modules/lodash/identity.js","../../node_modules/lodash/_baseProperty.js","../../node_modules/lodash/_basePropertyDeep.js","../../node_modules/lodash/property.js","../../node_modules/lodash/_baseIteratee.js","../../node_modules/lodash/mapValues.js","../../node_modules/property-expr/index.js","../../node_modules/yup/es/Reference.js","../../node_modules/yup/es/util/createValidation.js","../../node_modules/yup/es/util/reach.js","../../node_modules/yup/es/util/ReferenceSet.js","../../node_modules/yup/es/schema.js","../../node_modules/yup/es/mixed.js","../../node_modules/yup/es/util/isAbsent.js","../../node_modules/yup/es/boolean.js","../../node_modules/yup/es/string.js","../../node_modules/yup/es/util/isodate.js","../../node_modules/yup/es/date.js","../../node_modules/lodash/_arrayReduce.js","../../node_modules/lodash/_basePropertyOf.js","../../node_modules/lodash/_deburrLetter.js","../../node_modules/lodash/deburr.js","../../node_modules/lodash/_asciiWords.js","../../node_modules/lodash/_hasUnicodeWord.js","../../node_modules/lodash/_unicodeWords.js","../../node_modules/lodash/words.js","../../node_modules/lodash/_createCompounder.js","../../node_modules/lodash/snakeCase.js","../../node_modules/lodash/_baseSlice.js","../../node_modules/lodash/_castSlice.js","../../node_modules/lodash/_hasUnicode.js","../../node_modules/lodash/_asciiToArray.js","../../node_modules/lodash/_unicodeToArray.js","../../node_modules/lodash/_stringToArray.js","../../node_modules/lodash/_createCaseFirst.js","../../node_modules/lodash/upperFirst.js","../../node_modules/lodash/capitalize.js","../../node_modules/lodash/camelCase.js","../../node_modules/lodash/mapKeys.js","../../node_modules/toposort/index.js","../../node_modules/yup/es/util/sortFields.js","../../node_modules/yup/es/util/sortByKeyOrder.js","../../node_modules/yup/es/object.js","../../node_modules/yup/lib/util/printValue.js","../../node_modules/yup/lib/locale.js","../../node_modules/yup/lib/Reference.js","../../node_modules/mobx-react-lite/es/utils/assertEnvironment.js","../../node_modules/mobx-react-lite/es/utils/observerBatching.js","../../node_modules/mobx-react-lite/es/utils/printDebugValue.js","../../node_modules/mobx-react-lite/es/utils/UniversalFinalizationRegistry.js","../../node_modules/mobx-react-lite/es/utils/observerFinalizationRegistry.js","../../node_modules/mobx-react-lite/es/useObserver.js","../../node_modules/mobx-react-lite/es/observer.js","../../node_modules/mobx-react-lite/es/index.js","../../node_modules/history/index.js","../../node_modules/react-router/index.js","../../node_modules/react-router-dom/index.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-shims/dist-es5/Constants.js","../../node_modules/@nevware21/ts-utils/dist/es5/mod/ts-utils.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-shims/dist-es5/TsLibShims.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/dynamicproto-js/dist-es5/DynamicProto.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/AggregationError.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/HelperFuncs.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/EnvUtils.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/RandomHelper.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DataCacheHelper.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaults.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicSupport.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicProperty.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicState.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/DynamicConfig.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/Config/ConfigDefaultHelpers.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DbgExtensionUtils.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/DiagnosticLogger.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/CookieMgr.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/PerfManager.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/TelemetryHelpers.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/ProcessTelemetryContext.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHandlerContainer.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/UnloadHookContainer.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-core-js/dist-es5/JavaScriptSDK/BaseTelemetryPlugin.js","../../node_modules/@microsoft/applicationinsights-react-js/node_modules/@microsoft/applicationinsights-common/dist-es5/applicationinsights-common.js","../../node_modules/@microsoft/applicationinsights-react-js/dist-esm/ReactPlugin.js","../../node_modules/@microsoft/applicationinsights-react-js/dist-esm/AppInsightsContext.js","../../node_modules/react-query/es/core/subscribable.js","../../node_modules/react-query/es/core/utils.js","../../node_modules/react-query/es/core/focusManager.js","../../node_modules/react-query/es/core/onlineManager.js","../../node_modules/react-query/es/core/retryer.js","../../node_modules/react-query/es/core/notifyManager.js","../../node_modules/react-query/es/core/logger.js","../../node_modules/react-query/es/core/query.js","../../node_modules/react-query/es/core/queryCache.js","../../node_modules/react-query/es/core/mutation.js","../../node_modules/react-query/es/core/mutationCache.js","../../node_modules/react-query/es/core/infiniteQueryBehavior.js","../../node_modules/react-query/es/core/queryClient.js","../../node_modules/react-query/es/core/queryObserver.js","../../node_modules/react-query/es/core/mutationObserver.js","../../node_modules/react-query/es/react/reactBatchedUpdates.js","../../node_modules/react-query/es/react/setBatchUpdatesFn.js","../../node_modules/react-query/es/react/logger.js","../../node_modules/react-query/es/react/setLogger.js","../../node_modules/react-query/es/react/QueryClientProvider.js","../../node_modules/react-query/es/react/QueryErrorResetBoundary.js","../../node_modules/react-query/es/react/utils.js","../../node_modules/react-query/es/react/useMutation.js","../../node_modules/react-query/es/react/useBaseQuery.js","../../node_modules/react-query/es/react/useQuery.js","../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js","../../node_modules/@mui/x-date-pickers/node_modules/clsx/dist/clsx.mjs","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/setRef/setRef.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useId/useId.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useControlled/useControlled.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useForkRef/useForkRef.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/composeClasses/composeClasses.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js","../../node_modules/@mui/x-date-pickers/node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js","../../node_modules/@mui/x-date-pickers/LocalizationProvider/LocalizationProvider.js","../../node_modules/@mui/x-date-pickers/locales/utils/getPickersLocalization.js","../../node_modules/@mui/x-date-pickers/locales/enUS.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useUtils.js","../../node_modules/@mui/x-date-pickers/hooks/usePickersTranslations.js","../../node_modules/@mui/x-date-pickers/icons/index.js","../../node_modules/@mui/x-date-pickers/internals/components/PickersArrowSwitcher/pickersArrowSwitcherClasses.js","../../node_modules/@mui/x-date-pickers/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.js","../../node_modules/@mui/x-date-pickers/internals/utils/views.js","../../node_modules/@mui/x-date-pickers/internals/utils/time-utils.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useViews.js","../../node_modules/@mui/x-date-pickers/internals/hooks/date-helpers-hooks.js","../../node_modules/@mui/x-date-pickers/internals/constants/dimensions.js","../../node_modules/@mui/x-date-pickers/internals/components/PickerViewRoot/PickerViewRoot.js","../../node_modules/@mui/x-date-pickers/internals/utils/date-utils.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useValueWithTimezone.js","../../node_modules/@mui/x-date-pickers/internals/utils/getDefaultReferenceDate.js","../../node_modules/@mui/x-date-pickers/internals/utils/valueManagers.js","../../node_modules/@mui/x-date-pickers/internals/utils/utils.js","../../node_modules/@mui/x-date-pickers/PickersDay/pickersDayClasses.js","../../node_modules/@mui/x-date-pickers/PickersDay/PickersDay.js","../../node_modules/@mui/x-date-pickers/validation/validateDate.js","../../node_modules/@mui/x-date-pickers/validation/useValidation.js","../../node_modules/@mui/x-date-pickers/DateCalendar/useIsDateDisabled.js","../../node_modules/@mui/x-date-pickers/DateCalendar/useCalendarState.js","../../node_modules/@mui/x-date-pickers/DateCalendar/pickersFadeTransitionGroupClasses.js","../../node_modules/@mui/x-date-pickers/DateCalendar/PickersFadeTransitionGroup.js","../../node_modules/@mui/x-date-pickers/DateCalendar/pickersSlideTransitionClasses.js","../../node_modules/@mui/x-date-pickers/DateCalendar/PickersSlideTransition.js","../../node_modules/@mui/x-date-pickers/DateCalendar/dayCalendarClasses.js","../../node_modules/@mui/x-date-pickers/DateCalendar/DayCalendar.js","../../node_modules/@mui/x-date-pickers/MonthCalendar/pickersMonthClasses.js","../../node_modules/@mui/x-date-pickers/MonthCalendar/PickersMonth.js","../../node_modules/@mui/x-date-pickers/MonthCalendar/monthCalendarClasses.js","../../node_modules/@mui/x-date-pickers/MonthCalendar/MonthCalendar.js","../../node_modules/@mui/x-date-pickers/YearCalendar/pickersYearClasses.js","../../node_modules/@mui/x-date-pickers/YearCalendar/PickersYear.js","../../node_modules/@mui/x-date-pickers/YearCalendar/yearCalendarClasses.js","../../node_modules/@mui/x-date-pickers/YearCalendar/YearCalendar.js","../../node_modules/@mui/x-date-pickers/PickersCalendarHeader/pickersCalendarHeaderClasses.js","../../node_modules/@mui/x-date-pickers/PickersCalendarHeader/PickersCalendarHeader.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useDefaultReduceAnimations.js","../../node_modules/@mui/x-date-pickers/DateCalendar/dateCalendarClasses.js","../../node_modules/@mui/x-date-pickers/DateCalendar/DateCalendar.js","../../node_modules/@mui/x-date-pickers/internals/components/pickersToolbarClasses.js","../../node_modules/@mui/x-date-pickers/internals/components/PickersToolbar.js","../../node_modules/@mui/x-date-pickers/DatePicker/datePickerToolbarClasses.js","../../node_modules/@mui/x-date-pickers/DatePicker/DatePickerToolbar.js","../../node_modules/@mui/x-date-pickers/DatePicker/shared.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useOpenState.js","../../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerValue.js","../../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerViews.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useIsLandscape.js","../../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerLayoutProps.js","../../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePickerOwnerState.js","../../node_modules/@mui/x-date-pickers/internals/hooks/usePicker/usePicker.js","../../node_modules/@mui/x-date-pickers/PickersLayout/pickersLayoutClasses.js","../../node_modules/@mui/x-date-pickers/PickersActionBar/PickersActionBar.js","../../node_modules/@mui/x-date-pickers/PickersShortcuts/PickersShortcuts.js","../../node_modules/@mui/x-date-pickers/PickersLayout/usePickerLayout.js","../../node_modules/@mui/x-date-pickers/PickersLayout/PickersLayout.js","../../node_modules/@mui/x-date-pickers/dateViewRenderers/dateViewRenderers.js","../../node_modules/@mui/x-date-pickers/internals/hooks/useStaticPicker/useStaticPicker.js","../../node_modules/@mui/x-date-pickers/StaticDatePicker/StaticDatePicker.js","../../node_modules/@mui/x-date-pickers/AdapterLuxon/AdapterLuxon.js","../../node_modules/@microsoft/dynamicproto-js/lib/dist/esm/dynamicproto-js.js","../../node_modules/@microsoft/applicationinsights-shims/dist-esm/Constants.js","../../node_modules/@microsoft/applicationinsights-shims/dist-esm/Helpers.js","../../node_modules/@microsoft/applicationinsights-shims/dist-esm/TsLibShims.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/HelperFuncs.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EnvUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DbgExtensionUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DiagnosticLogger.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/PerfManager.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/RandomHelper.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/DataCacheHelper.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CookieMgr.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/EventHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/CoreUtils.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/W3cTraceParent.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryHelpers.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/ChannelController.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/BaseCore.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/NotificationManager.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/AppInsightsCore.js","../../node_modules/@microsoft/applicationinsights-core-js/dist-esm/JavaScriptSDK/InstrumentHooks.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Constants.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/DomHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/HelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/RequestResponseHeaders.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Enums.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/StorageHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataSanitizer.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/UrlHelperFuncs.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Util.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/ConnectionStringParser.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Envelope.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Event.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Exception.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/DataPoint.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Metric.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageView.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/RemoteDependencyData.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Trace.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/PageViewPerformance.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Telemetry/Common/Data.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/SeverityLevel.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/Contracts/ContextTagKeys.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/TelemetryItemCreator.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/Interfaces/PartAExtensions.js","../../node_modules/@microsoft/applicationinsights-common/dist-esm/applicationinsights-common.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageViewPerformanceManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Telemetry/PageVisitTimeManager.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/Timing.js","../../node_modules/@microsoft/applicationinsights-analytics-js/dist-esm/JavaScriptSDK/AnalyticsPlugin.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/EnvelopeCreator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Offline.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/SendBuffer.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Serializer.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/HashCodeScoreGenerator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/SamplingScoreGenerators/SamplingScoreGenerator.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/TelemetryProcessors/Sample.js","../../node_modules/@microsoft/applicationinsights-channel-js/dist-esm/Sender.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajaxRecord.js","../../node_modules/@microsoft/applicationinsights-dependencies-js/dist-esm/ajax.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Application.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Device.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Internal.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Location.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/Session.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/TelemetryTrace.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/Context/User.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/TelemetryContext.js","../../node_modules/@microsoft/applicationinsights-properties-js/dist-esm/PropertiesPlugin.js","../../node_modules/@microsoft/applicationinsights-web/dist-esm/InternalConstants.js","../../node_modules/@microsoft/applicationinsights-web/dist-esm/__DynamicConstants.js","../../node_modules/@microsoft/applicationinsights-web/dist-esm/Initialization.js","../../node_modules/react-ga4/dist/gtag.js","../../node_modules/react-ga4/dist/format.js","../../node_modules/react-ga4/dist/ga4.js","../../node_modules/react-ga4/dist/index.js","../../node_modules/@hotjar/browser/dist/index.esm.js"],"sourcesContent":["/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","/** @license React v17.0.2\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=require(\"object-assign\"),n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;\nif(\"function\"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w(\"react.element\");p=w(\"react.portal\");exports.Fragment=w(\"react.fragment\");exports.StrictMode=w(\"react.strict_mode\");exports.Profiler=w(\"react.profiler\");q=w(\"react.provider\");r=w(\"react.context\");t=w(\"react.forward_ref\");exports.Suspense=w(\"react.suspense\");u=w(\"react.memo\");v=w(\"react.lazy\")}var x=\"function\"===typeof Symbol&&Symbol.iterator;\nfunction y(a){if(null===a||\"object\"!==typeof a)return null;a=x&&a[x]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}function z(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;c=\nE};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a}}return b}return null}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;\nfunction T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M)}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else{var b=J(M);null!==b&&g(U,b.startTime-a)}}\nfunction V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if(\"function\"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?O.callback=e:O===J(L)&&K(L);T(b)}else K(L);O=J(L)}if(null!==O)var m=!0;else{var n=J(M);null!==n&&g(U,n.startTime-b);m=!1}return m}finally{O=null,P=c,Q=!1}}var W=k;exports.unstable_IdlePriority=5;\nexports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V))};exports.unstable_getCurrentPriorityLevel=function(){return P};exports.unstable_getFirstCallbackNode=function(){return J(L)};\nexports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P}var c=P;P=b;try{return a()}finally{P=c}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3}var c=P;P=a;try{return b()}finally{P=c}};\nexports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();\"object\"===typeof c&&null!==c?(c=c.delay,c=\"number\"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a};\nexports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments)}finally{P=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/** @license React v17.0.2\n * react-dom.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n/*\n Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),m=require(\"object-assign\"),r=require(\"scheduler\");function y(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function B(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var D={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){D[a]=new B(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];D[b]=new B(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){D[a]=new B(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){D[a]=new B(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){D[a]=new B(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){D[a]=new B(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){D[a]=new B(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){D[a]=new B(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){D[a]=new B(a,5,!1,a.toLowerCase(),null,!1,!1)});var oa=/[\\-:]([a-z])/g;function pa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(oa,\npa);D[b]=new B(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(oa,pa);D[b]=new B(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!1,!1)});\nD.xlinkHref=new B(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){D[a]=new B(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction qa(a,b,c,d){var e=D.hasOwnProperty(b)?D[b]:null;var f=null!==e?0===e.type:d?!1:!(2h||e[g]!==f[h])return\"\\n\"+e[g].replace(\" at new \",\" at \");while(1<=g&&0<=h)}break}}}finally{Oa=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Na(a):\"\"}\nfunction Qa(a){switch(a.tag){case 5:return Na(a.type);case 16:return Na(\"Lazy\");case 13:return Na(\"Suspense\");case 19:return Na(\"SuspenseList\");case 0:case 2:case 15:return a=Pa(a.type,!1),a;case 11:return a=Pa(a.type.render,!1),a;case 22:return a=Pa(a.type._render,!1),a;case 1:return a=Pa(a.type,!0),a;default:return\"\"}}\nfunction Ra(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ua:return\"Fragment\";case ta:return\"Portal\";case xa:return\"Profiler\";case wa:return\"StrictMode\";case Ba:return\"Suspense\";case Ca:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case za:return(a.displayName||\"Context\")+\".Consumer\";case ya:return(a._context.displayName||\"Context\")+\".Provider\";case Aa:var b=a.render;b=b.displayName||b.name||\"\";\nreturn a.displayName||(\"\"!==b?\"ForwardRef(\"+b+\")\":\"ForwardRef\");case Da:return Ra(a.type);case Fa:return Ra(a._render);case Ea:b=a._payload;a=a._init;try{return Ra(a(b))}catch(c){}}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"object\":case \"string\":case \"undefined\":return a;default:return\"\"}}function Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return m({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function $a(a,b){b=b.checked;null!=b&&qa(a,\"checked\",b,!1)}\nfunction ab(a,b){$a(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?bb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&bb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction cb(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction bb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}function db(a){var b=\"\";aa.Children.forEach(a,function(a){null!=a&&(b+=a)});return b}function eb(a,b){a=m({children:void 0},b);if(b=db(b.children))a.children=b;return a}\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e=c.length))throw Error(y(93));c=c[0]}b=c}null==b&&(b=\"\");c=b}a._wrapperState={initialValue:Sa(c)}}\nfunction ib(a,b){var c=Sa(b.value),d=Sa(b.defaultValue);null!=c&&(c=\"\"+c,c!==a.value&&(a.value=c),null==b.defaultValue&&a.defaultValue!==c&&(a.defaultValue=c));null!=d&&(a.defaultValue=\"\"+d)}function jb(a){var b=a.textContent;b===a._wrapperState.initialValue&&\"\"!==b&&null!==b&&(a.value=b)}var kb={html:\"http://www.w3.org/1999/xhtml\",mathml:\"http://www.w3.org/1998/Math/MathML\",svg:\"http://www.w3.org/2000/svg\"};\nfunction lb(a){switch(a){case \"svg\":return\"http://www.w3.org/2000/svg\";case \"math\":return\"http://www.w3.org/1998/Math/MathML\";default:return\"http://www.w3.org/1999/xhtml\"}}function mb(a,b){return null==a||\"http://www.w3.org/1999/xhtml\"===a?lb(b):\"http://www.w3.org/2000/svg\"===a&&\"foreignObject\"===b?\"http://www.w3.org/1999/xhtml\":a}\nvar nb,ob=function(a){return\"undefined\"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(b,c,d,e){MSApp.execUnsafeLocalFunction(function(){return a(b,c,d,e)})}:a}(function(a,b){if(a.namespaceURI!==kb.svg||\"innerHTML\"in a)a.innerHTML=b;else{nb=nb||document.createElement(\"div\");nb.innerHTML=\"\"+b.valueOf().toString()+\"\";for(b=nb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction pb(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar qb={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,\nfloodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(qb).forEach(function(a){rb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);qb[b]=qb[a]})});function sb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||qb.hasOwnProperty(a)&&qb[a]?(\"\"+b).trim():b+\"px\"}\nfunction tb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=sb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var ub=m({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction vb(a,b){if(b){if(ub[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(y(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(y(60));if(!(\"object\"===typeof b.dangerouslySetInnerHTML&&\"__html\"in b.dangerouslySetInnerHTML))throw Error(y(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(y(62));}}\nfunction wb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(y(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;ad?0:1<c;c++)b.push(a);return b}\nfunction $c(a,b,c){a.pendingLanes|=b;var d=b-1;a.suspendedLanes&=d;a.pingedLanes&=d;a=a.eventTimes;b=31-Vc(b);a[b]=c}var Vc=Math.clz32?Math.clz32:ad,bd=Math.log,cd=Math.LN2;function ad(a){return 0===a?32:31-(bd(a)/cd|0)|0}var dd=r.unstable_UserBlockingPriority,ed=r.unstable_runWithPriority,fd=!0;function gd(a,b,c,d){Kb||Ib();var e=hd,f=Kb;Kb=!0;try{Hb(e,a,b,c,d)}finally{(Kb=f)||Mb()}}function id(a,b,c,d){ed(dd,hd.bind(null,a,b,c,d))}\nfunction hd(a,b,c,d){if(fd){var e;if((e=0===(b&4))&&0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Ke(c)}}function Me(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Me(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Ne(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Oe(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nvar Pe=fa&&\"documentMode\"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Oe(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Je(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Af||(a.current=zf[Af],zf[Af]=null,Af--)}function I(a,b){Af++;zf[Af]=a.current;a.current=b}var Cf={},M=Bf(Cf),N=Bf(!1),Df=Cf;\nfunction Ef(a,b){var c=a.type.contextTypes;if(!c)return Cf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}function Ff(a){a=a.childContextTypes;return null!==a&&void 0!==a}function Gf(){H(N);H(M)}function Hf(a,b,c){if(M.current!==Cf)throw Error(y(168));I(M,b);I(N,c)}\nfunction If(a,b,c){var d=a.stateNode;a=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in a))throw Error(y(108,Ra(b)||\"Unknown\",e));return m({},c,d)}function Jf(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Cf;Df=M.current;I(M,a);I(N,N.current);return!0}function Kf(a,b,c){var d=a.stateNode;if(!d)throw Error(y(169));c?(a=If(a,b,Df),d.__reactInternalMemoizedMergedChildContext=a,H(N),H(M),I(M,a)):H(N);I(N,c)}\nvar Lf=null,Mf=null,Nf=r.unstable_runWithPriority,Of=r.unstable_scheduleCallback,Pf=r.unstable_cancelCallback,Qf=r.unstable_shouldYield,Rf=r.unstable_requestPaint,Sf=r.unstable_now,Tf=r.unstable_getCurrentPriorityLevel,Uf=r.unstable_ImmediatePriority,Vf=r.unstable_UserBlockingPriority,Wf=r.unstable_NormalPriority,Xf=r.unstable_LowPriority,Yf=r.unstable_IdlePriority,Zf={},$f=void 0!==Rf?Rf:function(){},ag=null,bg=null,cg=!1,dg=Sf(),O=1E4>dg?Sf:function(){return Sf()-dg};\nfunction eg(){switch(Tf()){case Uf:return 99;case Vf:return 98;case Wf:return 97;case Xf:return 96;case Yf:return 95;default:throw Error(y(332));}}function fg(a){switch(a){case 99:return Uf;case 98:return Vf;case 97:return Wf;case 96:return Xf;case 95:return Yf;default:throw Error(y(332));}}function gg(a,b){a=fg(a);return Nf(a,b)}function hg(a,b,c){a=fg(a);return Of(a,b,c)}function ig(){if(null!==bg){var a=bg;bg=null;Pf(a)}jg()}\nfunction jg(){if(!cg&&null!==ag){cg=!0;var a=0;try{var b=ag;gg(99,function(){for(;az?(q=u,u=null):q=u.sibling;var n=p(e,u,h[z],k);if(null===n){null===u&&(u=q);break}a&&u&&null===\nn.alternate&&b(e,u);g=f(n,g,z);null===t?l=n:t.sibling=n;t=n;u=q}if(z===h.length)return c(e,u),l;if(null===u){for(;zz?(q=u,u=null):q=u.sibling;var w=p(e,u,n.value,k);if(null===w){null===u&&(u=q);break}a&&u&&null===w.alternate&&b(e,u);g=f(w,g,z);null===t?l=w:t.sibling=w;t=w;u=q}if(n.done)return c(e,u),l;if(null===u){for(;!n.done;z++,n=h.next())n=A(e,n.value,k),null!==n&&(g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);return l}for(u=d(e,u);!n.done;z++,n=h.next())n=C(u,e,z,n.value,k),null!==n&&(a&&null!==n.alternate&&\nu.delete(null===n.key?z:n.key),g=f(n,g,z),null===t?l=n:t.sibling=n,t=n);a&&u.forEach(function(a){return b(e,a)});return l}return function(a,d,f,h){var k=\"object\"===typeof f&&null!==f&&f.type===ua&&null===f.key;k&&(f=f.props.children);var l=\"object\"===typeof f&&null!==f;if(l)switch(f.$$typeof){case sa:a:{l=f.key;for(k=d;null!==k;){if(k.key===l){switch(k.tag){case 7:if(f.type===ua){c(a,k.sibling);d=e(k,f.props.children);d.return=a;a=d;break a}break;default:if(k.elementType===f.type){c(a,k.sibling);\nd=e(k,f.props);d.ref=Qg(a,k,f);d.return=a;a=d;break a}}c(a,k);break}else b(a,k);k=k.sibling}f.type===ua?(d=Xg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Vg(f.type,f.key,f.props,null,a.mode,h),h.ref=Qg(a,d,f),h.return=a,a=h)}return g(a);case ta:a:{for(k=f.key;null!==d;){if(d.key===k)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=\nWg(f,a.mode,h);d.return=a;a=d}return g(a)}if(\"string\"===typeof f||\"number\"===typeof f)return f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):(c(a,d),d=Ug(f,a.mode,h),d.return=a,a=d),g(a);if(Pg(f))return x(a,d,f,h);if(La(f))return w(a,d,f,h);l&&Rg(a,f);if(\"undefined\"===typeof f&&!k)switch(a.tag){case 1:case 22:case 0:case 11:case 15:throw Error(y(152,Ra(a.type)||\"Component\"));}return c(a,d)}}var Yg=Sg(!0),Zg=Sg(!1),$g={},ah=Bf($g),bh=Bf($g),ch=Bf($g);\nfunction dh(a){if(a===$g)throw Error(y(174));return a}function eh(a,b){I(ch,b);I(bh,a);I(ah,$g);a=b.nodeType;switch(a){case 9:case 11:b=(b=b.documentElement)?b.namespaceURI:mb(null,\"\");break;default:a=8===a?b.parentNode:b,b=a.namespaceURI||null,a=a.tagName,b=mb(b,a)}H(ah);I(ah,b)}function fh(){H(ah);H(bh);H(ch)}function gh(a){dh(ch.current);var b=dh(ah.current);var c=mb(b,a.type);b!==c&&(I(bh,a),I(ah,c))}function hh(a){bh.current===a&&(H(ah),H(bh))}var P=Bf(0);\nfunction ih(a){for(var b=a;null!==b;){if(13===b.tag){var c=b.memoizedState;if(null!==c&&(c=c.dehydrated,null===c||\"$?\"===c.data||\"$!\"===c.data))return b}else if(19===b.tag&&void 0!==b.memoizedProps.revealOrder){if(0!==(b.flags&64))return b}else if(null!==b.child){b.child.return=b;b=b.child;continue}if(b===a)break;for(;null===b.sibling;){if(null===b.return||b.return===a)return null;b=b.return}b.sibling.return=b.return;b=b.sibling}return null}var jh=null,kh=null,lh=!1;\nfunction mh(a,b){var c=nh(5,null,null,0);c.elementType=\"DELETED\";c.type=\"DELETED\";c.stateNode=b;c.return=a;c.flags=8;null!==a.lastEffect?(a.lastEffect.nextEffect=c,a.lastEffect=c):a.firstEffect=a.lastEffect=c}function oh(a,b){switch(a.tag){case 5:var c=a.type;b=1!==b.nodeType||c.toLowerCase()!==b.nodeName.toLowerCase()?null:b;return null!==b?(a.stateNode=b,!0):!1;case 6:return b=\"\"===a.pendingProps||3!==b.nodeType?null:b,null!==b?(a.stateNode=b,!0):!1;case 13:return!1;default:return!1}}\nfunction ph(a){if(lh){var b=kh;if(b){var c=b;if(!oh(a,b)){b=rf(c.nextSibling);if(!b||!oh(a,b)){a.flags=a.flags&-1025|2;lh=!1;jh=a;return}mh(jh,c)}jh=a;kh=rf(b.firstChild)}else a.flags=a.flags&-1025|2,lh=!1,jh=a}}function qh(a){for(a=a.return;null!==a&&5!==a.tag&&3!==a.tag&&13!==a.tag;)a=a.return;jh=a}\nfunction rh(a){if(a!==jh)return!1;if(!lh)return qh(a),lh=!0,!1;var b=a.type;if(5!==a.tag||\"head\"!==b&&\"body\"!==b&&!nf(b,a.memoizedProps))for(b=kh;b;)mh(a,b),b=rf(b.nextSibling);qh(a);if(13===a.tag){a=a.memoizedState;a=null!==a?a.dehydrated:null;if(!a)throw Error(y(317));a:{a=a.nextSibling;for(b=0;a;){if(8===a.nodeType){var c=a.data;if(\"/$\"===c){if(0===b){kh=rf(a.nextSibling);break a}b--}else\"$\"!==c&&\"$!\"!==c&&\"$?\"!==c||b++}a=a.nextSibling}kh=null}}else kh=jh?rf(a.stateNode.nextSibling):null;return!0}\nfunction sh(){kh=jh=null;lh=!1}var th=[];function uh(){for(var a=0;af))throw Error(y(301));f+=1;T=S=null;b.updateQueue=null;vh.current=Fh;a=c(d,e)}while(zh)}vh.current=Gh;b=null!==S&&null!==S.next;xh=0;T=S=R=null;yh=!1;if(b)throw Error(y(300));return a}function Hh(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};null===T?R.memoizedState=T=a:T=T.next=a;return T}\nfunction Ih(){if(null===S){var a=R.alternate;a=null!==a?a.memoizedState:null}else a=S.next;var b=null===T?R.memoizedState:T.next;if(null!==b)T=b,S=a;else{if(null===a)throw Error(y(310));S=a;a={memoizedState:S.memoizedState,baseState:S.baseState,baseQueue:S.baseQueue,queue:S.queue,next:null};null===T?R.memoizedState=T=a:T=T.next=a}return T}function Jh(a,b){return\"function\"===typeof b?b(a):b}\nfunction Kh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=S,e=d.baseQueue,f=c.pending;if(null!==f){if(null!==e){var g=e.next;e.next=f.next;f.next=g}d.baseQueue=e=f;c.pending=null}if(null!==e){e=e.next;d=d.baseState;var h=g=f=null,k=e;do{var l=k.lane;if((xh&l)===l)null!==h&&(h=h.next={lane:0,action:k.action,eagerReducer:k.eagerReducer,eagerState:k.eagerState,next:null}),d=k.eagerReducer===a?k.eagerState:a(d,k.action);else{var n={lane:l,action:k.action,eagerReducer:k.eagerReducer,\neagerState:k.eagerState,next:null};null===h?(g=h=n,f=d):h=h.next=n;R.lanes|=l;Dg|=l}k=k.next}while(null!==k&&k!==e);null===h?f=d:h.next=g;He(d,b.memoizedState)||(ug=!0);b.memoizedState=d;b.baseState=f;b.baseQueue=h;c.lastRenderedState=d}return[b.memoizedState,c.dispatch]}\nfunction Lh(a){var b=Ih(),c=b.queue;if(null===c)throw Error(y(311));c.lastRenderedReducer=a;var d=c.dispatch,e=c.pending,f=b.memoizedState;if(null!==e){c.pending=null;var g=e=e.next;do f=a(f,g.action),g=g.next;while(g!==e);He(f,b.memoizedState)||(ug=!0);b.memoizedState=f;null===b.baseQueue&&(b.baseState=f);c.lastRenderedState=f}return[f,d]}\nfunction Mh(a,b,c){var d=b._getVersion;d=d(b._source);var e=b._workInProgressVersionPrimary;if(null!==e)a=e===d;else if(a=a.mutableReadLanes,a=(xh&a)===a)b._workInProgressVersionPrimary=d,th.push(b);if(a)return c(b._source);th.push(b);throw Error(y(350));}\nfunction Nh(a,b,c,d){var e=U;if(null===e)throw Error(y(349));var f=b._getVersion,g=f(b._source),h=vh.current,k=h.useState(function(){return Mh(e,b,c)}),l=k[1],n=k[0];k=T;var A=a.memoizedState,p=A.refs,C=p.getSnapshot,x=A.source;A=A.subscribe;var w=R;a.memoizedState={refs:p,source:b,subscribe:d};h.useEffect(function(){p.getSnapshot=c;p.setSnapshot=l;var a=f(b._source);if(!He(g,a)){a=c(b._source);He(n,a)||(l(a),a=Ig(w),e.mutableReadLanes|=a&e.pendingLanes);a=e.mutableReadLanes;e.entangledLanes|=a;for(var d=\ne.entanglements,h=a;0c?98:c,function(){a(!0)});gg(97\\x3c/script>\",a=a.removeChild(a.firstChild)):\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[wf]=b;a[xf]=d;Bi(a,b,!1,!1);b.stateNode=a;g=wb(c,d);switch(c){case \"dialog\":G(\"cancel\",a);G(\"close\",a);\ne=d;break;case \"iframe\":case \"object\":case \"embed\":G(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eJi&&(b.flags|=64,f=!0,Fi(d,!1),b.lanes=33554432)}else{if(!f)if(a=ih(g),null!==a){if(b.flags|=64,f=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Fi(d,!0),null===d.tail&&\"hidden\"===d.tailMode&&!g.alternate&&!lh)return b=b.lastEffect=d.lastEffect,null!==b&&(b.nextEffect=null),null}else 2*O()-d.renderingStartTime>Ji&&1073741824!==c&&(b.flags|=\n64,f=!0,Fi(d,!1),b.lanes=33554432);d.isBackwards?(g.sibling=b.child,b.child=g):(c=d.last,null!==c?c.sibling=g:b.child=g,d.last=g)}return null!==d.tail?(c=d.tail,d.rendering=c,d.tail=c.sibling,d.lastEffect=b.lastEffect,d.renderingStartTime=O(),c.sibling=null,b=P.current,I(P,f?b&1|2:b&1),c):null;case 23:case 24:return Ki(),null!==a&&null!==a.memoizedState!==(null!==b.memoizedState)&&\"unstable-defer-without-hiding\"!==d.mode&&(b.flags|=4),null}throw Error(y(156,b.tag));}\nfunction Li(a){switch(a.tag){case 1:Ff(a.type)&&Gf();var b=a.flags;return b&4096?(a.flags=b&-4097|64,a):null;case 3:fh();H(N);H(M);uh();b=a.flags;if(0!==(b&64))throw Error(y(285));a.flags=b&-4097|64;return a;case 5:return hh(a),null;case 13:return H(P),b=a.flags,b&4096?(a.flags=b&-4097|64,a):null;case 19:return H(P),null;case 4:return fh(),null;case 10:return rg(a),null;case 23:case 24:return Ki(),null;default:return null}}\nfunction Mi(a,b){try{var c=\"\",d=b;do c+=Qa(d),d=d.return;while(d);var e=c}catch(f){e=\"\\nError generating stack: \"+f.message+\"\\n\"+f.stack}return{value:a,source:b,stack:e}}function Ni(a,b){try{console.error(b.value)}catch(c){setTimeout(function(){throw c;})}}var Oi=\"function\"===typeof WeakMap?WeakMap:Map;function Pi(a,b,c){c=zg(-1,c);c.tag=3;c.payload={element:null};var d=b.value;c.callback=function(){Qi||(Qi=!0,Ri=d);Ni(a,b)};return c}\nfunction Si(a,b,c){c=zg(-1,c);c.tag=3;var d=a.type.getDerivedStateFromError;if(\"function\"===typeof d){var e=b.value;c.payload=function(){Ni(a,b);return d(e)}}var f=a.stateNode;null!==f&&\"function\"===typeof f.componentDidCatch&&(c.callback=function(){\"function\"!==typeof d&&(null===Ti?Ti=new Set([this]):Ti.add(this),Ni(a,b));var c=b.stack;this.componentDidCatch(b.value,{componentStack:null!==c?c:\"\"})});return c}var Ui=\"function\"===typeof WeakSet?WeakSet:Set;\nfunction Vi(a){var b=a.ref;if(null!==b)if(\"function\"===typeof b)try{b(null)}catch(c){Wi(a,c)}else b.current=null}function Xi(a,b){switch(b.tag){case 0:case 11:case 15:case 22:return;case 1:if(b.flags&256&&null!==a){var c=a.memoizedProps,d=a.memoizedState;a=b.stateNode;b=a.getSnapshotBeforeUpdate(b.elementType===b.type?c:lg(b.type,c),d);a.__reactInternalSnapshotBeforeUpdate=b}return;case 3:b.flags&256&&qf(b.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(y(163));}\nfunction Yi(a,b,c){switch(c.tag){case 0:case 11:case 15:case 22:b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{if(3===(a.tag&3)){var d=a.create;a.destroy=d()}a=a.next}while(a!==b)}b=c.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){a=b=b.next;do{var e=a;d=e.next;e=e.tag;0!==(e&4)&&0!==(e&1)&&(Zi(c,a),$i(c,a));a=d}while(a!==b)}return;case 1:a=c.stateNode;c.flags&4&&(null===b?a.componentDidMount():(d=c.elementType===c.type?b.memoizedProps:lg(c.type,b.memoizedProps),a.componentDidUpdate(d,\nb.memoizedState,a.__reactInternalSnapshotBeforeUpdate)));b=c.updateQueue;null!==b&&Eg(c,b,a);return;case 3:b=c.updateQueue;if(null!==b){a=null;if(null!==c.child)switch(c.child.tag){case 5:a=c.child.stateNode;break;case 1:a=c.child.stateNode}Eg(c,b,a)}return;case 5:a=c.stateNode;null===b&&c.flags&4&&mf(c.type,c.memoizedProps)&&a.focus();return;case 6:return;case 4:return;case 12:return;case 13:null===c.memoizedState&&(c=c.alternate,null!==c&&(c=c.memoizedState,null!==c&&(c=c.dehydrated,null!==c&&Cc(c))));\nreturn;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(y(163));}\nfunction aj(a,b){for(var c=a;;){if(5===c.tag){var d=c.stateNode;if(b)d=d.style,\"function\"===typeof d.setProperty?d.setProperty(\"display\",\"none\",\"important\"):d.display=\"none\";else{d=c.stateNode;var e=c.memoizedProps.style;e=void 0!==e&&null!==e&&e.hasOwnProperty(\"display\")?e.display:null;d.style.display=sb(\"display\",e)}}else if(6===c.tag)c.stateNode.nodeValue=b?\"\":c.memoizedProps;else if((23!==c.tag&&24!==c.tag||null===c.memoizedState||c===a)&&null!==c.child){c.child.return=c;c=c.child;continue}if(c===\na)break;for(;null===c.sibling;){if(null===c.return||c.return===a)return;c=c.return}c.sibling.return=c.return;c=c.sibling}}\nfunction bj(a,b){if(Mf&&\"function\"===typeof Mf.onCommitFiberUnmount)try{Mf.onCommitFiberUnmount(Lf,b)}catch(f){}switch(b.tag){case 0:case 11:case 14:case 15:case 22:a=b.updateQueue;if(null!==a&&(a=a.lastEffect,null!==a)){var c=a=a.next;do{var d=c,e=d.destroy;d=d.tag;if(void 0!==e)if(0!==(d&4))Zi(b,c);else{d=b;try{e()}catch(f){Wi(d,f)}}c=c.next}while(c!==a)}break;case 1:Vi(b);a=b.stateNode;if(\"function\"===typeof a.componentWillUnmount)try{a.props=b.memoizedProps,a.state=b.memoizedState,a.componentWillUnmount()}catch(f){Wi(b,\nf)}break;case 5:Vi(b);break;case 4:cj(a,b)}}function dj(a){a.alternate=null;a.child=null;a.dependencies=null;a.firstEffect=null;a.lastEffect=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.return=null;a.updateQueue=null}function ej(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction fj(a){a:{for(var b=a.return;null!==b;){if(ej(b))break a;b=b.return}throw Error(y(160));}var c=b;b=c.stateNode;switch(c.tag){case 5:var d=!1;break;case 3:b=b.containerInfo;d=!0;break;case 4:b=b.containerInfo;d=!0;break;default:throw Error(y(161));}c.flags&16&&(pb(b,\"\"),c.flags&=-17);a:b:for(c=a;;){for(;null===c.sibling;){if(null===c.return||ej(c.return)){c=null;break a}c=c.return}c.sibling.return=c.return;for(c=c.sibling;5!==c.tag&&6!==c.tag&&18!==c.tag;){if(c.flags&2)continue b;if(null===\nc.child||4===c.tag)continue b;else c.child.return=c,c=c.child}if(!(c.flags&2)){c=c.stateNode;break a}}d?gj(a,c,b):hj(a,c,b)}\nfunction gj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=jf));else if(4!==d&&(a=a.child,null!==a))for(gj(a,b,c),a=a.sibling;null!==a;)gj(a,b,c),a=a.sibling}\nfunction hj(a,b,c){var d=a.tag,e=5===d||6===d;if(e)a=e?a.stateNode:a.stateNode.instance,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(hj(a,b,c),a=a.sibling;null!==a;)hj(a,b,c),a=a.sibling}\nfunction cj(a,b){for(var c=b,d=!1,e,f;;){if(!d){d=c.return;a:for(;;){if(null===d)throw Error(y(160));e=d.stateNode;switch(d.tag){case 5:f=!1;break a;case 3:e=e.containerInfo;f=!0;break a;case 4:e=e.containerInfo;f=!0;break a}d=d.return}d=!0}if(5===c.tag||6===c.tag){a:for(var g=a,h=c,k=h;;)if(bj(g,k),null!==k.child&&4!==k.tag)k.child.return=k,k=k.child;else{if(k===h)break a;for(;null===k.sibling;){if(null===k.return||k.return===h)break a;k=k.return}k.sibling.return=k.return;k=k.sibling}f?(g=e,h=c.stateNode,\n8===g.nodeType?g.parentNode.removeChild(h):g.removeChild(h)):e.removeChild(c.stateNode)}else if(4===c.tag){if(null!==c.child){e=c.stateNode.containerInfo;f=!0;c.child.return=c;c=c.child;continue}}else if(bj(a,c),null!==c.child){c.child.return=c;c=c.child;continue}if(c===b)break;for(;null===c.sibling;){if(null===c.return||c.return===b)return;c=c.return;4===c.tag&&(d=!1)}c.sibling.return=c.return;c=c.sibling}}\nfunction ij(a,b){switch(b.tag){case 0:case 11:case 14:case 15:case 22:var c=b.updateQueue;c=null!==c?c.lastEffect:null;if(null!==c){var d=c=c.next;do 3===(d.tag&3)&&(a=d.destroy,d.destroy=void 0,void 0!==a&&a()),d=d.next;while(d!==c)}return;case 1:return;case 5:c=b.stateNode;if(null!=c){d=b.memoizedProps;var e=null!==a?a.memoizedProps:d;a=b.type;var f=b.updateQueue;b.updateQueue=null;if(null!==f){c[xf]=d;\"input\"===a&&\"radio\"===d.type&&null!=d.name&&$a(c,d);wb(a,e);b=wb(a,d);for(e=0;ee&&(e=g);c&=~f}c=e;c=O()-c;c=(120>c?120:480>c?480:1080>c?1080:1920>c?1920:3E3>c?3E3:4320>\nc?4320:1960*nj(c/1960))-c;if(10 component higher in the tree to provide a loading indicator or placeholder to display.\")}5!==V&&(V=2);k=Mi(k,h);p=\ng;do{switch(p.tag){case 3:f=k;p.flags|=4096;b&=-b;p.lanes|=b;var J=Pi(p,f,b);Bg(p,J);break a;case 1:f=k;var K=p.type,Q=p.stateNode;if(0===(p.flags&64)&&(\"function\"===typeof K.getDerivedStateFromError||null!==Q&&\"function\"===typeof Q.componentDidCatch&&(null===Ti||!Ti.has(Q)))){p.flags|=4096;b&=-b;p.lanes|=b;var L=Si(p,f,b);Bg(p,L);break a}}p=p.return}while(null!==p)}Zj(c)}catch(va){b=va;Y===c&&null!==c&&(Y=c=c.return);continue}break}while(1)}\nfunction Pj(){var a=oj.current;oj.current=Gh;return null===a?Gh:a}function Tj(a,b){var c=X;X|=16;var d=Pj();U===a&&W===b||Qj(a,b);do try{ak();break}catch(e){Sj(a,e)}while(1);qg();X=c;oj.current=d;if(null!==Y)throw Error(y(261));U=null;W=0;return V}function ak(){for(;null!==Y;)bk(Y)}function Rj(){for(;null!==Y&&!Qf();)bk(Y)}function bk(a){var b=ck(a.alternate,a,qj);a.memoizedProps=a.pendingProps;null===b?Zj(a):Y=b;pj.current=null}\nfunction Zj(a){var b=a;do{var c=b.alternate;a=b.return;if(0===(b.flags&2048)){c=Gi(c,b,qj);if(null!==c){Y=c;return}c=b;if(24!==c.tag&&23!==c.tag||null===c.memoizedState||0!==(qj&1073741824)||0===(c.mode&4)){for(var d=0,e=c.child;null!==e;)d|=e.lanes|e.childLanes,e=e.sibling;c.childLanes=d}null!==a&&0===(a.flags&2048)&&(null===a.firstEffect&&(a.firstEffect=b.firstEffect),null!==b.lastEffect&&(null!==a.lastEffect&&(a.lastEffect.nextEffect=b.firstEffect),a.lastEffect=b.lastEffect),1g&&(h=g,g=J,J=h),h=Le(t,J),f=Le(t,g),h&&f&&(1!==v.rangeCount||v.anchorNode!==h.node||v.anchorOffset!==h.offset||v.focusNode!==f.node||v.focusOffset!==f.offset)&&(q=q.createRange(),q.setStart(h.node,h.offset),v.removeAllRanges(),J>g?(v.addRange(q),v.extend(f.node,f.offset)):(q.setEnd(f.node,f.offset),v.addRange(q))))));q=[];for(v=t;v=v.parentNode;)1===v.nodeType&&q.push({element:v,left:v.scrollLeft,top:v.scrollTop});\"function\"===typeof t.focus&&t.focus();for(t=\n0;tO()-jj?Qj(a,0):uj|=c);Mj(a,b)}function lj(a,b){var c=a.stateNode;null!==c&&c.delete(b);b=0;0===b&&(b=a.mode,0===(b&2)?b=1:0===(b&4)?b=99===eg()?1:2:(0===Gj&&(Gj=tj),b=Yc(62914560&~Gj),0===b&&(b=4194304)));c=Hg();a=Kj(a,b);null!==a&&($c(a,b,c),Mj(a,c))}var ck;\nck=function(a,b,c){var d=b.lanes;if(null!==a)if(a.memoizedProps!==b.pendingProps||N.current)ug=!0;else if(0!==(c&d))ug=0!==(a.flags&16384)?!0:!1;else{ug=!1;switch(b.tag){case 3:ri(b);sh();break;case 5:gh(b);break;case 1:Ff(b.type)&&Jf(b);break;case 4:eh(b,b.stateNode.containerInfo);break;case 10:d=b.memoizedProps.value;var e=b.type._context;I(mg,e._currentValue);e._currentValue=d;break;case 13:if(null!==b.memoizedState){if(0!==(c&b.child.childLanes))return ti(a,b,c);I(P,P.current&1);b=hi(a,b,c);return null!==\nb?b.sibling:null}I(P,P.current&1);break;case 19:d=0!==(c&b.childLanes);if(0!==(a.flags&64)){if(d)return Ai(a,b,c);b.flags|=64}e=b.memoizedState;null!==e&&(e.rendering=null,e.tail=null,e.lastEffect=null);I(P,P.current);if(d)break;else return null;case 23:case 24:return b.lanes=0,mi(a,b,c)}return hi(a,b,c)}else ug=!1;b.lanes=0;switch(b.tag){case 2:d=b.type;null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);a=b.pendingProps;e=Ef(b,M.current);tg(b,c);e=Ch(null,b,d,a,e,c);b.flags|=1;if(\"object\"===\ntypeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof){b.tag=1;b.memoizedState=null;b.updateQueue=null;if(Ff(d)){var f=!0;Jf(b)}else f=!1;b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null;xg(b);var g=d.getDerivedStateFromProps;\"function\"===typeof g&&Gg(b,d,g,a);e.updater=Kg;b.stateNode=e;e._reactInternals=b;Og(b,d,a,c);b=qi(null,b,d,!0,f,c)}else b.tag=0,fi(null,b,e,c),b=b.child;return b;case 16:e=b.elementType;a:{null!==a&&(a.alternate=null,b.alternate=null,b.flags|=2);\na=b.pendingProps;f=e._init;e=f(e._payload);b.type=e;f=b.tag=hk(e);a=lg(e,a);switch(f){case 0:b=li(null,b,e,a,c);break a;case 1:b=pi(null,b,e,a,c);break a;case 11:b=gi(null,b,e,a,c);break a;case 14:b=ii(null,b,e,lg(e.type,a),d,c);break a}throw Error(y(306,e,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),li(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:lg(d,e),pi(a,b,d,e,c);case 3:ri(b);d=b.updateQueue;if(null===a||null===d)throw Error(y(282));\nd=b.pendingProps;e=b.memoizedState;e=null!==e?e.element:null;yg(a,b);Cg(b,d,null,c);d=b.memoizedState.element;if(d===e)sh(),b=hi(a,b,c);else{e=b.stateNode;if(f=e.hydrate)kh=rf(b.stateNode.containerInfo.firstChild),jh=b,f=lh=!0;if(f){a=e.mutableSourceEagerHydrationData;if(null!=a)for(e=0;e= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","import { useCallback, useEffect, useRef } from 'react';\nexport default function useMountedState() {\n var mountedRef = useRef(false);\n var get = useCallback(function () { return mountedRef.current; }, []);\n useEffect(function () {\n mountedRef.current = true;\n return function () {\n mountedRef.current = false;\n };\n }, []);\n return get;\n}\n","import { __assign } from \"tslib\";\nimport { useCallback, useRef, useState } from 'react';\nimport useMountedState from './useMountedState';\nexport default function useAsyncFn(fn, deps, initialState) {\n if (deps === void 0) { deps = []; }\n if (initialState === void 0) { initialState = { loading: false }; }\n var lastCallId = useRef(0);\n var isMounted = useMountedState();\n var _a = useState(initialState), state = _a[0], set = _a[1];\n var callback = useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var callId = ++lastCallId.current;\n if (!state.loading) {\n set(function (prevState) { return (__assign(__assign({}, prevState), { loading: true })); });\n }\n return fn.apply(void 0, args).then(function (value) {\n isMounted() && callId === lastCallId.current && set({ value: value, loading: false });\n return value;\n }, function (error) {\n isMounted() && callId === lastCallId.current && set({ error: error, loading: false });\n return error;\n });\n }, deps);\n return [state, callback];\n}\n","import { useEffect } from 'react';\nimport useAsyncFn from './useAsyncFn';\nexport default function useAsync(fn, deps) {\n if (deps === void 0) { deps = []; }\n var _a = useAsyncFn(fn, deps, {\n loading: true,\n }), state = _a[0], callback = _a[1];\n useEffect(function () {\n callback();\n }, [callback]);\n return state;\n}\n","export var noop = function () { };\nexport function on(obj) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (obj && obj.addEventListener) {\n obj.addEventListener.apply(obj, args);\n }\n}\nexport function off(obj) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n if (obj && obj.removeEventListener) {\n obj.removeEventListener.apply(obj, args);\n }\n}\nexport var isBrowser = typeof window !== 'undefined';\nexport var isNavigator = typeof navigator !== 'undefined';\n","import { useReducer } from 'react';\nvar toggleReducer = function (state, nextValue) {\n return typeof nextValue === 'boolean' ? nextValue : !state;\n};\nvar useToggle = function (initialValue) {\n return useReducer(toggleReducer, initialValue);\n};\nexport default useToggle;\n","import { useCallback, useEffect, useRef } from 'react';\nexport default function useTimeoutFn(fn, ms) {\n if (ms === void 0) { ms = 0; }\n var ready = useRef(false);\n var timeout = useRef();\n var callback = useRef(fn);\n var isReady = useCallback(function () { return ready.current; }, []);\n var set = useCallback(function () {\n ready.current = false;\n timeout.current && clearTimeout(timeout.current);\n timeout.current = setTimeout(function () {\n ready.current = true;\n callback.current();\n }, ms);\n }, [ms]);\n var clear = useCallback(function () {\n ready.current = null;\n timeout.current && clearTimeout(timeout.current);\n }, []);\n // update ref when function changes\n useEffect(function () {\n callback.current = fn;\n }, [fn]);\n // set on mount, clear on unmount\n useEffect(function () {\n set();\n return clear;\n }, [ms]);\n return [isReady, clear, set];\n}\n","import { useEffect } from 'react';\nimport useTimeoutFn from './useTimeoutFn';\nexport default function useDebounce(fn, ms, deps) {\n if (ms === void 0) { ms = 0; }\n if (deps === void 0) { deps = []; }\n var _a = useTimeoutFn(fn, ms), isReady = _a[0], cancel = _a[1], reset = _a[2];\n useEffect(reset, deps);\n return [isReady, cancel];\n}\n","import { useEffect } from 'react';\nvar useEffectOnce = function (effect) {\n useEffect(effect, []);\n};\nexport default useEffectOnce;\n","import { useCallback, useState, useRef, useLayoutEffect } from 'react';\nimport { isBrowser, noop } from './misc/util';\nvar useLocalStorage = function (key, initialValue, options) {\n if (!isBrowser) {\n return [initialValue, noop, noop];\n }\n if (!key) {\n throw new Error('useLocalStorage key may not be falsy');\n }\n var deserializer = options\n ? options.raw\n ? function (value) { return value; }\n : options.deserializer\n : JSON.parse;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n var initializer = useRef(function (key) {\n try {\n var serializer = options ? (options.raw ? String : options.serializer) : JSON.stringify;\n var localStorageValue = localStorage.getItem(key);\n if (localStorageValue !== null) {\n return deserializer(localStorageValue);\n }\n else {\n initialValue && localStorage.setItem(key, serializer(initialValue));\n return initialValue;\n }\n }\n catch (_a) {\n // If user is in private mode or has storage restriction\n // localStorage can throw. JSON.parse and JSON.stringify\n // can throw, too.\n return initialValue;\n }\n });\n // eslint-disable-next-line react-hooks/rules-of-hooks\n var _a = useState(function () { return initializer.current(key); }), state = _a[0], setState = _a[1];\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useLayoutEffect(function () { return setState(initializer.current(key)); }, [key]);\n // eslint-disable-next-line react-hooks/rules-of-hooks\n var set = useCallback(function (valOrFunc) {\n try {\n var newState = typeof valOrFunc === 'function' ? valOrFunc(state) : valOrFunc;\n if (typeof newState === 'undefined')\n return;\n var value = void 0;\n if (options)\n if (options.raw)\n if (typeof newState === 'string')\n value = newState;\n else\n value = JSON.stringify(newState);\n else if (options.serializer)\n value = options.serializer(newState);\n else\n value = JSON.stringify(newState);\n else\n value = JSON.stringify(newState);\n localStorage.setItem(key, value);\n setState(deserializer(value));\n }\n catch (_a) {\n // If user is in private mode or has storage restriction\n // localStorage can throw. Also JSON.stringify can throw.\n }\n }, [key, setState]);\n // eslint-disable-next-line react-hooks/rules-of-hooks\n var remove = useCallback(function () {\n try {\n localStorage.removeItem(key);\n setState(undefined);\n }\n catch (_a) {\n // If user is in private mode or has storage restriction\n // localStorage can throw.\n }\n }, [key, setState]);\n return [state, set, remove];\n};\nexport default useLocalStorage;\n","import useEffectOnce from './useEffectOnce';\nvar useMount = function (fn) {\n useEffectOnce(function () {\n fn();\n });\n};\nexport default useMount;\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\n\nexport { __assign, __awaiter, __extends, __generator, __read, __rest, __spread };\n//# sourceMappingURL=_tslib.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\n\nexport { __assign, __awaiter, __extends, __generator, __spreadArrays };\n//# sourceMappingURL=_tslib.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __spreadArrays } from '../_virtual/_tslib.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar Constants = {\r\n LIBRARY_NAME: \"MSAL.JS\",\r\n SKU: \"msal.js.common\",\r\n // Prefix for all library cache entries\r\n CACHE_PREFIX: \"msal\",\r\n // default authority\r\n DEFAULT_AUTHORITY: \"https://login.microsoftonline.com/common/\",\r\n DEFAULT_AUTHORITY_HOST: \"login.microsoftonline.com\",\r\n DEFAULT_COMMON_TENANT: \"common\",\r\n // ADFS String\r\n ADFS: \"adfs\",\r\n DSTS: \"dstsv2\",\r\n // Default AAD Instance Discovery Endpoint\r\n AAD_INSTANCE_DISCOVERY_ENDPT: \"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=\",\r\n // CIAM URL\r\n CIAM_AUTH_URL: \".ciamlogin.com\",\r\n AAD_TENANT_DOMAIN_SUFFIX: \".onmicrosoft.com\",\r\n // Resource delimiter - used for certain cache entries\r\n RESOURCE_DELIM: \"|\",\r\n // Placeholder for non-existent account ids/objects\r\n NO_ACCOUNT: \"NO_ACCOUNT\",\r\n // Claims\r\n CLAIMS: \"claims\",\r\n // Consumer UTID\r\n CONSUMER_UTID: \"9188040d-6c67-4c5b-b112-36a304b66dad\",\r\n // Default scopes\r\n OPENID_SCOPE: \"openid\",\r\n PROFILE_SCOPE: \"profile\",\r\n OFFLINE_ACCESS_SCOPE: \"offline_access\",\r\n EMAIL_SCOPE: \"email\",\r\n // Default response type for authorization code flow\r\n CODE_RESPONSE_TYPE: \"code\",\r\n CODE_GRANT_TYPE: \"authorization_code\",\r\n RT_GRANT_TYPE: \"refresh_token\",\r\n FRAGMENT_RESPONSE_MODE: \"fragment\",\r\n S256_CODE_CHALLENGE_METHOD: \"S256\",\r\n URL_FORM_CONTENT_TYPE: \"application/x-www-form-urlencoded;charset=utf-8\",\r\n AUTHORIZATION_PENDING: \"authorization_pending\",\r\n NOT_DEFINED: \"not_defined\",\r\n EMPTY_STRING: \"\",\r\n NOT_APPLICABLE: \"N/A\",\r\n FORWARD_SLASH: \"/\",\r\n IMDS_ENDPOINT: \"http://169.254.169.254/metadata/instance/compute/location\",\r\n IMDS_VERSION: \"2020-06-01\",\r\n IMDS_TIMEOUT: 2000,\r\n AZURE_REGION_AUTO_DISCOVER_FLAG: \"TryAutoDetect\",\r\n REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: \"login.microsoft.com\",\r\n REGIONAL_AUTH_NON_MSI_QUERY_STRING: \"allowestsrnonmsi=true\",\r\n KNOWN_PUBLIC_CLOUDS: [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"],\r\n TOKEN_RESPONSE_TYPE: \"token\",\r\n ID_TOKEN_RESPONSE_TYPE: \"id_token\",\r\n SHR_NONCE_VALIDITY: 240,\r\n INVALID_INSTANCE: \"invalid_instance\",\r\n};\r\nvar OIDC_DEFAULT_SCOPES = [\r\n Constants.OPENID_SCOPE,\r\n Constants.PROFILE_SCOPE,\r\n Constants.OFFLINE_ACCESS_SCOPE\r\n];\r\nvar OIDC_SCOPES = __spreadArrays(OIDC_DEFAULT_SCOPES, [\r\n Constants.EMAIL_SCOPE\r\n]);\r\n/**\r\n * Request header names\r\n */\r\nvar HeaderNames;\r\n(function (HeaderNames) {\r\n HeaderNames[\"CONTENT_TYPE\"] = \"Content-Type\";\r\n HeaderNames[\"RETRY_AFTER\"] = \"Retry-After\";\r\n HeaderNames[\"CCS_HEADER\"] = \"X-AnchorMailbox\";\r\n HeaderNames[\"WWWAuthenticate\"] = \"WWW-Authenticate\";\r\n HeaderNames[\"AuthenticationInfo\"] = \"Authentication-Info\";\r\n HeaderNames[\"X_MS_REQUEST_ID\"] = \"x-ms-request-id\";\r\n HeaderNames[\"X_MS_HTTP_VERSION\"] = \"x-ms-httpver\";\r\n})(HeaderNames || (HeaderNames = {}));\r\n/**\r\n * Persistent cache keys MSAL which stay while user is logged in.\r\n */\r\nvar PersistentCacheKeys;\r\n(function (PersistentCacheKeys) {\r\n PersistentCacheKeys[\"ID_TOKEN\"] = \"idtoken\";\r\n PersistentCacheKeys[\"CLIENT_INFO\"] = \"client.info\";\r\n PersistentCacheKeys[\"ADAL_ID_TOKEN\"] = \"adal.idtoken\";\r\n PersistentCacheKeys[\"ERROR\"] = \"error\";\r\n PersistentCacheKeys[\"ERROR_DESC\"] = \"error.description\";\r\n PersistentCacheKeys[\"ACTIVE_ACCOUNT\"] = \"active-account\";\r\n PersistentCacheKeys[\"ACTIVE_ACCOUNT_FILTERS\"] = \"active-account-filters\"; // new cache entry for active_account for a more robust version for browser\r\n})(PersistentCacheKeys || (PersistentCacheKeys = {}));\r\n/**\r\n * String constants related to AAD Authority\r\n */\r\nvar AADAuthorityConstants;\r\n(function (AADAuthorityConstants) {\r\n AADAuthorityConstants[\"COMMON\"] = \"common\";\r\n AADAuthorityConstants[\"ORGANIZATIONS\"] = \"organizations\";\r\n AADAuthorityConstants[\"CONSUMERS\"] = \"consumers\";\r\n})(AADAuthorityConstants || (AADAuthorityConstants = {}));\r\n/**\r\n * Keys in the hashParams sent by AAD Server\r\n */\r\nvar AADServerParamKeys;\r\n(function (AADServerParamKeys) {\r\n AADServerParamKeys[\"CLIENT_ID\"] = \"client_id\";\r\n AADServerParamKeys[\"REDIRECT_URI\"] = \"redirect_uri\";\r\n AADServerParamKeys[\"RESPONSE_TYPE\"] = \"response_type\";\r\n AADServerParamKeys[\"RESPONSE_MODE\"] = \"response_mode\";\r\n AADServerParamKeys[\"GRANT_TYPE\"] = \"grant_type\";\r\n AADServerParamKeys[\"CLAIMS\"] = \"claims\";\r\n AADServerParamKeys[\"SCOPE\"] = \"scope\";\r\n AADServerParamKeys[\"ERROR\"] = \"error\";\r\n AADServerParamKeys[\"ERROR_DESCRIPTION\"] = \"error_description\";\r\n AADServerParamKeys[\"ACCESS_TOKEN\"] = \"access_token\";\r\n AADServerParamKeys[\"ID_TOKEN\"] = \"id_token\";\r\n AADServerParamKeys[\"REFRESH_TOKEN\"] = \"refresh_token\";\r\n AADServerParamKeys[\"EXPIRES_IN\"] = \"expires_in\";\r\n AADServerParamKeys[\"STATE\"] = \"state\";\r\n AADServerParamKeys[\"NONCE\"] = \"nonce\";\r\n AADServerParamKeys[\"PROMPT\"] = \"prompt\";\r\n AADServerParamKeys[\"SESSION_STATE\"] = \"session_state\";\r\n AADServerParamKeys[\"CLIENT_INFO\"] = \"client_info\";\r\n AADServerParamKeys[\"CODE\"] = \"code\";\r\n AADServerParamKeys[\"CODE_CHALLENGE\"] = \"code_challenge\";\r\n AADServerParamKeys[\"CODE_CHALLENGE_METHOD\"] = \"code_challenge_method\";\r\n AADServerParamKeys[\"CODE_VERIFIER\"] = \"code_verifier\";\r\n AADServerParamKeys[\"CLIENT_REQUEST_ID\"] = \"client-request-id\";\r\n AADServerParamKeys[\"X_CLIENT_SKU\"] = \"x-client-SKU\";\r\n AADServerParamKeys[\"X_CLIENT_VER\"] = \"x-client-VER\";\r\n AADServerParamKeys[\"X_CLIENT_OS\"] = \"x-client-OS\";\r\n AADServerParamKeys[\"X_CLIENT_CPU\"] = \"x-client-CPU\";\r\n AADServerParamKeys[\"X_CLIENT_CURR_TELEM\"] = \"x-client-current-telemetry\";\r\n AADServerParamKeys[\"X_CLIENT_LAST_TELEM\"] = \"x-client-last-telemetry\";\r\n AADServerParamKeys[\"X_MS_LIB_CAPABILITY\"] = \"x-ms-lib-capability\";\r\n AADServerParamKeys[\"X_APP_NAME\"] = \"x-app-name\";\r\n AADServerParamKeys[\"X_APP_VER\"] = \"x-app-ver\";\r\n AADServerParamKeys[\"POST_LOGOUT_URI\"] = \"post_logout_redirect_uri\";\r\n AADServerParamKeys[\"ID_TOKEN_HINT\"] = \"id_token_hint\";\r\n AADServerParamKeys[\"DEVICE_CODE\"] = \"device_code\";\r\n AADServerParamKeys[\"CLIENT_SECRET\"] = \"client_secret\";\r\n AADServerParamKeys[\"CLIENT_ASSERTION\"] = \"client_assertion\";\r\n AADServerParamKeys[\"CLIENT_ASSERTION_TYPE\"] = \"client_assertion_type\";\r\n AADServerParamKeys[\"TOKEN_TYPE\"] = \"token_type\";\r\n AADServerParamKeys[\"REQ_CNF\"] = \"req_cnf\";\r\n AADServerParamKeys[\"OBO_ASSERTION\"] = \"assertion\";\r\n AADServerParamKeys[\"REQUESTED_TOKEN_USE\"] = \"requested_token_use\";\r\n AADServerParamKeys[\"ON_BEHALF_OF\"] = \"on_behalf_of\";\r\n AADServerParamKeys[\"FOCI\"] = \"foci\";\r\n AADServerParamKeys[\"CCS_HEADER\"] = \"X-AnchorMailbox\";\r\n AADServerParamKeys[\"RETURN_SPA_CODE\"] = \"return_spa_code\";\r\n AADServerParamKeys[\"NATIVE_BROKER\"] = \"nativebroker\";\r\n AADServerParamKeys[\"LOGOUT_HINT\"] = \"logout_hint\";\r\n})(AADServerParamKeys || (AADServerParamKeys = {}));\r\n/**\r\n * Claims request keys\r\n */\r\nvar ClaimsRequestKeys;\r\n(function (ClaimsRequestKeys) {\r\n ClaimsRequestKeys[\"ACCESS_TOKEN\"] = \"access_token\";\r\n ClaimsRequestKeys[\"XMS_CC\"] = \"xms_cc\";\r\n})(ClaimsRequestKeys || (ClaimsRequestKeys = {}));\r\n/**\r\n * we considered making this \"enum\" in the request instead of string, however it looks like the allowed list of\r\n * prompt values kept changing over past couple of years. There are some undocumented prompt values for some\r\n * internal partners too, hence the choice of generic \"string\" type instead of the \"enum\"\r\n */\r\nvar PromptValue = {\r\n LOGIN: \"login\",\r\n SELECT_ACCOUNT: \"select_account\",\r\n CONSENT: \"consent\",\r\n NONE: \"none\",\r\n CREATE: \"create\",\r\n NO_SESSION: \"no_session\"\r\n};\r\n/**\r\n * SSO Types - generated to populate hints\r\n */\r\nvar SSOTypes;\r\n(function (SSOTypes) {\r\n SSOTypes[\"ACCOUNT\"] = \"account\";\r\n SSOTypes[\"SID\"] = \"sid\";\r\n SSOTypes[\"LOGIN_HINT\"] = \"login_hint\";\r\n SSOTypes[\"ID_TOKEN\"] = \"id_token\";\r\n SSOTypes[\"DOMAIN_HINT\"] = \"domain_hint\";\r\n SSOTypes[\"ORGANIZATIONS\"] = \"organizations\";\r\n SSOTypes[\"CONSUMERS\"] = \"consumers\";\r\n SSOTypes[\"ACCOUNT_ID\"] = \"accountIdentifier\";\r\n SSOTypes[\"HOMEACCOUNT_ID\"] = \"homeAccountIdentifier\";\r\n})(SSOTypes || (SSOTypes = {}));\r\n/**\r\n * allowed values for codeVerifier\r\n */\r\nvar CodeChallengeMethodValues = {\r\n PLAIN: \"plain\",\r\n S256: \"S256\"\r\n};\r\n/**\r\n * allowed values for response_mode\r\n */\r\nvar ResponseMode;\r\n(function (ResponseMode) {\r\n ResponseMode[\"QUERY\"] = \"query\";\r\n ResponseMode[\"FRAGMENT\"] = \"fragment\";\r\n ResponseMode[\"FORM_POST\"] = \"form_post\";\r\n})(ResponseMode || (ResponseMode = {}));\r\n/**\r\n * allowed grant_type\r\n */\r\nvar GrantType;\r\n(function (GrantType) {\r\n GrantType[\"IMPLICIT_GRANT\"] = \"implicit\";\r\n GrantType[\"AUTHORIZATION_CODE_GRANT\"] = \"authorization_code\";\r\n GrantType[\"CLIENT_CREDENTIALS_GRANT\"] = \"client_credentials\";\r\n GrantType[\"RESOURCE_OWNER_PASSWORD_GRANT\"] = \"password\";\r\n GrantType[\"REFRESH_TOKEN_GRANT\"] = \"refresh_token\";\r\n GrantType[\"DEVICE_CODE_GRANT\"] = \"device_code\";\r\n GrantType[\"JWT_BEARER\"] = \"urn:ietf:params:oauth:grant-type:jwt-bearer\";\r\n})(GrantType || (GrantType = {}));\r\n/**\r\n * Account types in Cache\r\n */\r\nvar CacheAccountType;\r\n(function (CacheAccountType) {\r\n CacheAccountType[\"MSSTS_ACCOUNT_TYPE\"] = \"MSSTS\";\r\n CacheAccountType[\"ADFS_ACCOUNT_TYPE\"] = \"ADFS\";\r\n CacheAccountType[\"MSAV1_ACCOUNT_TYPE\"] = \"MSA\";\r\n CacheAccountType[\"GENERIC_ACCOUNT_TYPE\"] = \"Generic\"; // NTLM, Kerberos, FBA, Basic etc\r\n})(CacheAccountType || (CacheAccountType = {}));\r\n/**\r\n * Separators used in cache\r\n */\r\nvar Separators;\r\n(function (Separators) {\r\n Separators[\"CACHE_KEY_SEPARATOR\"] = \"-\";\r\n Separators[\"CLIENT_INFO_SEPARATOR\"] = \".\";\r\n})(Separators || (Separators = {}));\r\n/**\r\n * Credential Type stored in the cache\r\n */\r\nvar CredentialType;\r\n(function (CredentialType) {\r\n CredentialType[\"ID_TOKEN\"] = \"IdToken\";\r\n CredentialType[\"ACCESS_TOKEN\"] = \"AccessToken\";\r\n CredentialType[\"ACCESS_TOKEN_WITH_AUTH_SCHEME\"] = \"AccessToken_With_AuthScheme\";\r\n CredentialType[\"REFRESH_TOKEN\"] = \"RefreshToken\";\r\n})(CredentialType || (CredentialType = {}));\r\n/**\r\n * Combine all cache types\r\n */\r\nvar CacheType;\r\n(function (CacheType) {\r\n CacheType[CacheType[\"ADFS\"] = 1001] = \"ADFS\";\r\n CacheType[CacheType[\"MSA\"] = 1002] = \"MSA\";\r\n CacheType[CacheType[\"MSSTS\"] = 1003] = \"MSSTS\";\r\n CacheType[CacheType[\"GENERIC\"] = 1004] = \"GENERIC\";\r\n CacheType[CacheType[\"ACCESS_TOKEN\"] = 2001] = \"ACCESS_TOKEN\";\r\n CacheType[CacheType[\"REFRESH_TOKEN\"] = 2002] = \"REFRESH_TOKEN\";\r\n CacheType[CacheType[\"ID_TOKEN\"] = 2003] = \"ID_TOKEN\";\r\n CacheType[CacheType[\"APP_METADATA\"] = 3001] = \"APP_METADATA\";\r\n CacheType[CacheType[\"UNDEFINED\"] = 9999] = \"UNDEFINED\";\r\n})(CacheType || (CacheType = {}));\r\n/**\r\n * More Cache related constants\r\n */\r\nvar APP_METADATA = \"appmetadata\";\r\nvar CLIENT_INFO = \"client_info\";\r\nvar THE_FAMILY_ID = \"1\";\r\nvar AUTHORITY_METADATA_CONSTANTS = {\r\n CACHE_KEY: \"authority-metadata\",\r\n REFRESH_TIME_SECONDS: 3600 * 24 // 24 Hours\r\n};\r\nvar AuthorityMetadataSource;\r\n(function (AuthorityMetadataSource) {\r\n AuthorityMetadataSource[\"CONFIG\"] = \"config\";\r\n AuthorityMetadataSource[\"CACHE\"] = \"cache\";\r\n AuthorityMetadataSource[\"NETWORK\"] = \"network\";\r\n AuthorityMetadataSource[\"HARDCODED_VALUES\"] = \"hardcoded_values\";\r\n})(AuthorityMetadataSource || (AuthorityMetadataSource = {}));\r\nvar SERVER_TELEM_CONSTANTS = {\r\n SCHEMA_VERSION: 5,\r\n MAX_CUR_HEADER_BYTES: 80,\r\n MAX_LAST_HEADER_BYTES: 330,\r\n MAX_CACHED_ERRORS: 50,\r\n CACHE_KEY: \"server-telemetry\",\r\n CATEGORY_SEPARATOR: \"|\",\r\n VALUE_SEPARATOR: \",\",\r\n OVERFLOW_TRUE: \"1\",\r\n OVERFLOW_FALSE: \"0\",\r\n UNKNOWN_ERROR: \"unknown_error\"\r\n};\r\n/**\r\n * Type of the authentication request\r\n */\r\nvar AuthenticationScheme;\r\n(function (AuthenticationScheme) {\r\n AuthenticationScheme[\"BEARER\"] = \"Bearer\";\r\n AuthenticationScheme[\"POP\"] = \"pop\";\r\n AuthenticationScheme[\"SSH\"] = \"ssh-cert\";\r\n})(AuthenticationScheme || (AuthenticationScheme = {}));\r\n/**\r\n * Constants related to throttling\r\n */\r\nvar ThrottlingConstants = {\r\n // Default time to throttle RequestThumbprint in seconds\r\n DEFAULT_THROTTLE_TIME_SECONDS: 60,\r\n // Default maximum time to throttle in seconds, overrides what the server sends back\r\n DEFAULT_MAX_THROTTLE_TIME_SECONDS: 3600,\r\n // Prefix for storing throttling entries\r\n THROTTLING_PREFIX: \"throttling\",\r\n // Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling\r\n X_MS_LIB_CAPABILITY_VALUE: \"retry-after, h429\"\r\n};\r\nvar Errors = {\r\n INVALID_GRANT_ERROR: \"invalid_grant\",\r\n CLIENT_MISMATCH_ERROR: \"client_mismatch\",\r\n};\r\n/**\r\n * Password grant parameters\r\n */\r\nvar PasswordGrantConstants;\r\n(function (PasswordGrantConstants) {\r\n PasswordGrantConstants[\"username\"] = \"username\";\r\n PasswordGrantConstants[\"password\"] = \"password\";\r\n})(PasswordGrantConstants || (PasswordGrantConstants = {}));\r\n/**\r\n * Response codes\r\n */\r\nvar ResponseCodes;\r\n(function (ResponseCodes) {\r\n ResponseCodes[ResponseCodes[\"httpSuccess\"] = 200] = \"httpSuccess\";\r\n ResponseCodes[ResponseCodes[\"httpBadRequest\"] = 400] = \"httpBadRequest\";\r\n})(ResponseCodes || (ResponseCodes = {}));\r\n/**\r\n * Region Discovery Sources\r\n */\r\nvar RegionDiscoverySources;\r\n(function (RegionDiscoverySources) {\r\n RegionDiscoverySources[\"FAILED_AUTO_DETECTION\"] = \"1\";\r\n RegionDiscoverySources[\"INTERNAL_CACHE\"] = \"2\";\r\n RegionDiscoverySources[\"ENVIRONMENT_VARIABLE\"] = \"3\";\r\n RegionDiscoverySources[\"IMDS\"] = \"4\";\r\n})(RegionDiscoverySources || (RegionDiscoverySources = {}));\r\n/**\r\n * Region Discovery Outcomes\r\n */\r\nvar RegionDiscoveryOutcomes;\r\n(function (RegionDiscoveryOutcomes) {\r\n RegionDiscoveryOutcomes[\"CONFIGURED_MATCHES_DETECTED\"] = \"1\";\r\n RegionDiscoveryOutcomes[\"CONFIGURED_NO_AUTO_DETECTION\"] = \"2\";\r\n RegionDiscoveryOutcomes[\"CONFIGURED_NOT_DETECTED\"] = \"3\";\r\n RegionDiscoveryOutcomes[\"AUTO_DETECTION_REQUESTED_SUCCESSFUL\"] = \"4\";\r\n RegionDiscoveryOutcomes[\"AUTO_DETECTION_REQUESTED_FAILED\"] = \"5\";\r\n})(RegionDiscoveryOutcomes || (RegionDiscoveryOutcomes = {}));\r\nvar CacheOutcome;\r\n(function (CacheOutcome) {\r\n CacheOutcome[\"NO_CACHE_HIT\"] = \"0\";\r\n CacheOutcome[\"FORCE_REFRESH\"] = \"1\";\r\n CacheOutcome[\"NO_CACHED_ACCESS_TOKEN\"] = \"2\";\r\n CacheOutcome[\"CACHED_ACCESS_TOKEN_EXPIRED\"] = \"3\";\r\n CacheOutcome[\"REFRESH_CACHED_ACCESS_TOKEN\"] = \"4\";\r\n})(CacheOutcome || (CacheOutcome = {}));\r\nvar JsonTypes;\r\n(function (JsonTypes) {\r\n JsonTypes[\"Jwt\"] = \"JWT\";\r\n JsonTypes[\"Jwk\"] = \"JWK\";\r\n JsonTypes[\"Pop\"] = \"pop\";\r\n})(JsonTypes || (JsonTypes = {}));\r\nvar ONE_DAY_IN_MS = 86400000;\n\nexport { AADAuthorityConstants, AADServerParamKeys, APP_METADATA, AUTHORITY_METADATA_CONSTANTS, AuthenticationScheme, AuthorityMetadataSource, CLIENT_INFO, CacheAccountType, CacheOutcome, CacheType, ClaimsRequestKeys, CodeChallengeMethodValues, Constants, CredentialType, Errors, GrantType, HeaderNames, JsonTypes, OIDC_DEFAULT_SCOPES, OIDC_SCOPES, ONE_DAY_IN_MS, PasswordGrantConstants, PersistentCacheKeys, PromptValue, RegionDiscoveryOutcomes, RegionDiscoverySources, ResponseCodes, ResponseMode, SERVER_TELEM_CONSTANTS, SSOTypes, Separators, THE_FAMILY_ID, ThrottlingConstants };\n//# sourceMappingURL=Constants.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { Constants } from '../utils/Constants.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 * AuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar AuthErrorMessage = {\r\n unexpectedError: {\r\n code: \"unexpected_error\",\r\n desc: \"Unexpected error in authentication.\"\r\n },\r\n postRequestFailed: {\r\n code: \"post_request_failed\",\r\n desc: \"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details.\"\r\n }\r\n};\r\n/**\r\n * General error class thrown by the MSAL.js library.\r\n */\r\nvar AuthError = /** @class */ (function (_super) {\r\n __extends(AuthError, _super);\r\n function AuthError(errorCode, errorMessage, suberror) {\r\n var _this = this;\r\n var errorString = errorMessage ? errorCode + \": \" + errorMessage : errorCode;\r\n _this = _super.call(this, errorString) || this;\r\n Object.setPrototypeOf(_this, AuthError.prototype);\r\n _this.errorCode = errorCode || Constants.EMPTY_STRING;\r\n _this.errorMessage = errorMessage || Constants.EMPTY_STRING;\r\n _this.subError = suberror || Constants.EMPTY_STRING;\r\n _this.name = \"AuthError\";\r\n return _this;\r\n }\r\n AuthError.prototype.setCorrelationId = function (correlationId) {\r\n this.correlationId = correlationId;\r\n };\r\n /**\r\n * Creates an error that is thrown when something unexpected happens in the library.\r\n * @param errDesc\r\n */\r\n AuthError.createUnexpectedError = function (errDesc) {\r\n return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc + \": \" + errDesc);\r\n };\r\n /**\r\n * Creates an error for post request failures.\r\n * @param errDesc\r\n * @returns\r\n */\r\n AuthError.createPostRequestFailed = function (errDesc) {\r\n return new AuthError(AuthErrorMessage.postRequestFailed.code, AuthErrorMessage.postRequestFailed.desc + \": \" + errDesc);\r\n };\r\n return AuthError;\r\n}(Error));\n\nexport { AuthError, AuthErrorMessage };\n//# sourceMappingURL=AuthError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { AuthError } from '../error/AuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar DEFAULT_CRYPTO_IMPLEMENTATION = {\r\n createNewGuid: function () {\r\n var notImplErr = \"Crypto interface - createNewGuid() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n base64Decode: function () {\r\n var notImplErr = \"Crypto interface - base64Decode() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n base64Encode: function () {\r\n var notImplErr = \"Crypto interface - base64Encode() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n },\r\n generatePkceCodes: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - generatePkceCodes() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n getPublicKeyThumbprint: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - getPublicKeyThumbprint() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n removeTokenBindingKey: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - removeTokenBindingKey() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n clearKeystore: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - clearKeystore() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n signJwt: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - signJwt() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n hashString: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Crypto interface - hashString() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n }\r\n};\n\nexport { DEFAULT_CRYPTO_IMPLEMENTATION };\n//# sourceMappingURL=ICrypto.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { AuthError } from './AuthError.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 * ClientAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar ClientAuthErrorMessage = {\r\n clientInfoDecodingError: {\r\n code: \"client_info_decoding_error\",\r\n desc: \"The client info could not be parsed/decoded correctly. Please review the trace to determine the root cause.\"\r\n },\r\n clientInfoEmptyError: {\r\n code: \"client_info_empty_error\",\r\n desc: \"The client info was empty. Please review the trace to determine the root cause.\"\r\n },\r\n tokenParsingError: {\r\n code: \"token_parsing_error\",\r\n desc: \"Token cannot be parsed. Please review stack trace to determine root cause.\"\r\n },\r\n nullOrEmptyToken: {\r\n code: \"null_or_empty_token\",\r\n desc: \"The token is null or empty. Please review the trace to determine the root cause.\"\r\n },\r\n endpointResolutionError: {\r\n code: \"endpoints_resolution_error\",\r\n desc: \"Error: could not resolve endpoints. Please check network and try again.\"\r\n },\r\n networkError: {\r\n code: \"network_error\",\r\n desc: \"Network request failed. Please check network trace to determine root cause.\"\r\n },\r\n unableToGetOpenidConfigError: {\r\n code: \"openid_config_error\",\r\n desc: \"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.\"\r\n },\r\n hashNotDeserialized: {\r\n code: \"hash_not_deserialized\",\r\n desc: \"The hash parameters could not be deserialized. Please review the trace to determine the root cause.\"\r\n },\r\n blankGuidGenerated: {\r\n code: \"blank_guid_generated\",\r\n desc: \"The guid generated was blank. Please review the trace to determine the root cause.\"\r\n },\r\n invalidStateError: {\r\n code: \"invalid_state\",\r\n desc: \"State was not the expected format. Please check the logs to determine whether the request was sent using ProtocolUtils.setRequestState().\"\r\n },\r\n stateMismatchError: {\r\n code: \"state_mismatch\",\r\n desc: \"State mismatch error. Please check your network. Continued requests may cause cache overflow.\"\r\n },\r\n stateNotFoundError: {\r\n code: \"state_not_found\",\r\n desc: \"State not found\"\r\n },\r\n nonceMismatchError: {\r\n code: \"nonce_mismatch\",\r\n desc: \"Nonce mismatch error. This may be caused by a race condition in concurrent requests.\"\r\n },\r\n nonceNotFoundError: {\r\n code: \"nonce_not_found\",\r\n desc: \"nonce not found\"\r\n },\r\n authTimeNotFoundError: {\r\n code: \"auth_time_not_found\",\r\n desc: \"Max Age was requested and the ID token is missing the auth_time variable.\" +\r\n \" auth_time is an optional claim and is not enabled by default - it must be enabled.\" +\r\n \" See https://aka.ms/msaljs/optional-claims for more information.\"\r\n },\r\n maxAgeTranspiredError: {\r\n code: \"max_age_transpired\",\r\n desc: \"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.\"\r\n },\r\n noTokensFoundError: {\r\n code: \"no_tokens_found\",\r\n desc: \"No tokens were found for the given scopes, and no authorization code was passed to acquireToken. You must retrieve an authorization code before making a call to acquireToken().\"\r\n },\r\n multipleMatchingTokens: {\r\n code: \"multiple_matching_tokens\",\r\n desc: \"The cache contains multiple tokens satisfying the requirements. \" +\r\n \"Call AcquireToken again providing more requirements such as authority or account.\"\r\n },\r\n multipleMatchingAccounts: {\r\n code: \"multiple_matching_accounts\",\r\n desc: \"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account\"\r\n },\r\n multipleMatchingAppMetadata: {\r\n code: \"multiple_matching_appMetadata\",\r\n desc: \"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata\"\r\n },\r\n tokenRequestCannotBeMade: {\r\n code: \"request_cannot_be_made\",\r\n desc: \"Token request cannot be made without authorization code or refresh token.\"\r\n },\r\n appendEmptyScopeError: {\r\n code: \"cannot_append_empty_scope\",\r\n desc: \"Cannot append null or empty scope to ScopeSet. Please check the stack trace for more info.\"\r\n },\r\n removeEmptyScopeError: {\r\n code: \"cannot_remove_empty_scope\",\r\n desc: \"Cannot remove null or empty scope from ScopeSet. Please check the stack trace for more info.\"\r\n },\r\n appendScopeSetError: {\r\n code: \"cannot_append_scopeset\",\r\n desc: \"Cannot append ScopeSet due to error.\"\r\n },\r\n emptyInputScopeSetError: {\r\n code: \"empty_input_scopeset\",\r\n desc: \"Empty input ScopeSet cannot be processed.\"\r\n },\r\n DeviceCodePollingCancelled: {\r\n code: \"device_code_polling_cancelled\",\r\n desc: \"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.\"\r\n },\r\n DeviceCodeExpired: {\r\n code: \"device_code_expired\",\r\n desc: \"Device code is expired.\"\r\n },\r\n DeviceCodeUnknownError: {\r\n code: \"device_code_unknown_error\",\r\n desc: \"Device code stopped polling for unknown reasons.\"\r\n },\r\n NoAccountInSilentRequest: {\r\n code: \"no_account_in_silent_request\",\r\n desc: \"Please pass an account object, silent flow is not supported without account information\"\r\n },\r\n invalidCacheRecord: {\r\n code: \"invalid_cache_record\",\r\n desc: \"Cache record object was null or undefined.\"\r\n },\r\n invalidCacheEnvironment: {\r\n code: \"invalid_cache_environment\",\r\n desc: \"Invalid environment when attempting to create cache entry\"\r\n },\r\n noAccountFound: {\r\n code: \"no_account_found\",\r\n desc: \"No account found in cache for given key.\"\r\n },\r\n CachePluginError: {\r\n code: \"no cache plugin set on CacheManager\",\r\n desc: \"ICachePlugin needs to be set before using readFromStorage or writeFromStorage\"\r\n },\r\n noCryptoObj: {\r\n code: \"no_crypto_object\",\r\n desc: \"No crypto object detected. This is required for the following operation: \"\r\n },\r\n invalidCacheType: {\r\n code: \"invalid_cache_type\",\r\n desc: \"Invalid cache type\"\r\n },\r\n unexpectedAccountType: {\r\n code: \"unexpected_account_type\",\r\n desc: \"Unexpected account type.\"\r\n },\r\n unexpectedCredentialType: {\r\n code: \"unexpected_credential_type\",\r\n desc: \"Unexpected credential type.\"\r\n },\r\n invalidAssertion: {\r\n code: \"invalid_assertion\",\r\n desc: \"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515\"\r\n },\r\n invalidClientCredential: {\r\n code: \"invalid_client_credential\",\r\n desc: \"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential\"\r\n },\r\n tokenRefreshRequired: {\r\n code: \"token_refresh_required\",\r\n desc: \"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.\"\r\n },\r\n userTimeoutReached: {\r\n code: \"user_timeout_reached\",\r\n desc: \"User defined timeout for device code polling reached\",\r\n },\r\n tokenClaimsRequired: {\r\n code: \"token_claims_cnf_required_for_signedjwt\",\r\n desc: \"Cannot generate a POP jwt if the token_claims are not populated\"\r\n },\r\n noAuthorizationCodeFromServer: {\r\n code: \"authorization_code_missing_from_server_response\",\r\n desc: \"Server response does not contain an authorization code to proceed\"\r\n },\r\n noAzureRegionDetected: {\r\n code: \"no_azure_region_detected\",\r\n desc: \"No azure region was detected and no fallback was made available\"\r\n },\r\n accessTokenEntityNullError: {\r\n code: \"access_token_entity_null\",\r\n desc: \"Access token entity is null, please check logs and cache to ensure a valid access token is present.\"\r\n },\r\n bindingKeyNotRemovedError: {\r\n code: \"binding_key_not_removed\",\r\n desc: \"Could not remove the credential's binding key from storage.\"\r\n },\r\n logoutNotSupported: {\r\n code: \"end_session_endpoint_not_supported\",\r\n desc: \"Provided authority does not support logout.\"\r\n },\r\n keyIdMissing: {\r\n code: \"key_id_missing\",\r\n desc: \"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.\"\r\n },\r\n noNetworkConnectivity: {\r\n code: \"no_network_connectivity\",\r\n desc: \"No network connectivity. Check your internet connection.\"\r\n },\r\n userCanceledError: {\r\n code: \"user_canceled\",\r\n desc: \"User canceled the flow.\"\r\n }\r\n};\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nvar ClientAuthError = /** @class */ (function (_super) {\r\n __extends(ClientAuthError, _super);\r\n function ClientAuthError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"ClientAuthError\";\r\n Object.setPrototypeOf(_this, ClientAuthError.prototype);\r\n return _this;\r\n }\r\n /**\r\n * Creates an error thrown when client info object doesn't decode correctly.\r\n * @param caughtError\r\n */\r\n ClientAuthError.createClientInfoDecodingError = function (caughtError) {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoDecodingError.code, ClientAuthErrorMessage.clientInfoDecodingError.desc + \" Failed with error: \" + caughtError);\r\n };\r\n /**\r\n * Creates an error thrown if the client info is empty.\r\n * @param rawClientInfo\r\n */\r\n ClientAuthError.createClientInfoEmptyError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoEmptyError.code, \"\" + ClientAuthErrorMessage.clientInfoEmptyError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the id token extraction errors out.\r\n * @param err\r\n */\r\n ClientAuthError.createTokenParsingError = function (caughtExtractionError) {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenParsingError.code, ClientAuthErrorMessage.tokenParsingError.desc + \" Failed with error: \" + caughtExtractionError);\r\n };\r\n /**\r\n * Creates an error thrown when the id token string is null or empty.\r\n * @param invalidRawTokenString\r\n */\r\n ClientAuthError.createTokenNullOrEmptyError = function (invalidRawTokenString) {\r\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyToken.code, ClientAuthErrorMessage.nullOrEmptyToken.desc + \" Raw Token Value: \" + invalidRawTokenString);\r\n };\r\n /**\r\n * Creates an error thrown when the endpoint discovery doesn't complete correctly.\r\n */\r\n ClientAuthError.createEndpointDiscoveryIncompleteError = function (errDetail) {\r\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, ClientAuthErrorMessage.endpointResolutionError.desc + \" Detail: \" + errDetail);\r\n };\r\n /**\r\n * Creates an error thrown when the fetch client throws\r\n */\r\n ClientAuthError.createNetworkError = function (endpoint, errDetail) {\r\n return new ClientAuthError(ClientAuthErrorMessage.networkError.code, ClientAuthErrorMessage.networkError.desc + \" | Fetch client threw: \" + errDetail + \" | Attempted to reach: \" + endpoint.split(\"?\")[0]);\r\n };\r\n /**\r\n * Creates an error thrown when the openid-configuration endpoint cannot be reached or does not contain the required data\r\n */\r\n ClientAuthError.createUnableToGetOpenidConfigError = function (errDetail) {\r\n return new ClientAuthError(ClientAuthErrorMessage.unableToGetOpenidConfigError.code, ClientAuthErrorMessage.unableToGetOpenidConfigError.desc + \" Attempted to retrieve endpoints from: \" + errDetail);\r\n };\r\n /**\r\n * Creates an error thrown when the hash cannot be deserialized.\r\n * @param hashParamObj\r\n */\r\n ClientAuthError.createHashNotDeserializedError = function (hashParamObj) {\r\n return new ClientAuthError(ClientAuthErrorMessage.hashNotDeserialized.code, ClientAuthErrorMessage.hashNotDeserialized.desc + \" Given Object: \" + hashParamObj);\r\n };\r\n /**\r\n * Creates an error thrown when the state cannot be parsed.\r\n * @param invalidState\r\n */\r\n ClientAuthError.createInvalidStateError = function (invalidState, errorString) {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code, ClientAuthErrorMessage.invalidStateError.desc + \" Invalid State: \" + invalidState + \", Root Err: \" + errorString);\r\n };\r\n /**\r\n * Creates an error thrown when two states do not match.\r\n */\r\n ClientAuthError.createStateMismatchError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.stateMismatchError.code, ClientAuthErrorMessage.stateMismatchError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the state is not present\r\n * @param missingState\r\n */\r\n ClientAuthError.createStateNotFoundError = function (missingState) {\r\n return new ClientAuthError(ClientAuthErrorMessage.stateNotFoundError.code, ClientAuthErrorMessage.stateNotFoundError.desc + \": \" + missingState);\r\n };\r\n /**\r\n * Creates an error thrown when the nonce does not match.\r\n */\r\n ClientAuthError.createNonceMismatchError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code, ClientAuthErrorMessage.nonceMismatchError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when max_age was provided in the request, but auth_time is not in the token claims\r\n * @param missingNonce\r\n */\r\n ClientAuthError.createAuthTimeNotFoundError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.authTimeNotFoundError.code, ClientAuthErrorMessage.authTimeNotFoundError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when too much time has elapsed since the last end-user authentication\r\n */\r\n ClientAuthError.createMaxAgeTranspiredError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.maxAgeTranspiredError.code, ClientAuthErrorMessage.maxAgeTranspiredError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the mnonce is not present\r\n * @param missingNonce\r\n */\r\n ClientAuthError.createNonceNotFoundError = function (missingNonce) {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceNotFoundError.code, ClientAuthErrorMessage.nonceNotFoundError.desc + \": \" + missingNonce);\r\n };\r\n /**\r\n * Throws error when multiple tokens are in cache.\r\n */\r\n ClientAuthError.createMultipleMatchingTokensInCacheError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingTokens.code, ClientAuthErrorMessage.multipleMatchingTokens.desc + \".\");\r\n };\r\n /**\r\n * Throws error when multiple accounts are in cache for the given params\r\n */\r\n ClientAuthError.createMultipleMatchingAccountsInCacheError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAccounts.code, ClientAuthErrorMessage.multipleMatchingAccounts.desc);\r\n };\r\n /**\r\n * Throws error when multiple appMetada are in cache for the given clientId.\r\n */\r\n ClientAuthError.createMultipleMatchingAppMetadataInCacheError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleMatchingAppMetadata.code, ClientAuthErrorMessage.multipleMatchingAppMetadata.desc);\r\n };\r\n /**\r\n * Throws error when no auth code or refresh token is given to ServerTokenRequestParameters.\r\n */\r\n ClientAuthError.createTokenRequestCannotBeMadeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRequestCannotBeMade.code, ClientAuthErrorMessage.tokenRequestCannotBeMade.desc);\r\n };\r\n /**\r\n * Throws error when attempting to append a null, undefined or empty scope to a set\r\n * @param givenScope\r\n */\r\n ClientAuthError.createAppendEmptyScopeToSetError = function (givenScope) {\r\n return new ClientAuthError(ClientAuthErrorMessage.appendEmptyScopeError.code, ClientAuthErrorMessage.appendEmptyScopeError.desc + \" Given Scope: \" + givenScope);\r\n };\r\n /**\r\n * Throws error when attempting to append a null, undefined or empty scope to a set\r\n * @param givenScope\r\n */\r\n ClientAuthError.createRemoveEmptyScopeFromSetError = function (givenScope) {\r\n return new ClientAuthError(ClientAuthErrorMessage.removeEmptyScopeError.code, ClientAuthErrorMessage.removeEmptyScopeError.desc + \" Given Scope: \" + givenScope);\r\n };\r\n /**\r\n * Throws error when attempting to append null or empty ScopeSet.\r\n * @param appendError\r\n */\r\n ClientAuthError.createAppendScopeSetError = function (appendError) {\r\n return new ClientAuthError(ClientAuthErrorMessage.appendScopeSetError.code, ClientAuthErrorMessage.appendScopeSetError.desc + \" Detail Error: \" + appendError);\r\n };\r\n /**\r\n * Throws error if ScopeSet is null or undefined.\r\n * @param givenScopeSet\r\n */\r\n ClientAuthError.createEmptyInputScopeSetError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.emptyInputScopeSetError.code, \"\" + ClientAuthErrorMessage.emptyInputScopeSetError.desc);\r\n };\r\n /**\r\n * Throws error if user sets CancellationToken.cancel = true during polling of token endpoint during device code flow\r\n */\r\n ClientAuthError.createDeviceCodeCancelledError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodePollingCancelled.code, \"\" + ClientAuthErrorMessage.DeviceCodePollingCancelled.desc);\r\n };\r\n /**\r\n * Throws error if device code is expired\r\n */\r\n ClientAuthError.createDeviceCodeExpiredError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeExpired.code, \"\" + ClientAuthErrorMessage.DeviceCodeExpired.desc);\r\n };\r\n /**\r\n * Throws error if device code is expired\r\n */\r\n ClientAuthError.createDeviceCodeUnknownError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.DeviceCodeUnknownError.code, \"\" + ClientAuthErrorMessage.DeviceCodeUnknownError.desc);\r\n };\r\n /**\r\n * Throws error when silent requests are made without an account object\r\n */\r\n ClientAuthError.createNoAccountInSilentRequestError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.NoAccountInSilentRequest.code, \"\" + ClientAuthErrorMessage.NoAccountInSilentRequest.desc);\r\n };\r\n /**\r\n * Throws error when cache record is null or undefined.\r\n */\r\n ClientAuthError.createNullOrUndefinedCacheRecord = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheRecord.code, ClientAuthErrorMessage.invalidCacheRecord.desc);\r\n };\r\n /**\r\n * Throws error when provided environment is not part of the CloudDiscoveryMetadata object\r\n */\r\n ClientAuthError.createInvalidCacheEnvironmentError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheEnvironment.code, ClientAuthErrorMessage.invalidCacheEnvironment.desc);\r\n };\r\n /**\r\n * Throws error when account is not found in cache.\r\n */\r\n ClientAuthError.createNoAccountFoundError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.noAccountFound.code, ClientAuthErrorMessage.noAccountFound.desc);\r\n };\r\n /**\r\n * Throws error if ICachePlugin not set on CacheManager.\r\n */\r\n ClientAuthError.createCachePluginError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.CachePluginError.code, \"\" + ClientAuthErrorMessage.CachePluginError.desc);\r\n };\r\n /**\r\n * Throws error if crypto object not found.\r\n * @param operationName\r\n */\r\n ClientAuthError.createNoCryptoObjectError = function (operationName) {\r\n return new ClientAuthError(ClientAuthErrorMessage.noCryptoObj.code, \"\" + ClientAuthErrorMessage.noCryptoObj.desc + operationName);\r\n };\r\n /**\r\n * Throws error if cache type is invalid.\r\n */\r\n ClientAuthError.createInvalidCacheTypeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidCacheType.code, \"\" + ClientAuthErrorMessage.invalidCacheType.desc);\r\n };\r\n /**\r\n * Throws error if unexpected account type.\r\n */\r\n ClientAuthError.createUnexpectedAccountTypeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedAccountType.code, \"\" + ClientAuthErrorMessage.unexpectedAccountType.desc);\r\n };\r\n /**\r\n * Throws error if unexpected credential type.\r\n */\r\n ClientAuthError.createUnexpectedCredentialTypeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.unexpectedCredentialType.code, \"\" + ClientAuthErrorMessage.unexpectedCredentialType.desc);\r\n };\r\n /**\r\n * Throws error if client assertion is not valid.\r\n */\r\n ClientAuthError.createInvalidAssertionError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidAssertion.code, \"\" + ClientAuthErrorMessage.invalidAssertion.desc);\r\n };\r\n /**\r\n * Throws error if client assertion is not valid.\r\n */\r\n ClientAuthError.createInvalidCredentialError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidClientCredential.code, \"\" + ClientAuthErrorMessage.invalidClientCredential.desc);\r\n };\r\n /**\r\n * Throws error if token cannot be retrieved from cache due to refresh being required.\r\n */\r\n ClientAuthError.createRefreshRequiredError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRefreshRequired.code, ClientAuthErrorMessage.tokenRefreshRequired.desc);\r\n };\r\n /**\r\n * Throws error if the user defined timeout is reached.\r\n */\r\n ClientAuthError.createUserTimeoutReachedError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.userTimeoutReached.code, ClientAuthErrorMessage.userTimeoutReached.desc);\r\n };\r\n /*\r\n * Throws error if token claims are not populated for a signed jwt generation\r\n */\r\n ClientAuthError.createTokenClaimsRequiredError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenClaimsRequired.code, ClientAuthErrorMessage.tokenClaimsRequired.desc);\r\n };\r\n /**\r\n * Throws error when the authorization code is missing from the server response\r\n */\r\n ClientAuthError.createNoAuthCodeInServerResponseError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.noAuthorizationCodeFromServer.code, ClientAuthErrorMessage.noAuthorizationCodeFromServer.desc);\r\n };\r\n ClientAuthError.createBindingKeyNotRemovedError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.bindingKeyNotRemovedError.code, ClientAuthErrorMessage.bindingKeyNotRemovedError.desc);\r\n };\r\n /**\r\n * Thrown when logout is attempted for an authority that doesnt have an end_session_endpoint\r\n */\r\n ClientAuthError.createLogoutNotSupportedError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.logoutNotSupported.code, ClientAuthErrorMessage.logoutNotSupported.desc);\r\n };\r\n /**\r\n * Create an error when kid attribute is missing from a PoP token's cache record\r\n */\r\n ClientAuthError.createKeyIdMissingError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.keyIdMissing.code, ClientAuthErrorMessage.keyIdMissing.desc);\r\n };\r\n /**\r\n * Create an error when the client does not have network connectivity\r\n */\r\n ClientAuthError.createNoNetworkConnectivityError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.noNetworkConnectivity.code, ClientAuthErrorMessage.noNetworkConnectivity.desc);\r\n };\r\n /**\r\n * Create an error when the user cancels the flow\r\n */\r\n ClientAuthError.createUserCanceledError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.userCanceledError.code, ClientAuthErrorMessage.userCanceledError.desc);\r\n };\r\n return ClientAuthError;\r\n}(AuthError));\n\nexport { ClientAuthError, ClientAuthErrorMessage };\n//# sourceMappingURL=ClientAuthError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ClientAuthError } from '../error/ClientAuthError.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 * @hidden\r\n */\r\nvar StringUtils = /** @class */ (function () {\r\n function StringUtils() {\r\n }\r\n /**\r\n * decode a JWT\r\n *\r\n * @param authToken\r\n */\r\n StringUtils.decodeAuthToken = function (authToken) {\r\n if (StringUtils.isEmpty(authToken)) {\r\n throw ClientAuthError.createTokenNullOrEmptyError(authToken);\r\n }\r\n var tokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n var matches = tokenPartsRegex.exec(authToken);\r\n if (!matches || matches.length < 4) {\r\n throw ClientAuthError.createTokenParsingError(\"Given token is malformed: \" + JSON.stringify(authToken));\r\n }\r\n var crackedToken = {\r\n header: matches[1],\r\n JWSPayload: matches[2],\r\n JWSSig: matches[3]\r\n };\r\n return crackedToken;\r\n };\r\n /**\r\n * Check if a string is empty.\r\n *\r\n * @param str\r\n */\r\n StringUtils.isEmpty = function (str) {\r\n return (typeof str === \"undefined\" || !str || 0 === str.length);\r\n };\r\n /**\r\n * Check if stringified object is empty\r\n * @param strObj\r\n */\r\n StringUtils.isEmptyObj = function (strObj) {\r\n if (strObj && !StringUtils.isEmpty(strObj)) {\r\n try {\r\n var obj = JSON.parse(strObj);\r\n return Object.keys(obj).length === 0;\r\n }\r\n catch (e) { }\r\n }\r\n return true;\r\n };\r\n StringUtils.startsWith = function (str, search) {\r\n return str.indexOf(search) === 0;\r\n };\r\n StringUtils.endsWith = function (str, search) {\r\n return (str.length >= search.length) && (str.lastIndexOf(search) === (str.length - search.length));\r\n };\r\n /**\r\n * Parses string into an object.\r\n *\r\n * @param query\r\n */\r\n StringUtils.queryStringToObject = function (query) {\r\n var obj = {};\r\n var params = query.split(\"&\");\r\n var decode = function (s) { return decodeURIComponent(s.replace(/\\+/g, \" \")); };\r\n params.forEach(function (pair) {\r\n if (pair.trim()) {\r\n var _a = pair.split(/=(.+)/g, 2), key = _a[0], value = _a[1]; // Split on the first occurence of the '=' character\r\n if (key && value) {\r\n obj[decode(key)] = decode(value);\r\n }\r\n }\r\n });\r\n return obj;\r\n };\r\n /**\r\n * Trims entries in an array.\r\n *\r\n * @param arr\r\n */\r\n StringUtils.trimArrayEntries = function (arr) {\r\n return arr.map(function (entry) { return entry.trim(); });\r\n };\r\n /**\r\n * Removes empty strings from array\r\n * @param arr\r\n */\r\n StringUtils.removeEmptyStringsFromArray = function (arr) {\r\n return arr.filter(function (entry) {\r\n return !StringUtils.isEmpty(entry);\r\n });\r\n };\r\n /**\r\n * Attempts to parse a string into JSON\r\n * @param str\r\n */\r\n StringUtils.jsonParseHelper = function (str) {\r\n try {\r\n return JSON.parse(str);\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n };\r\n /**\r\n * Tests if a given string matches a given pattern, with support for wildcards and queries.\r\n * @param pattern Wildcard pattern to string match. Supports \"*\" for wildcards and \"?\" for queries\r\n * @param input String to match against\r\n */\r\n StringUtils.matchPattern = function (pattern, input) {\r\n /**\r\n * Wildcard support: https://stackoverflow.com/a/3117248/4888559\r\n * Queries: replaces \"?\" in string with escaped \"\\?\" for regex test\r\n */\r\n var regex = new RegExp(pattern.replace(/\\\\/g, \"\\\\\\\\\").replace(/\\*/g, \"[^ ]*\").replace(/\\?/g, \"\\\\\\?\")); // eslint-disable-line security/detect-non-literal-regexp\r\n return regex.test(input);\r\n };\r\n return StringUtils;\r\n}());\n\nexport { StringUtils };\n//# sourceMappingURL=StringUtils.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { Constants } from '../utils/Constants.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 * Log message level.\r\n */\r\nvar LogLevel;\r\n(function (LogLevel) {\r\n LogLevel[LogLevel[\"Error\"] = 0] = \"Error\";\r\n LogLevel[LogLevel[\"Warning\"] = 1] = \"Warning\";\r\n LogLevel[LogLevel[\"Info\"] = 2] = \"Info\";\r\n LogLevel[LogLevel[\"Verbose\"] = 3] = \"Verbose\";\r\n LogLevel[LogLevel[\"Trace\"] = 4] = \"Trace\";\r\n})(LogLevel || (LogLevel = {}));\r\n/**\r\n * Class which facilitates logging of messages to a specific place.\r\n */\r\nvar Logger = /** @class */ (function () {\r\n function Logger(loggerOptions, packageName, packageVersion) {\r\n // Current log level, defaults to info.\r\n this.level = LogLevel.Info;\r\n var defaultLoggerCallback = function () {\r\n return;\r\n };\r\n var setLoggerOptions = loggerOptions || Logger.createDefaultLoggerOptions();\r\n this.localCallback = setLoggerOptions.loggerCallback || defaultLoggerCallback;\r\n this.piiLoggingEnabled = setLoggerOptions.piiLoggingEnabled || false;\r\n this.level = typeof (setLoggerOptions.logLevel) === \"number\" ? setLoggerOptions.logLevel : LogLevel.Info;\r\n this.correlationId = setLoggerOptions.correlationId || Constants.EMPTY_STRING;\r\n this.packageName = packageName || Constants.EMPTY_STRING;\r\n this.packageVersion = packageVersion || Constants.EMPTY_STRING;\r\n }\r\n Logger.createDefaultLoggerOptions = function () {\r\n return {\r\n loggerCallback: function () {\r\n // allow users to not set loggerCallback\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info\r\n };\r\n };\r\n /**\r\n * Create new Logger with existing configurations.\r\n */\r\n Logger.prototype.clone = function (packageName, packageVersion, correlationId) {\r\n return new Logger({ loggerCallback: this.localCallback, piiLoggingEnabled: this.piiLoggingEnabled, logLevel: this.level, correlationId: correlationId || this.correlationId }, packageName, packageVersion);\r\n };\r\n /**\r\n * Log message with required options.\r\n */\r\n Logger.prototype.logMessage = function (logMessage, options) {\r\n if ((options.logLevel > this.level) || (!this.piiLoggingEnabled && options.containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n // Add correlationId to logs if set, correlationId provided on log messages take precedence\r\n var logHeader;\r\n if (!StringUtils.isEmpty(options.correlationId)) {\r\n logHeader = \"[\" + timestamp + \"] : [\" + options.correlationId + \"]\";\r\n }\r\n else if (!StringUtils.isEmpty(this.correlationId)) {\r\n logHeader = \"[\" + timestamp + \"] : [\" + this.correlationId + \"]\";\r\n }\r\n else {\r\n logHeader = \"[\" + timestamp + \"]\";\r\n }\r\n var log = logHeader + \" : \" + this.packageName + \"@\" + this.packageVersion + \" : \" + LogLevel[options.logLevel] + \" - \" + logMessage;\r\n // debug(`msal:${LogLevel[options.logLevel]}${options.containsPii ? \"-Pii\": Constants.EMPTY_STRING}${options.context ? `:${options.context}` : Constants.EMPTY_STRING}`)(logMessage);\r\n this.executeCallback(options.logLevel, log, options.containsPii || false);\r\n };\r\n /**\r\n * Execute callback with message.\r\n */\r\n Logger.prototype.executeCallback = function (level, message, containsPii) {\r\n if (this.localCallback) {\r\n this.localCallback(level, message, containsPii);\r\n }\r\n };\r\n /**\r\n * Logs error messages.\r\n */\r\n Logger.prototype.error = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Error,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs error messages with PII.\r\n */\r\n Logger.prototype.errorPii = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Error,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs warning messages.\r\n */\r\n Logger.prototype.warning = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Warning,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs warning messages with PII.\r\n */\r\n Logger.prototype.warningPii = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Warning,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs info messages.\r\n */\r\n Logger.prototype.info = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Info,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs info messages with PII.\r\n */\r\n Logger.prototype.infoPii = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Info,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs verbose messages.\r\n */\r\n Logger.prototype.verbose = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Verbose,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs verbose messages with PII.\r\n */\r\n Logger.prototype.verbosePii = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Verbose,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs trace messages.\r\n */\r\n Logger.prototype.trace = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Trace,\r\n containsPii: false,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Logs trace messages with PII.\r\n */\r\n Logger.prototype.tracePii = function (message, correlationId) {\r\n this.logMessage(message, {\r\n logLevel: LogLevel.Trace,\r\n containsPii: true,\r\n correlationId: correlationId || Constants.EMPTY_STRING\r\n });\r\n };\r\n /**\r\n * Returns whether PII Logging is enabled or not.\r\n */\r\n Logger.prototype.isPiiLoggingEnabled = function () {\r\n return this.piiLoggingEnabled || false;\r\n };\r\n return Logger;\r\n}());\n\nexport { LogLevel, Logger };\n//# sourceMappingURL=Logger.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/* eslint-disable header/header */\r\nvar name = \"@azure/msal-common\";\r\nvar version = \"12.1.0\";\n\nexport { name, version };\n//# sourceMappingURL=packageMetadata.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar AzureCloudInstance;\r\n(function (AzureCloudInstance) {\r\n // AzureCloudInstance is not specified.\r\n AzureCloudInstance[AzureCloudInstance[\"None\"] = 0] = \"None\";\r\n // Microsoft Azure public cloud\r\n AzureCloudInstance[\"AzurePublic\"] = \"https://login.microsoftonline.com\";\r\n // Microsoft PPE\r\n AzureCloudInstance[\"AzurePpe\"] = \"https://login.windows-ppe.net\";\r\n // Microsoft Chinese national cloud\r\n AzureCloudInstance[\"AzureChina\"] = \"https://login.chinacloudapi.cn\";\r\n // Microsoft German national cloud (\"Black Forest\")\r\n AzureCloudInstance[\"AzureGermany\"] = \"https://login.microsoftonline.de\";\r\n // US Government cloud\r\n AzureCloudInstance[\"AzureUsGovernment\"] = \"https://login.microsoftonline.us\";\r\n})(AzureCloudInstance || (AzureCloudInstance = {}));\n\nexport { AzureCloudInstance };\n//# sourceMappingURL=AuthorityOptions.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { ClientAuthError } from './ClientAuthError.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 * ClientConfigurationErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar ClientConfigurationErrorMessage = {\r\n redirectUriNotSet: {\r\n code: \"redirect_uri_empty\",\r\n desc: \"A redirect URI is required for all calls, and none has been set.\"\r\n },\r\n postLogoutUriNotSet: {\r\n code: \"post_logout_uri_empty\",\r\n desc: \"A post logout redirect has not been set.\"\r\n },\r\n claimsRequestParsingError: {\r\n code: \"claims_request_parsing_error\",\r\n desc: \"Could not parse the given claims request object.\"\r\n },\r\n authorityUriInsecure: {\r\n code: \"authority_uri_insecure\",\r\n desc: \"Authority URIs must use https. Please see here for valid authority configuration options: https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-js-initializing-client-applications#configuration-options\"\r\n },\r\n urlParseError: {\r\n code: \"url_parse_error\",\r\n desc: \"URL could not be parsed into appropriate segments.\"\r\n },\r\n urlEmptyError: {\r\n code: \"empty_url_error\",\r\n desc: \"URL was empty or null.\"\r\n },\r\n emptyScopesError: {\r\n code: \"empty_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as null, undefined or empty array because they are required to obtain an access token.\"\r\n },\r\n nonArrayScopesError: {\r\n code: \"nonarray_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as non-array.\"\r\n },\r\n clientIdSingleScopeError: {\r\n code: \"clientid_input_scopes_error\",\r\n desc: \"Client ID can only be provided as a single scope.\"\r\n },\r\n invalidPrompt: {\r\n code: \"invalid_prompt_value\",\r\n desc: \"Supported prompt values are 'login', 'select_account', 'consent', 'create', 'none' and 'no_session'. Please see here for valid configuration options: https://azuread.github.io/microsoft-authentication-library-for-js/ref/modules/_azure_msal_common.html#commonauthorizationurlrequest\",\r\n },\r\n invalidClaimsRequest: {\r\n code: \"invalid_claims\",\r\n desc: \"Given claims parameter must be a stringified JSON object.\"\r\n },\r\n tokenRequestEmptyError: {\r\n code: \"token_request_empty\",\r\n desc: \"Token request was empty and not found in cache.\"\r\n },\r\n logoutRequestEmptyError: {\r\n code: \"logout_request_empty\",\r\n desc: \"The logout request was null or undefined.\"\r\n },\r\n invalidCodeChallengeMethod: {\r\n code: \"invalid_code_challenge_method\",\r\n desc: \"code_challenge_method passed is invalid. Valid values are \\\"plain\\\" and \\\"S256\\\".\"\r\n },\r\n invalidCodeChallengeParams: {\r\n code: \"pkce_params_missing\",\r\n desc: \"Both params: code_challenge and code_challenge_method are to be passed if to be sent in the request\"\r\n },\r\n invalidCloudDiscoveryMetadata: {\r\n code: \"invalid_cloud_discovery_metadata\",\r\n desc: \"Invalid cloudDiscoveryMetadata provided. Must be a stringified JSON object containing tenant_discovery_endpoint and metadata fields\"\r\n },\r\n invalidAuthorityMetadata: {\r\n code: \"invalid_authority_metadata\",\r\n desc: \"Invalid authorityMetadata provided. Must by a stringified JSON object containing authorization_endpoint, token_endpoint, issuer fields.\"\r\n },\r\n untrustedAuthority: {\r\n code: \"untrusted_authority\",\r\n desc: \"The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter.\"\r\n },\r\n invalidAzureCloudInstance: {\r\n code: \"invalid_azure_cloud_instance\",\r\n desc: \"Invalid AzureCloudInstance provided. Please refer MSAL JS docs: aks.ms/msaljs/azure_cloud_instance for valid values\"\r\n },\r\n missingSshJwk: {\r\n code: \"missing_ssh_jwk\",\r\n desc: \"Missing sshJwk in SSH certificate request. A stringified JSON Web Key is required when using the SSH authentication scheme.\"\r\n },\r\n missingSshKid: {\r\n code: \"missing_ssh_kid\",\r\n desc: \"Missing sshKid in SSH certificate request. A string that uniquely identifies the public SSH key is required when using the SSH authentication scheme.\"\r\n },\r\n missingNonceAuthenticationHeader: {\r\n code: \"missing_nonce_authentication_header\",\r\n desc: \"Unable to find an authentication header containing server nonce. Either the Authentication-Info or WWW-Authenticate headers must be present in order to obtain a server nonce.\"\r\n },\r\n invalidAuthenticationHeader: {\r\n code: \"invalid_authentication_header\",\r\n desc: \"Invalid authentication header provided\"\r\n }\r\n};\r\n/**\r\n * Error thrown when there is an error in configuration of the MSAL.js library.\r\n */\r\nvar ClientConfigurationError = /** @class */ (function (_super) {\r\n __extends(ClientConfigurationError, _super);\r\n function ClientConfigurationError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"ClientConfigurationError\";\r\n Object.setPrototypeOf(_this, ClientConfigurationError.prototype);\r\n return _this;\r\n }\r\n /**\r\n * Creates an error thrown when the redirect uri is empty (not set by caller)\r\n */\r\n ClientConfigurationError.createRedirectUriEmptyError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.redirectUriNotSet.code, ClientConfigurationErrorMessage.redirectUriNotSet.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\r\n */\r\n ClientConfigurationError.createPostLogoutRedirectUriEmptyError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.postLogoutUriNotSet.code, ClientConfigurationErrorMessage.postLogoutUriNotSet.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the claims request could not be successfully parsed\r\n */\r\n ClientConfigurationError.createClaimsRequestParsingError = function (claimsRequestParseError) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code, ClientConfigurationErrorMessage.claimsRequestParsingError.desc + \" Given value: \" + claimsRequestParseError);\r\n };\r\n /**\r\n * Creates an error thrown if authority uri is given an insecure protocol.\r\n * @param urlString\r\n */\r\n ClientConfigurationError.createInsecureAuthorityUriError = function (urlString) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.authorityUriInsecure.code, ClientConfigurationErrorMessage.authorityUriInsecure.desc + \" Given URI: \" + urlString);\r\n };\r\n /**\r\n * Creates an error thrown if URL string does not parse into separate segments.\r\n * @param urlString\r\n */\r\n ClientConfigurationError.createUrlParseError = function (urlParseError) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlParseError.code, ClientConfigurationErrorMessage.urlParseError.desc + \" Given Error: \" + urlParseError);\r\n };\r\n /**\r\n * Creates an error thrown if URL string is empty or null.\r\n * @param urlString\r\n */\r\n ClientConfigurationError.createUrlEmptyError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.urlEmptyError.code, ClientConfigurationErrorMessage.urlEmptyError.desc);\r\n };\r\n /**\r\n * Error thrown when scopes are empty.\r\n * @param scopesValue\r\n */\r\n ClientConfigurationError.createEmptyScopesArrayError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopesError.code, \"\" + ClientConfigurationErrorMessage.emptyScopesError.desc);\r\n };\r\n /**\r\n * Error thrown when client id scope is not provided as single scope.\r\n * @param inputScopes\r\n */\r\n ClientConfigurationError.createClientIdSingleScopeError = function (inputScopes) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.clientIdSingleScopeError.code, ClientConfigurationErrorMessage.clientIdSingleScopeError.desc + \" Given Scopes: \" + inputScopes);\r\n };\r\n /**\r\n * Error thrown when prompt is not an allowed type.\r\n * @param promptValue\r\n */\r\n ClientConfigurationError.createInvalidPromptError = function (promptValue) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidPrompt.code, ClientConfigurationErrorMessage.invalidPrompt.desc + \" Given value: \" + promptValue);\r\n };\r\n /**\r\n * Creates error thrown when claims parameter is not a stringified JSON object\r\n */\r\n ClientConfigurationError.createInvalidClaimsRequestError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidClaimsRequest.code, ClientConfigurationErrorMessage.invalidClaimsRequest.desc);\r\n };\r\n /**\r\n * Throws error when token request is empty and nothing cached in storage.\r\n */\r\n ClientConfigurationError.createEmptyLogoutRequestError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.logoutRequestEmptyError.code, ClientConfigurationErrorMessage.logoutRequestEmptyError.desc);\r\n };\r\n /**\r\n * Throws error when token request is empty and nothing cached in storage.\r\n */\r\n ClientConfigurationError.createEmptyTokenRequestError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.tokenRequestEmptyError.code, ClientConfigurationErrorMessage.tokenRequestEmptyError.desc);\r\n };\r\n /**\r\n * Throws error when an invalid code_challenge_method is passed by the user\r\n */\r\n ClientConfigurationError.createInvalidCodeChallengeMethodError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCodeChallengeMethod.code, ClientConfigurationErrorMessage.invalidCodeChallengeMethod.desc);\r\n };\r\n /**\r\n * Throws error when both params: code_challenge and code_challenge_method are not passed together\r\n */\r\n ClientConfigurationError.createInvalidCodeChallengeParamsError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCodeChallengeParams.code, ClientConfigurationErrorMessage.invalidCodeChallengeParams.desc);\r\n };\r\n /**\r\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\r\n */\r\n ClientConfigurationError.createInvalidCloudDiscoveryMetadataError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.code, ClientConfigurationErrorMessage.invalidCloudDiscoveryMetadata.desc);\r\n };\r\n /**\r\n * Throws an error when the user passes invalid cloudDiscoveryMetadata\r\n */\r\n ClientConfigurationError.createInvalidAuthorityMetadataError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadata.code, ClientConfigurationErrorMessage.invalidAuthorityMetadata.desc);\r\n };\r\n /**\r\n * Throws error when provided authority is not a member of the trusted host list\r\n */\r\n ClientConfigurationError.createUntrustedAuthorityError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code, ClientConfigurationErrorMessage.untrustedAuthority.desc);\r\n };\r\n /**\r\n * Throws error when the AzureCloudInstance is set to an invalid value\r\n */\r\n ClientConfigurationError.createInvalidAzureCloudInstanceError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAzureCloudInstance.code, ClientConfigurationErrorMessage.invalidAzureCloudInstance.desc);\r\n };\r\n /**\r\n * Throws an error when the authentication scheme is set to SSH but the SSH public key is omitted from the request\r\n */\r\n ClientConfigurationError.createMissingSshJwkError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshJwk.code, ClientConfigurationErrorMessage.missingSshJwk.desc);\r\n };\r\n /**\r\n * Throws an error when the authentication scheme is set to SSH but the SSH public key ID is omitted from the request\r\n */\r\n ClientConfigurationError.createMissingSshKidError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingSshKid.code, ClientConfigurationErrorMessage.missingSshKid.desc);\r\n };\r\n /**\r\n * Throws error when provided headers don't contain a header that a server nonce can be extracted from\r\n */\r\n ClientConfigurationError.createMissingNonceAuthenticationHeadersError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.code, ClientConfigurationErrorMessage.missingNonceAuthenticationHeader.desc);\r\n };\r\n /**\r\n * Throws error when a provided header is invalid in any way\r\n */\r\n ClientConfigurationError.createInvalidAuthenticationHeaderError = function (invalidHeaderName, details) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthenticationHeader.code, ClientConfigurationErrorMessage.invalidAuthenticationHeader.desc + \". Invalid header: \" + invalidHeaderName + \". Details: \" + details);\r\n };\r\n return ClientConfigurationError;\r\n}(ClientAuthError));\n\nexport { ClientConfigurationError, ClientConfigurationErrorMessage };\n//# sourceMappingURL=ClientConfigurationError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __spreadArrays } from '../_virtual/_tslib.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { Constants, OIDC_SCOPES } from '../utils/Constants.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 * The ScopeSet class creates a set of scopes. Scopes are case-insensitive, unique values, so the Set object in JS makes\r\n * the most sense to implement for this class. All scopes are trimmed and converted to lower case strings in intersection and union functions\r\n * to ensure uniqueness of strings.\r\n */\r\nvar ScopeSet = /** @class */ (function () {\r\n function ScopeSet(inputScopes) {\r\n var _this = this;\r\n // Filter empty string and null/undefined array items\r\n var scopeArr = inputScopes ? StringUtils.trimArrayEntries(__spreadArrays(inputScopes)) : [];\r\n var filteredInput = scopeArr ? StringUtils.removeEmptyStringsFromArray(scopeArr) : [];\r\n // Validate and filter scopes (validate function throws if validation fails)\r\n this.validateInputScopes(filteredInput);\r\n this.scopes = new Set(); // Iterator in constructor not supported by IE11\r\n filteredInput.forEach(function (scope) { return _this.scopes.add(scope); });\r\n }\r\n /**\r\n * Factory method to create ScopeSet from space-delimited string\r\n * @param inputScopeString\r\n * @param appClientId\r\n * @param scopesRequired\r\n */\r\n ScopeSet.fromString = function (inputScopeString) {\r\n var scopeString = inputScopeString || Constants.EMPTY_STRING;\r\n var inputScopes = scopeString.split(\" \");\r\n return new ScopeSet(inputScopes);\r\n };\r\n /**\r\n * Creates the set of scopes to search for in cache lookups\r\n * @param inputScopeString\r\n * @returns\r\n */\r\n ScopeSet.createSearchScopes = function (inputScopeString) {\r\n var scopeSet = new ScopeSet(inputScopeString);\r\n if (!scopeSet.containsOnlyOIDCScopes()) {\r\n scopeSet.removeOIDCScopes();\r\n }\r\n else {\r\n scopeSet.removeScope(Constants.OFFLINE_ACCESS_SCOPE);\r\n }\r\n return scopeSet;\r\n };\r\n /**\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} inputScopes - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {boolean} scopesRequired - Boolean indicating whether the scopes array is required or not\r\n */\r\n ScopeSet.prototype.validateInputScopes = function (inputScopes) {\r\n // Check if scopes are required but not given or is an empty array\r\n if (!inputScopes || inputScopes.length < 1) {\r\n throw ClientConfigurationError.createEmptyScopesArrayError();\r\n }\r\n };\r\n /**\r\n * Check if a given scope is present in this set of scopes.\r\n * @param scope\r\n */\r\n ScopeSet.prototype.containsScope = function (scope) {\r\n var lowerCaseScopes = this.printScopesLowerCase().split(\" \");\r\n var lowerCaseScopesSet = new ScopeSet(lowerCaseScopes);\r\n // compare lowercase scopes\r\n return !StringUtils.isEmpty(scope) ? lowerCaseScopesSet.scopes.has(scope.toLowerCase()) : false;\r\n };\r\n /**\r\n * Check if a set of scopes is present in this set of scopes.\r\n * @param scopeSet\r\n */\r\n ScopeSet.prototype.containsScopeSet = function (scopeSet) {\r\n var _this = this;\r\n if (!scopeSet || scopeSet.scopes.size <= 0) {\r\n return false;\r\n }\r\n return (this.scopes.size >= scopeSet.scopes.size && scopeSet.asArray().every(function (scope) { return _this.containsScope(scope); }));\r\n };\r\n /**\r\n * Check if set of scopes contains only the defaults\r\n */\r\n ScopeSet.prototype.containsOnlyOIDCScopes = function () {\r\n var _this = this;\r\n var defaultScopeCount = 0;\r\n OIDC_SCOPES.forEach(function (defaultScope) {\r\n if (_this.containsScope(defaultScope)) {\r\n defaultScopeCount += 1;\r\n }\r\n });\r\n return this.scopes.size === defaultScopeCount;\r\n };\r\n /**\r\n * Appends single scope if passed\r\n * @param newScope\r\n */\r\n ScopeSet.prototype.appendScope = function (newScope) {\r\n if (!StringUtils.isEmpty(newScope)) {\r\n this.scopes.add(newScope.trim());\r\n }\r\n };\r\n /**\r\n * Appends multiple scopes if passed\r\n * @param newScopes\r\n */\r\n ScopeSet.prototype.appendScopes = function (newScopes) {\r\n var _this = this;\r\n try {\r\n newScopes.forEach(function (newScope) { return _this.appendScope(newScope); });\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createAppendScopeSetError(e);\r\n }\r\n };\r\n /**\r\n * Removes element from set of scopes.\r\n * @param scope\r\n */\r\n ScopeSet.prototype.removeScope = function (scope) {\r\n if (StringUtils.isEmpty(scope)) {\r\n throw ClientAuthError.createRemoveEmptyScopeFromSetError(scope);\r\n }\r\n this.scopes.delete(scope.trim());\r\n };\r\n /**\r\n * Removes default scopes from set of scopes\r\n * Primarily used to prevent cache misses if the default scopes are not returned from the server\r\n */\r\n ScopeSet.prototype.removeOIDCScopes = function () {\r\n var _this = this;\r\n OIDC_SCOPES.forEach(function (defaultScope) {\r\n _this.scopes.delete(defaultScope);\r\n });\r\n };\r\n /**\r\n * Combines an array of scopes with the current set of scopes.\r\n * @param otherScopes\r\n */\r\n ScopeSet.prototype.unionScopeSets = function (otherScopes) {\r\n if (!otherScopes) {\r\n throw ClientAuthError.createEmptyInputScopeSetError();\r\n }\r\n var unionScopes = new Set(); // Iterator in constructor not supported in IE11\r\n otherScopes.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });\r\n this.scopes.forEach(function (scope) { return unionScopes.add(scope.toLowerCase()); });\r\n return unionScopes;\r\n };\r\n /**\r\n * Check if scopes intersect between this set and another.\r\n * @param otherScopes\r\n */\r\n ScopeSet.prototype.intersectingScopeSets = function (otherScopes) {\r\n if (!otherScopes) {\r\n throw ClientAuthError.createEmptyInputScopeSetError();\r\n }\r\n // Do not allow OIDC scopes to be the only intersecting scopes\r\n if (!otherScopes.containsOnlyOIDCScopes()) {\r\n otherScopes.removeOIDCScopes();\r\n }\r\n var unionScopes = this.unionScopeSets(otherScopes);\r\n var sizeOtherScopes = otherScopes.getScopeCount();\r\n var sizeThisScopes = this.getScopeCount();\r\n var sizeUnionScopes = unionScopes.size;\r\n return sizeUnionScopes < (sizeThisScopes + sizeOtherScopes);\r\n };\r\n /**\r\n * Returns size of set of scopes.\r\n */\r\n ScopeSet.prototype.getScopeCount = function () {\r\n return this.scopes.size;\r\n };\r\n /**\r\n * Returns the scopes as an array of string values\r\n */\r\n ScopeSet.prototype.asArray = function () {\r\n var array = [];\r\n this.scopes.forEach(function (val) { return array.push(val); });\r\n return array;\r\n };\r\n /**\r\n * Prints scopes into a space-delimited string\r\n */\r\n ScopeSet.prototype.printScopes = function () {\r\n if (this.scopes) {\r\n var scopeArr = this.asArray();\r\n return scopeArr.join(\" \");\r\n }\r\n return Constants.EMPTY_STRING;\r\n };\r\n /**\r\n * Prints scopes into a space-delimited lower-case string (used for caching)\r\n */\r\n ScopeSet.prototype.printScopesLowerCase = function () {\r\n return this.printScopes().toLowerCase();\r\n };\r\n return ScopeSet;\r\n}());\n\nexport { ScopeSet };\n//# sourceMappingURL=ScopeSet.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { Separators, Constants } from '../utils/Constants.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 * Function to build a client info object from server clientInfo string\r\n * @param rawClientInfo\r\n * @param crypto\r\n */\r\nfunction buildClientInfo(rawClientInfo, crypto) {\r\n if (StringUtils.isEmpty(rawClientInfo)) {\r\n throw ClientAuthError.createClientInfoEmptyError();\r\n }\r\n try {\r\n var decodedClientInfo = crypto.base64Decode(rawClientInfo);\r\n return JSON.parse(decodedClientInfo);\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createClientInfoDecodingError(e.message);\r\n }\r\n}\r\n/**\r\n * Function to build a client info object from cached homeAccountId string\r\n * @param homeAccountId\r\n */\r\nfunction buildClientInfoFromHomeAccountId(homeAccountId) {\r\n if (StringUtils.isEmpty(homeAccountId)) {\r\n throw ClientAuthError.createClientInfoDecodingError(\"Home account ID was empty.\");\r\n }\r\n var clientInfoParts = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\r\n return {\r\n uid: clientInfoParts[0],\r\n utid: clientInfoParts.length < 2 ? Constants.EMPTY_STRING : clientInfoParts[1]\r\n };\r\n}\n\nexport { buildClientInfo, buildClientInfoFromHomeAccountId };\n//# sourceMappingURL=ClientInfo.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Authority types supported by MSAL.\r\n */\r\nvar AuthorityType;\r\n(function (AuthorityType) {\r\n AuthorityType[AuthorityType[\"Default\"] = 0] = \"Default\";\r\n AuthorityType[AuthorityType[\"Adfs\"] = 1] = \"Adfs\";\r\n AuthorityType[AuthorityType[\"Dsts\"] = 2] = \"Dsts\";\r\n AuthorityType[AuthorityType[\"Ciam\"] = 3] = \"Ciam\";\r\n})(AuthorityType || (AuthorityType = {}));\n\nexport { AuthorityType };\n//# sourceMappingURL=AuthorityType.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { Separators, CacheAccountType, CacheType, Constants } from '../../utils/Constants.js';\nimport { buildClientInfo } from '../../account/ClientInfo.js';\nimport { StringUtils } from '../../utils/StringUtils.js';\nimport { ClientAuthError } from '../../error/ClientAuthError.js';\nimport { AuthorityType } from '../../authority/AuthorityType.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 * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\r\n *\r\n * Key : Value Schema\r\n *\r\n * Key: --\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\r\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\r\n * authorityType: Accounts authority type as a string\r\n * name: Full name for the account, including given name and family name,\r\n * clientInfo: Full base64 encoded client info received from ESTS\r\n * lastModificationTime: last time this entity was modified in the cache\r\n * lastModificationApp:\r\n * idTokenClaims: Object containing claims parsed from ID token\r\n * nativeAccountId: Account identifier on the native device\r\n * }\r\n */\r\nvar AccountEntity = /** @class */ (function () {\r\n function AccountEntity() {\r\n }\r\n /**\r\n * Generate Account Id key component as per the schema: -\r\n */\r\n AccountEntity.prototype.generateAccountId = function () {\r\n var accountId = [this.homeAccountId, this.environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * Generate Account Cache Key as per the schema: --\r\n */\r\n AccountEntity.prototype.generateAccountKey = function () {\r\n return AccountEntity.generateAccountCacheKey({\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId\r\n });\r\n };\r\n /**\r\n * returns the type of the cache (in this case account)\r\n */\r\n AccountEntity.prototype.generateType = function () {\r\n switch (this.authorityType) {\r\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\r\n return CacheType.ADFS;\r\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\r\n return CacheType.MSA;\r\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\r\n return CacheType.MSSTS;\r\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\r\n return CacheType.GENERIC;\r\n default: {\r\n throw ClientAuthError.createUnexpectedAccountTypeError();\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the AccountInfo interface for this account.\r\n */\r\n AccountEntity.prototype.getAccountInfo = function () {\r\n return {\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId,\r\n name: this.name,\r\n idTokenClaims: this.idTokenClaims,\r\n nativeAccountId: this.nativeAccountId\r\n };\r\n };\r\n /**\r\n * Generates account key from interface\r\n * @param accountInterface\r\n */\r\n AccountEntity.generateAccountCacheKey = function (accountInterface) {\r\n var accountKey = [\r\n accountInterface.homeAccountId,\r\n accountInterface.environment || Constants.EMPTY_STRING,\r\n accountInterface.tenantId || Constants.EMPTY_STRING,\r\n ];\r\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\r\n * @param clientInfo\r\n * @param authority\r\n * @param idToken\r\n * @param policy\r\n */\r\n AccountEntity.createAccount = function (clientInfo, homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment, nativeAccountId) {\r\n var _a, _b, _c, _d, _e, _f;\r\n var account = new AccountEntity();\r\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\r\n account.clientInfo = clientInfo;\r\n account.homeAccountId = homeAccountId;\r\n account.nativeAccountId = nativeAccountId;\r\n var env = environment || (authority && authority.getPreferredCache());\r\n if (!env) {\r\n throw ClientAuthError.createInvalidCacheEnvironmentError();\r\n }\r\n account.environment = env;\r\n // non AAD scenarios can have empty realm\r\n account.realm = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.tid) || Constants.EMPTY_STRING;\r\n if (idToken) {\r\n account.idTokenClaims = idToken.claims;\r\n // How do you account for MSA CID here?\r\n account.localAccountId = ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.oid) || ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.sub) || Constants.EMPTY_STRING;\r\n /*\r\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array.\r\n * In most cases it will contain a single email. This field should not be relied upon if a custom\r\n * policy is configured to return more than 1 email.\r\n */\r\n var preferredUsername = (_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.preferred_username;\r\n var email = ((_e = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _e === void 0 ? void 0 : _e.emails) ? idToken.claims.emails[0] : null;\r\n account.username = preferredUsername || email || Constants.EMPTY_STRING;\r\n account.name = (_f = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _f === void 0 ? void 0 : _f.name;\r\n }\r\n account.cloudGraphHostName = cloudGraphHostName;\r\n account.msGraphHost = msGraphHost;\r\n return account;\r\n };\r\n /**\r\n * Builds non-AAD/ADFS account.\r\n * @param authority\r\n * @param idToken\r\n */\r\n AccountEntity.createGenericAccount = function (homeAccountId, idToken, authority, cloudGraphHostName, msGraphHost, environment) {\r\n var _a, _b, _c, _d;\r\n var account = new AccountEntity();\r\n account.authorityType = (authority &&\r\n authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\r\n account.homeAccountId = homeAccountId;\r\n // non AAD scenarios can have empty realm\r\n account.realm = Constants.EMPTY_STRING;\r\n var env = environment || authority && authority.getPreferredCache();\r\n if (!env) {\r\n throw ClientAuthError.createInvalidCacheEnvironmentError();\r\n }\r\n if (idToken) {\r\n // How do you account for MSA CID here?\r\n account.localAccountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.oid) || ((_b = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _b === void 0 ? void 0 : _b.sub) || Constants.EMPTY_STRING;\r\n // upn claim for most ADFS scenarios\r\n account.username = ((_c = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _c === void 0 ? void 0 : _c.upn) || Constants.EMPTY_STRING;\r\n account.name = ((_d = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _d === void 0 ? void 0 : _d.name) || Constants.EMPTY_STRING;\r\n account.idTokenClaims = idToken === null || idToken === void 0 ? void 0 : idToken.claims;\r\n }\r\n account.environment = env;\r\n account.cloudGraphHostName = cloudGraphHostName;\r\n account.msGraphHost = msGraphHost;\r\n /*\r\n * add uniqueName to claims\r\n * account.name = idToken.claims.uniqueName;\r\n */\r\n return account;\r\n };\r\n /**\r\n * Generate HomeAccountId from server response\r\n * @param serverClientInfo\r\n * @param authType\r\n */\r\n AccountEntity.generateHomeAccountId = function (serverClientInfo, authType, logger, cryptoObj, idToken) {\r\n var _a;\r\n var accountId = ((_a = idToken === null || idToken === void 0 ? void 0 : idToken.claims) === null || _a === void 0 ? void 0 : _a.sub) ? idToken.claims.sub : Constants.EMPTY_STRING;\r\n // since ADFS does not have tid and does not set client_info\r\n if (authType === AuthorityType.Adfs || authType === AuthorityType.Dsts) {\r\n return accountId;\r\n }\r\n // for cases where there is clientInfo\r\n if (serverClientInfo) {\r\n try {\r\n var clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\r\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\r\n return \"\" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid;\r\n }\r\n }\r\n catch (e) { }\r\n }\r\n // default to \"sub\" claim\r\n logger.verbose(\"No client info in response\");\r\n return accountId;\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n AccountEntity.isAccountEntity = function (entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"localAccountId\") &&\r\n entity.hasOwnProperty(\"username\") &&\r\n entity.hasOwnProperty(\"authorityType\"));\r\n };\r\n /**\r\n * Helper function to determine whether 2 accountInfo objects represent the same account\r\n * @param accountA\r\n * @param accountB\r\n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\r\n */\r\n AccountEntity.accountInfoIsEqual = function (accountA, accountB, compareClaims) {\r\n if (!accountA || !accountB) {\r\n return false;\r\n }\r\n var claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\r\n if (compareClaims) {\r\n var accountAClaims = (accountA.idTokenClaims || {});\r\n var accountBClaims = (accountB.idTokenClaims || {});\r\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\r\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\r\n (accountAClaims.nonce === accountBClaims.nonce);\r\n }\r\n return (accountA.homeAccountId === accountB.homeAccountId) &&\r\n (accountA.localAccountId === accountB.localAccountId) &&\r\n (accountA.username === accountB.username) &&\r\n (accountA.tenantId === accountB.tenantId) &&\r\n (accountA.environment === accountB.environment) &&\r\n (accountA.nativeAccountId === accountB.nativeAccountId) &&\r\n claimsMatch;\r\n };\r\n return AccountEntity;\r\n}());\n\nexport { AccountEntity };\n//# sourceMappingURL=AccountEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { StringUtils } from '../utils/StringUtils.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 * JWT Token representation class. Parses token string and generates claims object.\r\n */\r\nvar AuthToken = /** @class */ (function () {\r\n function AuthToken(rawToken, crypto) {\r\n if (StringUtils.isEmpty(rawToken)) {\r\n throw ClientAuthError.createTokenNullOrEmptyError(rawToken);\r\n }\r\n this.rawToken = rawToken;\r\n this.claims = AuthToken.extractTokenClaims(rawToken, crypto);\r\n }\r\n /**\r\n * Extract token by decoding the rawToken\r\n *\r\n * @param encodedToken\r\n */\r\n AuthToken.extractTokenClaims = function (encodedToken, crypto) {\r\n var decodedToken = StringUtils.decodeAuthToken(encodedToken);\r\n // token will be decoded to get the username\r\n try {\r\n var base64TokenPayload = decodedToken.JWSPayload;\r\n // base64Decode() should throw an error if there is an issue\r\n var base64Decoded = crypto.base64Decode(base64TokenPayload);\r\n return JSON.parse(base64Decoded);\r\n }\r\n catch (err) {\r\n throw ClientAuthError.createTokenParsingError(err);\r\n }\r\n };\r\n /**\r\n * Determine if the token's max_age has transpired\r\n */\r\n AuthToken.checkMaxAge = function (authTime, maxAge) {\r\n /*\r\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\r\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\r\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\r\n */\r\n var fiveMinuteSkew = 300000; // five minutes in milliseconds\r\n if ((maxAge === 0) || ((Date.now() - fiveMinuteSkew) > (authTime + maxAge))) {\r\n throw ClientAuthError.createMaxAgeTranspiredError();\r\n }\r\n };\r\n return AuthToken;\r\n}());\n\nexport { AuthToken };\n//# sourceMappingURL=AuthToken.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator, __assign, __extends } from '../_virtual/_tslib.js';\nimport { Separators, CredentialType, AuthenticationScheme, THE_FAMILY_ID, APP_METADATA, AUTHORITY_METADATA_CONSTANTS } from '../utils/Constants.js';\nimport { ScopeSet } from '../request/ScopeSet.js';\nimport { AccountEntity } from './entities/AccountEntity.js';\nimport { AuthError } from '../error/AuthError.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { AuthToken } from '../account/AuthToken.js';\nimport { name, version } from '../packageMetadata.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 * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.\r\n */\r\nvar CacheManager = /** @class */ (function () {\r\n function CacheManager(clientId, cryptoImpl, logger) {\r\n this.clientId = clientId;\r\n this.cryptoImpl = cryptoImpl;\r\n this.commonLogger = logger.clone(name, version);\r\n }\r\n /**\r\n * Returns all accounts in cache\r\n */\r\n CacheManager.prototype.getAllAccounts = function () {\r\n var _this = this;\r\n var allAccountKeys = this.getAccountKeys();\r\n if (allAccountKeys.length < 1) {\r\n return [];\r\n }\r\n var accountEntities = allAccountKeys.reduce(function (accounts, key) {\r\n var entity = _this.getAccount(key);\r\n if (!entity) {\r\n return accounts;\r\n }\r\n accounts.push(entity);\r\n return accounts;\r\n }, []);\r\n if (accountEntities.length < 1) {\r\n return [];\r\n }\r\n else {\r\n var allAccounts = accountEntities.map(function (accountEntity) {\r\n return _this.getAccountInfoFromEntity(accountEntity);\r\n });\r\n return allAccounts;\r\n }\r\n };\r\n /**\r\n * Gets accountInfo object based on provided filters\r\n */\r\n CacheManager.prototype.getAccountInfoFilteredBy = function (accountFilter) {\r\n var allAccounts = this.getAccountsFilteredBy(accountFilter);\r\n if (allAccounts.length > 0) {\r\n return this.getAccountInfoFromEntity(allAccounts[0]);\r\n }\r\n else {\r\n return null;\r\n }\r\n };\r\n CacheManager.prototype.getAccountInfoFromEntity = function (accountEntity) {\r\n var accountInfo = accountEntity.getAccountInfo();\r\n var idToken = this.getIdToken(accountInfo);\r\n if (idToken) {\r\n accountInfo.idToken = idToken.secret;\r\n accountInfo.idTokenClaims = new AuthToken(idToken.secret, this.cryptoImpl).claims;\r\n }\r\n return accountInfo;\r\n };\r\n /**\r\n * saves a cache record\r\n * @param cacheRecord\r\n */\r\n CacheManager.prototype.saveCacheRecord = function (cacheRecord) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!cacheRecord) {\r\n throw ClientAuthError.createNullOrUndefinedCacheRecord();\r\n }\r\n if (!!cacheRecord.account) {\r\n this.setAccount(cacheRecord.account);\r\n }\r\n if (!!cacheRecord.idToken) {\r\n this.setIdTokenCredential(cacheRecord.idToken);\r\n }\r\n if (!!!cacheRecord.accessToken) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.saveAccessToken(cacheRecord.accessToken)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n if (!!cacheRecord.refreshToken) {\r\n this.setRefreshTokenCredential(cacheRecord.refreshToken);\r\n }\r\n if (!!cacheRecord.appMetadata) {\r\n this.setAppMetadata(cacheRecord.appMetadata);\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * saves access token credential\r\n * @param credential\r\n */\r\n CacheManager.prototype.saveAccessToken = function (credential) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var accessTokenFilter, tokenKeys, currentScopes, removedAccessTokens;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n accessTokenFilter = {\r\n clientId: credential.clientId,\r\n credentialType: credential.credentialType,\r\n environment: credential.environment,\r\n homeAccountId: credential.homeAccountId,\r\n realm: credential.realm,\r\n tokenType: credential.tokenType,\r\n requestedClaimsHash: credential.requestedClaimsHash\r\n };\r\n tokenKeys = this.getTokenKeys();\r\n currentScopes = ScopeSet.fromString(credential.target);\r\n removedAccessTokens = [];\r\n tokenKeys.accessToken.forEach(function (key) {\r\n if (!_this.accessTokenKeyMatchesFilter(key, accessTokenFilter, false)) {\r\n return;\r\n }\r\n var tokenEntity = _this.getAccessTokenCredential(key);\r\n if (tokenEntity && _this.credentialMatchesFilter(tokenEntity, accessTokenFilter)) {\r\n var tokenScopeSet = ScopeSet.fromString(tokenEntity.target);\r\n if (tokenScopeSet.intersectingScopeSets(currentScopes)) {\r\n removedAccessTokens.push(_this.removeAccessToken(key));\r\n }\r\n }\r\n });\r\n return [4 /*yield*/, Promise.all(removedAccessTokens)];\r\n case 1:\r\n _a.sent();\r\n this.setAccessTokenCredential(credential);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * retrieve accounts matching all provided filters; if no filter is set, get all accounts\r\n * not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared\r\n * @param homeAccountId\r\n * @param environment\r\n * @param realm\r\n */\r\n CacheManager.prototype.getAccountsFilteredBy = function (accountFilter) {\r\n var _this = this;\r\n var allAccountKeys = this.getAccountKeys();\r\n var matchingAccounts = [];\r\n allAccountKeys.forEach(function (cacheKey) {\r\n if (!_this.isAccountKey(cacheKey, accountFilter.homeAccountId, accountFilter.realm)) {\r\n // Don't parse value if the key doesn't match the account filters\r\n return;\r\n }\r\n var entity = _this.getAccount(cacheKey);\r\n if (!entity) {\r\n return;\r\n }\r\n if (!!accountFilter.homeAccountId && !_this.matchHomeAccountId(entity, accountFilter.homeAccountId)) {\r\n return;\r\n }\r\n if (!!accountFilter.localAccountId && !_this.matchLocalAccountId(entity, accountFilter.localAccountId)) {\r\n return;\r\n }\r\n if (!!accountFilter.username && !_this.matchUsername(entity, accountFilter.username)) {\r\n return;\r\n }\r\n if (!!accountFilter.environment && !_this.matchEnvironment(entity, accountFilter.environment)) {\r\n return;\r\n }\r\n if (!!accountFilter.realm && !_this.matchRealm(entity, accountFilter.realm)) {\r\n return;\r\n }\r\n if (!!accountFilter.nativeAccountId && !_this.matchNativeAccountId(entity, accountFilter.nativeAccountId)) {\r\n return;\r\n }\r\n matchingAccounts.push(entity);\r\n });\r\n return matchingAccounts;\r\n };\r\n /**\r\n * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided\r\n * @param key\r\n * @param homeAccountId\r\n * @param tenantId\r\n * @returns\r\n */\r\n CacheManager.prototype.isAccountKey = function (key, homeAccountId, tenantId) {\r\n if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 3) {\r\n // Account cache keys contain 3 items separated by '-' (each item may also contain '-')\r\n return false;\r\n }\r\n if (homeAccountId && !key.toLowerCase().includes(homeAccountId.toLowerCase())) {\r\n return false;\r\n }\r\n if (tenantId && !key.toLowerCase().includes(tenantId.toLowerCase())) {\r\n return false;\r\n }\r\n // Do not check environment as aliasing can cause false negatives\r\n return true;\r\n };\r\n /**\r\n * Returns true if the given key matches our credential key schema.\r\n * @param key\r\n */\r\n CacheManager.prototype.isCredentialKey = function (key) {\r\n if (key.split(Separators.CACHE_KEY_SEPARATOR).length < 6) {\r\n // Credential cache keys contain 6 items separated by '-' (each item may also contain '-')\r\n return false;\r\n }\r\n var lowerCaseKey = key.toLowerCase();\r\n // Credential keys must indicate what credential type they represent\r\n if (lowerCaseKey.indexOf(CredentialType.ID_TOKEN.toLowerCase()) === -1 &&\r\n lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) === -1 &&\r\n lowerCaseKey.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) === -1 &&\r\n lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (lowerCaseKey.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) > -1) {\r\n // Refresh tokens must contain the client id or family id\r\n var clientIdValidation = \"\" + CredentialType.REFRESH_TOKEN + Separators.CACHE_KEY_SEPARATOR + this.clientId + Separators.CACHE_KEY_SEPARATOR;\r\n var familyIdValidation = \"\" + CredentialType.REFRESH_TOKEN + Separators.CACHE_KEY_SEPARATOR + THE_FAMILY_ID + Separators.CACHE_KEY_SEPARATOR;\r\n if (lowerCaseKey.indexOf(clientIdValidation.toLowerCase()) === -1 && lowerCaseKey.indexOf(familyIdValidation.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n }\r\n else if (lowerCaseKey.indexOf(this.clientId.toLowerCase()) === -1) {\r\n // Tokens must contain the clientId\r\n return false;\r\n }\r\n return true;\r\n };\r\n /**\r\n * Returns whether or not the given credential entity matches the filter\r\n * @param entity\r\n * @param filter\r\n * @returns\r\n */\r\n CacheManager.prototype.credentialMatchesFilter = function (entity, filter) {\r\n if (!!filter.clientId && !this.matchClientId(entity, filter.clientId)) {\r\n return false;\r\n }\r\n if (!!filter.userAssertionHash && !this.matchUserAssertionHash(entity, filter.userAssertionHash)) {\r\n return false;\r\n }\r\n /*\r\n * homeAccountId can be undefined, and we want to filter out cached items that have a homeAccountId of \"\"\r\n * because we don't want a client_credential request to return a cached token that has a homeAccountId\r\n */\r\n if ((typeof filter.homeAccountId === \"string\") && !this.matchHomeAccountId(entity, filter.homeAccountId)) {\r\n return false;\r\n }\r\n if (!!filter.environment && !this.matchEnvironment(entity, filter.environment)) {\r\n return false;\r\n }\r\n if (!!filter.realm && !this.matchRealm(entity, filter.realm)) {\r\n return false;\r\n }\r\n if (!!filter.credentialType && !this.matchCredentialType(entity, filter.credentialType)) {\r\n return false;\r\n }\r\n if (!!filter.familyId && !this.matchFamilyId(entity, filter.familyId)) {\r\n return false;\r\n }\r\n /*\r\n * idTokens do not have \"target\", target specific refreshTokens do exist for some types of authentication\r\n * Resource specific refresh tokens case will be added when the support is deemed necessary\r\n */\r\n if (!!filter.target && !this.matchTarget(entity, filter.target)) {\r\n return false;\r\n }\r\n // If request OR cached entity has requested Claims Hash, check if they match\r\n if (filter.requestedClaimsHash || entity.requestedClaimsHash) {\r\n // Don't match if either is undefined or they are different\r\n if (entity.requestedClaimsHash !== filter.requestedClaimsHash) {\r\n return false;\r\n }\r\n }\r\n // Access Token with Auth Scheme specific matching\r\n if (entity.credentialType === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {\r\n if (!!filter.tokenType && !this.matchTokenType(entity, filter.tokenType)) {\r\n return false;\r\n }\r\n // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key\r\n if (filter.tokenType === AuthenticationScheme.SSH) {\r\n if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata\r\n * @param filter\r\n */\r\n CacheManager.prototype.getAppMetadataFilteredBy = function (filter) {\r\n return this.getAppMetadataFilteredByInternal(filter.environment, filter.clientId);\r\n };\r\n /**\r\n * Support function to help match appMetadata\r\n * @param environment\r\n * @param clientId\r\n */\r\n CacheManager.prototype.getAppMetadataFilteredByInternal = function (environment, clientId) {\r\n var _this = this;\r\n var allCacheKeys = this.getKeys();\r\n var matchingAppMetadata = {};\r\n allCacheKeys.forEach(function (cacheKey) {\r\n // don't parse any non-appMetadata type cache entities\r\n if (!_this.isAppMetadata(cacheKey)) {\r\n return;\r\n }\r\n // Attempt retrieval\r\n var entity = _this.getAppMetadata(cacheKey);\r\n if (!entity) {\r\n return;\r\n }\r\n if (!!environment && !_this.matchEnvironment(entity, environment)) {\r\n return;\r\n }\r\n if (!!clientId && !_this.matchClientId(entity, clientId)) {\r\n return;\r\n }\r\n matchingAppMetadata[cacheKey] = entity;\r\n });\r\n return matchingAppMetadata;\r\n };\r\n /**\r\n * retrieve authorityMetadata that contains a matching alias\r\n * @param filter\r\n */\r\n CacheManager.prototype.getAuthorityMetadataByAlias = function (host) {\r\n var _this = this;\r\n var allCacheKeys = this.getAuthorityMetadataKeys();\r\n var matchedEntity = null;\r\n allCacheKeys.forEach(function (cacheKey) {\r\n // don't parse any non-authorityMetadata type cache entities\r\n if (!_this.isAuthorityMetadata(cacheKey) || cacheKey.indexOf(_this.clientId) === -1) {\r\n return;\r\n }\r\n // Attempt retrieval\r\n var entity = _this.getAuthorityMetadata(cacheKey);\r\n if (!entity) {\r\n return;\r\n }\r\n if (entity.aliases.indexOf(host) === -1) {\r\n return;\r\n }\r\n matchedEntity = entity;\r\n });\r\n return matchedEntity;\r\n };\r\n /**\r\n * Removes all accounts and related tokens from cache.\r\n */\r\n CacheManager.prototype.removeAllAccounts = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var allAccountKeys, removedAccounts;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n allAccountKeys = this.getAccountKeys();\r\n removedAccounts = [];\r\n allAccountKeys.forEach(function (cacheKey) {\r\n removedAccounts.push(_this.removeAccount(cacheKey));\r\n });\r\n return [4 /*yield*/, Promise.all(removedAccounts)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes the account and related tokens for a given account key\r\n * @param account\r\n */\r\n CacheManager.prototype.removeAccount = function (accountKey) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var account;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n account = this.getAccount(accountKey);\r\n if (!account) {\r\n throw ClientAuthError.createNoAccountFoundError();\r\n }\r\n return [4 /*yield*/, this.removeAccountContext(account)];\r\n case 1:\r\n _a.sent();\r\n this.removeItem(accountKey);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes credentials associated with the provided account\r\n * @param account\r\n */\r\n CacheManager.prototype.removeAccountContext = function (account) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var allTokenKeys, accountId, removedCredentials;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n allTokenKeys = this.getTokenKeys();\r\n accountId = account.generateAccountId();\r\n removedCredentials = [];\r\n allTokenKeys.idToken.forEach(function (key) {\r\n if (key.indexOf(accountId) === 0) {\r\n _this.removeIdToken(key);\r\n }\r\n });\r\n allTokenKeys.accessToken.forEach(function (key) {\r\n if (key.indexOf(accountId) === 0) {\r\n removedCredentials.push(_this.removeAccessToken(key));\r\n }\r\n });\r\n allTokenKeys.refreshToken.forEach(function (key) {\r\n if (key.indexOf(accountId) === 0) {\r\n _this.removeRefreshToken(key);\r\n }\r\n });\r\n return [4 /*yield*/, Promise.all(removedCredentials)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * returns a boolean if the given credential is removed\r\n * @param credential\r\n */\r\n CacheManager.prototype.removeAccessToken = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var credential, accessTokenWithAuthSchemeEntity, kid;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n credential = this.getAccessTokenCredential(key);\r\n if (!credential) {\r\n return [2 /*return*/];\r\n }\r\n if (!(credential.credentialType.toLowerCase() === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase())) return [3 /*break*/, 4];\r\n if (!(credential.tokenType === AuthenticationScheme.POP)) return [3 /*break*/, 4];\r\n accessTokenWithAuthSchemeEntity = credential;\r\n kid = accessTokenWithAuthSchemeEntity.keyId;\r\n if (!kid) return [3 /*break*/, 4];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.cryptoImpl.removeTokenBindingKey(kid)];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n _a.sent();\r\n throw ClientAuthError.createBindingKeyNotRemovedError();\r\n case 4: return [2 /*return*/, this.removeItem(key)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes all app metadata objects from cache.\r\n */\r\n CacheManager.prototype.removeAppMetadata = function () {\r\n var _this = this;\r\n var allCacheKeys = this.getKeys();\r\n allCacheKeys.forEach(function (cacheKey) {\r\n if (_this.isAppMetadata(cacheKey)) {\r\n _this.removeItem(cacheKey);\r\n }\r\n });\r\n return true;\r\n };\r\n /**\r\n * Retrieve the cached credentials into a cacherecord\r\n * @param account\r\n * @param clientId\r\n * @param scopes\r\n * @param environment\r\n * @param authScheme\r\n */\r\n CacheManager.prototype.readCacheRecord = function (account, request, environment) {\r\n var tokenKeys = this.getTokenKeys();\r\n var cachedAccount = this.readAccountFromCache(account);\r\n var cachedIdToken = this.getIdToken(account, tokenKeys);\r\n var cachedAccessToken = this.getAccessToken(account, request, tokenKeys);\r\n var cachedRefreshToken = this.getRefreshToken(account, false, tokenKeys);\r\n var cachedAppMetadata = this.readAppMetadataFromCache(environment);\r\n if (cachedAccount && cachedIdToken) {\r\n cachedAccount.idTokenClaims = new AuthToken(cachedIdToken.secret, this.cryptoImpl).claims;\r\n }\r\n return {\r\n account: cachedAccount,\r\n idToken: cachedIdToken,\r\n accessToken: cachedAccessToken,\r\n refreshToken: cachedRefreshToken,\r\n appMetadata: cachedAppMetadata,\r\n };\r\n };\r\n /**\r\n * Retrieve AccountEntity from cache\r\n * @param account\r\n */\r\n CacheManager.prototype.readAccountFromCache = function (account) {\r\n var accountKey = AccountEntity.generateAccountCacheKey(account);\r\n return this.getAccount(accountKey);\r\n };\r\n /**\r\n * Retrieve IdTokenEntity from cache\r\n * @param clientId\r\n * @param account\r\n * @param inputRealm\r\n */\r\n CacheManager.prototype.getIdToken = function (account, tokenKeys) {\r\n this.commonLogger.trace(\"CacheManager - getIdToken called\");\r\n var idTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: CredentialType.ID_TOKEN,\r\n clientId: this.clientId,\r\n realm: account.tenantId,\r\n };\r\n var idTokens = this.getIdTokensByFilter(idTokenFilter, tokenKeys);\r\n var numIdTokens = idTokens.length;\r\n if (numIdTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getIdToken - No token found\");\r\n return null;\r\n }\r\n else if (numIdTokens > 1) {\r\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\r\n }\r\n this.commonLogger.info(\"CacheManager:getIdToken - Returning id token\");\r\n return idTokens[0];\r\n };\r\n /**\r\n * Gets all idTokens matching the given filter\r\n * @param filter\r\n * @returns\r\n */\r\n CacheManager.prototype.getIdTokensByFilter = function (filter, tokenKeys) {\r\n var _this = this;\r\n var idTokenKeys = tokenKeys && tokenKeys.idToken || this.getTokenKeys().idToken;\r\n var idTokens = [];\r\n idTokenKeys.forEach(function (key) {\r\n if (!_this.idTokenKeyMatchesFilter(key, __assign({ clientId: _this.clientId }, filter))) {\r\n return;\r\n }\r\n var idToken = _this.getIdTokenCredential(key);\r\n if (idToken && _this.credentialMatchesFilter(idToken, filter)) {\r\n idTokens.push(idToken);\r\n }\r\n });\r\n return idTokens;\r\n };\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n * @returns\r\n */\r\n CacheManager.prototype.idTokenKeyMatchesFilter = function (inputKey, filter) {\r\n var key = inputKey.toLowerCase();\r\n if (filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n /**\r\n * Removes idToken from the cache\r\n * @param key\r\n */\r\n CacheManager.prototype.removeIdToken = function (key) {\r\n this.removeItem(key);\r\n };\r\n /**\r\n * Removes refresh token from the cache\r\n * @param key\r\n */\r\n CacheManager.prototype.removeRefreshToken = function (key) {\r\n this.removeItem(key);\r\n };\r\n /**\r\n * Retrieve AccessTokenEntity from cache\r\n * @param clientId\r\n * @param account\r\n * @param scopes\r\n * @param authScheme\r\n */\r\n CacheManager.prototype.getAccessToken = function (account, request, tokenKeys) {\r\n var _this = this;\r\n this.commonLogger.trace(\"CacheManager - getAccessToken called\");\r\n var scopes = ScopeSet.createSearchScopes(request.scopes);\r\n var authScheme = request.authenticationScheme || AuthenticationScheme.BEARER;\r\n /*\r\n * Distinguish between Bearer and PoP/SSH token cache types\r\n * Cast to lowercase to handle \"bearer\" from ADFS\r\n */\r\n var credentialType = (authScheme && authScheme.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME : CredentialType.ACCESS_TOKEN;\r\n var accessTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: credentialType,\r\n clientId: this.clientId,\r\n realm: account.tenantId,\r\n target: scopes,\r\n tokenType: authScheme,\r\n keyId: request.sshKid,\r\n requestedClaimsHash: request.requestedClaimsHash,\r\n };\r\n var accessTokenKeys = tokenKeys && tokenKeys.accessToken || this.getTokenKeys().accessToken;\r\n var accessTokens = [];\r\n accessTokenKeys.forEach(function (key) {\r\n // Validate key\r\n if (_this.accessTokenKeyMatchesFilter(key, accessTokenFilter, true)) {\r\n var accessToken = _this.getAccessTokenCredential(key);\r\n // Validate value\r\n if (accessToken && _this.credentialMatchesFilter(accessToken, accessTokenFilter)) {\r\n accessTokens.push(accessToken);\r\n }\r\n }\r\n });\r\n var numAccessTokens = accessTokens.length;\r\n if (numAccessTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getAccessToken - No token found\");\r\n return null;\r\n }\r\n else if (numAccessTokens > 1) {\r\n throw ClientAuthError.createMultipleMatchingTokensInCacheError();\r\n }\r\n this.commonLogger.info(\"CacheManager:getAccessToken - Returning access token\");\r\n return accessTokens[0];\r\n };\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n * @param keyMustContainAllScopes\r\n * @returns\r\n */\r\n CacheManager.prototype.accessTokenKeyMatchesFilter = function (inputKey, filter, keyMustContainAllScopes) {\r\n var key = inputKey.toLowerCase();\r\n if (filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.realm && key.indexOf(filter.realm.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.requestedClaimsHash && key.indexOf(filter.requestedClaimsHash.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.target) {\r\n var scopes = filter.target.asArray();\r\n for (var i = 0; i < scopes.length; i++) {\r\n if (keyMustContainAllScopes && !key.includes(scopes[i].toLowerCase())) {\r\n // When performing a cache lookup a missing scope would be a cache miss\r\n return false;\r\n }\r\n else if (!keyMustContainAllScopes && key.includes(scopes[i].toLowerCase())) {\r\n // When performing a cache write, any token with a subset of requested scopes should be replaced\r\n return true;\r\n }\r\n }\r\n }\r\n return true;\r\n };\r\n /**\r\n * Gets all access tokens matching the filter\r\n * @param filter\r\n * @returns\r\n */\r\n CacheManager.prototype.getAccessTokensByFilter = function (filter) {\r\n var _this = this;\r\n var tokenKeys = this.getTokenKeys();\r\n var accessTokens = [];\r\n tokenKeys.accessToken.forEach(function (key) {\r\n if (!_this.accessTokenKeyMatchesFilter(key, filter, true)) {\r\n return;\r\n }\r\n var accessToken = _this.getAccessTokenCredential(key);\r\n if (accessToken && _this.credentialMatchesFilter(accessToken, filter)) {\r\n accessTokens.push(accessToken);\r\n }\r\n });\r\n return accessTokens;\r\n };\r\n /**\r\n * Helper to retrieve the appropriate refresh token from cache\r\n * @param clientId\r\n * @param account\r\n * @param familyRT\r\n */\r\n CacheManager.prototype.getRefreshToken = function (account, familyRT, tokenKeys) {\r\n var _this = this;\r\n this.commonLogger.trace(\"CacheManager - getRefreshToken called\");\r\n var id = familyRT ? THE_FAMILY_ID : undefined;\r\n var refreshTokenFilter = {\r\n homeAccountId: account.homeAccountId,\r\n environment: account.environment,\r\n credentialType: CredentialType.REFRESH_TOKEN,\r\n clientId: this.clientId,\r\n familyId: id,\r\n };\r\n var refreshTokenKeys = tokenKeys && tokenKeys.refreshToken || this.getTokenKeys().refreshToken;\r\n var refreshTokens = [];\r\n refreshTokenKeys.forEach(function (key) {\r\n // Validate key\r\n if (_this.refreshTokenKeyMatchesFilter(key, refreshTokenFilter)) {\r\n var refreshToken = _this.getRefreshTokenCredential(key);\r\n // Validate value\r\n if (refreshToken && _this.credentialMatchesFilter(refreshToken, refreshTokenFilter)) {\r\n refreshTokens.push(refreshToken);\r\n }\r\n }\r\n });\r\n var numRefreshTokens = refreshTokens.length;\r\n if (numRefreshTokens < 1) {\r\n this.commonLogger.info(\"CacheManager:getRefreshToken - No refresh token found.\");\r\n return null;\r\n }\r\n // address the else case after remove functions address environment aliases\r\n this.commonLogger.info(\"CacheManager:getRefreshToken - returning refresh token\");\r\n return refreshTokens[0];\r\n };\r\n /**\r\n * Validate the cache key against filter before retrieving and parsing cache value\r\n * @param key\r\n * @param filter\r\n */\r\n CacheManager.prototype.refreshTokenKeyMatchesFilter = function (inputKey, filter) {\r\n var key = inputKey.toLowerCase();\r\n if (filter.familyId && key.indexOf(filter.familyId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n // If familyId is used, clientId is not in the key\r\n if (!filter.familyId && filter.clientId && key.indexOf(filter.clientId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n if (filter.homeAccountId && key.indexOf(filter.homeAccountId.toLowerCase()) === -1) {\r\n return false;\r\n }\r\n return true;\r\n };\r\n /**\r\n * Retrieve AppMetadataEntity from cache\r\n */\r\n CacheManager.prototype.readAppMetadataFromCache = function (environment) {\r\n var appMetadataFilter = {\r\n environment: environment,\r\n clientId: this.clientId,\r\n };\r\n var appMetadata = this.getAppMetadataFilteredBy(appMetadataFilter);\r\n var appMetadataEntries = Object.keys(appMetadata).map(function (key) { return appMetadata[key]; });\r\n var numAppMetadata = appMetadataEntries.length;\r\n if (numAppMetadata < 1) {\r\n return null;\r\n }\r\n else if (numAppMetadata > 1) {\r\n throw ClientAuthError.createMultipleMatchingAppMetadataInCacheError();\r\n }\r\n return appMetadataEntries[0];\r\n };\r\n /**\r\n * Return the family_id value associated with FOCI\r\n * @param environment\r\n * @param clientId\r\n */\r\n CacheManager.prototype.isAppMetadataFOCI = function (environment) {\r\n var appMetadata = this.readAppMetadataFromCache(environment);\r\n return !!(appMetadata && appMetadata.familyId === THE_FAMILY_ID);\r\n };\r\n /**\r\n * helper to match account ids\r\n * @param value\r\n * @param homeAccountId\r\n */\r\n CacheManager.prototype.matchHomeAccountId = function (entity, homeAccountId) {\r\n return !!((typeof entity.homeAccountId === \"string\") && (homeAccountId === entity.homeAccountId));\r\n };\r\n /**\r\n * helper to match account ids\r\n * @param entity\r\n * @param localAccountId\r\n * @returns\r\n */\r\n CacheManager.prototype.matchLocalAccountId = function (entity, localAccountId) {\r\n return !!((typeof entity.localAccountId === \"string\") && (localAccountId === entity.localAccountId));\r\n };\r\n /**\r\n * helper to match usernames\r\n * @param entity\r\n * @param username\r\n * @returns\r\n */\r\n CacheManager.prototype.matchUsername = function (entity, username) {\r\n return !!((typeof entity.username === \"string\") && (username.toLowerCase() === entity.username.toLowerCase()));\r\n };\r\n /**\r\n * helper to match assertion\r\n * @param value\r\n * @param oboAssertion\r\n */\r\n CacheManager.prototype.matchUserAssertionHash = function (entity, userAssertionHash) {\r\n return !!(entity.userAssertionHash && userAssertionHash === entity.userAssertionHash);\r\n };\r\n /**\r\n * helper to match environment\r\n * @param value\r\n * @param environment\r\n */\r\n CacheManager.prototype.matchEnvironment = function (entity, environment) {\r\n var cloudMetadata = this.getAuthorityMetadataByAlias(environment);\r\n if (cloudMetadata && cloudMetadata.aliases.indexOf(entity.environment) > -1) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n /**\r\n * helper to match credential type\r\n * @param entity\r\n * @param credentialType\r\n */\r\n CacheManager.prototype.matchCredentialType = function (entity, credentialType) {\r\n return (entity.credentialType && credentialType.toLowerCase() === entity.credentialType.toLowerCase());\r\n };\r\n /**\r\n * helper to match client ids\r\n * @param entity\r\n * @param clientId\r\n */\r\n CacheManager.prototype.matchClientId = function (entity, clientId) {\r\n return !!(entity.clientId && clientId === entity.clientId);\r\n };\r\n /**\r\n * helper to match family ids\r\n * @param entity\r\n * @param familyId\r\n */\r\n CacheManager.prototype.matchFamilyId = function (entity, familyId) {\r\n return !!(entity.familyId && familyId === entity.familyId);\r\n };\r\n /**\r\n * helper to match realm\r\n * @param entity\r\n * @param realm\r\n */\r\n CacheManager.prototype.matchRealm = function (entity, realm) {\r\n return !!(entity.realm && realm === entity.realm);\r\n };\r\n /**\r\n * helper to match nativeAccountId\r\n * @param entity\r\n * @param nativeAccountId\r\n * @returns boolean indicating the match result\r\n */\r\n CacheManager.prototype.matchNativeAccountId = function (entity, nativeAccountId) {\r\n return !!(entity.nativeAccountId && nativeAccountId === entity.nativeAccountId);\r\n };\r\n /**\r\n * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.\r\n * @param entity\r\n * @param target\r\n */\r\n CacheManager.prototype.matchTarget = function (entity, target) {\r\n var isNotAccessTokenCredential = (entity.credentialType !== CredentialType.ACCESS_TOKEN && entity.credentialType !== CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME);\r\n if (isNotAccessTokenCredential || !entity.target) {\r\n return false;\r\n }\r\n var entityScopeSet = ScopeSet.fromString(entity.target);\r\n return entityScopeSet.containsScopeSet(target);\r\n };\r\n /**\r\n * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise\r\n * @param entity\r\n * @param tokenType\r\n */\r\n CacheManager.prototype.matchTokenType = function (entity, tokenType) {\r\n return !!(entity.tokenType && entity.tokenType === tokenType);\r\n };\r\n /**\r\n * Returns true if the credential's keyId matches the one in the request, false otherwise\r\n * @param entity\r\n * @param tokenType\r\n */\r\n CacheManager.prototype.matchKeyId = function (entity, keyId) {\r\n return !!(entity.keyId && entity.keyId === keyId);\r\n };\r\n /**\r\n * returns if a given cache entity is of the type appmetadata\r\n * @param key\r\n */\r\n CacheManager.prototype.isAppMetadata = function (key) {\r\n return key.indexOf(APP_METADATA) !== -1;\r\n };\r\n /**\r\n * returns if a given cache entity is of the type authoritymetadata\r\n * @param key\r\n */\r\n CacheManager.prototype.isAuthorityMetadata = function (key) {\r\n return key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) !== -1;\r\n };\r\n /**\r\n * returns cache key used for cloud instance metadata\r\n */\r\n CacheManager.prototype.generateAuthorityMetadataCacheKey = function (authority) {\r\n return AUTHORITY_METADATA_CONSTANTS.CACHE_KEY + \"-\" + this.clientId + \"-\" + authority;\r\n };\r\n /**\r\n * Helper to convert serialized data to object\r\n * @param obj\r\n * @param json\r\n */\r\n CacheManager.toObject = function (obj, json) {\r\n for (var propertyName in json) {\r\n obj[propertyName] = json[propertyName];\r\n }\r\n return obj;\r\n };\r\n return CacheManager;\r\n}());\r\nvar DefaultStorageClass = /** @class */ (function (_super) {\r\n __extends(DefaultStorageClass, _super);\r\n function DefaultStorageClass() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n DefaultStorageClass.prototype.setAccount = function () {\r\n var notImplErr = \"Storage interface - setAccount() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAccount = function () {\r\n var notImplErr = \"Storage interface - getAccount() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setIdTokenCredential = function () {\r\n var notImplErr = \"Storage interface - setIdTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getIdTokenCredential = function () {\r\n var notImplErr = \"Storage interface - getIdTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setAccessTokenCredential = function () {\r\n var notImplErr = \"Storage interface - setAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAccessTokenCredential = function () {\r\n var notImplErr = \"Storage interface - getAccessTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setRefreshTokenCredential = function () {\r\n var notImplErr = \"Storage interface - setRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getRefreshTokenCredential = function () {\r\n var notImplErr = \"Storage interface - getRefreshTokenCredential() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setAppMetadata = function () {\r\n var notImplErr = \"Storage interface - setAppMetadata() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAppMetadata = function () {\r\n var notImplErr = \"Storage interface - getAppMetadata() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setServerTelemetry = function () {\r\n var notImplErr = \"Storage interface - setServerTelemetry() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getServerTelemetry = function () {\r\n var notImplErr = \"Storage interface - getServerTelemetry() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setAuthorityMetadata = function () {\r\n var notImplErr = \"Storage interface - setAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAuthorityMetadata = function () {\r\n var notImplErr = \"Storage interface - getAuthorityMetadata() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAuthorityMetadataKeys = function () {\r\n var notImplErr = \"Storage interface - getAuthorityMetadataKeys() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.setThrottlingCache = function () {\r\n var notImplErr = \"Storage interface - setThrottlingCache() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getThrottlingCache = function () {\r\n var notImplErr = \"Storage interface - getThrottlingCache() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.removeItem = function () {\r\n var notImplErr = \"Storage interface - removeItem() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.containsKey = function () {\r\n var notImplErr = \"Storage interface - containsKey() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getKeys = function () {\r\n var notImplErr = \"Storage interface - getKeys() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getAccountKeys = function () {\r\n var notImplErr = \"Storage interface - getAccountKeys() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.getTokenKeys = function () {\r\n var notImplErr = \"Storage interface - getTokenKeys() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n DefaultStorageClass.prototype.clear = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Storage interface - clear() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n };\r\n DefaultStorageClass.prototype.updateCredentialCacheKey = function () {\r\n var notImplErr = \"Storage interface - updateCredentialCacheKey() has not been implemented for the cacheStorage interface.\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n };\r\n return DefaultStorageClass;\r\n}(CacheManager));\n\nexport { CacheManager, DefaultStorageClass };\n//# sourceMappingURL=CacheManager.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { DEFAULT_CRYPTO_IMPLEMENTATION } from '../crypto/ICrypto.js';\nimport { AuthError } from '../error/AuthError.js';\nimport { Logger, LogLevel } from '../logger/Logger.js';\nimport { Constants } from '../utils/Constants.js';\nimport { version } from '../packageMetadata.js';\nimport { AzureCloudInstance } from '../authority/AuthorityOptions.js';\nimport { DefaultStorageClass } from '../cache/CacheManager.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Token renewal offset default in seconds\r\nvar DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;\r\nvar DEFAULT_SYSTEM_OPTIONS = {\r\n tokenRenewalOffsetSeconds: DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,\r\n preventCorsPreflight: false\r\n};\r\nvar DEFAULT_LOGGER_IMPLEMENTATION = {\r\n loggerCallback: function () {\r\n // allow users to not set loggerCallback\r\n },\r\n piiLoggingEnabled: false,\r\n logLevel: LogLevel.Info,\r\n correlationId: Constants.EMPTY_STRING\r\n};\r\nvar DEFAULT_NETWORK_IMPLEMENTATION = {\r\n sendGetRequestAsync: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n },\r\n sendPostRequestAsync: function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var notImplErr;\r\n return __generator(this, function (_a) {\r\n notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented\";\r\n throw AuthError.createUnexpectedError(notImplErr);\r\n });\r\n });\r\n }\r\n};\r\nvar DEFAULT_LIBRARY_INFO = {\r\n sku: Constants.SKU,\r\n version: version,\r\n cpu: Constants.EMPTY_STRING,\r\n os: Constants.EMPTY_STRING\r\n};\r\nvar DEFAULT_CLIENT_CREDENTIALS = {\r\n clientSecret: Constants.EMPTY_STRING,\r\n clientAssertion: undefined\r\n};\r\nvar DEFAULT_AZURE_CLOUD_OPTIONS = {\r\n azureCloudInstance: AzureCloudInstance.None,\r\n tenant: \"\" + Constants.DEFAULT_COMMON_TENANT\r\n};\r\nvar DEFAULT_TELEMETRY_OPTIONS = {\r\n application: {\r\n appName: \"\",\r\n appVersion: \"\"\r\n }\r\n};\r\n/**\r\n * Function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param Configuration\r\n *\r\n * @returns Configuration\r\n */\r\nfunction buildClientConfiguration(_a) {\r\n var userAuthOptions = _a.authOptions, userSystemOptions = _a.systemOptions, userLoggerOption = _a.loggerOptions, storageImplementation = _a.storageInterface, networkImplementation = _a.networkInterface, cryptoImplementation = _a.cryptoInterface, clientCredentials = _a.clientCredentials, libraryInfo = _a.libraryInfo, telemetry = _a.telemetry, serverTelemetryManager = _a.serverTelemetryManager, persistencePlugin = _a.persistencePlugin, serializableCache = _a.serializableCache;\r\n var loggerOptions = __assign(__assign({}, DEFAULT_LOGGER_IMPLEMENTATION), userLoggerOption);\r\n return {\r\n authOptions: buildAuthOptions(userAuthOptions),\r\n systemOptions: __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), userSystemOptions),\r\n loggerOptions: loggerOptions,\r\n storageInterface: storageImplementation || new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions)),\r\n networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,\r\n cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,\r\n clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,\r\n libraryInfo: __assign(__assign({}, DEFAULT_LIBRARY_INFO), libraryInfo),\r\n telemetry: __assign(__assign({}, DEFAULT_TELEMETRY_OPTIONS), telemetry),\r\n serverTelemetryManager: serverTelemetryManager || null,\r\n persistencePlugin: persistencePlugin || null,\r\n serializableCache: serializableCache || null,\r\n };\r\n}\r\n/**\r\n * Construct authoptions from the client and platform passed values\r\n * @param authOptions\r\n */\r\nfunction buildAuthOptions(authOptions) {\r\n return __assign({ clientCapabilities: [], azureCloudOptions: DEFAULT_AZURE_CLOUD_OPTIONS, skipAuthorityMetadataCache: false }, authOptions);\r\n}\n\nexport { DEFAULT_SYSTEM_OPTIONS, buildClientConfiguration };\n//# sourceMappingURL=ClientConfiguration.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { AuthError } from './AuthError.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 * Error thrown when there is an error with the server code, for example, unavailability.\r\n */\r\nvar ServerError = /** @class */ (function (_super) {\r\n __extends(ServerError, _super);\r\n function ServerError(errorCode, errorMessage, subError) {\r\n var _this = _super.call(this, errorCode, errorMessage, subError) || this;\r\n _this.name = \"ServerError\";\r\n Object.setPrototypeOf(_this, ServerError.prototype);\r\n return _this;\r\n }\r\n return ServerError;\r\n}(AuthError));\n\nexport { ServerError };\n//# sourceMappingURL=ServerError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ThrottlingConstants, Constants, HeaderNames } from '../utils/Constants.js';\nimport { ServerError } from '../error/ServerError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ThrottlingUtils = /** @class */ (function () {\r\n function ThrottlingUtils() {\r\n }\r\n /**\r\n * Prepares a RequestThumbprint to be stored as a key.\r\n * @param thumbprint\r\n */\r\n ThrottlingUtils.generateThrottlingStorageKey = function (thumbprint) {\r\n return ThrottlingConstants.THROTTLING_PREFIX + \".\" + JSON.stringify(thumbprint);\r\n };\r\n /**\r\n * Performs necessary throttling checks before a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n */\r\n ThrottlingUtils.preProcess = function (cacheManager, thumbprint) {\r\n var _a;\r\n var key = ThrottlingUtils.generateThrottlingStorageKey(thumbprint);\r\n var value = cacheManager.getThrottlingCache(key);\r\n if (value) {\r\n if (value.throttleTime < Date.now()) {\r\n cacheManager.removeItem(key);\r\n return;\r\n }\r\n throw new ServerError(((_a = value.errorCodes) === null || _a === void 0 ? void 0 : _a.join(\" \")) || Constants.EMPTY_STRING, value.errorMessage, value.subError);\r\n }\r\n };\r\n /**\r\n * Performs necessary throttling checks after a network request.\r\n * @param cacheManager\r\n * @param thumbprint\r\n * @param response\r\n */\r\n ThrottlingUtils.postProcess = function (cacheManager, thumbprint, response) {\r\n if (ThrottlingUtils.checkResponseStatus(response) || ThrottlingUtils.checkResponseForRetryAfter(response)) {\r\n var thumbprintValue = {\r\n throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),\r\n error: response.body.error,\r\n errorCodes: response.body.error_codes,\r\n errorMessage: response.body.error_description,\r\n subError: response.body.suberror\r\n };\r\n cacheManager.setThrottlingCache(ThrottlingUtils.generateThrottlingStorageKey(thumbprint), thumbprintValue);\r\n }\r\n };\r\n /**\r\n * Checks a NetworkResponse object's status codes against 429 or 5xx\r\n * @param response\r\n */\r\n ThrottlingUtils.checkResponseStatus = function (response) {\r\n return response.status === 429 || response.status >= 500 && response.status < 600;\r\n };\r\n /**\r\n * Checks a NetworkResponse object's RetryAfter header\r\n * @param response\r\n */\r\n ThrottlingUtils.checkResponseForRetryAfter = function (response) {\r\n if (response.headers) {\r\n return response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) && (response.status < 200 || response.status >= 300);\r\n }\r\n return false;\r\n };\r\n /**\r\n * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.\r\n * @param throttleTime\r\n */\r\n ThrottlingUtils.calculateThrottleTime = function (throttleTime) {\r\n var time = throttleTime <= 0 ? 0 : throttleTime;\r\n var currentSeconds = Date.now() / 1000;\r\n return Math.floor(Math.min(currentSeconds + (time || ThrottlingConstants.DEFAULT_THROTTLE_TIME_SECONDS), currentSeconds + ThrottlingConstants.DEFAULT_MAX_THROTTLE_TIME_SECONDS) * 1000);\r\n };\r\n ThrottlingUtils.removeThrottle = function (cacheManager, clientId, request, homeAccountIdentifier) {\r\n var thumbprint = {\r\n clientId: clientId,\r\n authority: request.authority,\r\n scopes: request.scopes,\r\n homeAccountIdentifier: homeAccountIdentifier,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n var key = this.generateThrottlingStorageKey(thumbprint);\r\n cacheManager.removeItem(key);\r\n };\r\n return ThrottlingUtils;\r\n}());\n\nexport { ThrottlingUtils };\n//# sourceMappingURL=ThrottlingUtils.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { ThrottlingUtils } from './ThrottlingUtils.js';\nimport { AuthError } from '../error/AuthError.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar NetworkManager = /** @class */ (function () {\r\n function NetworkManager(networkClient, cacheManager) {\r\n this.networkClient = networkClient;\r\n this.cacheManager = cacheManager;\r\n }\r\n /**\r\n * Wraps sendPostRequestAsync with necessary preflight and postflight logic\r\n * @param thumbprint\r\n * @param tokenEndpoint\r\n * @param options\r\n */\r\n NetworkManager.prototype.sendPostRequest = function (thumbprint, tokenEndpoint, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n ThrottlingUtils.preProcess(this.cacheManager, thumbprint);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.networkClient.sendPostRequestAsync(tokenEndpoint, options)];\r\n case 2:\r\n response = _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof AuthError) {\r\n throw e_1;\r\n }\r\n else {\r\n throw ClientAuthError.createNetworkError(tokenEndpoint, e_1);\r\n }\r\n case 4:\r\n ThrottlingUtils.postProcess(this.cacheManager, thumbprint, response);\r\n return [2 /*return*/, response];\r\n }\r\n });\r\n });\r\n };\r\n return NetworkManager;\r\n}());\n\nexport { NetworkManager };\n//# sourceMappingURL=NetworkManager.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar CcsCredentialType;\r\n(function (CcsCredentialType) {\r\n CcsCredentialType[\"HOME_ACCOUNT_ID\"] = \"home_account_id\";\r\n CcsCredentialType[\"UPN\"] = \"UPN\";\r\n})(CcsCredentialType || (CcsCredentialType = {}));\n\nexport { CcsCredentialType };\n//# sourceMappingURL=CcsCredential.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { CodeChallengeMethodValues, PromptValue } from '../utils/Constants.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 * Validates server consumable params from the \"request\" objects\r\n */\r\nvar RequestValidator = /** @class */ (function () {\r\n function RequestValidator() {\r\n }\r\n /**\r\n * Utility to check if the `redirectUri` in the request is a non-null value\r\n * @param redirectUri\r\n */\r\n RequestValidator.validateRedirectUri = function (redirectUri) {\r\n if (StringUtils.isEmpty(redirectUri)) {\r\n throw ClientConfigurationError.createRedirectUriEmptyError();\r\n }\r\n };\r\n /**\r\n * Utility to validate prompt sent by the user in the request\r\n * @param prompt\r\n */\r\n RequestValidator.validatePrompt = function (prompt) {\r\n var promptValues = [];\r\n for (var value in PromptValue) {\r\n promptValues.push(PromptValue[value]);\r\n }\r\n if (promptValues.indexOf(prompt) < 0) {\r\n throw ClientConfigurationError.createInvalidPromptError(prompt);\r\n }\r\n };\r\n RequestValidator.validateClaims = function (claims) {\r\n try {\r\n JSON.parse(claims);\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createInvalidClaimsRequestError();\r\n }\r\n };\r\n /**\r\n * Utility to validate code_challenge and code_challenge_method\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n RequestValidator.validateCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {\r\n if (StringUtils.isEmpty(codeChallenge) || StringUtils.isEmpty(codeChallengeMethod)) {\r\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\r\n }\r\n else {\r\n this.validateCodeChallengeMethod(codeChallengeMethod);\r\n }\r\n };\r\n /**\r\n * Utility to validate code_challenge_method\r\n * @param codeChallengeMethod\r\n */\r\n RequestValidator.validateCodeChallengeMethod = function (codeChallengeMethod) {\r\n if ([\r\n CodeChallengeMethodValues.PLAIN,\r\n CodeChallengeMethodValues.S256\r\n ].indexOf(codeChallengeMethod) < 0) {\r\n throw ClientConfigurationError.createInvalidCodeChallengeMethodError();\r\n }\r\n };\r\n /**\r\n * Removes unnecessary, duplicate, and empty string query parameters from extraQueryParameters\r\n * @param request\r\n */\r\n RequestValidator.sanitizeEQParams = function (eQParams, queryParams) {\r\n if (!eQParams) {\r\n return {};\r\n }\r\n // Remove any query parameters already included in SSO params\r\n queryParams.forEach(function (value, key) {\r\n if (eQParams[key]) {\r\n delete eQParams[key];\r\n }\r\n });\r\n // remove empty string parameters\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n return Object.fromEntries(Object.entries(eQParams).filter(function (_a) {\r\n var value = _a[1];\r\n return value !== \"\";\r\n }));\r\n };\r\n return RequestValidator;\r\n}());\n\nexport { RequestValidator };\n//# sourceMappingURL=RequestValidator.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __spreadArrays } from '../_virtual/_tslib.js';\nimport { AADServerParamKeys, Constants, ResponseMode, OIDC_DEFAULT_SCOPES, SSOTypes, HeaderNames, CLIENT_INFO, ClaimsRequestKeys, PasswordGrantConstants, AuthenticationScheme, ThrottlingConstants } from '../utils/Constants.js';\nimport { ScopeSet } from './ScopeSet.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { RequestValidator } from './RequestValidator.js';\nimport { StringUtils } from '../utils/StringUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar RequestParameterBuilder = /** @class */ (function () {\r\n function RequestParameterBuilder() {\r\n this.parameters = new Map();\r\n }\r\n /**\r\n * add response_type = code\r\n */\r\n RequestParameterBuilder.prototype.addResponseTypeCode = function () {\r\n this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.CODE_RESPONSE_TYPE));\r\n };\r\n /**\r\n * add response_type = token id_token\r\n */\r\n RequestParameterBuilder.prototype.addResponseTypeForTokenAndIdToken = function () {\r\n this.parameters.set(AADServerParamKeys.RESPONSE_TYPE, encodeURIComponent(Constants.TOKEN_RESPONSE_TYPE + \" \" + Constants.ID_TOKEN_RESPONSE_TYPE));\r\n };\r\n /**\r\n * add response_mode. defaults to query.\r\n * @param responseMode\r\n */\r\n RequestParameterBuilder.prototype.addResponseMode = function (responseMode) {\r\n this.parameters.set(AADServerParamKeys.RESPONSE_MODE, encodeURIComponent((responseMode) ? responseMode : ResponseMode.QUERY));\r\n };\r\n /**\r\n * Add flag to indicate STS should attempt to use WAM if available\r\n */\r\n RequestParameterBuilder.prototype.addNativeBroker = function () {\r\n this.parameters.set(AADServerParamKeys.NATIVE_BROKER, encodeURIComponent(\"1\"));\r\n };\r\n /**\r\n * add scopes. set addOidcScopes to false to prevent default scopes in non-user scenarios\r\n * @param scopeSet\r\n * @param addOidcScopes\r\n */\r\n RequestParameterBuilder.prototype.addScopes = function (scopes, addOidcScopes) {\r\n if (addOidcScopes === void 0) { addOidcScopes = true; }\r\n var requestScopes = addOidcScopes ? __spreadArrays(scopes || [], OIDC_DEFAULT_SCOPES) : scopes || [];\r\n var scopeSet = new ScopeSet(requestScopes);\r\n this.parameters.set(AADServerParamKeys.SCOPE, encodeURIComponent(scopeSet.printScopes()));\r\n };\r\n /**\r\n * add clientId\r\n * @param clientId\r\n */\r\n RequestParameterBuilder.prototype.addClientId = function (clientId) {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ID, encodeURIComponent(clientId));\r\n };\r\n /**\r\n * add redirect_uri\r\n * @param redirectUri\r\n */\r\n RequestParameterBuilder.prototype.addRedirectUri = function (redirectUri) {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.REDIRECT_URI, encodeURIComponent(redirectUri));\r\n };\r\n /**\r\n * add post logout redirectUri\r\n * @param redirectUri\r\n */\r\n RequestParameterBuilder.prototype.addPostLogoutRedirectUri = function (redirectUri) {\r\n RequestValidator.validateRedirectUri(redirectUri);\r\n this.parameters.set(AADServerParamKeys.POST_LOGOUT_URI, encodeURIComponent(redirectUri));\r\n };\r\n /**\r\n * add id_token_hint to logout request\r\n * @param idTokenHint\r\n */\r\n RequestParameterBuilder.prototype.addIdTokenHint = function (idTokenHint) {\r\n this.parameters.set(AADServerParamKeys.ID_TOKEN_HINT, encodeURIComponent(idTokenHint));\r\n };\r\n /**\r\n * add domain_hint\r\n * @param domainHint\r\n */\r\n RequestParameterBuilder.prototype.addDomainHint = function (domainHint) {\r\n this.parameters.set(SSOTypes.DOMAIN_HINT, encodeURIComponent(domainHint));\r\n };\r\n /**\r\n * add login_hint\r\n * @param loginHint\r\n */\r\n RequestParameterBuilder.prototype.addLoginHint = function (loginHint) {\r\n this.parameters.set(SSOTypes.LOGIN_HINT, encodeURIComponent(loginHint));\r\n };\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for login_hint\r\n * @param loginHint\r\n */\r\n RequestParameterBuilder.prototype.addCcsUpn = function (loginHint) {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(\"UPN:\" + loginHint));\r\n };\r\n /**\r\n * Adds the CCS (Cache Credential Service) query parameter for account object\r\n * @param loginHint\r\n */\r\n RequestParameterBuilder.prototype.addCcsOid = function (clientInfo) {\r\n this.parameters.set(HeaderNames.CCS_HEADER, encodeURIComponent(\"Oid:\" + clientInfo.uid + \"@\" + clientInfo.utid));\r\n };\r\n /**\r\n * add sid\r\n * @param sid\r\n */\r\n RequestParameterBuilder.prototype.addSid = function (sid) {\r\n this.parameters.set(SSOTypes.SID, encodeURIComponent(sid));\r\n };\r\n /**\r\n * add claims\r\n * @param claims\r\n */\r\n RequestParameterBuilder.prototype.addClaims = function (claims, clientCapabilities) {\r\n var mergedClaims = this.addClientCapabilitiesToClaims(claims, clientCapabilities);\r\n RequestValidator.validateClaims(mergedClaims);\r\n this.parameters.set(AADServerParamKeys.CLAIMS, encodeURIComponent(mergedClaims));\r\n };\r\n /**\r\n * add correlationId\r\n * @param correlationId\r\n */\r\n RequestParameterBuilder.prototype.addCorrelationId = function (correlationId) {\r\n this.parameters.set(AADServerParamKeys.CLIENT_REQUEST_ID, encodeURIComponent(correlationId));\r\n };\r\n /**\r\n * add library info query params\r\n * @param libraryInfo\r\n */\r\n RequestParameterBuilder.prototype.addLibraryInfo = function (libraryInfo) {\r\n // Telemetry Info\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_SKU, libraryInfo.sku);\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_VER, libraryInfo.version);\r\n if (libraryInfo.os) {\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_OS, libraryInfo.os);\r\n }\r\n if (libraryInfo.cpu) {\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CPU, libraryInfo.cpu);\r\n }\r\n };\r\n /**\r\n * Add client telemetry parameters\r\n * @param appTelemetry\r\n */\r\n RequestParameterBuilder.prototype.addApplicationTelemetry = function (appTelemetry) {\r\n if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appName) {\r\n this.parameters.set(AADServerParamKeys.X_APP_NAME, appTelemetry.appName);\r\n }\r\n if (appTelemetry === null || appTelemetry === void 0 ? void 0 : appTelemetry.appVersion) {\r\n this.parameters.set(AADServerParamKeys.X_APP_VER, appTelemetry.appVersion);\r\n }\r\n };\r\n /**\r\n * add prompt\r\n * @param prompt\r\n */\r\n RequestParameterBuilder.prototype.addPrompt = function (prompt) {\r\n RequestValidator.validatePrompt(prompt);\r\n this.parameters.set(\"\" + AADServerParamKeys.PROMPT, encodeURIComponent(prompt));\r\n };\r\n /**\r\n * add state\r\n * @param state\r\n */\r\n RequestParameterBuilder.prototype.addState = function (state) {\r\n if (!StringUtils.isEmpty(state)) {\r\n this.parameters.set(AADServerParamKeys.STATE, encodeURIComponent(state));\r\n }\r\n };\r\n /**\r\n * add nonce\r\n * @param nonce\r\n */\r\n RequestParameterBuilder.prototype.addNonce = function (nonce) {\r\n this.parameters.set(AADServerParamKeys.NONCE, encodeURIComponent(nonce));\r\n };\r\n /**\r\n * add code_challenge and code_challenge_method\r\n * - throw if either of them are not passed\r\n * @param codeChallenge\r\n * @param codeChallengeMethod\r\n */\r\n RequestParameterBuilder.prototype.addCodeChallengeParams = function (codeChallenge, codeChallengeMethod) {\r\n RequestValidator.validateCodeChallengeParams(codeChallenge, codeChallengeMethod);\r\n if (codeChallenge && codeChallengeMethod) {\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE, encodeURIComponent(codeChallenge));\r\n this.parameters.set(AADServerParamKeys.CODE_CHALLENGE_METHOD, encodeURIComponent(codeChallengeMethod));\r\n }\r\n else {\r\n throw ClientConfigurationError.createInvalidCodeChallengeParamsError();\r\n }\r\n };\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n RequestParameterBuilder.prototype.addAuthorizationCode = function (code) {\r\n this.parameters.set(AADServerParamKeys.CODE, encodeURIComponent(code));\r\n };\r\n /**\r\n * add the `authorization_code` passed by the user to exchange for a token\r\n * @param code\r\n */\r\n RequestParameterBuilder.prototype.addDeviceCode = function (code) {\r\n this.parameters.set(AADServerParamKeys.DEVICE_CODE, encodeURIComponent(code));\r\n };\r\n /**\r\n * add the `refreshToken` passed by the user\r\n * @param refreshToken\r\n */\r\n RequestParameterBuilder.prototype.addRefreshToken = function (refreshToken) {\r\n this.parameters.set(AADServerParamKeys.REFRESH_TOKEN, encodeURIComponent(refreshToken));\r\n };\r\n /**\r\n * add the `code_verifier` passed by the user to exchange for a token\r\n * @param codeVerifier\r\n */\r\n RequestParameterBuilder.prototype.addCodeVerifier = function (codeVerifier) {\r\n this.parameters.set(AADServerParamKeys.CODE_VERIFIER, encodeURIComponent(codeVerifier));\r\n };\r\n /**\r\n * add client_secret\r\n * @param clientSecret\r\n */\r\n RequestParameterBuilder.prototype.addClientSecret = function (clientSecret) {\r\n this.parameters.set(AADServerParamKeys.CLIENT_SECRET, encodeURIComponent(clientSecret));\r\n };\r\n /**\r\n * add clientAssertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n RequestParameterBuilder.prototype.addClientAssertion = function (clientAssertion) {\r\n if (!StringUtils.isEmpty(clientAssertion)) {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION, encodeURIComponent(clientAssertion));\r\n }\r\n };\r\n /**\r\n * add clientAssertionType for confidential client flows\r\n * @param clientAssertionType\r\n */\r\n RequestParameterBuilder.prototype.addClientAssertionType = function (clientAssertionType) {\r\n if (!StringUtils.isEmpty(clientAssertionType)) {\r\n this.parameters.set(AADServerParamKeys.CLIENT_ASSERTION_TYPE, encodeURIComponent(clientAssertionType));\r\n }\r\n };\r\n /**\r\n * add OBO assertion for confidential client flows\r\n * @param clientAssertion\r\n */\r\n RequestParameterBuilder.prototype.addOboAssertion = function (oboAssertion) {\r\n this.parameters.set(AADServerParamKeys.OBO_ASSERTION, encodeURIComponent(oboAssertion));\r\n };\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n RequestParameterBuilder.prototype.addRequestTokenUse = function (tokenUse) {\r\n this.parameters.set(AADServerParamKeys.REQUESTED_TOKEN_USE, encodeURIComponent(tokenUse));\r\n };\r\n /**\r\n * add grant type\r\n * @param grantType\r\n */\r\n RequestParameterBuilder.prototype.addGrantType = function (grantType) {\r\n this.parameters.set(AADServerParamKeys.GRANT_TYPE, encodeURIComponent(grantType));\r\n };\r\n /**\r\n * add client info\r\n *\r\n */\r\n RequestParameterBuilder.prototype.addClientInfo = function () {\r\n this.parameters.set(CLIENT_INFO, \"1\");\r\n };\r\n /**\r\n * add extraQueryParams\r\n * @param eQParams\r\n */\r\n RequestParameterBuilder.prototype.addExtraQueryParameters = function (eQParams) {\r\n var _this = this;\r\n var sanitizedEQParams = RequestValidator.sanitizeEQParams(eQParams, this.parameters);\r\n Object.keys(sanitizedEQParams).forEach(function (key) {\r\n _this.parameters.set(key, eQParams[key]);\r\n });\r\n };\r\n RequestParameterBuilder.prototype.addClientCapabilitiesToClaims = function (claims, clientCapabilities) {\r\n var mergedClaims;\r\n // Parse provided claims into JSON object or initialize empty object\r\n if (!claims) {\r\n mergedClaims = {};\r\n }\r\n else {\r\n try {\r\n mergedClaims = JSON.parse(claims);\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createInvalidClaimsRequestError();\r\n }\r\n }\r\n if (clientCapabilities && clientCapabilities.length > 0) {\r\n if (!mergedClaims.hasOwnProperty(ClaimsRequestKeys.ACCESS_TOKEN)) {\r\n // Add access_token key to claims object\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN] = {};\r\n }\r\n // Add xms_cc claim with provided clientCapabilities to access_token key\r\n mergedClaims[ClaimsRequestKeys.ACCESS_TOKEN][ClaimsRequestKeys.XMS_CC] = {\r\n values: clientCapabilities\r\n };\r\n }\r\n return JSON.stringify(mergedClaims);\r\n };\r\n /**\r\n * adds `username` for Password Grant flow\r\n * @param username\r\n */\r\n RequestParameterBuilder.prototype.addUsername = function (username) {\r\n this.parameters.set(PasswordGrantConstants.username, encodeURIComponent(username));\r\n };\r\n /**\r\n * adds `password` for Password Grant flow\r\n * @param password\r\n */\r\n RequestParameterBuilder.prototype.addPassword = function (password) {\r\n this.parameters.set(PasswordGrantConstants.password, encodeURIComponent(password));\r\n };\r\n /**\r\n * add pop_jwk to query params\r\n * @param cnfString\r\n */\r\n RequestParameterBuilder.prototype.addPopToken = function (cnfString) {\r\n if (!StringUtils.isEmpty(cnfString)) {\r\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.POP);\r\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(cnfString));\r\n }\r\n };\r\n /**\r\n * add SSH JWK and key ID to query params\r\n */\r\n RequestParameterBuilder.prototype.addSshJwk = function (sshJwkString) {\r\n if (!StringUtils.isEmpty(sshJwkString)) {\r\n this.parameters.set(AADServerParamKeys.TOKEN_TYPE, AuthenticationScheme.SSH);\r\n this.parameters.set(AADServerParamKeys.REQ_CNF, encodeURIComponent(sshJwkString));\r\n }\r\n };\r\n /**\r\n * add server telemetry fields\r\n * @param serverTelemetryManager\r\n */\r\n RequestParameterBuilder.prototype.addServerTelemetry = function (serverTelemetryManager) {\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_CURR_TELEM, serverTelemetryManager.generateCurrentRequestHeaderValue());\r\n this.parameters.set(AADServerParamKeys.X_CLIENT_LAST_TELEM, serverTelemetryManager.generateLastRequestHeaderValue());\r\n };\r\n /**\r\n * Adds parameter that indicates to the server that throttling is supported\r\n */\r\n RequestParameterBuilder.prototype.addThrottling = function () {\r\n this.parameters.set(AADServerParamKeys.X_MS_LIB_CAPABILITY, ThrottlingConstants.X_MS_LIB_CAPABILITY_VALUE);\r\n };\r\n /**\r\n * Adds logout_hint parameter for \"silent\" logout which prevent server account picker\r\n */\r\n RequestParameterBuilder.prototype.addLogoutHint = function (logoutHint) {\r\n this.parameters.set(AADServerParamKeys.LOGOUT_HINT, encodeURIComponent(logoutHint));\r\n };\r\n /**\r\n * Utility to create a URL from the params map\r\n */\r\n RequestParameterBuilder.prototype.createQueryString = function () {\r\n var queryParameterArray = new Array();\r\n this.parameters.forEach(function (value, key) {\r\n queryParameterArray.push(key + \"=\" + value);\r\n });\r\n return queryParameterArray.join(\"&\");\r\n };\r\n return RequestParameterBuilder;\r\n}());\n\nexport { RequestParameterBuilder };\n//# sourceMappingURL=RequestParameterBuilder.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { buildClientConfiguration } from '../config/ClientConfiguration.js';\nimport { NetworkManager } from '../network/NetworkManager.js';\nimport { Logger } from '../logger/Logger.js';\nimport { HeaderNames, Constants } from '../utils/Constants.js';\nimport { name, version } from '../packageMetadata.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { CcsCredentialType } from '../account/CcsCredential.js';\nimport { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';\nimport { RequestParameterBuilder } from '../request/RequestParameterBuilder.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 * Base application class which will construct requests to send to and handle responses from the Microsoft STS using the authorization code flow.\r\n */\r\nvar BaseClient = /** @class */ (function () {\r\n function BaseClient(configuration, performanceClient) {\r\n // Set the configuration\r\n this.config = buildClientConfiguration(configuration);\r\n // Initialize the logger\r\n this.logger = new Logger(this.config.loggerOptions, name, version);\r\n // Initialize crypto\r\n this.cryptoUtils = this.config.cryptoInterface;\r\n // Initialize storage interface\r\n this.cacheManager = this.config.storageInterface;\r\n // Set the network interface\r\n this.networkClient = this.config.networkInterface;\r\n // Set the NetworkManager\r\n this.networkManager = new NetworkManager(this.networkClient, this.cacheManager);\r\n // Set TelemetryManager\r\n this.serverTelemetryManager = this.config.serverTelemetryManager;\r\n // set Authority\r\n this.authority = this.config.authOptions.authority;\r\n // set performance telemetry client\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Creates default headers for requests to token endpoint\r\n */\r\n BaseClient.prototype.createTokenRequestHeaders = function (ccsCred) {\r\n var headers = {};\r\n headers[HeaderNames.CONTENT_TYPE] = Constants.URL_FORM_CONTENT_TYPE;\r\n if (!this.config.systemOptions.preventCorsPreflight && ccsCred) {\r\n switch (ccsCred.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n var clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\r\n headers[HeaderNames.CCS_HEADER] = \"Oid:\" + clientInfo.uid + \"@\" + clientInfo.utid;\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n headers[HeaderNames.CCS_HEADER] = \"UPN: \" + ccsCred.credential;\r\n break;\r\n }\r\n }\r\n return headers;\r\n };\r\n /**\r\n * Http post to token endpoint\r\n * @param tokenEndpoint\r\n * @param queryString\r\n * @param headers\r\n * @param thumbprint\r\n */\r\n BaseClient.prototype.executePostToTokenEndpoint = function (tokenEndpoint, queryString, headers, thumbprint) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.networkManager.sendPostRequest(thumbprint, tokenEndpoint, { body: queryString, headers: headers })];\r\n case 1:\r\n response = _a.sent();\r\n if (this.config.serverTelemetryManager && response.status < 500 && response.status !== 429) {\r\n // Telemetry data successfully logged by server, clear Telemetry cache\r\n this.config.serverTelemetryManager.clearTelemetryCache();\r\n }\r\n return [2 /*return*/, response];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Updates the authority object of the client. Endpoint discovery must be completed.\r\n * @param updatedAuthority\r\n */\r\n BaseClient.prototype.updateAuthority = function (updatedAuthority) {\r\n if (!updatedAuthority.discoveryComplete()) {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Updated authority has not completed endpoint discovery.\");\r\n }\r\n this.authority = updatedAuthority;\r\n };\r\n /**\r\n * Creates query string for the /token request\r\n * @param request\r\n */\r\n BaseClient.prototype.createTokenQueryParameters = function (request) {\r\n var parameterBuilder = new RequestParameterBuilder();\r\n if (request.tokenQueryParameters) {\r\n parameterBuilder.addExtraQueryParameters(request.tokenQueryParameters);\r\n }\r\n return parameterBuilder.createQueryString();\r\n };\r\n return BaseClient;\r\n}());\n\nexport { BaseClient };\n//# sourceMappingURL=BaseClient.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { CredentialType, CacheType, Separators, Constants, AuthenticationScheme } from '../../utils/Constants.js';\nimport { ClientAuthError } from '../../error/ClientAuthError.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 * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key: -------\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, usually only used for refresh tokens\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\r\n * requestedClaimsHash: Matches the SHA 256 hash of the claims object included in the token request\r\n * userAssertionHash: Matches the SHA 256 hash of the obo_assertion for the OBO flow\r\n * }\r\n */\r\nvar CredentialEntity = /** @class */ (function () {\r\n function CredentialEntity() {\r\n }\r\n /**\r\n * Generate Account Id key component as per the schema: -\r\n */\r\n CredentialEntity.prototype.generateAccountId = function () {\r\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\r\n };\r\n /**\r\n * Generate Credential Id key component as per the schema: --\r\n */\r\n CredentialEntity.prototype.generateCredentialId = function () {\r\n return CredentialEntity.generateCredentialIdForCacheKey(this.credentialType, this.clientId, this.realm, this.familyId);\r\n };\r\n /**\r\n * Generate target key component as per schema: \r\n */\r\n CredentialEntity.prototype.generateTarget = function () {\r\n return CredentialEntity.generateTargetForCacheKey(this.target);\r\n };\r\n /**\r\n * generates credential key\r\n */\r\n CredentialEntity.prototype.generateCredentialKey = function () {\r\n return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType, this.requestedClaimsHash);\r\n };\r\n /**\r\n * returns the type of the cache (in this case credential)\r\n */\r\n CredentialEntity.prototype.generateType = function () {\r\n switch (this.credentialType) {\r\n case CredentialType.ID_TOKEN:\r\n return CacheType.ID_TOKEN;\r\n case CredentialType.ACCESS_TOKEN:\r\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\r\n return CacheType.ACCESS_TOKEN;\r\n case CredentialType.REFRESH_TOKEN:\r\n return CacheType.REFRESH_TOKEN;\r\n default: {\r\n throw ClientAuthError.createUnexpectedCredentialTypeError();\r\n }\r\n }\r\n };\r\n /**\r\n * generates credential key\r\n * -\\-----\r\n */\r\n CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType, requestedClaimsHash) {\r\n var credentialKey = [\r\n this.generateAccountIdForCacheKey(homeAccountId, environment),\r\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\r\n this.generateTargetForCacheKey(target),\r\n this.generateClaimsHashForCacheKey(requestedClaimsHash),\r\n this.generateSchemeForCacheKey(tokenType)\r\n ];\r\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * generates Account Id for keys\r\n * @param homeAccountId\r\n * @param environment\r\n */\r\n CredentialEntity.generateAccountIdForCacheKey = function (homeAccountId, environment) {\r\n var accountId = [homeAccountId, environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * Generates Credential Id for keys\r\n * @param credentialType\r\n * @param realm\r\n * @param clientId\r\n * @param familyId\r\n */\r\n CredentialEntity.generateCredentialIdForCacheKey = function (credentialType, clientId, realm, familyId) {\r\n var clientOrFamilyId = credentialType === CredentialType.REFRESH_TOKEN\r\n ? familyId || clientId\r\n : clientId;\r\n var credentialId = [\r\n credentialType,\r\n clientOrFamilyId,\r\n realm || Constants.EMPTY_STRING,\r\n ];\r\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * Generate target key component as per schema: \r\n */\r\n CredentialEntity.generateTargetForCacheKey = function (scopes) {\r\n return (scopes || Constants.EMPTY_STRING).toLowerCase();\r\n };\r\n /**\r\n * Generate requested claims key component as per schema: \r\n */\r\n CredentialEntity.generateClaimsHashForCacheKey = function (requestedClaimsHash) {\r\n return (requestedClaimsHash || Constants.EMPTY_STRING).toLowerCase();\r\n };\r\n /**\r\n * Generate scheme key componenet as per schema: \r\n */\r\n CredentialEntity.generateSchemeForCacheKey = function (tokenType) {\r\n /*\r\n * PoP Tokens and SSH certs include scheme in cache key\r\n * Cast to lowercase to handle \"bearer\" from ADFS\r\n */\r\n return (tokenType && tokenType.toLowerCase() !== AuthenticationScheme.BEARER.toLowerCase()) ? tokenType.toLowerCase() : Constants.EMPTY_STRING;\r\n };\r\n return CredentialEntity;\r\n}());\n\nexport { CredentialEntity };\n//# sourceMappingURL=CredentialEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../../_virtual/_tslib.js';\nimport { CredentialEntity } from './CredentialEntity.js';\nimport { CredentialType } from '../../utils/Constants.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 * ID_TOKEN Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * }\r\n */\r\nvar IdTokenEntity = /** @class */ (function (_super) {\r\n __extends(IdTokenEntity, _super);\r\n function IdTokenEntity() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Create IdTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\n IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId) {\r\n var idTokenEntity = new IdTokenEntity();\r\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\r\n idTokenEntity.homeAccountId = homeAccountId;\r\n idTokenEntity.environment = environment;\r\n idTokenEntity.clientId = clientId;\r\n idTokenEntity.secret = idToken;\r\n idTokenEntity.realm = tenantId;\r\n return idTokenEntity;\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n IdTokenEntity.isIdTokenEntity = function (entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\") &&\r\n entity[\"credentialType\"] === CredentialType.ID_TOKEN);\r\n };\r\n return IdTokenEntity;\r\n}(CredentialEntity));\n\nexport { IdTokenEntity };\n//# sourceMappingURL=IdTokenEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Utility class which exposes functions for managing date and time operations.\r\n */\r\nvar TimeUtils = /** @class */ (function () {\r\n function TimeUtils() {\r\n }\r\n /**\r\n * return the current time in Unix time (seconds).\r\n */\r\n TimeUtils.nowSeconds = function () {\r\n // Date.getTime() returns in milliseconds.\r\n return Math.round(new Date().getTime() / 1000.0);\r\n };\r\n /**\r\n * check if a token is expired based on given UTC time in seconds.\r\n * @param expiresOn\r\n */\r\n TimeUtils.isTokenExpired = function (expiresOn, offset) {\r\n // check for access token expiry\r\n var expirationSec = Number(expiresOn) || 0;\r\n var offsetCurrentTimeSec = TimeUtils.nowSeconds() + offset;\r\n // If current time + offset is greater than token expiration time, then token is expired.\r\n return (offsetCurrentTimeSec > expirationSec);\r\n };\r\n /**\r\n * If the current time is earlier than the time that a token was cached at, we must discard the token\r\n * i.e. The system clock was turned back after acquiring the cached token\r\n * @param cachedAt\r\n * @param offset\r\n */\r\n TimeUtils.wasClockTurnedBack = function (cachedAt) {\r\n var cachedAtSec = Number(cachedAt);\r\n return cachedAtSec > TimeUtils.nowSeconds();\r\n };\r\n /**\r\n * Waits for t number of milliseconds\r\n * @param t number\r\n * @param value T\r\n */\r\n TimeUtils.delay = function (t, value) {\r\n return new Promise(function (resolve) { return setTimeout(function () { return resolve(value); }, t); });\r\n };\r\n return TimeUtils;\r\n}());\n\nexport { TimeUtils };\n//# sourceMappingURL=TimeUtils.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../../_virtual/_tslib.js';\nimport { CredentialEntity } from './CredentialEntity.js';\nimport { CredentialType, AuthenticationScheme } from '../../utils/Constants.js';\nimport { TimeUtils } from '../../utils/TimeUtils.js';\nimport { StringUtils } from '../../utils/StringUtils.js';\nimport { AuthToken } from '../../account/AuthToken.js';\nimport { ClientAuthError } from '../../error/ClientAuthError.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 * ACCESS_TOKEN Credential Type\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key Example: uid.utid-login.microsoftonline.com-accesstoken-clientId-contoso.com-user.read\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, usually only used for refresh tokens\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * cachedAt: Absolute device time when entry was created in the cache.\r\n * expiresOn: Token expiry time, calculated based on current UTC time in seconds. Represented as a string.\r\n * extendedExpiresOn: Additional extended expiry time until when token is valid in case of server-side outage. Represented as string in UTC seconds.\r\n * keyId: used for POP and SSH tokenTypes\r\n * tokenType: Type of the token issued. Usually \"Bearer\"\r\n * }\r\n */\r\nvar AccessTokenEntity = /** @class */ (function (_super) {\r\n __extends(AccessTokenEntity, _super);\r\n function AccessTokenEntity() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Create AccessTokenEntity\r\n * @param homeAccountId\r\n * @param environment\r\n * @param accessToken\r\n * @param clientId\r\n * @param tenantId\r\n * @param scopes\r\n * @param expiresOn\r\n * @param extExpiresOn\r\n */\r\n AccessTokenEntity.createAccessTokenEntity = function (homeAccountId, environment, accessToken, clientId, tenantId, scopes, expiresOn, extExpiresOn, cryptoUtils, refreshOn, tokenType, userAssertionHash, keyId, requestedClaims, requestedClaimsHash) {\r\n var _a, _b;\r\n var atEntity = new AccessTokenEntity();\r\n atEntity.homeAccountId = homeAccountId;\r\n atEntity.credentialType = CredentialType.ACCESS_TOKEN;\r\n atEntity.secret = accessToken;\r\n var currentTime = TimeUtils.nowSeconds();\r\n atEntity.cachedAt = currentTime.toString();\r\n /*\r\n * Token expiry time.\r\n * This value should be  calculated based on the current UTC time measured locally and the value  expires_in Represented as a string in JSON.\r\n */\r\n atEntity.expiresOn = expiresOn.toString();\r\n atEntity.extendedExpiresOn = extExpiresOn.toString();\r\n if (refreshOn) {\r\n atEntity.refreshOn = refreshOn.toString();\r\n }\r\n atEntity.environment = environment;\r\n atEntity.clientId = clientId;\r\n atEntity.realm = tenantId;\r\n atEntity.target = scopes;\r\n atEntity.userAssertionHash = userAssertionHash;\r\n atEntity.tokenType = StringUtils.isEmpty(tokenType) ? AuthenticationScheme.BEARER : tokenType;\r\n if (requestedClaims) {\r\n atEntity.requestedClaims = requestedClaims;\r\n atEntity.requestedClaimsHash = requestedClaimsHash;\r\n }\r\n /*\r\n * Create Access Token With Auth Scheme instead of regular access token\r\n * Cast to lower to handle \"bearer\" from ADFS\r\n */\r\n if (((_a = atEntity.tokenType) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== AuthenticationScheme.BEARER.toLowerCase()) {\r\n atEntity.credentialType = CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\r\n switch (atEntity.tokenType) {\r\n case AuthenticationScheme.POP:\r\n // Make sure keyId is present and add it to credential\r\n var tokenClaims = AuthToken.extractTokenClaims(accessToken, cryptoUtils);\r\n if (!((_b = tokenClaims === null || tokenClaims === void 0 ? void 0 : tokenClaims.cnf) === null || _b === void 0 ? void 0 : _b.kid)) {\r\n throw ClientAuthError.createTokenClaimsRequiredError();\r\n }\r\n atEntity.keyId = tokenClaims.cnf.kid;\r\n break;\r\n case AuthenticationScheme.SSH:\r\n atEntity.keyId = keyId;\r\n }\r\n }\r\n return atEntity;\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n AccessTokenEntity.isAccessTokenEntity = function (entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\") &&\r\n entity.hasOwnProperty(\"target\") &&\r\n (entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN || entity[\"credentialType\"] === CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME));\r\n };\r\n return AccessTokenEntity;\r\n}(CredentialEntity));\n\nexport { AccessTokenEntity };\n//# sourceMappingURL=AccessTokenEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../../_virtual/_tslib.js';\nimport { CredentialEntity } from './CredentialEntity.js';\nimport { CredentialType } from '../../utils/Constants.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 * REFRESH_TOKEN Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\r\n *\r\n * Value:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, '1' represents Microsoft Family\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * }\r\n */\r\nvar RefreshTokenEntity = /** @class */ (function (_super) {\r\n __extends(RefreshTokenEntity, _super);\r\n function RefreshTokenEntity() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Create RefreshTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\n RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, userAssertionHash) {\r\n var rtEntity = new RefreshTokenEntity();\r\n rtEntity.clientId = clientId;\r\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\r\n rtEntity.environment = environment;\r\n rtEntity.homeAccountId = homeAccountId;\r\n rtEntity.secret = refreshToken;\r\n rtEntity.userAssertionHash = userAssertionHash;\r\n if (familyId)\r\n rtEntity.familyId = familyId;\r\n return rtEntity;\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n RefreshTokenEntity.isRefreshTokenEntity = function (entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\") &&\r\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN);\r\n };\r\n return RefreshTokenEntity;\r\n}(CredentialEntity));\n\nexport { RefreshTokenEntity };\n//# sourceMappingURL=RefreshTokenEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { Constants } from '../utils/Constants.js';\nimport { AuthError } from './AuthError.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 * InteractionRequiredServerErrorMessage contains string constants used by error codes and messages returned by the server indicating interaction is required\r\n */\r\nvar InteractionRequiredServerErrorMessage = [\r\n \"interaction_required\",\r\n \"consent_required\",\r\n \"login_required\"\r\n];\r\nvar InteractionRequiredAuthSubErrorMessage = [\r\n \"message_only\",\r\n \"additional_action\",\r\n \"basic_action\",\r\n \"user_password_expired\",\r\n \"consent_required\"\r\n];\r\n/**\r\n * Interaction required errors defined by the SDK\r\n */\r\nvar InteractionRequiredAuthErrorMessage = {\r\n noTokensFoundError: {\r\n code: \"no_tokens_found\",\r\n desc: \"No refresh token found in the cache. Please sign-in.\"\r\n },\r\n native_account_unavailable: {\r\n code: \"native_account_unavailable\",\r\n desc: \"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.\"\r\n }\r\n};\r\n/**\r\n * Error thrown when user interaction is required.\r\n */\r\nvar InteractionRequiredAuthError = /** @class */ (function (_super) {\r\n __extends(InteractionRequiredAuthError, _super);\r\n function InteractionRequiredAuthError(errorCode, errorMessage, subError, timestamp, traceId, correlationId, claims) {\r\n var _this = _super.call(this, errorCode, errorMessage, subError) || this;\r\n Object.setPrototypeOf(_this, InteractionRequiredAuthError.prototype);\r\n _this.timestamp = timestamp || Constants.EMPTY_STRING;\r\n _this.traceId = traceId || Constants.EMPTY_STRING;\r\n _this.correlationId = correlationId || Constants.EMPTY_STRING;\r\n _this.claims = claims || Constants.EMPTY_STRING;\r\n _this.name = \"InteractionRequiredAuthError\";\r\n return _this;\r\n }\r\n /**\r\n * Helper function used to determine if an error thrown by the server requires interaction to resolve\r\n * @param errorCode\r\n * @param errorString\r\n * @param subError\r\n */\r\n InteractionRequiredAuthError.isInteractionRequiredError = function (errorCode, errorString, subError) {\r\n var isInteractionRequiredErrorCode = !!errorCode && InteractionRequiredServerErrorMessage.indexOf(errorCode) > -1;\r\n var isInteractionRequiredSubError = !!subError && InteractionRequiredAuthSubErrorMessage.indexOf(subError) > -1;\r\n var isInteractionRequiredErrorDesc = !!errorString && InteractionRequiredServerErrorMessage.some(function (irErrorCode) {\r\n return errorString.indexOf(irErrorCode) > -1;\r\n });\r\n return isInteractionRequiredErrorCode || isInteractionRequiredErrorDesc || isInteractionRequiredSubError;\r\n };\r\n /**\r\n * Creates an error thrown when the authorization code required for a token request is null or empty.\r\n */\r\n InteractionRequiredAuthError.createNoTokensFoundError = function () {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.noTokensFoundError.code, InteractionRequiredAuthErrorMessage.noTokensFoundError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the native broker returns ACCOUNT_UNAVAILABLE status, indicating that the account was removed and interactive sign-in is required\r\n * @returns\r\n */\r\n InteractionRequiredAuthError.createNativeAccountUnavailableError = function () {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.native_account_unavailable.code, InteractionRequiredAuthErrorMessage.native_account_unavailable.desc);\r\n };\r\n return InteractionRequiredAuthError;\r\n}(AuthError));\n\nexport { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage, InteractionRequiredAuthSubErrorMessage, InteractionRequiredServerErrorMessage };\n//# sourceMappingURL=InteractionRequiredAuthError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar CacheRecord = /** @class */ (function () {\r\n function CacheRecord(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {\r\n this.account = accountEntity || null;\r\n this.idToken = idTokenEntity || null;\r\n this.accessToken = accessTokenEntity || null;\r\n this.refreshToken = refreshTokenEntity || null;\r\n this.appMetadata = appMetadataEntity || null;\r\n }\r\n return CacheRecord;\r\n}());\n\nexport { CacheRecord };\n//# sourceMappingURL=CacheRecord.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { StringUtils } from './StringUtils.js';\nimport { Constants } from './Constants.js';\nimport { ClientAuthError } from '../error/ClientAuthError.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 * Class which provides helpers for OAuth 2.0 protocol specific values\r\n */\r\nvar ProtocolUtils = /** @class */ (function () {\r\n function ProtocolUtils() {\r\n }\r\n /**\r\n * Appends user state with random guid, or returns random guid.\r\n * @param userState\r\n * @param randomGuid\r\n */\r\n ProtocolUtils.setRequestState = function (cryptoObj, userState, meta) {\r\n var libraryState = ProtocolUtils.generateLibraryState(cryptoObj, meta);\r\n return !StringUtils.isEmpty(userState) ? \"\" + libraryState + Constants.RESOURCE_DELIM + userState : libraryState;\r\n };\r\n /**\r\n * Generates the state value used by the common library.\r\n * @param randomGuid\r\n * @param cryptoObj\r\n */\r\n ProtocolUtils.generateLibraryState = function (cryptoObj, meta) {\r\n if (!cryptoObj) {\r\n throw ClientAuthError.createNoCryptoObjectError(\"generateLibraryState\");\r\n }\r\n // Create a state object containing a unique id and the timestamp of the request creation\r\n var stateObj = {\r\n id: cryptoObj.createNewGuid()\r\n };\r\n if (meta) {\r\n stateObj.meta = meta;\r\n }\r\n var stateString = JSON.stringify(stateObj);\r\n return cryptoObj.base64Encode(stateString);\r\n };\r\n /**\r\n * Parses the state into the RequestStateObject, which contains the LibraryState info and the state passed by the user.\r\n * @param state\r\n * @param cryptoObj\r\n */\r\n ProtocolUtils.parseRequestState = function (cryptoObj, state) {\r\n if (!cryptoObj) {\r\n throw ClientAuthError.createNoCryptoObjectError(\"parseRequestState\");\r\n }\r\n if (StringUtils.isEmpty(state)) {\r\n throw ClientAuthError.createInvalidStateError(state, \"Null, undefined or empty state\");\r\n }\r\n try {\r\n // Split the state between library state and user passed state and decode them separately\r\n var splitState = state.split(Constants.RESOURCE_DELIM);\r\n var libraryState = splitState[0];\r\n var userState = splitState.length > 1 ? splitState.slice(1).join(Constants.RESOURCE_DELIM) : Constants.EMPTY_STRING;\r\n var libraryStateString = cryptoObj.base64Decode(libraryState);\r\n var libraryStateObj = JSON.parse(libraryStateString);\r\n return {\r\n userRequestState: !StringUtils.isEmpty(userState) ? userState : Constants.EMPTY_STRING,\r\n libraryState: libraryStateObj\r\n };\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createInvalidStateError(state, e);\r\n }\r\n };\r\n return ProtocolUtils;\r\n}());\n\nexport { ProtocolUtils };\n//# sourceMappingURL=ProtocolUtils.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { AADAuthorityConstants, Constants } from '../utils/Constants.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 * Url object class which can perform various transformations on url strings.\r\n */\r\nvar UrlString = /** @class */ (function () {\r\n function UrlString(url) {\r\n this._urlString = url;\r\n if (StringUtils.isEmpty(this._urlString)) {\r\n // Throws error if url is empty\r\n throw ClientConfigurationError.createUrlEmptyError();\r\n }\r\n if (StringUtils.isEmpty(this.getHash())) {\r\n this._urlString = UrlString.canonicalizeUri(url);\r\n }\r\n }\r\n Object.defineProperty(UrlString.prototype, \"urlString\", {\r\n get: function () {\r\n return this._urlString;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Ensure urls are lower case and end with a / character.\r\n * @param url\r\n */\r\n UrlString.canonicalizeUri = function (url) {\r\n if (url) {\r\n var lowerCaseUrl = url.toLowerCase();\r\n if (StringUtils.endsWith(lowerCaseUrl, \"?\")) {\r\n lowerCaseUrl = lowerCaseUrl.slice(0, -1);\r\n }\r\n else if (StringUtils.endsWith(lowerCaseUrl, \"?/\")) {\r\n lowerCaseUrl = lowerCaseUrl.slice(0, -2);\r\n }\r\n if (!StringUtils.endsWith(lowerCaseUrl, \"/\")) {\r\n lowerCaseUrl += \"/\";\r\n }\r\n return lowerCaseUrl;\r\n }\r\n return url;\r\n };\r\n /**\r\n * Throws if urlString passed is not a valid authority URI string.\r\n */\r\n UrlString.prototype.validateAsUri = function () {\r\n // Attempts to parse url for uri components\r\n var components;\r\n try {\r\n components = this.getUrlComponents();\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createUrlParseError(e);\r\n }\r\n // Throw error if URI or path segments are not parseable.\r\n if (!components.HostNameAndPort || !components.PathSegments) {\r\n throw ClientConfigurationError.createUrlParseError(\"Given url string: \" + this.urlString);\r\n }\r\n // Throw error if uri is insecure.\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ClientConfigurationError.createInsecureAuthorityUriError(this.urlString);\r\n }\r\n };\r\n /**\r\n * Given a url and a query string return the url with provided query string appended\r\n * @param url\r\n * @param queryString\r\n */\r\n UrlString.appendQueryString = function (url, queryString) {\r\n if (StringUtils.isEmpty(queryString)) {\r\n return url;\r\n }\r\n return url.indexOf(\"?\") < 0 ? url + \"?\" + queryString : url + \"&\" + queryString;\r\n };\r\n /**\r\n * Returns a url with the hash removed\r\n * @param url\r\n */\r\n UrlString.removeHashFromUrl = function (url) {\r\n return UrlString.canonicalizeUri(url.split(\"#\")[0]);\r\n };\r\n /**\r\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\r\n * @param href The url\r\n * @param tenantId The tenant id to replace\r\n */\r\n UrlString.prototype.replaceTenantPath = function (tenantId) {\r\n var urlObject = this.getUrlComponents();\r\n var pathArray = urlObject.PathSegments;\r\n if (tenantId && (pathArray.length !== 0 && (pathArray[0] === AADAuthorityConstants.COMMON || pathArray[0] === AADAuthorityConstants.ORGANIZATIONS))) {\r\n pathArray[0] = tenantId;\r\n }\r\n return UrlString.constructAuthorityUriFromObject(urlObject);\r\n };\r\n /**\r\n * Returns the anchor part(#) of the URL\r\n */\r\n UrlString.prototype.getHash = function () {\r\n return UrlString.parseHash(this.urlString);\r\n };\r\n /**\r\n * Parses out the components from a url string.\r\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\r\n */\r\n UrlString.prototype.getUrlComponents = function () {\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n // If url string does not match regEx, we throw an error\r\n var match = this.urlString.match(regEx);\r\n if (!match) {\r\n throw ClientConfigurationError.createUrlParseError(\"Given url string: \" + this.urlString);\r\n }\r\n // Url component object\r\n var urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5],\r\n QueryString: match[7]\r\n };\r\n var pathSegments = urlComponents.AbsolutePath.split(\"/\");\r\n pathSegments = pathSegments.filter(function (val) { return val && val.length > 0; }); // remove empty elements\r\n urlComponents.PathSegments = pathSegments;\r\n if (!StringUtils.isEmpty(urlComponents.QueryString) && urlComponents.QueryString.endsWith(\"/\")) {\r\n urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length - 1);\r\n }\r\n return urlComponents;\r\n };\r\n UrlString.getDomainFromUrl = function (url) {\r\n var regEx = RegExp(\"^([^:/?#]+://)?([^/?#]*)\");\r\n var match = url.match(regEx);\r\n if (!match) {\r\n throw ClientConfigurationError.createUrlParseError(\"Given url string: \" + url);\r\n }\r\n return match[2];\r\n };\r\n UrlString.getAbsoluteUrl = function (relativeUrl, baseUrl) {\r\n if (relativeUrl[0] === Constants.FORWARD_SLASH) {\r\n var url = new UrlString(baseUrl);\r\n var baseComponents = url.getUrlComponents();\r\n return baseComponents.Protocol + \"//\" + baseComponents.HostNameAndPort + relativeUrl;\r\n }\r\n return relativeUrl;\r\n };\r\n /**\r\n * Parses hash string from given string. Returns empty string if no hash symbol is found.\r\n * @param hashString\r\n */\r\n UrlString.parseHash = function (hashString) {\r\n var hashIndex1 = hashString.indexOf(\"#\");\r\n var hashIndex2 = hashString.indexOf(\"#/\");\r\n if (hashIndex2 > -1) {\r\n return hashString.substring(hashIndex2 + 2);\r\n }\r\n else if (hashIndex1 > -1) {\r\n return hashString.substring(hashIndex1 + 1);\r\n }\r\n return Constants.EMPTY_STRING;\r\n };\r\n /**\r\n * Parses query string from given string. Returns empty string if no query symbol is found.\r\n * @param queryString\r\n */\r\n UrlString.parseQueryString = function (queryString) {\r\n var queryIndex1 = queryString.indexOf(\"?\");\r\n var queryIndex2 = queryString.indexOf(\"/?\");\r\n if (queryIndex2 > -1) {\r\n return queryString.substring(queryIndex2 + 2);\r\n }\r\n else if (queryIndex1 > -1) {\r\n return queryString.substring(queryIndex1 + 1);\r\n }\r\n return Constants.EMPTY_STRING;\r\n };\r\n UrlString.constructAuthorityUriFromObject = function (urlObject) {\r\n return new UrlString(urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + urlObject.PathSegments.join(\"/\"));\r\n };\r\n /**\r\n * Returns URL hash as server auth code response object.\r\n */\r\n UrlString.getDeserializedHash = function (hash) {\r\n // Check if given hash is empty\r\n if (StringUtils.isEmpty(hash)) {\r\n return {};\r\n }\r\n // Strip the # symbol if present\r\n var parsedHash = UrlString.parseHash(hash);\r\n // If # symbol was not present, above will return empty string, so give original hash value\r\n var deserializedHash = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedHash) ? hash : parsedHash);\r\n // Check if deserialization didn't work\r\n if (!deserializedHash) {\r\n throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedHash));\r\n }\r\n return deserializedHash;\r\n };\r\n /**\r\n * Returns URL query string as server auth code response object.\r\n */\r\n UrlString.getDeserializedQueryString = function (query) {\r\n // Check if given query is empty\r\n if (StringUtils.isEmpty(query)) {\r\n return {};\r\n }\r\n // Strip the ? symbol if present\r\n var parsedQueryString = UrlString.parseQueryString(query);\r\n // If ? symbol was not present, above will return empty string, so give original query value\r\n var deserializedQueryString = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedQueryString) ? query : parsedQueryString);\r\n // Check if deserialization didn't work\r\n if (!deserializedQueryString) {\r\n throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedQueryString));\r\n }\r\n return deserializedQueryString;\r\n };\r\n /**\r\n * Check if the hash of the URL string contains known properties\r\n */\r\n UrlString.hashContainsKnownProperties = function (hash) {\r\n if (StringUtils.isEmpty(hash) || hash.indexOf(\"=\") < 0) {\r\n // Hash doesn't contain key/value pairs\r\n return false;\r\n }\r\n var parameters = UrlString.getDeserializedHash(hash);\r\n return !!(parameters.code ||\r\n parameters.error_description ||\r\n parameters.error ||\r\n parameters.state);\r\n };\r\n return UrlString;\r\n}());\n\nexport { UrlString };\n//# sourceMappingURL=UrlString.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Enumeration of operations that are instrumented by have their performance measured by the PerformanceClient.\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nvar PerformanceEvents;\r\n(function (PerformanceEvents) {\r\n /**\r\n * acquireTokenByCode API (msal-browser and msal-node).\r\n * Used to acquire tokens by trading an authorization code against the token endpoint.\r\n */\r\n PerformanceEvents[\"AcquireTokenByCode\"] = \"acquireTokenByCode\";\r\n /**\r\n * acquireTokenByRefreshToken API (msal-browser and msal-node).\r\n * Used to renew an access token using a refresh token against the token endpoint.\r\n */\r\n PerformanceEvents[\"AcquireTokenByRefreshToken\"] = \"acquireTokenByRefreshToken\";\r\n /**\r\n * acquireTokenSilent API (msal-browser and msal-node).\r\n * Used to silently acquire a new access token (from the cache or the network).\r\n */\r\n PerformanceEvents[\"AcquireTokenSilent\"] = \"acquireTokenSilent\";\r\n /**\r\n * acquireTokenSilentAsync (msal-browser).\r\n * Internal API for acquireTokenSilent.\r\n */\r\n PerformanceEvents[\"AcquireTokenSilentAsync\"] = \"acquireTokenSilentAsync\";\r\n /**\r\n * acquireTokenPopup (msal-browser).\r\n * Used to acquire a new access token interactively through pop ups\r\n */\r\n PerformanceEvents[\"AcquireTokenPopup\"] = \"acquireTokenPopup\";\r\n /**\r\n * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).\r\n * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.\r\n */\r\n PerformanceEvents[\"CryptoOptsGetPublicKeyThumbprint\"] = \"cryptoOptsGetPublicKeyThumbprint\";\r\n /**\r\n * signJwt API in CryptoOpts class (msal-browser).\r\n * Used to signed a pop token.\r\n */\r\n PerformanceEvents[\"CryptoOptsSignJwt\"] = \"cryptoOptsSignJwt\";\r\n /**\r\n * acquireToken API in the SilentCacheClient class (msal-browser).\r\n * Used to read access tokens from the cache.\r\n */\r\n PerformanceEvents[\"SilentCacheClientAcquireToken\"] = \"silentCacheClientAcquireToken\";\r\n /**\r\n * acquireToken API in the SilentIframeClient class (msal-browser).\r\n * Used to acquire a new set of tokens from the authorize endpoint in a hidden iframe.\r\n */\r\n PerformanceEvents[\"SilentIframeClientAcquireToken\"] = \"silentIframeClientAcquireToken\";\r\n /**\r\n * acquireToken API in SilentRereshClient (msal-browser).\r\n * Used to acquire a new set of tokens from the token endpoint using a refresh token.\r\n */\r\n PerformanceEvents[\"SilentRefreshClientAcquireToken\"] = \"silentRefreshClientAcquireToken\";\r\n /**\r\n * ssoSilent API (msal-browser).\r\n * Used to silently acquire an authorization code and set of tokens using a hidden iframe.\r\n */\r\n PerformanceEvents[\"SsoSilent\"] = \"ssoSilent\";\r\n /**\r\n * getDiscoveredAuthority API in StandardInteractionClient class (msal-browser).\r\n * Used to load authority metadata for a request.\r\n */\r\n PerformanceEvents[\"StandardInteractionClientGetDiscoveredAuthority\"] = \"standardInteractionClientGetDiscoveredAuthority\";\r\n /**\r\n * acquireToken APIs in msal-browser.\r\n * Used to make an /authorize endpoint call with native brokering enabled.\r\n */\r\n PerformanceEvents[\"FetchAccountIdWithNativeBroker\"] = \"fetchAccountIdWithNativeBroker\";\r\n /**\r\n * acquireToken API in NativeInteractionClient class (msal-browser).\r\n * Used to acquire a token from Native component when native brokering is enabled.\r\n */\r\n PerformanceEvents[\"NativeInteractionClientAcquireToken\"] = \"nativeInteractionClientAcquireToken\";\r\n /**\r\n * Time spent creating default headers for requests to token endpoint\r\n */\r\n PerformanceEvents[\"BaseClientCreateTokenRequestHeaders\"] = \"baseClientCreateTokenRequestHeaders\";\r\n /**\r\n * Used to measure the time taken for completing embedded-broker handshake (PW-Broker).\r\n */\r\n PerformanceEvents[\"BrokerHandhshake\"] = \"brokerHandshake\";\r\n /**\r\n * acquireTokenByRefreshToken API in BrokerClientApplication (PW-Broker) .\r\n */\r\n PerformanceEvents[\"AcquireTokenByRefreshTokenInBroker\"] = \"acquireTokenByRefreshTokenInBroker\";\r\n /**\r\n * Time taken for token acquisition by broker\r\n */\r\n PerformanceEvents[\"AcquireTokenByBroker\"] = \"acquireTokenByBroker\";\r\n /**\r\n * Time spent on the network for refresh token acquisition\r\n */\r\n PerformanceEvents[\"RefreshTokenClientExecuteTokenRequest\"] = \"refreshTokenClientExecuteTokenRequest\";\r\n /**\r\n * Time taken for acquiring refresh token , records RT size\r\n */\r\n PerformanceEvents[\"RefreshTokenClientAcquireToken\"] = \"refreshTokenClientAcquireToken\";\r\n /**\r\n * Time taken for acquiring cached refresh token\r\n */\r\n PerformanceEvents[\"RefreshTokenClientAcquireTokenWithCachedRefreshToken\"] = \"refreshTokenClientAcquireTokenWithCachedRefreshToken\";\r\n /**\r\n * acquireTokenByRefreshToken API in RefreshTokenClient (msal-common).\r\n */\r\n PerformanceEvents[\"RefreshTokenClientAcquireTokenByRefreshToken\"] = \"refreshTokenClientAcquireTokenByRefreshToken\";\r\n /**\r\n * Helper function to create token request body in RefreshTokenClient (msal-common).\r\n */\r\n PerformanceEvents[\"RefreshTokenClientCreateTokenRequestBody\"] = \"refreshTokenClientCreateTokenRequestBody\";\r\n /**\r\n * acquireTokenFromCache (msal-browser).\r\n * Internal API for acquiring token from cache\r\n */\r\n PerformanceEvents[\"AcquireTokenFromCache\"] = \"acquireTokenFromCache\";\r\n /**\r\n * acquireTokenBySilentIframe (msal-browser).\r\n * Internal API for acquiring token by silent Iframe\r\n */\r\n PerformanceEvents[\"AcquireTokenBySilentIframe\"] = \"acquireTokenBySilentIframe\";\r\n /**\r\n * Internal API for initializing base request in BaseInteractionClient (msal-browser)\r\n */\r\n PerformanceEvents[\"InitializeBaseRequest\"] = \"initializeBaseRequest\";\r\n /**\r\n * Internal API for initializing silent request in SilentCacheClient (msal-browser)\r\n */\r\n PerformanceEvents[\"InitializeSilentRequest\"] = \"initializeSilentRequest\";\r\n PerformanceEvents[\"InitializeClientApplication\"] = \"initializeClientApplication\";\r\n /**\r\n * Helper function in SilentIframeClient class (msal-browser).\r\n */\r\n PerformanceEvents[\"SilentIframeClientTokenHelper\"] = \"silentIframeClientTokenHelper\";\r\n /**\r\n * SilentHandler\r\n */\r\n PerformanceEvents[\"SilentHandlerInitiateAuthRequest\"] = \"silentHandlerInitiateAuthRequest\";\r\n PerformanceEvents[\"SilentHandlerMonitorIframeForHash\"] = \"silentHandlerMonitorIframeForHash\";\r\n PerformanceEvents[\"SilentHandlerLoadFrame\"] = \"silentHandlerLoadFrame\";\r\n /**\r\n * Helper functions in StandardInteractionClient class (msal-browser)\r\n */\r\n PerformanceEvents[\"StandardInteractionClientCreateAuthCodeClient\"] = \"standardInteractionClientCreateAuthCodeClient\";\r\n PerformanceEvents[\"StandardInteractionClientGetClientConfiguration\"] = \"standardInteractionClientGetClientConfiguration\";\r\n PerformanceEvents[\"StandardInteractionClientInitializeAuthorizationRequest\"] = \"standardInteractionClientInitializeAuthorizationRequest\";\r\n PerformanceEvents[\"StandardInteractionClientInitializeAuthorizationCodeRequest\"] = \"standardInteractionClientInitializeAuthorizationCodeRequest\";\r\n /**\r\n * getAuthCodeUrl API (msal-browser and msal-node).\r\n */\r\n PerformanceEvents[\"GetAuthCodeUrl\"] = \"getAuthCodeUrl\";\r\n /**\r\n * Functions from InteractionHandler (msal-browser)\r\n */\r\n PerformanceEvents[\"HandleCodeResponseFromServer\"] = \"handleCodeResponseFromServer\";\r\n PerformanceEvents[\"HandleCodeResponseFromHash\"] = \"handleCodeResponseFromHash\";\r\n PerformanceEvents[\"UpdateTokenEndpointAuthority\"] = \"updateTokenEndpointAuthority\";\r\n /**\r\n * APIs in Authorization Code Client (msal-common)\r\n */\r\n PerformanceEvents[\"AuthClientAcquireToken\"] = \"authClientAcquireToken\";\r\n PerformanceEvents[\"AuthClientExecuteTokenRequest\"] = \"authClientExecuteTokenRequest\";\r\n PerformanceEvents[\"AuthClientCreateTokenRequestBody\"] = \"authClientCreateTokenRequestBody\";\r\n PerformanceEvents[\"AuthClientCreateQueryString\"] = \"authClientCreateQueryString\";\r\n /**\r\n * Generate functions in PopTokenGenerator (msal-common)\r\n */\r\n PerformanceEvents[\"PopTokenGenerateCnf\"] = \"popTokenGenerateCnf\";\r\n PerformanceEvents[\"PopTokenGenerateKid\"] = \"popTokenGenerateKid\";\r\n /**\r\n * handleServerTokenResponse API in ResponseHandler (msal-common)\r\n */\r\n PerformanceEvents[\"HandleServerTokenResponse\"] = \"handleServerTokenResponse\";\r\n /**\r\n * Authority functions\r\n */\r\n PerformanceEvents[\"AuthorityFactoryCreateDiscoveredInstance\"] = \"authorityFactoryCreateDiscoveredInstance\";\r\n PerformanceEvents[\"AuthorityResolveEndpointsAsync\"] = \"authorityResolveEndpointsAsync\";\r\n PerformanceEvents[\"AuthorityGetCloudDiscoveryMetadataFromNetwork\"] = \"authorityGetCloudDiscoveryMetadataFromNetwork\";\r\n PerformanceEvents[\"AuthorityUpdateCloudDiscoveryMetadata\"] = \"authorityUpdateCloudDiscoveryMetadata\";\r\n PerformanceEvents[\"AuthorityGetEndpointMetadataFromNetwork\"] = \"authorityGetEndpointMetadataFromNetwork\";\r\n PerformanceEvents[\"AuthorityUpdateEndpointMetadata\"] = \"authorityUpdateEndpointMetadata\";\r\n PerformanceEvents[\"AuthorityUpdateMetadataWithRegionalInformation\"] = \"authorityUpdateMetadataWithRegionalInformation\";\r\n /**\r\n * Region Discovery functions\r\n */\r\n PerformanceEvents[\"RegionDiscoveryDetectRegion\"] = \"regionDiscoveryDetectRegion\";\r\n PerformanceEvents[\"RegionDiscoveryGetRegionFromIMDS\"] = \"regionDiscoveryGetRegionFromIMDS\";\r\n PerformanceEvents[\"RegionDiscoveryGetCurrentVersion\"] = \"regionDiscoveryGetCurrentVersion\";\r\n PerformanceEvents[\"AcquireTokenByCodeAsync\"] = \"acquireTokenByCodeAsync\";\r\n PerformanceEvents[\"GetEndpointMetadataFromNetwork\"] = \"getEndpointMetadataFromNetwork\";\r\n PerformanceEvents[\"GetCloudDiscoveryMetadataFromNetworkMeasurement\"] = \"getCloudDiscoveryMetadataFromNetworkMeasurement\";\r\n PerformanceEvents[\"HandleRedirectPromiseMeasurement\"] = \"handleRedirectPromiseMeasurement\";\r\n PerformanceEvents[\"UpdateCloudDiscoveryMetadataMeasurement\"] = \"updateCloudDiscoveryMetadataMeasurement\";\r\n PerformanceEvents[\"UsernamePasswordClientAcquireToken\"] = \"usernamePasswordClientAcquireToken\";\r\n PerformanceEvents[\"NativeMessageHandlerHandshake\"] = \"nativeMessageHandlerHandshake\";\r\n})(PerformanceEvents || (PerformanceEvents = {}));\r\n/**\r\n * State of the performance event.\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nvar PerformanceEventStatus;\r\n(function (PerformanceEventStatus) {\r\n PerformanceEventStatus[PerformanceEventStatus[\"NotStarted\"] = 0] = \"NotStarted\";\r\n PerformanceEventStatus[PerformanceEventStatus[\"InProgress\"] = 1] = \"InProgress\";\r\n PerformanceEventStatus[PerformanceEventStatus[\"Completed\"] = 2] = \"Completed\";\r\n})(PerformanceEventStatus || (PerformanceEventStatus = {}));\r\nvar IntFields = new Set([\r\n \"accessTokenSize\",\r\n \"durationMs\",\r\n \"idTokenSize\",\r\n \"matsSilentStatus\",\r\n \"matsHttpStatus\",\r\n \"refreshTokenSize\",\r\n \"queuedTimeMs\",\r\n \"startTimeMs\",\r\n \"status\",\r\n]);\n\nexport { IntFields, PerformanceEventStatus, PerformanceEvents };\n//# sourceMappingURL=PerformanceEvent.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { TimeUtils } from '../utils/TimeUtils.js';\nimport { UrlString } from '../url/UrlString.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar KeyLocation;\r\n(function (KeyLocation) {\r\n KeyLocation[\"SW\"] = \"sw\";\r\n KeyLocation[\"UHW\"] = \"uhw\";\r\n})(KeyLocation || (KeyLocation = {}));\r\nvar PopTokenGenerator = /** @class */ (function () {\r\n function PopTokenGenerator(cryptoUtils, performanceClient) {\r\n this.cryptoUtils = cryptoUtils;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Generates the req_cnf validated at the RP in the POP protocol for SHR parameters\r\n * and returns an object containing the keyid, the full req_cnf string and the req_cnf string hash\r\n * @param request\r\n * @returns\r\n */\r\n PopTokenGenerator.prototype.generateCnf = function (request) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var reqCnf, reqCnfString, _c;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.PopTokenGenerateKid, request.correlationId);\r\n return [4 /*yield*/, this.generateKid(request)];\r\n case 1:\r\n reqCnf = _d.sent();\r\n reqCnfString = this.cryptoUtils.base64Encode(JSON.stringify(reqCnf));\r\n _c = {\r\n kid: reqCnf.kid,\r\n reqCnfString: reqCnfString\r\n };\r\n return [4 /*yield*/, this.cryptoUtils.hashString(reqCnfString)];\r\n case 2: return [2 /*return*/, (_c.reqCnfHash = _d.sent(),\r\n _c)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Generates key_id for a SHR token request\r\n * @param request\r\n * @returns\r\n */\r\n PopTokenGenerator.prototype.generateKid = function (request) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var kidThumbprint;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.PopTokenGenerateKid, request.correlationId);\r\n return [4 /*yield*/, this.cryptoUtils.getPublicKeyThumbprint(request)];\r\n case 1:\r\n kidThumbprint = _b.sent();\r\n return [2 /*return*/, {\r\n kid: kidThumbprint,\r\n xms_ksl: KeyLocation.SW\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Signs the POP access_token with the local generated key-pair\r\n * @param accessToken\r\n * @param request\r\n * @returns\r\n */\r\n PopTokenGenerator.prototype.signPopToken = function (accessToken, keyId, request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.signPayload(accessToken, keyId, request)];\r\n });\r\n });\r\n };\r\n /**\r\n * Utility function to generate the signed JWT for an access_token\r\n * @param payload\r\n * @param kid\r\n * @param request\r\n * @param claims\r\n * @returns\r\n */\r\n PopTokenGenerator.prototype.signPayload = function (payload, keyId, request, claims) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var resourceRequestMethod, resourceRequestUri, shrClaims, shrNonce, resourceUrlString, resourceUrlComponents;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n resourceRequestMethod = request.resourceRequestMethod, resourceRequestUri = request.resourceRequestUri, shrClaims = request.shrClaims, shrNonce = request.shrNonce;\r\n resourceUrlString = (resourceRequestUri) ? new UrlString(resourceRequestUri) : undefined;\r\n resourceUrlComponents = resourceUrlString === null || resourceUrlString === void 0 ? void 0 : resourceUrlString.getUrlComponents();\r\n return [4 /*yield*/, this.cryptoUtils.signJwt(__assign({ at: payload, ts: TimeUtils.nowSeconds(), m: resourceRequestMethod === null || resourceRequestMethod === void 0 ? void 0 : resourceRequestMethod.toUpperCase(), u: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.HostNameAndPort, nonce: shrNonce || this.cryptoUtils.createNewGuid(), p: resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.AbsolutePath, q: (resourceUrlComponents === null || resourceUrlComponents === void 0 ? void 0 : resourceUrlComponents.QueryString) ? [[], resourceUrlComponents.QueryString] : undefined, client_claims: shrClaims || undefined }, claims), keyId, request.correlationId)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n return PopTokenGenerator;\r\n}());\n\nexport { PopTokenGenerator };\n//# sourceMappingURL=PopTokenGenerator.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { Separators, APP_METADATA } from '../../utils/Constants.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 * APP_METADATA Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key: appmetadata--\r\n *\r\n * Value:\r\n * {\r\n * clientId: client ID of the application\r\n * environment: entity that issued the token, represented as a full host\r\n * familyId: Family ID identifier, '1' represents Microsoft Family\r\n * }\r\n */\r\nvar AppMetadataEntity = /** @class */ (function () {\r\n function AppMetadataEntity() {\r\n }\r\n /**\r\n * Generate AppMetadata Cache Key as per the schema: appmetadata--\r\n */\r\n AppMetadataEntity.prototype.generateAppMetadataKey = function () {\r\n return AppMetadataEntity.generateAppMetadataCacheKey(this.environment, this.clientId);\r\n };\r\n /**\r\n * Generate AppMetadata Cache Key\r\n */\r\n AppMetadataEntity.generateAppMetadataCacheKey = function (environment, clientId) {\r\n var appMetaDataKeyArray = [\r\n APP_METADATA,\r\n environment,\r\n clientId,\r\n ];\r\n return appMetaDataKeyArray.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n };\r\n /**\r\n * Creates AppMetadataEntity\r\n * @param clientId\r\n * @param environment\r\n * @param familyId\r\n */\r\n AppMetadataEntity.createAppMetadataEntity = function (clientId, environment, familyId) {\r\n var appMetadata = new AppMetadataEntity();\r\n appMetadata.clientId = clientId;\r\n appMetadata.environment = environment;\r\n if (familyId) {\r\n appMetadata.familyId = familyId;\r\n }\r\n return appMetadata;\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n AppMetadataEntity.isAppMetadataEntity = function (key, entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (key.indexOf(APP_METADATA) === 0 &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"environment\"));\r\n };\r\n return AppMetadataEntity;\r\n}());\n\nexport { AppMetadataEntity };\n//# sourceMappingURL=AppMetadataEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * This class instance helps track the memory changes facilitating\r\n * decisions to read from and write to the persistent cache\r\n */ var TokenCacheContext = /** @class */ (function () {\r\n function TokenCacheContext(tokenCache, hasChanged) {\r\n this.cache = tokenCache;\r\n this.hasChanged = hasChanged;\r\n }\r\n Object.defineProperty(TokenCacheContext.prototype, \"cacheHasChanged\", {\r\n /**\r\n * boolean which indicates the changes in cache\r\n */\r\n get: function () {\r\n return this.hasChanged;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(TokenCacheContext.prototype, \"tokenCache\", {\r\n /**\r\n * function to retrieve the token cache\r\n */\r\n get: function () {\r\n return this.cache;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n return TokenCacheContext;\r\n}());\n\nexport { TokenCacheContext };\n//# sourceMappingURL=TokenCacheContext.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { buildClientInfo } from '../account/ClientInfo.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ServerError } from '../error/ServerError.js';\nimport { AuthToken } from '../account/AuthToken.js';\nimport { ScopeSet } from '../request/ScopeSet.js';\nimport { AccountEntity } from '../cache/entities/AccountEntity.js';\nimport { AuthorityType } from '../authority/AuthorityType.js';\nimport { IdTokenEntity } from '../cache/entities/IdTokenEntity.js';\nimport { AccessTokenEntity } from '../cache/entities/AccessTokenEntity.js';\nimport { RefreshTokenEntity } from '../cache/entities/RefreshTokenEntity.js';\nimport { InteractionRequiredAuthError } from '../error/InteractionRequiredAuthError.js';\nimport { CacheRecord } from '../cache/entities/CacheRecord.js';\nimport { ProtocolUtils } from '../utils/ProtocolUtils.js';\nimport { Constants, AuthenticationScheme, THE_FAMILY_ID } from '../utils/Constants.js';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';\nimport { AppMetadataEntity } from '../cache/entities/AppMetadataEntity.js';\nimport { TokenCacheContext } from '../cache/persistence/TokenCacheContext.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.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 * Class that handles response parsing.\r\n */\r\nvar ResponseHandler = /** @class */ (function () {\r\n function ResponseHandler(clientId, cacheStorage, cryptoObj, logger, serializableCache, persistencePlugin, performanceClient) {\r\n this.clientId = clientId;\r\n this.cacheStorage = cacheStorage;\r\n this.cryptoObj = cryptoObj;\r\n this.logger = logger;\r\n this.serializableCache = serializableCache;\r\n this.persistencePlugin = persistencePlugin;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Function which validates server authorization code response.\r\n * @param serverResponseHash\r\n * @param cachedState\r\n * @param cryptoObj\r\n */\r\n ResponseHandler.prototype.validateServerAuthorizationCodeResponse = function (serverResponseHash, cachedState, cryptoObj) {\r\n if (!serverResponseHash.state || !cachedState) {\r\n throw !serverResponseHash.state ? ClientAuthError.createStateNotFoundError(\"Server State\") : ClientAuthError.createStateNotFoundError(\"Cached State\");\r\n }\r\n if (decodeURIComponent(serverResponseHash.state) !== decodeURIComponent(cachedState)) {\r\n throw ClientAuthError.createStateMismatchError();\r\n }\r\n // Check for error\r\n if (serverResponseHash.error || serverResponseHash.error_description || serverResponseHash.suberror) {\r\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponseHash.error, serverResponseHash.error_description, serverResponseHash.suberror)) {\r\n throw new InteractionRequiredAuthError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror, serverResponseHash.timestamp || Constants.EMPTY_STRING, serverResponseHash.trace_id || Constants.EMPTY_STRING, serverResponseHash.correlation_id || Constants.EMPTY_STRING, serverResponseHash.claims || Constants.EMPTY_STRING);\r\n }\r\n throw new ServerError(serverResponseHash.error || Constants.EMPTY_STRING, serverResponseHash.error_description, serverResponseHash.suberror);\r\n }\r\n if (serverResponseHash.client_info) {\r\n buildClientInfo(serverResponseHash.client_info, cryptoObj);\r\n }\r\n };\r\n /**\r\n * Function which validates server authorization token response.\r\n * @param serverResponse\r\n */\r\n ResponseHandler.prototype.validateTokenResponse = function (serverResponse) {\r\n // Check for error\r\n if (serverResponse.error || serverResponse.error_description || serverResponse.suberror) {\r\n if (InteractionRequiredAuthError.isInteractionRequiredError(serverResponse.error, serverResponse.error_description, serverResponse.suberror)) {\r\n throw new InteractionRequiredAuthError(serverResponse.error, serverResponse.error_description, serverResponse.suberror, serverResponse.timestamp || Constants.EMPTY_STRING, serverResponse.trace_id || Constants.EMPTY_STRING, serverResponse.correlation_id || Constants.EMPTY_STRING, serverResponse.claims || Constants.EMPTY_STRING);\r\n }\r\n var errString = serverResponse.error_codes + \" - [\" + serverResponse.timestamp + \"]: \" + serverResponse.error_description + \" - Correlation ID: \" + serverResponse.correlation_id + \" - Trace ID: \" + serverResponse.trace_id;\r\n throw new ServerError(serverResponse.error, errString, serverResponse.suberror);\r\n }\r\n };\r\n /**\r\n * Returns a constructed token response based on given string. Also manages the cache updates and cleanups.\r\n * @param serverTokenResponse\r\n * @param authority\r\n */\r\n ResponseHandler.prototype.handleServerTokenResponse = function (serverTokenResponse, authority, reqTimestamp, request, authCodePayload, userAssertionHash, handlingRefreshTokenResponse, forceCacheRefreshTokenResponse, serverRequestId) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var idTokenObj, authTime, requestStateObj, cacheRecord, cacheContext, key, account;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.HandleServerTokenResponse, serverTokenResponse.correlation_id);\r\n if (serverTokenResponse.id_token) {\r\n idTokenObj = new AuthToken(serverTokenResponse.id_token || Constants.EMPTY_STRING, this.cryptoObj);\r\n // token nonce check (TODO: Add a warning if no nonce is given?)\r\n if (authCodePayload && !StringUtils.isEmpty(authCodePayload.nonce)) {\r\n if (idTokenObj.claims.nonce !== authCodePayload.nonce) {\r\n throw ClientAuthError.createNonceMismatchError();\r\n }\r\n }\r\n // token max_age check\r\n if (request.maxAge || (request.maxAge === 0)) {\r\n authTime = idTokenObj.claims.auth_time;\r\n if (!authTime) {\r\n throw ClientAuthError.createAuthTimeNotFoundError();\r\n }\r\n AuthToken.checkMaxAge(authTime, request.maxAge);\r\n }\r\n }\r\n // generate homeAccountId\r\n this.homeAccountIdentifier = AccountEntity.generateHomeAccountId(serverTokenResponse.client_info || Constants.EMPTY_STRING, authority.authorityType, this.logger, this.cryptoObj, idTokenObj);\r\n if (!!authCodePayload && !!authCodePayload.state) {\r\n requestStateObj = ProtocolUtils.parseRequestState(this.cryptoObj, authCodePayload.state);\r\n }\r\n // Add keyId from request to serverTokenResponse if defined\r\n serverTokenResponse.key_id = serverTokenResponse.key_id || request.sshKid || undefined;\r\n cacheRecord = this.generateCacheRecord(serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload);\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, , 5, 8]);\r\n if (!(this.persistencePlugin && this.serializableCache)) return [3 /*break*/, 3];\r\n this.logger.verbose(\"Persistence enabled, calling beforeCacheAccess\");\r\n cacheContext = new TokenCacheContext(this.serializableCache, true);\r\n return [4 /*yield*/, this.persistencePlugin.beforeCacheAccess(cacheContext)];\r\n case 2:\r\n _b.sent();\r\n _b.label = 3;\r\n case 3:\r\n /*\r\n * When saving a refreshed tokens to the cache, it is expected that the account that was used is present in the cache.\r\n * If not present, we should return null, as it's the case that another application called removeAccount in between\r\n * the calls to getAllAccounts and acquireTokenSilent. We should not overwrite that removal, unless explicitly flagged by\r\n * the developer, as in the case of refresh token flow used in ADAL Node to MSAL Node migration.\r\n */\r\n if (handlingRefreshTokenResponse && !forceCacheRefreshTokenResponse && cacheRecord.account) {\r\n key = cacheRecord.account.generateAccountKey();\r\n account = this.cacheStorage.getAccount(key);\r\n if (!account) {\r\n this.logger.warning(\"Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache\");\r\n return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, undefined, serverRequestId)];\r\n }\r\n }\r\n return [4 /*yield*/, this.cacheStorage.saveCacheRecord(cacheRecord)];\r\n case 4:\r\n _b.sent();\r\n return [3 /*break*/, 8];\r\n case 5:\r\n if (!(this.persistencePlugin && this.serializableCache && cacheContext)) return [3 /*break*/, 7];\r\n this.logger.verbose(\"Persistence enabled, calling afterCacheAccess\");\r\n return [4 /*yield*/, this.persistencePlugin.afterCacheAccess(cacheContext)];\r\n case 6:\r\n _b.sent();\r\n _b.label = 7;\r\n case 7: return [7 /*endfinally*/];\r\n case 8: return [2 /*return*/, ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenObj, requestStateObj, serverTokenResponse, serverRequestId)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Generates CacheRecord\r\n * @param serverTokenResponse\r\n * @param idTokenObj\r\n * @param authority\r\n */\r\n ResponseHandler.prototype.generateCacheRecord = function (serverTokenResponse, authority, reqTimestamp, request, idTokenObj, userAssertionHash, authCodePayload) {\r\n var env = authority.getPreferredCache();\r\n if (StringUtils.isEmpty(env)) {\r\n throw ClientAuthError.createInvalidCacheEnvironmentError();\r\n }\r\n // IdToken: non AAD scenarios can have empty realm\r\n var cachedIdToken;\r\n var cachedAccount;\r\n if (!StringUtils.isEmpty(serverTokenResponse.id_token) && !!idTokenObj) {\r\n cachedIdToken = IdTokenEntity.createIdTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.id_token || Constants.EMPTY_STRING, this.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);\r\n cachedAccount = this.generateAccountEntity(serverTokenResponse, idTokenObj, authority, authCodePayload);\r\n }\r\n // AccessToken\r\n var cachedAccessToken = null;\r\n if (!StringUtils.isEmpty(serverTokenResponse.access_token)) {\r\n // If scopes not returned in server response, use request scopes\r\n var responseScopes = serverTokenResponse.scope ? ScopeSet.fromString(serverTokenResponse.scope) : new ScopeSet(request.scopes || []);\r\n /*\r\n * Use timestamp calculated before request\r\n * Server may return timestamps as strings, parse to numbers if so.\r\n */\r\n var expiresIn = (typeof serverTokenResponse.expires_in === \"string\" ? parseInt(serverTokenResponse.expires_in, 10) : serverTokenResponse.expires_in) || 0;\r\n var extExpiresIn = (typeof serverTokenResponse.ext_expires_in === \"string\" ? parseInt(serverTokenResponse.ext_expires_in, 10) : serverTokenResponse.ext_expires_in) || 0;\r\n var refreshIn = (typeof serverTokenResponse.refresh_in === \"string\" ? parseInt(serverTokenResponse.refresh_in, 10) : serverTokenResponse.refresh_in) || undefined;\r\n var tokenExpirationSeconds = reqTimestamp + expiresIn;\r\n var extendedTokenExpirationSeconds = tokenExpirationSeconds + extExpiresIn;\r\n var refreshOnSeconds = refreshIn && refreshIn > 0 ? reqTimestamp + refreshIn : undefined;\r\n // non AAD scenarios can have empty realm\r\n cachedAccessToken = AccessTokenEntity.createAccessTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.access_token || Constants.EMPTY_STRING, this.clientId, idTokenObj ? idTokenObj.claims.tid || Constants.EMPTY_STRING : authority.tenant, responseScopes.printScopes(), tokenExpirationSeconds, extendedTokenExpirationSeconds, this.cryptoObj, refreshOnSeconds, serverTokenResponse.token_type, userAssertionHash, serverTokenResponse.key_id, request.claims, request.requestedClaimsHash);\r\n }\r\n // refreshToken\r\n var cachedRefreshToken = null;\r\n if (!StringUtils.isEmpty(serverTokenResponse.refresh_token)) {\r\n cachedRefreshToken = RefreshTokenEntity.createRefreshTokenEntity(this.homeAccountIdentifier, env, serverTokenResponse.refresh_token || Constants.EMPTY_STRING, this.clientId, serverTokenResponse.foci, userAssertionHash);\r\n }\r\n // appMetadata\r\n var cachedAppMetadata = null;\r\n if (!StringUtils.isEmpty(serverTokenResponse.foci)) {\r\n cachedAppMetadata = AppMetadataEntity.createAppMetadataEntity(this.clientId, env, serverTokenResponse.foci);\r\n }\r\n return new CacheRecord(cachedAccount, cachedIdToken, cachedAccessToken, cachedRefreshToken, cachedAppMetadata);\r\n };\r\n /**\r\n * Generate Account\r\n * @param serverTokenResponse\r\n * @param idToken\r\n * @param authority\r\n */\r\n ResponseHandler.prototype.generateAccountEntity = function (serverTokenResponse, idToken, authority, authCodePayload) {\r\n var authorityType = authority.authorityType;\r\n var cloudGraphHostName = authCodePayload ? authCodePayload.cloud_graph_host_name : Constants.EMPTY_STRING;\r\n var msGraphhost = authCodePayload ? authCodePayload.msgraph_host : Constants.EMPTY_STRING;\r\n // ADFS does not require client_info in the response\r\n if (authorityType === AuthorityType.Adfs) {\r\n this.logger.verbose(\"Authority type is ADFS, creating ADFS account\");\r\n return AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\r\n }\r\n // This fallback applies to B2C as well as they fall under an AAD account type.\r\n if (StringUtils.isEmpty(serverTokenResponse.client_info) && authority.protocolMode === \"AAD\") {\r\n throw ClientAuthError.createClientInfoEmptyError();\r\n }\r\n return serverTokenResponse.client_info ?\r\n AccountEntity.createAccount(serverTokenResponse.client_info, this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost) :\r\n AccountEntity.createGenericAccount(this.homeAccountIdentifier, idToken, authority, cloudGraphHostName, msGraphhost);\r\n };\r\n /**\r\n * Creates an @AuthenticationResult from @CacheRecord , @IdToken , and a boolean that states whether or not the result is from cache.\r\n *\r\n * Optionally takes a state string that is set as-is in the response.\r\n *\r\n * @param cacheRecord\r\n * @param idTokenObj\r\n * @param fromTokenCache\r\n * @param stateString\r\n */\r\n ResponseHandler.generateAuthenticationResult = function (cryptoObj, authority, cacheRecord, fromTokenCache, request, idTokenObj, requestState, serverTokenResponse, requestId) {\r\n var _a, _b, _c;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var accessToken, responseScopes, expiresOn, extExpiresOn, familyId, popTokenGenerator, _d, secret, keyId, uid, tid;\r\n return __generator(this, function (_e) {\r\n switch (_e.label) {\r\n case 0:\r\n accessToken = Constants.EMPTY_STRING;\r\n responseScopes = [];\r\n expiresOn = null;\r\n familyId = Constants.EMPTY_STRING;\r\n if (!cacheRecord.accessToken) return [3 /*break*/, 4];\r\n if (!(cacheRecord.accessToken.tokenType === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n popTokenGenerator = new PopTokenGenerator(cryptoObj);\r\n _d = cacheRecord.accessToken, secret = _d.secret, keyId = _d.keyId;\r\n if (!keyId) {\r\n throw ClientAuthError.createKeyIdMissingError();\r\n }\r\n return [4 /*yield*/, popTokenGenerator.signPopToken(secret, keyId, request)];\r\n case 1:\r\n accessToken = _e.sent();\r\n return [3 /*break*/, 3];\r\n case 2:\r\n accessToken = cacheRecord.accessToken.secret;\r\n _e.label = 3;\r\n case 3:\r\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\r\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\r\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\r\n _e.label = 4;\r\n case 4:\r\n if (cacheRecord.appMetadata) {\r\n familyId = cacheRecord.appMetadata.familyId === THE_FAMILY_ID ? THE_FAMILY_ID : Constants.EMPTY_STRING;\r\n }\r\n uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;\r\n tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;\r\n // for hybrid + native bridge enablement, send back the native account Id\r\n if ((serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_accountid) && !!cacheRecord.account) {\r\n cacheRecord.account.nativeAccountId = serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_accountid;\r\n }\r\n return [2 /*return*/, {\r\n authority: authority.canonicalAuthority,\r\n uniqueId: uid,\r\n tenantId: tid,\r\n scopes: responseScopes,\r\n account: cacheRecord.account ? cacheRecord.account.getAccountInfo() : null,\r\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\r\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\r\n accessToken: accessToken,\r\n fromCache: fromTokenCache,\r\n expiresOn: expiresOn,\r\n correlationId: request.correlationId,\r\n requestId: requestId || Constants.EMPTY_STRING,\r\n extExpiresOn: extExpiresOn,\r\n familyId: familyId,\r\n tokenType: ((_a = cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,\r\n state: requestState ? requestState.userRequestState : Constants.EMPTY_STRING,\r\n cloudGraphHostName: ((_b = cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,\r\n msGraphHost: ((_c = cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,\r\n code: serverTokenResponse === null || serverTokenResponse === void 0 ? void 0 : serverTokenResponse.spa_code,\r\n fromNativeBroker: false,\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n return ResponseHandler;\r\n}());\n\nexport { ResponseHandler };\n//# sourceMappingURL=ResponseHandler.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign, __spreadArrays } from '../_virtual/_tslib.js';\nimport { BaseClient } from './BaseClient.js';\nimport { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';\nimport { Separators, AADServerParamKeys, AuthenticationScheme, GrantType, PromptValue, HeaderNames } from '../utils/Constants.js';\nimport { ResponseHandler } from '../response/ResponseHandler.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { UrlString } from '../url/UrlString.js';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';\nimport { TimeUtils } from '../utils/TimeUtils.js';\nimport { buildClientInfo, buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';\nimport { CcsCredentialType } from '../account/CcsCredential.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { RequestValidator } from '../request/RequestValidator.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.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 * Oauth2.0 Authorization Code client\r\n */\r\nvar AuthorizationCodeClient = /** @class */ (function (_super) {\r\n __extends(AuthorizationCodeClient, _super);\r\n function AuthorizationCodeClient(configuration, performanceClient) {\r\n var _this = _super.call(this, configuration, performanceClient) || this;\r\n // Flag to indicate if client is for hybrid spa auth code redemption\r\n _this.includeRedirectUri = true;\r\n return _this;\r\n }\r\n /**\r\n * Creates the URL of the authorization request letting the user input credentials and consent to the\r\n * application. The URL target the /authorize endpoint of the authority configured in the\r\n * application object.\r\n *\r\n * Once the user inputs their credentials and consents, the authority will send a response to the redirect URI\r\n * sent in the request and should contain an authorization code, which can then be used to acquire tokens via\r\n * acquireToken(AuthorizationCodeRequest)\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.getAuthCodeUrl = function (request) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var queryString;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.GetAuthCodeUrl, request.correlationId);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeUrlQueryString(request)];\r\n case 1:\r\n queryString = _c.sent();\r\n return [2 /*return*/, UrlString.appendQueryString(this.authority.authorizationEndpoint, queryString)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * API to acquire a token in exchange of 'authorization_code` acquired by the user in the first leg of the\r\n * authorization_code_grant\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.acquireToken = function (request, authCodePayload) {\r\n var _a, _b, _c, _d, _e, _f;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var atsMeasurement, reqTimestamp, response, requestId, httpVerAuthority, responseHandler;\r\n var _this = this;\r\n return __generator(this, function (_g) {\r\n switch (_g.label) {\r\n case 0:\r\n if (!request || !request.code) {\r\n throw ClientAuthError.createTokenRequestCannotBeMadeError();\r\n }\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientAcquireToken, request.correlationId);\r\n atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(\"AuthCodeClientAcquireToken\", request.correlationId);\r\n this.logger.info(\"in acquireToken call in auth-code client\");\r\n reqTimestamp = TimeUtils.nowSeconds();\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);\r\n return [4 /*yield*/, this.executeTokenRequest(this.authority, request)];\r\n case 1:\r\n response = _g.sent();\r\n requestId = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_REQUEST_ID];\r\n httpVerAuthority = (_e = response.headers) === null || _e === void 0 ? void 0 : _e[HeaderNames.X_MS_HTTP_VERSION];\r\n if (httpVerAuthority) {\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({\r\n httpVerAuthority: httpVerAuthority\r\n });\r\n }\r\n responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin, this.performanceClient);\r\n // Validate response. This function throws a server error if an error is returned by the server.\r\n responseHandler.validateTokenResponse(response.body);\r\n (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);\r\n return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, authCodePayload, undefined, undefined, undefined, requestId).then(function (result) {\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({\r\n success: true\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n _this.logger.verbose(\"Error in fetching token in ACC\", request.correlationId);\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n success: false\r\n });\r\n throw error;\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Handles the hash fragment response from public client code request. Returns a code response used by\r\n * the client to exchange for a token in acquireToken.\r\n * @param hashFragment\r\n */\r\n AuthorizationCodeClient.prototype.handleFragmentResponse = function (hashFragment, cachedState) {\r\n // Handle responses.\r\n var responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, null, null);\r\n // Deserialize hash fragment response parameters.\r\n var hashUrlString = new UrlString(hashFragment);\r\n // Deserialize hash fragment response parameters.\r\n var serverParams = UrlString.getDeserializedHash(hashUrlString.getHash());\r\n // Get code response\r\n responseHandler.validateServerAuthorizationCodeResponse(serverParams, cachedState, this.cryptoUtils);\r\n // throw when there is no auth code in the response\r\n if (!serverParams.code) {\r\n throw ClientAuthError.createNoAuthCodeInServerResponseError();\r\n }\r\n return __assign(__assign({}, serverParams), { \r\n // Code param is optional in ServerAuthorizationCodeResponse but required in AuthorizationCodePaylod\r\n code: serverParams.code });\r\n };\r\n /**\r\n * Used to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param authorityUri\r\n */\r\n AuthorizationCodeClient.prototype.getLogoutUri = function (logoutRequest) {\r\n // Throw error if logoutRequest is null/undefined\r\n if (!logoutRequest) {\r\n throw ClientConfigurationError.createEmptyLogoutRequestError();\r\n }\r\n var queryString = this.createLogoutUrlQueryString(logoutRequest);\r\n // Construct logout URI\r\n return UrlString.appendQueryString(this.authority.endSessionEndpoint, queryString);\r\n };\r\n /**\r\n * Executes POST request to token endpoint\r\n * @param authority\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.executeTokenRequest = function (authority, request) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var queryParametersString, endpoint, requestBody, ccsCredential, clientInfo, headers, thumbprint;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientExecuteTokenRequest, request.correlationId);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);\r\n queryParametersString = this.createTokenQueryParameters(request);\r\n endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\r\n return [4 /*yield*/, this.createTokenRequestBody(request)];\r\n case 1:\r\n requestBody = _c.sent();\r\n ccsCredential = undefined;\r\n if (request.clientInfo) {\r\n try {\r\n clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);\r\n ccsCredential = {\r\n credential: \"\" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID\r\n };\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\r\n }\r\n }\r\n headers = this.createTokenRequestHeaders(ccsCredential || request.ccsCredential);\r\n thumbprint = {\r\n clientId: this.config.authOptions.clientId,\r\n authority: authority.canonicalAuthority,\r\n scopes: request.scopes,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Generates a map for all the params to be sent to the service\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.createTokenRequestBody = function (request) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, correlationId, ccsCred, clientInfo, clientInfo;\r\n var _c;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientCreateTokenRequestBody, request.correlationId);\r\n parameterBuilder = new RequestParameterBuilder();\r\n parameterBuilder.addClientId(this.config.authOptions.clientId);\r\n /*\r\n * For hybrid spa flow, there will be a code but no verifier\r\n * In this scenario, don't include redirect uri as auth code will not be bound to redirect URI\r\n */\r\n if (!this.includeRedirectUri) {\r\n // Just validate\r\n RequestValidator.validateRedirectUri(request.redirectUri);\r\n }\r\n else {\r\n // Validate and include redirect uri\r\n parameterBuilder.addRedirectUri(request.redirectUri);\r\n }\r\n // Add scope array, parameter builder will add default scopes and dedupe\r\n parameterBuilder.addScopes(request.scopes);\r\n // add code: user set, not validated\r\n parameterBuilder.addAuthorizationCode(request.code);\r\n // Add library metadata\r\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\r\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\r\n parameterBuilder.addThrottling();\r\n if (this.serverTelemetryManager) {\r\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\r\n }\r\n // add code_verifier if passed\r\n if (request.codeVerifier) {\r\n parameterBuilder.addCodeVerifier(request.codeVerifier);\r\n }\r\n if (this.config.clientCredentials.clientSecret) {\r\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\r\n }\r\n if (this.config.clientCredentials.clientAssertion) {\r\n clientAssertion = this.config.clientCredentials.clientAssertion;\r\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\r\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\r\n }\r\n parameterBuilder.addGrantType(GrantType.AUTHORIZATION_CODE_GRANT);\r\n parameterBuilder.addClientInfo();\r\n if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);\r\n return [4 /*yield*/, popTokenGenerator.generateCnf(request)];\r\n case 1:\r\n reqCnfData = _d.sent();\r\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\r\n parameterBuilder.addPopToken(reqCnfData.reqCnfString);\r\n return [3 /*break*/, 3];\r\n case 2:\r\n if (request.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (request.sshJwk) {\r\n parameterBuilder.addSshJwk(request.sshJwk);\r\n }\r\n else {\r\n throw ClientConfigurationError.createMissingSshJwkError();\r\n }\r\n }\r\n _d.label = 3;\r\n case 3:\r\n correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\r\n parameterBuilder.addCorrelationId(correlationId);\r\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n ccsCred = undefined;\r\n if (request.clientInfo) {\r\n try {\r\n clientInfo = buildClientInfo(request.clientInfo, this.cryptoUtils);\r\n ccsCred = {\r\n credential: \"\" + clientInfo.uid + Separators.CLIENT_INFO_SEPARATOR + clientInfo.utid,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID\r\n };\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse client info for CCS Header: \" + e);\r\n }\r\n }\r\n else {\r\n ccsCred = request.ccsCredential;\r\n }\r\n // Adds these as parameters in the request instead of headers to prevent CORS preflight request\r\n if (this.config.systemOptions.preventCorsPreflight && ccsCred) {\r\n switch (ccsCred.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n clientInfo = buildClientInfoFromHomeAccountId(ccsCred.credential);\r\n parameterBuilder.addCcsOid(clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n parameterBuilder.addCcsUpn(ccsCred.credential);\r\n break;\r\n }\r\n }\r\n if (request.tokenBodyParameters) {\r\n parameterBuilder.addExtraQueryParameters(request.tokenBodyParameters);\r\n }\r\n // Add hybrid spa parameters if not already provided\r\n if (request.enableSpaAuthorizationCode && (!request.tokenBodyParameters || !request.tokenBodyParameters[AADServerParamKeys.RETURN_SPA_CODE])) {\r\n parameterBuilder.addExtraQueryParameters((_c = {},\r\n _c[AADServerParamKeys.RETURN_SPA_CODE] = \"1\",\r\n _c));\r\n }\r\n return [2 /*return*/, parameterBuilder.createQueryString()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * This API validates the `AuthorizationCodeUrlRequest` and creates a URL\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.createAuthCodeUrlQueryString = function (request) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var parameterBuilder, requestScopes, correlationId, accountSid, accountLoginHintClaim, clientInfo, clientInfo, clientInfo, popTokenGenerator, reqCnfData;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthClientCreateQueryString, request.correlationId);\r\n parameterBuilder = new RequestParameterBuilder();\r\n parameterBuilder.addClientId(this.config.authOptions.clientId);\r\n requestScopes = __spreadArrays(request.scopes || [], request.extraScopesToConsent || []);\r\n parameterBuilder.addScopes(requestScopes);\r\n // validate the redirectUri (to be a non null value)\r\n parameterBuilder.addRedirectUri(request.redirectUri);\r\n correlationId = request.correlationId || this.config.cryptoInterface.createNewGuid();\r\n parameterBuilder.addCorrelationId(correlationId);\r\n // add response_mode. If not passed in it defaults to query.\r\n parameterBuilder.addResponseMode(request.responseMode);\r\n // add response_type = code\r\n parameterBuilder.addResponseTypeCode();\r\n // add library info parameters\r\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\r\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\r\n // add client_info=1\r\n parameterBuilder.addClientInfo();\r\n if (request.codeChallenge && request.codeChallengeMethod) {\r\n parameterBuilder.addCodeChallengeParams(request.codeChallenge, request.codeChallengeMethod);\r\n }\r\n if (request.prompt) {\r\n parameterBuilder.addPrompt(request.prompt);\r\n }\r\n if (request.domainHint) {\r\n parameterBuilder.addDomainHint(request.domainHint);\r\n }\r\n // Add sid or loginHint with preference for login_hint claim (in request) -> sid -> loginHint (upn/email) -> username of AccountInfo object\r\n if (request.prompt !== PromptValue.SELECT_ACCOUNT) {\r\n // AAD will throw if prompt=select_account is passed with an account hint\r\n if (request.sid && request.prompt === PromptValue.NONE) {\r\n // SessionID is only used in silent calls\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from request\");\r\n parameterBuilder.addSid(request.sid);\r\n }\r\n else if (request.account) {\r\n accountSid = this.extractAccountSid(request.account);\r\n accountLoginHintClaim = this.extractLoginHint(request.account);\r\n // If login_hint claim is present, use it over sid/username\r\n if (accountLoginHintClaim) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: login_hint claim present on account\");\r\n parameterBuilder.addLoginHint(accountLoginHintClaim);\r\n try {\r\n clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n parameterBuilder.addCcsOid(clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n else if (accountSid && request.prompt === PromptValue.NONE) {\r\n /*\r\n * If account and loginHint are provided, we will check account first for sid before adding loginHint\r\n * SessionId is only used in silent calls\r\n */\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is none, adding sid from account\");\r\n parameterBuilder.addSid(accountSid);\r\n try {\r\n clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n parameterBuilder.addCcsOid(clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n else if (request.loginHint) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from request\");\r\n parameterBuilder.addLoginHint(request.loginHint);\r\n parameterBuilder.addCcsUpn(request.loginHint);\r\n }\r\n else if (request.account.username) {\r\n // Fallback to account username if provided\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Adding login_hint from account\");\r\n parameterBuilder.addLoginHint(request.account.username);\r\n try {\r\n clientInfo = buildClientInfoFromHomeAccountId(request.account.homeAccountId);\r\n parameterBuilder.addCcsOid(clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header\");\r\n }\r\n }\r\n }\r\n else if (request.loginHint) {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: No account, adding login_hint from request\");\r\n parameterBuilder.addLoginHint(request.loginHint);\r\n parameterBuilder.addCcsUpn(request.loginHint);\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints\");\r\n }\r\n if (request.nonce) {\r\n parameterBuilder.addNonce(request.nonce);\r\n }\r\n if (request.state) {\r\n parameterBuilder.addState(request.state);\r\n }\r\n if (!StringUtils.isEmpty(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n if (request.extraQueryParameters) {\r\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\r\n }\r\n if (!request.nativeBroker) return [3 /*break*/, 2];\r\n // signal ests that this is a WAM call\r\n parameterBuilder.addNativeBroker();\r\n if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n popTokenGenerator = new PopTokenGenerator(this.cryptoUtils);\r\n return [4 /*yield*/, popTokenGenerator.generateCnf(request)];\r\n case 1:\r\n reqCnfData = _b.sent();\r\n parameterBuilder.addPopToken(reqCnfData.reqCnfHash);\r\n _b.label = 2;\r\n case 2: return [2 /*return*/, parameterBuilder.createQueryString()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * This API validates the `EndSessionRequest` and creates a URL\r\n * @param request\r\n */\r\n AuthorizationCodeClient.prototype.createLogoutUrlQueryString = function (request) {\r\n var parameterBuilder = new RequestParameterBuilder();\r\n if (request.postLogoutRedirectUri) {\r\n parameterBuilder.addPostLogoutRedirectUri(request.postLogoutRedirectUri);\r\n }\r\n if (request.correlationId) {\r\n parameterBuilder.addCorrelationId(request.correlationId);\r\n }\r\n if (request.idTokenHint) {\r\n parameterBuilder.addIdTokenHint(request.idTokenHint);\r\n }\r\n if (request.state) {\r\n parameterBuilder.addState(request.state);\r\n }\r\n if (request.logoutHint) {\r\n parameterBuilder.addLogoutHint(request.logoutHint);\r\n }\r\n if (request.extraQueryParameters) {\r\n parameterBuilder.addExtraQueryParameters(request.extraQueryParameters);\r\n }\r\n return parameterBuilder.createQueryString();\r\n };\r\n /**\r\n * Helper to get sid from account. Returns null if idTokenClaims are not present or sid is not present.\r\n * @param account\r\n */\r\n AuthorizationCodeClient.prototype.extractAccountSid = function (account) {\r\n var _a;\r\n return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.sid) || null;\r\n };\r\n AuthorizationCodeClient.prototype.extractLoginHint = function (account) {\r\n var _a;\r\n return ((_a = account.idTokenClaims) === null || _a === void 0 ? void 0 : _a.login_hint) || null;\r\n };\r\n return AuthorizationCodeClient;\r\n}(BaseClient));\n\nexport { AuthorizationCodeClient };\n//# sourceMappingURL=AuthorizationCodeClient.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { BaseClient } from './BaseClient.js';\nimport { RequestParameterBuilder } from '../request/RequestParameterBuilder.js';\nimport { AuthenticationScheme, GrantType, HeaderNames, Errors } from '../utils/Constants.js';\nimport { ResponseHandler } from '../response/ResponseHandler.js';\nimport { PopTokenGenerator } from '../crypto/PopTokenGenerator.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { ServerError } from '../error/ServerError.js';\nimport { TimeUtils } from '../utils/TimeUtils.js';\nimport { UrlString } from '../url/UrlString.js';\nimport { CcsCredentialType } from '../account/CcsCredential.js';\nimport { buildClientInfoFromHomeAccountId } from '../account/ClientInfo.js';\nimport { InteractionRequiredAuthError, InteractionRequiredAuthErrorMessage } from '../error/InteractionRequiredAuthError.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.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 * OAuth2.0 refresh token client\r\n */\r\nvar RefreshTokenClient = /** @class */ (function (_super) {\r\n __extends(RefreshTokenClient, _super);\r\n function RefreshTokenClient(configuration, performanceClient) {\r\n return _super.call(this, configuration, performanceClient) || this;\r\n }\r\n RefreshTokenClient.prototype.acquireToken = function (request) {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var atsMeasurement, reqTimestamp, response, httpVerToken, requestId, responseHandler;\r\n var _this = this;\r\n return __generator(this, function (_h) {\r\n switch (_h.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);\r\n atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);\r\n this.logger.verbose(\"RefreshTokenClientAcquireToken called\", request.correlationId);\r\n reqTimestamp = TimeUtils.nowSeconds();\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);\r\n return [4 /*yield*/, this.executeTokenRequest(request, this.authority)];\r\n case 1:\r\n response = _h.sent();\r\n httpVerToken = (_d = response.headers) === null || _d === void 0 ? void 0 : _d[HeaderNames.X_MS_HTTP_VERSION];\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({\r\n refreshTokenSize: ((_e = response.body.refresh_token) === null || _e === void 0 ? void 0 : _e.length) || 0,\r\n });\r\n if (httpVerToken) {\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.addStaticFields({\r\n httpVerToken: httpVerToken,\r\n });\r\n }\r\n requestId = (_f = response.headers) === null || _f === void 0 ? void 0 : _f[HeaderNames.X_MS_REQUEST_ID];\r\n responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.config.serializableCache, this.config.persistencePlugin);\r\n responseHandler.validateTokenResponse(response.body);\r\n (_g = this.performanceClient) === null || _g === void 0 ? void 0 : _g.setPreQueueTime(PerformanceEvents.HandleServerTokenResponse, request.correlationId);\r\n return [2 /*return*/, responseHandler.handleServerTokenResponse(response.body, this.authority, reqTimestamp, request, undefined, undefined, true, request.forceCache, requestId).then(function (result) {\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({\r\n success: true\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n _this.logger.verbose(\"Error in fetching refresh token\", request.correlationId);\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n success: false\r\n });\r\n throw error;\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Gets cached refresh token and attaches to request, then calls acquireToken API\r\n * @param request\r\n */\r\n RefreshTokenClient.prototype.acquireTokenByRefreshToken = function (request) {\r\n var _a, _b, _c, _d;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var isFOCI, noFamilyRTInCache, clientMismatchErrorWithFamilyRT;\r\n return __generator(this, function (_e) {\r\n // Cannot renew token if no request object is given.\r\n if (!request) {\r\n throw ClientConfigurationError.createEmptyTokenRequestError();\r\n }\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);\r\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\r\n if (!request.account) {\r\n throw ClientAuthError.createNoAccountInSilentRequestError();\r\n }\r\n isFOCI = this.cacheManager.isAppMetadataFOCI(request.account.environment);\r\n // if the app is part of the family, retrive a Family refresh token if present and make a refreshTokenRequest\r\n if (isFOCI) {\r\n try {\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, true)];\r\n }\r\n catch (e) {\r\n noFamilyRTInCache = e instanceof InteractionRequiredAuthError && e.errorCode === InteractionRequiredAuthErrorMessage.noTokensFoundError.code;\r\n clientMismatchErrorWithFamilyRT = e instanceof ServerError && e.errorCode === Errors.INVALID_GRANT_ERROR && e.subError === Errors.CLIENT_MISMATCH_ERROR;\r\n // if family Refresh Token (FRT) cache acquisition fails or if client_mismatch error is seen with FRT, reattempt with application Refresh Token (ART)\r\n if (noFamilyRTInCache || clientMismatchErrorWithFamilyRT) {\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, false)];\r\n // throw in all other cases\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n }\r\n // fall back to application refresh token acquisition\r\n (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n return [2 /*return*/, this.acquireTokenWithCachedRefreshToken(request, false)];\r\n });\r\n });\r\n };\r\n /**\r\n * makes a network call to acquire tokens by exchanging RefreshToken available in userCache; throws if refresh token is not cached\r\n * @param request\r\n */\r\n RefreshTokenClient.prototype.acquireTokenWithCachedRefreshToken = function (request, foci) {\r\n var _a, _b, _c;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var atsMeasurement, refreshToken, refreshTokenRequest;\r\n return __generator(this, function (_d) {\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n atsMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken, request.correlationId);\r\n this.logger.verbose(\"RefreshTokenClientAcquireTokenWithCachedRefreshToken called\", request.correlationId);\r\n refreshToken = this.cacheManager.getRefreshToken(request.account, foci);\r\n if (!refreshToken) {\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.discardMeasurement();\r\n throw InteractionRequiredAuthError.createNoTokensFoundError();\r\n }\r\n // attach cached RT size to the current measurement\r\n atsMeasurement === null || atsMeasurement === void 0 ? void 0 : atsMeasurement.endMeasurement({\r\n success: true\r\n });\r\n refreshTokenRequest = __assign(__assign({}, request), { refreshToken: refreshToken.secret, authenticationScheme: request.authenticationScheme || AuthenticationScheme.BEARER, ccsCredential: {\r\n credential: request.account.homeAccountId,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID\r\n } });\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireToken, request.correlationId);\r\n return [2 /*return*/, this.acquireToken(refreshTokenRequest)];\r\n });\r\n });\r\n };\r\n /**\r\n * Constructs the network message and makes a NW call to the underlying secure token service\r\n * @param request\r\n * @param authority\r\n */\r\n RefreshTokenClient.prototype.executeTokenRequest = function (request, authority) {\r\n var _a, _b, _c;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var acquireTokenMeasurement, queryParametersString, endpoint, requestBody, headers, thumbprint;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);\r\n acquireTokenMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(PerformanceEvents.RefreshTokenClientExecuteTokenRequest, request.correlationId);\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);\r\n queryParametersString = this.createTokenQueryParameters(request);\r\n endpoint = UrlString.appendQueryString(authority.tokenEndpoint, queryParametersString);\r\n return [4 /*yield*/, this.createTokenRequestBody(request)];\r\n case 1:\r\n requestBody = _d.sent();\r\n headers = this.createTokenRequestHeaders(request.ccsCredential);\r\n thumbprint = {\r\n clientId: this.config.authOptions.clientId,\r\n authority: authority.canonicalAuthority,\r\n scopes: request.scopes,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n return [2 /*return*/, this.executePostToTokenEndpoint(endpoint, requestBody, headers, thumbprint)\r\n .then(function (result) {\r\n acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({\r\n success: true\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({\r\n success: false\r\n });\r\n throw error;\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Helper function to create the token request body\r\n * @param request\r\n */\r\n RefreshTokenClient.prototype.createTokenRequestBody = function (request) {\r\n var _a, _b, _c;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, acquireTokenMeasurement, parameterBuilder, clientAssertion, popTokenGenerator, reqCnfData, clientInfo;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RefreshTokenClientCreateTokenRequestBody, request.correlationId);\r\n correlationId = request.correlationId;\r\n acquireTokenMeasurement = (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.startMeasurement(PerformanceEvents.BaseClientCreateTokenRequestHeaders, correlationId);\r\n parameterBuilder = new RequestParameterBuilder();\r\n parameterBuilder.addClientId(this.config.authOptions.clientId);\r\n parameterBuilder.addScopes(request.scopes);\r\n parameterBuilder.addGrantType(GrantType.REFRESH_TOKEN_GRANT);\r\n parameterBuilder.addClientInfo();\r\n parameterBuilder.addLibraryInfo(this.config.libraryInfo);\r\n parameterBuilder.addApplicationTelemetry(this.config.telemetry.application);\r\n parameterBuilder.addThrottling();\r\n if (this.serverTelemetryManager) {\r\n parameterBuilder.addServerTelemetry(this.serverTelemetryManager);\r\n }\r\n parameterBuilder.addCorrelationId(correlationId);\r\n parameterBuilder.addRefreshToken(request.refreshToken);\r\n if (this.config.clientCredentials.clientSecret) {\r\n parameterBuilder.addClientSecret(this.config.clientCredentials.clientSecret);\r\n }\r\n if (this.config.clientCredentials.clientAssertion) {\r\n clientAssertion = this.config.clientCredentials.clientAssertion;\r\n parameterBuilder.addClientAssertion(clientAssertion.assertion);\r\n parameterBuilder.addClientAssertionType(clientAssertion.assertionType);\r\n }\r\n if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.PopTokenGenerateCnf, request.correlationId);\r\n return [4 /*yield*/, popTokenGenerator.generateCnf(request)];\r\n case 1:\r\n reqCnfData = _d.sent();\r\n // SPA PoP requires full Base64Url encoded req_cnf string (unhashed)\r\n parameterBuilder.addPopToken(reqCnfData.reqCnfString);\r\n return [3 /*break*/, 3];\r\n case 2:\r\n if (request.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (request.sshJwk) {\r\n parameterBuilder.addSshJwk(request.sshJwk);\r\n }\r\n else {\r\n acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({\r\n success: false\r\n });\r\n throw ClientConfigurationError.createMissingSshJwkError();\r\n }\r\n }\r\n _d.label = 3;\r\n case 3:\r\n if (!StringUtils.isEmptyObj(request.claims) || this.config.authOptions.clientCapabilities && this.config.authOptions.clientCapabilities.length > 0) {\r\n parameterBuilder.addClaims(request.claims, this.config.authOptions.clientCapabilities);\r\n }\r\n if (this.config.systemOptions.preventCorsPreflight && request.ccsCredential) {\r\n switch (request.ccsCredential.type) {\r\n case CcsCredentialType.HOME_ACCOUNT_ID:\r\n try {\r\n clientInfo = buildClientInfoFromHomeAccountId(request.ccsCredential.credential);\r\n parameterBuilder.addCcsOid(clientInfo);\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Could not parse home account ID for CCS Header: \" + e);\r\n }\r\n break;\r\n case CcsCredentialType.UPN:\r\n parameterBuilder.addCcsUpn(request.ccsCredential.credential);\r\n break;\r\n }\r\n }\r\n acquireTokenMeasurement === null || acquireTokenMeasurement === void 0 ? void 0 : acquireTokenMeasurement.endMeasurement({\r\n success: true\r\n });\r\n return [2 /*return*/, parameterBuilder.createQueryString()];\r\n }\r\n });\r\n });\r\n };\r\n return RefreshTokenClient;\r\n}(BaseClient));\n\nexport { RefreshTokenClient };\n//# sourceMappingURL=RefreshTokenClient.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BaseClient } from './BaseClient.js';\nimport { AuthToken } from '../account/AuthToken.js';\nimport { TimeUtils } from '../utils/TimeUtils.js';\nimport { RefreshTokenClient } from './RefreshTokenClient.js';\nimport { ClientAuthError, ClientAuthErrorMessage } from '../error/ClientAuthError.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { ResponseHandler } from '../response/ResponseHandler.js';\nimport { CacheOutcome } from '../utils/Constants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentFlowClient = /** @class */ (function (_super) {\r\n __extends(SilentFlowClient, _super);\r\n function SilentFlowClient(configuration, performanceClient) {\r\n return _super.call(this, configuration, performanceClient) || this;\r\n }\r\n /**\r\n * Retrieves a token from cache if it is still valid, or uses the cached refresh token to renew\r\n * the given token and returns the renewed token\r\n * @param request\r\n */\r\n SilentFlowClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1, refreshTokenClient;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.acquireCachedToken(request)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof ClientAuthError && e_1.errorCode === ClientAuthErrorMessage.tokenRefreshRequired.code) {\r\n refreshTokenClient = new RefreshTokenClient(this.config, this.performanceClient);\r\n return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(request)];\r\n }\r\n else {\r\n throw e_1;\r\n }\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Retrieves token from cache or throws an error if it must be refreshed.\r\n * @param request\r\n */\r\n SilentFlowClient.prototype.acquireCachedToken = function (request) {\r\n var _a, _b, _c, _d;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var environment, cacheRecord;\r\n return __generator(this, function (_e) {\r\n switch (_e.label) {\r\n case 0:\r\n // Cannot renew token if no request object is given.\r\n if (!request) {\r\n throw ClientConfigurationError.createEmptyTokenRequestError();\r\n }\r\n if (request.forceRefresh) {\r\n // Must refresh due to present force_refresh flag.\r\n (_a = this.serverTelemetryManager) === null || _a === void 0 ? void 0 : _a.setCacheOutcome(CacheOutcome.FORCE_REFRESH);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Skipping cache because forceRefresh is true.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n // We currently do not support silent flow for account === null use cases; This will be revisited for confidential flow usecases\r\n if (!request.account) {\r\n throw ClientAuthError.createNoAccountInSilentRequestError();\r\n }\r\n environment = request.authority || this.authority.getPreferredCache();\r\n cacheRecord = this.cacheManager.readCacheRecord(request.account, request, environment);\r\n if (!cacheRecord.accessToken) {\r\n // Must refresh due to non-existent access_token.\r\n (_b = this.serverTelemetryManager) === null || _b === void 0 ? void 0 : _b.setCacheOutcome(CacheOutcome.NO_CACHED_ACCESS_TOKEN);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - No access token found in cache for the given properties.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n else if (TimeUtils.wasClockTurnedBack(cacheRecord.accessToken.cachedAt) ||\r\n TimeUtils.isTokenExpired(cacheRecord.accessToken.expiresOn, this.config.systemOptions.tokenRenewalOffsetSeconds)) {\r\n // Must refresh due to expired access_token.\r\n (_c = this.serverTelemetryManager) === null || _c === void 0 ? void 0 : _c.setCacheOutcome(CacheOutcome.CACHED_ACCESS_TOKEN_EXPIRED);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Cached access token is expired or will expire within \" + this.config.systemOptions.tokenRenewalOffsetSeconds + \" seconds.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n else if (cacheRecord.accessToken.refreshOn && TimeUtils.isTokenExpired(cacheRecord.accessToken.refreshOn, 0)) {\r\n // Must refresh due to the refresh_in value.\r\n (_d = this.serverTelemetryManager) === null || _d === void 0 ? void 0 : _d.setCacheOutcome(CacheOutcome.REFRESH_CACHED_ACCESS_TOKEN);\r\n this.logger.info(\"SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'.\");\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n if (this.config.serverTelemetryManager) {\r\n this.config.serverTelemetryManager.incrementCacheHits();\r\n }\r\n return [4 /*yield*/, this.generateResultFromCacheRecord(cacheRecord, request)];\r\n case 1: return [2 /*return*/, _e.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Helper function to build response object from the CacheRecord\r\n * @param cacheRecord\r\n */\r\n SilentFlowClient.prototype.generateResultFromCacheRecord = function (cacheRecord, request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var idTokenObj, authTime;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (cacheRecord.idToken) {\r\n idTokenObj = new AuthToken(cacheRecord.idToken.secret, this.config.cryptoInterface);\r\n }\r\n // token max_age check\r\n if (request.maxAge || (request.maxAge === 0)) {\r\n authTime = idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.auth_time;\r\n if (!authTime) {\r\n throw ClientAuthError.createAuthTimeNotFoundError();\r\n }\r\n AuthToken.checkMaxAge(authTime, request.maxAge);\r\n }\r\n return [4 /*yield*/, ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, idTokenObj)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n return SilentFlowClient;\r\n}(BaseClient));\n\nexport { SilentFlowClient };\n//# sourceMappingURL=SilentFlowClient.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isOpenIdConfigResponse(response) {\r\n return (response.hasOwnProperty(\"authorization_endpoint\") &&\r\n response.hasOwnProperty(\"token_endpoint\") &&\r\n response.hasOwnProperty(\"issuer\") &&\r\n response.hasOwnProperty(\"jwks_uri\"));\r\n}\n\nexport { isOpenIdConfigResponse };\n//# sourceMappingURL=OpenIdConfigResponse.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar rawMetdataJSON = { \"endpointMetadata\": { \"https://login.microsoftonline.com/common/\": { \"token_endpoint\": \"https://login.microsoftonline.com/common/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.com/common/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.com/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.com/common/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.com/common/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.com/common/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.com\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pas.windows.net\" }, \"https://login.chinacloudapi.cn/common/\": { \"token_endpoint\": \"https://login.chinacloudapi.cn/common/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.chinacloudapi.cn/common/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.partner.microsoftonline.cn/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo\", \"authorization_endpoint\": \"https://login.chinacloudapi.cn/common/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.chinacloudapi.cn/common/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.chinacloudapi.cn/common/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.chinacloudapi.cn/common/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"partner.microsoftonline.cn\", \"cloud_graph_host_name\": \"graph.chinacloudapi.cn\", \"msgraph_host\": \"microsoftgraph.chinacloudapi.cn\", \"rbac_url\": \"https://pas.chinacloudapi.cn\" }, \"https://login.microsoftonline.us/common/\": { \"token_endpoint\": \"https://login.microsoftonline.us/common/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.us/common/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.us/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.us/common/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.us/common/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.us/common/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.us/common/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.us\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pasff.usgovcloudapi.net\" }, \"https://login.microsoftonline.com/consumers/\": { \"token_endpoint\": \"https://login.microsoftonline.com/consumers/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.com/consumers/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.com/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.com/consumers/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.com/consumers/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.com/consumers/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.com\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pas.windows.net\" }, \"https://login.chinacloudapi.cn/consumers/\": { \"token_endpoint\": \"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.chinacloudapi.cn/consumers/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.partner.microsoftonline.cn/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo\", \"authorization_endpoint\": \"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.chinacloudapi.cn/consumers/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.chinacloudapi.cn/consumers/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"partner.microsoftonline.cn\", \"cloud_graph_host_name\": \"graph.chinacloudapi.cn\", \"msgraph_host\": \"microsoftgraph.chinacloudapi.cn\", \"rbac_url\": \"https://pas.chinacloudapi.cn\" }, \"https://login.microsoftonline.us/consumers/\": { \"token_endpoint\": \"https://login.microsoftonline.us/consumers/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.us/consumers/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.us/9188040d-6c67-4c5b-b112-36a304b66dad/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.us/consumers/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.us/consumers/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.us/consumers/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.us/consumers/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.us\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pasff.usgovcloudapi.net\" }, \"https://login.microsoftonline.com/organizations/\": { \"token_endpoint\": \"https://login.microsoftonline.com/organizations/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.com/organizations/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.com/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.com/organizations/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.com/organizations/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.com/organizations/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.com\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pas.windows.net\" }, \"https://login.chinacloudapi.cn/organizations/\": { \"token_endpoint\": \"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.chinacloudapi.cn/organizations/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.partner.microsoftonline.cn/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://microsoftgraph.chinacloudapi.cn/oidc/userinfo\", \"authorization_endpoint\": \"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.chinacloudapi.cn/organizations/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.chinacloudapi.cn/organizations/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"partner.microsoftonline.cn\", \"cloud_graph_host_name\": \"graph.chinacloudapi.cn\", \"msgraph_host\": \"microsoftgraph.chinacloudapi.cn\", \"rbac_url\": \"https://pas.chinacloudapi.cn\" }, \"https://login.microsoftonline.us/organizations/\": { \"token_endpoint\": \"https://login.microsoftonline.us/organizations/oauth2/v2.0/token\", \"token_endpoint_auth_methods_supported\": [\"client_secret_post\", \"private_key_jwt\", \"client_secret_basic\"], \"jwks_uri\": \"https://login.microsoftonline.us/organizations/discovery/v2.0/keys\", \"response_modes_supported\": [\"query\", \"fragment\", \"form_post\"], \"subject_types_supported\": [\"pairwise\"], \"id_token_signing_alg_values_supported\": [\"RS256\"], \"response_types_supported\": [\"code\", \"id_token\", \"code id_token\", \"id_token token\"], \"scopes_supported\": [\"openid\", \"profile\", \"email\", \"offline_access\"], \"issuer\": \"https://login.microsoftonline.us/{tenantid}/v2.0\", \"request_uri_parameter_supported\": false, \"userinfo_endpoint\": \"https://graph.microsoft.com/oidc/userinfo\", \"authorization_endpoint\": \"https://login.microsoftonline.us/organizations/oauth2/v2.0/authorize\", \"device_authorization_endpoint\": \"https://login.microsoftonline.us/organizations/oauth2/v2.0/devicecode\", \"http_logout_supported\": true, \"frontchannel_logout_supported\": true, \"end_session_endpoint\": \"https://login.microsoftonline.us/organizations/oauth2/v2.0/logout\", \"claims_supported\": [\"sub\", \"iss\", \"cloud_instance_name\", \"cloud_instance_host_name\", \"cloud_graph_host_name\", \"msgraph_host\", \"aud\", \"exp\", \"iat\", \"auth_time\", \"acr\", \"nonce\", \"preferred_username\", \"name\", \"tid\", \"ver\", \"at_hash\", \"c_hash\", \"email\"], \"kerberos_endpoint\": \"https://login.microsoftonline.us/organizations/kerberos\", \"tenant_region_scope\": null, \"cloud_instance_name\": \"microsoftonline.us\", \"cloud_graph_host_name\": \"graph.windows.net\", \"msgraph_host\": \"graph.microsoft.com\", \"rbac_url\": \"https://pasff.usgovcloudapi.net\" } }, \"instanceDiscoveryMetadata\": { \"https://login.microsoftonline.com/common/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.chinacloudapi.cn/common/\": { \"tenant_discovery_endpoint\": \"https://login.chinacloudapi.cn/common/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.microsoftonline.us/common/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.us/common/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.microsoftonline.com/consumers/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.com/consumers/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.chinacloudapi.cn/consumers/\": { \"tenant_discovery_endpoint\": \"https://login.chinacloudapi.cn/consumers/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.microsoftonline.us/consumers/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.us/consumers/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.microsoftonline.com/organizations/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.com/organizations/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.chinacloudapi.cn/organizations/\": { \"tenant_discovery_endpoint\": \"https://login.chinacloudapi.cn/organizations/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] }, \"https://login.microsoftonline.us/organizations/\": { \"tenant_discovery_endpoint\": \"https://login.microsoftonline.us/organizations/v2.0/.well-known/openid-configuration\", \"api-version\": \"1.1\", \"metadata\": [{ \"preferred_network\": \"login.microsoftonline.com\", \"preferred_cache\": \"login.windows.net\", \"aliases\": [\"login.microsoftonline.com\", \"login.windows.net\", \"login.microsoft.com\", \"sts.windows.net\"] }, { \"preferred_network\": \"login.partner.microsoftonline.cn\", \"preferred_cache\": \"login.partner.microsoftonline.cn\", \"aliases\": [\"login.partner.microsoftonline.cn\", \"login.chinacloudapi.cn\"] }, { \"preferred_network\": \"login.microsoftonline.de\", \"preferred_cache\": \"login.microsoftonline.de\", \"aliases\": [\"login.microsoftonline.de\"] }, { \"preferred_network\": \"login.microsoftonline.us\", \"preferred_cache\": \"login.microsoftonline.us\", \"aliases\": [\"login.microsoftonline.us\", \"login.usgovcloudapi.net\"] }, { \"preferred_network\": \"login-us.microsoftonline.com\", \"preferred_cache\": \"login-us.microsoftonline.com\", \"aliases\": [\"login-us.microsoftonline.com\"] }] } } };\r\nvar EndpointMetadata = rawMetdataJSON.endpointMetadata;\r\nvar InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;\n\nexport { EndpointMetadata, InstanceDiscoveryMetadata, rawMetdataJSON };\n//# sourceMappingURL=AuthorityMetadata.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Protocol modes supported by MSAL.\r\n */\r\nvar ProtocolMode;\r\n(function (ProtocolMode) {\r\n ProtocolMode[\"AAD\"] = \"AAD\";\r\n ProtocolMode[\"OIDC\"] = \"OIDC\";\r\n})(ProtocolMode || (ProtocolMode = {}));\n\nexport { ProtocolMode };\n//# sourceMappingURL=ProtocolMode.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.js';\nimport { TimeUtils } from '../../utils/TimeUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar AuthorityMetadataEntity = /** @class */ (function () {\r\n function AuthorityMetadataEntity() {\r\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\r\n }\r\n /**\r\n * Update the entity with new aliases, preferred_cache and preferred_network values\r\n * @param metadata\r\n * @param fromNetwork\r\n */\r\n AuthorityMetadataEntity.prototype.updateCloudDiscoveryMetadata = function (metadata, fromNetwork) {\r\n this.aliases = metadata.aliases;\r\n this.preferred_cache = metadata.preferred_cache;\r\n this.preferred_network = metadata.preferred_network;\r\n this.aliasesFromNetwork = fromNetwork;\r\n };\r\n /**\r\n * Update the entity with new endpoints\r\n * @param metadata\r\n * @param fromNetwork\r\n */\r\n AuthorityMetadataEntity.prototype.updateEndpointMetadata = function (metadata, fromNetwork) {\r\n this.authorization_endpoint = metadata.authorization_endpoint;\r\n this.token_endpoint = metadata.token_endpoint;\r\n this.end_session_endpoint = metadata.end_session_endpoint;\r\n this.issuer = metadata.issuer;\r\n this.endpointsFromNetwork = fromNetwork;\r\n this.jwks_uri = metadata.jwks_uri;\r\n };\r\n /**\r\n * Save the authority that was used to create this cache entry\r\n * @param authority\r\n */\r\n AuthorityMetadataEntity.prototype.updateCanonicalAuthority = function (authority) {\r\n this.canonical_authority = authority;\r\n };\r\n /**\r\n * Reset the exiresAt value\r\n */\r\n AuthorityMetadataEntity.prototype.resetExpiresAt = function () {\r\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\r\n };\r\n /**\r\n * Returns whether or not the data needs to be refreshed\r\n */\r\n AuthorityMetadataEntity.prototype.isExpired = function () {\r\n return this.expiresAt <= TimeUtils.nowSeconds();\r\n };\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n AuthorityMetadataEntity.isAuthorityMetadataEntity = function (key, entity) {\r\n if (!entity) {\r\n return false;\r\n }\r\n return (key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\r\n entity.hasOwnProperty(\"aliases\") &&\r\n entity.hasOwnProperty(\"preferred_cache\") &&\r\n entity.hasOwnProperty(\"preferred_network\") &&\r\n entity.hasOwnProperty(\"canonical_authority\") &&\r\n entity.hasOwnProperty(\"authorization_endpoint\") &&\r\n entity.hasOwnProperty(\"token_endpoint\") &&\r\n entity.hasOwnProperty(\"issuer\") &&\r\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\r\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\r\n entity.hasOwnProperty(\"expiresAt\") &&\r\n entity.hasOwnProperty(\"jwks_uri\"));\r\n };\r\n return AuthorityMetadataEntity;\r\n}());\n\nexport { AuthorityMetadataEntity };\n//# sourceMappingURL=AuthorityMetadataEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryResponse(response) {\r\n return (response.hasOwnProperty(\"tenant_discovery_endpoint\") &&\r\n response.hasOwnProperty(\"metadata\"));\r\n}\n\nexport { isCloudInstanceDiscoveryResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryResponse.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryErrorResponse(response) {\r\n return (response.hasOwnProperty(\"error\") &&\r\n response.hasOwnProperty(\"error_description\"));\r\n}\n\nexport { isCloudInstanceDiscoveryErrorResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryErrorResponse.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { RegionDiscoverySources, ResponseCodes, Constants } from '../utils/Constants.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar RegionDiscovery = /** @class */ (function () {\r\n function RegionDiscovery(networkInterface, performanceClient, correlationId) {\r\n this.networkInterface = networkInterface;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n }\r\n /**\r\n * Detect the region from the application's environment.\r\n *\r\n * @returns Promise\r\n */\r\n RegionDiscovery.prototype.detectRegion = function (environmentRegion, regionDiscoveryMetadata) {\r\n var _a, _b, _c, _d;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var autodetectedRegionName, options, localIMDSVersionResponse, currentIMDSVersion, currentIMDSVersionResponse;\r\n return __generator(this, function (_e) {\r\n switch (_e.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);\r\n autodetectedRegionName = environmentRegion;\r\n if (!!autodetectedRegionName) return [3 /*break*/, 8];\r\n options = RegionDiscovery.IMDS_OPTIONS;\r\n _e.label = 1;\r\n case 1:\r\n _e.trys.push([1, 6, , 7]);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);\r\n return [4 /*yield*/, this.getRegionFromIMDS(Constants.IMDS_VERSION, options)];\r\n case 2:\r\n localIMDSVersionResponse = _e.sent();\r\n if (localIMDSVersionResponse.status === ResponseCodes.httpSuccess) {\r\n autodetectedRegionName = localIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;\r\n }\r\n if (!(localIMDSVersionResponse.status === ResponseCodes.httpBadRequest)) return [3 /*break*/, 5];\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);\r\n return [4 /*yield*/, this.getCurrentVersion(options)];\r\n case 3:\r\n currentIMDSVersion = _e.sent();\r\n if (!currentIMDSVersion) {\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return [2 /*return*/, null];\r\n }\r\n (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);\r\n return [4 /*yield*/, this.getRegionFromIMDS(currentIMDSVersion, options)];\r\n case 4:\r\n currentIMDSVersionResponse = _e.sent();\r\n if (currentIMDSVersionResponse.status === ResponseCodes.httpSuccess) {\r\n autodetectedRegionName = currentIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.IMDS;\r\n }\r\n _e.label = 5;\r\n case 5: return [3 /*break*/, 7];\r\n case 6:\r\n _e.sent();\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return [2 /*return*/, null];\r\n case 7: return [3 /*break*/, 9];\r\n case 8:\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.ENVIRONMENT_VARIABLE;\r\n _e.label = 9;\r\n case 9:\r\n // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION\r\n if (!autodetectedRegionName) {\r\n regionDiscoveryMetadata.region_source = RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n }\r\n return [2 /*return*/, autodetectedRegionName || null];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Make the call to the IMDS endpoint\r\n *\r\n * @param imdsEndpointUrl\r\n * @returns Promise>\r\n */\r\n RegionDiscovery.prototype.getRegionFromIMDS = function (version, options) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_b) {\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);\r\n return [2 /*return*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + \"?api-version=\" + version + \"&format=text\", options, Constants.IMDS_TIMEOUT)];\r\n });\r\n });\r\n };\r\n /**\r\n * Get the most recent version of the IMDS endpoint available\r\n *\r\n * @returns Promise\r\n */\r\n RegionDiscovery.prototype.getCurrentVersion = function (options) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(Constants.IMDS_ENDPOINT + \"?format=json\", options)];\r\n case 2:\r\n response = _b.sent();\r\n // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.\r\n if (response.status === ResponseCodes.httpBadRequest && response.body && response.body[\"newest-versions\"] && response.body[\"newest-versions\"].length > 0) {\r\n return [2 /*return*/, response.body[\"newest-versions\"][0]];\r\n }\r\n return [2 /*return*/, null];\r\n case 3:\r\n _b.sent();\r\n return [2 /*return*/, null];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // Options for the IMDS endpoint request\r\n RegionDiscovery.IMDS_OPTIONS = {\r\n headers: {\r\n Metadata: \"true\",\r\n },\r\n };\r\n return RegionDiscovery;\r\n}());\n\nexport { RegionDiscovery };\n//# sourceMappingURL=RegionDiscovery.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { AuthorityType } from './AuthorityType.js';\nimport { isOpenIdConfigResponse } from './OpenIdConfigResponse.js';\nimport { UrlString } from '../url/UrlString.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes } from '../utils/Constants.js';\nimport { EndpointMetadata, InstanceDiscoveryMetadata } from './AuthorityMetadata.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { ProtocolMode } from './ProtocolMode.js';\nimport { AuthorityMetadataEntity } from '../cache/entities/AuthorityMetadataEntity.js';\nimport { AzureCloudInstance } from './AuthorityOptions.js';\nimport { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.js';\nimport { isCloudInstanceDiscoveryErrorResponse } from './CloudInstanceDiscoveryErrorResponse.js';\nimport { RegionDiscovery } from './RegionDiscovery.js';\nimport { AuthError } from '../error/AuthError.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.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 * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\r\n * endpoint. It will store the pertinent config data in this object for use during token calls.\r\n */\r\nvar Authority = /** @class */ (function () {\r\n function Authority(authority, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {\r\n this.canonicalAuthority = authority;\r\n this._canonicalAuthority.validateAsUri();\r\n this.networkInterface = networkInterface;\r\n this.cacheManager = cacheManager;\r\n this.authorityOptions = authorityOptions;\r\n this.regionDiscoveryMetadata = { region_used: undefined, region_source: undefined, region_outcome: undefined };\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n this.regionDiscovery = new RegionDiscovery(networkInterface, this.performanceClient, this.correlationId);\r\n }\r\n Object.defineProperty(Authority.prototype, \"authorityType\", {\r\n // See above for AuthorityType\r\n get: function () {\r\n // CIAM auth url pattern is being standardized as: .ciamlogin.com\r\n if (this.canonicalAuthorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {\r\n return AuthorityType.Ciam;\r\n }\r\n var pathSegments = this.canonicalAuthorityUrlComponents.PathSegments;\r\n if (pathSegments.length) {\r\n switch (pathSegments[0].toLowerCase()) {\r\n case Constants.ADFS:\r\n return AuthorityType.Adfs;\r\n case Constants.DSTS:\r\n return AuthorityType.Dsts;\r\n }\r\n }\r\n return AuthorityType.Default;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"protocolMode\", {\r\n /**\r\n * ProtocolMode enum representing the way endpoints are constructed.\r\n */\r\n get: function () {\r\n return this.authorityOptions.protocolMode;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"options\", {\r\n /**\r\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\r\n */\r\n get: function () {\r\n return this.authorityOptions;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"canonicalAuthority\", {\r\n /**\r\n * A URL that is the authority set by the developer\r\n */\r\n get: function () {\r\n return this._canonicalAuthority.urlString;\r\n },\r\n /**\r\n * Sets canonical authority.\r\n */\r\n set: function (url) {\r\n this._canonicalAuthority = new UrlString(url);\r\n this._canonicalAuthority.validateAsUri();\r\n this._canonicalAuthorityUrlComponents = null;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"canonicalAuthorityUrlComponents\", {\r\n /**\r\n * Get authority components.\r\n */\r\n get: function () {\r\n if (!this._canonicalAuthorityUrlComponents) {\r\n this._canonicalAuthorityUrlComponents = this._canonicalAuthority.getUrlComponents();\r\n }\r\n return this._canonicalAuthorityUrlComponents;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"hostnameAndPort\", {\r\n /**\r\n * Get hostname and port i.e. login.microsoftonline.com\r\n */\r\n get: function () {\r\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"tenant\", {\r\n /**\r\n * Get tenant for authority.\r\n */\r\n get: function () {\r\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"authorizationEndpoint\", {\r\n /**\r\n * OAuth /authorize endpoint for requests\r\n */\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n var endpoint = this.replacePath(this.metadata.authorization_endpoint);\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"tokenEndpoint\", {\r\n /**\r\n * OAuth /token endpoint for requests\r\n */\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n var endpoint = this.replacePath(this.metadata.token_endpoint);\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"deviceCodeEndpoint\", {\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n var endpoint = this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"endSessionEndpoint\", {\r\n /**\r\n * OAuth logout endpoint for requests\r\n */\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n // ROPC policies may not have end_session_endpoint set\r\n if (!this.metadata.end_session_endpoint) {\r\n throw ClientAuthError.createLogoutNotSupportedError();\r\n }\r\n var endpoint = this.replacePath(this.metadata.end_session_endpoint);\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"selfSignedJwtAudience\", {\r\n /**\r\n * OAuth issuer for requests\r\n */\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n var endpoint = this.replacePath(this.metadata.issuer);\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"jwksUri\", {\r\n /**\r\n * Jwks_uri for token signing keys\r\n */\r\n get: function () {\r\n if (this.discoveryComplete()) {\r\n var endpoint = this.replacePath(this.metadata.jwks_uri);\r\n return this.replaceTenant(endpoint);\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Replaces tenant in url path with current tenant. Defaults to common.\r\n * @param urlString\r\n */\r\n Authority.prototype.replaceTenant = function (urlString) {\r\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\r\n };\r\n /**\r\n * Replaces path such as tenant or policy with the current tenant or policy.\r\n * @param urlString\r\n */\r\n Authority.prototype.replacePath = function (urlString) {\r\n var endpoint = urlString;\r\n var cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\r\n var cachedAuthorityParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\r\n var currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\r\n currentAuthorityParts.forEach(function (currentPart, index) {\r\n var cachedPart = cachedAuthorityParts[index];\r\n if (currentPart !== cachedPart) {\r\n endpoint = endpoint.replace(\"/\" + cachedPart + \"/\", \"/\" + currentPart + \"/\");\r\n }\r\n });\r\n return endpoint;\r\n };\r\n Object.defineProperty(Authority.prototype, \"defaultOpenIdConfigurationEndpoint\", {\r\n /**\r\n * The default open id configuration endpoint for any canonical authority.\r\n */\r\n get: function () {\r\n if (this.authorityType === AuthorityType.Adfs ||\r\n this.authorityType === AuthorityType.Dsts ||\r\n this.protocolMode === ProtocolMode.OIDC) {\r\n return this.canonicalAuthority + \".well-known/openid-configuration\";\r\n }\r\n return this.canonicalAuthority + \"v2.0/.well-known/openid-configuration\";\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n /**\r\n * Boolean that returns whethr or not tenant discovery has been completed.\r\n */\r\n Authority.prototype.discoveryComplete = function () {\r\n return !!this.metadata;\r\n };\r\n /**\r\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\r\n * and the /authorize, /token and logout endpoints.\r\n */\r\n Authority.prototype.resolveEndpointsAsync = function () {\r\n var _a, _b, _c;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var metadataEntity, cloudDiscoverySource, endpointSource, cacheKey;\r\n return __generator(this, function (_d) {\r\n switch (_d.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);\r\n metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\r\n if (!metadataEntity) {\r\n metadataEntity = new AuthorityMetadataEntity();\r\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\r\n }\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);\r\n return [4 /*yield*/, this.updateCloudDiscoveryMetadata(metadataEntity)];\r\n case 1:\r\n cloudDiscoverySource = _d.sent();\r\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\r\n (_c = this.performanceClient) === null || _c === void 0 ? void 0 : _c.setPreQueueTime(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);\r\n return [4 /*yield*/, this.updateEndpointMetadata(metadataEntity)];\r\n case 2:\r\n endpointSource = _d.sent();\r\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE && endpointSource !== AuthorityMetadataSource.CACHE) {\r\n // Reset the expiration time unless both values came from a successful cache lookup\r\n metadataEntity.resetExpiresAt();\r\n metadataEntity.updateCanonicalAuthority(this.canonicalAuthority);\r\n }\r\n cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\r\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\r\n this.metadata = metadataEntity;\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\r\n * @param metadataEntity\r\n */\r\n Authority.prototype.updateEndpointMetadata = function (metadataEntity) {\r\n var _a, _b, _c, _d, _e, _f;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var metadata, harcodedMetadata;\r\n return __generator(this, function (_g) {\r\n switch (_g.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);\r\n metadata = this.getEndpointMetadataFromConfig();\r\n if (metadata) {\r\n metadataEntity.updateEndpointMetadata(metadata, false);\r\n return [2 /*return*/, AuthorityMetadataSource.CONFIG];\r\n }\r\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.endpointsFromNetwork && !metadataEntity.isExpired()) {\r\n // No need to update\r\n return [2 /*return*/, AuthorityMetadataSource.CACHE];\r\n }\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);\r\n return [4 /*yield*/, this.getEndpointMetadataFromNetwork()];\r\n case 1:\r\n metadata = _g.sent();\r\n if (!metadata) return [3 /*break*/, 4];\r\n if (!((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.azureRegion)) return [3 /*break*/, 3];\r\n (_d = this.performanceClient) === null || _d === void 0 ? void 0 : _d.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);\r\n return [4 /*yield*/, this.updateMetadataWithRegionalInformation(metadata)];\r\n case 2:\r\n metadata = _g.sent();\r\n _g.label = 3;\r\n case 3:\r\n metadataEntity.updateEndpointMetadata(metadata, true);\r\n return [2 /*return*/, AuthorityMetadataSource.NETWORK];\r\n case 4:\r\n harcodedMetadata = this.getEndpointMetadataFromHardcodedValues();\r\n if (!(harcodedMetadata && !this.authorityOptions.skipAuthorityMetadataCache)) return [3 /*break*/, 7];\r\n if (!((_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion)) return [3 /*break*/, 6];\r\n (_f = this.performanceClient) === null || _f === void 0 ? void 0 : _f.setPreQueueTime(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);\r\n return [4 /*yield*/, this.updateMetadataWithRegionalInformation(harcodedMetadata)];\r\n case 5:\r\n harcodedMetadata = _g.sent();\r\n _g.label = 6;\r\n case 6:\r\n metadataEntity.updateEndpointMetadata(harcodedMetadata, false);\r\n return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];\r\n case 7: throw ClientAuthError.createUnableToGetOpenidConfigError(this.defaultOpenIdConfigurationEndpoint);\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Compares the number of url components after the domain to determine if the cached\r\n * authority metadata can be used for the requested authority. Protects against same domain different\r\n * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\r\n * @param metadataEntity\r\n */\r\n Authority.prototype.isAuthoritySameType = function (metadataEntity) {\r\n var cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\r\n var cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\r\n return cachedParts.length === this.canonicalAuthorityUrlComponents.PathSegments.length;\r\n };\r\n /**\r\n * Parse authorityMetadata config option\r\n */\r\n Authority.prototype.getEndpointMetadataFromConfig = function () {\r\n if (this.authorityOptions.authorityMetadata) {\r\n try {\r\n return JSON.parse(this.authorityOptions.authorityMetadata);\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n Authority.prototype.getEndpointMetadataFromNetwork = function () {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var options, response;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);\r\n options = {};\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.networkInterface.\r\n sendGetRequestAsync(this.defaultOpenIdConfigurationEndpoint, options)];\r\n case 2:\r\n response = _b.sent();\r\n return [2 /*return*/, isOpenIdConfigResponse(response.body) ? response.body : null];\r\n case 3:\r\n _b.sent();\r\n return [2 /*return*/, null];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Get OAuth endpoints for common authorities.\r\n */\r\n Authority.prototype.getEndpointMetadataFromHardcodedValues = function () {\r\n if (this.canonicalAuthority in EndpointMetadata) {\r\n return EndpointMetadata[this.canonicalAuthority];\r\n }\r\n return null;\r\n };\r\n /**\r\n * Update the retrieved metadata with regional information.\r\n */\r\n Authority.prototype.updateMetadataWithRegionalInformation = function (metadata) {\r\n var _a, _b, _c, _d, _e, _f, _g;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var autodetectedRegionName, azureRegion;\r\n return __generator(this, function (_h) {\r\n switch (_h.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);\r\n return [4 /*yield*/, this.regionDiscovery.detectRegion((_c = this.authorityOptions.azureRegionConfiguration) === null || _c === void 0 ? void 0 : _c.environmentRegion, this.regionDiscoveryMetadata)];\r\n case 1:\r\n autodetectedRegionName = _h.sent();\r\n azureRegion = ((_d = this.authorityOptions.azureRegionConfiguration) === null || _d === void 0 ? void 0 : _d.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG\r\n ? autodetectedRegionName\r\n : (_e = this.authorityOptions.azureRegionConfiguration) === null || _e === void 0 ? void 0 : _e.azureRegion;\r\n if (((_f = this.authorityOptions.azureRegionConfiguration) === null || _f === void 0 ? void 0 : _f.azureRegion) === Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\r\n this.regionDiscoveryMetadata.region_outcome = autodetectedRegionName ?\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL :\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\r\n }\r\n else {\r\n if (autodetectedRegionName) {\r\n this.regionDiscoveryMetadata.region_outcome = (((_g = this.authorityOptions.azureRegionConfiguration) === null || _g === void 0 ? void 0 : _g.azureRegion) === autodetectedRegionName) ?\r\n RegionDiscoveryOutcomes.CONFIGURED_MATCHES_DETECTED :\r\n RegionDiscoveryOutcomes.CONFIGURED_NOT_DETECTED;\r\n }\r\n else {\r\n this.regionDiscoveryMetadata.region_outcome = RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\r\n }\r\n }\r\n if (azureRegion) {\r\n this.regionDiscoveryMetadata.region_used = azureRegion;\r\n return [2 /*return*/, Authority.replaceWithRegionalInformation(metadata, azureRegion)];\r\n }\r\n return [2 /*return*/, metadata];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache\r\n * and returns where the information was retrieved from\r\n * @param metadataEntity\r\n * @returns AuthorityMetadataSource\r\n */\r\n Authority.prototype.updateCloudDiscoveryMetadata = function (metadataEntity) {\r\n var _a, _b;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var metadata, metadataEntityExpired, harcodedMetadata;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);\r\n // attempt to read metadata from the config\r\n this.logger.verbose(\"Attempting to get cloud discovery metadata in the config\");\r\n this.logger.verbosePii(\"Known Authorities: \" + (this.authorityOptions.knownAuthorities || Constants.NOT_APPLICABLE));\r\n this.logger.verbosePii(\"Authority Metadata: \" + (this.authorityOptions.authorityMetadata || Constants.NOT_APPLICABLE));\r\n this.logger.verbosePii(\"Canonical Authority: \" + (metadataEntity.canonical_authority || Constants.NOT_APPLICABLE));\r\n metadata = this.getCloudDiscoveryMetadataFromConfig();\r\n if (metadata) {\r\n this.logger.verbose(\"Found cloud discovery metadata in the config.\");\r\n metadataEntity.updateCloudDiscoveryMetadata(metadata, false);\r\n return [2 /*return*/, AuthorityMetadataSource.CONFIG];\r\n }\r\n // If the cached metadata came from config but that config was not passed to this instance, we must go to the network\r\n this.logger.verbose(\"Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the cache.\");\r\n metadataEntityExpired = metadataEntity.isExpired();\r\n if (this.isAuthoritySameType(metadataEntity) && metadataEntity.aliasesFromNetwork && !metadataEntityExpired) {\r\n this.logger.verbose(\"Found metadata in the cache.\");\r\n // No need to update\r\n return [2 /*return*/, AuthorityMetadataSource.CACHE];\r\n }\r\n else if (metadataEntityExpired) {\r\n this.logger.verbose(\"The metadata entity is expired.\");\r\n }\r\n this.logger.verbose(\"Did not find cloud discovery metadata in the cache... Attempting to get cloud discovery metadata from the network.\");\r\n (_b = this.performanceClient) === null || _b === void 0 ? void 0 : _b.setPreQueueTime(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);\r\n return [4 /*yield*/, this.getCloudDiscoveryMetadataFromNetwork()];\r\n case 1:\r\n metadata = _c.sent();\r\n if (metadata) {\r\n this.logger.verbose(\"cloud discovery metadata was successfully returned from getCloudDiscoveryMetadataFromNetwork()\");\r\n metadataEntity.updateCloudDiscoveryMetadata(metadata, true);\r\n return [2 /*return*/, AuthorityMetadataSource.NETWORK];\r\n }\r\n this.logger.verbose(\"Did not find cloud discovery metadata from the network... Attempting to get cloud discovery metadata from hardcoded values.\");\r\n harcodedMetadata = this.getCloudDiscoveryMetadataFromHarcodedValues();\r\n if (harcodedMetadata && !this.options.skipAuthorityMetadataCache) {\r\n this.logger.verbose(\"Found cloud discovery metadata from hardcoded values.\");\r\n metadataEntity.updateCloudDiscoveryMetadata(harcodedMetadata, false);\r\n return [2 /*return*/, AuthorityMetadataSource.HARDCODED_VALUES];\r\n }\r\n // Metadata could not be obtained from the config, cache, network or hardcoded values\r\n this.logger.error(\"Did not find cloud discovery metadata from hardcoded values... Metadata could not be obtained from config, cache, network or hardcoded values. Throwing Untrusted Authority Error.\");\r\n throw ClientConfigurationError.createUntrustedAuthorityError();\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\r\n */\r\n Authority.prototype.getCloudDiscoveryMetadataFromConfig = function () {\r\n // CIAM does not support cloud discovery metadata\r\n if (this.authorityType === AuthorityType.Ciam) {\r\n this.logger.verbose(\"CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n // Check if network response was provided in config\r\n if (this.authorityOptions.cloudDiscoveryMetadata) {\r\n this.logger.verbose(\"The cloud discovery metadata has been provided as a network response, in the config.\");\r\n try {\r\n this.logger.verbose(\"Attempting to parse the cloud discovery metadata.\");\r\n var parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata);\r\n var metadata = Authority.getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);\r\n this.logger.verbose(\"Parsed the cloud discovery metadata.\");\r\n if (metadata) {\r\n this.logger.verbose(\"There is returnable metadata attached to the parsed cloud discovery metadata.\");\r\n return metadata;\r\n }\r\n else {\r\n this.logger.verbose(\"There is no metadata attached to the parsed cloud discovery metadata.\");\r\n }\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.\");\r\n throw ClientConfigurationError.createInvalidCloudDiscoveryMetadataError();\r\n }\r\n }\r\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\r\n if (this.isInKnownAuthorities()) {\r\n this.logger.verbose(\"The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return null;\r\n };\r\n /**\r\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n Authority.prototype.getCloudDiscoveryMetadataFromNetwork = function () {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var instanceDiscoveryEndpoint, options, match, response, typedResponseBody, metadata, error_1, typedError;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);\r\n instanceDiscoveryEndpoint = \"\" + Constants.AAD_INSTANCE_DISCOVERY_ENDPT + this.canonicalAuthority + \"oauth2/v2.0/authorize\";\r\n options = {};\r\n match = null;\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options)];\r\n case 2:\r\n response = _b.sent();\r\n typedResponseBody = void 0;\r\n metadata = void 0;\r\n if (isCloudInstanceDiscoveryResponse(response.body)) {\r\n typedResponseBody = response.body;\r\n metadata = typedResponseBody.metadata;\r\n this.logger.verbosePii(\"tenant_discovery_endpoint is: \" + typedResponseBody.tenant_discovery_endpoint);\r\n }\r\n else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {\r\n this.logger.warning(\"A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: \" + response.status);\r\n typedResponseBody = response.body;\r\n if (typedResponseBody.error === Constants.INVALID_INSTANCE) {\r\n this.logger.error(\"The CloudInstanceDiscoveryErrorResponse error is invalid_instance.\");\r\n return [2 /*return*/, null];\r\n }\r\n this.logger.warning(\"The CloudInstanceDiscoveryErrorResponse error is \" + typedResponseBody.error);\r\n this.logger.warning(\"The CloudInstanceDiscoveryErrorResponse error description is \" + typedResponseBody.error_description);\r\n this.logger.warning(\"Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []\");\r\n metadata = [];\r\n }\r\n else {\r\n this.logger.error(\"AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse\");\r\n return [2 /*return*/, null];\r\n }\r\n this.logger.verbose(\"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n match = Authority.getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);\r\n return [3 /*break*/, 4];\r\n case 3:\r\n error_1 = _b.sent();\r\n if (error_1 instanceof AuthError) {\r\n this.logger.error(\"There was a network error while attempting to get the cloud discovery instance metadata.\\nError: \" + error_1.errorCode + \"\\nError Description: \" + error_1.errorMessage);\r\n }\r\n else {\r\n typedError = error_1;\r\n this.logger.error(\"A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\\nError: \" + typedError.name + \"\\nError Description: \" + typedError.message);\r\n }\r\n return [2 /*return*/, null];\r\n case 4:\r\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\r\n if (!match) {\r\n this.logger.warning(\"The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n this.logger.verbose(\"Creating custom Authority for custom domain scenario.\");\r\n match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return [2 /*return*/, match];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Get cloud discovery metadata for common authorities\r\n */\r\n Authority.prototype.getCloudDiscoveryMetadataFromHarcodedValues = function () {\r\n if (this.canonicalAuthority in InstanceDiscoveryMetadata) {\r\n return InstanceDiscoveryMetadata[this.canonicalAuthority];\r\n }\r\n return null;\r\n };\r\n /**\r\n * Helper function to determine if this host is included in the knownAuthorities config option\r\n */\r\n Authority.prototype.isInKnownAuthorities = function () {\r\n var _this = this;\r\n var matches = this.authorityOptions.knownAuthorities.filter(function (authority) {\r\n return UrlString.getDomainFromUrl(authority).toLowerCase() === _this.hostnameAndPort;\r\n });\r\n return matches.length > 0;\r\n };\r\n /**\r\n * helper function to populate the authority based on azureCloudOptions\r\n * @param authorityString\r\n * @param azureCloudOptions\r\n */\r\n Authority.generateAuthority = function (authorityString, azureCloudOptions) {\r\n var authorityAzureCloudInstance;\r\n if (azureCloudOptions && azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {\r\n var tenant = azureCloudOptions.tenant ? azureCloudOptions.tenant : Constants.DEFAULT_COMMON_TENANT;\r\n authorityAzureCloudInstance = azureCloudOptions.azureCloudInstance + \"/\" + tenant + \"/\";\r\n }\r\n return authorityAzureCloudInstance ? authorityAzureCloudInstance : authorityString;\r\n };\r\n /**\r\n * Creates cloud discovery metadata object from a given host\r\n * @param host\r\n */\r\n Authority.createCloudDiscoveryMetadataFromHost = function (host) {\r\n return {\r\n preferred_network: host,\r\n preferred_cache: host,\r\n aliases: [host]\r\n };\r\n };\r\n /**\r\n * Searches instance discovery network response for the entry that contains the host in the aliases list\r\n * @param response\r\n * @param authority\r\n */\r\n Authority.getCloudDiscoveryMetadataFromNetworkResponse = function (response, authority) {\r\n for (var i = 0; i < response.length; i++) {\r\n var metadata = response[i];\r\n if (metadata.aliases.indexOf(authority) > -1) {\r\n return metadata;\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * helper function to generate environment from authority object\r\n */\r\n Authority.prototype.getPreferredCache = function () {\r\n if (this.discoveryComplete()) {\r\n return this.metadata.preferred_cache;\r\n }\r\n else {\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(\"Discovery incomplete.\");\r\n }\r\n };\r\n /**\r\n * Returns whether or not the provided host is an alias of this authority instance\r\n * @param host\r\n */\r\n Authority.prototype.isAlias = function (host) {\r\n return this.metadata.aliases.indexOf(host) > -1;\r\n };\r\n /**\r\n * Checks whether the provided host is that of a public cloud authority\r\n *\r\n * @param authority string\r\n * @returns bool\r\n */\r\n Authority.isPublicCloudAuthority = function (host) {\r\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\r\n };\r\n /**\r\n * Rebuild the authority string with the region\r\n *\r\n * @param host string\r\n * @param region string\r\n */\r\n Authority.buildRegionalAuthorityString = function (host, region, queryString) {\r\n // Create and validate a Url string object with the initial authority string\r\n var authorityUrlInstance = new UrlString(host);\r\n authorityUrlInstance.validateAsUri();\r\n var authorityUrlParts = authorityUrlInstance.getUrlComponents();\r\n var hostNameAndPort = region + \".\" + authorityUrlParts.HostNameAndPort;\r\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\r\n hostNameAndPort = region + \".\" + Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX;\r\n }\r\n // Include the query string portion of the url\r\n var url = UrlString.constructAuthorityUriFromObject(__assign(__assign({}, authorityUrlInstance.getUrlComponents()), { HostNameAndPort: hostNameAndPort })).urlString;\r\n // Add the query string if a query string was provided\r\n if (queryString)\r\n return url + \"?\" + queryString;\r\n return url;\r\n };\r\n /**\r\n * Replace the endpoints in the metadata object with their regional equivalents.\r\n *\r\n * @param metadata OpenIdConfigResponse\r\n * @param azureRegion string\r\n */\r\n Authority.replaceWithRegionalInformation = function (metadata, azureRegion) {\r\n metadata.authorization_endpoint = Authority.buildRegionalAuthorityString(metadata.authorization_endpoint, azureRegion);\r\n // TODO: Enquire on whether we should leave the query string or remove it before releasing the feature\r\n metadata.token_endpoint = Authority.buildRegionalAuthorityString(metadata.token_endpoint, azureRegion, Constants.REGIONAL_AUTH_NON_MSI_QUERY_STRING);\r\n if (metadata.end_session_endpoint) {\r\n metadata.end_session_endpoint = Authority.buildRegionalAuthorityString(metadata.end_session_endpoint, azureRegion);\r\n }\r\n return metadata;\r\n };\r\n /**\r\n * Transform CIAM_AUTHORIY as per the below rules:\r\n * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it\r\n *\r\n * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`\r\n * `ciamlogin.com` can also change in the future and we should accommodate the same\r\n *\r\n * @param authority\r\n */\r\n Authority.transformCIAMAuthority = function (authority) {\r\n var ciamAuthority = authority;\r\n var authorityUrl = new UrlString(authority);\r\n var authorityUrlComponents = authorityUrl.getUrlComponents();\r\n // check if transformation is needed\r\n if (authorityUrlComponents.PathSegments.length === 0 && (authorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL))) {\r\n var tenantIdOrDomain = authorityUrlComponents.HostNameAndPort.split(\".\")[0];\r\n ciamAuthority = \"\" + ciamAuthority + tenantIdOrDomain + Constants.AAD_TENANT_DOMAIN_SUFFIX;\r\n }\r\n return ciamAuthority;\r\n };\r\n return Authority;\r\n}());\n\nexport { Authority };\n//# sourceMappingURL=Authority.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { Authority } from './Authority.js';\nimport { ClientConfigurationError } from '../error/ClientConfigurationError.js';\nimport { StringUtils } from '../utils/StringUtils.js';\nimport { ClientAuthError } from '../error/ClientAuthError.js';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar AuthorityFactory = /** @class */ (function () {\r\n function AuthorityFactory() {\r\n }\r\n /**\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\r\n *\r\n * Also performs endpoint discovery.\r\n *\r\n * @param authorityUri\r\n * @param networkClient\r\n * @param protocolMode\r\n */\r\n AuthorityFactory.createDiscoveredInstance = function (authorityUri, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authorityUriFinal, acquireTokenAuthority, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n performanceClient === null || performanceClient === void 0 ? void 0 : performanceClient.addQueueMeasurement(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);\r\n authorityUriFinal = Authority.transformCIAMAuthority(authorityUri);\r\n acquireTokenAuthority = AuthorityFactory.createInstance(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, performanceClient, correlationId);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n performanceClient === null || performanceClient === void 0 ? void 0 : performanceClient.setPreQueueTime(PerformanceEvents.AuthorityResolveEndpointsAsync, correlationId);\r\n return [4 /*yield*/, acquireTokenAuthority.resolveEndpointsAsync()];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, acquireTokenAuthority];\r\n case 3:\r\n e_1 = _a.sent();\r\n throw ClientAuthError.createEndpointDiscoveryIncompleteError(e_1);\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\r\n *\r\n * Does not perform endpoint discovery.\r\n *\r\n * @param authorityUrl\r\n * @param networkInterface\r\n * @param protocolMode\r\n */\r\n AuthorityFactory.createInstance = function (authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId) {\r\n // Throw error if authority url is empty\r\n if (StringUtils.isEmpty(authorityUrl)) {\r\n throw ClientConfigurationError.createUrlEmptyError();\r\n }\r\n return new Authority(authorityUrl, networkInterface, cacheManager, authorityOptions, logger, performanceClient, correlationId);\r\n };\r\n return AuthorityFactory;\r\n}());\n\nexport { AuthorityFactory };\n//# sourceMappingURL=AuthorityFactory.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ServerTelemetryEntity = /** @class */ (function () {\r\n function ServerTelemetryEntity() {\r\n this.failedRequests = [];\r\n this.errors = [];\r\n this.cacheHits = 0;\r\n }\r\n /**\r\n * validates if a given cache entry is \"Telemetry\", parses \r\n * @param key\r\n * @param entity\r\n */\r\n ServerTelemetryEntity.isServerTelemetryEntity = function (key, entity) {\r\n var validateKey = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\r\n var validateEntity = true;\r\n if (entity) {\r\n validateEntity =\r\n entity.hasOwnProperty(\"failedRequests\") &&\r\n entity.hasOwnProperty(\"errors\") &&\r\n entity.hasOwnProperty(\"cacheHits\");\r\n }\r\n return validateKey && validateEntity;\r\n };\r\n return ServerTelemetryEntity;\r\n}());\n\nexport { ServerTelemetryEntity };\n//# sourceMappingURL=ServerTelemetryEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { ThrottlingConstants } from '../../utils/Constants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ThrottlingEntity = /** @class */ (function () {\r\n function ThrottlingEntity() {\r\n }\r\n /**\r\n * validates if a given cache entry is \"Throttling\", parses \r\n * @param key\r\n * @param entity\r\n */\r\n ThrottlingEntity.isThrottlingEntity = function (key, entity) {\r\n var validateKey = false;\r\n if (key) {\r\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\r\n }\r\n var validateEntity = true;\r\n if (entity) {\r\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\r\n }\r\n return validateKey && validateEntity;\r\n };\r\n return ThrottlingEntity;\r\n}());\n\nexport { ThrottlingEntity };\n//# sourceMappingURL=ThrottlingEntity.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { AuthError } from '../error/AuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar StubbedNetworkModule = {\r\n sendGetRequestAsync: function () {\r\n var notImplErr = \"Network interface - sendGetRequestAsync() has not been implemented for the Network interface.\";\r\n return Promise.reject(AuthError.createUnexpectedError(notImplErr));\r\n },\r\n sendPostRequestAsync: function () {\r\n var notImplErr = \"Network interface - sendPostRequestAsync() has not been implemented for the Network interface.\";\r\n return Promise.reject(AuthError.createUnexpectedError(notImplErr));\r\n }\r\n};\n\nexport { StubbedNetworkModule };\n//# sourceMappingURL=INetworkModule.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { AuthError } from './AuthError.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 * ClientAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar JoseHeaderErrorMessage = {\r\n missingKidError: {\r\n code: \"missing_kid_error\",\r\n desc: \"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.\"\r\n },\r\n missingAlgError: {\r\n code: \"missing_alg_error\",\r\n desc: \"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided.\"\r\n },\r\n};\r\n/**\r\n * Error thrown when there is an error in the client code running on the browser.\r\n */\r\nvar JoseHeaderError = /** @class */ (function (_super) {\r\n __extends(JoseHeaderError, _super);\r\n function JoseHeaderError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"JoseHeaderError\";\r\n Object.setPrototypeOf(_this, JoseHeaderError.prototype);\r\n return _this;\r\n }\r\n /**\r\n * Creates an error thrown when keyId isn't set on JOSE header.\r\n */\r\n JoseHeaderError.createMissingKidError = function () {\r\n return new JoseHeaderError(JoseHeaderErrorMessage.missingKidError.code, JoseHeaderErrorMessage.missingKidError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when algorithm isn't set on JOSE header.\r\n */\r\n JoseHeaderError.createMissingAlgError = function () {\r\n return new JoseHeaderError(JoseHeaderErrorMessage.missingAlgError.code, JoseHeaderErrorMessage.missingAlgError.desc);\r\n };\r\n return JoseHeaderError;\r\n}(AuthError));\n\nexport { JoseHeaderError, JoseHeaderErrorMessage };\n//# sourceMappingURL=JoseHeaderError.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { JoseHeaderError } from '../error/JoseHeaderError.js';\nimport { JsonTypes } from '../utils/Constants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar JoseHeader = /** @class */ (function () {\r\n function JoseHeader(options) {\r\n this.typ = options.typ;\r\n this.alg = options.alg;\r\n this.kid = options.kid;\r\n }\r\n /**\r\n * Builds SignedHttpRequest formatted JOSE Header from the\r\n * JOSE Header options provided or previously set on the object and returns\r\n * the stringified header object.\r\n * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.\r\n * @param shrHeaderOptions\r\n * @returns\r\n */\r\n JoseHeader.getShrHeaderString = function (shrHeaderOptions) {\r\n // KeyID is required on the SHR header\r\n if (!shrHeaderOptions.kid) {\r\n throw JoseHeaderError.createMissingKidError();\r\n }\r\n // Alg is required on the SHR header\r\n if (!shrHeaderOptions.alg) {\r\n throw JoseHeaderError.createMissingAlgError();\r\n }\r\n var shrHeader = new JoseHeader({\r\n // Access Token PoP headers must have type pop, but the type header can be overriden for special cases\r\n typ: shrHeaderOptions.typ || JsonTypes.Pop,\r\n kid: shrHeaderOptions.kid,\r\n alg: shrHeaderOptions.alg\r\n });\r\n return JSON.stringify(shrHeader);\r\n };\r\n return JoseHeader;\r\n}());\n\nexport { JoseHeader };\n//# sourceMappingURL=JoseHeader.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { SERVER_TELEM_CONSTANTS, CacheOutcome, Constants, Separators } from '../../utils/Constants.js';\nimport { ServerTelemetryEntity } from '../../cache/entities/ServerTelemetryEntity.js';\nimport { StringUtils } from '../../utils/StringUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ServerTelemetryManager = /** @class */ (function () {\r\n function ServerTelemetryManager(telemetryRequest, cacheManager) {\r\n this.cacheOutcome = CacheOutcome.NO_CACHE_HIT;\r\n this.cacheManager = cacheManager;\r\n this.apiId = telemetryRequest.apiId;\r\n this.correlationId = telemetryRequest.correlationId;\r\n this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;\r\n this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;\r\n this.telemetryCacheKey = SERVER_TELEM_CONSTANTS.CACHE_KEY + Separators.CACHE_KEY_SEPARATOR + telemetryRequest.clientId;\r\n }\r\n /**\r\n * API to add MSER Telemetry to request\r\n */\r\n ServerTelemetryManager.prototype.generateCurrentRequestHeaderValue = function () {\r\n var request = \"\" + this.apiId + SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR + this.cacheOutcome;\r\n var platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n var regionDiscoveryFields = this.getRegionDiscoveryFields();\r\n var requestWithRegionDiscoveryFields = [request, regionDiscoveryFields].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, requestWithRegionDiscoveryFields, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\r\n };\r\n /**\r\n * API to add MSER Telemetry for the last failed request\r\n */\r\n ServerTelemetryManager.prototype.generateLastRequestHeaderValue = function () {\r\n var lastRequests = this.getLastRequests();\r\n var maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);\r\n var failedRequests = lastRequests.failedRequests.slice(0, 2 * maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n var errors = lastRequests.errors.slice(0, maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n var errorCount = lastRequests.errors.length;\r\n // Indicate whether this header contains all data or partial data\r\n var overflow = maxErrors < errorCount ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;\r\n var platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\r\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, lastRequests.cacheHits, failedRequests, errors, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\r\n };\r\n /**\r\n * API to cache token failures for MSER data capture\r\n * @param error\r\n */\r\n ServerTelemetryManager.prototype.cacheFailedRequest = function (error) {\r\n var lastRequests = this.getLastRequests();\r\n if (lastRequests.errors.length >= SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {\r\n // Remove a cached error to make room, first in first out\r\n lastRequests.failedRequests.shift(); // apiId\r\n lastRequests.failedRequests.shift(); // correlationId\r\n lastRequests.errors.shift();\r\n }\r\n lastRequests.failedRequests.push(this.apiId, this.correlationId);\r\n if (!StringUtils.isEmpty(error.subError)) {\r\n lastRequests.errors.push(error.subError);\r\n }\r\n else if (!StringUtils.isEmpty(error.errorCode)) {\r\n lastRequests.errors.push(error.errorCode);\r\n }\r\n else if (!!error && error.toString()) {\r\n lastRequests.errors.push(error.toString());\r\n }\r\n else {\r\n lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);\r\n }\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n return;\r\n };\r\n /**\r\n * Update server telemetry cache entry by incrementing cache hit counter\r\n */\r\n ServerTelemetryManager.prototype.incrementCacheHits = function () {\r\n var lastRequests = this.getLastRequests();\r\n lastRequests.cacheHits += 1;\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\r\n return lastRequests.cacheHits;\r\n };\r\n /**\r\n * Get the server telemetry entity from cache or initialize a new one\r\n */\r\n ServerTelemetryManager.prototype.getLastRequests = function () {\r\n var initialValue = new ServerTelemetryEntity();\r\n var lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey);\r\n return lastRequests || initialValue;\r\n };\r\n /**\r\n * Remove server telemetry cache entry\r\n */\r\n ServerTelemetryManager.prototype.clearTelemetryCache = function () {\r\n var lastRequests = this.getLastRequests();\r\n var numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);\r\n var errorCount = lastRequests.errors.length;\r\n if (numErrorsFlushed === errorCount) {\r\n // All errors were sent on last request, clear Telemetry cache\r\n this.cacheManager.removeItem(this.telemetryCacheKey);\r\n }\r\n else {\r\n // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed\r\n var serverTelemEntity = new ServerTelemetryEntity();\r\n serverTelemEntity.failedRequests = lastRequests.failedRequests.slice(numErrorsFlushed * 2); // failedRequests contains 2 items for each error\r\n serverTelemEntity.errors = lastRequests.errors.slice(numErrorsFlushed);\r\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);\r\n }\r\n };\r\n /**\r\n * Returns the maximum number of errors that can be flushed to the server in the next network request\r\n * @param serverTelemetryEntity\r\n */\r\n ServerTelemetryManager.maxErrorsToSend = function (serverTelemetryEntity) {\r\n var i;\r\n var maxErrors = 0;\r\n var dataSize = 0;\r\n var errorCount = serverTelemetryEntity.errors.length;\r\n for (i = 0; i < errorCount; i++) {\r\n // failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs\r\n var apiId = serverTelemetryEntity.failedRequests[2 * i] || Constants.EMPTY_STRING;\r\n var correlationId = serverTelemetryEntity.failedRequests[2 * i + 1] || Constants.EMPTY_STRING;\r\n var errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;\r\n // Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators\r\n dataSize += apiId.toString().length + correlationId.toString().length + errorCode.length + 3;\r\n if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {\r\n // Adding this entry to the header would still keep header size below the limit\r\n maxErrors += 1;\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n return maxErrors;\r\n };\r\n /**\r\n * Get the region discovery fields\r\n *\r\n * @returns string\r\n */\r\n ServerTelemetryManager.prototype.getRegionDiscoveryFields = function () {\r\n var regionDiscoveryFields = [];\r\n regionDiscoveryFields.push(this.regionUsed || Constants.EMPTY_STRING);\r\n regionDiscoveryFields.push(this.regionSource || Constants.EMPTY_STRING);\r\n regionDiscoveryFields.push(this.regionOutcome || Constants.EMPTY_STRING);\r\n return regionDiscoveryFields.join(\",\");\r\n };\r\n /**\r\n * Update the region discovery metadata\r\n *\r\n * @param regionDiscoveryMetadata\r\n * @returns void\r\n */\r\n ServerTelemetryManager.prototype.updateRegionDiscoveryMetadata = function (regionDiscoveryMetadata) {\r\n this.regionUsed = regionDiscoveryMetadata.region_used;\r\n this.regionSource = regionDiscoveryMetadata.region_source;\r\n this.regionOutcome = regionDiscoveryMetadata.region_outcome;\r\n };\r\n /**\r\n * Set cache outcome\r\n */\r\n ServerTelemetryManager.prototype.setCacheOutcome = function (cacheOutcome) {\r\n this.cacheOutcome = cacheOutcome;\r\n };\r\n return ServerTelemetryManager;\r\n}());\n\nexport { ServerTelemetryManager };\n//# sourceMappingURL=ServerTelemetryManager.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __assign } from '../../_virtual/_tslib.js';\nimport { IntFields, PerformanceEventStatus } from './PerformanceEvent.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar PerformanceClient = /** @class */ (function () {\r\n /**\r\n * Creates an instance of PerformanceClient,\r\n * an abstract class containing core performance telemetry logic.\r\n *\r\n * @constructor\r\n * @param {string} clientId Client ID of the application\r\n * @param {string} authority Authority used by the application\r\n * @param {Logger} logger Logger used by the application\r\n * @param {string} libraryName Name of the library\r\n * @param {string} libraryVersion Version of the library\r\n */\r\n function PerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {\r\n this.authority = authority;\r\n this.libraryName = libraryName;\r\n this.libraryVersion = libraryVersion;\r\n this.applicationTelemetry = applicationTelemetry;\r\n this.clientId = clientId;\r\n this.logger = logger;\r\n this.callbacks = new Map();\r\n this.eventsByCorrelationId = new Map();\r\n this.queueMeasurements = new Map();\r\n this.preQueueTimeByCorrelationId = new Map();\r\n }\r\n /**\r\n * Starts and returns an platform-specific implementation of IPerformanceMeasurement.\r\n * Note: this function can be changed to abstract at the next major version bump.\r\n *\r\n * @param {string} measureName\r\n * @param {string} correlationId\r\n * @returns {IPerformanceMeasurement}\r\n */\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n PerformanceClient.prototype.startPerformanceMeasurement = function (measureName, correlationId) {\r\n return {};\r\n };\r\n /**\r\n * Starts and returns an platform-specific implementation of IPerformanceMeasurement.\r\n * Note: this incorrectly-named function will be removed at the next major version bump.\r\n *\r\n * @param {string} measureName\r\n * @param {string} correlationId\r\n * @returns {IPerformanceMeasurement}\r\n */\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n PerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {\r\n return {};\r\n };\r\n /**\r\n * Get integral fields.\r\n * Override to change the set.\r\n */\r\n PerformanceClient.prototype.getIntFields = function () {\r\n return IntFields;\r\n };\r\n /**\r\n * Gets map of pre-queue times by correlation Id\r\n *\r\n * @param {PerformanceEvents} eventName\r\n * @param {string} correlationId\r\n * @returns {number}\r\n */\r\n PerformanceClient.prototype.getPreQueueTime = function (eventName, correlationId) {\r\n var preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);\r\n if (!preQueueEvent) {\r\n this.logger.trace(\"PerformanceClient.getPreQueueTime: no pre-queue times found for correlationId: \" + correlationId + \", unable to add queue measurement\");\r\n return;\r\n }\r\n else if (preQueueEvent.name !== eventName) {\r\n this.logger.trace(\"PerformanceClient.getPreQueueTime: no pre-queue time found for \" + eventName + \", unable to add queue measurement\");\r\n return;\r\n }\r\n return preQueueEvent.time;\r\n };\r\n /**\r\n * Calculates the difference between current time and time when function was queued.\r\n * Note: It is possible to have 0 as the queue time if the current time and the queued time was the same.\r\n *\r\n * @param {number} preQueueTime\r\n * @param {number} currentTime\r\n * @returns {number}\r\n */\r\n PerformanceClient.prototype.calculateQueuedTime = function (preQueueTime, currentTime) {\r\n if (preQueueTime < 1) {\r\n this.logger.trace(\"PerformanceClient: preQueueTime should be a positive integer and not \" + preQueueTime);\r\n return 0;\r\n }\r\n if (currentTime < 1) {\r\n this.logger.trace(\"PerformanceClient: currentTime should be a positive integer and not \" + currentTime);\r\n return 0;\r\n }\r\n if (currentTime < preQueueTime) {\r\n this.logger.trace(\"PerformanceClient: currentTime is less than preQueueTime, check how time is being retrieved\");\r\n return 0;\r\n }\r\n return currentTime - preQueueTime;\r\n };\r\n /**\r\n * Adds queue measurement time to QueueMeasurements array for given correlation ID.\r\n *\r\n * @param {PerformanceEvents} eventName\r\n * @param {?string} correlationId\r\n * @param {?number} queueTime\r\n * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements\r\n * @returns\r\n */\r\n PerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime, manuallyCompleted) {\r\n if (!correlationId) {\r\n this.logger.trace(\"PerformanceClient.addQueueMeasurement: correlationId not provided for \" + eventName + \", cannot add queue measurement\");\r\n return;\r\n }\r\n if (queueTime === 0) {\r\n // Possible for there to be no queue time after calculation\r\n this.logger.trace(\"PerformanceClient.addQueueMeasurement: queue time provided for \" + eventName + \" is \" + queueTime);\r\n }\r\n else if (!queueTime) {\r\n this.logger.trace(\"PerformanceClient.addQueueMeasurement: no queue time provided for \" + eventName);\r\n return;\r\n }\r\n var queueMeasurement = { eventName: eventName, queueTime: queueTime, manuallyCompleted: manuallyCompleted };\r\n // Adds to existing correlation Id if present in queueMeasurements\r\n var existingMeasurements = this.queueMeasurements.get(correlationId);\r\n if (existingMeasurements) {\r\n existingMeasurements.push(queueMeasurement);\r\n this.queueMeasurements.set(correlationId, existingMeasurements);\r\n }\r\n else {\r\n // Sets new correlation Id if not present in queueMeasurements\r\n this.logger.trace(\"PerformanceClient.addQueueMeasurement: adding correlationId \" + correlationId + \" to queue measurements\");\r\n var measurementArray = [queueMeasurement];\r\n this.queueMeasurements.set(correlationId, measurementArray);\r\n }\r\n // Delete processed pre-queue event.\r\n this.preQueueTimeByCorrelationId.delete(correlationId);\r\n };\r\n /**\r\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\r\n *\r\n * @param {PerformanceEvents} measureName\r\n * @param {?string} [correlationId]\r\n * @returns {InProgressPerformanceEvent}\r\n */\r\n PerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {\r\n var _this = this;\r\n var _a, _b;\r\n // Generate a placeholder correlation if the request does not provide one\r\n var eventCorrelationId = correlationId || this.generateId();\r\n if (!correlationId) {\r\n this.logger.info(\"PerformanceClient: No correlation id provided for \" + measureName + \", generating\", eventCorrelationId);\r\n }\r\n // Duplicate code to address spelling error will be removed at the next major version bump.\r\n this.logger.trace(\"PerformanceClient: Performance measurement started for \" + measureName, eventCorrelationId);\r\n var performanceMeasurement = this.startPerformanceMeasuremeant(measureName, eventCorrelationId);\r\n performanceMeasurement.startMeasurement();\r\n var inProgressEvent = {\r\n eventId: this.generateId(),\r\n status: PerformanceEventStatus.InProgress,\r\n authority: this.authority,\r\n libraryName: this.libraryName,\r\n libraryVersion: this.libraryVersion,\r\n clientId: this.clientId,\r\n name: measureName,\r\n startTimeMs: Date.now(),\r\n correlationId: eventCorrelationId,\r\n appName: (_a = this.applicationTelemetry) === null || _a === void 0 ? void 0 : _a.appName,\r\n appVersion: (_b = this.applicationTelemetry) === null || _b === void 0 ? void 0 : _b.appVersion,\r\n };\r\n // Store in progress events so they can be discarded if not ended properly\r\n this.cacheEventByCorrelationId(inProgressEvent);\r\n // Return the event and functions the caller can use to properly end/flush the measurement\r\n return {\r\n endMeasurement: function (event) {\r\n return _this.endMeasurement(__assign(__assign({}, inProgressEvent), event), performanceMeasurement);\r\n },\r\n discardMeasurement: function () {\r\n return _this.discardMeasurements(inProgressEvent.correlationId);\r\n },\r\n addStaticFields: function (fields) {\r\n return _this.addStaticFields(fields, inProgressEvent.correlationId);\r\n },\r\n increment: function (counters) {\r\n return _this.increment(counters, inProgressEvent.correlationId);\r\n },\r\n measurement: performanceMeasurement,\r\n event: inProgressEvent\r\n };\r\n };\r\n /**\r\n * Stops measuring the performance for an operation. Should only be called directly by PerformanceClient classes,\r\n * as consumers should instead use the function returned by startMeasurement.\r\n * Adds a new field named as \"[event name]DurationMs\" for sub-measurements, completes and emits an event\r\n * otherwise.\r\n *\r\n * @param {PerformanceEvent} event\r\n * @param {IPerformanceMeasurement} measurement\r\n * @returns {(PerformanceEvent | null)}\r\n */\r\n PerformanceClient.prototype.endMeasurement = function (event, measurement) {\r\n var _this = this;\r\n var _a, _b;\r\n var rootEvent = this.eventsByCorrelationId.get(event.correlationId);\r\n if (!rootEvent) {\r\n this.logger.trace(\"PerformanceClient: Measurement not found for \" + event.eventId, event.correlationId);\r\n return null;\r\n }\r\n var isRoot = event.eventId === rootEvent.eventId;\r\n var queueInfo = {\r\n totalQueueTime: 0,\r\n totalQueueCount: 0,\r\n manuallyCompletedCount: 0\r\n };\r\n if (isRoot) {\r\n queueInfo = this.getQueueInfo(event.correlationId);\r\n this.discardCache(rootEvent.correlationId);\r\n }\r\n else {\r\n (_a = rootEvent.incompleteSubMeasurements) === null || _a === void 0 ? void 0 : _a.delete(event.eventId);\r\n }\r\n measurement === null || measurement === void 0 ? void 0 : measurement.endMeasurement();\r\n var durationMs = measurement === null || measurement === void 0 ? void 0 : measurement.flushMeasurement();\r\n // null indicates no measurement was taken (e.g. needed performance APIs not present)\r\n if (!durationMs) {\r\n this.logger.trace(\"PerformanceClient: Performance measurement not taken\", rootEvent.correlationId);\r\n return null;\r\n }\r\n this.logger.trace(\"PerformanceClient: Performance measurement ended for \" + event.name + \": \" + durationMs + \" ms\", event.correlationId);\r\n // Add sub-measurement attribute to root event.\r\n if (!isRoot) {\r\n rootEvent[event.name + \"DurationMs\"] = Math.floor(durationMs);\r\n return __assign({}, rootEvent);\r\n }\r\n var finalEvent = __assign(__assign({}, rootEvent), event);\r\n var incompleteSubsCount = 0;\r\n // Incomplete sub-measurements are discarded. They are likely an instrumentation bug that should be fixed.\r\n (_b = finalEvent.incompleteSubMeasurements) === null || _b === void 0 ? void 0 : _b.forEach(function (subMeasurement) {\r\n _this.logger.trace(\"PerformanceClient: Incomplete submeasurement \" + subMeasurement.name + \" found for \" + event.name, finalEvent.correlationId);\r\n incompleteSubsCount++;\r\n });\r\n finalEvent.incompleteSubMeasurements = undefined;\r\n finalEvent = __assign(__assign({}, finalEvent), { durationMs: Math.round(durationMs), queuedTimeMs: queueInfo.totalQueueTime, queuedCount: queueInfo.totalQueueCount, queuedManuallyCompletedCount: queueInfo.manuallyCompletedCount, status: PerformanceEventStatus.Completed, incompleteSubsCount: incompleteSubsCount });\r\n this.truncateIntegralFields(finalEvent, this.getIntFields());\r\n this.emitEvents([finalEvent], event.correlationId);\r\n return finalEvent;\r\n };\r\n /**\r\n * Saves extra information to be emitted when the measurements are flushed\r\n * @param fields\r\n * @param correlationId\r\n */\r\n PerformanceClient.prototype.addStaticFields = function (fields, correlationId) {\r\n this.logger.trace(\"PerformanceClient: Updating static fields\");\r\n var event = this.eventsByCorrelationId.get(correlationId);\r\n if (event) {\r\n this.eventsByCorrelationId.set(correlationId, __assign(__assign({}, event), fields));\r\n }\r\n else {\r\n this.logger.trace(\"PerformanceClient: Event not found for\", correlationId);\r\n }\r\n };\r\n /**\r\n * Increment counters to be emitted when the measurements are flushed\r\n * @param counters {Counters}\r\n * @param correlationId {string} correlation identifier\r\n */\r\n PerformanceClient.prototype.increment = function (counters, correlationId) {\r\n this.logger.trace(\"PerformanceClient: Updating counters\");\r\n var event = this.eventsByCorrelationId.get(correlationId);\r\n if (event) {\r\n for (var counter in counters) {\r\n if (!event.hasOwnProperty(counter)) {\r\n event[counter] = 0;\r\n }\r\n event[counter] += counters[counter];\r\n }\r\n }\r\n else {\r\n this.logger.trace(\"PerformanceClient: Event not found for\", correlationId);\r\n }\r\n };\r\n /**\r\n * Upserts event into event cache.\r\n * First key is the correlation id, second key is the event id.\r\n * Allows for events to be grouped by correlation id,\r\n * and to easily allow for properties on them to be updated.\r\n *\r\n * @private\r\n * @param {PerformanceEvent} event\r\n */\r\n PerformanceClient.prototype.cacheEventByCorrelationId = function (event) {\r\n var rootEvent = this.eventsByCorrelationId.get(event.correlationId);\r\n if (rootEvent) {\r\n this.logger.trace(\"PerformanceClient: Performance measurement for \" + event.name + \" added/updated\", event.correlationId);\r\n rootEvent.incompleteSubMeasurements = rootEvent.incompleteSubMeasurements || new Map();\r\n rootEvent.incompleteSubMeasurements.set(event.eventId, { name: event.name, startTimeMs: event.startTimeMs });\r\n }\r\n else {\r\n this.logger.trace(\"PerformanceClient: Performance measurement for \" + event.name + \" started\", event.correlationId);\r\n this.eventsByCorrelationId.set(event.correlationId, __assign({}, event));\r\n }\r\n };\r\n PerformanceClient.prototype.getQueueInfo = function (correlationId) {\r\n var queueMeasurementForCorrelationId = this.queueMeasurements.get(correlationId);\r\n if (!queueMeasurementForCorrelationId) {\r\n this.logger.trace(\"PerformanceClient: no queue measurements found for for correlationId: \" + correlationId);\r\n }\r\n var totalQueueTime = 0;\r\n var totalQueueCount = 0;\r\n var manuallyCompletedCount = 0;\r\n queueMeasurementForCorrelationId === null || queueMeasurementForCorrelationId === void 0 ? void 0 : queueMeasurementForCorrelationId.forEach(function (measurement) {\r\n totalQueueTime += measurement.queueTime;\r\n totalQueueCount++;\r\n manuallyCompletedCount += measurement.manuallyCompleted ? 1 : 0;\r\n });\r\n return {\r\n totalQueueTime: totalQueueTime,\r\n totalQueueCount: totalQueueCount,\r\n manuallyCompletedCount: manuallyCompletedCount\r\n };\r\n };\r\n /**\r\n * Removes measurements for a given correlation id.\r\n *\r\n * @param {string} correlationId\r\n */\r\n PerformanceClient.prototype.discardMeasurements = function (correlationId) {\r\n this.logger.trace(\"PerformanceClient: Performance measurements discarded\", correlationId);\r\n this.eventsByCorrelationId.delete(correlationId);\r\n };\r\n /**\r\n * Removes cache for a given correlation id.\r\n *\r\n * @param {string} correlationId correlation identifier\r\n */\r\n PerformanceClient.prototype.discardCache = function (correlationId) {\r\n this.discardMeasurements(correlationId);\r\n this.logger.trace(\"PerformanceClient: QueueMeasurements discarded\", correlationId);\r\n this.queueMeasurements.delete(correlationId);\r\n this.logger.trace(\"PerformanceClient: Pre-queue times discarded\", correlationId);\r\n this.preQueueTimeByCorrelationId.delete(correlationId);\r\n };\r\n /**\r\n * Registers a callback function to receive performance events.\r\n *\r\n * @param {PerformanceCallbackFunction} callback\r\n * @returns {string}\r\n */\r\n PerformanceClient.prototype.addPerformanceCallback = function (callback) {\r\n var callbackId = this.generateId();\r\n this.callbacks.set(callbackId, callback);\r\n this.logger.verbose(\"PerformanceClient: Performance callback registered with id: \" + callbackId);\r\n return callbackId;\r\n };\r\n /**\r\n * Removes a callback registered with addPerformanceCallback.\r\n *\r\n * @param {string} callbackId\r\n * @returns {boolean}\r\n */\r\n PerformanceClient.prototype.removePerformanceCallback = function (callbackId) {\r\n var result = this.callbacks.delete(callbackId);\r\n if (result) {\r\n this.logger.verbose(\"PerformanceClient: Performance callback \" + callbackId + \" removed.\");\r\n }\r\n else {\r\n this.logger.verbose(\"PerformanceClient: Performance callback \" + callbackId + \" not removed.\");\r\n }\r\n return result;\r\n };\r\n /**\r\n * Emits events to all registered callbacks.\r\n *\r\n * @param {PerformanceEvent[]} events\r\n * @param {?string} [correlationId]\r\n */\r\n PerformanceClient.prototype.emitEvents = function (events, correlationId) {\r\n var _this = this;\r\n this.logger.verbose(\"PerformanceClient: Emitting performance events\", correlationId);\r\n this.callbacks.forEach(function (callback, callbackId) {\r\n _this.logger.trace(\"PerformanceClient: Emitting event to callback \" + callbackId, correlationId);\r\n callback.apply(null, [events]);\r\n });\r\n };\r\n /**\r\n * Enforce truncation of integral fields in performance event.\r\n * @param {PerformanceEvent} event performance event to update.\r\n * @param {Set} intFields integral fields.\r\n */\r\n PerformanceClient.prototype.truncateIntegralFields = function (event, intFields) {\r\n intFields.forEach(function (key) {\r\n if (key in event && typeof event[key] === \"number\") {\r\n event[key] = Math.floor(event[key]);\r\n }\r\n });\r\n };\r\n return PerformanceClient;\r\n}());\n\nexport { PerformanceClient };\n//# sourceMappingURL=PerformanceClient.js.map\n","/*! @azure/msal-common v12.1.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../../_virtual/_tslib.js';\nimport { PerformanceClient } from './PerformanceClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar StubPerformanceMeasurement = /** @class */ (function () {\r\n function StubPerformanceMeasurement() {\r\n }\r\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\r\n StubPerformanceMeasurement.prototype.startMeasurement = function () { };\r\n /* eslint-disable-next-line @typescript-eslint/no-empty-function */\r\n StubPerformanceMeasurement.prototype.endMeasurement = function () { };\r\n StubPerformanceMeasurement.prototype.flushMeasurement = function () {\r\n return null;\r\n };\r\n return StubPerformanceMeasurement;\r\n}());\r\nvar StubPerformanceClient = /** @class */ (function (_super) {\r\n __extends(StubPerformanceClient, _super);\r\n function StubPerformanceClient() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n StubPerformanceClient.prototype.generateId = function () {\r\n return \"callback-id\";\r\n };\r\n StubPerformanceClient.prototype.startPerformanceMeasuremeant = function () {\r\n return new StubPerformanceMeasurement();\r\n };\r\n StubPerformanceClient.prototype.startPerformanceMeasurement = function () {\r\n return new StubPerformanceMeasurement();\r\n };\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n StubPerformanceClient.prototype.calculateQueuedTime = function (preQueueTime, currentTime) {\r\n return 0;\r\n };\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n StubPerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime) {\r\n return;\r\n };\r\n /* eslint-disable-next-line @typescript-eslint/no-unused-vars */\r\n StubPerformanceClient.prototype.setPreQueueTime = function (eventName, correlationId) {\r\n return;\r\n };\r\n return StubPerformanceClient;\r\n}(PerformanceClient));\n\nexport { StubPerformanceClient, StubPerformanceMeasurement };\n//# sourceMappingURL=StubPerformanceClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { StringUtils, AuthError } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar BrowserAuthErrorMessage = {\r\n pkceNotGenerated: {\r\n code: \"pkce_not_created\",\r\n desc: \"The PKCE code challenge and verifier could not be generated.\"\r\n },\r\n cryptoDoesNotExist: {\r\n code: \"crypto_nonexistent\",\r\n desc: \"The crypto object or function is not available.\"\r\n },\r\n httpMethodNotImplementedError: {\r\n code: \"http_method_not_implemented\",\r\n desc: \"The HTTP method given has not been implemented in this library.\"\r\n },\r\n emptyNavigateUriError: {\r\n code: \"empty_navigate_uri\",\r\n desc: \"Navigation URI is empty. Please check stack trace for more info.\"\r\n },\r\n hashEmptyError: {\r\n code: \"hash_empty_error\",\r\n desc: \"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\r\n },\r\n hashDoesNotContainStateError: {\r\n code: \"no_state_in_hash\",\r\n desc: \"Hash does not contain state. Please verify that the request originated from msal.\"\r\n },\r\n hashDoesNotContainKnownPropertiesError: {\r\n code: \"hash_does_not_contain_known_properties\",\r\n desc: \"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\r\n },\r\n unableToParseStateError: {\r\n code: \"unable_to_parse_state\",\r\n desc: \"Unable to parse state. Please verify that the request originated from msal.\"\r\n },\r\n stateInteractionTypeMismatchError: {\r\n code: \"state_interaction_type_mismatch\",\r\n desc: \"Hash contains state but the interaction type does not match the caller.\"\r\n },\r\n interactionInProgress: {\r\n code: \"interaction_in_progress\",\r\n desc: \"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors.\"\r\n },\r\n popupWindowError: {\r\n code: \"popup_window_error\",\r\n desc: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"\r\n },\r\n emptyWindowError: {\r\n code: \"empty_window_error\",\r\n desc: \"window.open returned null or undefined window object.\"\r\n },\r\n userCancelledError: {\r\n code: \"user_cancelled\",\r\n desc: \"User cancelled the flow.\"\r\n },\r\n monitorPopupTimeoutError: {\r\n code: \"monitor_window_timeout\",\r\n desc: \"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\r\n },\r\n monitorIframeTimeoutError: {\r\n code: \"monitor_window_timeout\",\r\n desc: \"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\r\n },\r\n redirectInIframeError: {\r\n code: \"redirect_in_iframe\",\r\n desc: \"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.\"\r\n },\r\n blockTokenRequestsInHiddenIframeError: {\r\n code: \"block_iframe_reload\",\r\n desc: \"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors\"\r\n },\r\n blockAcquireTokenInPopupsError: {\r\n code: \"block_nested_popups\",\r\n desc: \"Request was blocked inside a popup because MSAL detected it was running in a popup.\"\r\n },\r\n iframeClosedPrematurelyError: {\r\n code: \"iframe_closed_prematurely\",\r\n desc: \"The iframe being monitored was closed prematurely.\"\r\n },\r\n silentLogoutUnsupportedError: {\r\n code: \"silent_logout_unsupported\",\r\n desc: \"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.\"\r\n },\r\n noAccountError: {\r\n code: \"no_account_error\",\r\n desc: \"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.\"\r\n },\r\n silentPromptValueError: {\r\n code: \"silent_prompt_value_error\",\r\n desc: \"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.\"\r\n },\r\n noTokenRequestCacheError: {\r\n code: \"no_token_request_cache_error\",\r\n desc: \"No token request found in cache.\"\r\n },\r\n unableToParseTokenRequestCacheError: {\r\n code: \"unable_to_parse_token_request_cache_error\",\r\n desc: \"The cached token request could not be parsed.\"\r\n },\r\n noCachedAuthorityError: {\r\n code: \"no_cached_authority_error\",\r\n desc: \"No cached authority found.\"\r\n },\r\n authRequestNotSet: {\r\n code: \"auth_request_not_set_error\",\r\n desc: \"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler\"\r\n },\r\n invalidCacheType: {\r\n code: \"invalid_cache_type\",\r\n desc: \"Invalid cache type\"\r\n },\r\n notInBrowserEnvironment: {\r\n code: \"non_browser_environment\",\r\n desc: \"Login and token requests are not supported in non-browser environments.\"\r\n },\r\n databaseNotOpen: {\r\n code: \"database_not_open\",\r\n desc: \"Database is not open!\"\r\n },\r\n noNetworkConnectivity: {\r\n code: \"no_network_connectivity\",\r\n desc: \"No network connectivity. Check your internet connection.\"\r\n },\r\n postRequestFailed: {\r\n code: \"post_request_failed\",\r\n desc: \"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'\"\r\n },\r\n getRequestFailed: {\r\n code: \"get_request_failed\",\r\n desc: \"Network request failed. Please check the network trace to determine root cause.\"\r\n },\r\n failedToParseNetworkResponse: {\r\n code: \"failed_to_parse_response\",\r\n desc: \"Failed to parse network response. Check network trace.\"\r\n },\r\n unableToLoadTokenError: {\r\n code: \"unable_to_load_token\",\r\n desc: \"Error loading token to cache.\"\r\n },\r\n signingKeyNotFoundInStorage: {\r\n code: \"crypto_key_not_found\",\r\n desc: \"Cryptographic Key or Keypair not found in browser storage.\"\r\n },\r\n authCodeRequired: {\r\n code: \"auth_code_required\",\r\n desc: \"An authorization code must be provided (as the `code` property on the request) to this flow.\"\r\n },\r\n authCodeOrNativeAccountRequired: {\r\n code: \"auth_code_or_nativeAccountId_required\",\r\n desc: \"An authorization code or nativeAccountId must be provided to this flow.\"\r\n },\r\n spaCodeAndNativeAccountPresent: {\r\n code: \"spa_code_and_nativeAccountId_present\",\r\n desc: \"Request cannot contain both spa code and native account id.\"\r\n },\r\n databaseUnavailable: {\r\n code: \"database_unavailable\",\r\n desc: \"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.\"\r\n },\r\n unableToAcquireTokenFromNativePlatform: {\r\n code: \"unable_to_acquire_token_from_native_platform\",\r\n desc: \"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors.\"\r\n },\r\n nativeHandshakeTimeout: {\r\n code: \"native_handshake_timeout\",\r\n desc: \"Timed out while attempting to establish connection to browser extension\"\r\n },\r\n nativeExtensionNotInstalled: {\r\n code: \"native_extension_not_installed\",\r\n desc: \"Native extension is not installed. If you think this is a mistake call the initialize function.\"\r\n },\r\n nativeConnectionNotEstablished: {\r\n code: \"native_connection_not_established\",\r\n desc: \"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors.\"\r\n },\r\n nativeBrokerCalledBeforeInitialize: {\r\n code: \"native_broker_called_before_initialize\",\r\n desc: \"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors.\"\r\n },\r\n nativePromptNotSupported: {\r\n code: \"native_prompt_not_supported\",\r\n desc: \"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.\"\r\n }\r\n};\r\n/**\r\n * Browser library error class thrown by the MSAL.js library for SPAs\r\n */\r\nvar BrowserAuthError = /** @class */ (function (_super) {\r\n __extends(BrowserAuthError, _super);\r\n function BrowserAuthError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n Object.setPrototypeOf(_this, BrowserAuthError.prototype);\r\n _this.name = \"BrowserAuthError\";\r\n return _this;\r\n }\r\n /**\r\n * Creates an error thrown when PKCE is not implemented.\r\n * @param errDetail\r\n */\r\n BrowserAuthError.createPkceNotGeneratedError = function (errDetail) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code, BrowserAuthErrorMessage.pkceNotGenerated.desc + \" Detail:\" + errDetail);\r\n };\r\n /**\r\n * Creates an error thrown when the crypto object is unavailable.\r\n * @param errDetail\r\n */\r\n BrowserAuthError.createCryptoNotAvailableError = function (errDetail) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code, BrowserAuthErrorMessage.cryptoDoesNotExist.desc + \" Detail:\" + errDetail);\r\n };\r\n /**\r\n * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.\r\n * @param method\r\n */\r\n BrowserAuthError.createHttpMethodNotImplementedError = function (method) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code, BrowserAuthErrorMessage.httpMethodNotImplementedError.desc + \" Given Method: \" + method);\r\n };\r\n /**\r\n * Creates an error thrown when the navigation URI is empty.\r\n */\r\n BrowserAuthError.createEmptyNavigationUriError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the hash string value is unexpectedly empty.\r\n * @param hashValue\r\n */\r\n BrowserAuthError.createEmptyHashError = function (hashValue) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, BrowserAuthErrorMessage.hashEmptyError.desc + \" Given Url: \" + hashValue);\r\n };\r\n /**\r\n * Creates an error thrown when the hash string value is unexpectedly empty.\r\n */\r\n BrowserAuthError.createHashDoesNotContainStateError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the hash string value does not contain known properties\r\n */\r\n BrowserAuthError.createHashDoesNotContainKnownPropertiesError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the hash string value is unexpectedly empty.\r\n */\r\n BrowserAuthError.createUnableToParseStateError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.\r\n */\r\n BrowserAuthError.createStateInteractionTypeMismatchError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when a browser interaction (redirect or popup) is in progress.\r\n */\r\n BrowserAuthError.createInteractionInProgressError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the popup window could not be opened.\r\n * @param errDetail\r\n */\r\n BrowserAuthError.createPopupWindowError = function (errDetail) {\r\n var errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;\r\n errorMessage = !StringUtils.isEmpty(errDetail) ? errorMessage + \" Details: \" + errDetail : errorMessage;\r\n return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);\r\n };\r\n /**\r\n * Creates an error thrown when window.open returns an empty window object.\r\n * @param errDetail\r\n */\r\n BrowserAuthError.createEmptyWindowCreatedError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the user closes a popup.\r\n */\r\n BrowserAuthError.createUserCancelledError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code, BrowserAuthErrorMessage.userCancelledError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when monitorPopupFromHash times out for a given popup.\r\n */\r\n BrowserAuthError.createMonitorPopupTimeoutError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code, BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when monitorIframeFromHash times out for a given iframe.\r\n */\r\n BrowserAuthError.createMonitorIframeTimeoutError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code, BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.\r\n * @param windowParentCheck\r\n */\r\n BrowserAuthError.createRedirectInIframeError = function (windowParentCheck) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code, BrowserAuthErrorMessage.redirectInIframeError.desc + \" (window.parent !== window) => \" + windowParentCheck);\r\n };\r\n /**\r\n * Creates an error thrown when an auth reload is done inside an iframe.\r\n */\r\n BrowserAuthError.createBlockReloadInHiddenIframeError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code, BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when a popup attempts to call an acquireToken API\r\n * @returns\r\n */\r\n BrowserAuthError.createBlockAcquireTokenInPopupsError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code, BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when an iframe is found to be closed before the timeout is reached.\r\n */\r\n BrowserAuthError.createIframeClosedPrematurelyError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the logout API is called on any of the silent interaction clients\r\n */\r\n BrowserAuthError.createSilentLogoutUnsupportedError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.\r\n */\r\n BrowserAuthError.createNoAccountError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when a given prompt value is invalid for silent requests.\r\n */\r\n BrowserAuthError.createSilentPromptValueError = function (givenPrompt) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, BrowserAuthErrorMessage.silentPromptValueError.desc + \" Given value: \" + givenPrompt);\r\n };\r\n /**\r\n * Creates an error thrown when the cached token request could not be retrieved from the cache\r\n */\r\n BrowserAuthError.createUnableToParseTokenRequestCacheError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code, BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the token request could not be retrieved from the cache\r\n */\r\n BrowserAuthError.createNoTokenRequestCacheError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code, BrowserAuthErrorMessage.noTokenRequestCacheError.desc);\r\n };\r\n /**\r\n * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)\r\n */\r\n BrowserAuthError.createAuthRequestNotSetError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code, BrowserAuthErrorMessage.authRequestNotSet.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the authority could not be retrieved from the cache\r\n */\r\n BrowserAuthError.createNoCachedAuthorityError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code, BrowserAuthErrorMessage.noCachedAuthorityError.desc);\r\n };\r\n /**\r\n * Creates an error thrown if cache type is invalid.\r\n */\r\n BrowserAuthError.createInvalidCacheTypeError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.invalidCacheType.code, \"\" + BrowserAuthErrorMessage.invalidCacheType.desc);\r\n };\r\n /**\r\n * Create an error thrown when login and token requests are made from a non-browser environment\r\n */\r\n BrowserAuthError.createNonBrowserEnvironmentError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);\r\n };\r\n /**\r\n * Create an error thrown when indexDB database is not open\r\n */\r\n BrowserAuthError.createDatabaseNotOpenError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);\r\n };\r\n /**\r\n * Create an error thrown when token fetch fails due to no internet\r\n */\r\n BrowserAuthError.createNoNetworkConnectivityError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);\r\n };\r\n /**\r\n * Create an error thrown when token fetch fails due to reasons other than internet connectivity\r\n */\r\n BrowserAuthError.createPostRequestFailedError = function (errorDesc, endpoint) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, BrowserAuthErrorMessage.postRequestFailed.desc + \" | Network client threw: \" + errorDesc + \" | Attempted to reach: \" + endpoint.split(\"?\")[0]);\r\n };\r\n /**\r\n * Create an error thrown when get request fails due to reasons other than internet connectivity\r\n */\r\n BrowserAuthError.createGetRequestFailedError = function (errorDesc, endpoint) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, BrowserAuthErrorMessage.getRequestFailed.desc + \" | Network client threw: \" + errorDesc + \" | Attempted to reach: \" + endpoint.split(\"?\")[0]);\r\n };\r\n /**\r\n * Create an error thrown when network client fails to parse network response\r\n */\r\n BrowserAuthError.createFailedToParseNetworkResponseError = function (endpoint) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, BrowserAuthErrorMessage.failedToParseNetworkResponse.desc + \" | Attempted to reach: \" + endpoint.split(\"?\")[0]);\r\n };\r\n /**\r\n * Create an error thrown when the necessary information is not available to sideload tokens\r\n */\r\n BrowserAuthError.createUnableToLoadTokenError = function (errorDetail) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, BrowserAuthErrorMessage.unableToLoadTokenError.desc + \" | \" + errorDetail);\r\n };\r\n /**\r\n * Create an error thrown when the queried cryptographic key is not found in IndexedDB\r\n */\r\n BrowserAuthError.createSigningKeyNotFoundInStorageError = function (keyId) {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc + \" | No match found for KeyId: \" + keyId);\r\n };\r\n /**\r\n * Create an error when an authorization code is required but not provided\r\n */\r\n BrowserAuthError.createAuthCodeRequiredError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);\r\n };\r\n /**\r\n * Create an error when an authorization code or native account ID is required but not provided\r\n */\r\n BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);\r\n };\r\n /**\r\n * Create an error when both authorization code and native account ID are provided\r\n */\r\n BrowserAuthError.createSpaCodeAndNativeAccountIdPresentError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.spaCodeAndNativeAccountPresent.code, BrowserAuthErrorMessage.spaCodeAndNativeAccountPresent.desc);\r\n };\r\n /**\r\n * Create an error when IndexedDB is unavailable\r\n */\r\n BrowserAuthError.createDatabaseUnavailableError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);\r\n };\r\n /**\r\n * Create an error when native token acquisition is not possible\r\n */\r\n BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);\r\n };\r\n /**\r\n * Create an error thrown when Handshake with browser extension times out\r\n */\r\n BrowserAuthError.createNativeHandshakeTimeoutError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);\r\n };\r\n /**\r\n * Create an error thrown when browser extension is not installed\r\n */\r\n BrowserAuthError.createNativeExtensionNotInstalledError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);\r\n };\r\n /**\r\n * Create an error when native connection has not been established\r\n * @returns\r\n */\r\n BrowserAuthError.createNativeConnectionNotEstablishedError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);\r\n };\r\n /**\r\n * Create an error thrown when the initialize function hasn't been called\r\n */\r\n BrowserAuthError.createNativeBrokerCalledBeforeInitialize = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);\r\n };\r\n /**\r\n * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create\r\n * These requests must go through eSTS to ensure eSTS is aware of the new account\r\n */\r\n BrowserAuthError.createNativePromptParameterNotSupportedError = function () {\r\n return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);\r\n };\r\n return BrowserAuthError;\r\n}(AuthError));\n\nexport { BrowserAuthError, BrowserAuthErrorMessage };\n//# sourceMappingURL=BrowserAuthError.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Constants\r\n */\r\nvar BrowserConstants = {\r\n /**\r\n * Interaction in progress cache value\r\n */\r\n INTERACTION_IN_PROGRESS_VALUE: \"interaction_in_progress\",\r\n /**\r\n * Invalid grant error code\r\n */\r\n INVALID_GRANT_ERROR: \"invalid_grant\",\r\n /**\r\n * Default popup window width\r\n */\r\n POPUP_WIDTH: 483,\r\n /**\r\n * Default popup window height\r\n */\r\n POPUP_HEIGHT: 600,\r\n /**\r\n * Name of the popup window starts with\r\n */\r\n POPUP_NAME_PREFIX: \"msal\",\r\n /**\r\n * Default popup monitor poll interval in milliseconds\r\n */\r\n DEFAULT_POLL_INTERVAL_MS: 30,\r\n /**\r\n * Msal-browser SKU\r\n */\r\n MSAL_SKU: \"msal.js.browser\",\r\n};\r\nvar NativeConstants = {\r\n CHANNEL_ID: \"53ee284d-920a-4b59-9d30-a60315b26836\",\r\n PREFERRED_EXTENSION_ID: \"ppnbnpeolgkicgegkbkbjmhlideopiji\",\r\n MATS_TELEMETRY: \"MATS\"\r\n};\r\nvar NativeExtensionMethod;\r\n(function (NativeExtensionMethod) {\r\n NativeExtensionMethod[\"HandshakeRequest\"] = \"Handshake\";\r\n NativeExtensionMethod[\"HandshakeResponse\"] = \"HandshakeResponse\";\r\n NativeExtensionMethod[\"GetToken\"] = \"GetToken\";\r\n NativeExtensionMethod[\"Response\"] = \"Response\";\r\n})(NativeExtensionMethod || (NativeExtensionMethod = {}));\r\nvar BrowserCacheLocation;\r\n(function (BrowserCacheLocation) {\r\n BrowserCacheLocation[\"LocalStorage\"] = \"localStorage\";\r\n BrowserCacheLocation[\"SessionStorage\"] = \"sessionStorage\";\r\n BrowserCacheLocation[\"MemoryStorage\"] = \"memoryStorage\";\r\n})(BrowserCacheLocation || (BrowserCacheLocation = {}));\r\n/**\r\n * HTTP Request types supported by MSAL.\r\n */\r\nvar HTTP_REQUEST_TYPE;\r\n(function (HTTP_REQUEST_TYPE) {\r\n HTTP_REQUEST_TYPE[\"GET\"] = \"GET\";\r\n HTTP_REQUEST_TYPE[\"POST\"] = \"POST\";\r\n})(HTTP_REQUEST_TYPE || (HTTP_REQUEST_TYPE = {}));\r\n/**\r\n * Temporary cache keys for MSAL, deleted after any request.\r\n */\r\nvar TemporaryCacheKeys;\r\n(function (TemporaryCacheKeys) {\r\n TemporaryCacheKeys[\"AUTHORITY\"] = \"authority\";\r\n TemporaryCacheKeys[\"ACQUIRE_TOKEN_ACCOUNT\"] = \"acquireToken.account\";\r\n TemporaryCacheKeys[\"SESSION_STATE\"] = \"session.state\";\r\n TemporaryCacheKeys[\"REQUEST_STATE\"] = \"request.state\";\r\n TemporaryCacheKeys[\"NONCE_IDTOKEN\"] = \"nonce.id_token\";\r\n TemporaryCacheKeys[\"ORIGIN_URI\"] = \"request.origin\";\r\n TemporaryCacheKeys[\"RENEW_STATUS\"] = \"token.renew.status\";\r\n TemporaryCacheKeys[\"URL_HASH\"] = \"urlHash\";\r\n TemporaryCacheKeys[\"REQUEST_PARAMS\"] = \"request.params\";\r\n TemporaryCacheKeys[\"SCOPES\"] = \"scopes\";\r\n TemporaryCacheKeys[\"INTERACTION_STATUS_KEY\"] = \"interaction.status\";\r\n TemporaryCacheKeys[\"CCS_CREDENTIAL\"] = \"ccs.credential\";\r\n TemporaryCacheKeys[\"CORRELATION_ID\"] = \"request.correlationId\";\r\n TemporaryCacheKeys[\"NATIVE_REQUEST\"] = \"request.native\";\r\n TemporaryCacheKeys[\"REDIRECT_CONTEXT\"] = \"request.redirect.context\";\r\n})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));\r\nvar StaticCacheKeys;\r\n(function (StaticCacheKeys) {\r\n StaticCacheKeys[\"ACCOUNT_KEYS\"] = \"msal.account.keys\";\r\n StaticCacheKeys[\"TOKEN_KEYS\"] = \"msal.token.keys\";\r\n})(StaticCacheKeys || (StaticCacheKeys = {}));\r\n/**\r\n * Cache keys stored in-memory\r\n */\r\nvar InMemoryCacheKeys;\r\n(function (InMemoryCacheKeys) {\r\n InMemoryCacheKeys[\"WRAPPER_SKU\"] = \"wrapper.sku\";\r\n InMemoryCacheKeys[\"WRAPPER_VER\"] = \"wrapper.version\";\r\n})(InMemoryCacheKeys || (InMemoryCacheKeys = {}));\r\n/**\r\n * API Codes for Telemetry purposes.\r\n * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs\r\n * 0-99 Silent Flow\r\n * 800-899 Auth Code Flow\r\n */\r\nvar ApiId;\r\n(function (ApiId) {\r\n ApiId[ApiId[\"acquireTokenRedirect\"] = 861] = \"acquireTokenRedirect\";\r\n ApiId[ApiId[\"acquireTokenPopup\"] = 862] = \"acquireTokenPopup\";\r\n ApiId[ApiId[\"ssoSilent\"] = 863] = \"ssoSilent\";\r\n ApiId[ApiId[\"acquireTokenSilent_authCode\"] = 864] = \"acquireTokenSilent_authCode\";\r\n ApiId[ApiId[\"handleRedirectPromise\"] = 865] = \"handleRedirectPromise\";\r\n ApiId[ApiId[\"acquireTokenByCode\"] = 866] = \"acquireTokenByCode\";\r\n ApiId[ApiId[\"acquireTokenSilent_silentFlow\"] = 61] = \"acquireTokenSilent_silentFlow\";\r\n ApiId[ApiId[\"logout\"] = 961] = \"logout\";\r\n ApiId[ApiId[\"logoutPopup\"] = 962] = \"logoutPopup\";\r\n})(ApiId || (ApiId = {}));\r\n/*\r\n * Interaction type of the API - used for state and telemetry\r\n */\r\nvar InteractionType;\r\n(function (InteractionType) {\r\n InteractionType[\"Redirect\"] = \"redirect\";\r\n InteractionType[\"Popup\"] = \"popup\";\r\n InteractionType[\"Silent\"] = \"silent\";\r\n InteractionType[\"None\"] = \"none\";\r\n})(InteractionType || (InteractionType = {}));\r\n/**\r\n * Types of interaction currently in progress.\r\n * Used in events in wrapper libraries to invoke functions when certain interaction is in progress or all interactions are complete.\r\n */\r\nvar InteractionStatus;\r\n(function (InteractionStatus) {\r\n /**\r\n * Initial status before interaction occurs\r\n */\r\n InteractionStatus[\"Startup\"] = \"startup\";\r\n /**\r\n * Status set when all login calls occuring\r\n */\r\n InteractionStatus[\"Login\"] = \"login\";\r\n /**\r\n * Status set when logout call occuring\r\n */\r\n InteractionStatus[\"Logout\"] = \"logout\";\r\n /**\r\n * Status set for acquireToken calls\r\n */\r\n InteractionStatus[\"AcquireToken\"] = \"acquireToken\";\r\n /**\r\n * Status set for ssoSilent calls\r\n */\r\n InteractionStatus[\"SsoSilent\"] = \"ssoSilent\";\r\n /**\r\n * Status set when handleRedirect in progress\r\n */\r\n InteractionStatus[\"HandleRedirect\"] = \"handleRedirect\";\r\n /**\r\n * Status set when interaction is complete\r\n */\r\n InteractionStatus[\"None\"] = \"none\";\r\n})(InteractionStatus || (InteractionStatus = {}));\r\nvar DEFAULT_REQUEST = {\r\n scopes: OIDC_DEFAULT_SCOPES\r\n};\r\n/**\r\n * JWK Key Format string (Type MUST be defined for window crypto APIs)\r\n */\r\nvar KEY_FORMAT_JWK = \"jwk\";\r\n// Supported wrapper SKUs\r\nvar WrapperSKU;\r\n(function (WrapperSKU) {\r\n WrapperSKU[\"React\"] = \"@azure/msal-react\";\r\n WrapperSKU[\"Angular\"] = \"@azure/msal-angular\";\r\n})(WrapperSKU || (WrapperSKU = {}));\r\n// DatabaseStorage Constants\r\nvar DB_NAME = \"msal.db\";\r\nvar DB_VERSION = 1;\r\nvar DB_TABLE_NAME = DB_NAME + \".keys\";\r\nvar CacheLookupPolicy;\r\n(function (CacheLookupPolicy) {\r\n /*\r\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired\r\n * or cannot be found the refresh token will be used to acquire a new one. Finally, if the refresh token\r\n * is expired acquireTokenSilent will attempt to acquire new access and refresh tokens.\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"Default\"] = 0] = \"Default\";\r\n /*\r\n * acquireTokenSilent will only look for access tokens in the cache. It will not attempt to renew access or\r\n * refresh tokens.\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"AccessToken\"] = 1] = \"AccessToken\";\r\n /*\r\n * acquireTokenSilent will attempt to retrieve an access token from the cache. If the access token is expired or\r\n * cannot be found, the refresh token will be used to acquire a new one. If the refresh token is expired, it\r\n * will not be renewed and acquireTokenSilent will fail.\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"AccessTokenAndRefreshToken\"] = 2] = \"AccessTokenAndRefreshToken\";\r\n /*\r\n * acquireTokenSilent will not attempt to retrieve access tokens from the cache and will instead attempt to\r\n * exchange the cached refresh token for a new access token. If the refresh token is expired, it will not be\r\n * renewed and acquireTokenSilent will fail.\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"RefreshToken\"] = 3] = \"RefreshToken\";\r\n /*\r\n * acquireTokenSilent will not look in the cache for the access token. It will go directly to network with the\r\n * cached refresh token. If the refresh token is expired an attempt will be made to renew it. This is equivalent to\r\n * setting \"forceRefresh: true\".\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"RefreshTokenAndNetwork\"] = 4] = \"RefreshTokenAndNetwork\";\r\n /*\r\n * acquireTokenSilent will attempt to renew both access and refresh tokens. It will not look in the cache. This will\r\n * always fail if 3rd party cookies are blocked by the browser.\r\n */\r\n CacheLookupPolicy[CacheLookupPolicy[\"Skip\"] = 5] = \"Skip\";\r\n})(CacheLookupPolicy || (CacheLookupPolicy = {}));\n\nexport { ApiId, BrowserCacheLocation, BrowserConstants, CacheLookupPolicy, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, NativeConstants, NativeExtensionMethod, StaticCacheKeys, TemporaryCacheKeys, WrapperSKU };\n//# sourceMappingURL=BrowserConstants.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { AuthError } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\r\n */\r\nvar BrowserConfigurationAuthErrorMessage = {\r\n redirectUriNotSet: {\r\n code: \"redirect_uri_empty\",\r\n desc: \"A redirect URI is required for all calls, and none has been set.\"\r\n },\r\n postLogoutUriNotSet: {\r\n code: \"post_logout_uri_empty\",\r\n desc: \"A post logout redirect has not been set.\"\r\n },\r\n storageNotSupportedError: {\r\n code: \"storage_not_supported\",\r\n desc: \"Given storage configuration option was not supported.\"\r\n },\r\n noRedirectCallbacksSet: {\r\n code: \"no_redirect_callbacks\",\r\n desc: \"No redirect callbacks have been set. Please call setRedirectCallbacks() with the appropriate function arguments before continuing. \" +\r\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\r\n },\r\n invalidCallbackObject: {\r\n code: \"invalid_callback_object\",\r\n desc: \"The object passed for the callback was invalid. \" +\r\n \"More information is available here: https://github.com/AzureAD/microsoft-authentication-library-for-js/wiki/MSAL-basics.\"\r\n },\r\n stubPcaInstanceCalled: {\r\n code: \"stubbed_public_client_application_called\",\r\n desc: \"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors\"\r\n },\r\n inMemRedirectUnavailable: {\r\n code: \"in_mem_redirect_unavailable\",\r\n desc: \"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true.\"\r\n },\r\n entropyNotProvided: {\r\n code: \"entropy_not_provided\",\r\n desc: \"The available browser crypto interface requires entropy set via system.cryptoOptions.entropy configuration option.\"\r\n }\r\n};\r\n/**\r\n * Browser library error class thrown by the MSAL.js library for SPAs\r\n */\r\nvar BrowserConfigurationAuthError = /** @class */ (function (_super) {\r\n __extends(BrowserConfigurationAuthError, _super);\r\n function BrowserConfigurationAuthError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"BrowserConfigurationAuthError\";\r\n Object.setPrototypeOf(_this, BrowserConfigurationAuthError.prototype);\r\n return _this;\r\n }\r\n /**\r\n * Creates an error thrown when the redirect uri is empty (not set by caller)\r\n */\r\n BrowserConfigurationAuthError.createRedirectUriEmptyError = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.redirectUriNotSet.code, BrowserConfigurationAuthErrorMessage.redirectUriNotSet.desc);\r\n };\r\n /**\r\n * Creates an error thrown when the post-logout redirect uri is empty (not set by caller)\r\n */\r\n BrowserConfigurationAuthError.createPostLogoutRedirectUriEmptyError = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.code, BrowserConfigurationAuthErrorMessage.postLogoutUriNotSet.desc);\r\n };\r\n /**\r\n * Creates error thrown when given storage location is not supported.\r\n * @param givenStorageLocation\r\n */\r\n BrowserConfigurationAuthError.createStorageNotSupportedError = function (givenStorageLocation) {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.storageNotSupportedError.code, BrowserConfigurationAuthErrorMessage.storageNotSupportedError.desc + \" Given Location: \" + givenStorageLocation);\r\n };\r\n /**\r\n * Creates error thrown when redirect callbacks are not set before calling loginRedirect() or acquireTokenRedirect().\r\n */\r\n BrowserConfigurationAuthError.createRedirectCallbacksNotSetError = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.code, BrowserConfigurationAuthErrorMessage.noRedirectCallbacksSet.desc);\r\n };\r\n /**\r\n * Creates error thrown when the stub instance of PublicClientApplication is called.\r\n */\r\n BrowserConfigurationAuthError.createStubPcaInstanceCalledError = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.code, BrowserConfigurationAuthErrorMessage.stubPcaInstanceCalled.desc);\r\n };\r\n /*\r\n * Create an error thrown when in-memory storage is used and storeAuthStateInCookie=false.\r\n */\r\n BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.code, BrowserConfigurationAuthErrorMessage.inMemRedirectUnavailable.desc);\r\n };\r\n /**\r\n * Creates an error thrown when a crypto interface that requires entropy is initialized without entropy\r\n */\r\n BrowserConfigurationAuthError.createEntropyNotProvided = function () {\r\n return new BrowserConfigurationAuthError(BrowserConfigurationAuthErrorMessage.entropyNotProvided.code, BrowserConfigurationAuthErrorMessage.entropyNotProvided.desc);\r\n };\r\n return BrowserConfigurationAuthError;\r\n}(AuthError));\n\nexport { BrowserConfigurationAuthError, BrowserConfigurationAuthErrorMessage };\n//# sourceMappingURL=BrowserConfigurationAuthError.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';\nimport { BrowserCacheLocation } from '../utils/BrowserConstants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar BrowserStorage = /** @class */ (function () {\r\n function BrowserStorage(cacheLocation) {\r\n this.validateWindowStorage(cacheLocation);\r\n this.windowStorage = window[cacheLocation];\r\n }\r\n BrowserStorage.prototype.validateWindowStorage = function (cacheLocation) {\r\n if (cacheLocation !== BrowserCacheLocation.LocalStorage && cacheLocation !== BrowserCacheLocation.SessionStorage) {\r\n throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);\r\n }\r\n var storageSupported = !!window[cacheLocation];\r\n if (!storageSupported) {\r\n throw BrowserConfigurationAuthError.createStorageNotSupportedError(cacheLocation);\r\n }\r\n };\r\n BrowserStorage.prototype.getItem = function (key) {\r\n return this.windowStorage.getItem(key);\r\n };\r\n BrowserStorage.prototype.setItem = function (key, value) {\r\n this.windowStorage.setItem(key, value);\r\n };\r\n BrowserStorage.prototype.removeItem = function (key) {\r\n this.windowStorage.removeItem(key);\r\n };\r\n BrowserStorage.prototype.getKeys = function () {\r\n return Object.keys(this.windowStorage);\r\n };\r\n BrowserStorage.prototype.containsKey = function (key) {\r\n return this.windowStorage.hasOwnProperty(key);\r\n };\r\n return BrowserStorage;\r\n}());\n\nexport { BrowserStorage };\n//# sourceMappingURL=BrowserStorage.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar MemoryStorage = /** @class */ (function () {\r\n function MemoryStorage() {\r\n this.cache = new Map();\r\n }\r\n MemoryStorage.prototype.getItem = function (key) {\r\n return this.cache.get(key) || null;\r\n };\r\n MemoryStorage.prototype.setItem = function (key, value) {\r\n this.cache.set(key, value);\r\n };\r\n MemoryStorage.prototype.removeItem = function (key) {\r\n this.cache.delete(key);\r\n };\r\n MemoryStorage.prototype.getKeys = function () {\r\n var cacheKeys = [];\r\n this.cache.forEach(function (value, key) {\r\n cacheKeys.push(key);\r\n });\r\n return cacheKeys;\r\n };\r\n MemoryStorage.prototype.containsKey = function (key) {\r\n return this.cache.has(key);\r\n };\r\n MemoryStorage.prototype.clear = function () {\r\n this.cache.clear();\r\n };\r\n return MemoryStorage;\r\n}());\n\nexport { MemoryStorage };\n//# sourceMappingURL=MemoryStorage.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { StringUtils, ProtocolUtils, ClientAuthError, UrlString } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar BrowserProtocolUtils = /** @class */ (function () {\r\n function BrowserProtocolUtils() {\r\n }\r\n /**\r\n * Extracts the BrowserStateObject from the state string.\r\n * @param browserCrypto\r\n * @param state\r\n */\r\n BrowserProtocolUtils.extractBrowserRequestState = function (browserCrypto, state) {\r\n if (StringUtils.isEmpty(state)) {\r\n return null;\r\n }\r\n try {\r\n var requestStateObj = ProtocolUtils.parseRequestState(browserCrypto, state);\r\n return requestStateObj.libraryState.meta;\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createInvalidStateError(state, e);\r\n }\r\n };\r\n /**\r\n * Parses properties of server response from url hash\r\n * @param locationHash Hash from url\r\n */\r\n BrowserProtocolUtils.parseServerResponseFromHash = function (locationHash) {\r\n if (!locationHash) {\r\n return {};\r\n }\r\n var hashUrlString = new UrlString(locationHash);\r\n return UrlString.getDeserializedHash(hashUrlString.getHash());\r\n };\r\n return BrowserProtocolUtils;\r\n}());\n\nexport { BrowserProtocolUtils };\n//# sourceMappingURL=BrowserProtocolUtils.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __spread } from '../_virtual/_tslib.js';\nimport { CredentialType, RefreshTokenEntity, CacheManager, AccessTokenEntity, IdTokenEntity, AccountEntity, ClientAuthError, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, Constants, PersistentCacheKeys, ThrottlingEntity, StringUtils, ProtocolUtils, CcsCredentialType, IdToken, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { BrowserCacheLocation, StaticCacheKeys, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.js';\nimport { BrowserStorage } from './BrowserStorage.js';\nimport { MemoryStorage } from './MemoryStorage.js';\nimport { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.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 * This class implements the cache storage interface for MSAL through browser local or session storage.\r\n * Cookies are only used if storeAuthStateInCookie is true, and are only used for\r\n * parameters such as state and nonce, generally.\r\n */\r\nvar BrowserCacheManager = /** @class */ (function (_super) {\r\n __extends(BrowserCacheManager, _super);\r\n function BrowserCacheManager(clientId, cacheConfig, cryptoImpl, logger) {\r\n var _this = _super.call(this, clientId, cryptoImpl, logger) || this;\r\n // Cookie life calculation (hours * minutes * seconds * ms)\r\n _this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;\r\n _this.cacheConfig = cacheConfig;\r\n _this.logger = logger;\r\n _this.internalStorage = new MemoryStorage();\r\n _this.browserStorage = _this.setupBrowserStorage(_this.cacheConfig.cacheLocation);\r\n _this.temporaryCacheStorage = _this.setupTemporaryCacheStorage(_this.cacheConfig.temporaryCacheLocation, _this.cacheConfig.cacheLocation);\r\n // Migrate cache entries from older versions of MSAL.\r\n if (cacheConfig.cacheMigrationEnabled) {\r\n _this.migrateCacheEntries();\r\n _this.createKeyMaps();\r\n }\r\n return _this;\r\n }\r\n /**\r\n * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.\r\n * @param cacheLocation\r\n */\r\n BrowserCacheManager.prototype.setupBrowserStorage = function (cacheLocation) {\r\n switch (cacheLocation) {\r\n case BrowserCacheLocation.LocalStorage:\r\n case BrowserCacheLocation.SessionStorage:\r\n try {\r\n return new BrowserStorage(cacheLocation);\r\n }\r\n catch (e) {\r\n this.logger.verbose(e);\r\n break;\r\n }\r\n }\r\n this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;\r\n return new MemoryStorage();\r\n };\r\n /**\r\n * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.\r\n * @param temporaryCacheLocation\r\n * @param cacheLocation\r\n */\r\n BrowserCacheManager.prototype.setupTemporaryCacheStorage = function (temporaryCacheLocation, cacheLocation) {\r\n switch (cacheLocation) {\r\n case BrowserCacheLocation.LocalStorage:\r\n case BrowserCacheLocation.SessionStorage:\r\n try {\r\n /*\r\n * When users do not explicitly choose their own temporaryCacheLocation,\r\n * temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs\r\n */\r\n return new BrowserStorage(temporaryCacheLocation || BrowserCacheLocation.SessionStorage);\r\n }\r\n catch (e) {\r\n this.logger.verbose(e);\r\n return this.internalStorage;\r\n }\r\n case BrowserCacheLocation.MemoryStorage:\r\n default:\r\n return this.internalStorage;\r\n }\r\n };\r\n /**\r\n * Migrate all old cache entries to new schema. No rollback supported.\r\n * @param storeAuthStateInCookie\r\n */\r\n BrowserCacheManager.prototype.migrateCacheEntries = function () {\r\n var _this = this;\r\n var idTokenKey = Constants.CACHE_PREFIX + \".\" + PersistentCacheKeys.ID_TOKEN;\r\n var clientInfoKey = Constants.CACHE_PREFIX + \".\" + PersistentCacheKeys.CLIENT_INFO;\r\n var errorKey = Constants.CACHE_PREFIX + \".\" + PersistentCacheKeys.ERROR;\r\n var errorDescKey = Constants.CACHE_PREFIX + \".\" + PersistentCacheKeys.ERROR_DESC;\r\n var idTokenValue = this.browserStorage.getItem(idTokenKey);\r\n var clientInfoValue = this.browserStorage.getItem(clientInfoKey);\r\n var errorValue = this.browserStorage.getItem(errorKey);\r\n var errorDescValue = this.browserStorage.getItem(errorDescKey);\r\n var values = [idTokenValue, clientInfoValue, errorValue, errorDescValue];\r\n var keysToMigrate = [PersistentCacheKeys.ID_TOKEN, PersistentCacheKeys.CLIENT_INFO, PersistentCacheKeys.ERROR, PersistentCacheKeys.ERROR_DESC];\r\n keysToMigrate.forEach(function (cacheKey, index) { return _this.migrateCacheEntry(cacheKey, values[index]); });\r\n };\r\n /**\r\n * Utility function to help with migration.\r\n * @param newKey\r\n * @param value\r\n * @param storeAuthStateInCookie\r\n */\r\n BrowserCacheManager.prototype.migrateCacheEntry = function (newKey, value) {\r\n if (value) {\r\n this.setTemporaryCache(newKey, value, true);\r\n }\r\n };\r\n /**\r\n * Searches all cache entries for MSAL accounts and creates the account key map\r\n * This is used to migrate users from older versions of MSAL which did not create the map.\r\n * @returns\r\n */\r\n BrowserCacheManager.prototype.createKeyMaps = function () {\r\n var _this = this;\r\n this.logger.trace(\"BrowserCacheManager - createKeyMaps called.\");\r\n var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);\r\n var tokenKeys = this.getItem(StaticCacheKeys.TOKEN_KEYS + \".\" + this.clientId);\r\n if (accountKeys && tokenKeys) {\r\n this.logger.verbose(\"BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.\");\r\n // Key maps already exist, no need to iterate through cache\r\n return;\r\n }\r\n var allKeys = this.browserStorage.getKeys();\r\n allKeys.forEach(function (key) {\r\n if (_this.isCredentialKey(key)) {\r\n // Get item, parse, validate and write key to map\r\n var value = _this.getItem(key);\r\n if (value) {\r\n var credObj = _this.validateAndParseJson(value);\r\n if (credObj && credObj.hasOwnProperty(\"credentialType\")) {\r\n switch (credObj[\"credentialType\"]) {\r\n case CredentialType.ID_TOKEN:\r\n if (IdTokenEntity.isIdTokenEntity(credObj)) {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - idToken with key: \" + key + \" found, saving key to token key map\");\r\n var idTokenEntity = CacheManager.toObject(new IdTokenEntity(), credObj);\r\n var newKey = _this.updateCredentialCacheKey(key, idTokenEntity);\r\n _this.addTokenKey(newKey, CredentialType.ID_TOKEN);\r\n return;\r\n }\r\n else {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping.\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - failed idToken validation on key: \" + key);\r\n }\r\n break;\r\n case CredentialType.ACCESS_TOKEN:\r\n case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\r\n if (AccessTokenEntity.isAccessTokenEntity(credObj)) {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - accessToken with key: \" + key + \" found, saving key to token key map\");\r\n var accessTokenEntity = CacheManager.toObject(new AccessTokenEntity(), credObj);\r\n var newKey = _this.updateCredentialCacheKey(key, accessTokenEntity);\r\n _this.addTokenKey(newKey, CredentialType.ACCESS_TOKEN);\r\n return;\r\n }\r\n else {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping.\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - failed accessToken validation on key: \" + key);\r\n }\r\n break;\r\n case CredentialType.REFRESH_TOKEN:\r\n if (RefreshTokenEntity.isRefreshTokenEntity(credObj)) {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - refreshToken with key: \" + key + \" found, saving key to token key map\");\r\n var refreshTokenEntity = CacheManager.toObject(new RefreshTokenEntity(), credObj);\r\n var newKey = _this.updateCredentialCacheKey(key, refreshTokenEntity);\r\n _this.addTokenKey(newKey, CredentialType.REFRESH_TOKEN);\r\n return;\r\n }\r\n else {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping.\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: \" + key);\r\n }\r\n break;\r\n // If credentialType isn't one of our predefined ones, it may not be an MSAL cache value. Ignore.\r\n }\r\n }\r\n }\r\n }\r\n if (_this.isAccountKey(key)) {\r\n var value = _this.getItem(key);\r\n if (value) {\r\n var accountObj = _this.validateAndParseJson(value);\r\n if (accountObj && AccountEntity.isAccountEntity(accountObj)) {\r\n _this.logger.trace(\"BrowserCacheManager:createKeyMaps - account found, saving key to account key map\");\r\n _this.logger.tracePii(\"BrowserCacheManager:createKeyMaps - account with key: \" + key + \" found, saving key to account key map\");\r\n _this.addAccountKeyToMap(key);\r\n }\r\n }\r\n }\r\n });\r\n };\r\n /**\r\n * Parses passed value as JSON object, JSON.parse() will throw an error.\r\n * @param input\r\n */\r\n BrowserCacheManager.prototype.validateAndParseJson = function (jsonValue) {\r\n try {\r\n var parsedJson = JSON.parse(jsonValue);\r\n /**\r\n * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object\r\n * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check\r\n * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.\r\n *\r\n */\r\n return (parsedJson && typeof parsedJson === \"object\") ? parsedJson : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n };\r\n /**\r\n * fetches the entry from the browser storage based off the key\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.getItem = function (key) {\r\n return this.browserStorage.getItem(key);\r\n };\r\n /**\r\n * sets the entry in the browser storage\r\n * @param key\r\n * @param value\r\n */\r\n BrowserCacheManager.prototype.setItem = function (key, value) {\r\n this.browserStorage.setItem(key, value);\r\n };\r\n /**\r\n * fetch the account entity from the platform cache\r\n * @param accountKey\r\n */\r\n BrowserCacheManager.prototype.getAccount = function (accountKey) {\r\n this.logger.trace(\"BrowserCacheManager.getAccount called\");\r\n var account = this.getItem(accountKey);\r\n if (!account) {\r\n this.removeAccountKeyFromMap(accountKey);\r\n return null;\r\n }\r\n var parsedAccount = this.validateAndParseJson(account);\r\n if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {\r\n this.removeAccountKeyFromMap(accountKey);\r\n return null;\r\n }\r\n return CacheManager.toObject(new AccountEntity(), parsedAccount);\r\n };\r\n /**\r\n * set account entity in the platform cache\r\n * @param key\r\n * @param value\r\n */\r\n BrowserCacheManager.prototype.setAccount = function (account) {\r\n this.logger.trace(\"BrowserCacheManager.setAccount called\");\r\n var key = account.generateAccountKey();\r\n this.setItem(key, JSON.stringify(account));\r\n this.addAccountKeyToMap(key);\r\n };\r\n /**\r\n * Returns the array of account keys currently cached\r\n * @returns\r\n */\r\n BrowserCacheManager.prototype.getAccountKeys = function () {\r\n this.logger.trace(\"BrowserCacheManager.getAccountKeys called\");\r\n var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);\r\n if (accountKeys) {\r\n return JSON.parse(accountKeys);\r\n }\r\n this.logger.verbose(\"BrowserCacheManager.getAccountKeys - No account keys found\");\r\n return [];\r\n };\r\n /**\r\n * Add a new account to the key map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.addAccountKeyToMap = function (key) {\r\n this.logger.trace(\"BrowserCacheManager.addAccountKeyToMap called\");\r\n this.logger.tracePii(\"BrowserCacheManager.addAccountKeyToMap called with key: \" + key);\r\n var accountKeys = this.getAccountKeys();\r\n if (accountKeys.indexOf(key) === -1) {\r\n // Only add key if it does not already exist in the map\r\n accountKeys.push(key);\r\n this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\r\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key added\");\r\n }\r\n else {\r\n this.logger.verbose(\"BrowserCacheManager.addAccountKeyToMap account key already exists in map\");\r\n }\r\n };\r\n /**\r\n * Remove an account from the key map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeAccountKeyFromMap = function (key) {\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap called\");\r\n this.logger.tracePii(\"BrowserCacheManager.removeAccountKeyFromMap called with key: \" + key);\r\n var accountKeys = this.getAccountKeys();\r\n var removalIndex = accountKeys.indexOf(key);\r\n if (removalIndex > -1) {\r\n accountKeys.splice(removalIndex, 1);\r\n this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap account key removed\");\r\n }\r\n else {\r\n this.logger.trace(\"BrowserCacheManager.removeAccountKeyFromMap key not found in existing map\");\r\n }\r\n };\r\n /**\r\n * Extends inherited removeAccount function to include removal of the account key from the map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeAccount = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n _super.prototype.removeAccount.call(this, key);\r\n this.removeAccountKeyFromMap(key);\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Removes given idToken from the cache and from the key map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeIdToken = function (key) {\r\n _super.prototype.removeIdToken.call(this, key);\r\n this.removeTokenKey(key, CredentialType.ID_TOKEN);\r\n };\r\n /**\r\n * Removes given accessToken from the cache and from the key map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeAccessToken = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n _super.prototype.removeAccessToken.call(this, key);\r\n this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Removes given refreshToken from the cache and from the key map\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeRefreshToken = function (key) {\r\n _super.prototype.removeRefreshToken.call(this, key);\r\n this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);\r\n };\r\n /**\r\n * Gets the keys for the cached tokens associated with this clientId\r\n * @returns\r\n */\r\n BrowserCacheManager.prototype.getTokenKeys = function () {\r\n this.logger.trace(\"BrowserCacheManager.getTokenKeys called\");\r\n var item = this.getItem(StaticCacheKeys.TOKEN_KEYS + \".\" + this.clientId);\r\n if (item) {\r\n var tokenKeys = this.validateAndParseJson(item);\r\n if (tokenKeys &&\r\n tokenKeys.hasOwnProperty(\"idToken\") &&\r\n tokenKeys.hasOwnProperty(\"accessToken\") &&\r\n tokenKeys.hasOwnProperty(\"refreshToken\")) {\r\n return tokenKeys;\r\n }\r\n else {\r\n this.logger.error(\"BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"BrowserCacheManager.getTokenKeys - No token keys found\");\r\n }\r\n return {\r\n idToken: [],\r\n accessToken: [],\r\n refreshToken: []\r\n };\r\n };\r\n /**\r\n * Adds the given key to the token key map\r\n * @param key\r\n * @param type\r\n */\r\n BrowserCacheManager.prototype.addTokenKey = function (key, type) {\r\n this.logger.trace(\"BrowserCacheManager addTokenKey called\");\r\n var tokenKeys = this.getTokenKeys();\r\n switch (type) {\r\n case CredentialType.ID_TOKEN:\r\n if (tokenKeys.idToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - idToken added to map\");\r\n tokenKeys.idToken.push(key);\r\n }\r\n break;\r\n case CredentialType.ACCESS_TOKEN:\r\n if (tokenKeys.accessToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - accessToken added to map\");\r\n tokenKeys.accessToken.push(key);\r\n }\r\n break;\r\n case CredentialType.REFRESH_TOKEN:\r\n if (tokenKeys.refreshToken.indexOf(key) === -1) {\r\n this.logger.info(\"BrowserCacheManager: addTokenKey - refreshToken added to map\");\r\n tokenKeys.refreshToken.push(key);\r\n }\r\n break;\r\n default:\r\n this.logger.error(\"BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: \" + type);\r\n ClientAuthError.createUnexpectedCredentialTypeError();\r\n }\r\n this.setItem(StaticCacheKeys.TOKEN_KEYS + \".\" + this.clientId, JSON.stringify(tokenKeys));\r\n };\r\n /**\r\n * Removes the given key from the token key map\r\n * @param key\r\n * @param type\r\n */\r\n BrowserCacheManager.prototype.removeTokenKey = function (key, type) {\r\n this.logger.trace(\"BrowserCacheManager removeTokenKey called\");\r\n var tokenKeys = this.getTokenKeys();\r\n switch (type) {\r\n case CredentialType.ID_TOKEN:\r\n this.logger.infoPii(\"BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: \" + key + \" from map\");\r\n var idRemoval = tokenKeys.idToken.indexOf(key);\r\n if (idRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken removed from map\");\r\n tokenKeys.idToken.splice(idRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n case CredentialType.ACCESS_TOKEN:\r\n this.logger.infoPii(\"BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: \" + key + \" from map\");\r\n var accessRemoval = tokenKeys.accessToken.indexOf(key);\r\n if (accessRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken removed from map\");\r\n tokenKeys.accessToken.splice(accessRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n case CredentialType.REFRESH_TOKEN:\r\n this.logger.infoPii(\"BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: \" + key + \" from map\");\r\n var refreshRemoval = tokenKeys.refreshToken.indexOf(key);\r\n if (refreshRemoval > -1) {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken removed from map\");\r\n tokenKeys.refreshToken.splice(refreshRemoval, 1);\r\n }\r\n else {\r\n this.logger.info(\"BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.\");\r\n }\r\n break;\r\n default:\r\n this.logger.error(\"BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: \" + type);\r\n ClientAuthError.createUnexpectedCredentialTypeError();\r\n }\r\n this.setItem(StaticCacheKeys.TOKEN_KEYS + \".\" + this.clientId, JSON.stringify(tokenKeys));\r\n };\r\n /**\r\n * generates idToken entity from a string\r\n * @param idTokenKey\r\n */\r\n BrowserCacheManager.prototype.getIdTokenCredential = function (idTokenKey) {\r\n var value = this.getItem(idTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n return null;\r\n }\r\n var parsedIdToken = this.validateAndParseJson(value);\r\n if (!parsedIdToken || !IdTokenEntity.isIdTokenEntity(parsedIdToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getIdTokenCredential: cache hit\");\r\n return CacheManager.toObject(new IdTokenEntity(), parsedIdToken);\r\n };\r\n /**\r\n * set IdToken credential to the platform cache\r\n * @param idToken\r\n */\r\n BrowserCacheManager.prototype.setIdTokenCredential = function (idToken) {\r\n this.logger.trace(\"BrowserCacheManager.setIdTokenCredential called\");\r\n var idTokenKey = idToken.generateCredentialKey();\r\n this.setItem(idTokenKey, JSON.stringify(idToken));\r\n this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);\r\n };\r\n /**\r\n * generates accessToken entity from a string\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.getAccessTokenCredential = function (accessTokenKey) {\r\n var value = this.getItem(accessTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n return null;\r\n }\r\n var parsedAccessToken = this.validateAndParseJson(value);\r\n if (!parsedAccessToken || !AccessTokenEntity.isAccessTokenEntity(parsedAccessToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getAccessTokenCredential: cache hit\");\r\n return CacheManager.toObject(new AccessTokenEntity(), parsedAccessToken);\r\n };\r\n /**\r\n * set accessToken credential to the platform cache\r\n * @param accessToken\r\n */\r\n BrowserCacheManager.prototype.setAccessTokenCredential = function (accessToken) {\r\n this.logger.trace(\"BrowserCacheManager.setAccessTokenCredential called\");\r\n var accessTokenKey = accessToken.generateCredentialKey();\r\n this.setItem(accessTokenKey, JSON.stringify(accessToken));\r\n this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);\r\n };\r\n /**\r\n * generates refreshToken entity from a string\r\n * @param refreshTokenKey\r\n */\r\n BrowserCacheManager.prototype.getRefreshTokenCredential = function (refreshTokenKey) {\r\n var value = this.getItem(refreshTokenKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n return null;\r\n }\r\n var parsedRefreshToken = this.validateAndParseJson(value);\r\n if (!parsedRefreshToken || !RefreshTokenEntity.isRefreshTokenEntity(parsedRefreshToken)) {\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: called, no cache hit\");\r\n this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getRefreshTokenCredential: cache hit\");\r\n return CacheManager.toObject(new RefreshTokenEntity(), parsedRefreshToken);\r\n };\r\n /**\r\n * set refreshToken credential to the platform cache\r\n * @param refreshToken\r\n */\r\n BrowserCacheManager.prototype.setRefreshTokenCredential = function (refreshToken) {\r\n this.logger.trace(\"BrowserCacheManager.setRefreshTokenCredential called\");\r\n var refreshTokenKey = refreshToken.generateCredentialKey();\r\n this.setItem(refreshTokenKey, JSON.stringify(refreshToken));\r\n this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);\r\n };\r\n /**\r\n * fetch appMetadata entity from the platform cache\r\n * @param appMetadataKey\r\n */\r\n BrowserCacheManager.prototype.getAppMetadata = function (appMetadataKey) {\r\n var value = this.getItem(appMetadataKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n var parsedMetadata = this.validateAndParseJson(value);\r\n if (!parsedMetadata || !AppMetadataEntity.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getAppMetadata: cache hit\");\r\n return CacheManager.toObject(new AppMetadataEntity(), parsedMetadata);\r\n };\r\n /**\r\n * set appMetadata entity to the platform cache\r\n * @param appMetadata\r\n */\r\n BrowserCacheManager.prototype.setAppMetadata = function (appMetadata) {\r\n this.logger.trace(\"BrowserCacheManager.setAppMetadata called\");\r\n var appMetadataKey = appMetadata.generateAppMetadataKey();\r\n this.setItem(appMetadataKey, JSON.stringify(appMetadata));\r\n };\r\n /**\r\n * fetch server telemetry entity from the platform cache\r\n * @param serverTelemetryKey\r\n */\r\n BrowserCacheManager.prototype.getServerTelemetry = function (serverTelemetryKey) {\r\n var value = this.getItem(serverTelemetryKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\r\n return null;\r\n }\r\n var parsedMetadata = this.validateAndParseJson(value);\r\n if (!parsedMetadata || !ServerTelemetryEntity.isServerTelemetryEntity(serverTelemetryKey, parsedMetadata)) {\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getServerTelemetry: cache hit\");\r\n return CacheManager.toObject(new ServerTelemetryEntity(), parsedMetadata);\r\n };\r\n /**\r\n * set server telemetry entity to the platform cache\r\n * @param serverTelemetryKey\r\n * @param serverTelemetry\r\n */\r\n BrowserCacheManager.prototype.setServerTelemetry = function (serverTelemetryKey, serverTelemetry) {\r\n this.logger.trace(\"BrowserCacheManager.setServerTelemetry called\");\r\n this.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));\r\n };\r\n /**\r\n *\r\n */\r\n BrowserCacheManager.prototype.getAuthorityMetadata = function (key) {\r\n var value = this.internalStorage.getItem(key);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: called, no cache hit\");\r\n return null;\r\n }\r\n var parsedMetadata = this.validateAndParseJson(value);\r\n if (parsedMetadata && AuthorityMetadataEntity.isAuthorityMetadataEntity(key, parsedMetadata)) {\r\n this.logger.trace(\"BrowserCacheManager.getAuthorityMetadata: cache hit\");\r\n return CacheManager.toObject(new AuthorityMetadataEntity(), parsedMetadata);\r\n }\r\n return null;\r\n };\r\n /**\r\n *\r\n */\r\n BrowserCacheManager.prototype.getAuthorityMetadataKeys = function () {\r\n var _this = this;\r\n var allKeys = this.internalStorage.getKeys();\r\n return allKeys.filter(function (key) {\r\n return _this.isAuthorityMetadata(key);\r\n });\r\n };\r\n /**\r\n * Sets wrapper metadata in memory\r\n * @param wrapperSKU\r\n * @param wrapperVersion\r\n */\r\n BrowserCacheManager.prototype.setWrapperMetadata = function (wrapperSKU, wrapperVersion) {\r\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);\r\n this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);\r\n };\r\n /**\r\n * Returns wrapper metadata from in-memory storage\r\n */\r\n BrowserCacheManager.prototype.getWrapperMetadata = function () {\r\n var sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) || Constants.EMPTY_STRING;\r\n var version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) || Constants.EMPTY_STRING;\r\n return [sku, version];\r\n };\r\n /**\r\n *\r\n * @param entity\r\n */\r\n BrowserCacheManager.prototype.setAuthorityMetadata = function (key, entity) {\r\n this.logger.trace(\"BrowserCacheManager.setAuthorityMetadata called\");\r\n this.internalStorage.setItem(key, JSON.stringify(entity));\r\n };\r\n /**\r\n * Gets the active account\r\n */\r\n BrowserCacheManager.prototype.getActiveAccount = function () {\r\n var activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\r\n var activeAccountValueFilters = this.getItem(activeAccountKeyFilters);\r\n if (!activeAccountValueFilters) {\r\n // if new active account cache type isn't found, it's an old version, so look for that instead\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema\");\r\n var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);\r\n var activeAccountValueLocal = this.getItem(activeAccountKeyLocal);\r\n if (!activeAccountValueLocal) {\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account found\");\r\n return null;\r\n }\r\n var activeAccount = this.getAccountInfoByFilter({ localAccountId: activeAccountValueLocal })[0] || null;\r\n if (activeAccount) {\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Legacy active account cache schema found\");\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Adding active account filters cache schema\");\r\n this.setActiveAccount(activeAccount);\r\n return activeAccount;\r\n }\r\n return null;\r\n }\r\n var activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);\r\n if (activeAccountValueObj) {\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: Active account filters schema found\");\r\n return this.getAccountInfoByFilter({\r\n homeAccountId: activeAccountValueObj.homeAccountId,\r\n localAccountId: activeAccountValueObj.localAccountId\r\n })[0] || null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getActiveAccount: No active account found\");\r\n return null;\r\n };\r\n /**\r\n * Sets the active account's localAccountId in cache\r\n * @param account\r\n */\r\n BrowserCacheManager.prototype.setActiveAccount = function (account) {\r\n var activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);\r\n var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);\r\n if (account) {\r\n this.logger.verbose(\"setActiveAccount: Active account set\");\r\n var activeAccountValue = {\r\n homeAccountId: account.homeAccountId,\r\n localAccountId: account.localAccountId\r\n };\r\n this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));\r\n this.browserStorage.setItem(activeAccountKeyLocal, account.localAccountId);\r\n }\r\n else {\r\n this.logger.verbose(\"setActiveAccount: No account passed, active account not set\");\r\n this.browserStorage.removeItem(activeAccountKey);\r\n this.browserStorage.removeItem(activeAccountKeyLocal);\r\n }\r\n };\r\n /**\r\n * Gets a list of accounts that match all of the filters provided\r\n * @param account\r\n */\r\n BrowserCacheManager.prototype.getAccountInfoByFilter = function (accountFilter) {\r\n var allAccounts = this.getAllAccounts();\r\n this.logger.trace(\"BrowserCacheManager.getAccountInfoByFilter: total \" + allAccounts.length + \" accounts found\");\r\n return allAccounts.filter(function (accountObj) {\r\n if (accountFilter.username && accountFilter.username.toLowerCase() !== accountObj.username.toLowerCase()) {\r\n return false;\r\n }\r\n if (accountFilter.homeAccountId && accountFilter.homeAccountId !== accountObj.homeAccountId) {\r\n return false;\r\n }\r\n if (accountFilter.localAccountId && accountFilter.localAccountId !== accountObj.localAccountId) {\r\n return false;\r\n }\r\n if (accountFilter.tenantId && accountFilter.tenantId !== accountObj.tenantId) {\r\n return false;\r\n }\r\n if (accountFilter.environment && accountFilter.environment !== accountObj.environment) {\r\n return false;\r\n }\r\n return true;\r\n });\r\n };\r\n /**\r\n * Checks the cache for accounts matching loginHint or SID\r\n * @param loginHint\r\n * @param sid\r\n */\r\n BrowserCacheManager.prototype.getAccountInfoByHints = function (loginHint, sid) {\r\n var matchingAccounts = this.getAllAccounts().filter(function (accountInfo) {\r\n if (sid) {\r\n var accountSid = accountInfo.idTokenClaims && accountInfo.idTokenClaims[\"sid\"];\r\n return sid === accountSid;\r\n }\r\n if (loginHint) {\r\n return loginHint === accountInfo.username;\r\n }\r\n return false;\r\n });\r\n if (matchingAccounts.length === 1) {\r\n return matchingAccounts[0];\r\n }\r\n else if (matchingAccounts.length > 1) {\r\n throw ClientAuthError.createMultipleMatchingAccountsInCacheError();\r\n }\r\n return null;\r\n };\r\n /**\r\n * fetch throttling entity from the platform cache\r\n * @param throttlingCacheKey\r\n */\r\n BrowserCacheManager.prototype.getThrottlingCache = function (throttlingCacheKey) {\r\n var value = this.getItem(throttlingCacheKey);\r\n if (!value) {\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\r\n return null;\r\n }\r\n var parsedThrottlingCache = this.validateAndParseJson(value);\r\n if (!parsedThrottlingCache || !ThrottlingEntity.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: called, no cache hit\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getThrottlingCache: cache hit\");\r\n return CacheManager.toObject(new ThrottlingEntity(), parsedThrottlingCache);\r\n };\r\n /**\r\n * set throttling entity to the platform cache\r\n * @param throttlingCacheKey\r\n * @param throttlingCache\r\n */\r\n BrowserCacheManager.prototype.setThrottlingCache = function (throttlingCacheKey, throttlingCache) {\r\n this.logger.trace(\"BrowserCacheManager.setThrottlingCache called\");\r\n this.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));\r\n };\r\n /**\r\n * Gets cache item with given key.\r\n * Will retrieve from cookies if storeAuthStateInCookie is set to true.\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.getTemporaryCache = function (cacheKey, generateKey) {\r\n var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n var itemCookie = this.getItemCookie(key);\r\n if (itemCookie) {\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies\");\r\n return itemCookie;\r\n }\r\n }\r\n var value = this.temporaryCacheStorage.getItem(key);\r\n if (!value) {\r\n // If temp cache item not found in session/memory, check local storage for items set by old versions\r\n if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {\r\n var item = this.browserStorage.getItem(key);\r\n if (item) {\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage\");\r\n return item;\r\n }\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: No cache item found in local storage\");\r\n return null;\r\n }\r\n this.logger.trace(\"BrowserCacheManager.getTemporaryCache: Temporary cache item returned\");\r\n return value;\r\n };\r\n /**\r\n * Sets the cache item with the key and value given.\r\n * Stores in cookie if storeAuthStateInCookie is set to true.\r\n * This can cause cookie overflow if used incorrectly.\r\n * @param key\r\n * @param value\r\n */\r\n BrowserCacheManager.prototype.setTemporaryCache = function (cacheKey, value, generateKey) {\r\n var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;\r\n this.temporaryCacheStorage.setItem(key, value);\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n this.logger.trace(\"BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie\");\r\n this.setItemCookie(key, value);\r\n }\r\n };\r\n /**\r\n * Removes the cache item with the given key.\r\n * Will also clear the cookie item if storeAuthStateInCookie is set to true.\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.removeItem = function (key) {\r\n this.browserStorage.removeItem(key);\r\n this.temporaryCacheStorage.removeItem(key);\r\n if (this.cacheConfig.storeAuthStateInCookie) {\r\n this.logger.trace(\"BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie\");\r\n this.clearItemCookie(key);\r\n }\r\n };\r\n /**\r\n * Checks whether key is in cache.\r\n * @param key\r\n */\r\n BrowserCacheManager.prototype.containsKey = function (key) {\r\n return this.browserStorage.containsKey(key) || this.temporaryCacheStorage.containsKey(key);\r\n };\r\n /**\r\n * Gets all keys in window.\r\n */\r\n BrowserCacheManager.prototype.getKeys = function () {\r\n return __spread(this.browserStorage.getKeys(), this.temporaryCacheStorage.getKeys());\r\n };\r\n /**\r\n * Clears all cache entries created by MSAL.\r\n */\r\n BrowserCacheManager.prototype.clear = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: \r\n // Removes all accounts and their credentials\r\n return [4 /*yield*/, this.removeAllAccounts()];\r\n case 1:\r\n // Removes all accounts and their credentials\r\n _a.sent();\r\n this.removeAppMetadata();\r\n // Removes all remaining MSAL cache items\r\n this.getKeys().forEach(function (cacheKey) {\r\n // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js\r\n if ((_this.browserStorage.containsKey(cacheKey) || _this.temporaryCacheStorage.containsKey(cacheKey)) && ((cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1) || (cacheKey.indexOf(_this.clientId) !== -1))) {\r\n _this.removeItem(cacheKey);\r\n }\r\n });\r\n this.internalStorage.clear();\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Add value to cookies\r\n * @param cookieName\r\n * @param cookieValue\r\n * @param expires\r\n */\r\n BrowserCacheManager.prototype.setItemCookie = function (cookieName, cookieValue, expires) {\r\n var cookieStr = encodeURIComponent(cookieName) + \"=\" + encodeURIComponent(cookieValue) + \";path=/;SameSite=Lax;\";\r\n if (expires) {\r\n var expireTime = this.getCookieExpirationTime(expires);\r\n cookieStr += \"expires=\" + expireTime + \";\";\r\n }\r\n if (this.cacheConfig.secureCookies) {\r\n cookieStr += \"Secure;\";\r\n }\r\n document.cookie = cookieStr;\r\n };\r\n /**\r\n * Get one item by key from cookies\r\n * @param cookieName\r\n */\r\n BrowserCacheManager.prototype.getItemCookie = function (cookieName) {\r\n var name = encodeURIComponent(cookieName) + \"=\";\r\n var cookieList = document.cookie.split(\";\");\r\n for (var i = 0; i < cookieList.length; i++) {\r\n var cookie = cookieList[i];\r\n while (cookie.charAt(0) === \" \") {\r\n cookie = cookie.substring(1);\r\n }\r\n if (cookie.indexOf(name) === 0) {\r\n return decodeURIComponent(cookie.substring(name.length, cookie.length));\r\n }\r\n }\r\n return Constants.EMPTY_STRING;\r\n };\r\n /**\r\n * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.\r\n */\r\n BrowserCacheManager.prototype.clearMsalCookies = function () {\r\n var _this = this;\r\n var cookiePrefix = Constants.CACHE_PREFIX + \".\" + this.clientId;\r\n var cookieList = document.cookie.split(\";\");\r\n cookieList.forEach(function (cookie) {\r\n while (cookie.charAt(0) === \" \") {\r\n // eslint-disable-next-line no-param-reassign\r\n cookie = cookie.substring(1);\r\n }\r\n if (cookie.indexOf(cookiePrefix) === 0) {\r\n var cookieKey = cookie.split(\"=\")[0];\r\n _this.clearItemCookie(cookieKey);\r\n }\r\n });\r\n };\r\n /**\r\n * Clear an item in the cookies by key\r\n * @param cookieName\r\n */\r\n BrowserCacheManager.prototype.clearItemCookie = function (cookieName) {\r\n this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);\r\n };\r\n /**\r\n * Get cookie expiration time\r\n * @param cookieLifeDays\r\n */\r\n BrowserCacheManager.prototype.getCookieExpirationTime = function (cookieLifeDays) {\r\n var today = new Date();\r\n var expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);\r\n return expr.toUTCString();\r\n };\r\n /**\r\n * Gets the cache object referenced by the browser\r\n */\r\n BrowserCacheManager.prototype.getCache = function () {\r\n return this.browserStorage;\r\n };\r\n /**\r\n * interface compat, we cannot overwrite browser cache; Functionality is supported by individual entities in browser\r\n */\r\n BrowserCacheManager.prototype.setCache = function () {\r\n // sets nothing\r\n };\r\n /**\r\n * Prepend msal. to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)\r\n * @param key\r\n * @param addInstanceId\r\n */\r\n BrowserCacheManager.prototype.generateCacheKey = function (key) {\r\n var generatedKey = this.validateAndParseJson(key);\r\n if (!generatedKey) {\r\n if (StringUtils.startsWith(key, Constants.CACHE_PREFIX) || StringUtils.startsWith(key, PersistentCacheKeys.ADAL_ID_TOKEN)) {\r\n return key;\r\n }\r\n return Constants.CACHE_PREFIX + \".\" + this.clientId + \".\" + key;\r\n }\r\n return JSON.stringify(key);\r\n };\r\n /**\r\n * Create authorityKey to cache authority\r\n * @param state\r\n */\r\n BrowserCacheManager.prototype.generateAuthorityKey = function (stateString) {\r\n var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;\r\n return this.generateCacheKey(TemporaryCacheKeys.AUTHORITY + \".\" + stateId);\r\n };\r\n /**\r\n * Create Nonce key to cache nonce\r\n * @param state\r\n */\r\n BrowserCacheManager.prototype.generateNonceKey = function (stateString) {\r\n var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;\r\n return this.generateCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN + \".\" + stateId);\r\n };\r\n /**\r\n * Creates full cache key for the request state\r\n * @param stateString State string for the request\r\n */\r\n BrowserCacheManager.prototype.generateStateKey = function (stateString) {\r\n // Use the library state id to key temp storage for uniqueness for multiple concurrent requests\r\n var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;\r\n return this.generateCacheKey(TemporaryCacheKeys.REQUEST_STATE + \".\" + stateId);\r\n };\r\n /**\r\n * Gets the cached authority based on the cached state. Returns empty if no cached state found.\r\n */\r\n BrowserCacheManager.prototype.getCachedAuthority = function (cachedState) {\r\n var stateCacheKey = this.generateStateKey(cachedState);\r\n var state = this.getTemporaryCache(stateCacheKey);\r\n if (!state) {\r\n return null;\r\n }\r\n var authorityCacheKey = this.generateAuthorityKey(state);\r\n return this.getTemporaryCache(authorityCacheKey);\r\n };\r\n /**\r\n * Updates account, authority, and state in cache\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n */\r\n BrowserCacheManager.prototype.updateCacheEntries = function (state, nonce, authorityInstance, loginHint, account) {\r\n this.logger.trace(\"BrowserCacheManager.updateCacheEntries called\");\r\n // Cache the request state\r\n var stateCacheKey = this.generateStateKey(state);\r\n this.setTemporaryCache(stateCacheKey, state, false);\r\n // Cache the nonce\r\n var nonceCacheKey = this.generateNonceKey(state);\r\n this.setTemporaryCache(nonceCacheKey, nonce, false);\r\n // Cache authorityKey\r\n var authorityCacheKey = this.generateAuthorityKey(state);\r\n this.setTemporaryCache(authorityCacheKey, authorityInstance, false);\r\n if (account) {\r\n var ccsCredential = {\r\n credential: account.homeAccountId,\r\n type: CcsCredentialType.HOME_ACCOUNT_ID\r\n };\r\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\r\n }\r\n else if (!StringUtils.isEmpty(loginHint)) {\r\n var ccsCredential = {\r\n credential: loginHint,\r\n type: CcsCredentialType.UPN\r\n };\r\n this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);\r\n }\r\n };\r\n /**\r\n * Reset all temporary cache items\r\n * @param state\r\n */\r\n BrowserCacheManager.prototype.resetRequestCache = function (state) {\r\n var _this = this;\r\n this.logger.trace(\"BrowserCacheManager.resetRequestCache called\");\r\n // check state and remove associated cache items\r\n if (!StringUtils.isEmpty(state)) {\r\n this.getKeys().forEach(function (key) {\r\n if (key.indexOf(state) !== -1) {\r\n _this.removeItem(key);\r\n }\r\n });\r\n }\r\n // delete generic interactive request parameters\r\n if (state) {\r\n this.removeItem(this.generateStateKey(state));\r\n this.removeItem(this.generateNonceKey(state));\r\n this.removeItem(this.generateAuthorityKey(state));\r\n }\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.ORIGIN_URI));\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\r\n this.setInteractionInProgress(false);\r\n };\r\n /**\r\n * Removes temporary cache for the provided state\r\n * @param stateString\r\n */\r\n BrowserCacheManager.prototype.cleanRequestByState = function (stateString) {\r\n this.logger.trace(\"BrowserCacheManager.cleanRequestByState called\");\r\n // Interaction is completed - remove interaction status.\r\n if (stateString) {\r\n var stateKey = this.generateStateKey(stateString);\r\n var cachedState = this.temporaryCacheStorage.getItem(stateKey);\r\n this.logger.infoPii(\"BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: \" + cachedState);\r\n this.resetRequestCache(cachedState || Constants.EMPTY_STRING);\r\n }\r\n this.clearMsalCookies();\r\n };\r\n /**\r\n * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state\r\n * Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.\r\n * @param interactionType\r\n */\r\n BrowserCacheManager.prototype.cleanRequestByInteractionType = function (interactionType) {\r\n var _this = this;\r\n this.logger.trace(\"BrowserCacheManager.cleanRequestByInteractionType called\");\r\n // Loop through all keys to find state key\r\n this.getKeys().forEach(function (key) {\r\n // If this key is not the state key, move on\r\n if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {\r\n return;\r\n }\r\n // Retrieve state value, return if not a valid value\r\n var stateValue = _this.temporaryCacheStorage.getItem(key);\r\n if (!stateValue) {\r\n return;\r\n }\r\n // Extract state and ensure it matches given InteractionType, then clean request cache\r\n var parsedState = BrowserProtocolUtils.extractBrowserRequestState(_this.cryptoImpl, stateValue);\r\n if (parsedState && parsedState.interactionType === interactionType) {\r\n _this.logger.infoPii(\"BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: \" + stateValue);\r\n _this.resetRequestCache(stateValue);\r\n }\r\n });\r\n this.clearMsalCookies();\r\n this.setInteractionInProgress(false);\r\n };\r\n BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {\r\n this.logger.trace(\"BrowserCacheManager.cacheCodeRequest called\");\r\n var encodedValue = browserCrypto.base64Encode(JSON.stringify(authCodeRequest));\r\n this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);\r\n };\r\n /**\r\n * Gets the token exchange parameters from the cache. Throws an error if nothing is found.\r\n */\r\n BrowserCacheManager.prototype.getCachedRequest = function (state, browserCrypto) {\r\n this.logger.trace(\"BrowserCacheManager.getCachedRequest called\");\r\n // Get token request from cache and parse as TokenExchangeParameters.\r\n var encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);\r\n if (!encodedTokenRequest) {\r\n throw BrowserAuthError.createNoTokenRequestCacheError();\r\n }\r\n var parsedRequest = this.validateAndParseJson(browserCrypto.base64Decode(encodedTokenRequest));\r\n if (!parsedRequest) {\r\n throw BrowserAuthError.createUnableToParseTokenRequestCacheError();\r\n }\r\n this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));\r\n // Get cached authority and use if no authority is cached with request.\r\n if (StringUtils.isEmpty(parsedRequest.authority)) {\r\n var authorityCacheKey = this.generateAuthorityKey(state);\r\n var cachedAuthority = this.getTemporaryCache(authorityCacheKey);\r\n if (!cachedAuthority) {\r\n throw BrowserAuthError.createNoCachedAuthorityError();\r\n }\r\n parsedRequest.authority = cachedAuthority;\r\n }\r\n return parsedRequest;\r\n };\r\n /**\r\n * Gets cached native request for redirect flows\r\n */\r\n BrowserCacheManager.prototype.getCachedNativeRequest = function () {\r\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest called\");\r\n var cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);\r\n if (!cachedRequest) {\r\n this.logger.trace(\"BrowserCacheManager.getCachedNativeRequest: No cached native request found\");\r\n return null;\r\n }\r\n var parsedRequest = this.validateAndParseJson(cachedRequest);\r\n if (!parsedRequest) {\r\n this.logger.error(\"BrowserCacheManager.getCachedNativeRequest: Unable to parse native request\");\r\n return null;\r\n }\r\n return parsedRequest;\r\n };\r\n BrowserCacheManager.prototype.isInteractionInProgress = function (matchClientId) {\r\n var clientId = this.getInteractionInProgress();\r\n if (matchClientId) {\r\n return clientId === this.clientId;\r\n }\r\n else {\r\n return !!clientId;\r\n }\r\n };\r\n BrowserCacheManager.prototype.getInteractionInProgress = function () {\r\n var key = Constants.CACHE_PREFIX + \".\" + TemporaryCacheKeys.INTERACTION_STATUS_KEY;\r\n return this.getTemporaryCache(key, false);\r\n };\r\n BrowserCacheManager.prototype.setInteractionInProgress = function (inProgress) {\r\n // Ensure we don't overwrite interaction in progress for a different clientId\r\n var key = Constants.CACHE_PREFIX + \".\" + TemporaryCacheKeys.INTERACTION_STATUS_KEY;\r\n if (inProgress) {\r\n if (this.getInteractionInProgress()) {\r\n throw BrowserAuthError.createInteractionInProgressError();\r\n }\r\n else {\r\n // No interaction is in progress\r\n this.setTemporaryCache(key, this.clientId, false);\r\n }\r\n }\r\n else if (!inProgress && this.getInteractionInProgress() === this.clientId) {\r\n this.removeItem(key);\r\n }\r\n };\r\n /**\r\n * Returns username retrieved from ADAL or MSAL v1 idToken\r\n */\r\n BrowserCacheManager.prototype.getLegacyLoginHint = function () {\r\n // Only check for adal/msal token if no SSO params are being used\r\n var adalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ADAL_ID_TOKEN);\r\n if (adalIdTokenString) {\r\n this.browserStorage.removeItem(PersistentCacheKeys.ADAL_ID_TOKEN);\r\n this.logger.verbose(\"Cached ADAL id token retrieved.\");\r\n }\r\n // Check for cached MSAL v1 id token\r\n var msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);\r\n if (msalIdTokenString) {\r\n this.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));\r\n this.logger.verbose(\"Cached MSAL.js v1 id token retrieved\");\r\n }\r\n var cachedIdTokenString = msalIdTokenString || adalIdTokenString;\r\n if (cachedIdTokenString) {\r\n var cachedIdToken = new IdToken(cachedIdTokenString, this.cryptoImpl);\r\n if (cachedIdToken.claims && cachedIdToken.claims.preferred_username) {\r\n this.logger.verbose(\"No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint\");\r\n return cachedIdToken.claims.preferred_username;\r\n }\r\n else if (cachedIdToken.claims && cachedIdToken.claims.upn) {\r\n this.logger.verbose(\"No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint\");\r\n return cachedIdToken.claims.upn;\r\n }\r\n else {\r\n 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.\");\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Updates a credential's cache key if the current cache key is outdated\r\n */\r\n BrowserCacheManager.prototype.updateCredentialCacheKey = function (currentCacheKey, credential) {\r\n var updatedCacheKey = credential.generateCredentialKey();\r\n if (currentCacheKey !== updatedCacheKey) {\r\n var cacheItem = this.getItem(currentCacheKey);\r\n if (cacheItem) {\r\n this.removeItem(currentCacheKey);\r\n this.setItem(updatedCacheKey, cacheItem);\r\n this.logger.verbose(\"Updated an outdated \" + credential.credentialType + \" cache key\");\r\n return updatedCacheKey;\r\n }\r\n else {\r\n this.logger.error(\"Attempted to update an outdated \" + credential.credentialType + \" cache key but no item matching the outdated key was found in storage\");\r\n }\r\n }\r\n return currentCacheKey;\r\n };\r\n /**\r\n * Returns application id as redirect context during AcquireTokenRedirect flow.\r\n */\r\n BrowserCacheManager.prototype.getRedirectRequestContext = function () {\r\n return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);\r\n };\r\n /**\r\n * Sets application id as the redirect context during AcquireTokenRedirect flow.\r\n * @param value\r\n */\r\n BrowserCacheManager.prototype.setRedirectRequestContext = function (value) {\r\n this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);\r\n };\r\n return BrowserCacheManager;\r\n}(CacheManager));\r\nvar DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {\r\n var cacheOptions = {\r\n cacheLocation: BrowserCacheLocation.MemoryStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n cacheMigrationEnabled: false\r\n };\r\n return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);\r\n};\n\nexport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER };\n//# sourceMappingURL=BrowserCacheManager.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/* eslint-disable header/header */\r\nvar name = \"@azure/msal-browser\";\r\nvar version = \"2.36.0\";\n\nexport { name, version };\n//# sourceMappingURL=packageMetadata.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { Constants } from '@azure/msal-common';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.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 * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\r\n */\r\nvar FetchClient = /** @class */ (function () {\r\n function FetchClient() {\r\n }\r\n /**\r\n * Fetch Client for REST endpoints - Get request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n FetchClient.prototype.sendGetRequestAsync = function (url, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var response, e_1, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n _b.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, fetch(url, {\r\n method: HTTP_REQUEST_TYPE.GET,\r\n headers: this.getFetchHeaders(options)\r\n })];\r\n case 1:\r\n response = _b.sent();\r\n return [3 /*break*/, 3];\r\n case 2:\r\n e_1 = _b.sent();\r\n if (window.navigator.onLine) {\r\n throw BrowserAuthError.createGetRequestFailedError(e_1, url);\r\n }\r\n else {\r\n throw BrowserAuthError.createNoNetworkConnectivityError();\r\n }\r\n case 3:\r\n _b.trys.push([3, 5, , 6]);\r\n _a = {\r\n headers: this.getHeaderDict(response.headers)\r\n };\r\n return [4 /*yield*/, response.json()];\r\n case 4: return [2 /*return*/, (_a.body = (_b.sent()),\r\n _a.status = response.status,\r\n _a)];\r\n case 5:\r\n _b.sent();\r\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Fetch Client for REST endpoints - Post request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n FetchClient.prototype.sendPostRequestAsync = function (url, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var reqBody, response, e_3, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n reqBody = (options && options.body) || Constants.EMPTY_STRING;\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, fetch(url, {\r\n method: HTTP_REQUEST_TYPE.POST,\r\n headers: this.getFetchHeaders(options),\r\n body: reqBody\r\n })];\r\n case 2:\r\n response = _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_3 = _b.sent();\r\n if (window.navigator.onLine) {\r\n throw BrowserAuthError.createPostRequestFailedError(e_3, url);\r\n }\r\n else {\r\n throw BrowserAuthError.createNoNetworkConnectivityError();\r\n }\r\n case 4:\r\n _b.trys.push([4, 6, , 7]);\r\n _a = {\r\n headers: this.getHeaderDict(response.headers)\r\n };\r\n return [4 /*yield*/, response.json()];\r\n case 5: return [2 /*return*/, (_a.body = (_b.sent()),\r\n _a.status = response.status,\r\n _a)];\r\n case 6:\r\n _b.sent();\r\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\r\n case 7: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Get Fetch API Headers object from string map\r\n * @param inputHeaders\r\n */\r\n FetchClient.prototype.getFetchHeaders = function (options) {\r\n var headers = new Headers();\r\n if (!(options && options.headers)) {\r\n return headers;\r\n }\r\n var optionsHeaders = options.headers;\r\n Object.keys(optionsHeaders).forEach(function (key) {\r\n headers.append(key, optionsHeaders[key]);\r\n });\r\n return headers;\r\n };\r\n FetchClient.prototype.getHeaderDict = function (headers) {\r\n var headerDict = {};\r\n headers.forEach(function (value, key) {\r\n headerDict[key] = value;\r\n });\r\n return headerDict;\r\n };\r\n return FetchClient;\r\n}());\n\nexport { FetchClient };\n//# sourceMappingURL=FetchClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.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 * This client implements the XMLHttpRequest class to send GET and POST requests.\r\n */\r\nvar XhrClient = /** @class */ (function () {\r\n function XhrClient() {\r\n }\r\n /**\r\n * XhrClient for REST endpoints - Get request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n XhrClient.prototype.sendGetRequestAsync = function (url, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.sendRequestAsync(url, HTTP_REQUEST_TYPE.GET, options)];\r\n });\r\n });\r\n };\r\n /**\r\n * XhrClient for REST endpoints - Post request\r\n * @param url\r\n * @param headers\r\n * @param body\r\n */\r\n XhrClient.prototype.sendPostRequestAsync = function (url, options) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.sendRequestAsync(url, HTTP_REQUEST_TYPE.POST, options)];\r\n });\r\n });\r\n };\r\n /**\r\n * Helper for XhrClient requests.\r\n * @param url\r\n * @param method\r\n * @param options\r\n */\r\n XhrClient.prototype.sendRequestAsync = function (url, method, options) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(method, url, /* async: */ true);\r\n _this.setXhrHeaders(xhr, options);\r\n xhr.onload = function () {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n if (method === HTTP_REQUEST_TYPE.POST) {\r\n reject(BrowserAuthError.createPostRequestFailedError(\"Failed with status \" + xhr.status, url));\r\n }\r\n else {\r\n reject(BrowserAuthError.createGetRequestFailedError(\"Failed with status \" + xhr.status, url));\r\n }\r\n }\r\n try {\r\n var jsonResponse = JSON.parse(xhr.responseText);\r\n var networkResponse = {\r\n headers: _this.getHeaderDict(xhr),\r\n body: jsonResponse,\r\n status: xhr.status\r\n };\r\n resolve(networkResponse);\r\n }\r\n catch (e) {\r\n reject(BrowserAuthError.createFailedToParseNetworkResponseError(url));\r\n }\r\n };\r\n xhr.onerror = function () {\r\n if (window.navigator.onLine) {\r\n if (method === HTTP_REQUEST_TYPE.POST) {\r\n reject(BrowserAuthError.createPostRequestFailedError(\"Failed with status \" + xhr.status, url));\r\n }\r\n else {\r\n reject(BrowserAuthError.createGetRequestFailedError(\"Failed with status \" + xhr.status, url));\r\n }\r\n }\r\n else {\r\n reject(BrowserAuthError.createNoNetworkConnectivityError());\r\n }\r\n };\r\n if (method === HTTP_REQUEST_TYPE.POST && options && options.body) {\r\n xhr.send(options.body);\r\n }\r\n else if (method === HTTP_REQUEST_TYPE.GET) {\r\n xhr.send();\r\n }\r\n else {\r\n throw BrowserAuthError.createHttpMethodNotImplementedError(method);\r\n }\r\n });\r\n };\r\n /**\r\n * Helper to set XHR headers for request.\r\n * @param xhr\r\n * @param options\r\n */\r\n XhrClient.prototype.setXhrHeaders = function (xhr, options) {\r\n if (options && options.headers) {\r\n var headers_1 = options.headers;\r\n Object.keys(headers_1).forEach(function (key) {\r\n xhr.setRequestHeader(key, headers_1[key]);\r\n });\r\n }\r\n };\r\n /**\r\n * Gets a string map of the headers received in the response.\r\n *\r\n * Algorithm comes from https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders\r\n * @param xhr\r\n */\r\n XhrClient.prototype.getHeaderDict = function (xhr) {\r\n var headerString = xhr.getAllResponseHeaders();\r\n var headerArr = headerString.trim().split(/[\\r\\n]+/);\r\n var headerDict = {};\r\n headerArr.forEach(function (value) {\r\n var parts = value.split(\": \");\r\n var headerName = parts.shift();\r\n var headerVal = parts.join(\": \");\r\n if (headerName && headerVal) {\r\n headerDict[headerName] = headerVal;\r\n }\r\n });\r\n return headerDict;\r\n };\r\n return XhrClient;\r\n}());\n\nexport { XhrClient };\n//# sourceMappingURL=XhrClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { Constants, UrlString } from '@azure/msal-common';\nimport { FetchClient } from '../network/FetchClient.js';\nimport { XhrClient } from '../network/XhrClient.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { BrowserConstants, InteractionType } from './BrowserConstants.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 * Utility class for browser specific functions\r\n */\r\nvar BrowserUtils = /** @class */ (function () {\r\n function BrowserUtils() {\r\n }\r\n // #region Window Navigation and URL management\r\n /**\r\n * Clears hash from window url.\r\n */\r\n BrowserUtils.clearHash = function (contentWindow) {\r\n // Office.js sets history.replaceState to null\r\n contentWindow.location.hash = Constants.EMPTY_STRING;\r\n if (typeof contentWindow.history.replaceState === \"function\") {\r\n // Full removes \"#\" from url\r\n contentWindow.history.replaceState(null, Constants.EMPTY_STRING, \"\" + contentWindow.location.origin + contentWindow.location.pathname + contentWindow.location.search);\r\n }\r\n };\r\n /**\r\n * Replaces current hash with hash from provided url\r\n */\r\n BrowserUtils.replaceHash = function (url) {\r\n var urlParts = url.split(\"#\");\r\n urlParts.shift(); // Remove part before the hash\r\n window.location.hash = urlParts.length > 0 ? urlParts.join(\"#\") : Constants.EMPTY_STRING;\r\n };\r\n /**\r\n * Returns boolean of whether the current window is in an iframe or not.\r\n */\r\n BrowserUtils.isInIframe = function () {\r\n return window.parent !== window;\r\n };\r\n /**\r\n * Returns boolean of whether or not the current window is a popup opened by msal\r\n */\r\n BrowserUtils.isInPopup = function () {\r\n return typeof window !== \"undefined\" && !!window.opener &&\r\n window.opener !== window &&\r\n typeof window.name === \"string\" &&\r\n window.name.indexOf(BrowserConstants.POPUP_NAME_PREFIX + \".\") === 0;\r\n };\r\n // #endregion\r\n /**\r\n * Returns current window URL as redirect uri\r\n */\r\n BrowserUtils.getCurrentUri = function () {\r\n return window.location.href.split(\"?\")[0].split(\"#\")[0];\r\n };\r\n /**\r\n * Gets the homepage url for the current window location.\r\n */\r\n BrowserUtils.getHomepage = function () {\r\n var currentUrl = new UrlString(window.location.href);\r\n var urlComponents = currentUrl.getUrlComponents();\r\n return urlComponents.Protocol + \"//\" + urlComponents.HostNameAndPort + \"/\";\r\n };\r\n /**\r\n * Returns best compatible network client object.\r\n */\r\n BrowserUtils.getBrowserNetworkClient = function () {\r\n if (window.fetch && window.Headers) {\r\n return new FetchClient();\r\n }\r\n else {\r\n return new XhrClient();\r\n }\r\n };\r\n /**\r\n * Throws error if we have completed an auth and are\r\n * attempting another auth request inside an iframe.\r\n */\r\n BrowserUtils.blockReloadInHiddenIframes = function () {\r\n var isResponseHash = UrlString.hashContainsKnownProperties(window.location.hash);\r\n // return an error if called from the hidden iframe created by the msal js silent calls\r\n if (isResponseHash && BrowserUtils.isInIframe()) {\r\n throw BrowserAuthError.createBlockReloadInHiddenIframeError();\r\n }\r\n };\r\n /**\r\n * Block redirect operations in iframes unless explicitly allowed\r\n * @param interactionType Interaction type for the request\r\n * @param allowRedirectInIframe Config value to allow redirects when app is inside an iframe\r\n */\r\n BrowserUtils.blockRedirectInIframe = function (interactionType, allowRedirectInIframe) {\r\n var isIframedApp = BrowserUtils.isInIframe();\r\n if (interactionType === InteractionType.Redirect && isIframedApp && !allowRedirectInIframe) {\r\n // If we are not in top frame, we shouldn't redirect. This is also handled by the service.\r\n throw BrowserAuthError.createRedirectInIframeError(isIframedApp);\r\n }\r\n };\r\n /**\r\n * Block redirectUri loaded in popup from calling AcquireToken APIs\r\n */\r\n BrowserUtils.blockAcquireTokenInPopups = function () {\r\n // Popups opened by msal popup APIs are given a name that starts with \"msal.\"\r\n if (BrowserUtils.isInPopup()) {\r\n throw BrowserAuthError.createBlockAcquireTokenInPopupsError();\r\n }\r\n };\r\n /**\r\n * Throws error if token requests are made in non-browser environment\r\n * @param isBrowserEnvironment Flag indicating if environment is a browser.\r\n */\r\n BrowserUtils.blockNonBrowserEnvironment = function (isBrowserEnvironment) {\r\n if (!isBrowserEnvironment) {\r\n throw BrowserAuthError.createNonBrowserEnvironmentError();\r\n }\r\n };\r\n /**\r\n * Throws error if native brokering is enabled but initialize hasn't been called\r\n * @param allowNativeBroker\r\n * @param initialized\r\n */\r\n BrowserUtils.blockNativeBrokerCalledBeforeInitialized = function (allowNativeBroker, initialized) {\r\n if (allowNativeBroker && !initialized) {\r\n throw BrowserAuthError.createNativeBrokerCalledBeforeInitialize();\r\n }\r\n };\r\n /**\r\n * Returns boolean of whether current browser is an Internet Explorer or Edge browser.\r\n */\r\n BrowserUtils.detectIEOrEdge = function () {\r\n var ua = window.navigator.userAgent;\r\n var msie = ua.indexOf(\"MSIE \");\r\n var msie11 = ua.indexOf(\"Trident/\");\r\n var msedge = ua.indexOf(\"Edge/\");\r\n var isIE = msie > 0 || msie11 > 0;\r\n var isEdge = msedge > 0;\r\n return isIE || isEdge;\r\n };\r\n return BrowserUtils;\r\n}());\n\nexport { BrowserUtils };\n//# sourceMappingURL=BrowserUtils.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator, __spread, __assign } from '../_virtual/_tslib.js';\nimport { AccountEntity, PerformanceEvents, AuthenticationScheme, ClientConfigurationError, StringUtils, UrlString, ServerTelemetryManager, AuthorityFactory } from '@azure/msal-common';\nimport { version } from '../packageMetadata.js';\nimport { BrowserConstants } from '../utils/BrowserConstants.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar BaseInteractionClient = /** @class */ (function () {\r\n function BaseInteractionClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {\r\n this.config = config;\r\n this.browserStorage = storageImpl;\r\n this.browserCrypto = browserCrypto;\r\n this.networkClient = this.config.system.networkClient;\r\n this.eventHandler = eventHandler;\r\n this.navigationClient = navigationClient;\r\n this.nativeMessageHandler = nativeMessageHandler;\r\n this.correlationId = correlationId || this.browserCrypto.createNewGuid();\r\n this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);\r\n this.performanceClient = performanceClient;\r\n }\r\n BaseInteractionClient.prototype.clearCacheOnLogout = function (account) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!account) return [3 /*break*/, 5];\r\n if (AccountEntity.accountInfoIsEqual(account, this.browserStorage.getActiveAccount(), false)) {\r\n this.logger.verbose(\"Setting active account to null\");\r\n this.browserStorage.setActiveAccount(null);\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.browserStorage.removeAccount(AccountEntity.generateAccountCacheKey(account))];\r\n case 2:\r\n _a.sent();\r\n this.logger.verbose(\"Cleared cache items belonging to the account provided in the logout request.\");\r\n return [3 /*break*/, 4];\r\n case 3:\r\n _a.sent();\r\n this.logger.error(\"Account provided in logout request was not found. Local cache unchanged.\");\r\n return [3 /*break*/, 4];\r\n case 4: return [3 /*break*/, 9];\r\n case 5:\r\n _a.trys.push([5, 8, , 9]);\r\n this.logger.verbose(\"No account provided in logout request, clearing all cache items.\", this.correlationId);\r\n // Clear all accounts and tokens\r\n return [4 /*yield*/, this.browserStorage.clear()];\r\n case 6:\r\n // Clear all accounts and tokens\r\n _a.sent();\r\n // Clear any stray keys from IndexedDB\r\n return [4 /*yield*/, this.browserCrypto.clearKeystore()];\r\n case 7:\r\n // Clear any stray keys from IndexedDB\r\n _a.sent();\r\n return [3 /*break*/, 9];\r\n case 8:\r\n _a.sent();\r\n this.logger.error(\"Attempted to clear all MSAL cache items and failed. Local cache unchanged.\");\r\n return [3 /*break*/, 9];\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Initializer function for all request APIs\r\n * @param request\r\n */\r\n BaseInteractionClient.prototype.initializeBaseRequest = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authority, scopes, validatedRequest, _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeBaseRequest, request.correlationId);\r\n this.logger.verbose(\"Initializing BaseAuthRequest\");\r\n authority = request.authority || this.config.auth.authority;\r\n scopes = __spread(((request && request.scopes) || []));\r\n validatedRequest = __assign(__assign({}, request), { correlationId: this.correlationId, authority: authority,\r\n scopes: scopes });\r\n // Set authenticationScheme to BEARER if not explicitly set in the request\r\n if (!validatedRequest.authenticationScheme) {\r\n validatedRequest.authenticationScheme = AuthenticationScheme.BEARER;\r\n this.logger.verbose(\"Authentication Scheme wasn't explicitly set in request, defaulting to \\\"Bearer\\\" request\");\r\n }\r\n else {\r\n if (validatedRequest.authenticationScheme === AuthenticationScheme.SSH) {\r\n if (!request.sshJwk) {\r\n throw ClientConfigurationError.createMissingSshJwkError();\r\n }\r\n if (!request.sshKid) {\r\n throw ClientConfigurationError.createMissingSshKidError();\r\n }\r\n }\r\n this.logger.verbose(\"Authentication Scheme set to \\\"\" + validatedRequest.authenticationScheme + \"\\\" as configured in Auth request\");\r\n }\r\n if (!(request.claims && !StringUtils.isEmpty(request.claims))) return [3 /*break*/, 2];\r\n _a = validatedRequest;\r\n return [4 /*yield*/, this.browserCrypto.hashString(request.claims)];\r\n case 1:\r\n _a.requestedClaimsHash = _b.sent();\r\n _b.label = 2;\r\n case 2: return [2 /*return*/, validatedRequest];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n *\r\n * Use to get the redirect uri configured in MSAL or null.\r\n * @param requestRedirectUri\r\n * @returns Redirect URL\r\n *\r\n */\r\n BaseInteractionClient.prototype.getRedirectUri = function (requestRedirectUri) {\r\n this.logger.verbose(\"getRedirectUri called\");\r\n var redirectUri = requestRedirectUri || this.config.auth.redirectUri || BrowserUtils.getCurrentUri();\r\n return UrlString.getAbsoluteUrl(redirectUri, BrowserUtils.getCurrentUri());\r\n };\r\n /**\r\n *\r\n * @param apiId\r\n * @param correlationId\r\n * @param forceRefresh\r\n */\r\n BaseInteractionClient.prototype.initializeServerTelemetryManager = function (apiId, forceRefresh) {\r\n this.logger.verbose(\"initializeServerTelemetryManager called\");\r\n var telemetryPayload = {\r\n clientId: this.config.auth.clientId,\r\n correlationId: this.correlationId,\r\n apiId: apiId,\r\n forceRefresh: forceRefresh || false,\r\n wrapperSKU: this.browserStorage.getWrapperMetadata()[0],\r\n wrapperVer: this.browserStorage.getWrapperMetadata()[1]\r\n };\r\n return new ServerTelemetryManager(telemetryPayload, this.browserStorage);\r\n };\r\n /**\r\n * Used to get a discovered version of the default authority.\r\n * @param requestAuthority\r\n * @param requestCorrelationId\r\n */\r\n BaseInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authorityOptions;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"getDiscoveredAuthority called\");\r\n authorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata\r\n };\r\n if (!requestAuthority) return [3 /*break*/, 2];\r\n this.logger.verbose(\"Creating discovered authority with request authority\");\r\n return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2:\r\n this.logger.verbose(\"Creating discovered authority with configured authority\");\r\n return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger)];\r\n case 3: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n return BaseInteractionClient;\r\n}());\n\nexport { BaseInteractionClient };\n//# sourceMappingURL=BaseInteractionClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { UrlString, Constants, PerformanceEvents, AuthorizationCodeClient, Authority, AuthorityFactory, ResponseMode, StringUtils, ProtocolUtils } from '@azure/msal-common';\nimport { BaseInteractionClient } from './BaseInteractionClient.js';\nimport { BrowserConstants } from '../utils/BrowserConstants.js';\nimport { version } from '../packageMetadata.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.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 * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\r\n */\r\nvar StandardInteractionClient = /** @class */ (function (_super) {\r\n __extends(StandardInteractionClient, _super);\r\n function StandardInteractionClient() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Generates an auth code request tied to the url request.\r\n * @param request\r\n */\r\n StandardInteractionClient.prototype.initializeAuthorizationCodeRequest = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var generatedPkceParams, authCodeRequest;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\r\n return [4 /*yield*/, this.browserCrypto.generatePkceCodes()];\r\n case 1:\r\n generatedPkceParams = _a.sent();\r\n authCodeRequest = __assign(__assign({}, request), { redirectUri: request.redirectUri, code: Constants.EMPTY_STRING, codeVerifier: generatedPkceParams.verifier });\r\n request.codeChallenge = generatedPkceParams.challenge;\r\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\r\n return [2 /*return*/, authCodeRequest];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Initializer for the logout request.\r\n * @param logoutRequest\r\n */\r\n StandardInteractionClient.prototype.initializeLogoutRequest = function (logoutRequest) {\r\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.correlationId);\r\n var validLogoutRequest = __assign({ correlationId: this.correlationId || this.browserCrypto.createNewGuid() }, logoutRequest);\r\n /**\r\n * Set logout_hint to be login_hint from ID Token Claims if present\r\n * and logoutHint attribute wasn't manually set in logout request\r\n */\r\n if (logoutRequest) {\r\n // If logoutHint isn't set and an account was passed in, try to extract logoutHint from ID Token Claims\r\n if (!logoutRequest.logoutHint) {\r\n if (logoutRequest.account) {\r\n var logoutHint = this.getLogoutHintFromIdTokenClaims(logoutRequest.account);\r\n if (logoutHint) {\r\n this.logger.verbose(\"Setting logoutHint to login_hint ID Token Claim value for the account provided\");\r\n validLogoutRequest.logoutHint = logoutHint;\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint was not set and account was not passed into logout request, logoutHint will not be set\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint has already been set in logoutRequest\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"logoutHint will not be set since no logout request was configured\");\r\n }\r\n /*\r\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\r\n * Otherwise, use passed uri, config, or current page.\r\n */\r\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\r\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\r\n }\r\n else if (this.config.auth.postLogoutRedirectUri === null) {\r\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\r\n }\r\n else if (this.config.auth.postLogoutRedirectUri) {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\r\n }\r\n else {\r\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\r\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\r\n }\r\n return validLogoutRequest;\r\n };\r\n /**\r\n * Parses login_hint ID Token Claim out of AccountInfo object to be used as\r\n * logout_hint in end session request.\r\n * @param account\r\n */\r\n StandardInteractionClient.prototype.getLogoutHintFromIdTokenClaims = function (account) {\r\n var idTokenClaims = account.idTokenClaims;\r\n if (idTokenClaims) {\r\n if (idTokenClaims.login_hint) {\r\n return idTokenClaims.login_hint;\r\n }\r\n else {\r\n 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\");\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"The provided account does not contain ID Token Claims, logoutHint will not be added to logout request\");\r\n }\r\n return null;\r\n };\r\n /**\r\n * Creates an Authorization Code Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n StandardInteractionClient.prototype.createAuthCodeClient = function (serverTelemetryManager, authorityUrl, requestAzureCloudOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var clientConfig;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.correlationId);\r\n // Create auth module.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, requestAzureCloudOptions)];\r\n case 1:\r\n clientConfig = _a.sent();\r\n return [2 /*return*/, new AuthorizationCodeClient(clientConfig, this.performanceClient)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Creates a Client Configuration object with the given request authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param requestAuthority\r\n * @param requestCorrelationId\r\n */\r\n StandardInteractionClient.prototype.getClientConfiguration = function (serverTelemetryManager, requestAuthority, requestAzureCloudOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var discoveredAuthority, logger;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n this.logger.verbose(\"getClientConfiguration called\", this.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\r\n return [4 /*yield*/, this.getDiscoveredAuthority(requestAuthority, requestAzureCloudOptions)];\r\n case 1:\r\n discoveredAuthority = _a.sent();\r\n logger = this.config.system.loggerOptions;\r\n return [2 /*return*/, {\r\n authOptions: {\r\n clientId: this.config.auth.clientId,\r\n authority: discoveredAuthority,\r\n clientCapabilities: this.config.auth.clientCapabilities\r\n },\r\n systemOptions: {\r\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\r\n preventCorsPreflight: true\r\n },\r\n loggerOptions: {\r\n loggerCallback: logger.loggerCallback,\r\n piiLoggingEnabled: logger.piiLoggingEnabled,\r\n logLevel: logger.logLevel,\r\n correlationId: this.correlationId\r\n },\r\n cryptoInterface: this.browserCrypto,\r\n networkInterface: this.networkClient,\r\n storageInterface: this.browserStorage,\r\n serverTelemetryManager: serverTelemetryManager,\r\n libraryInfo: {\r\n sku: BrowserConstants.MSAL_SKU,\r\n version: version,\r\n cpu: Constants.EMPTY_STRING,\r\n os: Constants.EMPTY_STRING\r\n },\r\n telemetry: this.config.telemetry\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @param hash\r\n * @param interactionType\r\n */\r\n StandardInteractionClient.prototype.validateAndExtractStateFromHash = function (serverParams, interactionType, requestCorrelationId) {\r\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\r\n if (!serverParams.state) {\r\n throw BrowserAuthError.createHashDoesNotContainStateError();\r\n }\r\n var platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\r\n if (!platformStateObj) {\r\n throw BrowserAuthError.createUnableToParseStateError();\r\n }\r\n if (platformStateObj.interactionType !== interactionType) {\r\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\r\n }\r\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\r\n return serverParams.state;\r\n };\r\n /**\r\n * Used to get a discovered version of the default authority.\r\n * @param requestAuthority\r\n * @param requestCorrelationId\r\n */\r\n StandardInteractionClient.prototype.getDiscoveredAuthority = function (requestAuthority, requestAzureCloudOptions) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var getAuthorityMeasurement, authorityOptions, userAuthority, builtAuthority;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\r\n this.logger.verbose(\"getDiscoveredAuthority called\", this.correlationId);\r\n getAuthorityMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority, this.correlationId);\r\n authorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata,\r\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache\r\n };\r\n userAuthority = requestAuthority ? requestAuthority : this.config.auth.authority;\r\n builtAuthority = Authority.generateAuthority(userAuthority, requestAzureCloudOptions || this.config.auth.azureCloudOptions);\r\n this.logger.verbose(\"Creating discovered authority with configured authority\", this.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, this.correlationId);\r\n return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(builtAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions, this.logger, this.performanceClient, this.correlationId)\r\n .then(function (result) {\r\n getAuthorityMeasurement.endMeasurement({\r\n success: true,\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n getAuthorityMeasurement.endMeasurement({\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n success: false\r\n });\r\n throw error;\r\n })];\r\n case 1: return [2 /*return*/, _b.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\r\n * @param request\r\n * @param interactionType\r\n */\r\n StandardInteractionClient.prototype.initializeAuthorizationRequest = function (request, interactionType) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var redirectUri, browserState, state, validatedRequest, _a, account, legacyLoginHint;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.correlationId);\r\n this.logger.verbose(\"initializeAuthorizationRequest called\", this.correlationId);\r\n redirectUri = this.getRedirectUri(request.redirectUri);\r\n browserState = {\r\n interactionType: interactionType\r\n };\r\n state = ProtocolUtils.setRequestState(this.browserCrypto, (request && request.state) || Constants.EMPTY_STRING, browserState);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\r\n _a = [{}];\r\n return [4 /*yield*/, this.initializeBaseRequest(request)];\r\n case 1:\r\n validatedRequest = __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { redirectUri: redirectUri, state: state, nonce: request.nonce || this.browserCrypto.createNewGuid(), responseMode: ResponseMode.FRAGMENT }]);\r\n account = request.account || this.browserStorage.getActiveAccount();\r\n if (account) {\r\n this.logger.verbose(\"Setting validated request account\", this.correlationId);\r\n this.logger.verbosePii(\"Setting validated request account: \" + account.homeAccountId, this.correlationId);\r\n validatedRequest.account = account;\r\n }\r\n // Check for ADAL/MSAL v1 SSO\r\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\r\n legacyLoginHint = this.browserStorage.getLegacyLoginHint();\r\n if (legacyLoginHint) {\r\n validatedRequest.loginHint = legacyLoginHint;\r\n }\r\n }\r\n return [2 /*return*/, validatedRequest];\r\n }\r\n });\r\n });\r\n };\r\n return StandardInteractionClient;\r\n}(BaseInteractionClient));\n\nexport { StandardInteractionClient };\n//# sourceMappingURL=StandardInteractionClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { PerformanceEvents, StringUtils, ClientAuthError, ServerError, AuthorityFactory } from '@azure/msal-common';\nimport { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';\nimport { TemporaryCacheKeys } from '../utils/BrowserConstants.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 * Abstract class which defines operations for a browser interaction handling class.\r\n */\r\nvar InteractionHandler = /** @class */ (function () {\r\n function InteractionHandler(authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) {\r\n this.authModule = authCodeModule;\r\n this.browserStorage = storageImpl;\r\n this.authCodeRequest = authCodeRequest;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Function to handle response parameters from hash.\r\n * @param locationHash\r\n */\r\n InteractionHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var stateKey, requestState, authCodeResponse;\r\n return __generator(this, function (_a) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromHash, this.authCodeRequest.correlationId);\r\n this.logger.verbose(\"InteractionHandler.handleCodeResponse called\");\r\n // Check that location hash isn't empty.\r\n if (StringUtils.isEmpty(locationHash)) {\r\n throw BrowserAuthError.createEmptyHashError(locationHash);\r\n }\r\n stateKey = this.browserStorage.generateStateKey(state);\r\n requestState = this.browserStorage.getTemporaryCache(stateKey);\r\n if (!requestState) {\r\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\r\n }\r\n try {\r\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\r\n }\r\n catch (e) {\r\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\r\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\r\n throw BrowserAuthError.createUserCancelledError();\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);\r\n return [2 /*return*/, this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule)];\r\n });\r\n });\r\n };\r\n /**\r\n * Process auth code response from AAD\r\n * @param authCodeResponse\r\n * @param state\r\n * @param authority\r\n * @param networkModule\r\n * @returns\r\n */\r\n InteractionHandler.prototype.handleCodeResponseFromServer = function (authCodeResponse, state, authority, networkModule, validateNonce) {\r\n if (validateNonce === void 0) { validateNonce = true; }\r\n return __awaiter(this, void 0, void 0, function () {\r\n var stateKey, requestState, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.HandleCodeResponseFromServer, this.authCodeRequest.correlationId);\r\n this.logger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\r\n stateKey = this.browserStorage.generateStateKey(state);\r\n requestState = this.browserStorage.getTemporaryCache(stateKey);\r\n if (!requestState) {\r\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\r\n }\r\n nonceKey = this.browserStorage.generateNonceKey(requestState);\r\n cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\r\n // Assign code to request\r\n this.authCodeRequest.code = authCodeResponse.code;\r\n if (!authCodeResponse.cloud_instance_host_name) return [3 /*break*/, 2];\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);\r\n return [4 /*yield*/, this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\r\n if (validateNonce) {\r\n authCodeResponse.nonce = cachedNonce || undefined;\r\n }\r\n authCodeResponse.state = requestState;\r\n // Add CCS parameters if available\r\n if (authCodeResponse.client_info) {\r\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\r\n }\r\n else {\r\n cachedCcsCred = this.checkCcsCredentials();\r\n if (cachedCcsCred) {\r\n this.authCodeRequest.ccsCredential = cachedCcsCred;\r\n }\r\n }\r\n // Acquire token with retrieved code.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.AuthClientAcquireToken, this.authCodeRequest.correlationId);\r\n return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];\r\n case 3:\r\n tokenResponse = _a.sent();\r\n this.browserStorage.cleanRequestByState(state);\r\n return [2 /*return*/, tokenResponse];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Updates authority based on cloudInstanceHostname\r\n * @param cloudInstanceHostname\r\n * @param authority\r\n * @param networkModule\r\n */\r\n InteractionHandler.prototype.updateTokenEndpointAuthority = function (cloudInstanceHostname, authority, networkModule) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cloudInstanceAuthorityUri, cloudInstanceAuthority;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.UpdateTokenEndpointAuthority, this.authCodeRequest.correlationId);\r\n cloudInstanceAuthorityUri = \"https://\" + cloudInstanceHostname + \"/\" + authority.tenant + \"/\";\r\n return [4 /*yield*/, AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options, this.logger, this.performanceClient, this.authCodeRequest.correlationId)];\r\n case 1:\r\n cloudInstanceAuthority = _a.sent();\r\n this.authModule.updateAuthority(cloudInstanceAuthority);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Looks up ccs creds in the cache\r\n */\r\n InteractionHandler.prototype.checkCcsCredentials = function () {\r\n // Look up ccs credential in temp cache\r\n var cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\r\n if (cachedCcsCred) {\r\n try {\r\n return JSON.parse(cachedCcsCred);\r\n }\r\n catch (e) {\r\n this.authModule.logger.error(\"Cache credential could not be parsed\");\r\n this.authModule.logger.errorPii(\"Cache credential could not be parsed: \" + cachedCcsCred);\r\n }\r\n }\r\n return null;\r\n };\r\n return InteractionHandler;\r\n}());\n\nexport { InteractionHandler };\n//# sourceMappingURL=InteractionHandler.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { StringUtils, ClientAuthError, ServerError } from '@azure/msal-common';\nimport { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';\nimport { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.js';\nimport { InteractionHandler } from './InteractionHandler.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar RedirectHandler = /** @class */ (function (_super) {\r\n __extends(RedirectHandler, _super);\r\n function RedirectHandler(authCodeModule, storageImpl, authCodeRequest, logger, browserCrypto, performanceClient) {\r\n var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) || this;\r\n _this.browserCrypto = browserCrypto;\r\n return _this;\r\n }\r\n /**\r\n * Redirects window to given URL.\r\n * @param urlNavigate\r\n */\r\n RedirectHandler.prototype.initiateAuthRequest = function (requestUrl, params) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var navigationOptions, navigate;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest called\");\r\n if (!!StringUtils.isEmpty(requestUrl)) return [3 /*break*/, 7];\r\n // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true\r\n if (params.redirectStartPage) {\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page\");\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);\r\n }\r\n // Set interaction status in the library.\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);\r\n this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);\r\n this.logger.infoPii(\"RedirectHandler.initiateAuthRequest: Navigate to: \" + requestUrl);\r\n navigationOptions = {\r\n apiId: ApiId.acquireTokenRedirect,\r\n timeout: params.redirectTimeout,\r\n noHistory: false\r\n };\r\n if (!(typeof params.onRedirectNavigate === \"function\")) return [3 /*break*/, 4];\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback\");\r\n navigate = params.onRedirectNavigate(requestUrl);\r\n if (!(navigate !== false)) return [3 /*break*/, 2];\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating\");\r\n return [4 /*yield*/, params.navigationClient.navigateExternal(requestUrl, navigationOptions)];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 2:\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation\");\r\n return [2 /*return*/];\r\n case 3: return [3 /*break*/, 6];\r\n case 4:\r\n // Navigate window to request URL\r\n this.logger.verbose(\"RedirectHandler.initiateAuthRequest: Navigating window to navigate url\");\r\n return [4 /*yield*/, params.navigationClient.navigateExternal(requestUrl, navigationOptions)];\r\n case 5:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 6: return [3 /*break*/, 8];\r\n case 7:\r\n // Throw error if request URL is empty.\r\n this.logger.info(\"RedirectHandler.initiateAuthRequest: Navigate url is empty\");\r\n throw BrowserAuthError.createEmptyNavigationUriError();\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Handle authorization code response in the window.\r\n * @param hash\r\n */\r\n RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"RedirectHandler.handleCodeResponse called\");\r\n // Check that location hash isn't empty.\r\n if (StringUtils.isEmpty(locationHash)) {\r\n throw BrowserAuthError.createEmptyHashError(locationHash);\r\n }\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n stateKey = this.browserStorage.generateStateKey(state);\r\n requestState = this.browserStorage.getTemporaryCache(stateKey);\r\n if (!requestState) {\r\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\r\n }\r\n try {\r\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\r\n }\r\n catch (e) {\r\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\r\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\r\n throw BrowserAuthError.createUserCancelledError();\r\n }\r\n else {\r\n throw e;\r\n }\r\n }\r\n nonceKey = this.browserStorage.generateNonceKey(requestState);\r\n cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\r\n // Assign code to request\r\n this.authCodeRequest.code = authCodeResponse.code;\r\n if (!authCodeResponse.cloud_instance_host_name) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule)];\r\n case 1:\r\n _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n authCodeResponse.nonce = cachedNonce || undefined;\r\n authCodeResponse.state = requestState;\r\n // Add CCS parameters if available\r\n if (authCodeResponse.client_info) {\r\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\r\n }\r\n else {\r\n cachedCcsCred = this.checkCcsCredentials();\r\n if (cachedCcsCred) {\r\n this.authCodeRequest.ccsCredential = cachedCcsCred;\r\n }\r\n }\r\n return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];\r\n case 3:\r\n tokenResponse = _a.sent();\r\n this.browserStorage.cleanRequestByState(state);\r\n return [2 /*return*/, tokenResponse];\r\n }\r\n });\r\n });\r\n };\r\n return RedirectHandler;\r\n}(InteractionHandler));\n\nexport { RedirectHandler };\n//# sourceMappingURL=RedirectHandler.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar EventType;\r\n(function (EventType) {\r\n EventType[\"INITIALIZE_START\"] = \"msal:initializeStart\";\r\n EventType[\"INITIALIZE_END\"] = \"msal:initializeEnd\";\r\n EventType[\"ACCOUNT_ADDED\"] = \"msal:accountAdded\";\r\n EventType[\"ACCOUNT_REMOVED\"] = \"msal:accountRemoved\";\r\n EventType[\"LOGIN_START\"] = \"msal:loginStart\";\r\n EventType[\"LOGIN_SUCCESS\"] = \"msal:loginSuccess\";\r\n EventType[\"LOGIN_FAILURE\"] = \"msal:loginFailure\";\r\n EventType[\"ACQUIRE_TOKEN_START\"] = \"msal:acquireTokenStart\";\r\n EventType[\"ACQUIRE_TOKEN_SUCCESS\"] = \"msal:acquireTokenSuccess\";\r\n EventType[\"ACQUIRE_TOKEN_FAILURE\"] = \"msal:acquireTokenFailure\";\r\n EventType[\"ACQUIRE_TOKEN_NETWORK_START\"] = \"msal:acquireTokenFromNetworkStart\";\r\n EventType[\"SSO_SILENT_START\"] = \"msal:ssoSilentStart\";\r\n EventType[\"SSO_SILENT_SUCCESS\"] = \"msal:ssoSilentSuccess\";\r\n EventType[\"SSO_SILENT_FAILURE\"] = \"msal:ssoSilentFailure\";\r\n EventType[\"ACQUIRE_TOKEN_BY_CODE_START\"] = \"msal:acquireTokenByCodeStart\";\r\n EventType[\"ACQUIRE_TOKEN_BY_CODE_SUCCESS\"] = \"msal:acquireTokenByCodeSuccess\";\r\n EventType[\"ACQUIRE_TOKEN_BY_CODE_FAILURE\"] = \"msal:acquireTokenByCodeFailure\";\r\n EventType[\"HANDLE_REDIRECT_START\"] = \"msal:handleRedirectStart\";\r\n EventType[\"HANDLE_REDIRECT_END\"] = \"msal:handleRedirectEnd\";\r\n EventType[\"POPUP_OPENED\"] = \"msal:popupOpened\";\r\n EventType[\"LOGOUT_START\"] = \"msal:logoutStart\";\r\n EventType[\"LOGOUT_SUCCESS\"] = \"msal:logoutSuccess\";\r\n EventType[\"LOGOUT_FAILURE\"] = \"msal:logoutFailure\";\r\n EventType[\"LOGOUT_END\"] = \"msal:logoutEnd\";\r\n})(EventType || (EventType = {}));\n\nexport { EventType };\n//# sourceMappingURL=EventType.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { InteractionRequiredAuthError, AuthError } from '@azure/msal-common';\nimport { BrowserAuthError } from './BrowserAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar NativeStatusCode;\r\n(function (NativeStatusCode) {\r\n NativeStatusCode[\"USER_INTERACTION_REQUIRED\"] = \"USER_INTERACTION_REQUIRED\";\r\n NativeStatusCode[\"USER_CANCEL\"] = \"USER_CANCEL\";\r\n NativeStatusCode[\"NO_NETWORK\"] = \"NO_NETWORK\";\r\n NativeStatusCode[\"TRANSIENT_ERROR\"] = \"TRANSIENT_ERROR\";\r\n NativeStatusCode[\"PERSISTENT_ERROR\"] = \"PERSISTENT_ERROR\";\r\n NativeStatusCode[\"DISABLED\"] = \"DISABLED\";\r\n NativeStatusCode[\"ACCOUNT_UNAVAILABLE\"] = \"ACCOUNT_UNAVAILABLE\";\r\n})(NativeStatusCode || (NativeStatusCode = {}));\r\nvar NativeAuthErrorMessage = {\r\n extensionError: {\r\n code: \"ContentError\"\r\n },\r\n userSwitch: {\r\n code: \"user_switch\",\r\n desc: \"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again.\"\r\n },\r\n tokensNotFoundInCache: {\r\n code: \"tokens_not_found_in_internal_memory_cache\",\r\n desc: \"Tokens not cached in MSAL JS internal memory, please make the WAM request\"\r\n }\r\n};\r\nvar NativeAuthError = /** @class */ (function (_super) {\r\n __extends(NativeAuthError, _super);\r\n function NativeAuthError(errorCode, description, ext) {\r\n var _this = _super.call(this, errorCode, description) || this;\r\n Object.setPrototypeOf(_this, NativeAuthError.prototype);\r\n _this.name = \"NativeAuthError\";\r\n _this.ext = ext;\r\n return _this;\r\n }\r\n /**\r\n * These errors should result in a fallback to the 'standard' browser based auth flow.\r\n */\r\n NativeAuthError.prototype.isFatal = function () {\r\n if (this.ext && this.ext.status && (this.ext.status === NativeStatusCode.PERSISTENT_ERROR || this.ext.status === NativeStatusCode.DISABLED)) {\r\n return true;\r\n }\r\n switch (this.errorCode) {\r\n case NativeAuthErrorMessage.extensionError.code:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n };\r\n /**\r\n * Create the appropriate error object based on the WAM status code.\r\n * @param code\r\n * @param description\r\n * @param ext\r\n * @returns\r\n */\r\n NativeAuthError.createError = function (code, description, ext) {\r\n if (ext && ext.status) {\r\n switch (ext.status) {\r\n case NativeStatusCode.ACCOUNT_UNAVAILABLE:\r\n return InteractionRequiredAuthError.createNativeAccountUnavailableError();\r\n case NativeStatusCode.USER_INTERACTION_REQUIRED:\r\n return new InteractionRequiredAuthError(code, description);\r\n case NativeStatusCode.USER_CANCEL:\r\n return BrowserAuthError.createUserCancelledError();\r\n case NativeStatusCode.NO_NETWORK:\r\n return BrowserAuthError.createNoNetworkConnectivityError();\r\n }\r\n }\r\n return new NativeAuthError(code, description, ext);\r\n };\r\n /**\r\n * Creates user switch error when the user chooses a different account in the native broker prompt\r\n * @returns\r\n */\r\n NativeAuthError.createUserSwitchError = function () {\r\n return new NativeAuthError(NativeAuthErrorMessage.userSwitch.code, NativeAuthErrorMessage.userSwitch.desc);\r\n };\r\n /**\r\n * Creates a tokens not found error when the internal cache look up fails\r\n * @returns NativeAuthError: tokensNotFoundInCache\r\n */\r\n NativeAuthError.createTokensNotFoundInCacheError = function () {\r\n return new NativeAuthError(NativeAuthErrorMessage.tokensNotFoundInCache.code, NativeAuthErrorMessage.tokensNotFoundInCache.desc);\r\n };\r\n return NativeAuthError;\r\n}(AuthError));\n\nexport { NativeAuthError, NativeAuthErrorMessage, NativeStatusCode };\n//# sourceMappingURL=NativeAuthError.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { AuthError, PerformanceEvents, SilentFlowClient } from '@azure/msal-common';\nimport { ApiId } from '../utils/BrowserConstants.js';\nimport { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentCacheClient = /** @class */ (function (_super) {\r\n __extends(SilentCacheClient, _super);\r\n function SilentCacheClient() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Returns unexpired tokens from the cache, if available\r\n * @param silentRequest\r\n */\r\n SilentCacheClient.prototype.acquireToken = function (silentRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var acquireTokenMeasurement, serverTelemetryManager, silentAuthClient, cachedToken, error_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentCacheClientAcquireToken, silentRequest.correlationId);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n return [4 /*yield*/, this.createSilentFlowClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];\r\n case 1:\r\n silentAuthClient = _a.sent();\r\n this.logger.verbose(\"Silent auth client created\");\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, silentAuthClient.acquireCachedToken(silentRequest)];\r\n case 3:\r\n cachedToken = _a.sent();\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: true\r\n });\r\n return [2 /*return*/, cachedToken];\r\n case 4:\r\n error_1 = _a.sent();\r\n if (error_1 instanceof BrowserAuthError && error_1.errorCode === BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code) {\r\n this.logger.verbose(\"Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair.\");\r\n }\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: error_1 instanceof AuthError && error_1.errorCode || undefined,\r\n subErrorCode: error_1 instanceof AuthError && error_1.subError || undefined,\r\n success: false\r\n });\r\n throw error_1;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Currently Unsupported\r\n */\r\n SilentCacheClient.prototype.logout = function () {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n };\r\n /**\r\n * Creates an Silent Flow Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n SilentCacheClient.prototype.createSilentFlowClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var clientConfig;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Create auth module.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];\r\n case 1:\r\n clientConfig = _a.sent();\r\n return [2 /*return*/, new SilentFlowClient(clientConfig, this.performanceClient)];\r\n }\r\n });\r\n });\r\n };\r\n SilentCacheClient.prototype.initializeSilentRequest = function (request, account) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _a;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.InitializeSilentRequest, this.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, this.correlationId);\r\n _a = [__assign({}, request)];\r\n return [4 /*yield*/, this.initializeBaseRequest(request)];\r\n case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([_b.sent()])), { account: account, forceRefresh: request.forceRefresh || false }])];\r\n }\r\n });\r\n });\r\n };\r\n return SilentCacheClient;\r\n}(StandardInteractionClient));\n\nexport { SilentCacheClient };\n//# sourceMappingURL=SilentCacheClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __rest, __assign } from '../_virtual/_tslib.js';\nimport { ScopeSet, AuthToken, Constants, AccountEntity, AuthorityType, IdTokenEntity, AccessTokenEntity, PerformanceEvents, TimeUtils, ClientAuthError, AuthenticationScheme, PopTokenGenerator, UrlString, OIDC_DEFAULT_SCOPES, PromptValue } from '@azure/msal-common';\nimport { BaseInteractionClient } from './BaseInteractionClient.js';\nimport { TemporaryCacheKeys, NativeExtensionMethod, NativeConstants, ApiId } from '../utils/BrowserConstants.js';\nimport { NativeAuthError } from '../error/NativeAuthError.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { SilentCacheClient } from './SilentCacheClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar NativeInteractionClient = /** @class */ (function (_super) {\r\n __extends(NativeInteractionClient, _super);\r\n function NativeInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {\r\n var _this = _super.call(this, config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId) || this;\r\n _this.apiId = apiId;\r\n _this.accountId = accountId;\r\n _this.nativeMessageHandler = provider;\r\n _this.nativeStorageManager = nativeStorageImpl;\r\n _this.silentCacheClient = new SilentCacheClient(config, _this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);\r\n return _this;\r\n }\r\n /**\r\n * Acquire token from native platform via browser extension\r\n * @param request\r\n */\r\n NativeInteractionClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var nativeATMeasurement, reqTimestamp, nativeRequest, result, messageBody, response, validatedResponse;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"NativeInteractionClient - acquireToken called.\");\r\n nativeATMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.NativeInteractionClientAcquireToken, request.correlationId);\r\n reqTimestamp = TimeUtils.nowSeconds();\r\n return [4 /*yield*/, this.initializeNativeRequest(request)];\r\n case 1:\r\n nativeRequest = _a.sent();\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.acquireTokensFromCache(this.accountId, nativeRequest)];\r\n case 3:\r\n result = _a.sent();\r\n nativeATMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: false,\r\n fromCache: true\r\n });\r\n return [2 /*return*/, result];\r\n case 4:\r\n _a.sent();\r\n // continue with a native call for any and all errors\r\n this.logger.info(\"MSAL internal Cache does not contain tokens, proceed to make a native call\");\r\n return [3 /*break*/, 5];\r\n case 5:\r\n messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: nativeRequest\r\n };\r\n return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];\r\n case 6:\r\n response = _a.sent();\r\n validatedResponse = this.validateNativeResponse(response);\r\n return [2 /*return*/, this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)\r\n .then(function (result) {\r\n nativeATMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: true,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n nativeATMeasurement.endMeasurement({\r\n success: false,\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n isNativeBroker: true\r\n });\r\n throw error;\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Creates silent flow request\r\n * @param request\r\n * @param cachedAccount\r\n * @returns CommonSilentFlowRequest\r\n */\r\n NativeInteractionClient.prototype.createSilentCacheRequest = function (request, cachedAccount) {\r\n return {\r\n authority: request.authority,\r\n correlationId: this.correlationId,\r\n scopes: ScopeSet.fromString(request.scope).asArray(),\r\n account: cachedAccount,\r\n forceRefresh: false,\r\n };\r\n };\r\n /**\r\n * Fetches the tokens from the cache if un-expired\r\n * @param nativeAccountId\r\n * @param request\r\n * @returns authenticationResult\r\n */\r\n NativeInteractionClient.prototype.acquireTokensFromCache = function (nativeAccountId, request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var account, silentRequest, result, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!nativeAccountId) {\r\n this.logger.warning(\"NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided\");\r\n throw ClientAuthError.createNoAccountFoundError();\r\n }\r\n account = this.browserStorage.getAccountInfoFilteredBy({ nativeAccountId: nativeAccountId });\r\n if (!account) {\r\n throw ClientAuthError.createNoAccountFoundError();\r\n }\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n silentRequest = this.createSilentCacheRequest(request, account);\r\n return [4 /*yield*/, this.silentCacheClient.acquireToken(silentRequest)];\r\n case 2:\r\n result = _a.sent();\r\n return [2 /*return*/, result];\r\n case 3:\r\n e_2 = _a.sent();\r\n throw e_2;\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Acquires a token from native platform then redirects to the redirectUri instead of returning the response\r\n * @param request\r\n */\r\n NativeInteractionClient.prototype.acquireTokenRedirect = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var nativeRequest, messageBody, response, e_3, navigationOptions, redirectUri;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"NativeInteractionClient - acquireTokenRedirect called.\");\r\n return [4 /*yield*/, this.initializeNativeRequest(request)];\r\n case 1:\r\n nativeRequest = _a.sent();\r\n messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: nativeRequest\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];\r\n case 3:\r\n response = _a.sent();\r\n this.validateNativeResponse(response);\r\n return [3 /*break*/, 5];\r\n case 4:\r\n e_3 = _a.sent();\r\n // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise\r\n if (e_3 instanceof NativeAuthError && e_3.isFatal()) {\r\n throw e_3;\r\n }\r\n return [3 /*break*/, 5];\r\n case 5:\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, JSON.stringify(nativeRequest), true);\r\n navigationOptions = {\r\n apiId: ApiId.acquireTokenRedirect,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n redirectUri = this.config.auth.navigateToLoginRequestUrl ? window.location.href : this.getRedirectUri(request.redirectUri);\r\n return [4 /*yield*/, this.navigationClient.navigateExternal(redirectUri, navigationOptions)];\r\n case 6:\r\n _a.sent(); // Need to treat this as external to ensure handleRedirectPromise is run again\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * If the previous page called native platform for a token using redirect APIs, send the same request again and return the response\r\n */\r\n NativeInteractionClient.prototype.handleRedirectPromise = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cachedRequest, prompt, request, messageBody, reqTimestamp, response, result, e_4;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"NativeInteractionClient - handleRedirectPromise called.\");\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return [2 /*return*/, null];\r\n }\r\n cachedRequest = this.browserStorage.getCachedNativeRequest();\r\n if (!cachedRequest) {\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.\");\r\n return [2 /*return*/, null];\r\n }\r\n prompt = cachedRequest.prompt, request = __rest(cachedRequest, [\"prompt\"]);\r\n if (prompt) {\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.\");\r\n }\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));\r\n messageBody = {\r\n method: NativeExtensionMethod.GetToken,\r\n request: request\r\n };\r\n reqTimestamp = TimeUtils.nowSeconds();\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n this.logger.verbose(\"NativeInteractionClient - handleRedirectPromise sending message to native broker.\");\r\n return [4 /*yield*/, this.nativeMessageHandler.sendMessage(messageBody)];\r\n case 2:\r\n response = _a.sent();\r\n this.validateNativeResponse(response);\r\n result = this.handleNativeResponse(response, request, reqTimestamp);\r\n this.browserStorage.setInteractionInProgress(false);\r\n return [2 /*return*/, result];\r\n case 3:\r\n e_4 = _a.sent();\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw e_4;\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Logout from native platform via browser extension\r\n * @param request\r\n */\r\n NativeInteractionClient.prototype.logout = function () {\r\n this.logger.trace(\"NativeInteractionClient - logout called.\");\r\n return Promise.reject(\"Logout not implemented yet\");\r\n };\r\n /**\r\n * Transform response from native platform into AuthenticationResult object which will be returned to the end user\r\n * @param response\r\n * @param request\r\n * @param reqTimestamp\r\n */\r\n NativeInteractionClient.prototype.handleNativeResponse = function (response, request, reqTimestamp) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authority, authorityPreferredCache, idTokenObj, homeAccountIdentifier, accountEntity, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"NativeInteractionClient - handleNativeResponse called.\");\r\n if (response.account.id !== request.accountId) {\r\n // User switch in native broker prompt is not supported. All users must first sign in through web flow to ensure server state is in sync\r\n throw NativeAuthError.createUserSwitchError();\r\n }\r\n return [4 /*yield*/, this.getDiscoveredAuthority(request.authority)];\r\n case 1:\r\n authority = _a.sent();\r\n authorityPreferredCache = authority.getPreferredCache();\r\n idTokenObj = this.createIdTokenObj(response);\r\n homeAccountIdentifier = this.createHomeAccountIdentifier(response, idTokenObj);\r\n accountEntity = this.createAccountEntity(response, homeAccountIdentifier, idTokenObj, authorityPreferredCache);\r\n return [4 /*yield*/, this.generateAuthenticationResult(response, request, idTokenObj, accountEntity, authority.canonicalAuthority, reqTimestamp)];\r\n case 2:\r\n result = _a.sent();\r\n // cache accounts and tokens in the appropriate storage\r\n this.cacheAccount(accountEntity);\r\n this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenObj, result.accessToken, result.tenantId, reqTimestamp);\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Create an idToken Object (not entity)\r\n * @param response\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.createIdTokenObj = function (response) {\r\n return new AuthToken(response.id_token || Constants.EMPTY_STRING, this.browserCrypto);\r\n };\r\n /**\r\n * creates an homeAccountIdentifier for the account\r\n * @param response\r\n * @param idTokenObj\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.createHomeAccountIdentifier = function (response, idTokenObj) {\r\n // Save account in browser storage\r\n var homeAccountIdentifier = AccountEntity.generateHomeAccountId(response.client_info || Constants.EMPTY_STRING, AuthorityType.Default, this.logger, this.browserCrypto, idTokenObj);\r\n return homeAccountIdentifier;\r\n };\r\n /**\r\n * Creates account entity\r\n * @param response\r\n * @param homeAccountIdentifier\r\n * @param idTokenObj\r\n * @param authority\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.createAccountEntity = function (response, homeAccountIdentifier, idTokenObj, authority) {\r\n return AccountEntity.createAccount(response.client_info, homeAccountIdentifier, idTokenObj, undefined, undefined, undefined, authority, response.account.id);\r\n };\r\n /**\r\n * Helper to generate scopes\r\n * @param response\r\n * @param request\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.generateScopes = function (response, request) {\r\n return response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);\r\n };\r\n /**\r\n * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser\r\n * @param request\r\n * @param response\r\n */\r\n NativeInteractionClient.prototype.generatePopAccessToken = function (response, request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var popTokenGenerator, shrParameters;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!(request.tokenType === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n /**\r\n * This code prioritizes SHR returned from the native layer. In case of error/SHR not calculated from WAM and the AT\r\n * is still received, SHR is calculated locally\r\n */\r\n // Check if native layer returned an SHR token\r\n if (response.shr) {\r\n this.logger.trace(\"handleNativeServerResponse: SHR is enabled in native layer\");\r\n return [2 /*return*/, response.shr];\r\n }\r\n popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\r\n shrParameters = {\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n shrNonce: request.shrNonce\r\n };\r\n /**\r\n * KeyID must be present in the native request from when the PoP key was generated in order for\r\n * PopTokenGenerator to query the full key for signing\r\n */\r\n if (!request.keyId) {\r\n throw ClientAuthError.createKeyIdMissingError();\r\n }\r\n return [4 /*yield*/, popTokenGenerator.signPopToken(response.access_token, request.keyId, shrParameters)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2: return [2 /*return*/, response.access_token];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Generates authentication result\r\n * @param response\r\n * @param request\r\n * @param idTokenObj\r\n * @param accountEntity\r\n * @param authority\r\n * @param reqTimestamp\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.generateAuthenticationResult = function (response, request, idTokenObj, accountEntity, authority, reqTimestamp) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var mats, responseScopes, accountProperties, uid, tid, responseAccessToken, tokenType, result;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n mats = this.addTelemetryFromNativeResponse(response);\r\n responseScopes = response.scope ? ScopeSet.fromString(response.scope) : ScopeSet.fromString(request.scope);\r\n accountProperties = response.account.properties || {};\r\n uid = accountProperties[\"UID\"] || idTokenObj.claims.oid || idTokenObj.claims.sub || Constants.EMPTY_STRING;\r\n tid = accountProperties[\"TenantId\"] || idTokenObj.claims.tid || Constants.EMPTY_STRING;\r\n return [4 /*yield*/, this.generatePopAccessToken(response, request)];\r\n case 1:\r\n responseAccessToken = _a.sent();\r\n tokenType = (request.tokenType === AuthenticationScheme.POP) ? AuthenticationScheme.POP : AuthenticationScheme.BEARER;\r\n result = {\r\n authority: authority,\r\n uniqueId: uid,\r\n tenantId: tid,\r\n scopes: responseScopes.asArray(),\r\n account: accountEntity.getAccountInfo(),\r\n idToken: response.id_token,\r\n idTokenClaims: idTokenObj.claims,\r\n accessToken: responseAccessToken,\r\n fromCache: mats ? this.isResponseFromCache(mats) : false,\r\n expiresOn: new Date(Number(reqTimestamp + response.expires_in) * 1000),\r\n tokenType: tokenType,\r\n correlationId: this.correlationId,\r\n state: response.state,\r\n fromNativeBroker: true\r\n };\r\n return [2 /*return*/, result];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * cache the account entity in browser storage\r\n * @param accountEntity\r\n */\r\n NativeInteractionClient.prototype.cacheAccount = function (accountEntity) {\r\n var _this = this;\r\n // Store the account info and hence `nativeAccountId` in browser cache\r\n this.browserStorage.setAccount(accountEntity);\r\n // Remove any existing cached tokens for this account in browser storage\r\n this.browserStorage.removeAccountContext(accountEntity).catch(function (e) {\r\n _this.logger.error(\"Error occurred while removing account context from browser storage. \" + e);\r\n });\r\n };\r\n /**\r\n * Stores the access_token and id_token in inmemory storage\r\n * @param response\r\n * @param request\r\n * @param homeAccountIdentifier\r\n * @param idTokenObj\r\n * @param responseAccessToken\r\n * @param tenantId\r\n * @param reqTimestamp\r\n */\r\n NativeInteractionClient.prototype.cacheNativeTokens = function (response, request, homeAccountIdentifier, idTokenObj, responseAccessToken, tenantId, reqTimestamp) {\r\n // cache idToken in inmemory storage\r\n var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountIdentifier, request.authority, response.id_token || Constants.EMPTY_STRING, request.clientId, idTokenObj.claims.tid || Constants.EMPTY_STRING);\r\n this.nativeStorageManager.setIdTokenCredential(idTokenEntity);\r\n // cache accessToken in inmemory storage\r\n var expiresIn = (request.tokenType === AuthenticationScheme.POP)\r\n ? Constants.SHR_NONCE_VALIDITY\r\n : (typeof response.expires_in === \"string\"\r\n ? parseInt(response.expires_in, 10)\r\n : response.expires_in) || 0;\r\n var tokenExpirationSeconds = reqTimestamp + expiresIn;\r\n var responseScopes = this.generateScopes(response, request);\r\n var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, this.browserCrypto);\r\n this.nativeStorageManager.setAccessTokenCredential(accessTokenEntity);\r\n };\r\n NativeInteractionClient.prototype.addTelemetryFromNativeResponse = function (response) {\r\n var mats = this.getMATSFromResponse(response);\r\n if (!mats) {\r\n return null;\r\n }\r\n this.performanceClient.addStaticFields({\r\n extensionId: this.nativeMessageHandler.getExtensionId(),\r\n extensionVersion: this.nativeMessageHandler.getExtensionVersion(),\r\n matsBrokerVersion: mats.broker_version,\r\n matsAccountJoinOnStart: mats.account_join_on_start,\r\n matsAccountJoinOnEnd: mats.account_join_on_end,\r\n matsDeviceJoin: mats.device_join,\r\n matsPromptBehavior: mats.prompt_behavior,\r\n matsApiErrorCode: mats.api_error_code,\r\n matsUiVisible: mats.ui_visible,\r\n matsSilentCode: mats.silent_code,\r\n matsSilentBiSubCode: mats.silent_bi_sub_code,\r\n matsSilentMessage: mats.silent_message,\r\n matsSilentStatus: mats.silent_status,\r\n matsHttpStatus: mats.http_status,\r\n matsHttpEventCount: mats.http_event_count\r\n }, this.correlationId);\r\n return mats;\r\n };\r\n /**\r\n * Validates native platform response before processing\r\n * @param response\r\n */\r\n NativeInteractionClient.prototype.validateNativeResponse = function (response) {\r\n if (response.hasOwnProperty(\"access_token\") &&\r\n response.hasOwnProperty(\"id_token\") &&\r\n response.hasOwnProperty(\"client_info\") &&\r\n response.hasOwnProperty(\"account\") &&\r\n response.hasOwnProperty(\"scope\") &&\r\n response.hasOwnProperty(\"expires_in\")) {\r\n return response;\r\n }\r\n else {\r\n throw NativeAuthError.createUnexpectedError(\"Response missing expected properties.\");\r\n }\r\n };\r\n /**\r\n * Gets MATS telemetry from native response\r\n * @param response\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.getMATSFromResponse = function (response) {\r\n if (response.properties.MATS) {\r\n try {\r\n return JSON.parse(response.properties.MATS);\r\n }\r\n catch (e) {\r\n this.logger.error(\"NativeInteractionClient - Error parsing MATS telemetry, returning null instead\");\r\n }\r\n }\r\n return null;\r\n };\r\n /**\r\n * Returns whether or not response came from native cache\r\n * @param response\r\n * @returns\r\n */\r\n NativeInteractionClient.prototype.isResponseFromCache = function (mats) {\r\n if (typeof mats.is_cached === \"undefined\") {\r\n this.logger.verbose(\"NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false.\");\r\n return false;\r\n }\r\n return !!mats.is_cached;\r\n };\r\n /**\r\n * Translates developer provided request object into NativeRequest object\r\n * @param request\r\n */\r\n NativeInteractionClient.prototype.initializeNativeRequest = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authority, canonicalAuthority, scopes, remainingProperties, scopeSet, getPrompt, validatedRequest, shrParameters, popTokenGenerator, reqCnfData;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"NativeInteractionClient - initializeNativeRequest called\");\r\n authority = request.authority || this.config.auth.authority;\r\n canonicalAuthority = new UrlString(authority);\r\n canonicalAuthority.validateAsUri();\r\n scopes = request.scopes, remainingProperties = __rest(request, [\"scopes\"]);\r\n scopeSet = new ScopeSet(scopes || []);\r\n scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);\r\n getPrompt = function () {\r\n // If request is silent, prompt is always none\r\n switch (_this.apiId) {\r\n case ApiId.ssoSilent:\r\n case ApiId.acquireTokenSilent_silentFlow:\r\n _this.logger.trace(\"initializeNativeRequest: silent request sets prompt to none\");\r\n return PromptValue.NONE;\r\n }\r\n // Prompt not provided, request may proceed and native broker decides if it needs to prompt\r\n if (!request.prompt) {\r\n _this.logger.trace(\"initializeNativeRequest: prompt was not provided\");\r\n return undefined;\r\n }\r\n // If request is interactive, check if prompt provided is allowed to go directly to native broker\r\n switch (request.prompt) {\r\n case PromptValue.NONE:\r\n case PromptValue.CONSENT:\r\n case PromptValue.LOGIN:\r\n _this.logger.trace(\"initializeNativeRequest: prompt is compatible with native flow\");\r\n return request.prompt;\r\n default:\r\n _this.logger.trace(\"initializeNativeRequest: prompt = \" + request.prompt + \" is not compatible with native flow\");\r\n throw BrowserAuthError.createNativePromptParameterNotSupportedError();\r\n }\r\n };\r\n validatedRequest = __assign(__assign({}, remainingProperties), { accountId: this.accountId, clientId: this.config.auth.clientId, authority: canonicalAuthority.urlString, scope: scopeSet.printScopes(), redirectUri: this.getRedirectUri(request.redirectUri), prompt: getPrompt(), correlationId: this.correlationId, tokenType: request.authenticationScheme, windowTitleSubstring: document.title, extraParameters: __assign(__assign(__assign({}, request.extraQueryParameters), request.tokenQueryParameters), { telemetry: NativeConstants.MATS_TELEMETRY }), extendedExpiryToken: false // Make this configurable?\r\n });\r\n if (!(request.authenticationScheme === AuthenticationScheme.POP)) return [3 /*break*/, 2];\r\n shrParameters = {\r\n resourceRequestUri: request.resourceRequestUri,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n shrClaims: request.shrClaims,\r\n shrNonce: request.shrNonce\r\n };\r\n popTokenGenerator = new PopTokenGenerator(this.browserCrypto);\r\n return [4 /*yield*/, popTokenGenerator.generateCnf(shrParameters)];\r\n case 1:\r\n reqCnfData = _a.sent();\r\n // to reduce the URL length, it is recommended to send the hash of the req_cnf instead of the whole string\r\n validatedRequest.reqCnf = reqCnfData.reqCnfHash;\r\n validatedRequest.keyId = reqCnfData.kid;\r\n _a.label = 2;\r\n case 2: return [2 /*return*/, validatedRequest];\r\n }\r\n });\r\n });\r\n };\r\n return NativeInteractionClient;\r\n}(BaseInteractionClient));\n\nexport { NativeInteractionClient };\n//# sourceMappingURL=NativeInteractionClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../../_virtual/_tslib.js';\nimport { NativeConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.js';\nimport { AuthError, AuthenticationScheme, PerformanceEvents } from '@azure/msal-common';\nimport { NativeAuthError } from '../../error/NativeAuthError.js';\nimport { BrowserAuthError } from '../../error/BrowserAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar NativeMessageHandler = /** @class */ (function () {\r\n function NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, extensionId) {\r\n this.logger = logger;\r\n this.handshakeTimeoutMs = handshakeTimeoutMs;\r\n this.extensionId = extensionId;\r\n this.resolvers = new Map(); // Used for non-handshake messages\r\n this.handshakeResolvers = new Map(); // Used for handshake messages\r\n this.responseId = 0;\r\n this.messageChannel = new MessageChannel();\r\n this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound\r\n this.performanceClient = performanceClient;\r\n this.handshakeEvent = performanceClient.startMeasurement(PerformanceEvents.NativeMessageHandlerHandshake);\r\n }\r\n /**\r\n * Sends a given message to the extension and resolves with the extension response\r\n * @param body\r\n */\r\n NativeMessageHandler.prototype.sendMessage = function (body) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var req;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n this.logger.trace(\"NativeMessageHandler - sendMessage called.\");\r\n req = {\r\n channel: NativeConstants.CHANNEL_ID,\r\n extensionId: this.extensionId,\r\n responseId: this.responseId++,\r\n body: body\r\n };\r\n this.logger.trace(\"NativeMessageHandler - Sending request to browser extension\");\r\n this.logger.tracePii(\"NativeMessageHandler - Sending request to browser extension: \" + JSON.stringify(req));\r\n this.messageChannel.port1.postMessage(req);\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n _this.resolvers.set(req.responseId, { resolve: resolve, reject: reject });\r\n })];\r\n });\r\n });\r\n };\r\n /**\r\n * Returns an instance of the MessageHandler that has successfully established a connection with an extension\r\n * @param {Logger} logger\r\n * @param {number} handshakeTimeoutMs\r\n * @param {IPerformanceClient} performanceClient\r\n */\r\n NativeMessageHandler.createProvider = function (logger, handshakeTimeoutMs, performanceClient) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var preferredProvider, backupProvider;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n logger.trace(\"NativeMessageHandler - createProvider called.\");\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 5]);\r\n preferredProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient, NativeConstants.PREFERRED_EXTENSION_ID);\r\n return [4 /*yield*/, preferredProvider.sendHandshakeRequest()];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, preferredProvider];\r\n case 3:\r\n _a.sent();\r\n backupProvider = new NativeMessageHandler(logger, handshakeTimeoutMs, performanceClient);\r\n return [4 /*yield*/, backupProvider.sendHandshakeRequest()];\r\n case 4:\r\n _a.sent();\r\n return [2 /*return*/, backupProvider];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Send handshake request helper.\r\n */\r\n NativeMessageHandler.prototype.sendHandshakeRequest = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var req;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n this.logger.trace(\"NativeMessageHandler - sendHandshakeRequest called.\");\r\n // Register this event listener before sending handshake\r\n window.addEventListener(\"message\", this.windowListener, false); // false is important, because content script message processing should work first\r\n req = {\r\n channel: NativeConstants.CHANNEL_ID,\r\n extensionId: this.extensionId,\r\n responseId: this.responseId++,\r\n body: {\r\n method: NativeExtensionMethod.HandshakeRequest\r\n }\r\n };\r\n this.handshakeEvent.addStaticFields({\r\n extensionId: this.extensionId,\r\n extensionHandshakeTimeoutMs: this.handshakeTimeoutMs\r\n });\r\n this.messageChannel.port1.onmessage = function (event) {\r\n _this.onChannelMessage(event);\r\n };\r\n window.postMessage(req, window.origin, [this.messageChannel.port2]);\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n _this.handshakeResolvers.set(req.responseId, { resolve: resolve, reject: reject });\r\n _this.timeoutId = window.setTimeout(function () {\r\n /*\r\n * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.\r\n * This typically suggests an event handler stopped propagation of the Handshake request but did not respond to it on the MessageChannel port\r\n */\r\n window.removeEventListener(\"message\", _this.windowListener, false);\r\n _this.messageChannel.port1.close();\r\n _this.messageChannel.port2.close();\r\n _this.handshakeEvent.endMeasurement({ extensionHandshakeTimedOut: true, success: false });\r\n reject(BrowserAuthError.createNativeHandshakeTimeoutError());\r\n _this.handshakeResolvers.delete(req.responseId);\r\n }, _this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here\r\n })];\r\n });\r\n });\r\n };\r\n /**\r\n * Invoked when a message is posted to the window. If a handshake request is received it means the extension is not installed.\r\n * @param event\r\n */\r\n NativeMessageHandler.prototype.onWindowMessage = function (event) {\r\n this.logger.trace(\"NativeMessageHandler - onWindowMessage called\");\r\n // We only accept messages from ourselves\r\n if (event.source !== window) {\r\n return;\r\n }\r\n var request = event.data;\r\n if (!request.channel || request.channel !== NativeConstants.CHANNEL_ID) {\r\n return;\r\n }\r\n if (request.extensionId && request.extensionId !== this.extensionId) {\r\n return;\r\n }\r\n if (request.body.method === NativeExtensionMethod.HandshakeRequest) {\r\n // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed\r\n this.logger.verbose(request.extensionId ? \"Extension with id: \" + request.extensionId + \" not installed\" : \"No extension installed\");\r\n clearTimeout(this.timeoutId);\r\n this.messageChannel.port1.close();\r\n this.messageChannel.port2.close();\r\n window.removeEventListener(\"message\", this.windowListener, false);\r\n var handshakeResolver = this.handshakeResolvers.get(request.responseId);\r\n if (handshakeResolver) {\r\n this.handshakeEvent.endMeasurement({ success: false, extensionInstalled: false });\r\n handshakeResolver.reject(BrowserAuthError.createNativeExtensionNotInstalledError());\r\n }\r\n }\r\n };\r\n /**\r\n * Invoked when a message is received from the extension on the MessageChannel port\r\n * @param event\r\n */\r\n NativeMessageHandler.prototype.onChannelMessage = function (event) {\r\n this.logger.trace(\"NativeMessageHandler - onChannelMessage called.\");\r\n var request = event.data;\r\n var resolver = this.resolvers.get(request.responseId);\r\n var handshakeResolver = this.handshakeResolvers.get(request.responseId);\r\n try {\r\n var method = request.body.method;\r\n if (method === NativeExtensionMethod.Response) {\r\n if (!resolver) {\r\n return;\r\n }\r\n var response = request.body.response;\r\n this.logger.trace(\"NativeMessageHandler - Received response from browser extension\");\r\n this.logger.tracePii(\"NativeMessageHandler - Received response from browser extension: \" + JSON.stringify(response));\r\n if (response.status !== \"Success\") {\r\n resolver.reject(NativeAuthError.createError(response.code, response.description, response.ext));\r\n }\r\n else if (response.result) {\r\n if (response.result[\"code\"] && response.result[\"description\"]) {\r\n resolver.reject(NativeAuthError.createError(response.result[\"code\"], response.result[\"description\"], response.result[\"ext\"]));\r\n }\r\n else {\r\n resolver.resolve(response.result);\r\n }\r\n }\r\n else {\r\n throw AuthError.createUnexpectedError(\"Event does not contain result.\");\r\n }\r\n this.resolvers.delete(request.responseId);\r\n }\r\n else if (method === NativeExtensionMethod.HandshakeResponse) {\r\n if (!handshakeResolver) {\r\n return;\r\n }\r\n clearTimeout(this.timeoutId); // Clear setTimeout\r\n window.removeEventListener(\"message\", this.windowListener, false); // Remove 'No extension' listener\r\n this.extensionId = request.extensionId;\r\n this.extensionVersion = request.body.version;\r\n this.logger.verbose(\"NativeMessageHandler - Received HandshakeResponse from extension: \" + this.extensionId);\r\n this.handshakeEvent.endMeasurement({ extensionInstalled: true, success: true });\r\n handshakeResolver.resolve();\r\n this.handshakeResolvers.delete(request.responseId);\r\n }\r\n // Do nothing if method is not Response or HandshakeResponse\r\n }\r\n catch (err) {\r\n this.logger.error(\"Error parsing response from WAM Extension\");\r\n this.logger.errorPii(\"Error parsing response from WAM Extension: \" + err.toString());\r\n this.logger.errorPii(\"Unable to parse \" + event);\r\n if (resolver) {\r\n resolver.reject(err);\r\n }\r\n else if (handshakeResolver) {\r\n handshakeResolver.reject(err);\r\n }\r\n }\r\n };\r\n /**\r\n * Returns the Id for the browser extension this handler is communicating with\r\n * @returns\r\n */\r\n NativeMessageHandler.prototype.getExtensionId = function () {\r\n return this.extensionId;\r\n };\r\n /**\r\n * Returns the version for the browser extension this handler is communicating with\r\n * @returns\r\n */\r\n NativeMessageHandler.prototype.getExtensionVersion = function () {\r\n return this.extensionVersion;\r\n };\r\n /**\r\n * Returns boolean indicating whether or not the request should attempt to use native broker\r\n * @param logger\r\n * @param config\r\n * @param nativeExtensionProvider\r\n * @param authenticationScheme\r\n */\r\n NativeMessageHandler.isNativeAvailable = function (config, logger, nativeExtensionProvider, authenticationScheme) {\r\n logger.trace(\"isNativeAvailable called\");\r\n if (!config.system.allowNativeBroker) {\r\n logger.trace(\"isNativeAvailable: allowNativeBroker is not enabled, returning false\");\r\n // Developer disabled WAM\r\n return false;\r\n }\r\n if (!nativeExtensionProvider) {\r\n logger.trace(\"isNativeAvailable: WAM extension provider is not initialized, returning false\");\r\n // Extension is not available\r\n return false;\r\n }\r\n if (authenticationScheme) {\r\n switch (authenticationScheme) {\r\n case AuthenticationScheme.BEARER:\r\n case AuthenticationScheme.POP:\r\n logger.trace(\"isNativeAvailable: authenticationScheme is supported, returning true\");\r\n return true;\r\n default:\r\n logger.trace(\"isNativeAvailable: authenticationScheme is not supported, returning false\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n };\r\n return NativeMessageHandler;\r\n}());\n\nexport { NativeMessageHandler };\n//# sourceMappingURL=NativeMessageHandler.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { UrlString, AuthError, PerformanceEvents, Constants, ThrottlingUtils, ProtocolUtils } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { TemporaryCacheKeys, ApiId, InteractionType } from '../utils/BrowserConstants.js';\nimport { RedirectHandler } from '../interaction_handler/RedirectHandler.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.js';\nimport { EventType } from '../event/EventType.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { NativeInteractionClient } from './NativeInteractionClient.js';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar RedirectClient = /** @class */ (function (_super) {\r\n __extends(RedirectClient, _super);\r\n function RedirectClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;\r\n _this.nativeStorage = nativeStorageImpl;\r\n return _this;\r\n }\r\n /**\r\n * Redirects the page to the /authorize endpoint of the IDP\r\n * @param request\r\n */\r\n RedirectClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var validRequest, serverTelemetryManager, handleBackButton, authCodeRequest, authClient, interactionHandler, navigateUrl, redirectStartPage, e_1;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Redirect)];\r\n case 1:\r\n validRequest = _a.sent();\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);\r\n handleBackButton = function (event) {\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n if (event.persisted) {\r\n _this.logger.verbose(\"Page was restored from back/forward cache. Clearing temporary cache.\");\r\n _this.browserStorage.cleanRequestByState(validRequest.state);\r\n }\r\n };\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 7, , 8]);\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];\r\n case 3:\r\n authCodeRequest = _a.sent();\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];\r\n case 4:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n interactionHandler = new RedirectHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n return [4 /*yield*/, authClient.getAuthCodeUrl(__assign(__assign({}, validRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme) }))];\r\n case 5:\r\n navigateUrl = _a.sent();\r\n redirectStartPage = this.getRedirectStartPage(request.redirectStartPage);\r\n this.logger.verbosePii(\"Redirect start page: \" + redirectStartPage);\r\n // Clear temporary cache if the back button is clicked during the redirect flow.\r\n window.addEventListener(\"pageshow\", handleBackButton);\r\n return [4 /*yield*/, interactionHandler.initiateAuthRequest(navigateUrl, {\r\n navigationClient: this.navigationClient,\r\n redirectTimeout: this.config.system.redirectNavigationTimeout,\r\n redirectStartPage: redirectStartPage,\r\n onRedirectNavigate: request.onRedirectNavigate\r\n })];\r\n case 6: \r\n // Show the UI once the url has been created. Response will come back in the hash, which will be handled in the handleRedirectCallback function.\r\n return [2 /*return*/, _a.sent()];\r\n case 7:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof AuthError) {\r\n e_1.setCorrelationId(this.correlationId);\r\n }\r\n window.removeEventListener(\"pageshow\", handleBackButton);\r\n serverTelemetryManager.cacheFailedRequest(e_1);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e_1;\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Checks if navigateToLoginRequestUrl is set, and:\r\n * - if true, performs logic to cache and navigate\r\n * - if false, handles hash string and parses response\r\n * @param hash\r\n */\r\n RedirectClient.prototype.handleRedirectPromise = function (hash) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var serverTelemetryManager, responseHash, state, serverParams, loginRequestUrl, loginRequestUrlNormalized, currentUrlNormalized, handleHashResult, navigationOptions, processHashOnRedirect, homepage, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.handleRedirectPromise);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 10, , 11]);\r\n if (!this.browserStorage.isInteractionInProgress(true)) {\r\n this.logger.info(\"handleRedirectPromise called but there is no interaction in progress, returning null.\");\r\n return [2 /*return*/, null];\r\n }\r\n responseHash = this.getRedirectResponseHash(hash || window.location.hash);\r\n if (!responseHash) {\r\n // Not a recognized server response hash or hash not associated with a redirect request\r\n this.logger.info(\"handleRedirectPromise did not detect a response hash as a result of a redirect. Cleaning temporary cache.\");\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return [2 /*return*/, null];\r\n }\r\n state = void 0;\r\n try {\r\n serverParams = UrlString.getDeserializedHash(responseHash);\r\n state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Redirect);\r\n this.logger.verbose(\"State extracted from hash\");\r\n }\r\n catch (e) {\r\n this.logger.info(\"handleRedirectPromise was unable to extract state due to: \" + e);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n return [2 /*return*/, null];\r\n }\r\n loginRequestUrl = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, true) || Constants.EMPTY_STRING;\r\n loginRequestUrlNormalized = UrlString.removeHashFromUrl(loginRequestUrl);\r\n currentUrlNormalized = UrlString.removeHashFromUrl(window.location.href);\r\n if (!(loginRequestUrlNormalized === currentUrlNormalized && this.config.auth.navigateToLoginRequestUrl)) return [3 /*break*/, 3];\r\n // We are on the page we need to navigate to - handle hash\r\n this.logger.verbose(\"Current page is loginRequestUrl, handling hash\");\r\n return [4 /*yield*/, this.handleHash(responseHash, state, serverTelemetryManager)];\r\n case 2:\r\n handleHashResult = _a.sent();\r\n if (loginRequestUrl.indexOf(\"#\") > -1) {\r\n // Replace current hash with non-msal hash, if present\r\n BrowserUtils.replaceHash(loginRequestUrl);\r\n }\r\n return [2 /*return*/, handleHashResult];\r\n case 3:\r\n if (!!this.config.auth.navigateToLoginRequestUrl) return [3 /*break*/, 4];\r\n this.logger.verbose(\"NavigateToLoginRequestUrl set to false, handling hash\");\r\n return [2 /*return*/, this.handleHash(responseHash, state, serverTelemetryManager)];\r\n case 4:\r\n if (!(!BrowserUtils.isInIframe() || this.config.system.allowRedirectInIframe)) return [3 /*break*/, 9];\r\n /*\r\n * Returned from authority using redirect - need to perform navigation before processing response\r\n * Cache the hash to be retrieved after the next redirect\r\n */\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.URL_HASH, responseHash, true);\r\n navigationOptions = {\r\n apiId: ApiId.handleRedirectPromise,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: true\r\n };\r\n processHashOnRedirect = true;\r\n if (!(!loginRequestUrl || loginRequestUrl === \"null\")) return [3 /*break*/, 6];\r\n homepage = BrowserUtils.getHomepage();\r\n // Cache the homepage under ORIGIN_URI to ensure cached hash is processed on homepage\r\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, homepage, true);\r\n this.logger.warning(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n return [4 /*yield*/, this.navigationClient.navigateInternal(homepage, navigationOptions)];\r\n case 5:\r\n processHashOnRedirect = _a.sent();\r\n return [3 /*break*/, 8];\r\n case 6:\r\n // Navigate to page that initiated the redirect request\r\n this.logger.verbose(\"Navigating to loginRequestUrl: \" + loginRequestUrl);\r\n return [4 /*yield*/, this.navigationClient.navigateInternal(loginRequestUrl, navigationOptions)];\r\n case 7:\r\n processHashOnRedirect = _a.sent();\r\n _a.label = 8;\r\n case 8:\r\n // If navigateInternal implementation returns false, handle the hash now\r\n if (!processHashOnRedirect) {\r\n return [2 /*return*/, this.handleHash(responseHash, state, serverTelemetryManager)];\r\n }\r\n _a.label = 9;\r\n case 9: return [2 /*return*/, null];\r\n case 10:\r\n e_2 = _a.sent();\r\n if (e_2 instanceof AuthError) {\r\n e_2.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e_2);\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Redirect);\r\n throw e_2;\r\n case 11: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Gets the response hash for a redirect request\r\n * Returns null if interactionType in the state value is not \"redirect\" or the hash does not contain known properties\r\n * @param hash\r\n */\r\n RedirectClient.prototype.getRedirectResponseHash = function (hash) {\r\n this.logger.verbose(\"getRedirectResponseHash called\");\r\n // Get current location hash from window or cache.\r\n var isResponseHash = UrlString.hashContainsKnownProperties(hash);\r\n if (isResponseHash) {\r\n BrowserUtils.clearHash(window);\r\n this.logger.verbose(\"Hash contains known properties, returning response hash\");\r\n return hash;\r\n }\r\n var cachedHash = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.URL_HASH, true);\r\n this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.URL_HASH));\r\n this.logger.verbose(\"Hash does not contain known properties, returning cached hash\");\r\n return cachedHash;\r\n };\r\n /**\r\n * Checks if hash exists and handles in window.\r\n * @param hash\r\n * @param state\r\n */\r\n RedirectClient.prototype.handleHash = function (hash, state, serverTelemetryManager) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cachedRequest, serverParams, nativeInteractionClient, userRequestState, currentAuthority, authClient, interactionHandler;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n cachedRequest = this.browserStorage.getCachedRequest(state, this.browserCrypto);\r\n this.logger.verbose(\"handleHash called, retrieved cached request\");\r\n serverParams = UrlString.getDeserializedHash(hash);\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, cachedRequest.correlationId);\r\n userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;\r\n return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, cachedRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n })).finally(function () {\r\n _this.browserStorage.cleanRequestByState(state);\r\n })];\r\n }\r\n currentAuthority = this.browserStorage.getCachedAuthority(state);\r\n if (!currentAuthority) {\r\n throw BrowserAuthError.createNoCachedAuthorityError();\r\n }\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, cachedRequest.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, currentAuthority)];\r\n case 1:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, cachedRequest);\r\n interactionHandler = new RedirectHandler(authClient, this.browserStorage, cachedRequest, this.logger, this.browserCrypto, this.performanceClient);\r\n return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];\r\n case 2: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n RedirectClient.prototype.logout = function (logoutRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var validLogoutRequest, serverTelemetryManager, navigationOptions, authClient, logoutUri, navigate, e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"logoutRedirect called\");\r\n validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logout);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 10, , 11]);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Redirect, logoutRequest);\r\n // Clear cache on logout\r\n return [4 /*yield*/, this.clearCacheOnLogout(validLogoutRequest.account)];\r\n case 2:\r\n // Clear cache on logout\r\n _a.sent();\r\n navigationOptions = {\r\n apiId: ApiId.logout,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validLogoutRequest.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, logoutRequest && logoutRequest.authority)];\r\n case 3:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n logoutUri = authClient.getLogoutUri(validLogoutRequest);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Redirect, validLogoutRequest);\r\n if (!(logoutRequest && typeof logoutRequest.onRedirectNavigate === \"function\")) return [3 /*break*/, 7];\r\n navigate = logoutRequest.onRedirectNavigate(logoutUri);\r\n if (!(navigate !== false)) return [3 /*break*/, 5];\r\n this.logger.verbose(\"Logout onRedirectNavigate did not return false, navigating\");\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n return [4 /*yield*/, this.navigationClient.navigateExternal(logoutUri, navigationOptions)];\r\n case 4:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 5:\r\n // Ensure interaction is not in progress\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.logger.verbose(\"Logout onRedirectNavigate returned false, stopping navigation\");\r\n _a.label = 6;\r\n case 6: return [3 /*break*/, 9];\r\n case 7:\r\n // Ensure interaction is in progress\r\n if (!this.browserStorage.getInteractionInProgress()) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n return [4 /*yield*/, this.navigationClient.navigateExternal(logoutUri, navigationOptions)];\r\n case 8:\r\n _a.sent();\r\n return [2 /*return*/];\r\n case 9: return [3 /*break*/, 11];\r\n case 10:\r\n e_3 = _a.sent();\r\n if (e_3 instanceof AuthError) {\r\n e_3.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e_3);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Redirect, null, e_3);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n throw e_3;\r\n case 11:\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Redirect);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Use to get the redirectStartPage either from request or use current window\r\n * @param requestStartPage\r\n */\r\n RedirectClient.prototype.getRedirectStartPage = function (requestStartPage) {\r\n var redirectStartPage = requestStartPage || window.location.href;\r\n return UrlString.getAbsoluteUrl(redirectStartPage, BrowserUtils.getCurrentUri());\r\n };\r\n return RedirectClient;\r\n}(StandardInteractionClient));\n\nexport { RedirectClient };\n//# sourceMappingURL=RedirectClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { OIDC_DEFAULT_SCOPES, StringUtils, UrlString, Constants, AuthError, ThrottlingUtils, ProtocolUtils, PerformanceEvents } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { EventType } from '../event/EventType.js';\nimport { BrowserConstants, InteractionType, ApiId } from '../utils/BrowserConstants.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.js';\nimport { NativeInteractionClient } from './NativeInteractionClient.js';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { InteractionHandler } from '../interaction_handler/InteractionHandler.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar PopupClient = /** @class */ (function (_super) {\r\n __extends(PopupClient, _super);\r\n function PopupClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;\r\n // Properly sets this reference for the unload event.\r\n _this.unloadWindow = _this.unloadWindow.bind(_this);\r\n _this.nativeStorage = nativeStorageImpl;\r\n return _this;\r\n }\r\n /**\r\n * Acquires tokens by opening a popup window to the /authorize endpoint of the authority\r\n * @param request\r\n */\r\n PopupClient.prototype.acquireToken = function (request) {\r\n try {\r\n var popupName = this.generatePopupName(request.scopes || OIDC_DEFAULT_SCOPES, request.authority || this.config.auth.authority);\r\n var popupWindowAttributes = request.popupWindowAttributes || {};\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true, acquiring token\");\r\n // Passes on popup position and dimensions if in request\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes);\r\n }\r\n else {\r\n // asyncPopups flag is set to false. Opens popup before acquiring token.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup before acquiring token\");\r\n var popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.acquireTokenPopupAsync(request, popupName, popupWindowAttributes, popup);\r\n }\r\n }\r\n catch (e) {\r\n return Promise.reject(e);\r\n }\r\n };\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n PopupClient.prototype.logout = function (logoutRequest) {\r\n try {\r\n this.logger.verbose(\"logoutPopup called\");\r\n var validLogoutRequest = this.initializeLogoutRequest(logoutRequest);\r\n var popupName = this.generateLogoutPopupName(validLogoutRequest);\r\n var authority = logoutRequest && logoutRequest.authority;\r\n var mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;\r\n var popupWindowAttributes = (logoutRequest === null || logoutRequest === void 0 ? void 0 : logoutRequest.popupWindowAttributes) || {};\r\n // asyncPopups flag is true. Acquires token without first opening popup. Popup will be opened later asynchronously.\r\n if (this.config.system.asyncPopups) {\r\n this.logger.verbose(\"asyncPopups set to true\");\r\n // Passes on popup position and dimensions if in request\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, undefined, mainWindowRedirectUri);\r\n }\r\n else {\r\n // asyncPopups flag is set to false. Opens popup before logging out.\r\n this.logger.verbose(\"asyncPopup set to false, opening popup\");\r\n var popup = this.openSizedPopup(\"about:blank\", popupName, popupWindowAttributes);\r\n return this.logoutPopupAsync(validLogoutRequest, popupName, popupWindowAttributes, authority, popup, mainWindowRedirectUri);\r\n }\r\n }\r\n catch (e) {\r\n // Since this function is synchronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n };\r\n /**\r\n * Helper which obtains an access_token for your API via opening a popup window in the user's browser\r\n * @param validRequest\r\n * @param popupName\r\n * @param popup\r\n * @param popupWindowAttributes\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n PopupClient.prototype.acquireTokenPopupAsync = function (request, popupName, popupWindowAttributes, popup) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var serverTelemetryManager, validRequest, authCodeRequest, authClient, isNativeBroker, fetchNativeAccountIdMeasurement, navigateUrl, interactionHandler, popupParameters, popupWindow, hash, serverParams, state_1, nativeInteractionClient, userRequestState, result, e_1;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"acquireTokenPopupAsync called\");\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Popup)];\r\n case 1:\r\n validRequest = _a.sent();\r\n this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || Constants.EMPTY_STRING, validRequest.account || null);\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 8, , 9]);\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationCodeRequest(validRequest)];\r\n case 3:\r\n authCodeRequest = _a.sent();\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions)];\r\n case 4:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);\r\n fetchNativeAccountIdMeasurement = void 0;\r\n if (isNativeBroker) {\r\n fetchNativeAccountIdMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);\r\n }\r\n return [4 /*yield*/, authClient.getAuthCodeUrl(__assign(__assign({}, validRequest), { nativeBroker: isNativeBroker }))];\r\n case 5:\r\n navigateUrl = _a.sent();\r\n interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);\r\n popupParameters = {\r\n popup: popup,\r\n popupName: popupName,\r\n popupWindowAttributes: popupWindowAttributes\r\n };\r\n popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow: popupWindow }, null);\r\n return [4 /*yield*/, this.monitorPopupForHash(popupWindow)];\r\n case 6:\r\n hash = _a.sent();\r\n serverParams = UrlString.getDeserializedHash(hash);\r\n state_1 = this.validateAndExtractStateFromHash(serverParams, InteractionType.Popup, validRequest.correlationId);\r\n // Remove throttle if it exists\r\n ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n // end measurement for server call with native brokering enabled\r\n if (fetchNativeAccountIdMeasurement) {\r\n fetchNativeAccountIdMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: true\r\n });\r\n }\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);\r\n userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state_1).userRequestState;\r\n return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, validRequest), { state: userRequestState, prompt: undefined // Server should handle the prompt, ideally native broker can do this part silently\r\n })).finally(function () {\r\n _this.browserStorage.cleanRequestByState(state_1);\r\n })];\r\n }\r\n return [4 /*yield*/, interactionHandler.handleCodeResponseFromHash(hash, state_1, authClient.authority, this.networkClient)];\r\n case 7:\r\n result = _a.sent();\r\n return [2 /*return*/, result];\r\n case 8:\r\n e_1 = _a.sent();\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n if (e_1 instanceof AuthError) {\r\n e_1.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e_1);\r\n this.browserStorage.cleanRequestByState(validRequest.state);\r\n throw e_1;\r\n case 9: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n *\r\n * @param validRequest\r\n * @param popupName\r\n * @param requestAuthority\r\n * @param popup\r\n * @param mainWindowRedirectUri\r\n * @param popupWindowAttributes\r\n */\r\n PopupClient.prototype.logoutPopupAsync = function (validRequest, popupName, popupWindowAttributes, requestAuthority, popup, mainWindowRedirectUri) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var serverTelemetryManager, authClient, logoutUri, popupWindow, navigationOptions, absoluteUrl, e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"logoutPopupAsync called\");\r\n this.eventHandler.emitEvent(EventType.LOGOUT_START, InteractionType.Popup, validRequest);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.logoutPopup);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 5, , 6]);\r\n // Clear cache on logout\r\n return [4 /*yield*/, this.clearCacheOnLogout(validRequest.account)];\r\n case 2:\r\n // Clear cache on logout\r\n _a.sent();\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, validRequest.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, requestAuthority)];\r\n case 3:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n logoutUri = authClient.getLogoutUri(validRequest);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, InteractionType.Popup, validRequest);\r\n popupWindow = this.openPopup(logoutUri, { popupName: popupName, popupWindowAttributes: popupWindowAttributes, popup: popup });\r\n this.eventHandler.emitEvent(EventType.POPUP_OPENED, InteractionType.Popup, { popupWindow: popupWindow }, null);\r\n return [4 /*yield*/, this.waitForLogoutPopup(popupWindow)];\r\n case 4:\r\n _a.sent();\r\n if (mainWindowRedirectUri) {\r\n navigationOptions = {\r\n apiId: ApiId.logoutPopup,\r\n timeout: this.config.system.redirectNavigationTimeout,\r\n noHistory: false\r\n };\r\n absoluteUrl = UrlString.getAbsoluteUrl(mainWindowRedirectUri, BrowserUtils.getCurrentUri());\r\n this.logger.verbose(\"Redirecting main window to url specified in the request\");\r\n this.logger.verbosePii(\"Redirecting main window to: \" + absoluteUrl);\r\n this.navigationClient.navigateInternal(absoluteUrl, navigationOptions);\r\n }\r\n else {\r\n this.logger.verbose(\"No main window navigation requested\");\r\n }\r\n return [3 /*break*/, 6];\r\n case 5:\r\n e_2 = _a.sent();\r\n if (popup) {\r\n // Close the synchronous popup if an error is thrown before the window unload event is registered\r\n popup.close();\r\n }\r\n if (e_2 instanceof AuthError) {\r\n e_2.setCorrelationId(this.correlationId);\r\n }\r\n this.browserStorage.setInteractionInProgress(false);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_FAILURE, InteractionType.Popup, null, e_2);\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n serverTelemetryManager.cacheFailedRequest(e_2);\r\n throw e_2;\r\n case 6:\r\n this.eventHandler.emitEvent(EventType.LOGOUT_END, InteractionType.Popup);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Opens a popup window with given request Url.\r\n * @param requestUrl\r\n */\r\n PopupClient.prototype.initiateAuthRequest = function (requestUrl, params) {\r\n // Check that request url is not empty.\r\n if (!StringUtils.isEmpty(requestUrl)) {\r\n this.logger.infoPii(\"Navigate to: \" + requestUrl);\r\n // Open the popup window to requestUrl.\r\n return this.openPopup(requestUrl, params);\r\n }\r\n else {\r\n // Throw error if request URL is empty.\r\n this.logger.error(\"Navigate url is empty\");\r\n throw BrowserAuthError.createEmptyNavigationUriError();\r\n }\r\n };\r\n /**\r\n * Monitors a window until it loads a url with the same origin.\r\n * @param popupWindow - window that is being monitored\r\n * @param timeout - timeout for processing hash once popup is redirected back to application\r\n */\r\n PopupClient.prototype.monitorPopupForHash = function (popupWindow) {\r\n var _this = this;\r\n return new Promise(function (resolve, reject) {\r\n /*\r\n * Polling for popups needs to be tick-based,\r\n * since a non-trivial amount of time can be spent on interaction (which should not count against the timeout).\r\n */\r\n var maxTicks = _this.config.system.windowHashTimeout / _this.config.system.pollIntervalMilliseconds;\r\n var ticks = 0;\r\n _this.logger.verbose(\"PopupHandler.monitorPopupForHash - polling started\");\r\n var intervalId = setInterval(function () {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n _this.logger.error(\"PopupHandler.monitorPopupForHash - window closed\");\r\n _this.cleanPopup();\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createUserCancelledError());\r\n return;\r\n }\r\n var href = Constants.EMPTY_STRING;\r\n var hash = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n hash = popupWindow.location.hash;\r\n }\r\n catch (e) { }\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n _this.logger.verbose(\"PopupHandler.monitorPopupForHash - popup window is on same origin as caller\");\r\n /*\r\n * Only run clock when we are on same domain for popups\r\n * as popup operations can take a long time.\r\n */\r\n ticks++;\r\n if (hash) {\r\n _this.logger.verbose(\"PopupHandler.monitorPopupForHash - found hash in url\");\r\n clearInterval(intervalId);\r\n _this.cleanPopup(popupWindow);\r\n if (UrlString.hashContainsKnownProperties(hash)) {\r\n _this.logger.verbose(\"PopupHandler.monitorPopupForHash - hash contains known properties, returning.\");\r\n resolve(hash);\r\n }\r\n else {\r\n _this.logger.error(\"PopupHandler.monitorPopupForHash - found hash in url but it does not contain known properties. Check that your router is not changing the hash prematurely.\");\r\n _this.logger.errorPii(\"PopupHandler.monitorPopupForHash - hash found: \" + hash);\r\n reject(BrowserAuthError.createHashDoesNotContainKnownPropertiesError());\r\n }\r\n }\r\n else if (ticks > maxTicks) {\r\n _this.logger.error(\"PopupHandler.monitorPopupForHash - unable to find hash in url, timing out\");\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createMonitorPopupTimeoutError());\r\n }\r\n }, _this.config.system.pollIntervalMilliseconds);\r\n });\r\n };\r\n /**\r\n * Waits for user interaction in logout popup window\r\n * @param popupWindow\r\n * @returns\r\n */\r\n PopupClient.prototype.waitForLogoutPopup = function (popupWindow) {\r\n var _this = this;\r\n return new Promise(function (resolve) {\r\n _this.logger.verbose(\"PopupHandler.waitForLogoutPopup - polling started\");\r\n var intervalId = setInterval(function () {\r\n // Window is closed\r\n if (popupWindow.closed) {\r\n _this.logger.error(\"PopupHandler.waitForLogoutPopup - window closed\");\r\n _this.cleanPopup();\r\n clearInterval(intervalId);\r\n resolve();\r\n }\r\n var href = Constants.EMPTY_STRING;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = popupWindow.location.href;\r\n }\r\n catch (e) { }\r\n // Don't process blank pages or cross domain\r\n if (StringUtils.isEmpty(href) || href === \"about:blank\") {\r\n return;\r\n }\r\n _this.logger.verbose(\"PopupHandler.waitForLogoutPopup - popup window is on same origin as caller, closing.\");\r\n clearInterval(intervalId);\r\n _this.cleanPopup(popupWindow);\r\n resolve();\r\n }, _this.config.system.pollIntervalMilliseconds);\r\n });\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Configures popup window for login.\r\n *\r\n * @param urlNavigate\r\n * @param title\r\n * @param popUpWidth\r\n * @param popUpHeight\r\n * @param popupWindowAttributes\r\n * @ignore\r\n * @hidden\r\n */\r\n PopupClient.prototype.openPopup = function (urlNavigate, popupParams) {\r\n try {\r\n var popupWindow = void 0;\r\n // Popup window passed in, setting url to navigate to\r\n if (popupParams.popup) {\r\n popupWindow = popupParams.popup;\r\n this.logger.verbosePii(\"Navigating popup window to: \" + urlNavigate);\r\n popupWindow.location.assign(urlNavigate);\r\n }\r\n else if (typeof popupParams.popup === \"undefined\") {\r\n // Popup will be undefined if it was not passed in\r\n this.logger.verbosePii(\"Opening popup window to: \" + urlNavigate);\r\n popupWindow = this.openSizedPopup(urlNavigate, popupParams.popupName, popupParams.popupWindowAttributes);\r\n }\r\n // Popup will be null if popups are blocked\r\n if (!popupWindow) {\r\n throw BrowserAuthError.createEmptyWindowCreatedError();\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n this.currentWindow = popupWindow;\r\n window.addEventListener(\"beforeunload\", this.unloadWindow);\r\n return popupWindow;\r\n }\r\n catch (e) {\r\n this.logger.error(\"error opening popup \" + e.message);\r\n this.browserStorage.setInteractionInProgress(false);\r\n throw BrowserAuthError.createPopupWindowError(e.toString());\r\n }\r\n };\r\n /**\r\n * Helper function to set popup window dimensions and position\r\n * @param urlNavigate\r\n * @param popupName\r\n * @param popupWindowAttributes\r\n * @returns\r\n */\r\n PopupClient.prototype.openSizedPopup = function (urlNavigate, popupName, popupWindowAttributes) {\r\n var _a, _b, _c, _d;\r\n /**\r\n * adding winLeft and winTop to account for dual monitor\r\n * using screenLeft and screenTop for IE8 and earlier\r\n */\r\n var winLeft = window.screenLeft ? window.screenLeft : window.screenX;\r\n var winTop = window.screenTop ? window.screenTop : window.screenY;\r\n /**\r\n * window.innerWidth displays browser window\"s height and width excluding toolbars\r\n * using document.documentElement.clientWidth for IE8 and earlier\r\n */\r\n var winWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n var winHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n var width = (_a = popupWindowAttributes.popupSize) === null || _a === void 0 ? void 0 : _a.width;\r\n var height = (_b = popupWindowAttributes.popupSize) === null || _b === void 0 ? void 0 : _b.height;\r\n var top = (_c = popupWindowAttributes.popupPosition) === null || _c === void 0 ? void 0 : _c.top;\r\n var left = (_d = popupWindowAttributes.popupPosition) === null || _d === void 0 ? void 0 : _d.left;\r\n if (!width || width < 0 || width > winWidth) {\r\n this.logger.verbose(\"Default popup window width used. Window width not configured or invalid.\");\r\n width = BrowserConstants.POPUP_WIDTH;\r\n }\r\n if (!height || height < 0 || height > winHeight) {\r\n this.logger.verbose(\"Default popup window height used. Window height not configured or invalid.\");\r\n height = BrowserConstants.POPUP_HEIGHT;\r\n }\r\n if (!top || top < 0 || top > winHeight) {\r\n this.logger.verbose(\"Default popup window top position used. Window top not configured or invalid.\");\r\n top = Math.max(0, ((winHeight / 2) - (BrowserConstants.POPUP_HEIGHT / 2)) + winTop);\r\n }\r\n if (!left || left < 0 || left > winWidth) {\r\n this.logger.verbose(\"Default popup window left position used. Window left not configured or invalid.\");\r\n left = Math.max(0, ((winWidth / 2) - (BrowserConstants.POPUP_WIDTH / 2)) + winLeft);\r\n }\r\n return window.open(urlNavigate, popupName, \"width=\" + width + \", height=\" + height + \", top=\" + top + \", left=\" + left + \", scrollbars=yes\");\r\n };\r\n /**\r\n * Event callback to unload main window.\r\n */\r\n PopupClient.prototype.unloadWindow = function (e) {\r\n this.browserStorage.cleanRequestByInteractionType(InteractionType.Popup);\r\n if (this.currentWindow) {\r\n this.currentWindow.close();\r\n }\r\n // Guarantees browser unload will happen, so no other errors will be thrown.\r\n e.preventDefault();\r\n };\r\n /**\r\n * Closes popup, removes any state vars created during popup calls.\r\n * @param popupWindow\r\n */\r\n PopupClient.prototype.cleanPopup = function (popupWindow) {\r\n if (popupWindow) {\r\n // Close window.\r\n popupWindow.close();\r\n }\r\n // Remove window unload function\r\n window.removeEventListener(\"beforeunload\", this.unloadWindow);\r\n // Interaction is completed - remove interaction status.\r\n this.browserStorage.setInteractionInProgress(false);\r\n };\r\n /**\r\n * Generates the name for the popup based on the client id and request\r\n * @param clientId\r\n * @param request\r\n */\r\n PopupClient.prototype.generatePopupName = function (scopes, authority) {\r\n return BrowserConstants.POPUP_NAME_PREFIX + \".\" + this.config.auth.clientId + \".\" + scopes.join(\"-\") + \".\" + authority + \".\" + this.correlationId;\r\n };\r\n /**\r\n * Generates the name for the popup based on the client id and request for logouts\r\n * @param clientId\r\n * @param request\r\n */\r\n PopupClient.prototype.generateLogoutPopupName = function (request) {\r\n var homeAccountId = request.account && request.account.homeAccountId;\r\n return BrowserConstants.POPUP_NAME_PREFIX + \".\" + this.config.auth.clientId + \".\" + homeAccountId + \".\" + this.correlationId;\r\n };\r\n return PopupClient;\r\n}(StandardInteractionClient));\n\nexport { PopupClient };\n//# sourceMappingURL=PopupClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar NavigationClient = /** @class */ (function () {\r\n function NavigationClient() {\r\n }\r\n /**\r\n * Navigates to other pages within the same web application\r\n * @param url\r\n * @param options\r\n */\r\n NavigationClient.prototype.navigateInternal = function (url, options) {\r\n return NavigationClient.defaultNavigateWindow(url, options);\r\n };\r\n /**\r\n * Navigates to other pages outside the web application i.e. the Identity Provider\r\n * @param url\r\n * @param options\r\n */\r\n NavigationClient.prototype.navigateExternal = function (url, options) {\r\n return NavigationClient.defaultNavigateWindow(url, options);\r\n };\r\n /**\r\n * Default navigation implementation invoked by the internal and external functions\r\n * @param url\r\n * @param options\r\n */\r\n NavigationClient.defaultNavigateWindow = function (url, options) {\r\n if (options.noHistory) {\r\n window.location.replace(url);\r\n }\r\n else {\r\n window.location.assign(url);\r\n }\r\n return new Promise(function (resolve) {\r\n setTimeout(function () {\r\n resolve(true);\r\n }, options.timeout);\r\n });\r\n };\r\n return NavigationClient;\r\n}());\n\nexport { NavigationClient };\n//# sourceMappingURL=NavigationClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __assign } from '../_virtual/_tslib.js';\nimport { DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule, Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';\nimport { BrowserUtils } from '../utils/BrowserUtils.js';\nimport { BrowserConstants, BrowserCacheLocation } from '../utils/BrowserConstants.js';\nimport { NavigationClient } from '../navigation/NavigationClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Default timeout for popup windows and iframes in milliseconds\r\nvar DEFAULT_POPUP_TIMEOUT_MS = 60000;\r\nvar DEFAULT_IFRAME_TIMEOUT_MS = 6000;\r\nvar DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\r\nvar DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\r\n/**\r\n * MSAL function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param auth\r\n * @param cache\r\n * @param system\r\n *\r\n * @returns Configuration object\r\n */\r\nfunction buildConfiguration(_a, isBrowserEnvironment) {\r\n var userInputAuth = _a.auth, userInputCache = _a.cache, userInputSystem = _a.system, userInputTelemetry = _a.telemetry;\r\n // Default auth options for browser\r\n var DEFAULT_AUTH_OPTIONS = {\r\n clientId: Constants.EMPTY_STRING,\r\n authority: \"\" + Constants.DEFAULT_AUTHORITY,\r\n knownAuthorities: [],\r\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\r\n authorityMetadata: Constants.EMPTY_STRING,\r\n redirectUri: Constants.EMPTY_STRING,\r\n postLogoutRedirectUri: Constants.EMPTY_STRING,\r\n navigateToLoginRequestUrl: true,\r\n clientCapabilities: [],\r\n protocolMode: ProtocolMode.AAD,\r\n azureCloudOptions: {\r\n azureCloudInstance: AzureCloudInstance.None,\r\n tenant: Constants.EMPTY_STRING\r\n },\r\n skipAuthorityMetadataCache: false,\r\n };\r\n // Default cache options for browser\r\n var DEFAULT_CACHE_OPTIONS = {\r\n cacheLocation: BrowserCacheLocation.SessionStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.SessionStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n // Default cache migration to true if cache location is localStorage since entries are preserved across tabs/windows. Migration has little to no benefit in sessionStorage and memoryStorage\r\n cacheMigrationEnabled: userInputCache && userInputCache.cacheLocation === BrowserCacheLocation.LocalStorage ? true : false\r\n };\r\n // Default logger options for browser\r\n var DEFAULT_LOGGER_OPTIONS = {\r\n // eslint-disable-next-line @typescript-eslint/no-empty-function\r\n loggerCallback: function () {\r\n // allow users to not set logger call back \r\n },\r\n logLevel: LogLevel.Info,\r\n piiLoggingEnabled: false\r\n };\r\n // Default system options for browser\r\n var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0, \r\n // If loadFrameTimeout is provided, use that as default.\r\n windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS, cryptoOptions: {\r\n useMsrCrypto: false,\r\n entropy: undefined\r\n } });\r\n var providedSystemOptions = __assign(__assign({}, userInputSystem), { loggerOptions: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loggerOptions) || DEFAULT_LOGGER_OPTIONS });\r\n var DEFAULT_TELEMETRY_OPTIONS = {\r\n application: {\r\n appName: Constants.EMPTY_STRING,\r\n appVersion: Constants.EMPTY_STRING\r\n }\r\n };\r\n var overlayedConfig = {\r\n auth: __assign(__assign({}, DEFAULT_AUTH_OPTIONS), userInputAuth),\r\n cache: __assign(__assign({}, DEFAULT_CACHE_OPTIONS), userInputCache),\r\n system: __assign(__assign({}, DEFAULT_BROWSER_SYSTEM_OPTIONS), providedSystemOptions),\r\n telemetry: __assign(__assign({}, DEFAULT_TELEMETRY_OPTIONS), userInputTelemetry)\r\n };\r\n return overlayedConfig;\r\n}\n\nexport { DEFAULT_IFRAME_TIMEOUT_MS, DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, DEFAULT_POPUP_TIMEOUT_MS, DEFAULT_REDIRECT_TIMEOUT_MS, buildConfiguration };\n//# sourceMappingURL=Configuration.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { PerformanceEvents, StringUtils, Constants, UrlString } from '@azure/msal-common';\nimport { InteractionHandler } from './InteractionHandler.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { DEFAULT_IFRAME_TIMEOUT_MS } from '../config/Configuration.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentHandler = /** @class */ (function (_super) {\r\n __extends(SilentHandler, _super);\r\n function SilentHandler(authCodeModule, storageImpl, authCodeRequest, logger, systemOptions, performanceClient) {\r\n var _this = _super.call(this, authCodeModule, storageImpl, authCodeRequest, logger, performanceClient) || this;\r\n _this.navigateFrameWait = systemOptions.navigateFrameWait;\r\n _this.pollIntervalMilliseconds = systemOptions.pollIntervalMilliseconds;\r\n return _this;\r\n }\r\n /**\r\n * Creates a hidden iframe to given URL using user-requested scopes as an id.\r\n * @param urlNavigate\r\n * @param userRequestScopes\r\n */\r\n SilentHandler.prototype.initiateAuthRequest = function (requestUrl) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerInitiateAuthRequest, this.authCodeRequest.correlationId);\r\n if (StringUtils.isEmpty(requestUrl)) {\r\n // Throw error if request URL is empty.\r\n this.logger.info(\"Navigate url is empty\");\r\n throw BrowserAuthError.createEmptyNavigationUriError();\r\n }\r\n if (!this.navigateFrameWait) return [3 /*break*/, 2];\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);\r\n return [4 /*yield*/, this.loadFrame(requestUrl)];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2: return [2 /*return*/, this.loadFrameSync(requestUrl)];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Monitors an iframe content window until it loads a url with a known hash, or hits a specified timeout.\r\n * @param iframe\r\n * @param timeout\r\n */\r\n SilentHandler.prototype.monitorIframeForHash = function (iframe, timeout) {\r\n var _this = this;\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerMonitorIframeForHash, this.authCodeRequest.correlationId);\r\n return new Promise(function (resolve, reject) {\r\n if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {\r\n _this.logger.warning(\"system.loadFrameTimeout or system.iframeHashTimeout set to lower (\" + timeout + \"ms) than the default (\" + DEFAULT_IFRAME_TIMEOUT_MS + \"ms). This may result in timeouts.\");\r\n }\r\n /*\r\n * Polling for iframes can be purely timing based,\r\n * since we don't need to account for interaction.\r\n */\r\n var nowMark = window.performance.now();\r\n var timeoutMark = nowMark + timeout;\r\n var intervalId = setInterval(function () {\r\n if (window.performance.now() > timeoutMark) {\r\n _this.removeHiddenIframe(iframe);\r\n clearInterval(intervalId);\r\n reject(BrowserAuthError.createMonitorIframeTimeoutError());\r\n return;\r\n }\r\n var href = Constants.EMPTY_STRING;\r\n var contentWindow = iframe.contentWindow;\r\n try {\r\n /*\r\n * Will throw if cross origin,\r\n * which should be caught and ignored\r\n * since we need the interval to keep running while on STS UI.\r\n */\r\n href = contentWindow ? contentWindow.location.href : Constants.EMPTY_STRING;\r\n }\r\n catch (e) { }\r\n if (StringUtils.isEmpty(href)) {\r\n return;\r\n }\r\n var contentHash = contentWindow ? contentWindow.location.hash : Constants.EMPTY_STRING;\r\n if (UrlString.hashContainsKnownProperties(contentHash)) {\r\n // Success case\r\n _this.removeHiddenIframe(iframe);\r\n clearInterval(intervalId);\r\n resolve(contentHash);\r\n return;\r\n }\r\n }, _this.pollIntervalMilliseconds);\r\n });\r\n };\r\n /**\r\n * @hidden\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n */\r\n SilentHandler.prototype.loadFrame = function (urlNavigate) {\r\n var _this = this;\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentHandlerLoadFrame, this.authCodeRequest.correlationId);\r\n /*\r\n * This trick overcomes iframe navigation in IE\r\n * IE does not load the page consistently in iframe\r\n */\r\n return new Promise(function (resolve, reject) {\r\n var frameHandle = _this.createHiddenIframe();\r\n setTimeout(function () {\r\n if (!frameHandle) {\r\n reject(\"Unable to load iframe\");\r\n return;\r\n }\r\n frameHandle.src = urlNavigate;\r\n resolve(frameHandle);\r\n }, _this.navigateFrameWait);\r\n });\r\n };\r\n /**\r\n * @hidden\r\n * Loads the iframe synchronously when the navigateTimeFrame is set to `0`\r\n * @param urlNavigate\r\n * @param frameName\r\n * @param logger\r\n */\r\n SilentHandler.prototype.loadFrameSync = function (urlNavigate) {\r\n var frameHandle = this.createHiddenIframe();\r\n frameHandle.src = urlNavigate;\r\n return frameHandle;\r\n };\r\n /**\r\n * @hidden\r\n * Creates a new hidden iframe or gets an existing one for silent token renewal.\r\n * @ignore\r\n */\r\n SilentHandler.prototype.createHiddenIframe = function () {\r\n var authFrame = document.createElement(\"iframe\");\r\n authFrame.style.visibility = \"hidden\";\r\n authFrame.style.position = \"absolute\";\r\n authFrame.style.width = authFrame.style.height = \"0\";\r\n authFrame.style.border = \"0\";\r\n authFrame.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\r\n document.getElementsByTagName(\"body\")[0].appendChild(authFrame);\r\n return authFrame;\r\n };\r\n /**\r\n * @hidden\r\n * Removes a hidden iframe from the page.\r\n * @ignore\r\n */\r\n SilentHandler.prototype.removeHiddenIframe = function (iframe) {\r\n if (document.body === iframe.parentNode) {\r\n document.body.removeChild(iframe);\r\n }\r\n };\r\n return SilentHandler;\r\n}(InteractionHandler));\n\nexport { SilentHandler };\n//# sourceMappingURL=SilentHandler.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { AuthError, PerformanceEvents, Constants, StringUtils, PromptValue, UrlString, ProtocolUtils } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { InteractionType } from '../utils/BrowserConstants.js';\nimport { SilentHandler } from '../interaction_handler/SilentHandler.js';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';\nimport { NativeInteractionClient } from './NativeInteractionClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentIframeClient = /** @class */ (function (_super) {\r\n __extends(SilentIframeClient, _super);\r\n function SilentIframeClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, nativeMessageHandler, correlationId) {\r\n var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;\r\n _this.apiId = apiId;\r\n _this.nativeStorage = nativeStorageImpl;\r\n return _this;\r\n }\r\n /**\r\n * Acquires a token silently by opening a hidden iframe to the /authorize endpoint with prompt=none or prompt=no_session\r\n * @param request\r\n */\r\n SilentIframeClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var acquireTokenMeasurement, silentRequest, serverTelemetryManager, authClient, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n this.logger.verbose(\"acquireTokenByIframe called\");\r\n acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n // Check that we have some SSO data\r\n if (StringUtils.isEmpty(request.loginHint) && StringUtils.isEmpty(request.sid) && (!request.account || StringUtils.isEmpty(request.account.username))) {\r\n this.logger.warning(\"No user hint provided. The authorization server may need more information to complete this request.\");\r\n }\r\n // Check that prompt is set to none or no_session, throw error if it is set to anything else.\r\n if (request.prompt && (request.prompt !== PromptValue.NONE) && (request.prompt !== PromptValue.NO_SESSION)) {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: false\r\n });\r\n throw BrowserAuthError.createSilentPromptValueError(request.prompt);\r\n }\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationRequest(__assign(__assign({}, request), { prompt: request.prompt || PromptValue.NONE }), InteractionType.Silent)];\r\n case 1:\r\n silentRequest = _a.sent();\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 5, , 6]);\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, request.correlationId);\r\n return [4 /*yield*/, this.createAuthCodeClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];\r\n case 3:\r\n authClient = _a.sent();\r\n this.logger.verbose(\"Auth code client created\");\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientTokenHelper, request.correlationId);\r\n return [4 /*yield*/, this.silentTokenHelper(authClient, silentRequest).then(function (result) {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: false,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n })];\r\n case 4: return [2 /*return*/, _a.sent()];\r\n case 5:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof AuthError) {\r\n e_1.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e_1);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: e_1 instanceof AuthError && e_1.errorCode || undefined,\r\n subErrorCode: e_1 instanceof AuthError && e_1.subError || undefined,\r\n success: false\r\n });\r\n throw e_1;\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Currently Unsupported\r\n */\r\n SilentIframeClient.prototype.logout = function () {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n };\r\n /**\r\n * Helper which acquires an authorization code silently using a hidden iframe from given url\r\n * using the scopes requested as part of the id, and exchanges the code for a set of OAuth tokens.\r\n * @param navigateUrl\r\n * @param userRequestScopes\r\n */\r\n SilentIframeClient.prototype.silentTokenHelper = function (authClient, silentRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var authCodeRequest, navigateUrl, silentHandler, msalFrame, hash, serverParams, state, nativeInteractionClient, userRequestState;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentIframeClientTokenHelper, silentRequest.correlationId);\r\n // Create auth code request and generate PKCE params\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, silentRequest.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationCodeRequest(silentRequest)];\r\n case 1:\r\n authCodeRequest = _a.sent();\r\n // Create authorize request url\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.GetAuthCodeUrl, silentRequest.correlationId);\r\n return [4 /*yield*/, authClient.getAuthCodeUrl(__assign(__assign({}, silentRequest), { nativeBroker: NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, silentRequest.authenticationScheme) }))];\r\n case 2:\r\n navigateUrl = _a.sent();\r\n silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n // Get the frame handle for the silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerInitiateAuthRequest, silentRequest.correlationId);\r\n return [4 /*yield*/, silentHandler.initiateAuthRequest(navigateUrl)];\r\n case 3:\r\n msalFrame = _a.sent();\r\n // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentHandlerMonitorIframeForHash, silentRequest.correlationId);\r\n return [4 /*yield*/, silentHandler.monitorIframeForHash(msalFrame, this.config.system.iframeHashTimeout)];\r\n case 4:\r\n hash = _a.sent();\r\n serverParams = UrlString.getDeserializedHash(hash);\r\n state = this.validateAndExtractStateFromHash(serverParams, InteractionType.Silent, authCodeRequest.correlationId);\r\n if (serverParams.accountId) {\r\n this.logger.verbose(\"Account id found in hash, calling WAM for token\");\r\n if (!this.nativeMessageHandler) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.apiId, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.browserStorage, this.correlationId);\r\n userRequestState = ProtocolUtils.parseRequestState(this.browserCrypto, state).userRequestState;\r\n return [2 /*return*/, nativeInteractionClient.acquireToken(__assign(__assign({}, silentRequest), { state: userRequestState, prompt: silentRequest.prompt || PromptValue.NONE })).finally(function () {\r\n _this.browserStorage.cleanRequestByState(state);\r\n })];\r\n }\r\n // Handle response from hash string\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.HandleCodeResponseFromHash, silentRequest.correlationId);\r\n return [2 /*return*/, silentHandler.handleCodeResponseFromHash(hash, state, authClient.authority, this.networkClient)];\r\n }\r\n });\r\n });\r\n };\r\n return SilentIframeClient;\r\n}(StandardInteractionClient));\n\nexport { SilentIframeClient };\n//# sourceMappingURL=SilentIframeClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { PerformanceEvents, AuthError, RefreshTokenClient } from '@azure/msal-common';\nimport { ApiId } from '../utils/BrowserConstants.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentRefreshClient = /** @class */ (function (_super) {\r\n __extends(SilentRefreshClient, _super);\r\n function SilentRefreshClient() {\r\n return _super !== null && _super.apply(this, arguments) || this;\r\n }\r\n /**\r\n * Exchanges the refresh token for new tokens\r\n * @param request\r\n */\r\n SilentRefreshClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var silentRequest, _a, acquireTokenMeasurement, serverTelemetryManager, refreshTokenClient;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, request.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeBaseRequest, request.correlationId);\r\n _a = [__assign({}, request)];\r\n return [4 /*yield*/, this.initializeBaseRequest(request)];\r\n case 1:\r\n silentRequest = __assign.apply(void 0, _a.concat([_b.sent()]));\r\n acquireTokenMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SilentRefreshClientAcquireToken, silentRequest.correlationId);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenSilent_silentFlow);\r\n return [4 /*yield*/, this.createRefreshTokenClient(serverTelemetryManager, silentRequest.authority, silentRequest.azureCloudOptions)];\r\n case 2:\r\n refreshTokenClient = _b.sent();\r\n this.logger.verbose(\"Refresh token client created\");\r\n // Send request to renew token. Auth module will throw errors if token cannot be renewed.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken, request.correlationId);\r\n return [2 /*return*/, refreshTokenClient.acquireTokenByRefreshToken(silentRequest)\r\n .then(function (result) {\r\n acquireTokenMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: result.fromCache,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n })\r\n .catch(function (e) {\r\n if (e instanceof AuthError) {\r\n e.setCorrelationId(_this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e);\r\n acquireTokenMeasurement.endMeasurement({\r\n errorCode: e.errorCode,\r\n subErrorCode: e.subError,\r\n success: false\r\n });\r\n throw e;\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Currently Unsupported\r\n */\r\n SilentRefreshClient.prototype.logout = function () {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n };\r\n /**\r\n * Creates a Refresh Client with the given authority, or the default authority.\r\n * @param serverTelemetryManager\r\n * @param authorityUrl\r\n */\r\n SilentRefreshClient.prototype.createRefreshTokenClient = function (serverTelemetryManager, authorityUrl, azureCloudOptions) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var clientConfig;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Create auth module.\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, this.correlationId);\r\n return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, authorityUrl, azureCloudOptions)];\r\n case 1:\r\n clientConfig = _a.sent();\r\n return [2 /*return*/, new RefreshTokenClient(clientConfig, this.performanceClient)];\r\n }\r\n });\r\n });\r\n };\r\n return SilentRefreshClient;\r\n}(StandardInteractionClient));\n\nexport { SilentRefreshClient };\n//# sourceMappingURL=SilentRefreshClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { AccountEntity, CacheManager } from '@azure/msal-common';\nimport { EventType } from './EventType.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar EventHandler = /** @class */ (function () {\r\n function EventHandler(logger, browserCrypto) {\r\n this.eventCallbacks = new Map();\r\n this.logger = logger;\r\n this.browserCrypto = browserCrypto;\r\n this.listeningToStorageEvents = false;\r\n this.handleAccountCacheChange = this.handleAccountCacheChange.bind(this);\r\n }\r\n /**\r\n * Adds event callbacks to array\r\n * @param callback\r\n */\r\n EventHandler.prototype.addEventCallback = function (callback) {\r\n if (typeof window !== \"undefined\") {\r\n var callbackId = this.browserCrypto.createNewGuid();\r\n this.eventCallbacks.set(callbackId, callback);\r\n this.logger.verbose(\"Event callback registered with id: \" + callbackId);\r\n return callbackId;\r\n }\r\n return null;\r\n };\r\n /**\r\n * Removes callback with provided id from callback array\r\n * @param callbackId\r\n */\r\n EventHandler.prototype.removeEventCallback = function (callbackId) {\r\n this.eventCallbacks.delete(callbackId);\r\n this.logger.verbose(\"Event callback \" + callbackId + \" removed.\");\r\n };\r\n /**\r\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n EventHandler.prototype.enableAccountStorageEvents = function () {\r\n if (typeof window === \"undefined\") {\r\n return;\r\n }\r\n if (!this.listeningToStorageEvents) {\r\n this.logger.verbose(\"Adding account storage listener.\");\r\n this.listeningToStorageEvents = true;\r\n window.addEventListener(\"storage\", this.handleAccountCacheChange);\r\n }\r\n else {\r\n this.logger.verbose(\"Account storage listener already registered.\");\r\n }\r\n };\r\n /**\r\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n EventHandler.prototype.disableAccountStorageEvents = function () {\r\n if (typeof window === \"undefined\") {\r\n return;\r\n }\r\n if (this.listeningToStorageEvents) {\r\n this.logger.verbose(\"Removing account storage listener.\");\r\n window.removeEventListener(\"storage\", this.handleAccountCacheChange);\r\n this.listeningToStorageEvents = false;\r\n }\r\n else {\r\n this.logger.verbose(\"No account storage listener registered.\");\r\n }\r\n };\r\n /**\r\n * Emits events by calling callback with event message\r\n * @param eventType\r\n * @param interactionType\r\n * @param payload\r\n * @param error\r\n */\r\n EventHandler.prototype.emitEvent = function (eventType, interactionType, payload, error) {\r\n var _this = this;\r\n if (typeof window !== \"undefined\") {\r\n var message_1 = {\r\n eventType: eventType,\r\n interactionType: interactionType || null,\r\n payload: payload || null,\r\n error: error || null,\r\n timestamp: Date.now()\r\n };\r\n this.logger.info(\"Emitting event: \" + eventType);\r\n this.eventCallbacks.forEach(function (callback, callbackId) {\r\n _this.logger.verbose(\"Emitting event to callback \" + callbackId + \": \" + eventType);\r\n callback.apply(null, [message_1]);\r\n });\r\n }\r\n };\r\n /**\r\n * Emit account added/removed events when cached accounts are changed in a different tab or frame\r\n */\r\n EventHandler.prototype.handleAccountCacheChange = function (e) {\r\n try {\r\n var cacheValue = e.newValue || e.oldValue;\r\n if (!cacheValue) {\r\n return;\r\n }\r\n var parsedValue = JSON.parse(cacheValue);\r\n if (typeof parsedValue !== \"object\" || !AccountEntity.isAccountEntity(parsedValue)) {\r\n return;\r\n }\r\n var accountEntity = CacheManager.toObject(new AccountEntity(), parsedValue);\r\n var accountInfo = accountEntity.getAccountInfo();\r\n if (!e.oldValue && e.newValue) {\r\n this.logger.info(\"Account was added to cache in a different window\");\r\n this.emitEvent(EventType.ACCOUNT_ADDED, undefined, accountInfo);\r\n }\r\n else if (!e.newValue && e.oldValue) {\r\n this.logger.info(\"Account was removed from cache in a different window\");\r\n this.emitEvent(EventType.ACCOUNT_REMOVED, undefined, accountInfo);\r\n }\r\n }\r\n catch (e) {\r\n return;\r\n }\r\n };\r\n return EventHandler;\r\n}());\n\nexport { EventHandler };\n//# sourceMappingURL=EventHandler.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Utility class for math specific functions in browser.\r\n */\r\nvar MathUtils = /** @class */ (function () {\r\n function MathUtils() {\r\n }\r\n /**\r\n * Decimal to Hex\r\n *\r\n * @param num\r\n */\r\n MathUtils.decimalToHex = function (num) {\r\n var hex = num.toString(16);\r\n while (hex.length < 2) {\r\n hex = \"0\" + hex;\r\n }\r\n return hex;\r\n };\r\n return MathUtils;\r\n}());\n\nexport { MathUtils };\n//# sourceMappingURL=MathUtils.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { Constants } from '@azure/msal-common';\nimport { MathUtils } from '../utils/MathUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar GuidGenerator = /** @class */ (function () {\r\n function GuidGenerator(cryptoObj) {\r\n this.cryptoObj = cryptoObj;\r\n }\r\n /*\r\n * RFC4122: The version 4 UUID is meant for generating UUIDs from truly-random or\r\n * pseudo-random numbers.\r\n * The algorithm is as follows:\r\n * Set the two most significant bits (bits 6 and 7) of the\r\n * clock_seq_hi_and_reserved to zero and one, respectively.\r\n * Set the four most significant bits (bits 12 through 15) of the\r\n * time_hi_and_version field to the 4-bit version number from\r\n * Section 4.1.3. Version4\r\n * Set all the other bits to randomly (or pseudo-randomly) chosen\r\n * values.\r\n * UUID = time-low \"-\" time-mid \"-\"time-high-and-version \"-\"clock-seq-reserved and low(2hexOctet)\"-\" node\r\n * time-low = 4hexOctet\r\n * time-mid = 2hexOctet\r\n * time-high-and-version = 2hexOctet\r\n * clock-seq-and-reserved = hexOctet:\r\n * clock-seq-low = hexOctet\r\n * node = 6hexOctet\r\n * Format: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\r\n * y could be 1000, 1001, 1010, 1011 since most significant two bits needs to be 10\r\n * y values are 8, 9, A, B\r\n */\r\n GuidGenerator.prototype.generateGuid = function () {\r\n try {\r\n var buffer = new Uint8Array(16);\r\n this.cryptoObj.getRandomValues(buffer);\r\n // buffer[6] and buffer[7] represents the time_hi_and_version field. We will set the four most significant bits (4 through 7) of buffer[6] to represent decimal number 4 (UUID version number).\r\n buffer[6] |= 0x40; // buffer[6] | 01000000 will set the 6 bit to 1.\r\n buffer[6] &= 0x4f; // buffer[6] & 01001111 will set the 4, 5, and 7 bit to 0 such that bits 4-7 == 0100 = \"4\".\r\n // buffer[8] represents the clock_seq_hi_and_reserved field. We will set the two most significant bits (6 and 7) of the clock_seq_hi_and_reserved to zero and one, respectively.\r\n buffer[8] |= 0x80; // buffer[8] | 10000000 will set the 7 bit to 1.\r\n buffer[8] &= 0xbf; // buffer[8] & 10111111 will set the 6 bit to 0.\r\n return MathUtils.decimalToHex(buffer[0]) + MathUtils.decimalToHex(buffer[1])\r\n + MathUtils.decimalToHex(buffer[2]) + MathUtils.decimalToHex(buffer[3])\r\n + \"-\" + MathUtils.decimalToHex(buffer[4]) + MathUtils.decimalToHex(buffer[5])\r\n + \"-\" + MathUtils.decimalToHex(buffer[6]) + MathUtils.decimalToHex(buffer[7])\r\n + \"-\" + MathUtils.decimalToHex(buffer[8]) + MathUtils.decimalToHex(buffer[9])\r\n + \"-\" + MathUtils.decimalToHex(buffer[10]) + MathUtils.decimalToHex(buffer[11])\r\n + MathUtils.decimalToHex(buffer[12]) + MathUtils.decimalToHex(buffer[13])\r\n + MathUtils.decimalToHex(buffer[14]) + MathUtils.decimalToHex(buffer[15]);\r\n }\r\n catch (err) {\r\n var guidHolder = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n var hex = \"0123456789abcdef\";\r\n var r = 0;\r\n var guidResponse = Constants.EMPTY_STRING;\r\n for (var i = 0; i < 36; i++) {\r\n if (guidHolder[i] !== \"-\" && guidHolder[i] !== \"4\") {\r\n // each x and y needs to be random\r\n r = Math.random() * 16 | 0;\r\n }\r\n if (guidHolder[i] === \"x\") {\r\n guidResponse += hex[r];\r\n }\r\n else if (guidHolder[i] === \"y\") {\r\n // clock-seq-and-reserved first hex is filtered and remaining hex values are random\r\n r &= 0x3; // bit and with 0011 to set pos 2 to zero ?0??\r\n r |= 0x8; // set pos 3 to 1 as 1???\r\n guidResponse += hex[r];\r\n }\r\n else {\r\n guidResponse += guidHolder[i];\r\n }\r\n }\r\n return guidResponse;\r\n }\r\n };\r\n /**\r\n * verifies if a string is GUID\r\n * @param guid\r\n */\r\n GuidGenerator.prototype.isGuid = function (guid) {\r\n var regexGuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;\r\n return regexGuid.test(guid);\r\n };\r\n return GuidGenerator;\r\n}());\n\nexport { GuidGenerator };\n//# sourceMappingURL=GuidGenerator.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { Constants } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Utility functions for strings in a browser. See here for implementation details:\r\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\r\n */\r\nvar BrowserStringUtils = /** @class */ (function () {\r\n function BrowserStringUtils() {\r\n }\r\n /**\r\n * Converts string to Uint8Array\r\n * @param sDOMStr\r\n */\r\n BrowserStringUtils.stringToUtf8Arr = function (sDOMStr) {\r\n var nChr;\r\n var nArrLen = 0;\r\n var nStrLen = sDOMStr.length;\r\n /* mapping... */\r\n for (var nMapIdx = 0; nMapIdx < nStrLen; nMapIdx++) {\r\n nChr = sDOMStr.charCodeAt(nMapIdx);\r\n nArrLen += nChr < 0x80 ? 1 : nChr < 0x800 ? 2 : nChr < 0x10000 ? 3 : nChr < 0x200000 ? 4 : nChr < 0x4000000 ? 5 : 6;\r\n }\r\n var aBytes = new Uint8Array(nArrLen);\r\n /* transcription... */\r\n for (var nIdx = 0, nChrIdx = 0; nIdx < nArrLen; nChrIdx++) {\r\n nChr = sDOMStr.charCodeAt(nChrIdx);\r\n if (nChr < 128) {\r\n /* one byte */\r\n aBytes[nIdx++] = nChr;\r\n }\r\n else if (nChr < 0x800) {\r\n /* two bytes */\r\n aBytes[nIdx++] = 192 + (nChr >>> 6);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n else if (nChr < 0x10000) {\r\n /* three bytes */\r\n aBytes[nIdx++] = 224 + (nChr >>> 12);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n else if (nChr < 0x200000) {\r\n /* four bytes */\r\n aBytes[nIdx++] = 240 + (nChr >>> 18);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n else if (nChr < 0x4000000) {\r\n /* five bytes */\r\n aBytes[nIdx++] = 248 + (nChr >>> 24);\r\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n else /* if (nChr <= 0x7fffffff) */ {\r\n /* six bytes */\r\n aBytes[nIdx++] = 252 + (nChr >>> 30);\r\n aBytes[nIdx++] = 128 + (nChr >>> 24 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 18 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 12 & 63);\r\n aBytes[nIdx++] = 128 + (nChr >>> 6 & 63);\r\n aBytes[nIdx++] = 128 + (nChr & 63);\r\n }\r\n }\r\n return aBytes;\r\n };\r\n /**\r\n * Converst string to ArrayBuffer\r\n * @param dataString\r\n */\r\n BrowserStringUtils.stringToArrayBuffer = function (dataString) {\r\n var data = new ArrayBuffer(dataString.length);\r\n var dataView = new Uint8Array(data);\r\n for (var i = 0; i < dataString.length; i++) {\r\n dataView[i] = dataString.charCodeAt(i);\r\n }\r\n return data;\r\n };\r\n /**\r\n * Converts Uint8Array to a string\r\n * @param aBytes\r\n */\r\n BrowserStringUtils.utf8ArrToString = function (aBytes) {\r\n var sView = Constants.EMPTY_STRING;\r\n for (var nPart = void 0, nLen = aBytes.length, nIdx = 0; nIdx < nLen; nIdx++) {\r\n nPart = aBytes[nIdx];\r\n sView += String.fromCharCode(nPart > 251 && nPart < 254 && nIdx + 5 < nLen ? /* six bytes */\r\n /* (nPart - 252 << 30) may be not so safe in ECMAScript! So...: */\r\n (nPart - 252) * 1073741824 + (aBytes[++nIdx] - 128 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 247 && nPart < 252 && nIdx + 4 < nLen ? /* five bytes */\r\n (nPart - 248 << 24) + (aBytes[++nIdx] - 128 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 239 && nPart < 248 && nIdx + 3 < nLen ? /* four bytes */\r\n (nPart - 240 << 18) + (aBytes[++nIdx] - 128 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 223 && nPart < 240 && nIdx + 2 < nLen ? /* three bytes */\r\n (nPart - 224 << 12) + (aBytes[++nIdx] - 128 << 6) + aBytes[++nIdx] - 128\r\n : nPart > 191 && nPart < 224 && nIdx + 1 < nLen ? /* two bytes */\r\n (nPart - 192 << 6) + aBytes[++nIdx] - 128\r\n : /* nPart < 127 ? */ /* one byte */\r\n nPart);\r\n }\r\n return sView;\r\n };\r\n /**\r\n * Returns stringified jwk.\r\n * @param jwk\r\n */\r\n BrowserStringUtils.getSortedObjectString = function (obj) {\r\n return JSON.stringify(obj, Object.keys(obj).sort());\r\n };\r\n return BrowserStringUtils;\r\n}());\n\nexport { BrowserStringUtils };\n//# sourceMappingURL=BrowserStringUtils.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { Constants } from '@azure/msal-common';\nimport { BrowserStringUtils } from '../utils/BrowserStringUtils.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 * Class which exposes APIs to encode plaintext to base64 encoded string. See here for implementation details:\r\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\r\n */\r\nvar Base64Encode = /** @class */ (function () {\r\n function Base64Encode() {\r\n }\r\n /**\r\n * Returns URL Safe b64 encoded string from a plaintext string.\r\n * @param input\r\n */\r\n Base64Encode.prototype.urlEncode = function (input) {\r\n return encodeURIComponent(this.encode(input)\r\n .replace(/=/g, Constants.EMPTY_STRING)\r\n .replace(/\\+/g, \"-\")\r\n .replace(/\\//g, \"_\"));\r\n };\r\n /**\r\n * Returns URL Safe b64 encoded string from an int8Array.\r\n * @param inputArr\r\n */\r\n Base64Encode.prototype.urlEncodeArr = function (inputArr) {\r\n return this.base64EncArr(inputArr)\r\n .replace(/=/g, Constants.EMPTY_STRING)\r\n .replace(/\\+/g, \"-\")\r\n .replace(/\\//g, \"_\");\r\n };\r\n /**\r\n * Returns b64 encoded string from plaintext string.\r\n * @param input\r\n */\r\n Base64Encode.prototype.encode = function (input) {\r\n var inputUtf8Arr = BrowserStringUtils.stringToUtf8Arr(input);\r\n return this.base64EncArr(inputUtf8Arr);\r\n };\r\n /**\r\n * Base64 encode byte array\r\n * @param aBytes\r\n */\r\n Base64Encode.prototype.base64EncArr = function (aBytes) {\r\n var eqLen = (3 - (aBytes.length % 3)) % 3;\r\n var sB64Enc = Constants.EMPTY_STRING;\r\n for (var nMod3 = void 0, nLen = aBytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {\r\n nMod3 = nIdx % 3;\r\n /* Uncomment the following line in order to split the output in lines 76-character long: */\r\n /*\r\n *if (nIdx > 0 && (nIdx * 4 / 3) % 76 === 0) { sB64Enc += \"\\r\\n\"; }\r\n */\r\n nUint24 |= aBytes[nIdx] << (16 >>> nMod3 & 24);\r\n if (nMod3 === 2 || aBytes.length - nIdx === 1) {\r\n sB64Enc += String.fromCharCode(this.uint6ToB64(nUint24 >>> 18 & 63), this.uint6ToB64(nUint24 >>> 12 & 63), this.uint6ToB64(nUint24 >>> 6 & 63), this.uint6ToB64(nUint24 & 63));\r\n nUint24 = 0;\r\n }\r\n }\r\n return eqLen === 0 ? sB64Enc : sB64Enc.substring(0, sB64Enc.length - eqLen) + (eqLen === 1 ? \"=\" : \"==\");\r\n };\r\n /**\r\n * Base64 string to array encoding helper\r\n * @param nUint6\r\n */\r\n Base64Encode.prototype.uint6ToB64 = function (nUint6) {\r\n return nUint6 < 26 ?\r\n nUint6 + 65\r\n : nUint6 < 52 ?\r\n nUint6 + 71\r\n : nUint6 < 62 ?\r\n nUint6 - 4\r\n : nUint6 === 62 ?\r\n 43\r\n : nUint6 === 63 ?\r\n 47\r\n :\r\n 65;\r\n };\r\n return Base64Encode;\r\n}());\n\nexport { Base64Encode };\n//# sourceMappingURL=Base64Encode.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { Constants } from '@azure/msal-common';\nimport { BrowserStringUtils } from '../utils/BrowserStringUtils.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 * Class which exposes APIs to decode base64 strings to plaintext. See here for implementation details:\r\n * https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_2_%E2%80%93_JavaScript's_UTF-16_%3E_UTF-8_%3E_base64\r\n */\r\nvar Base64Decode = /** @class */ (function () {\r\n function Base64Decode() {\r\n }\r\n /**\r\n * Returns a URL-safe plaintext decoded string from b64 encoded input.\r\n * @param input\r\n */\r\n Base64Decode.prototype.decode = function (input) {\r\n var encodedString = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\r\n switch (encodedString.length % 4) {\r\n case 0:\r\n break;\r\n case 2:\r\n encodedString += \"==\";\r\n break;\r\n case 3:\r\n encodedString += \"=\";\r\n break;\r\n default:\r\n throw new Error(\"Invalid base64 string\");\r\n }\r\n var inputUtf8Arr = this.base64DecToArr(encodedString);\r\n return BrowserStringUtils.utf8ArrToString(inputUtf8Arr);\r\n };\r\n /**\r\n * Decodes base64 into Uint8Array\r\n * @param base64String\r\n * @param nBlockSize\r\n */\r\n Base64Decode.prototype.base64DecToArr = function (base64String, nBlockSize) {\r\n var sB64Enc = base64String.replace(/[^A-Za-z0-9\\+\\/]/g, Constants.EMPTY_STRING);\r\n var nInLen = sB64Enc.length;\r\n var nOutLen = nBlockSize ? Math.ceil((nInLen * 3 + 1 >>> 2) / nBlockSize) * nBlockSize : nInLen * 3 + 1 >>> 2;\r\n var aBytes = new Uint8Array(nOutLen);\r\n for (var nMod3 = void 0, nMod4 = void 0, nUint24 = 0, nOutIdx = 0, nInIdx = 0; nInIdx < nInLen; nInIdx++) {\r\n nMod4 = nInIdx & 3;\r\n nUint24 |= this.b64ToUint6(sB64Enc.charCodeAt(nInIdx)) << 18 - 6 * nMod4;\r\n if (nMod4 === 3 || nInLen - nInIdx === 1) {\r\n for (nMod3 = 0; nMod3 < 3 && nOutIdx < nOutLen; nMod3++, nOutIdx++) {\r\n aBytes[nOutIdx] = nUint24 >>> (16 >>> nMod3 & 24) & 255;\r\n }\r\n nUint24 = 0;\r\n }\r\n }\r\n return aBytes;\r\n };\r\n /**\r\n * Base64 string to array decoding helper\r\n * @param charNum\r\n */\r\n Base64Decode.prototype.b64ToUint6 = function (charNum) {\r\n return charNum > 64 && charNum < 91 ?\r\n charNum - 65\r\n : charNum > 96 && charNum < 123 ?\r\n charNum - 71\r\n : charNum > 47 && charNum < 58 ?\r\n charNum + 4\r\n : charNum === 43 ?\r\n 62\r\n : charNum === 47 ?\r\n 63\r\n :\r\n 0;\r\n };\r\n return Base64Decode;\r\n}());\n\nexport { Base64Decode };\n//# sourceMappingURL=Base64Decode.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { Base64Encode } from '../encode/Base64Encode.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n// Constant byte array length\r\nvar RANDOM_BYTE_ARR_LENGTH = 32;\r\n/**\r\n * Class which exposes APIs to generate PKCE codes and code verifiers.\r\n */\r\nvar PkceGenerator = /** @class */ (function () {\r\n function PkceGenerator(cryptoObj) {\r\n this.base64Encode = new Base64Encode();\r\n this.cryptoObj = cryptoObj;\r\n }\r\n /**\r\n * Generates PKCE Codes. See the RFC for more information: https://tools.ietf.org/html/rfc7636\r\n */\r\n PkceGenerator.prototype.generateCodes = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var codeVerifier, codeChallenge;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n codeVerifier = this.generateCodeVerifier();\r\n return [4 /*yield*/, this.generateCodeChallengeFromVerifier(codeVerifier)];\r\n case 1:\r\n codeChallenge = _a.sent();\r\n return [2 /*return*/, {\r\n verifier: codeVerifier,\r\n challenge: codeChallenge\r\n }];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Generates a random 32 byte buffer and returns the base64\r\n * encoded string to be used as a PKCE Code Verifier\r\n */\r\n PkceGenerator.prototype.generateCodeVerifier = function () {\r\n try {\r\n // Generate random values as utf-8\r\n var buffer = new Uint8Array(RANDOM_BYTE_ARR_LENGTH);\r\n this.cryptoObj.getRandomValues(buffer);\r\n // encode verifier as base64\r\n var pkceCodeVerifierB64 = this.base64Encode.urlEncodeArr(buffer);\r\n return pkceCodeVerifierB64;\r\n }\r\n catch (e) {\r\n throw BrowserAuthError.createPkceNotGeneratedError(e);\r\n }\r\n };\r\n /**\r\n * Creates a base64 encoded PKCE Code Challenge string from the\r\n * hash created from the PKCE Code Verifier supplied\r\n */\r\n PkceGenerator.prototype.generateCodeChallengeFromVerifier = function (pkceCodeVerifier) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var pkceHashedCodeVerifier, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n return [4 /*yield*/, this.cryptoObj.sha256Digest(pkceCodeVerifier)];\r\n case 1:\r\n pkceHashedCodeVerifier = _a.sent();\r\n // encode hash as base64\r\n return [2 /*return*/, this.base64Encode.urlEncodeArr(new Uint8Array(pkceHashedCodeVerifier))];\r\n case 2:\r\n e_1 = _a.sent();\r\n throw BrowserAuthError.createPkceNotGeneratedError(e_1);\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return PkceGenerator;\r\n}());\n\nexport { PkceGenerator };\n//# sourceMappingURL=PkceGenerator.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ModernBrowserCrypto = /** @class */ (function () {\r\n function ModernBrowserCrypto() {\r\n }\r\n ModernBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {\r\n return window.crypto.getRandomValues(dataBuffer);\r\n };\r\n ModernBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.crypto.subtle.generateKey(algorithm, extractable, keyUsages)];\r\n });\r\n });\r\n };\r\n ModernBrowserCrypto.prototype.exportKey = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key)];\r\n });\r\n });\r\n };\r\n ModernBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.crypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages)];\r\n });\r\n });\r\n };\r\n ModernBrowserCrypto.prototype.sign = function (algorithm, key, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.crypto.subtle.sign(algorithm, key, data)];\r\n });\r\n });\r\n };\r\n ModernBrowserCrypto.prototype.digest = function (algorithm, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.crypto.subtle.digest(algorithm, data)];\r\n });\r\n });\r\n };\r\n return ModernBrowserCrypto;\r\n}());\n\nexport { ModernBrowserCrypto };\n//# sourceMappingURL=ModernBrowserCrypto.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __spread, __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar MsrBrowserCrypto = /** @class */ (function () {\r\n function MsrBrowserCrypto() {\r\n }\r\n MsrBrowserCrypto.prototype.initPrng = function (entropy) {\r\n // Turn into array, as initPrng seems to not always like Uint8Array (even though it should support both)\r\n return window.msrCrypto.initPrng(__spread(entropy));\r\n };\r\n MsrBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {\r\n return window.msrCrypto.getRandomValues(dataBuffer);\r\n };\r\n MsrBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.msrCrypto.subtle.generateKey(algorithm, extractable, keyUsages)];\r\n });\r\n });\r\n };\r\n MsrBrowserCrypto.prototype.exportKey = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.msrCrypto.subtle.exportKey(KEY_FORMAT_JWK, key)];\r\n });\r\n });\r\n };\r\n MsrBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.msrCrypto.subtle.importKey(KEY_FORMAT_JWK, keyData, algorithm, extractable, keyUsages)];\r\n });\r\n });\r\n };\r\n MsrBrowserCrypto.prototype.sign = function (algorithm, key, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.msrCrypto.subtle.sign(algorithm, key, data)];\r\n });\r\n });\r\n };\r\n MsrBrowserCrypto.prototype.digest = function (algorithm, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, window.msrCrypto.subtle.digest(algorithm, data)];\r\n });\r\n });\r\n };\r\n return MsrBrowserCrypto;\r\n}());\n\nexport { MsrBrowserCrypto };\n//# sourceMappingURL=MsrBrowserCrypto.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { Constants } from '@azure/msal-common';\nimport { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';\nimport { BrowserStringUtils } from '../utils/BrowserStringUtils.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar MsBrowserCrypto = /** @class */ (function () {\r\n function MsBrowserCrypto() {\r\n }\r\n MsBrowserCrypto.prototype.getRandomValues = function (dataBuffer) {\r\n return window[\"msCrypto\"].getRandomValues(dataBuffer);\r\n };\r\n MsBrowserCrypto.prototype.generateKey = function (algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var msGenerateKey = window[\"msCrypto\"].subtle.generateKey(algorithm, extractable, keyUsages);\r\n msGenerateKey.addEventListener(\"complete\", function (e) {\r\n resolve(e.target.result);\r\n });\r\n msGenerateKey.addEventListener(\"error\", function (error) {\r\n reject(error);\r\n });\r\n })];\r\n });\r\n });\r\n };\r\n MsBrowserCrypto.prototype.exportKey = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var msExportKey = window[\"msCrypto\"].subtle.exportKey(KEY_FORMAT_JWK, key);\r\n msExportKey.addEventListener(\"complete\", function (e) {\r\n var resultBuffer = e.target.result;\r\n var resultString = BrowserStringUtils.utf8ArrToString(new Uint8Array(resultBuffer))\r\n .replace(/\\r/g, Constants.EMPTY_STRING)\r\n .replace(/\\n/g, Constants.EMPTY_STRING)\r\n .replace(/\\t/g, Constants.EMPTY_STRING)\r\n .split(\" \").join(Constants.EMPTY_STRING)\r\n .replace(\"\\u0000\", Constants.EMPTY_STRING);\r\n try {\r\n resolve(JSON.parse(resultString));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n });\r\n msExportKey.addEventListener(\"error\", function (error) {\r\n reject(error);\r\n });\r\n })];\r\n });\r\n });\r\n };\r\n MsBrowserCrypto.prototype.importKey = function (keyData, algorithm, extractable, keyUsages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var keyString, keyBuffer;\r\n return __generator(this, function (_a) {\r\n keyString = BrowserStringUtils.getSortedObjectString(keyData);\r\n keyBuffer = BrowserStringUtils.stringToArrayBuffer(keyString);\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var msImportKey = window[\"msCrypto\"].subtle.importKey(KEY_FORMAT_JWK, keyBuffer, algorithm, extractable, keyUsages);\r\n msImportKey.addEventListener(\"complete\", function (e) {\r\n resolve(e.target.result);\r\n });\r\n msImportKey.addEventListener(\"error\", function (error) {\r\n reject(error);\r\n });\r\n })];\r\n });\r\n });\r\n };\r\n MsBrowserCrypto.prototype.sign = function (algorithm, key, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var msSign = window[\"msCrypto\"].subtle.sign(algorithm, key, data);\r\n msSign.addEventListener(\"complete\", function (e) {\r\n resolve(e.target.result);\r\n });\r\n msSign.addEventListener(\"error\", function (error) {\r\n reject(error);\r\n });\r\n })];\r\n });\r\n });\r\n };\r\n MsBrowserCrypto.prototype.digest = function (algorithm, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var digestOperation = window[\"msCrypto\"].subtle.digest(algorithm, data.buffer);\r\n digestOperation.addEventListener(\"complete\", function (e) {\r\n resolve(e.target.result);\r\n });\r\n digestOperation.addEventListener(\"error\", function (error) {\r\n reject(error);\r\n });\r\n })];\r\n });\r\n });\r\n };\r\n return MsBrowserCrypto;\r\n}());\n\nexport { MsBrowserCrypto };\n//# sourceMappingURL=MsBrowserCrypto.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BrowserStringUtils } from '../utils/BrowserStringUtils.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { ModernBrowserCrypto } from './ModernBrowserCrypto.js';\nimport { MsrBrowserCrypto } from './MsrBrowserCrypto.js';\nimport { MsBrowserCrypto } from './MsBrowserCrypto.js';\nimport { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.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 * See here for more info on RsaHashedKeyGenParams: https://developer.mozilla.org/en-US/docs/Web/API/RsaHashedKeyGenParams\r\n */\r\n// RSA KeyGen Algorithm\r\nvar PKCS1_V15_KEYGEN_ALG = \"RSASSA-PKCS1-v1_5\";\r\n// SHA-256 hashing algorithm\r\nvar S256_HASH_ALG = \"SHA-256\";\r\n// MOD length for PoP tokens\r\nvar MODULUS_LENGTH = 2048;\r\n// Public Exponent\r\nvar PUBLIC_EXPONENT = new Uint8Array([0x01, 0x00, 0x01]);\r\n/**\r\n * This class implements functions used by the browser library to perform cryptography operations such as\r\n * hashing and encoding. It also has helper functions to validate the availability of specific APIs.\r\n */\r\nvar BrowserCrypto = /** @class */ (function () {\r\n function BrowserCrypto(logger, cryptoOptions) {\r\n var _a, _b;\r\n this.logger = logger;\r\n this.cryptoOptions = cryptoOptions;\r\n if (this.hasBrowserCrypto()) {\r\n // Use standard modern web crypto if available\r\n this.logger.verbose(\"BrowserCrypto: modern crypto interface available\");\r\n this.subtleCrypto = new ModernBrowserCrypto();\r\n }\r\n else if (this.hasIECrypto()) {\r\n // For IE11, use msCrypto interface\r\n this.logger.verbose(\"BrowserCrypto: MS crypto interface available\");\r\n this.subtleCrypto = new MsBrowserCrypto();\r\n }\r\n else if (this.hasMsrCrypto() && ((_a = this.cryptoOptions) === null || _a === void 0 ? void 0 : _a.useMsrCrypto)) {\r\n // For other browsers, use MSR Crypto if found\r\n this.logger.verbose(\"BrowserCrypto: MSR crypto interface available\");\r\n this.subtleCrypto = new MsrBrowserCrypto();\r\n }\r\n else {\r\n if (this.hasMsrCrypto()) {\r\n this.logger.info(\"BrowserCrypto: MSR Crypto interface available but system.cryptoOptions.useMsrCrypto not enabled\");\r\n }\r\n this.logger.error(\"BrowserCrypto: No crypto interfaces available.\");\r\n throw BrowserAuthError.createCryptoNotAvailableError(\"Browser crypto, msCrypto, or msrCrypto interfaces not available.\");\r\n }\r\n // Mainly needed for MSR Crypto: https://github.com/microsoft/MSR-JavaScript-Crypto#random-number-generator-prng\r\n if (this.subtleCrypto.initPrng) {\r\n this.logger.verbose(\"BrowserCrypto: Interface requires entropy\");\r\n if (!((_b = this.cryptoOptions) === null || _b === void 0 ? void 0 : _b.entropy)) {\r\n this.logger.error(\"BrowserCrypto: Interface requires entropy but none provided.\");\r\n throw BrowserConfigurationAuthError.createEntropyNotProvided();\r\n }\r\n this.logger.verbose(\"BrowserCrypto: Entropy provided\");\r\n this.subtleCrypto.initPrng(this.cryptoOptions.entropy);\r\n }\r\n this.keygenAlgorithmOptions = {\r\n name: PKCS1_V15_KEYGEN_ALG,\r\n hash: S256_HASH_ALG,\r\n modulusLength: MODULUS_LENGTH,\r\n publicExponent: PUBLIC_EXPONENT\r\n };\r\n }\r\n /**\r\n * Check whether IE crypto or other browser cryptography is available.\r\n */\r\n BrowserCrypto.prototype.hasIECrypto = function () {\r\n return \"msCrypto\" in window;\r\n };\r\n /**\r\n * Check whether browser crypto is available.\r\n */\r\n BrowserCrypto.prototype.hasBrowserCrypto = function () {\r\n return \"crypto\" in window;\r\n };\r\n /**\r\n * Check whether MSR crypto polyfill is available\r\n */\r\n BrowserCrypto.prototype.hasMsrCrypto = function () {\r\n return \"msrCrypto\" in window;\r\n };\r\n /**\r\n * Returns a sha-256 hash of the given dataString as an ArrayBuffer.\r\n * @param dataString\r\n */\r\n BrowserCrypto.prototype.sha256Digest = function (dataString) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var data;\r\n return __generator(this, function (_a) {\r\n data = BrowserStringUtils.stringToUtf8Arr(dataString);\r\n // MSR Crypto wants object with name property, instead of string\r\n return [2 /*return*/, this.subtleCrypto.digest({ name: S256_HASH_ALG }, data)];\r\n });\r\n });\r\n };\r\n /**\r\n * Populates buffer with cryptographically random values.\r\n * @param dataBuffer\r\n */\r\n BrowserCrypto.prototype.getRandomValues = function (dataBuffer) {\r\n return this.subtleCrypto.getRandomValues(dataBuffer);\r\n };\r\n /**\r\n * Generates a keypair based on current keygen algorithm config.\r\n * @param extractable\r\n * @param usages\r\n */\r\n BrowserCrypto.prototype.generateKeyPair = function (extractable, usages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.subtleCrypto.generateKey(this.keygenAlgorithmOptions, extractable, usages)];\r\n });\r\n });\r\n };\r\n /**\r\n * Export key as Json Web Key (JWK)\r\n * @param key\r\n * @param format\r\n */\r\n BrowserCrypto.prototype.exportJwk = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.subtleCrypto.exportKey(key)];\r\n });\r\n });\r\n };\r\n /**\r\n * Imports key as Json Web Key (JWK), can set extractable and usages.\r\n * @param key\r\n * @param format\r\n * @param extractable\r\n * @param usages\r\n */\r\n BrowserCrypto.prototype.importJwk = function (key, extractable, usages) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.subtleCrypto.importKey(key, this.keygenAlgorithmOptions, extractable, usages)];\r\n });\r\n });\r\n };\r\n /**\r\n * Signs given data with given key\r\n * @param key\r\n * @param data\r\n */\r\n BrowserCrypto.prototype.sign = function (key, data) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.subtleCrypto.sign(this.keygenAlgorithmOptions, key, data)];\r\n });\r\n });\r\n };\r\n return BrowserCrypto;\r\n}());\n\nexport { BrowserCrypto };\n//# sourceMappingURL=BrowserCrypto.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { DB_NAME, DB_VERSION, DB_TABLE_NAME } from '../utils/BrowserConstants.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 * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\r\n */\r\nvar DatabaseStorage = /** @class */ (function () {\r\n function DatabaseStorage() {\r\n this.dbName = DB_NAME;\r\n this.version = DB_VERSION;\r\n this.tableName = DB_TABLE_NAME;\r\n this.dbOpen = false;\r\n }\r\n /**\r\n * Opens IndexedDB instance.\r\n */\r\n DatabaseStorage.prototype.open = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var openDB = window.indexedDB.open(_this.dbName, _this.version);\r\n openDB.addEventListener(\"upgradeneeded\", function (e) {\r\n var event = e;\r\n event.target.result.createObjectStore(_this.tableName);\r\n });\r\n openDB.addEventListener(\"success\", function (e) {\r\n var event = e;\r\n _this.db = event.target.result;\r\n _this.dbOpen = true;\r\n resolve();\r\n });\r\n openDB.addEventListener(\"error\", function () { return reject(BrowserAuthError.createDatabaseUnavailableError()); });\r\n })];\r\n });\r\n });\r\n };\r\n /**\r\n * Closes the connection to IndexedDB database when all pending transactions\r\n * complete.\r\n */\r\n DatabaseStorage.prototype.closeConnection = function () {\r\n var db = this.db;\r\n if (db && this.dbOpen) {\r\n db.close();\r\n this.dbOpen = false;\r\n }\r\n };\r\n /**\r\n * Opens database if it's not already open\r\n */\r\n DatabaseStorage.prototype.validateDbIsOpen = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n if (!!this.dbOpen) return [3 /*break*/, 2];\r\n return [4 /*yield*/, this.open()];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n case 2: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Retrieves item from IndexedDB instance.\r\n * @param key\r\n */\r\n DatabaseStorage.prototype.getItem = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validateDbIsOpen()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n // TODO: Add timeouts?\r\n if (!_this.db) {\r\n return reject(BrowserAuthError.createDatabaseNotOpenError());\r\n }\r\n var transaction = _this.db.transaction([_this.tableName], \"readonly\");\r\n var objectStore = transaction.objectStore(_this.tableName);\r\n var dbGet = objectStore.get(key);\r\n dbGet.addEventListener(\"success\", function (e) {\r\n var event = e;\r\n _this.closeConnection();\r\n resolve(event.target.result);\r\n });\r\n dbGet.addEventListener(\"error\", function (e) {\r\n _this.closeConnection();\r\n reject(e);\r\n });\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Adds item to IndexedDB under given key\r\n * @param key\r\n * @param payload\r\n */\r\n DatabaseStorage.prototype.setItem = function (key, payload) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validateDbIsOpen()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n // TODO: Add timeouts?\r\n if (!_this.db) {\r\n return reject(BrowserAuthError.createDatabaseNotOpenError());\r\n }\r\n var transaction = _this.db.transaction([_this.tableName], \"readwrite\");\r\n var objectStore = transaction.objectStore(_this.tableName);\r\n var dbPut = objectStore.put(payload, key);\r\n dbPut.addEventListener(\"success\", function () {\r\n _this.closeConnection();\r\n resolve();\r\n });\r\n dbPut.addEventListener(\"error\", function (e) {\r\n _this.closeConnection();\r\n reject(e);\r\n });\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes item from IndexedDB under given key\r\n * @param key\r\n */\r\n DatabaseStorage.prototype.removeItem = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validateDbIsOpen()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n if (!_this.db) {\r\n return reject(BrowserAuthError.createDatabaseNotOpenError());\r\n }\r\n var transaction = _this.db.transaction([_this.tableName], \"readwrite\");\r\n var objectStore = transaction.objectStore(_this.tableName);\r\n var dbDelete = objectStore.delete(key);\r\n dbDelete.addEventListener(\"success\", function () {\r\n _this.closeConnection();\r\n resolve();\r\n });\r\n dbDelete.addEventListener(\"error\", function (e) {\r\n _this.closeConnection();\r\n reject(e);\r\n });\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Get all the keys from the storage object as an iterable array of strings.\r\n */\r\n DatabaseStorage.prototype.getKeys = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validateDbIsOpen()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n if (!_this.db) {\r\n return reject(BrowserAuthError.createDatabaseNotOpenError());\r\n }\r\n var transaction = _this.db.transaction([_this.tableName], \"readonly\");\r\n var objectStore = transaction.objectStore(_this.tableName);\r\n var dbGetKeys = objectStore.getAllKeys();\r\n dbGetKeys.addEventListener(\"success\", function (e) {\r\n var event = e;\r\n _this.closeConnection();\r\n resolve(event.target.result);\r\n });\r\n dbGetKeys.addEventListener(\"error\", function (e) {\r\n _this.closeConnection();\r\n reject(e);\r\n });\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n *\r\n * Checks whether there is an object under the search key in the object store\r\n */\r\n DatabaseStorage.prototype.containsKey = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.validateDbIsOpen()];\r\n case 1:\r\n _a.sent();\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n if (!_this.db) {\r\n return reject(BrowserAuthError.createDatabaseNotOpenError());\r\n }\r\n var transaction = _this.db.transaction([_this.tableName], \"readonly\");\r\n var objectStore = transaction.objectStore(_this.tableName);\r\n var dbContainsKey = objectStore.count(key);\r\n dbContainsKey.addEventListener(\"success\", function (e) {\r\n var event = e;\r\n _this.closeConnection();\r\n resolve(event.target.result === 1);\r\n });\r\n dbContainsKey.addEventListener(\"error\", function (e) {\r\n _this.closeConnection();\r\n reject(e);\r\n });\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\r\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\r\n * with IndexedDB database versions.\r\n */\r\n DatabaseStorage.prototype.deleteDatabase = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n // Check if database being deleted exists\r\n if (this.db && this.dbOpen) {\r\n this.closeConnection();\r\n }\r\n return [2 /*return*/, new Promise(function (resolve, reject) {\r\n var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\r\n deleteDbRequest.addEventListener(\"success\", function () { return resolve(true); });\r\n deleteDbRequest.addEventListener(\"blocked\", function () { return resolve(true); });\r\n deleteDbRequest.addEventListener(\"error\", function () { return reject(false); });\r\n })];\r\n });\r\n });\r\n };\r\n return DatabaseStorage;\r\n}());\n\nexport { DatabaseStorage };\n//# sourceMappingURL=DatabaseStorage.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';\nimport { DatabaseStorage } from './DatabaseStorage.js';\nimport { MemoryStorage } from './MemoryStorage.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 * This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,\r\n * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.\r\n */\r\nvar AsyncMemoryStorage = /** @class */ (function () {\r\n function AsyncMemoryStorage(logger, storeName) {\r\n this.inMemoryCache = new MemoryStorage();\r\n this.indexedDBCache = new DatabaseStorage();\r\n this.logger = logger;\r\n this.storeName = storeName;\r\n }\r\n AsyncMemoryStorage.prototype.handleDatabaseAccessError = function (error) {\r\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.databaseUnavailable.code) {\r\n this.logger.error(\"Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.\");\r\n }\r\n else {\r\n throw error;\r\n }\r\n };\r\n /**\r\n * Get the item matching the given key. Tries in-memory cache first, then in the asynchronous\r\n * storage object if item isn't found in-memory.\r\n * @param key\r\n */\r\n AsyncMemoryStorage.prototype.getItem = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var item, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n item = this.inMemoryCache.getItem(key);\r\n if (!!item) return [3 /*break*/, 4];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n this.logger.verbose(\"Queried item not found in in-memory cache, now querying persistent storage.\");\r\n return [4 /*yield*/, this.indexedDBCache.getItem(key)];\r\n case 2: return [2 /*return*/, _a.sent()];\r\n case 3:\r\n e_1 = _a.sent();\r\n this.handleDatabaseAccessError(e_1);\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/, item];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Sets the item in the in-memory cache and then tries to set it in the asynchronous\r\n * storage object with the given key.\r\n * @param key\r\n * @param value\r\n */\r\n AsyncMemoryStorage.prototype.setItem = function (key, value) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_2;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.inMemoryCache.setItem(key, value);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.indexedDBCache.setItem(key, value)];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_2 = _a.sent();\r\n this.handleDatabaseAccessError(e_2);\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.\r\n * @param key\r\n */\r\n AsyncMemoryStorage.prototype.removeItem = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_3;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.inMemoryCache.removeItem(key);\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.indexedDBCache.removeItem(key)];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_3 = _a.sent();\r\n this.handleDatabaseAccessError(e_3);\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the\r\n * asynchronous storage object.\r\n */\r\n AsyncMemoryStorage.prototype.getKeys = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var cacheKeys, e_4;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n cacheKeys = this.inMemoryCache.getKeys();\r\n if (!(cacheKeys.length === 0)) return [3 /*break*/, 4];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n this.logger.verbose(\"In-memory cache is empty, now querying persistent storage.\");\r\n return [4 /*yield*/, this.indexedDBCache.getKeys()];\r\n case 2: return [2 /*return*/, _a.sent()];\r\n case 3:\r\n e_4 = _a.sent();\r\n this.handleDatabaseAccessError(e_4);\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/, cacheKeys];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns true or false if the given key is present in the cache.\r\n * @param key\r\n */\r\n AsyncMemoryStorage.prototype.containsKey = function (key) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var containsKey, e_5;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n containsKey = this.inMemoryCache.containsKey(key);\r\n if (!!containsKey) return [3 /*break*/, 4];\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n this.logger.verbose(\"Key not found in in-memory cache, now querying persistent storage.\");\r\n return [4 /*yield*/, this.indexedDBCache.containsKey(key)];\r\n case 2: return [2 /*return*/, _a.sent()];\r\n case 3:\r\n e_5 = _a.sent();\r\n this.handleDatabaseAccessError(e_5);\r\n return [3 /*break*/, 4];\r\n case 4: return [2 /*return*/, containsKey];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Clears in-memory Map\r\n */\r\n AsyncMemoryStorage.prototype.clearInMemory = function () {\r\n // InMemory cache is a Map instance, clear is straightforward\r\n this.logger.verbose(\"Deleting in-memory keystore \" + this.storeName);\r\n this.inMemoryCache.clear();\r\n this.logger.verbose(\"In-memory keystore \" + this.storeName + \" deleted\");\r\n };\r\n /**\r\n * Tries to delete the IndexedDB database\r\n * @returns\r\n */\r\n AsyncMemoryStorage.prototype.clearPersistent = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var dbDeleted, e_6;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n _a.trys.push([0, 2, , 3]);\r\n this.logger.verbose(\"Deleting persistent keystore\");\r\n return [4 /*yield*/, this.indexedDBCache.deleteDatabase()];\r\n case 1:\r\n dbDeleted = _a.sent();\r\n if (dbDeleted) {\r\n this.logger.verbose(\"Persistent keystore deleted\");\r\n }\r\n return [2 /*return*/, dbDeleted];\r\n case 2:\r\n e_6 = _a.sent();\r\n this.handleDatabaseAccessError(e_6);\r\n return [2 /*return*/, false];\r\n case 3: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return AsyncMemoryStorage;\r\n}());\n\nexport { AsyncMemoryStorage };\n//# sourceMappingURL=AsyncMemoryStorage.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { AsyncMemoryStorage } from './AsyncMemoryStorage.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar CryptoKeyStoreNames;\r\n(function (CryptoKeyStoreNames) {\r\n CryptoKeyStoreNames[\"asymmetricKeys\"] = \"asymmetricKeys\";\r\n CryptoKeyStoreNames[\"symmetricKeys\"] = \"symmetricKeys\";\r\n})(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));\r\n/**\r\n * MSAL CryptoKeyStore DB Version 2\r\n */\r\nvar CryptoKeyStore = /** @class */ (function () {\r\n function CryptoKeyStore(logger) {\r\n this.logger = logger;\r\n this.asymmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys);\r\n this.symmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys);\r\n }\r\n CryptoKeyStore.prototype.clear = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // Delete in-memory keystores\r\n this.asymmetricKeys.clearInMemory();\r\n this.symmetricKeys.clearInMemory();\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 3, , 4]);\r\n return [4 /*yield*/, this.asymmetricKeys.clearPersistent()];\r\n case 2:\r\n _a.sent();\r\n return [2 /*return*/, true];\r\n case 3:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof Error) {\r\n this.logger.error(\"Clearing keystore failed with error: \" + e_1.message);\r\n }\r\n else {\r\n this.logger.error(\"Clearing keystore failed with unknown error\");\r\n }\r\n return [2 /*return*/, false];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n return CryptoKeyStore;\r\n}());\n\nexport { CryptoKeyStore, CryptoKeyStoreNames };\n//# sourceMappingURL=CryptoKeyStore.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator } from '../_virtual/_tslib.js';\nimport { PerformanceEvents, JoseHeader } from '@azure/msal-common';\nimport { GuidGenerator } from './GuidGenerator.js';\nimport { Base64Encode } from '../encode/Base64Encode.js';\nimport { Base64Decode } from '../encode/Base64Decode.js';\nimport { PkceGenerator } from './PkceGenerator.js';\nimport { BrowserCrypto } from './BrowserCrypto.js';\nimport { BrowserStringUtils } from '../utils/BrowserStringUtils.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { CryptoKeyStore } from '../cache/CryptoKeyStore.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 * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and\r\n * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).\r\n */\r\nvar CryptoOps = /** @class */ (function () {\r\n function CryptoOps(logger, performanceClient, cryptoConfig) {\r\n this.logger = logger;\r\n // Browser crypto needs to be validated first before any other classes can be set.\r\n this.browserCrypto = new BrowserCrypto(this.logger, cryptoConfig);\r\n this.b64Encode = new Base64Encode();\r\n this.b64Decode = new Base64Decode();\r\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\r\n this.pkceGenerator = new PkceGenerator(this.browserCrypto);\r\n this.cache = new CryptoKeyStore(this.logger);\r\n this.performanceClient = performanceClient;\r\n }\r\n /**\r\n * Creates a new random GUID - used to populate state and nonce.\r\n * @returns string (GUID)\r\n */\r\n CryptoOps.prototype.createNewGuid = function () {\r\n return this.guidGenerator.generateGuid();\r\n };\r\n /**\r\n * Encodes input string to base64.\r\n * @param input\r\n */\r\n CryptoOps.prototype.base64Encode = function (input) {\r\n return this.b64Encode.encode(input);\r\n };\r\n /**\r\n * Decodes input string from base64.\r\n * @param input\r\n */\r\n CryptoOps.prototype.base64Decode = function (input) {\r\n return this.b64Decode.decode(input);\r\n };\r\n /**\r\n * Generates PKCE codes used in Authorization Code Flow.\r\n */\r\n CryptoOps.prototype.generatePkceCodes = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n return [2 /*return*/, this.pkceGenerator.generateCodes()];\r\n });\r\n });\r\n };\r\n /**\r\n * Generates a keypair, stores it and returns a thumbprint\r\n * @param request\r\n */\r\n CryptoOps.prototype.getPublicKeyThumbprint = function (request) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var publicKeyThumbMeasurement, keyPair, publicKeyJwk, pubKeyThumprintObj, publicJwkString, publicJwkHash, privateKeyJwk, unextractablePrivateKey;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n publicKeyThumbMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);\r\n return [4 /*yield*/, this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES)];\r\n case 1:\r\n keyPair = _b.sent();\r\n return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.publicKey)];\r\n case 2:\r\n publicKeyJwk = _b.sent();\r\n pubKeyThumprintObj = {\r\n e: publicKeyJwk.e,\r\n kty: publicKeyJwk.kty,\r\n n: publicKeyJwk.n\r\n };\r\n publicJwkString = BrowserStringUtils.getSortedObjectString(pubKeyThumprintObj);\r\n return [4 /*yield*/, this.hashString(publicJwkString)];\r\n case 3:\r\n publicJwkHash = _b.sent();\r\n return [4 /*yield*/, this.browserCrypto.exportJwk(keyPair.privateKey)];\r\n case 4:\r\n privateKeyJwk = _b.sent();\r\n return [4 /*yield*/, this.browserCrypto.importJwk(privateKeyJwk, false, [\"sign\"])];\r\n case 5:\r\n unextractablePrivateKey = _b.sent();\r\n // Store Keypair data in keystore\r\n return [4 /*yield*/, this.cache.asymmetricKeys.setItem(publicJwkHash, {\r\n privateKey: unextractablePrivateKey,\r\n publicKey: keyPair.publicKey,\r\n requestMethod: request.resourceRequestMethod,\r\n requestUri: request.resourceRequestUri\r\n })];\r\n case 6:\r\n // Store Keypair data in keystore\r\n _b.sent();\r\n if (publicKeyThumbMeasurement) {\r\n publicKeyThumbMeasurement.endMeasurement({\r\n success: true\r\n });\r\n }\r\n return [2 /*return*/, publicJwkHash];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes cryptographic keypair from key store matching the keyId passed in\r\n * @param kid\r\n */\r\n CryptoOps.prototype.removeTokenBindingKey = function (kid) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var keyFound;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.cache.asymmetricKeys.removeItem(kid)];\r\n case 1:\r\n _a.sent();\r\n return [4 /*yield*/, this.cache.asymmetricKeys.containsKey(kid)];\r\n case 2:\r\n keyFound = _a.sent();\r\n return [2 /*return*/, !keyFound];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Removes all cryptographic keys from IndexedDB storage\r\n */\r\n CryptoOps.prototype.clearKeystore = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.cache.clear()];\r\n case 1: return [2 /*return*/, _a.sent()];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Signs the given object as a jwt payload with private key retrieved by given kid.\r\n * @param payload\r\n * @param kid\r\n */\r\n CryptoOps.prototype.signJwt = function (payload, kid, correlationId) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var signJwtMeasurement, cachedKeyPair, publicKeyJwk, publicKeyJwkString, encodedKeyIdThumbprint, shrHeader, encodedShrHeader, encodedPayload, tokenString, tokenBuffer, signatureBuffer, encodedSignature, signedJwt;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n signJwtMeasurement = (_a = this.performanceClient) === null || _a === void 0 ? void 0 : _a.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);\r\n return [4 /*yield*/, this.cache.asymmetricKeys.getItem(kid)];\r\n case 1:\r\n cachedKeyPair = _b.sent();\r\n if (!cachedKeyPair) {\r\n throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);\r\n }\r\n return [4 /*yield*/, this.browserCrypto.exportJwk(cachedKeyPair.publicKey)];\r\n case 2:\r\n publicKeyJwk = _b.sent();\r\n publicKeyJwkString = BrowserStringUtils.getSortedObjectString(publicKeyJwk);\r\n encodedKeyIdThumbprint = this.b64Encode.urlEncode(JSON.stringify({ kid: kid }));\r\n shrHeader = JoseHeader.getShrHeaderString({ kid: encodedKeyIdThumbprint, alg: publicKeyJwk.alg });\r\n encodedShrHeader = this.b64Encode.urlEncode(shrHeader);\r\n // Generate payload\r\n payload.cnf = {\r\n jwk: JSON.parse(publicKeyJwkString)\r\n };\r\n encodedPayload = this.b64Encode.urlEncode(JSON.stringify(payload));\r\n tokenString = encodedShrHeader + \".\" + encodedPayload;\r\n tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);\r\n return [4 /*yield*/, this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer)];\r\n case 3:\r\n signatureBuffer = _b.sent();\r\n encodedSignature = this.b64Encode.urlEncodeArr(new Uint8Array(signatureBuffer));\r\n signedJwt = tokenString + \".\" + encodedSignature;\r\n if (signJwtMeasurement) {\r\n signJwtMeasurement.endMeasurement({\r\n success: true\r\n });\r\n }\r\n return [2 /*return*/, signedJwt];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Returns the SHA-256 hash of an input string\r\n * @param plainText\r\n */\r\n CryptoOps.prototype.hashString = function (plainText) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var hashBuffer, hashBytes;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.browserCrypto.sha256Digest(plainText)];\r\n case 1:\r\n hashBuffer = _a.sent();\r\n hashBytes = new Uint8Array(hashBuffer);\r\n return [2 /*return*/, this.b64Encode.urlEncodeArr(hashBytes)];\r\n }\r\n });\r\n });\r\n };\r\n CryptoOps.POP_KEY_USAGES = [\"sign\", \"verify\"];\r\n CryptoOps.EXTRACTABLE = true;\r\n return CryptoOps;\r\n}());\n\nexport { CryptoOps };\n//# sourceMappingURL=CryptoOps.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar BrowserPerformanceMeasurement = /** @class */ (function () {\r\n function BrowserPerformanceMeasurement(name, correlationId) {\r\n this.correlationId = correlationId;\r\n this.measureName = BrowserPerformanceMeasurement.makeMeasureName(name, correlationId);\r\n this.startMark = BrowserPerformanceMeasurement.makeStartMark(name, correlationId);\r\n this.endMark = BrowserPerformanceMeasurement.makeEndMark(name, correlationId);\r\n }\r\n BrowserPerformanceMeasurement.makeMeasureName = function (name, correlationId) {\r\n return \"msal.measure.\" + name + \".\" + correlationId;\r\n };\r\n BrowserPerformanceMeasurement.makeStartMark = function (name, correlationId) {\r\n return \"msal.start.\" + name + \".\" + correlationId;\r\n };\r\n BrowserPerformanceMeasurement.makeEndMark = function (name, correlationId) {\r\n return \"msal.end.\" + name + \".\" + correlationId;\r\n };\r\n BrowserPerformanceMeasurement.supportsBrowserPerformance = function () {\r\n return typeof window !== \"undefined\" &&\r\n typeof window.performance !== \"undefined\" &&\r\n typeof window.performance.mark === \"function\" &&\r\n typeof window.performance.measure === \"function\" &&\r\n typeof window.performance.clearMarks === \"function\" &&\r\n typeof window.performance.clearMeasures === \"function\" &&\r\n typeof window.performance.getEntriesByName === \"function\";\r\n };\r\n /**\r\n * Flush browser marks and measurements.\r\n * @param {string} correlationId\r\n * @param {SubMeasurement} measurements\r\n */\r\n BrowserPerformanceMeasurement.flushMeasurements = function (correlationId, measurements) {\r\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\r\n try {\r\n measurements.forEach(function (measurement) {\r\n var measureName = BrowserPerformanceMeasurement.makeMeasureName(measurement.name, correlationId);\r\n var entriesForMeasurement = window.performance.getEntriesByName(measureName, \"measure\");\r\n if (entriesForMeasurement.length > 0) {\r\n window.performance.clearMeasures(measureName);\r\n window.performance.clearMarks(BrowserPerformanceMeasurement.makeStartMark(measureName, correlationId));\r\n window.performance.clearMarks(BrowserPerformanceMeasurement.makeEndMark(measureName, correlationId));\r\n }\r\n });\r\n }\r\n catch (e) {\r\n // Silently catch and return null\r\n }\r\n }\r\n };\r\n BrowserPerformanceMeasurement.prototype.startMeasurement = function () {\r\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\r\n try {\r\n window.performance.mark(this.startMark);\r\n }\r\n catch (e) {\r\n // Silently catch\r\n }\r\n }\r\n };\r\n BrowserPerformanceMeasurement.prototype.endMeasurement = function () {\r\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\r\n try {\r\n window.performance.mark(this.endMark);\r\n window.performance.measure(this.measureName, this.startMark, this.endMark);\r\n }\r\n catch (e) {\r\n // Silently catch\r\n }\r\n }\r\n };\r\n BrowserPerformanceMeasurement.prototype.flushMeasurement = function () {\r\n if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {\r\n try {\r\n var entriesForMeasurement = window.performance.getEntriesByName(this.measureName, \"measure\");\r\n if (entriesForMeasurement.length > 0) {\r\n var durationMs = entriesForMeasurement[0].duration;\r\n window.performance.clearMeasures(this.measureName);\r\n window.performance.clearMarks(this.startMark);\r\n window.performance.clearMarks(this.endMark);\r\n return durationMs;\r\n }\r\n }\r\n catch (e) {\r\n // Silently catch and return null\r\n }\r\n }\r\n return null;\r\n };\r\n return BrowserPerformanceMeasurement;\r\n}());\n\nexport { BrowserPerformanceMeasurement };\n//# sourceMappingURL=BrowserPerformanceMeasurement.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __assign } from '../_virtual/_tslib.js';\nimport { PerformanceClient } from '@azure/msal-common';\nimport { BrowserCrypto } from '../crypto/BrowserCrypto.js';\nimport { GuidGenerator } from '../crypto/GuidGenerator.js';\nimport { BrowserPerformanceMeasurement } from './BrowserPerformanceMeasurement.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar BrowserPerformanceClient = /** @class */ (function (_super) {\r\n __extends(BrowserPerformanceClient, _super);\r\n function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry, cryptoOptions) {\r\n var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;\r\n _this.browserCrypto = new BrowserCrypto(_this.logger, cryptoOptions);\r\n _this.guidGenerator = new GuidGenerator(_this.browserCrypto);\r\n return _this;\r\n }\r\n BrowserPerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {\r\n return new BrowserPerformanceMeasurement(measureName, correlationId);\r\n };\r\n BrowserPerformanceClient.prototype.generateId = function () {\r\n return this.guidGenerator.generateGuid();\r\n };\r\n BrowserPerformanceClient.prototype.getPageVisibility = function () {\r\n var _a;\r\n return ((_a = document.visibilityState) === null || _a === void 0 ? void 0 : _a.toString()) || null;\r\n };\r\n BrowserPerformanceClient.prototype.deleteIncompleteSubMeasurements = function (inProgressEvent) {\r\n var rootEvent = this.eventsByCorrelationId.get(inProgressEvent.event.correlationId);\r\n var isRootEvent = rootEvent && rootEvent.eventId === inProgressEvent.event.eventId;\r\n var incompleteMeasurements = [];\r\n if (isRootEvent && (rootEvent === null || rootEvent === void 0 ? void 0 : rootEvent.incompleteSubMeasurements)) {\r\n rootEvent.incompleteSubMeasurements.forEach(function (subMeasurement) {\r\n incompleteMeasurements.push(__assign({}, subMeasurement));\r\n });\r\n }\r\n // Clean up remaining marks for incomplete sub-measurements\r\n if (incompleteMeasurements.length > 0) {\r\n BrowserPerformanceMeasurement.flushMeasurements(inProgressEvent.event.correlationId, incompleteMeasurements);\r\n }\r\n };\r\n BrowserPerformanceClient.prototype.supportsBrowserPerformanceNow = function () {\r\n return typeof window !== \"undefined\" &&\r\n typeof window.performance !== \"undefined\" &&\r\n typeof window.performance.now === \"function\";\r\n };\r\n /**\r\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\r\n * Also captures browser page visibilityState.\r\n *\r\n * @param {PerformanceEvents} measureName\r\n * @param {?string} [correlationId]\r\n * @returns {((event?: Partial) => PerformanceEvent| null)}\r\n */\r\n BrowserPerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {\r\n var _this = this;\r\n // Capture page visibilityState and then invoke start/end measurement\r\n var startPageVisibility = this.getPageVisibility();\r\n var inProgressEvent = _super.prototype.startMeasurement.call(this, measureName, correlationId);\r\n return __assign(__assign({}, inProgressEvent), { endMeasurement: function (event) {\r\n var res = inProgressEvent.endMeasurement(__assign({ startPageVisibility: startPageVisibility, endPageVisibility: _this.getPageVisibility() }, event));\r\n _this.deleteIncompleteSubMeasurements(inProgressEvent);\r\n return res;\r\n }, discardMeasurement: function () {\r\n inProgressEvent.discardMeasurement();\r\n _this.deleteIncompleteSubMeasurements(inProgressEvent);\r\n inProgressEvent.measurement.flushMeasurement();\r\n } });\r\n };\r\n /**\r\n * Adds pre-queue time to preQueueTimeByCorrelationId map.\r\n * @param {PerformanceEvents} eventName\r\n * @param {?string} correlationId\r\n * @returns\r\n */\r\n BrowserPerformanceClient.prototype.setPreQueueTime = function (eventName, correlationId) {\r\n if (!this.supportsBrowserPerformanceNow()) {\r\n this.logger.trace(\"BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for \" + eventName);\r\n return;\r\n }\r\n if (!correlationId) {\r\n this.logger.trace(\"BrowserPerformanceClient: correlationId for \" + eventName + \" not provided, unable to set telemetry queue time\");\r\n return;\r\n }\r\n var preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);\r\n /**\r\n * Manually complete queue measurement if there is an incomplete pre-queue event.\r\n * Incomplete pre-queue events are instrumentation bugs that should be fixed.\r\n */\r\n if (preQueueEvent) {\r\n this.logger.trace(\"BrowserPerformanceClient: Incomplete pre-queue \" + preQueueEvent.name + \" found\", correlationId);\r\n this.addQueueMeasurement(preQueueEvent.name, correlationId, undefined, true);\r\n }\r\n this.preQueueTimeByCorrelationId.set(correlationId, { name: eventName, time: window.performance.now() });\r\n };\r\n /**\r\n * Calculates and adds queue time measurement for given performance event.\r\n *\r\n * @param {PerformanceEvents} eventName\r\n * @param {?string} correlationId\r\n * @param {?number} queueTime\r\n * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements\r\n * @returns\r\n */\r\n BrowserPerformanceClient.prototype.addQueueMeasurement = function (eventName, correlationId, queueTime, manuallyCompleted) {\r\n if (!this.supportsBrowserPerformanceNow()) {\r\n this.logger.trace(\"BrowserPerformanceClient: window performance API not available, unable to add queue measurement for \" + eventName);\r\n return;\r\n }\r\n if (!correlationId) {\r\n this.logger.trace(\"BrowserPerformanceClient: correlationId for \" + eventName + \" not provided, unable to add queue measurement\");\r\n return;\r\n }\r\n var preQueueTime = _super.prototype.getPreQueueTime.call(this, eventName, correlationId);\r\n if (!preQueueTime) {\r\n return;\r\n }\r\n var currentTime = window.performance.now();\r\n var resQueueTime = queueTime || _super.prototype.calculateQueuedTime.call(this, preQueueTime, currentTime);\r\n return _super.prototype.addQueueMeasurement.call(this, eventName, correlationId, resQueueTime, manuallyCompleted);\r\n };\r\n return BrowserPerformanceClient;\r\n}(PerformanceClient));\n\nexport { BrowserPerformanceClient };\n//# sourceMappingURL=BrowserPerformanceClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { AuthToken, CacheRecord, Authority, AccountEntity, IdTokenEntity, ScopeSet, AccessTokenEntity, RefreshTokenEntity, Constants } from '@azure/msal-common';\nimport { BrowserAuthError } from '../error/BrowserAuthError.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 * Token cache manager\r\n */\r\nvar TokenCache = /** @class */ (function () {\r\n function TokenCache(configuration, storage, logger, cryptoObj) {\r\n this.isBrowserEnvironment = typeof window !== \"undefined\";\r\n this.config = configuration;\r\n this.storage = storage;\r\n this.logger = logger;\r\n this.cryptoObj = cryptoObj;\r\n }\r\n // Move getAllAccounts here and cache utility APIs\r\n /**\r\n * API to load tokens to msal-browser cache.\r\n * @param request\r\n * @param response\r\n * @param options\r\n * @returns `AuthenticationResult` for the response that was loaded.\r\n */\r\n TokenCache.prototype.loadExternalTokens = function (request, response, options) {\r\n this.logger.info(\"TokenCache - loadExternalTokens called\");\r\n if (!response.id_token) {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes id token.\");\r\n }\r\n var idToken = new AuthToken(response.id_token, this.cryptoObj);\r\n var cacheRecord;\r\n var authority;\r\n if (request.account) {\r\n var cacheRecordAccount = this.loadAccount(idToken, request.account.environment, undefined, undefined, request.account.homeAccountId);\r\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment));\r\n }\r\n else if (request.authority) {\r\n var authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);\r\n var authorityOptions = {\r\n protocolMode: this.config.auth.protocolMode,\r\n knownAuthorities: this.config.auth.knownAuthorities,\r\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\r\n authorityMetadata: this.config.auth.authorityMetadata,\r\n skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\r\n };\r\n authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.logger);\r\n // \"clientInfo\" from options takes precedence over \"clientInfo\" in response\r\n if (options.clientInfo) {\r\n this.logger.trace(\"TokenCache - homeAccountId from options\");\r\n var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, options.clientInfo, authority.authorityType);\r\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));\r\n }\r\n else if (response.client_info) {\r\n this.logger.trace(\"TokenCache - homeAccountId from response\");\r\n var cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, response.client_info, authority.authorityType);\r\n cacheRecord = new CacheRecord(cacheRecordAccount, this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant), this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options), this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort));\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide clientInfo in the response or options.\");\r\n }\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide a request with an account or a request with authority.\");\r\n }\r\n return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);\r\n };\r\n /**\r\n * Helper function to load account to msal-browser cache\r\n * @param idToken\r\n * @param environment\r\n * @param clientInfo\r\n * @param authorityType\r\n * @param requestHomeAccountId\r\n * @returns `AccountEntity`\r\n */\r\n TokenCache.prototype.loadAccount = function (idToken, environment, clientInfo, authorityType, requestHomeAccountId) {\r\n var homeAccountId;\r\n if (requestHomeAccountId) {\r\n homeAccountId = requestHomeAccountId;\r\n }\r\n else if (authorityType !== undefined && clientInfo) {\r\n homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);\r\n }\r\n if (!homeAccountId) {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Unexpected missing homeAccountId\");\r\n }\r\n var accountEntity = clientInfo ?\r\n AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :\r\n AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);\r\n if (this.isBrowserEnvironment) {\r\n this.logger.verbose(\"TokenCache - loading account\");\r\n this.storage.setAccount(accountEntity);\r\n return accountEntity;\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\r\n }\r\n };\r\n /**\r\n * Helper function to load id tokens to msal-browser cache\r\n * @param idToken\r\n * @param homeAccountId\r\n * @param environment\r\n * @param tenantId\r\n * @returns `IdTokenEntity`\r\n */\r\n TokenCache.prototype.loadIdToken = function (idToken, homeAccountId, environment, tenantId) {\r\n var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);\r\n if (this.isBrowserEnvironment) {\r\n this.logger.verbose(\"TokenCache - loading id token\");\r\n this.storage.setIdTokenCredential(idTokenEntity);\r\n return idTokenEntity;\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\r\n }\r\n };\r\n /**\r\n * Helper function to load access tokens to msal-browser cache\r\n * @param request\r\n * @param response\r\n * @param homeAccountId\r\n * @param environment\r\n * @param tenantId\r\n * @returns `AccessTokenEntity`\r\n */\r\n TokenCache.prototype.loadAccessToken = function (request, response, homeAccountId, environment, tenantId, options) {\r\n if (!response.access_token) {\r\n this.logger.verbose(\"TokenCache - No access token provided for caching\");\r\n return null;\r\n }\r\n if (!response.expires_in) {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes expires_in value.\");\r\n }\r\n if (!options.extendedExpiresOn) {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide an extendedExpiresOn value in the options.\");\r\n }\r\n var scopes = new ScopeSet(request.scopes).printScopes();\r\n var expiresOn = options.expiresOn || (response.expires_in + new Date().getTime() / 1000);\r\n var extendedExpiresOn = options.extendedExpiresOn;\r\n var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, this.cryptoObj);\r\n if (this.isBrowserEnvironment) {\r\n this.logger.verbose(\"TokenCache - loading access token\");\r\n this.storage.setAccessTokenCredential(accessTokenEntity);\r\n return accessTokenEntity;\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\r\n }\r\n };\r\n /**\r\n * Helper function to load refresh tokens to msal-browser cache\r\n * @param request\r\n * @param response\r\n * @param homeAccountId\r\n * @param environment\r\n * @returns `RefreshTokenEntity`\r\n */\r\n TokenCache.prototype.loadRefreshToken = function (request, response, homeAccountId, environment) {\r\n if (!response.refresh_token) {\r\n this.logger.verbose(\"TokenCache - No refresh token provided for caching\");\r\n return null;\r\n }\r\n var refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);\r\n if (this.isBrowserEnvironment) {\r\n this.logger.verbose(\"TokenCache - loading refresh token\");\r\n this.storage.setRefreshTokenCredential(refreshTokenEntity);\r\n return refreshTokenEntity;\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\r\n }\r\n };\r\n /**\r\n * Helper function to generate an `AuthenticationResult` for the result.\r\n * @param request\r\n * @param idTokenObj\r\n * @param cacheRecord\r\n * @param authority\r\n * @returns `AuthenticationResult`\r\n */\r\n TokenCache.prototype.generateAuthenticationResult = function (request, idTokenObj, cacheRecord, authority) {\r\n var _a, _b, _c;\r\n var accessToken = Constants.EMPTY_STRING;\r\n var responseScopes = [];\r\n var expiresOn = null;\r\n var extExpiresOn;\r\n if (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) {\r\n accessToken = cacheRecord.accessToken.secret;\r\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\r\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\r\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\r\n }\r\n var uid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.oid) || (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.sub) || Constants.EMPTY_STRING;\r\n var tid = (idTokenObj === null || idTokenObj === void 0 ? void 0 : idTokenObj.claims.tid) || Constants.EMPTY_STRING;\r\n return {\r\n authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,\r\n uniqueId: uid,\r\n tenantId: tid,\r\n scopes: responseScopes,\r\n account: (cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) ? cacheRecord.account.getAccountInfo() : null,\r\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\r\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\r\n accessToken: accessToken,\r\n fromCache: true,\r\n expiresOn: expiresOn,\r\n correlationId: request.correlationId || Constants.EMPTY_STRING,\r\n requestId: Constants.EMPTY_STRING,\r\n extExpiresOn: extExpiresOn,\r\n familyId: Constants.EMPTY_STRING,\r\n tokenType: ((_a = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.accessToken) === null || _a === void 0 ? void 0 : _a.tokenType) || Constants.EMPTY_STRING,\r\n state: Constants.EMPTY_STRING,\r\n cloudGraphHostName: ((_b = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _b === void 0 ? void 0 : _b.cloudGraphHostName) || Constants.EMPTY_STRING,\r\n msGraphHost: ((_c = cacheRecord === null || cacheRecord === void 0 ? void 0 : cacheRecord.account) === null || _c === void 0 ? void 0 : _c.msGraphHost) || Constants.EMPTY_STRING,\r\n code: undefined,\r\n fromNativeBroker: false\r\n };\r\n };\r\n return TokenCache;\r\n}());\n\nexport { TokenCache };\n//# sourceMappingURL=TokenCache.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends } from '../_virtual/_tslib.js';\nimport { AuthorizationCodeClient } from '@azure/msal-common';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar HybridSpaAuthorizationCodeClient = /** @class */ (function (_super) {\r\n __extends(HybridSpaAuthorizationCodeClient, _super);\r\n function HybridSpaAuthorizationCodeClient(config) {\r\n var _this = _super.call(this, config) || this;\r\n _this.includeRedirectUri = false;\r\n return _this;\r\n }\r\n return HybridSpaAuthorizationCodeClient;\r\n}(AuthorizationCodeClient));\n\nexport { HybridSpaAuthorizationCodeClient };\n//# sourceMappingURL=HybridSpaAuthorizationCodeClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { AuthError, PerformanceEvents, Constants } from '@azure/msal-common';\nimport { StandardInteractionClient } from './StandardInteractionClient.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { InteractionType } from '../utils/BrowserConstants.js';\nimport { SilentHandler } from '../interaction_handler/SilentHandler.js';\nimport { HybridSpaAuthorizationCodeClient } from './HybridSpaAuthorizationCodeClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar SilentAuthCodeClient = /** @class */ (function (_super) {\r\n __extends(SilentAuthCodeClient, _super);\r\n function SilentAuthCodeClient(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeMessageHandler, correlationId) {\r\n var _this = _super.call(this, config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) || this;\r\n _this.apiId = apiId;\r\n return _this;\r\n }\r\n /**\r\n * Acquires a token silently by redeeming an authorization code against the /token endpoint\r\n * @param request\r\n */\r\n SilentAuthCodeClient.prototype.acquireToken = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var silentRequest, serverTelemetryManager, authCodeRequest, clientConfig, authClient, silentHandler, e_1;\r\n return __generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.trace(\"SilentAuthCodeClient.acquireToken called\");\r\n // Auth code payload is required\r\n if (!request.code) {\r\n throw BrowserAuthError.createAuthCodeRequiredError();\r\n }\r\n // Create silent request\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, request.correlationId);\r\n return [4 /*yield*/, this.initializeAuthorizationRequest(request, InteractionType.Silent)];\r\n case 1:\r\n silentRequest = _a.sent();\r\n this.browserStorage.updateCacheEntries(silentRequest.state, silentRequest.nonce, silentRequest.authority, silentRequest.loginHint || Constants.EMPTY_STRING, silentRequest.account || null);\r\n serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);\r\n _a.label = 2;\r\n case 2:\r\n _a.trys.push([2, 4, , 5]);\r\n authCodeRequest = __assign(__assign({}, silentRequest), { code: request.code });\r\n // Initialize the client\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.StandardInteractionClientGetClientConfiguration, request.correlationId);\r\n return [4 /*yield*/, this.getClientConfiguration(serverTelemetryManager, silentRequest.authority)];\r\n case 3:\r\n clientConfig = _a.sent();\r\n authClient = new HybridSpaAuthorizationCodeClient(clientConfig);\r\n this.logger.verbose(\"Auth code client created\");\r\n silentHandler = new SilentHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.config.system, this.performanceClient);\r\n // Handle auth code parameters from request\r\n return [2 /*return*/, silentHandler.handleCodeResponseFromServer({\r\n code: request.code,\r\n msgraph_host: request.msGraphHost,\r\n cloud_graph_host_name: request.cloudGraphHostName,\r\n cloud_instance_host_name: request.cloudInstanceHostName\r\n }, silentRequest.state, authClient.authority, this.networkClient, false)];\r\n case 4:\r\n e_1 = _a.sent();\r\n if (e_1 instanceof AuthError) {\r\n e_1.setCorrelationId(this.correlationId);\r\n }\r\n serverTelemetryManager.cacheFailedRequest(e_1);\r\n this.browserStorage.cleanRequestByState(silentRequest.state);\r\n throw e_1;\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Currently Unsupported\r\n */\r\n SilentAuthCodeClient.prototype.logout = function () {\r\n // Synchronous so we must reject\r\n return Promise.reject(BrowserAuthError.createSilentLogoutUnsupportedError());\r\n };\r\n return SilentAuthCodeClient;\r\n}(StandardInteractionClient));\n\nexport { SilentAuthCodeClient };\n//# sourceMappingURL=SilentAuthCodeClient.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { CryptoOps } from '../crypto/CryptoOps.js';\nimport { PerformanceEvents, Constants, InteractionRequiredAuthError, AuthError, ClientAuthError, PromptValue, Logger, StubPerformanceClient, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from '../cache/BrowserCacheManager.js';\nimport { buildConfiguration } from '../config/Configuration.js';\nimport { InteractionType, ApiId, TemporaryCacheKeys, CacheLookupPolicy, BrowserCacheLocation } from '../utils/BrowserConstants.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.js';\nimport { name, version } from '../packageMetadata.js';\nimport { EventType } from '../event/EventType.js';\nimport { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';\nimport { EventHandler } from '../event/EventHandler.js';\nimport { PopupClient } from '../interaction_client/PopupClient.js';\nimport { RedirectClient } from '../interaction_client/RedirectClient.js';\nimport { SilentIframeClient } from '../interaction_client/SilentIframeClient.js';\nimport { SilentRefreshClient } from '../interaction_client/SilentRefreshClient.js';\nimport { TokenCache } from '../cache/TokenCache.js';\nimport { NativeInteractionClient } from '../interaction_client/NativeInteractionClient.js';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';\nimport { NativeAuthError } from '../error/NativeAuthError.js';\nimport { SilentCacheClient } from '../interaction_client/SilentCacheClient.js';\nimport { SilentAuthCodeClient } from '../interaction_client/SilentAuthCodeClient.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { BrowserPerformanceClient } from '../telemetry/BrowserPerformanceClient.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar ClientApplication = /** @class */ (function () {\r\n /**\r\n * @constructor\r\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\r\n * - authority: the authority URL for your application.\r\n * - redirect_uri: the uri of your application registered in the portal.\r\n *\r\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\r\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\r\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\r\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\r\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\r\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\r\n *\r\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\r\n * Full B2C functionality will be available in this library in future versions.\r\n *\r\n * @param configuration Object for the MSAL PublicClientApplication instance\r\n */\r\n function ClientApplication(configuration) {\r\n /*\r\n * If loaded in an environment where window is not available,\r\n * set internal flag to false so that further requests fail.\r\n * This is to support server-side rendering environments.\r\n */\r\n this.isBrowserEnvironment = typeof window !== \"undefined\";\r\n // Set the configuration.\r\n this.config = buildConfiguration(configuration, this.isBrowserEnvironment);\r\n this.initialized = false;\r\n // Initialize logger\r\n this.logger = new Logger(this.config.system.loggerOptions, name, version);\r\n // Initialize the network module class.\r\n this.networkClient = this.config.system.networkClient;\r\n // Initialize the navigation client class.\r\n this.navigationClient = this.config.system.navigationClient;\r\n // Initialize redirectResponse Map\r\n this.redirectResponse = new Map();\r\n // Initial hybrid spa map\r\n this.hybridAuthCodeResponses = new Map();\r\n // Initialize performance client\r\n this.performanceClient = this.isBrowserEnvironment ?\r\n new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application, this.config.system.cryptoOptions) :\r\n new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);\r\n // Initialize the crypto class.\r\n this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger, this.performanceClient, this.config.system.cryptoOptions) : DEFAULT_CRYPTO_IMPLEMENTATION;\r\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\r\n // Initialize the browser storage class.\r\n this.browserStorage = this.isBrowserEnvironment ?\r\n new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) :\r\n DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\r\n // initialize in memory storage for native flows\r\n var nativeCacheOptions = {\r\n cacheLocation: BrowserCacheLocation.MemoryStorage,\r\n temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,\r\n storeAuthStateInCookie: false,\r\n secureCookies: false,\r\n cacheMigrationEnabled: false\r\n };\r\n this.nativeInternalStorage = new BrowserCacheManager(this.config.auth.clientId, nativeCacheOptions, this.browserCrypto, this.logger);\r\n // Initialize the token cache\r\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\r\n // Register listener functions\r\n this.trackPageVisibilityWithMeasurement = this.trackPageVisibilityWithMeasurement.bind(this);\r\n }\r\n /**\r\n * Initializer function to perform async startup tasks such as connecting to WAM extension\r\n */\r\n ClientApplication.prototype.initialize = function () {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var allowNativeBroker, initMeasurement, _a, e_1;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.logger.trace(\"initialize called\");\r\n if (this.initialized) {\r\n this.logger.info(\"initialize has already been called, exiting early.\");\r\n return [2 /*return*/];\r\n }\r\n allowNativeBroker = this.config.system.allowNativeBroker;\r\n initMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.InitializeClientApplication);\r\n this.eventHandler.emitEvent(EventType.INITIALIZE_START);\r\n if (!allowNativeBroker) return [3 /*break*/, 4];\r\n _b.label = 1;\r\n case 1:\r\n _b.trys.push([1, 3, , 4]);\r\n _a = this;\r\n return [4 /*yield*/, NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout, this.performanceClient)];\r\n case 2:\r\n _a.nativeExtensionProvider = _b.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n e_1 = _b.sent();\r\n this.logger.verbose(e_1);\r\n return [3 /*break*/, 4];\r\n case 4:\r\n this.initialized = true;\r\n this.eventHandler.emitEvent(EventType.INITIALIZE_END);\r\n initMeasurement.endMeasurement({ allowNativeBroker: allowNativeBroker, success: true });\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // #region Redirect Flow\r\n /**\r\n * Event handler function which allows users to fire events after the PublicClientApplication object\r\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\r\n * auth flows.\r\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\r\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\r\n */\r\n ClientApplication.prototype.handleRedirectPromise = function (hash) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var loggedInAccounts, redirectResponseKey, response, request, redirectResponse, nativeClient, correlationId, redirectClient;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n this.logger.verbose(\"handleRedirectPromise called\");\r\n // Block token acquisition before initialize has been called if native brokering is enabled\r\n BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);\r\n loggedInAccounts = this.getAllAccounts();\r\n if (this.isBrowserEnvironment) {\r\n redirectResponseKey = hash || Constants.EMPTY_STRING;\r\n response = this.redirectResponse.get(redirectResponseKey);\r\n if (typeof response === \"undefined\") {\r\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\r\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\r\n request = this.browserStorage.getCachedNativeRequest();\r\n redirectResponse = void 0;\r\n if (request && NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) && this.nativeExtensionProvider && !hash) {\r\n this.logger.trace(\"handleRedirectPromise - acquiring token from native platform\");\r\n nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, this.nativeInternalStorage, request.correlationId);\r\n redirectResponse = nativeClient.handleRedirectPromise();\r\n }\r\n else {\r\n this.logger.trace(\"handleRedirectPromise - acquiring token from web flow\");\r\n correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || Constants.EMPTY_STRING;\r\n redirectClient = this.createRedirectClient(correlationId);\r\n redirectResponse = redirectClient.handleRedirectPromise(hash);\r\n }\r\n response = redirectResponse.then(function (result) {\r\n if (result) {\r\n // Emit login event if number of accounts change\r\n var isLoggingIn = loggedInAccounts.length < _this.getAllAccounts().length;\r\n if (isLoggingIn) {\r\n _this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\r\n _this.logger.verbose(\"handleRedirectResponse returned result, login success\");\r\n }\r\n else {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\r\n _this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\r\n }\r\n }\r\n _this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\r\n return result;\r\n }).catch(function (e) {\r\n // Emit login event if there is an account\r\n if (loggedInAccounts.length > 0) {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n else {\r\n _this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n _this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\r\n throw e;\r\n });\r\n this.redirectResponse.set(redirectResponseKey, response);\r\n }\r\n else {\r\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\r\n }\r\n return [2 /*return*/, response];\r\n }\r\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\r\n return [2 /*return*/, null];\r\n });\r\n });\r\n };\r\n /**\r\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\r\n * the page, so any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n ClientApplication.prototype.acquireTokenRedirect = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, isLoggedIn, result, nativeClient, redirectClient;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"acquireTokenRedirect called\", correlationId);\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\r\n isLoggedIn = this.getAllAccounts().length > 0;\r\n if (isLoggedIn) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\r\n }\r\n if (this.nativeExtensionProvider && this.canUseNative(request)) {\r\n nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);\r\n result = nativeClient.acquireTokenRedirect(request).catch(function (e) {\r\n if (e instanceof NativeAuthError && e.isFatal()) {\r\n _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n var redirectClient = _this.createRedirectClient(request.correlationId);\r\n return redirectClient.acquireToken(request);\r\n }\r\n else if (e instanceof InteractionRequiredAuthError) {\r\n _this.logger.verbose(\"acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow\");\r\n var redirectClient = _this.createRedirectClient(request.correlationId);\r\n return redirectClient.acquireToken(request);\r\n }\r\n _this.browserStorage.setInteractionInProgress(false);\r\n throw e;\r\n });\r\n }\r\n else {\r\n redirectClient = this.createRedirectClient(request.correlationId);\r\n result = redirectClient.acquireToken(request);\r\n }\r\n return [2 /*return*/, result.catch(function (e) {\r\n // If logged in, emit acquire token events\r\n if (isLoggedIn) {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n else {\r\n _this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\r\n }\r\n throw e;\r\n })];\r\n });\r\n });\r\n };\r\n // #endregion\r\n // #region Popup Flow\r\n /**\r\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n ClientApplication.prototype.acquireTokenPopup = function (request) {\r\n var _this = this;\r\n var correlationId = this.getRequestCorrelationId(request);\r\n var atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);\r\n try {\r\n this.logger.verbose(\"acquireTokenPopup called\", correlationId);\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\r\n }\r\n catch (e) {\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n // If logged in, emit acquire token events\r\n var loggedInAccounts = this.getAllAccounts();\r\n if (loggedInAccounts.length > 0) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\r\n }\r\n else {\r\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\r\n }\r\n var result;\r\n if (this.canUseNative(request)) {\r\n result = this.acquireTokenNative(request, ApiId.acquireTokenPopup).then(function (response) {\r\n _this.browserStorage.setInteractionInProgress(false);\r\n atPopupMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: true,\r\n requestId: response.requestId\r\n });\r\n return response;\r\n }).catch(function (e) {\r\n if (e instanceof NativeAuthError && e.isFatal()) {\r\n _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n var popupClient = _this.createPopupClient(request.correlationId);\r\n return popupClient.acquireToken(request);\r\n }\r\n else if (e instanceof InteractionRequiredAuthError) {\r\n _this.logger.verbose(\"acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow\");\r\n var popupClient = _this.createPopupClient(request.correlationId);\r\n return popupClient.acquireToken(request);\r\n }\r\n _this.browserStorage.setInteractionInProgress(false);\r\n throw e;\r\n });\r\n }\r\n else {\r\n var popupClient = this.createPopupClient(request.correlationId);\r\n result = popupClient.acquireToken(request);\r\n }\r\n return result.then(function (result) {\r\n /*\r\n * If logged in, emit acquire token events\r\n */\r\n var isLoggingIn = loggedInAccounts.length < _this.getAllAccounts().length;\r\n if (isLoggingIn) {\r\n _this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\r\n }\r\n else {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\r\n }\r\n atPopupMeasurement.addStaticFields({\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length\r\n });\r\n atPopupMeasurement.endMeasurement({\r\n success: true,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n }).catch(function (e) {\r\n if (loggedInAccounts.length > 0) {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\r\n }\r\n else {\r\n _this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\r\n }\r\n atPopupMeasurement.endMeasurement({\r\n errorCode: e.errorCode,\r\n subErrorCode: e.subError,\r\n success: false\r\n });\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n });\r\n };\r\n ClientApplication.prototype.trackPageVisibilityWithMeasurement = function () {\r\n var measurement = this.ssoSilentMeasurement || this.acquireTokenByCodeAsyncMeasurement;\r\n if (!measurement) {\r\n return;\r\n }\r\n this.logger.info(\"Perf: Visibility change detected in \", measurement.event.name);\r\n measurement.increment({\r\n visibilityChangeCount: 1,\r\n });\r\n };\r\n // #endregion\r\n // #region Silent Flow\r\n /**\r\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\r\n * - Any browser using a form of Intelligent Tracking Prevention\r\n * - If there is not an established session with the service\r\n *\r\n * In these cases, the request must be done inside a popup or full frame redirect.\r\n *\r\n * For the cases where interaction is required, you cannot send a request with prompt=none.\r\n *\r\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\r\n * you session on the server still exists.\r\n * @param request {@link SsoSilentRequest}\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n ClientApplication.prototype.ssoSilent = function (request) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, validRequest, result, silentIframeClient;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n correlationId = this.getRequestCorrelationId(request);\r\n validRequest = __assign(__assign({}, request), { \r\n // will be PromptValue.NONE or PromptValue.NO_SESSION\r\n prompt: request.prompt, correlationId: correlationId });\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\r\n this.ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);\r\n (_a = this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.increment({\r\n visibilityChangeCount: 0\r\n });\r\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n this.logger.verbose(\"ssoSilent called\", correlationId);\r\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, validRequest);\r\n if (this.canUseNative(validRequest)) {\r\n result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch(function (e) {\r\n // If native token acquisition fails for availability reasons fallback to standard flow\r\n if (e instanceof NativeAuthError && e.isFatal()) {\r\n _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n var silentIframeClient = _this.createSilentIframeClient(validRequest.correlationId);\r\n return silentIframeClient.acquireToken(validRequest);\r\n }\r\n throw e;\r\n });\r\n }\r\n else {\r\n silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\r\n result = silentIframeClient.acquireToken(validRequest);\r\n }\r\n return [2 /*return*/, result.then(function (response) {\r\n var _a, _b;\r\n _this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);\r\n (_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.addStaticFields({\r\n accessTokenSize: response.accessToken.length,\r\n idTokenSize: response.idToken.length\r\n });\r\n (_b = _this.ssoSilentMeasurement) === null || _b === void 0 ? void 0 : _b.endMeasurement({\r\n success: true,\r\n isNativeBroker: response.fromNativeBroker,\r\n requestId: response.requestId\r\n });\r\n return response;\r\n }).catch(function (e) {\r\n var _a;\r\n _this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\r\n (_a = _this.ssoSilentMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({\r\n errorCode: e.errorCode,\r\n subErrorCode: e.subError,\r\n success: false\r\n });\r\n throw e;\r\n }).finally(function () {\r\n document.removeEventListener(\"visibilitychange\", _this.trackPageVisibilityWithMeasurement);\r\n })];\r\n });\r\n });\r\n };\r\n /**\r\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\r\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\r\n * This API is not indended for normal authorization code acquisition and redemption.\r\n *\r\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\r\n *\r\n * @param request {@link AuthorizationCodeRequest}\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n ClientApplication.prototype.acquireTokenByCode = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, atbcMeasurement, hybridAuthCode_1, response;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(request);\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\r\n this.logger.trace(\"acquireTokenByCode called\", correlationId);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\r\n atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, request.correlationId);\r\n try {\r\n if (request.code && request.nativeAccountId) {\r\n // Throw error in case server returns both spa_code and spa_accountid in exchange for auth code.\r\n throw BrowserAuthError.createSpaCodeAndNativeAccountIdPresentError();\r\n }\r\n else if (request.code) {\r\n hybridAuthCode_1 = request.code;\r\n response = this.hybridAuthCodeResponses.get(hybridAuthCode_1);\r\n if (!response) {\r\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", correlationId);\r\n response = this.acquireTokenByCodeAsync(__assign(__assign({}, request), { correlationId: correlationId }))\r\n .then(function (result) {\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\r\n _this.hybridAuthCodeResponses.delete(hybridAuthCode_1);\r\n atbcMeasurement.addStaticFields({\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length\r\n });\r\n atbcMeasurement.endMeasurement({\r\n success: true,\r\n isNativeBroker: result.fromNativeBroker,\r\n requestId: result.requestId\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n _this.hybridAuthCodeResponses.delete(hybridAuthCode_1);\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, error);\r\n atbcMeasurement.endMeasurement({\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n success: false\r\n });\r\n throw error;\r\n });\r\n this.hybridAuthCodeResponses.set(hybridAuthCode_1, response);\r\n }\r\n else {\r\n this.logger.verbose(\"Existing acquireTokenByCode request found\", request.correlationId);\r\n atbcMeasurement.discardMeasurement();\r\n }\r\n return [2 /*return*/, response];\r\n }\r\n else if (request.nativeAccountId) {\r\n if (this.canUseNative(request, request.nativeAccountId)) {\r\n return [2 /*return*/, this.acquireTokenNative(request, ApiId.acquireTokenByCode, request.nativeAccountId).catch(function (e) {\r\n // If native token acquisition fails for availability reasons fallback to standard flow\r\n if (e instanceof NativeAuthError && e.isFatal()) {\r\n _this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\r\n }\r\n throw e;\r\n })];\r\n }\r\n else {\r\n throw BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError();\r\n }\r\n }\r\n else {\r\n throw BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError();\r\n }\r\n }\r\n catch (e) {\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\r\n atbcMeasurement.endMeasurement({\r\n errorCode: e instanceof AuthError && e.errorCode || undefined,\r\n subErrorCode: e instanceof AuthError && e.subError || undefined,\r\n success: false\r\n });\r\n throw e;\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Creates a SilentAuthCodeClient to redeem an authorization code.\r\n * @param request\r\n * @returns Result of the operation to redeem the authorization code\r\n */\r\n ClientApplication.prototype.acquireTokenByCodeAsync = function (request) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var silentAuthCodeClient, silentTokenResult;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\r\n this.acquireTokenByCodeAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCodeAsync, request.correlationId);\r\n (_a = this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.increment({\r\n visibilityChangeCount: 0\r\n });\r\n document.addEventListener(\"visibilitychange\", this.trackPageVisibilityWithMeasurement);\r\n silentAuthCodeClient = this.createSilentAuthCodeClient(request.correlationId);\r\n return [4 /*yield*/, silentAuthCodeClient.acquireToken(request).then(function (response) {\r\n var _a;\r\n (_a = _this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({\r\n success: true,\r\n fromCache: response.fromCache,\r\n isNativeBroker: response.fromNativeBroker,\r\n requestId: response.requestId\r\n });\r\n return response;\r\n }).catch(function (tokenRenewalError) {\r\n var _a;\r\n (_a = _this.acquireTokenByCodeAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({\r\n errorCode: tokenRenewalError.errorCode,\r\n subErrorCode: tokenRenewalError.subError,\r\n success: false\r\n });\r\n throw tokenRenewalError;\r\n }).finally(function () {\r\n document.removeEventListener(\"visibilitychange\", _this.trackPageVisibilityWithMeasurement);\r\n })];\r\n case 1:\r\n silentTokenResult = _b.sent();\r\n return [2 /*return*/, silentTokenResult];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Attempt to acquire an access token from the cache\r\n * @param silentCacheClient SilentCacheClient\r\n * @param commonRequest CommonSilentFlowRequest\r\n * @param silentRequest SilentRequest\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n ClientApplication.prototype.acquireTokenFromCache = function (silentCacheClient, commonRequest, silentRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n return __generator(this, function (_a) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenFromCache, commonRequest.correlationId);\r\n switch (silentRequest.cacheLookupPolicy) {\r\n case CacheLookupPolicy.Default:\r\n case CacheLookupPolicy.AccessToken:\r\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\r\n return [2 /*return*/, silentCacheClient.acquireToken(commonRequest)];\r\n default:\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Attempt to acquire an access token via a refresh token\r\n * @param commonRequest CommonSilentFlowRequest\r\n * @param silentRequest SilentRequest\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n ClientApplication.prototype.acquireTokenByRefreshToken = function (commonRequest, silentRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var silentRefreshClient;\r\n return __generator(this, function (_a) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, commonRequest.correlationId);\r\n switch (silentRequest.cacheLookupPolicy) {\r\n case CacheLookupPolicy.Default:\r\n case CacheLookupPolicy.AccessTokenAndRefreshToken:\r\n case CacheLookupPolicy.RefreshToken:\r\n case CacheLookupPolicy.RefreshTokenAndNetwork:\r\n silentRefreshClient = this.createSilentRefreshClient(commonRequest.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentRefreshClientAcquireToken, commonRequest.correlationId);\r\n return [2 /*return*/, silentRefreshClient.acquireToken(commonRequest)];\r\n default:\r\n throw ClientAuthError.createRefreshRequiredError();\r\n }\r\n return [2 /*return*/];\r\n });\r\n });\r\n };\r\n /**\r\n * Attempt to acquire an access token via an iframe\r\n * @param request CommonSilentFlowRequest\r\n * @returns A promise that, when resolved, returns the access token\r\n */\r\n ClientApplication.prototype.acquireTokenBySilentIframe = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var silentIframeClient;\r\n return __generator(this, function (_a) {\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenBySilentIframe, request.correlationId);\r\n silentIframeClient = this.createSilentIframeClient(request.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.SilentIframeClientAcquireToken, request.correlationId);\r\n return [2 /*return*/, silentIframeClient.acquireToken(request)];\r\n });\r\n });\r\n };\r\n // #endregion\r\n // #region Logout\r\n /**\r\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\r\n * @param logoutRequest\r\n * @deprecated\r\n */\r\n ClientApplication.prototype.logout = function (logoutRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(logoutRequest);\r\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\", correlationId);\r\n return [2 /*return*/, this.logoutRedirect(__assign({ correlationId: correlationId }, logoutRequest))];\r\n });\r\n });\r\n };\r\n /**\r\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\r\n * Default behaviour is to redirect the user to `window.location.href`.\r\n * @param logoutRequest\r\n */\r\n ClientApplication.prototype.logoutRedirect = function (logoutRequest) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, redirectClient;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(logoutRequest);\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\r\n redirectClient = this.createRedirectClient(correlationId);\r\n return [2 /*return*/, redirectClient.logout(logoutRequest)];\r\n });\r\n });\r\n };\r\n /**\r\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\r\n * @param logoutRequest\r\n */\r\n ClientApplication.prototype.logoutPopup = function (logoutRequest) {\r\n try {\r\n var correlationId = this.getRequestCorrelationId(logoutRequest);\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\r\n var popupClient = this.createPopupClient(correlationId);\r\n return popupClient.logout(logoutRequest);\r\n }\r\n catch (e) {\r\n // Since this function is syncronous we need to reject\r\n return Promise.reject(e);\r\n }\r\n };\r\n // #endregion\r\n // #region Account APIs\r\n /**\r\n * Returns all accounts that MSAL currently has data for.\r\n * (the account object is created at the time of successful login)\r\n * or empty array when no accounts are found\r\n * @returns Array of account objects in cache\r\n */\r\n ClientApplication.prototype.getAllAccounts = function () {\r\n this.logger.verbose(\"getAllAccounts called\");\r\n return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];\r\n };\r\n /**\r\n * Returns the signed in account matching username.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found.\r\n * This API is provided for convenience but getAccountById should be used for best reliability\r\n * @param username\r\n * @returns The account object stored in MSAL\r\n */\r\n ClientApplication.prototype.getAccountByUsername = function (username) {\r\n this.logger.trace(\"getAccountByUsername called\");\r\n if (!username) {\r\n this.logger.warning(\"getAccountByUsername: No username provided\");\r\n return null;\r\n }\r\n var account = this.browserStorage.getAccountInfoFilteredBy({ username: username });\r\n if (account) {\r\n this.logger.verbose(\"getAccountByUsername: Account matching username found, returning\");\r\n this.logger.verbosePii(\"getAccountByUsername: Returning signed-in accounts matching username: \" + username);\r\n return account;\r\n }\r\n else {\r\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\r\n return null;\r\n }\r\n };\r\n /**\r\n * Returns the signed in account matching homeAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param homeAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\n ClientApplication.prototype.getAccountByHomeId = function (homeAccountId) {\r\n this.logger.trace(\"getAccountByHomeId called\");\r\n if (!homeAccountId) {\r\n this.logger.warning(\"getAccountByHomeId: No homeAccountId provided\");\r\n return null;\r\n }\r\n var account = this.browserStorage.getAccountInfoFilteredBy({ homeAccountId: homeAccountId });\r\n if (account) {\r\n this.logger.verbose(\"getAccountByHomeId: Account matching homeAccountId found, returning\");\r\n this.logger.verbosePii(\"getAccountByHomeId: Returning signed-in accounts matching homeAccountId: \" + homeAccountId);\r\n return account;\r\n }\r\n else {\r\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\r\n return null;\r\n }\r\n };\r\n /**\r\n * Returns the signed in account matching localAccountId.\r\n * (the account object is created at the time of successful login)\r\n * or null when no matching account is found\r\n * @param localAccountId\r\n * @returns The account object stored in MSAL\r\n */\r\n ClientApplication.prototype.getAccountByLocalId = function (localAccountId) {\r\n this.logger.trace(\"getAccountByLocalId called\");\r\n if (!localAccountId) {\r\n this.logger.warning(\"getAccountByLocalId: No localAccountId provided\");\r\n return null;\r\n }\r\n var account = this.browserStorage.getAccountInfoFilteredBy({ localAccountId: localAccountId });\r\n if (account) {\r\n this.logger.verbose(\"getAccountByLocalId: Account matching localAccountId found, returning\");\r\n this.logger.verbosePii(\"getAccountByLocalId: Returning signed-in accounts matching localAccountId: \" + localAccountId);\r\n return account;\r\n }\r\n else {\r\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\r\n return null;\r\n }\r\n };\r\n /**\r\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\r\n * @param account\r\n */\r\n ClientApplication.prototype.setActiveAccount = function (account) {\r\n this.browserStorage.setActiveAccount(account);\r\n };\r\n /**\r\n * Gets the currently active account\r\n */\r\n ClientApplication.prototype.getActiveAccount = function () {\r\n return this.browserStorage.getActiveAccount();\r\n };\r\n // #endregion\r\n // #region Helpers\r\n /**\r\n * Helper to validate app environment before making an auth request\r\n *\r\n * @protected\r\n * @param {InteractionType} interactionType What kind of interaction is being used\r\n * @param {boolean} [setInteractionInProgress=true] Whether to set interaction in progress temp cache flag\r\n */\r\n ClientApplication.prototype.preflightBrowserEnvironmentCheck = function (interactionType, setInteractionInProgress) {\r\n if (setInteractionInProgress === void 0) { setInteractionInProgress = true; }\r\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\r\n // Block request if not in browser environment\r\n BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);\r\n // Block redirects if in an iframe\r\n BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\r\n // Block auth requests inside a hidden iframe\r\n BrowserUtils.blockReloadInHiddenIframes();\r\n // Block redirectUri opened in a popup from calling MSAL APIs\r\n BrowserUtils.blockAcquireTokenInPopups();\r\n // Block token acquisition before initialize has been called if native brokering is enabled\r\n BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);\r\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\r\n if (interactionType === InteractionType.Redirect &&\r\n this.config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\r\n !this.config.cache.storeAuthStateInCookie) {\r\n throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();\r\n }\r\n if (interactionType === InteractionType.Redirect || interactionType === InteractionType.Popup) {\r\n this.preflightInteractiveRequest(setInteractionInProgress);\r\n }\r\n };\r\n /**\r\n * Preflight check for interactive requests\r\n *\r\n * @protected\r\n * @param {boolean} setInteractionInProgress Whether to set interaction in progress temp cache flag\r\n */\r\n ClientApplication.prototype.preflightInteractiveRequest = function (setInteractionInProgress) {\r\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\");\r\n // block the reload if it occurred inside a hidden iframe\r\n BrowserUtils.blockReloadInHiddenIframes();\r\n // Set interaction in progress temporary cache or throw if alread set.\r\n if (setInteractionInProgress) {\r\n this.browserStorage.setInteractionInProgress(true);\r\n }\r\n };\r\n /**\r\n * Acquire a token from native device (e.g. WAM)\r\n * @param request\r\n */\r\n ClientApplication.prototype.acquireTokenNative = function (request, apiId, accountId) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var nativeClient;\r\n return __generator(this, function (_a) {\r\n this.logger.trace(\"acquireTokenNative called\");\r\n if (!this.nativeExtensionProvider) {\r\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\r\n }\r\n nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, request.correlationId);\r\n return [2 /*return*/, nativeClient.acquireToken(request)];\r\n });\r\n });\r\n };\r\n /**\r\n * Returns boolean indicating if this request can use the native broker\r\n * @param request\r\n */\r\n ClientApplication.prototype.canUseNative = function (request, accountId) {\r\n this.logger.trace(\"canUseNative called\");\r\n if (!NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {\r\n this.logger.trace(\"canUseNative: isNativeAvailable returned false, returning false\");\r\n return false;\r\n }\r\n if (request.prompt) {\r\n switch (request.prompt) {\r\n case PromptValue.NONE:\r\n case PromptValue.CONSENT:\r\n case PromptValue.LOGIN:\r\n this.logger.trace(\"canUseNative: prompt is compatible with native flow\");\r\n break;\r\n default:\r\n this.logger.trace(\"canUseNative: prompt = \" + request.prompt + \" is not compatible with native flow, returning false\");\r\n return false;\r\n }\r\n }\r\n if (!accountId && !this.getNativeAccountId(request)) {\r\n this.logger.trace(\"canUseNative: nativeAccountId is not available, returning false\");\r\n return false;\r\n }\r\n return true;\r\n };\r\n /**\r\n * Get the native accountId from the account\r\n * @param request\r\n * @returns\r\n */\r\n ClientApplication.prototype.getNativeAccountId = function (request) {\r\n var account = request.account || this.browserStorage.getAccountInfoByHints(request.loginHint, request.sid) || this.getActiveAccount();\r\n return account && account.nativeAccountId || \"\";\r\n };\r\n /**\r\n * Returns new instance of the Popup Interaction Client\r\n * @param correlationId\r\n */\r\n ClientApplication.prototype.createPopupClient = function (correlationId) {\r\n return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Returns new instance of the Redirect Interaction Client\r\n * @param correlationId\r\n */\r\n ClientApplication.prototype.createRedirectClient = function (correlationId) {\r\n return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Returns new instance of the Silent Iframe Interaction Client\r\n * @param correlationId\r\n */\r\n ClientApplication.prototype.createSilentIframeClient = function (correlationId) {\r\n return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Returns new instance of the Silent Cache Interaction Client\r\n */\r\n ClientApplication.prototype.createSilentCacheClient = function (correlationId) {\r\n return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Returns new instance of the Silent Refresh Interaction Client\r\n */\r\n ClientApplication.prototype.createSilentRefreshClient = function (correlationId) {\r\n return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Returns new instance of the Silent AuthCode Interaction Client\r\n */\r\n ClientApplication.prototype.createSilentAuthCodeClient = function (correlationId) {\r\n return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);\r\n };\r\n /**\r\n * Adds event callbacks to array\r\n * @param callback\r\n */\r\n ClientApplication.prototype.addEventCallback = function (callback) {\r\n return this.eventHandler.addEventCallback(callback);\r\n };\r\n /**\r\n * Removes callback with provided id from callback array\r\n * @param callbackId\r\n */\r\n ClientApplication.prototype.removeEventCallback = function (callbackId) {\r\n this.eventHandler.removeEventCallback(callbackId);\r\n };\r\n /**\r\n * Registers a callback to receive performance events.\r\n *\r\n * @param {PerformanceCallbackFunction} callback\r\n * @returns {string}\r\n */\r\n ClientApplication.prototype.addPerformanceCallback = function (callback) {\r\n return this.performanceClient.addPerformanceCallback(callback);\r\n };\r\n /**\r\n * Removes a callback registered with addPerformanceCallback.\r\n *\r\n * @param {string} callbackId\r\n * @returns {boolean}\r\n */\r\n ClientApplication.prototype.removePerformanceCallback = function (callbackId) {\r\n return this.performanceClient.removePerformanceCallback(callbackId);\r\n };\r\n /**\r\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n ClientApplication.prototype.enableAccountStorageEvents = function () {\r\n this.eventHandler.enableAccountStorageEvents();\r\n };\r\n /**\r\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\r\n */\r\n ClientApplication.prototype.disableAccountStorageEvents = function () {\r\n this.eventHandler.disableAccountStorageEvents();\r\n };\r\n /**\r\n * Gets the token cache for the application.\r\n */\r\n ClientApplication.prototype.getTokenCache = function () {\r\n return this.tokenCache;\r\n };\r\n /**\r\n * Returns the logger instance\r\n */\r\n ClientApplication.prototype.getLogger = function () {\r\n return this.logger;\r\n };\r\n /**\r\n * Replaces the default logger set in configurations with new Logger with new configurations\r\n * @param logger Logger instance\r\n */\r\n ClientApplication.prototype.setLogger = function (logger) {\r\n this.logger = logger;\r\n };\r\n /**\r\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\r\n * @param sku\r\n * @param version\r\n */\r\n ClientApplication.prototype.initializeWrapperLibrary = function (sku, version) {\r\n // Validate the SKU passed in is one we expect\r\n this.browserStorage.setWrapperMetadata(sku, version);\r\n };\r\n /**\r\n * Sets navigation client\r\n * @param navigationClient\r\n */\r\n ClientApplication.prototype.setNavigationClient = function (navigationClient) {\r\n this.navigationClient = navigationClient;\r\n };\r\n /**\r\n * Returns the configuration object\r\n */\r\n ClientApplication.prototype.getConfiguration = function () {\r\n return this.config;\r\n };\r\n /**\r\n * Generates a correlation id for a request if none is provided.\r\n *\r\n * @protected\r\n * @param {?Partial} [request]\r\n * @returns {string}\r\n */\r\n ClientApplication.prototype.getRequestCorrelationId = function (request) {\r\n if (request === null || request === void 0 ? void 0 : request.correlationId) {\r\n return request.correlationId;\r\n }\r\n if (this.isBrowserEnvironment) {\r\n return this.browserCrypto.createNewGuid();\r\n }\r\n /*\r\n * Included for fallback for non-browser environments,\r\n * and to ensure this method always returns a string.\r\n */\r\n return Constants.EMPTY_STRING;\r\n };\r\n return ClientApplication;\r\n}());\n\nexport { ClientApplication };\n//# sourceMappingURL=ClientApplication.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';\nimport { PerformanceEvents, Constants, ServerError, InteractionRequiredAuthError } from '@azure/msal-common';\nimport { DEFAULT_REQUEST, InteractionType, CacheLookupPolicy, ApiId, BrowserConstants } from '../utils/BrowserConstants.js';\nimport { ClientApplication } from './ClientApplication.js';\nimport { EventType } from '../event/EventType.js';\nimport { BrowserAuthError } from '../error/BrowserAuthError.js';\nimport { NativeAuthError } from '../error/NativeAuthError.js';\nimport { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';\nimport { BrowserUtils } from '../utils/BrowserUtils.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 * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications\r\n * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.\r\n */\r\nvar PublicClientApplication = /** @class */ (function (_super) {\r\n __extends(PublicClientApplication, _super);\r\n /**\r\n * @constructor\r\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\r\n * - authority: the authority URL for your application.\r\n * - redirect_uri: the uri of your application registered in the portal.\r\n *\r\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\r\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\r\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\r\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\r\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\r\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\r\n *\r\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\r\n * Full B2C functionality will be available in this library in future versions.\r\n *\r\n * @param configuration object for the MSAL PublicClientApplication instance\r\n */\r\n function PublicClientApplication(configuration) {\r\n var _this = _super.call(this, configuration) || this;\r\n _this.astsAsyncMeasurement = undefined;\r\n _this.activeSilentTokenRequests = new Map();\r\n // Register listener functions\r\n _this.trackPageVisibility = _this.trackPageVisibility.bind(_this);\r\n return _this;\r\n }\r\n /**\r\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\r\n * any code that follows this function will not execute.\r\n *\r\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\r\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\r\n *\r\n * @param request\r\n */\r\n PublicClientApplication.prototype.loginRedirect = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"loginRedirect called\", correlationId);\r\n return [2 /*return*/, this.acquireTokenRedirect(__assign({ correlationId: correlationId }, (request || DEFAULT_REQUEST)))];\r\n });\r\n });\r\n };\r\n /**\r\n * Use when initiating the login process via opening a popup window in the user's browser\r\n *\r\n * @param request\r\n *\r\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\r\n */\r\n PublicClientApplication.prototype.loginPopup = function (request) {\r\n var correlationId = this.getRequestCorrelationId(request);\r\n this.logger.verbose(\"loginPopup called\", correlationId);\r\n return this.acquireTokenPopup(__assign({ correlationId: correlationId }, (request || DEFAULT_REQUEST)));\r\n };\r\n /**\r\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\r\n *\r\n * @param {@link (SilentRequest:type)}\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\r\n */\r\n PublicClientApplication.prototype.acquireTokenSilent = function (request) {\r\n return __awaiter(this, void 0, void 0, function () {\r\n var correlationId, atsMeasurement, account, thumbprint, silentRequestKey, cachedResponse, response;\r\n var _this = this;\r\n return __generator(this, function (_a) {\r\n correlationId = this.getRequestCorrelationId(request);\r\n atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);\r\n atsMeasurement.addStaticFields({\r\n cacheLookupPolicy: request.cacheLookupPolicy\r\n });\r\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\r\n this.logger.verbose(\"acquireTokenSilent called\", correlationId);\r\n account = request.account || this.getActiveAccount();\r\n if (!account) {\r\n throw BrowserAuthError.createNoAccountError();\r\n }\r\n thumbprint = {\r\n clientId: this.config.auth.clientId,\r\n authority: request.authority || Constants.EMPTY_STRING,\r\n scopes: request.scopes,\r\n homeAccountIdentifier: account.homeAccountId,\r\n claims: request.claims,\r\n authenticationScheme: request.authenticationScheme,\r\n resourceRequestMethod: request.resourceRequestMethod,\r\n resourceRequestUri: request.resourceRequestUri,\r\n shrClaims: request.shrClaims,\r\n sshKid: request.sshKid\r\n };\r\n silentRequestKey = JSON.stringify(thumbprint);\r\n cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);\r\n if (typeof cachedResponse === \"undefined\") {\r\n this.logger.verbose(\"acquireTokenSilent called for the first time, storing active request\", correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenSilentAsync, correlationId);\r\n response = this.acquireTokenSilentAsync(__assign(__assign({}, request), { correlationId: correlationId }), account)\r\n .then(function (result) {\r\n _this.activeSilentTokenRequests.delete(silentRequestKey);\r\n atsMeasurement.addStaticFields({\r\n accessTokenSize: result.accessToken.length,\r\n idTokenSize: result.idToken.length\r\n });\r\n atsMeasurement.endMeasurement({\r\n success: true,\r\n fromCache: result.fromCache,\r\n isNativeBroker: result.fromNativeBroker,\r\n cacheLookupPolicy: request.cacheLookupPolicy,\r\n requestId: result.requestId,\r\n });\r\n return result;\r\n })\r\n .catch(function (error) {\r\n _this.activeSilentTokenRequests.delete(silentRequestKey);\r\n atsMeasurement.endMeasurement({\r\n errorCode: error.errorCode,\r\n subErrorCode: error.subError,\r\n success: false\r\n });\r\n throw error;\r\n });\r\n this.activeSilentTokenRequests.set(silentRequestKey, response);\r\n return [2 /*return*/, response];\r\n }\r\n else {\r\n this.logger.verbose(\"acquireTokenSilent has been called previously, returning the result from the first call\", correlationId);\r\n // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics\r\n atsMeasurement.discardMeasurement();\r\n return [2 /*return*/, cachedResponse];\r\n }\r\n });\r\n });\r\n };\r\n PublicClientApplication.prototype.trackPageVisibility = function () {\r\n if (!this.astsAsyncMeasurement) {\r\n return;\r\n }\r\n this.logger.info(\"Perf: Visibility change detected\");\r\n this.astsAsyncMeasurement.increment({\r\n visibilityChangeCount: 1,\r\n });\r\n };\r\n /**\r\n * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.\r\n * @param {@link (SilentRequest:type)}\r\n * @param {@link (AccountInfo:type)}\r\n * @returns {Promise.} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse}\r\n */\r\n PublicClientApplication.prototype.acquireTokenSilentAsync = function (request, account) {\r\n var _a;\r\n return __awaiter(this, void 0, void 0, function () {\r\n var result, silentRequest, silentCacheClient, silentRequest_1, requestWithCLP_1;\r\n var _this = this;\r\n return __generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n this.performanceClient.addQueueMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\r\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\r\n this.astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\r\n (_a = this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.increment({\r\n visibilityChangeCount: 0\r\n });\r\n document.addEventListener(\"visibilitychange\", this.trackPageVisibility);\r\n if (!(NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId)) return [3 /*break*/, 1];\r\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from native platform\");\r\n silentRequest = __assign(__assign({}, request), { account: account });\r\n result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(function (e) { return __awaiter(_this, void 0, void 0, function () {\r\n var silentIframeClient;\r\n return __generator(this, function (_a) {\r\n // If native token acquisition fails for availability reasons fallback to web flow\r\n if (e instanceof NativeAuthError && e.isFatal()) {\r\n this.logger.verbose(\"acquireTokenSilent - native platform unavailable, falling back to web flow\");\r\n this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt\r\n silentIframeClient = this.createSilentIframeClient(request.correlationId);\r\n return [2 /*return*/, silentIframeClient.acquireToken(request)];\r\n }\r\n throw e;\r\n });\r\n }); });\r\n return [3 /*break*/, 3];\r\n case 1:\r\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from web flow\");\r\n silentCacheClient = this.createSilentCacheClient(request.correlationId);\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.InitializeSilentRequest, request.correlationId);\r\n return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];\r\n case 2:\r\n silentRequest_1 = _b.sent();\r\n requestWithCLP_1 = __assign(__assign({}, request), { \r\n // set the request's CacheLookupPolicy to Default if it was not optionally passed in\r\n cacheLookupPolicy: request.cacheLookupPolicy || CacheLookupPolicy.Default });\r\n this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenFromCache, silentRequest_1.correlationId);\r\n result = this.acquireTokenFromCache(silentCacheClient, silentRequest_1, requestWithCLP_1).catch(function (cacheError) {\r\n if (requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.AccessToken) {\r\n throw cacheError;\r\n }\r\n // block the reload if it occurred inside a hidden iframe\r\n BrowserUtils.blockReloadInHiddenIframes();\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, silentRequest_1);\r\n _this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenByRefreshToken, silentRequest_1.correlationId);\r\n return _this.acquireTokenByRefreshToken(silentRequest_1, requestWithCLP_1).catch(function (refreshTokenError) {\r\n var isServerError = refreshTokenError instanceof ServerError;\r\n var isInteractionRequiredError = refreshTokenError instanceof InteractionRequiredAuthError;\r\n var isInvalidGrantError = (refreshTokenError.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\r\n if ((!isServerError ||\r\n !isInvalidGrantError ||\r\n isInteractionRequiredError ||\r\n requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.AccessTokenAndRefreshToken ||\r\n requestWithCLP_1.cacheLookupPolicy === CacheLookupPolicy.RefreshToken)\r\n && (requestWithCLP_1.cacheLookupPolicy !== CacheLookupPolicy.Skip)) {\r\n throw refreshTokenError;\r\n }\r\n _this.logger.verbose(\"Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.\", request.correlationId);\r\n _this.performanceClient.setPreQueueTime(PerformanceEvents.AcquireTokenBySilentIframe, silentRequest_1.correlationId);\r\n return _this.acquireTokenBySilentIframe(silentRequest_1);\r\n });\r\n });\r\n _b.label = 3;\r\n case 3: return [2 /*return*/, result.then(function (response) {\r\n var _a;\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);\r\n (_a = _this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({\r\n success: true,\r\n fromCache: response.fromCache,\r\n isNativeBroker: response.fromNativeBroker,\r\n requestId: response.requestId\r\n });\r\n return response;\r\n }).catch(function (tokenRenewalError) {\r\n var _a;\r\n _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);\r\n (_a = _this.astsAsyncMeasurement) === null || _a === void 0 ? void 0 : _a.endMeasurement({\r\n errorCode: tokenRenewalError.errorCode,\r\n subErrorCode: tokenRenewalError.subError,\r\n success: false\r\n });\r\n throw tokenRenewalError;\r\n }).finally(function () {\r\n document.removeEventListener(\"visibilitychange\", _this.trackPageVisibility);\r\n })];\r\n }\r\n });\r\n });\r\n };\r\n return PublicClientApplication;\r\n}(ClientApplication));\n\nexport { PublicClientApplication };\n//# sourceMappingURL=PublicClientApplication.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar stubbedPublicClientApplication = {\r\n initialize: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n acquireTokenPopup: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n acquireTokenRedirect: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n acquireTokenSilent: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n acquireTokenByCode: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n getAllAccounts: function () {\r\n return [];\r\n },\r\n getAccountByHomeId: function () {\r\n return null;\r\n },\r\n getAccountByUsername: function () {\r\n return null;\r\n },\r\n getAccountByLocalId: function () {\r\n return null;\r\n },\r\n handleRedirectPromise: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n loginPopup: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n loginRedirect: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n logout: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n logoutRedirect: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n logoutPopup: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n ssoSilent: function () {\r\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\r\n },\r\n addEventCallback: function () {\r\n return null;\r\n },\r\n removeEventCallback: function () {\r\n return;\r\n },\r\n addPerformanceCallback: function () {\r\n return \"\";\r\n },\r\n removePerformanceCallback: function () {\r\n return false;\r\n },\r\n enableAccountStorageEvents: function () {\r\n return;\r\n },\r\n disableAccountStorageEvents: function () {\r\n return;\r\n },\r\n getTokenCache: function () {\r\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\r\n },\r\n getLogger: function () {\r\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\r\n },\r\n setLogger: function () {\r\n return;\r\n },\r\n setActiveAccount: function () {\r\n return;\r\n },\r\n getActiveAccount: function () {\r\n return null;\r\n },\r\n initializeWrapperLibrary: function () {\r\n return;\r\n },\r\n setNavigationClient: function () {\r\n return;\r\n },\r\n getConfiguration: function () {\r\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\r\n }\r\n};\n\nexport { stubbedPublicClientApplication };\n//# sourceMappingURL=IPublicClientApplication.js.map\n","/*! @azure/msal-browser v2.36.0 2023-04-18 */\n'use strict';\nimport { EventType } from './EventType.js';\nimport { InteractionType, InteractionStatus } from '../utils/BrowserConstants.js';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar EventMessageUtils = /** @class */ (function () {\r\n function EventMessageUtils() {\r\n }\r\n /**\r\n * Gets interaction status from event message\r\n * @param message\r\n * @param currentStatus\r\n */\r\n EventMessageUtils.getInteractionStatusFromEvent = function (message, currentStatus) {\r\n switch (message.eventType) {\r\n case EventType.LOGIN_START:\r\n return InteractionStatus.Login;\r\n case EventType.SSO_SILENT_START:\r\n return InteractionStatus.SsoSilent;\r\n case EventType.ACQUIRE_TOKEN_START:\r\n if (message.interactionType === InteractionType.Redirect || message.interactionType === InteractionType.Popup) {\r\n return InteractionStatus.AcquireToken;\r\n }\r\n break;\r\n case EventType.HANDLE_REDIRECT_START:\r\n return InteractionStatus.HandleRedirect;\r\n case EventType.LOGOUT_START:\r\n return InteractionStatus.Logout;\r\n case EventType.SSO_SILENT_SUCCESS:\r\n case EventType.SSO_SILENT_FAILURE:\r\n if (currentStatus && currentStatus !== InteractionStatus.SsoSilent) {\r\n // Prevent this event from clearing any status other than ssoSilent\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.LOGOUT_END:\r\n if (currentStatus && currentStatus !== InteractionStatus.Logout) {\r\n // Prevent this event from clearing any status other than logout\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.HANDLE_REDIRECT_END:\r\n if (currentStatus && currentStatus !== InteractionStatus.HandleRedirect) {\r\n // Prevent this event from clearing any status other than handleRedirect\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n case EventType.LOGIN_SUCCESS:\r\n case EventType.LOGIN_FAILURE:\r\n case EventType.ACQUIRE_TOKEN_SUCCESS:\r\n case EventType.ACQUIRE_TOKEN_FAILURE:\r\n if (message.interactionType === InteractionType.Redirect || message.interactionType === InteractionType.Popup) {\r\n if (currentStatus && currentStatus !== InteractionStatus.Login && currentStatus !== InteractionStatus.AcquireToken) {\r\n // Prevent this event from clearing any status other than login or acquireToken\r\n break;\r\n }\r\n return InteractionStatus.None;\r\n }\r\n break;\r\n }\r\n return null;\r\n };\r\n return EventMessageUtils;\r\n}());\n\nexport { EventMessageUtils };\n//# sourceMappingURL=EventMessage.js.map\n","import React__default, { createContext, useEffect, useMemo, useReducer, useContext, useState, useRef, useCallback } from 'react';\nimport { stubbedPublicClientApplication, InteractionStatus, Logger, WrapperSKU, EventMessageUtils, AccountEntity, AuthError, InteractionType, InteractionRequiredAuthError, EventType, OIDC_DEFAULT_SCOPES } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/*\r\n * Stubbed context implementation\r\n * Only used when there is no provider, which is an unsupported scenario\r\n */\n\nconst defaultMsalContext = {\n instance: stubbedPublicClientApplication,\n inProgress: InteractionStatus.None,\n accounts: [],\n logger: /*#__PURE__*/new Logger({})\n};\nconst MsalContext = /*#__PURE__*/createContext(defaultMsalContext);\nconst MsalConsumer = MsalContext.Consumer;\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nfunction getChildrenOrFunction(children, args) {\n if (typeof children === \"function\") {\n return children(args);\n }\n\n return children;\n}\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 */\n\nfunction accountArraysAreEqual(arrayA, arrayB) {\n if (arrayA.length !== arrayB.length) {\n return false;\n }\n\n const comparisonArray = [...arrayB];\n return arrayA.every(elementA => {\n const elementB = comparisonArray.shift();\n\n if (!elementA || !elementB) {\n return false;\n }\n\n return elementA.homeAccountId === elementB.homeAccountId && elementA.localAccountId === elementB.localAccountId && elementA.username === elementB.username;\n });\n}\nfunction getAccountByIdentifiers(allAccounts, accountIdentifiers) {\n if (allAccounts.length > 0 && (accountIdentifiers.homeAccountId || accountIdentifiers.localAccountId || accountIdentifiers.username)) {\n const matchedAccounts = allAccounts.filter(accountObj => {\n if (accountIdentifiers.username && accountIdentifiers.username.toLowerCase() !== accountObj.username.toLowerCase()) {\n return false;\n }\n\n if (accountIdentifiers.homeAccountId && accountIdentifiers.homeAccountId.toLowerCase() !== accountObj.homeAccountId.toLowerCase()) {\n return false;\n }\n\n if (accountIdentifiers.localAccountId && accountIdentifiers.localAccountId.toLowerCase() !== accountObj.localAccountId.toLowerCase()) {\n return false;\n }\n\n return true;\n });\n return matchedAccounts[0] || null;\n } else {\n return null;\n }\n}\n\n/* eslint-disable header/header */\nconst name = \"@azure/msal-react\";\nconst version = \"1.5.13\";\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nvar MsalProviderActionType;\n\n(function (MsalProviderActionType) {\n MsalProviderActionType[\"UNBLOCK_INPROGRESS\"] = \"UNBLOCK_INPROGRESS\";\n MsalProviderActionType[\"EVENT\"] = \"EVENT\";\n})(MsalProviderActionType || (MsalProviderActionType = {}));\n/**\r\n * Returns the next inProgress and accounts state based on event message\r\n * @param previousState\r\n * @param action\r\n */\n\n\nconst reducer = (previousState, action) => {\n const {\n type,\n payload\n } = action;\n let newInProgress = previousState.inProgress;\n\n switch (type) {\n case MsalProviderActionType.UNBLOCK_INPROGRESS:\n if (previousState.inProgress === InteractionStatus.Startup) {\n newInProgress = InteractionStatus.None;\n payload.logger.info(\"MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'\");\n }\n\n break;\n\n case MsalProviderActionType.EVENT:\n const message = payload.message;\n const status = EventMessageUtils.getInteractionStatusFromEvent(message, previousState.inProgress);\n\n if (status) {\n payload.logger.info(`MsalProvider - ${message.eventType} results in setting inProgress from ${previousState.inProgress} to ${status}`);\n newInProgress = status;\n }\n\n break;\n\n default:\n throw new Error(`Unknown action type: ${type}`);\n }\n\n const currentAccounts = payload.instance.getAllAccounts();\n\n if (newInProgress !== previousState.inProgress && !accountArraysAreEqual(currentAccounts, previousState.accounts)) {\n // Both inProgress and accounts changed\n return { ...previousState,\n inProgress: newInProgress,\n accounts: currentAccounts\n };\n } else if (newInProgress !== previousState.inProgress) {\n // Only only inProgress changed\n return { ...previousState,\n inProgress: newInProgress\n };\n } else if (!accountArraysAreEqual(currentAccounts, previousState.accounts)) {\n // Only accounts changed\n return { ...previousState,\n accounts: currentAccounts\n };\n } else {\n // Nothing changed\n return previousState;\n }\n};\n/**\r\n * MSAL context provider component. This must be rendered above any other components that use MSAL.\r\n */\n\n\nfunction MsalProvider(_ref) {\n let {\n instance,\n children\n } = _ref;\n useEffect(() => {\n instance.initializeWrapperLibrary(WrapperSKU.React, version);\n }, [instance]); // Create a logger instance for msal-react with the same options as PublicClientApplication\n\n const logger = useMemo(() => {\n return instance.getLogger().clone(name, version);\n }, [instance]);\n const [state, updateState] = useReducer(reducer, undefined, () => {\n // Lazy initialization of the initial state\n return {\n inProgress: InteractionStatus.Startup,\n accounts: instance.getAllAccounts()\n };\n });\n useEffect(() => {\n const callbackId = instance.addEventCallback(message => {\n updateState({\n payload: {\n instance,\n logger,\n message\n },\n type: MsalProviderActionType.EVENT\n });\n });\n logger.verbose(`MsalProvider - Registered event callback with id: ${callbackId}`);\n instance.initialize().then(() => {\n instance.handleRedirectPromise().catch(() => {\n // Errors should be handled by listening to the LOGIN_FAILURE event\n return;\n }).finally(() => {\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 */\n updateState({\n payload: {\n instance,\n logger\n },\n type: MsalProviderActionType.UNBLOCK_INPROGRESS\n });\n });\n });\n return () => {\n // Remove callback when component unmounts or accounts change\n if (callbackId) {\n logger.verbose(`MsalProvider - Removing event callback ${callbackId}`);\n instance.removeEventCallback(callbackId);\n }\n };\n }, [instance, logger]);\n const contextValue = {\n instance,\n inProgress: state.inProgress,\n accounts: state.accounts,\n logger\n };\n return React__default.createElement(MsalContext.Provider, {\n value: contextValue\n }, children);\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Returns Msal Context values\r\n */\n\nconst useMsal = () => useContext(MsalContext);\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n\nfunction isAuthenticated(allAccounts, matchAccount) {\n if (matchAccount && (matchAccount.username || matchAccount.homeAccountId || matchAccount.localAccountId)) {\n return !!getAccountByIdentifiers(allAccounts, matchAccount);\n }\n\n return allAccounts.length > 0;\n}\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 */\n\n\nfunction useIsAuthenticated(matchAccount) {\n const {\n accounts: allAccounts,\n inProgress\n } = useMsal();\n const [hasAuthenticated, setHasAuthenticated] = useState(() => {\n if (inProgress === InteractionStatus.Startup) {\n return false;\n }\n\n return isAuthenticated(allAccounts, matchAccount);\n });\n useEffect(() => {\n setHasAuthenticated(isAuthenticated(allAccounts, matchAccount));\n }, [allAccounts, matchAccount]);\n return hasAuthenticated;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Renders child components if user is authenticated\r\n * @param props\r\n */\n\nfunction AuthenticatedTemplate(_ref) {\n let {\n username,\n homeAccountId,\n localAccountId,\n children\n } = _ref;\n const context = useMsal();\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (isAuthenticated && context.inProgress !== InteractionStatus.Startup) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Renders child components if user is unauthenticated\r\n * @param props\r\n */\n\nfunction UnauthenticatedTemplate(_ref) {\n let {\n username,\n homeAccountId,\n localAccountId,\n children\n } = _ref;\n const context = useMsal();\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (!isAuthenticated && context.inProgress !== InteractionStatus.Startup && context.inProgress !== InteractionStatus.HandleRedirect) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n\nfunction getAccount(instance, accountIdentifiers) {\n if (!accountIdentifiers || !accountIdentifiers.homeAccountId && !accountIdentifiers.localAccountId && !accountIdentifiers.username) {\n // If no account identifiers are provided, return active account\n return instance.getActiveAccount();\n }\n\n return getAccountByIdentifiers(instance.getAllAccounts(), accountIdentifiers);\n}\n/**\r\n * Given 1 or more accountIdentifiers, returns the Account object if the user is signed-in\r\n * @param accountIdentifiers\r\n */\n\n\nfunction useAccount(accountIdentifiers) {\n const {\n instance,\n inProgress,\n logger\n } = useMsal();\n const [account, setAccount] = useState(() => getAccount(instance, accountIdentifiers));\n useEffect(() => {\n setAccount(currentAccount => {\n const nextAccount = getAccount(instance, accountIdentifiers);\n\n if (!AccountEntity.accountInfoIsEqual(currentAccount, nextAccount, true)) {\n logger.info(\"useAccount - Updating account\");\n return nextAccount;\n }\n\n return currentAccount;\n });\n }, [inProgress, accountIdentifiers, instance, logger]);\n return account;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nconst ReactAuthErrorMessage = {\n invalidInteractionType: {\n code: \"invalid_interaction_type\",\n desc: \"The provided interaction type is invalid.\"\n },\n unableToFallbackToInteraction: {\n code: \"unable_to_fallback_to_interaction\",\n desc: \"Interaction is required but another interaction is already in progress. Please try again when the current interaction is complete.\"\n }\n};\nclass ReactAuthError extends AuthError {\n constructor(errorCode, errorMessage) {\n super(errorCode, errorMessage);\n Object.setPrototypeOf(this, ReactAuthError.prototype);\n this.name = \"ReactAuthError\";\n }\n\n static createInvalidInteractionTypeError() {\n return new ReactAuthError(ReactAuthErrorMessage.invalidInteractionType.code, ReactAuthErrorMessage.invalidInteractionType.desc);\n }\n\n static createUnableToFallbackToInteractionError() {\n return new ReactAuthError(ReactAuthErrorMessage.unableToFallbackToInteraction.code, ReactAuthErrorMessage.unableToFallbackToInteraction.desc);\n }\n\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\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 */\n\nfunction useMsalAuthentication(interactionType, authenticationRequest, accountIdentifiers) {\n const {\n instance,\n inProgress,\n logger\n } = useMsal();\n const isAuthenticated = useIsAuthenticated(accountIdentifiers);\n const account = useAccount(accountIdentifiers);\n const [[result, error], setResponse] = useState([null, null]); // Used to prevent state updates after unmount\n\n const mounted = useRef(true);\n useEffect(() => {\n return () => {\n mounted.current = false;\n };\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\n\n const interactionInProgress = useRef(inProgress !== InteractionStatus.None);\n useEffect(() => {\n interactionInProgress.current = inProgress !== InteractionStatus.None;\n }, [inProgress]); // Flag used to control when the hook calls login/acquireToken\n\n const shouldAcquireToken = useRef(true);\n useEffect(() => {\n if (!!error) {\n // Errors should be handled by consuming component\n shouldAcquireToken.current = false;\n return;\n }\n\n if (!!result) {\n // Token has already been acquired, consuming component/application is responsible for renewing\n shouldAcquireToken.current = false;\n return;\n }\n }, [error, result]);\n const login = useCallback(async (callbackInteractionType, callbackRequest) => {\n const loginType = callbackInteractionType || interactionType;\n const loginRequest = callbackRequest || authenticationRequest;\n\n switch (loginType) {\n case InteractionType.Popup:\n logger.verbose(\"useMsalAuthentication - Calling loginPopup\");\n return instance.loginPopup(loginRequest);\n\n case InteractionType.Redirect:\n // This promise is not expected to resolve due to full frame redirect\n logger.verbose(\"useMsalAuthentication - Calling loginRedirect\");\n return instance.loginRedirect(loginRequest).then(null);\n\n case InteractionType.Silent:\n logger.verbose(\"useMsalAuthentication - Calling ssoSilent\");\n return instance.ssoSilent(loginRequest);\n\n default:\n throw ReactAuthError.createInvalidInteractionTypeError();\n }\n }, [instance, interactionType, authenticationRequest, logger]);\n const acquireToken = useCallback(async (callbackInteractionType, callbackRequest) => {\n const fallbackInteractionType = callbackInteractionType || interactionType;\n let tokenRequest;\n\n if (callbackRequest) {\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the callback\");\n tokenRequest = { ...callbackRequest\n };\n } else if (authenticationRequest) {\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the hook\");\n tokenRequest = { ...authenticationRequest,\n scopes: authenticationRequest.scopes || OIDC_DEFAULT_SCOPES\n };\n } else {\n logger.trace(\"useMsalAuthentication - acquireToken - No request object provided, using default request.\");\n tokenRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n };\n }\n\n if (!tokenRequest.account && account) {\n logger.trace(\"useMsalAuthentication - acquireToken - Attaching account to request\");\n tokenRequest.account = account;\n }\n\n const getToken = async () => {\n logger.verbose(\"useMsalAuthentication - Calling acquireTokenSilent\");\n return instance.acquireTokenSilent(tokenRequest).catch(async e => {\n if (e instanceof InteractionRequiredAuthError) {\n if (!interactionInProgress.current) {\n logger.error(\"useMsalAuthentication - Interaction required, falling back to interaction\");\n return login(fallbackInteractionType, tokenRequest);\n } else {\n logger.error(\"useMsalAuthentication - Interaction required but is already in progress. Please try again, if needed, after interaction completes.\");\n throw ReactAuthError.createUnableToFallbackToInteractionError();\n }\n }\n\n throw e;\n });\n };\n\n return getToken().then(response => {\n if (mounted.current) {\n setResponse([response, null]);\n }\n\n return response;\n }).catch(e => {\n if (mounted.current) {\n setResponse([null, e]);\n }\n\n throw e;\n });\n }, [instance, interactionType, authenticationRequest, logger, account, login]);\n useEffect(() => {\n const callbackId = instance.addEventCallback(message => {\n switch (message.eventType) {\n case EventType.LOGIN_SUCCESS:\n case EventType.SSO_SILENT_SUCCESS:\n if (message.payload) {\n setResponse([message.payload, null]);\n }\n\n break;\n\n case EventType.LOGIN_FAILURE:\n case EventType.SSO_SILENT_FAILURE:\n if (message.error) {\n setResponse([null, message.error]);\n }\n\n break;\n }\n });\n logger.verbose(`useMsalAuthentication - Registered event callback with id: ${callbackId}`);\n return () => {\n if (callbackId) {\n logger.verbose(`useMsalAuthentication - Removing event callback ${callbackId}`);\n instance.removeEventCallback(callbackId);\n }\n };\n }, [instance, logger]);\n useEffect(() => {\n if (shouldAcquireToken.current && inProgress === InteractionStatus.None) {\n shouldAcquireToken.current = false;\n\n if (!isAuthenticated) {\n logger.info(\"useMsalAuthentication - No user is authenticated, attempting to login\");\n login().catch(() => {\n // Errors are saved in state above\n return;\n });\n } else if (account) {\n logger.info(\"useMsalAuthentication - User is authenticated, attempting to acquire token\");\n acquireToken().catch(() => {\n // Errors are saved in state above\n return;\n });\n }\n }\n }, [isAuthenticated, account, inProgress, login, acquireToken, logger]);\n return {\n login,\n acquireToken,\n result,\n error\n };\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Attempts to authenticate user if not already authenticated, then renders child components\r\n * @param props\r\n */\n\nfunction MsalAuthenticationTemplate(_ref) {\n let {\n interactionType,\n username,\n homeAccountId,\n localAccountId,\n authenticationRequest,\n loadingComponent: LoadingComponent,\n errorComponent: ErrorComponent,\n children\n } = _ref;\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const context = useMsal();\n const msalAuthResult = useMsalAuthentication(interactionType, authenticationRequest, accountIdentifier);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (msalAuthResult.error && context.inProgress === InteractionStatus.None) {\n if (!!ErrorComponent) {\n return React__default.createElement(ErrorComponent, Object.assign({}, msalAuthResult));\n }\n\n throw msalAuthResult.error;\n }\n\n if (isAuthenticated) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, msalAuthResult));\n }\n\n if (!!LoadingComponent && context.inProgress !== InteractionStatus.None) {\n return React__default.createElement(LoadingComponent, Object.assign({}, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\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 */\n\nconst withMsal = Component => {\n const ComponentWithMsal = props => {\n const msal = useMsal();\n return React__default.createElement(Component, Object.assign({}, props, {\n msalContext: msal\n }));\n };\n\n const componentName = Component.displayName || Component.name || \"Component\";\n ComponentWithMsal.displayName = `withMsal(${componentName})`;\n return ComponentWithMsal;\n};\n\nexport { AuthenticatedTemplate, MsalAuthenticationTemplate, MsalConsumer, MsalContext, MsalProvider, UnauthenticatedTemplate, useAccount, useIsAuthenticated, useMsal, useMsalAuthentication, version, withMsal };\n//# sourceMappingURL=msal-react.esm.js.map\n","/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\nvar t=function(){return t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]1?(o=Array.from(n).sort((function(e,r){var t,n,o,c,i=null!==(n=null===(t=e.idTokenClaims)||void 0===t?void 0:t.auth_time)&&void 0!==n?n:0;return(null!==(c=null===(o=r.idTokenClaims)||void 0===o?void 0:o.auth_time)&&void 0!==c?c:0)-i})),(c=o[0])&&e.setActiveAccount(c),[2,c]):(i=n[0],e.setActiveAccount(i),[2,i]):[4,e.handleRedirectPromise()];case 1:return(null==(s=r.sent())?void 0:s.account)?(a=s.account,e.setActiveAccount(a),[2,a]):[2,void 0]}}))}))},w=function(o){return e(void 0,void 0,void 0,(function(){var e,c,i,s;return r(this,(function(r){switch(r.label){case 0:return c=(e=o||{}).resetInteractionInProgressStatus,i=t(e,[\"resetInteractionInProgressStatus\"]),s=m(),c&&s.browserStorage.isInteractionInProgress(!0)&&s.browserStorage.setInteractionInProgress(!1),[4,s.handleRedirectPromise()];case 1:return r.sent(),[2,s.loginRedirect(n(n({},v),i))]}}))}))},A=function(t,o){return void 0===t&&(t=!1),e(void 0,void 0,void 0,(function(){var e,c,i,s,l,d,f;return r(this,(function(r){switch(r.label){case 0:return e=function(e){if(t)throw o&&o(i),new Error(e)},[4,b()];case 1:if(!(c=r.sent()))return[2,e(\"Could not acquire an access token - there is no logged in account\")];i=m(),r.label=2;case 2:return r.trys.push([2,4,,10]),[4,i.acquireTokenSilent(n(n({},v),{account:c}))];case 3:return s=r.sent(),[2,null!==(f=null==s?void 0:s.accessToken)&&void 0!==f?f:e(\"Failed to acquire an access token\")];case 4:if(!((l=r.sent())instanceof u))throw l;return o&&o(i),[4,i.handleRedirectPromise()];case 5:return(null==(d=r.sent())?void 0:d.accessToken)?[2,d.accessToken]:t?a.isInteractionRequiredError(l.errorCode,l.errorMessage,l.subError)?[4,i.acquireTokenRedirect(v)]:[3,7]:[3,9];case 6:return r.sent(),[3,9];case 7:return[4,i.logoutRedirect(h)];case 8:r.sent(),r.label=9;case 9:return[3,10];case 10:return[2,void 0]}}))}))},R=function(t){return e(void 0,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return[4,m().logoutRedirect(n(n({},h),t||{}))];case 1:return e.sent(),[2]}}))}))};export{g as configure,A as getAccessToken,b as getActiveAccount,m as getAppInstance,w as login,R as logout};\n//# sourceMappingURL=Authenticator.js.map\n","import React__default, { createContext, useEffect, useMemo, useReducer, useContext, useState, useRef, useCallback } from 'react';\nimport { stubbedPublicClientApplication, InteractionStatus, Logger, WrapperSKU, EventMessageUtils, AccountEntity, AuthError, InteractionType, InteractionRequiredAuthError, EventType, OIDC_DEFAULT_SCOPES } from '@azure/msal-browser';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/*\r\n * Stubbed context implementation\r\n * Only used when there is no provider, which is an unsupported scenario\r\n */\n\nconst defaultMsalContext = {\n instance: stubbedPublicClientApplication,\n inProgress: InteractionStatus.None,\n accounts: [],\n logger: /*#__PURE__*/new Logger({})\n};\nconst MsalContext = /*#__PURE__*/createContext(defaultMsalContext);\nconst MsalConsumer = MsalContext.Consumer;\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nfunction getChildrenOrFunction(children, args) {\n if (typeof children === \"function\") {\n return children(args);\n }\n\n return children;\n}\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 */\n\nfunction accountArraysAreEqual(arrayA, arrayB) {\n if (arrayA.length !== arrayB.length) {\n return false;\n }\n\n const comparisonArray = [...arrayB];\n return arrayA.every(elementA => {\n const elementB = comparisonArray.shift();\n\n if (!elementA || !elementB) {\n return false;\n }\n\n return elementA.homeAccountId === elementB.homeAccountId && elementA.localAccountId === elementB.localAccountId && elementA.username === elementB.username;\n });\n}\nfunction getAccountByIdentifiers(allAccounts, accountIdentifiers) {\n if (allAccounts.length > 0 && (accountIdentifiers.homeAccountId || accountIdentifiers.localAccountId || accountIdentifiers.username)) {\n const matchedAccounts = allAccounts.filter(accountObj => {\n if (accountIdentifiers.username && accountIdentifiers.username.toLowerCase() !== accountObj.username.toLowerCase()) {\n return false;\n }\n\n if (accountIdentifiers.homeAccountId && accountIdentifiers.homeAccountId.toLowerCase() !== accountObj.homeAccountId.toLowerCase()) {\n return false;\n }\n\n if (accountIdentifiers.localAccountId && accountIdentifiers.localAccountId.toLowerCase() !== accountObj.localAccountId.toLowerCase()) {\n return false;\n }\n\n return true;\n });\n return matchedAccounts[0] || null;\n } else {\n return null;\n }\n}\n\n/* eslint-disable header/header */\nconst name = \"@azure/msal-react\";\nconst version = \"1.5.6\";\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nvar MsalProviderActionType;\n\n(function (MsalProviderActionType) {\n MsalProviderActionType[\"UNBLOCK_INPROGRESS\"] = \"UNBLOCK_INPROGRESS\";\n MsalProviderActionType[\"EVENT\"] = \"EVENT\";\n})(MsalProviderActionType || (MsalProviderActionType = {}));\n/**\r\n * Returns the next inProgress and accounts state based on event message\r\n * @param previousState\r\n * @param action\r\n */\n\n\nconst reducer = (previousState, action) => {\n const {\n type,\n payload\n } = action;\n let newInProgress = previousState.inProgress;\n\n switch (type) {\n case MsalProviderActionType.UNBLOCK_INPROGRESS:\n if (previousState.inProgress === InteractionStatus.Startup) {\n newInProgress = InteractionStatus.None;\n payload.logger.info(\"MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'\");\n }\n\n break;\n\n case MsalProviderActionType.EVENT:\n const message = payload.message;\n const status = EventMessageUtils.getInteractionStatusFromEvent(message, previousState.inProgress);\n\n if (status) {\n payload.logger.info(`MsalProvider - ${message.eventType} results in setting inProgress from ${previousState.inProgress} to ${status}`);\n newInProgress = status;\n }\n\n break;\n\n default:\n throw new Error(`Unknown action type: ${type}`);\n }\n\n const currentAccounts = payload.instance.getAllAccounts();\n\n if (newInProgress !== previousState.inProgress && !accountArraysAreEqual(currentAccounts, previousState.accounts)) {\n // Both inProgress and accounts changed\n return { ...previousState,\n inProgress: newInProgress,\n accounts: currentAccounts\n };\n } else if (newInProgress !== previousState.inProgress) {\n // Only only inProgress changed\n return { ...previousState,\n inProgress: newInProgress\n };\n } else if (!accountArraysAreEqual(currentAccounts, previousState.accounts)) {\n // Only accounts changed\n return { ...previousState,\n accounts: currentAccounts\n };\n } else {\n // Nothing changed\n return previousState;\n }\n};\n/**\r\n * MSAL context provider component. This must be rendered above any other components that use MSAL.\r\n */\n\n\nfunction MsalProvider(_ref) {\n let {\n instance,\n children\n } = _ref;\n useEffect(() => {\n instance.initializeWrapperLibrary(WrapperSKU.React, version);\n }, [instance]); // Create a logger instance for msal-react with the same options as PublicClientApplication\n\n const logger = useMemo(() => {\n return instance.getLogger().clone(name, version);\n }, [instance]);\n const [state, updateState] = useReducer(reducer, undefined, () => {\n // Lazy initialization of the initial state\n return {\n inProgress: InteractionStatus.Startup,\n accounts: instance.getAllAccounts()\n };\n });\n useEffect(() => {\n const callbackId = instance.addEventCallback(message => {\n updateState({\n payload: {\n instance,\n logger,\n message\n },\n type: MsalProviderActionType.EVENT\n });\n });\n logger.verbose(`MsalProvider - Registered event callback with id: ${callbackId}`);\n instance.initialize().then(() => {\n instance.handleRedirectPromise().catch(() => {\n // Errors should be handled by listening to the LOGIN_FAILURE event\n return;\n }).finally(() => {\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 */\n updateState({\n payload: {\n instance,\n logger\n },\n type: MsalProviderActionType.UNBLOCK_INPROGRESS\n });\n });\n });\n return () => {\n // Remove callback when component unmounts or accounts change\n if (callbackId) {\n logger.verbose(`MsalProvider - Removing event callback ${callbackId}`);\n instance.removeEventCallback(callbackId);\n }\n };\n }, [instance, logger]);\n const contextValue = {\n instance,\n inProgress: state.inProgress,\n accounts: state.accounts,\n logger\n };\n return React__default.createElement(MsalContext.Provider, {\n value: contextValue\n }, children);\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Returns Msal Context values\r\n */\n\nconst useMsal = () => useContext(MsalContext);\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n\nfunction isAuthenticated(allAccounts, matchAccount) {\n if (matchAccount && (matchAccount.username || matchAccount.homeAccountId || matchAccount.localAccountId)) {\n return !!getAccountByIdentifiers(allAccounts, matchAccount);\n }\n\n return allAccounts.length > 0;\n}\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 */\n\n\nfunction useIsAuthenticated(matchAccount) {\n const {\n accounts: allAccounts,\n inProgress\n } = useMsal();\n const [hasAuthenticated, setHasAuthenticated] = useState(() => {\n if (inProgress === InteractionStatus.Startup) {\n return false;\n }\n\n return isAuthenticated(allAccounts, matchAccount);\n });\n useEffect(() => {\n setHasAuthenticated(isAuthenticated(allAccounts, matchAccount));\n }, [allAccounts, matchAccount]);\n return hasAuthenticated;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Renders child components if user is authenticated\r\n * @param props\r\n */\n\nfunction AuthenticatedTemplate(_ref) {\n let {\n username,\n homeAccountId,\n localAccountId,\n children\n } = _ref;\n const context = useMsal();\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (isAuthenticated && context.inProgress !== InteractionStatus.Startup) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Renders child components if user is unauthenticated\r\n * @param props\r\n */\n\nfunction UnauthenticatedTemplate(_ref) {\n let {\n username,\n homeAccountId,\n localAccountId,\n children\n } = _ref;\n const context = useMsal();\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (!isAuthenticated && context.inProgress !== InteractionStatus.Startup && context.inProgress !== InteractionStatus.HandleRedirect) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n\nfunction getAccount(instance, accountIdentifiers) {\n if (!accountIdentifiers || !accountIdentifiers.homeAccountId && !accountIdentifiers.localAccountId && !accountIdentifiers.username) {\n // If no account identifiers are provided, return active account\n return instance.getActiveAccount();\n }\n\n return getAccountByIdentifiers(instance.getAllAccounts(), accountIdentifiers);\n}\n/**\r\n * Given 1 or more accountIdentifiers, returns the Account object if the user is signed-in\r\n * @param accountIdentifiers\r\n */\n\n\nfunction useAccount(accountIdentifiers) {\n const {\n instance,\n inProgress,\n logger\n } = useMsal();\n const [account, setAccount] = useState(() => getAccount(instance, accountIdentifiers));\n useEffect(() => {\n setAccount(currentAccount => {\n const nextAccount = getAccount(instance, accountIdentifiers);\n\n if (!AccountEntity.accountInfoIsEqual(currentAccount, nextAccount, true)) {\n logger.info(\"useAccount - Updating account\");\n return nextAccount;\n }\n\n return currentAccount;\n });\n }, [inProgress, accountIdentifiers, instance, logger]);\n return account;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\nconst ReactAuthErrorMessage = {\n invalidInteractionType: {\n code: \"invalid_interaction_type\",\n desc: \"The provided interaction type is invalid.\"\n },\n unableToFallbackToInteraction: {\n code: \"unable_to_fallback_to_interaction\",\n desc: \"Interaction is required but another interaction is already in progress. Please try again when the current interaction is complete.\"\n }\n};\nclass ReactAuthError extends AuthError {\n constructor(errorCode, errorMessage) {\n super(errorCode, errorMessage);\n Object.setPrototypeOf(this, ReactAuthError.prototype);\n this.name = \"ReactAuthError\";\n }\n\n static createInvalidInteractionTypeError() {\n return new ReactAuthError(ReactAuthErrorMessage.invalidInteractionType.code, ReactAuthErrorMessage.invalidInteractionType.desc);\n }\n\n static createUnableToFallbackToInteractionError() {\n return new ReactAuthError(ReactAuthErrorMessage.unableToFallbackToInteraction.code, ReactAuthErrorMessage.unableToFallbackToInteraction.desc);\n }\n\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\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 */\n\nfunction useMsalAuthentication(interactionType, authenticationRequest, accountIdentifiers) {\n const {\n instance,\n inProgress,\n logger\n } = useMsal();\n const isAuthenticated = useIsAuthenticated(accountIdentifiers);\n const account = useAccount(accountIdentifiers);\n const [[result, error], setResponse] = useState([null, null]); // Used to prevent state updates after unmount\n\n const mounted = useRef(true);\n useEffect(() => {\n return () => {\n mounted.current = false;\n };\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\n\n const interactionInProgress = useRef(inProgress !== InteractionStatus.None);\n useEffect(() => {\n interactionInProgress.current = inProgress !== InteractionStatus.None;\n }, [inProgress]); // Flag used to control when the hook calls login/acquireToken\n\n const shouldAcquireToken = useRef(true);\n useEffect(() => {\n if (!!error) {\n // Errors should be handled by consuming component\n shouldAcquireToken.current = false;\n return;\n }\n\n if (!!result) {\n // Token has already been acquired, consuming component/application is responsible for renewing\n shouldAcquireToken.current = false;\n return;\n }\n }, [error, result]);\n const login = useCallback(async (callbackInteractionType, callbackRequest) => {\n const loginType = callbackInteractionType || interactionType;\n const loginRequest = callbackRequest || authenticationRequest;\n\n switch (loginType) {\n case InteractionType.Popup:\n logger.verbose(\"useMsalAuthentication - Calling loginPopup\");\n return instance.loginPopup(loginRequest);\n\n case InteractionType.Redirect:\n // This promise is not expected to resolve due to full frame redirect\n logger.verbose(\"useMsalAuthentication - Calling loginRedirect\");\n return instance.loginRedirect(loginRequest).then(null);\n\n case InteractionType.Silent:\n logger.verbose(\"useMsalAuthentication - Calling ssoSilent\");\n return instance.ssoSilent(loginRequest);\n\n default:\n throw ReactAuthError.createInvalidInteractionTypeError();\n }\n }, [instance, interactionType, authenticationRequest, logger]);\n const acquireToken = useCallback(async (callbackInteractionType, callbackRequest) => {\n const fallbackInteractionType = callbackInteractionType || interactionType;\n let tokenRequest;\n\n if (callbackRequest) {\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the callback\");\n tokenRequest = { ...callbackRequest\n };\n } else if (authenticationRequest) {\n logger.trace(\"useMsalAuthentication - acquireToken - Using request provided in the hook\");\n tokenRequest = { ...authenticationRequest,\n scopes: authenticationRequest.scopes || OIDC_DEFAULT_SCOPES\n };\n } else {\n logger.trace(\"useMsalAuthentication - acquireToken - No request object provided, using default request.\");\n tokenRequest = {\n scopes: OIDC_DEFAULT_SCOPES\n };\n }\n\n if (!tokenRequest.account && account) {\n logger.trace(\"useMsalAuthentication - acquireToken - Attaching account to request\");\n tokenRequest.account = account;\n }\n\n const getToken = async () => {\n logger.verbose(\"useMsalAuthentication - Calling acquireTokenSilent\");\n return instance.acquireTokenSilent(tokenRequest).catch(async e => {\n if (e instanceof InteractionRequiredAuthError) {\n if (!interactionInProgress.current) {\n logger.error(\"useMsalAuthentication - Interaction required, falling back to interaction\");\n return login(fallbackInteractionType, tokenRequest);\n } else {\n logger.error(\"useMsalAuthentication - Interaction required but is already in progress. Please try again, if needed, after interaction completes.\");\n throw ReactAuthError.createUnableToFallbackToInteractionError();\n }\n }\n\n throw e;\n });\n };\n\n return getToken().then(response => {\n if (mounted.current) {\n setResponse([response, null]);\n }\n\n return response;\n }).catch(e => {\n if (mounted.current) {\n setResponse([null, e]);\n }\n\n throw e;\n });\n }, [instance, interactionType, authenticationRequest, logger, account, login]);\n useEffect(() => {\n const callbackId = instance.addEventCallback(message => {\n switch (message.eventType) {\n case EventType.LOGIN_SUCCESS:\n case EventType.SSO_SILENT_SUCCESS:\n if (message.payload) {\n setResponse([message.payload, null]);\n }\n\n break;\n\n case EventType.LOGIN_FAILURE:\n case EventType.SSO_SILENT_FAILURE:\n if (message.error) {\n setResponse([null, message.error]);\n }\n\n break;\n }\n });\n logger.verbose(`useMsalAuthentication - Registered event callback with id: ${callbackId}`);\n return () => {\n if (callbackId) {\n logger.verbose(`useMsalAuthentication - Removing event callback ${callbackId}`);\n instance.removeEventCallback(callbackId);\n }\n };\n }, [instance, logger]);\n useEffect(() => {\n if (shouldAcquireToken.current && inProgress === InteractionStatus.None) {\n shouldAcquireToken.current = false;\n\n if (!isAuthenticated) {\n logger.info(\"useMsalAuthentication - No user is authenticated, attempting to login\");\n login().catch(() => {\n // Errors are saved in state above\n return;\n });\n } else if (account) {\n logger.info(\"useMsalAuthentication - User is authenticated, attempting to acquire token\");\n acquireToken().catch(() => {\n // Errors are saved in state above\n return;\n });\n }\n }\n }, [isAuthenticated, account, inProgress, login, acquireToken, logger]);\n return {\n login,\n acquireToken,\n result,\n error\n };\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\n/**\r\n * Attempts to authenticate user if not already authenticated, then renders child components\r\n * @param props\r\n */\n\nfunction MsalAuthenticationTemplate(_ref) {\n let {\n interactionType,\n username,\n homeAccountId,\n localAccountId,\n authenticationRequest,\n loadingComponent: LoadingComponent,\n errorComponent: ErrorComponent,\n children\n } = _ref;\n const accountIdentifier = useMemo(() => {\n return {\n username,\n homeAccountId,\n localAccountId\n };\n }, [username, homeAccountId, localAccountId]);\n const context = useMsal();\n const msalAuthResult = useMsalAuthentication(interactionType, authenticationRequest, accountIdentifier);\n const isAuthenticated = useIsAuthenticated(accountIdentifier);\n\n if (msalAuthResult.error && context.inProgress === InteractionStatus.None) {\n if (!!ErrorComponent) {\n return React__default.createElement(ErrorComponent, Object.assign({}, msalAuthResult));\n }\n\n throw msalAuthResult.error;\n }\n\n if (isAuthenticated) {\n return React__default.createElement(React__default.Fragment, null, getChildrenOrFunction(children, msalAuthResult));\n }\n\n if (!!LoadingComponent && context.inProgress !== InteractionStatus.None) {\n return React__default.createElement(LoadingComponent, Object.assign({}, context));\n }\n\n return null;\n}\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\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 */\n\nconst withMsal = Component => {\n const ComponentWithMsal = props => {\n const msal = useMsal();\n return React__default.createElement(Component, Object.assign({}, props, {\n msalContext: msal\n }));\n };\n\n const componentName = Component.displayName || Component.name || \"Component\";\n ComponentWithMsal.displayName = `withMsal(${componentName})`;\n return ComponentWithMsal;\n};\n\nexport { AuthenticatedTemplate, MsalAuthenticationTemplate, MsalConsumer, MsalContext, MsalProvider, UnauthenticatedTemplate, useAccount, useIsAuthenticated, useMsal, useMsalAuthentication, version, withMsal };\n//# sourceMappingURL=msal-react.esm.js.map\n","const common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","const red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","const purple = {\n 50: '#f3e5f5',\n 100: '#e1bee7',\n 200: '#ce93d8',\n 300: '#ba68c8',\n 400: '#ab47bc',\n 500: '#9c27b0',\n 600: '#8e24aa',\n 700: '#7b1fa2',\n 800: '#6a1b9a',\n 900: '#4a148c',\n A100: '#ea80fc',\n A200: '#e040fb',\n A400: '#d500f9',\n A700: '#aa00ff'\n};\nexport default purple;","const blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","const lightBlue = {\n 50: '#e1f5fe',\n 100: '#b3e5fc',\n 200: '#81d4fa',\n 300: '#4fc3f7',\n 400: '#29b6f6',\n 500: '#03a9f4',\n 600: '#039be5',\n 700: '#0288d1',\n 800: '#0277bd',\n 900: '#01579b',\n A100: '#80d8ff',\n A200: '#40c4ff',\n A400: '#00b0ff',\n A700: '#0091ea'\n};\nexport default lightBlue;","const teal = {\n 50: '#e0f2f1',\n 100: '#b2dfdb',\n 200: '#80cbc4',\n 300: '#4db6ac',\n 400: '#26a69a',\n 500: '#009688',\n 600: '#00897b',\n 700: '#00796b',\n 800: '#00695c',\n 900: '#004d40',\n A100: '#a7ffeb',\n A200: '#64ffda',\n A400: '#1de9b6',\n A700: '#00bfa5'\n};\nexport default teal;","const green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","const orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","const grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#f5f5f5',\n A200: '#eeeeee',\n A400: '#bdbdbd',\n A700: '#616161'\n};\nexport default grey;","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.\n * @param {number} code\n */\nexport default function formatMuiErrorMessage(code) {\n // Apply babel-plugin-transform-template-literals in loose mode\n // loose mode is safe if we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n for (let i = 1; i < arguments.length; i += 1) {\n // rest params over-transpile for this case\n // eslint-disable-next-line prefer-rest-params\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","export default '$$material';","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import memoize from '@emotion/memoize';\n\n// eslint-disable-next-line no-undef\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport { isPropValid as default };\n","var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n\n return undefined;\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function\n /*: EmotionCache */\ncreateCache(options\n/*: Options */\n) {\n var key = options.key;\n\n if (key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node\n /*: HTMLStyleElement */\n ) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n var inserted = {};\n var container;\n /* : Node */\n\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node\n /*: HTMLStyleElement */\n ) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n /*: (\n selector: string,\n serialized: SerializedStyles,\n sheet: StyleSheet,\n shouldCache: boolean\n ) => string | void */\n\n\n var omnipresentPlugins = [compat, removeLabel];\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function\n /*: void */\n insert(selector\n /*: string */\n , serialized\n /*: SerializedStyles */\n , sheet\n /*: StyleSheet */\n , shouldCache\n /*: boolean */\n ) {\n currentSheet = sheet;\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache\n /*: EmotionCache */\n = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","var isBrowser = true;\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar isDevelopment = false;\n\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n var componentSelector = interpolation;\n\n if (componentSelector.__emotion_styles !== undefined) {\n\n return componentSelector;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n var keyframes = interpolation;\n\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n\n var serializedStyles = interpolation;\n\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = serializedStyles.styles + \";\";\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n var asString = interpolation;\n\n if (registered == null) {\n return asString;\n }\n\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n\n if (typeof value !== 'object') {\n var asString = value;\n\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g;\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n var templateStringsArr = strings;\n\n styles += templateStringsArr[i];\n }\n }\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\n\nexport { serializeStyles };\n","import * as React from 'react';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isDevelopment = false;\n\n/* import { type EmotionCache } from '@emotion/utils' */\nvar EmotionCacheContext\n/*: React.Context */\n= /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache()\n/*: EmotionCache | null*/\n{\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache\n/* > */\n(func\n/*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */\n)\n/*: React.AbstractComponent */\n{\n return /*#__PURE__*/forwardRef(function (props\n /*: Props */\n , ref\n /*: Ref */\n ) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme\n/*: Object */\n, theme\n/*: Object | (Object => Object) */\n) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n return mergedTheme;\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\n/*\ntype ThemeProviderProps = {\n theme: Object | (Object => Object),\n children: React.Node\n}\n*/\n\nvar ThemeProvider = function ThemeProvider(props\n/*: ThemeProviderProps */\n) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme\n/* */\n(Component\n/*: React.AbstractComponent */\n)\n/*: React.AbstractComponent<$Diff> */\n{\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n };\n\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar hasOwn = {}.hasOwnProperty;\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type\n/*: React.ElementType */\n, props\n/*: Object */\n) {\n\n var newProps\n /*: any */\n = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key)) {\n newProps[key] = props[key];\n }\n }\n\n newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(\n/* */\nfunction (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var key in props) {\n if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment )) {\n newProps[key] = props[key];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isDevelopment as i, useTheme as u, withEmotionCache as w };\n","function _extends() {\n return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _extends.apply(null, arguments);\n}\nmodule.exports = _extends, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isDevelopment } from './emotion-element-5486c51c.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-5486c51c.browser.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx\n/*: typeof React.createElement */\n= function jsx\n/*: typeof React.createElement */\n(type\n/*: React.ElementType */\n, props\n/*: Object */\n) {\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n }\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global\n/*: React.AbstractComponent<\nGlobalProps\n> */\n= /* #__PURE__ */withEmotionCache(function (props\n/*: GlobalProps */\n, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false;\n var node\n /*: HTMLStyleElement | null*/\n = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\n/* import type { Interpolation, SerializedStyles } from '@emotion/utils' */\n\nfunction css()\n/*: SerializedStyles */\n{\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\n/*\ntype Keyframes = {|\n name: string,\n styles: string,\n anim: 1,\n toString: () => string\n|} & string\n*/\n\nvar keyframes = function\n /*: Keyframes */\nkeyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name;\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n};\n\n/*\ntype ClassNameArg =\n | string\n | boolean\n | { [key: string]: boolean }\n | Array\n | null\n | void\n*/\n\nvar classnames = function\n /*: string */\nclassnames(args\n/*: Array */\n) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered\n/*: Object */\n, css\n/*: (...args: Array) => string */\n, className\n/*: string */\n) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n/*\ntype Props = {\n children: ({\n css: (...args: any) => string,\n cx: (...args: Array) => string,\n theme: Object\n }) => React.Node\n} */\n\n\nvar ClassNames\n/*: React.AbstractComponent*/\n= /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && isDevelopment) {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && isDevelopment) {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\n/* import type {\n ElementType,\n StatelessFunctionalComponent,\n AbstractComponent\n} from 'react' */\n/*\nexport type Interpolations = Array\n\nexport type StyledElementType =\n | string\n | AbstractComponent<{ ...Props, className: string }, mixed>\n\nexport type StyledOptions = {\n label?: string,\n shouldForwardProp?: string => boolean,\n target?: string\n}\n\nexport type StyledComponent = StatelessFunctionalComponent & {\n defaultProps: any,\n toString: () => string,\n withComponent: (\n nextTag: StyledElementType,\n nextOptions?: StyledOptions\n ) => StyledComponent\n}\n\nexport type PrivateStyledComponent = StyledComponent & {\n __emotion_real: StyledComponent,\n __emotion_base: any,\n __emotion_styles: any,\n __emotion_forwardProp: any\n}\n*/\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key\n/*: string */\n) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag\n/*: ElementType */\n) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag\n/*: PrivateStyledComponent */\n, options\n/*: StyledOptions | void */\n, isReal\n/*: boolean */\n) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName\n /*: string */\n ) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n/*\nexport type CreateStyledComponent = (\n ...args: Interpolations\n) => StyledComponent\n\nexport type CreateStyled = {\n (\n tag: StyledElementType,\n options?: StyledOptions\n ): (...args: Interpolations) => StyledComponent,\n [key: string]: CreateStyledComponent,\n bind: () => CreateStyled\n}\n*/\n\nvar isDevelopment = false;\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled\n/*: CreateStyled */\n= function createStyled\n/*: CreateStyled */\n(tag\n/*: any */\n, options\n/* ?: StyledOptions */\n) {\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n /* return function(): PrivateStyledComponent { */\n\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n\n styles.push(args[i], args[0][i]);\n }\n }\n\n var Styled\n /*: PrivateStyledComponent */\n = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = React.useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if (finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/React.createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && isDevelopment) {\n return 'NO_COMPONENT_SELECTOR';\n }\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag\n /*: StyledElementType */\n , nextOptions\n /* ?: StyledOptions */\n ) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport { createStyled as default };\n","import createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\nimport '@emotion/use-insertion-effect-with-fallbacks';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport { newStyled as default };\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nfunction emptyFunction() {}\nfunction emptyFunctionWithReset() {}\nemptyFunctionWithReset.resetWarningCache = emptyFunction;\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n var err = new Error(\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n err.name = 'Invariant Violation';\n throw err;\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bigint: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n elementType: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim,\n\n checkPropTypes: emptyFunctionWithReset,\n resetWarningCache: emptyFunction\n };\n\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { CacheProvider } from '@emotion/react';\nimport createCache from '@emotion/cache';\n\n// prepend: true moves MUI styles to the top of the so they're loaded first.\n// It allows developers to easily override MUI styles with other styling solutions, like CSS modules.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nlet cache;\nif (typeof document === 'object') {\n cache = createCache({\n key: 'css',\n prepend: true\n });\n}\nexport default function StyledEngineProvider(props) {\n const {\n injectFirst,\n children\n } = props;\n return injectFirst && cache ? /*#__PURE__*/_jsx(CacheProvider, {\n value: cache,\n children: children\n }) : children;\n}\nprocess.env.NODE_ENV !== \"production\" ? StyledEngineProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * By default, the styles are injected last in the element of the page.\n * As a result, they gain more specificity than any other style sheet.\n * If you want to override MUI's styles, set this prop.\n */\n injectFirst: PropTypes.bool\n} : void 0;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Global } from '@emotion/react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isEmpty(obj) {\n return obj === undefined || obj === null || Object.keys(obj).length === 0;\n}\nexport default function GlobalStyles(props) {\n const {\n styles,\n defaultTheme = {}\n } = props;\n const globalStyles = typeof styles === 'function' ? themeInput => styles(isEmpty(themeInput) ? defaultTheme : themeInput) : styles;\n return /*#__PURE__*/_jsx(Global, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes = {\n defaultTheme: PropTypes.object,\n styles: PropTypes.oneOfType([PropTypes.array, PropTypes.string, PropTypes.object, PropTypes.func])\n} : void 0;","/**\n * @mui/styled-engine v5.16.6\n *\n * @license MIT\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport emStyled from '@emotion/styled';\nexport default function styled(tag, options) {\n const stylesFactory = emStyled(tag, options);\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n return stylesFactory(...styles);\n };\n }\n return stylesFactory;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const internal_processStyles = (tag, processor) => {\n // Emotion attaches all the styles as `__emotion_styles`.\n // Ref: https://github.com/emotion-js/emotion/blob/16d971d0da229596d6bcc39d282ba9753c9ee7cf/packages/styled/src/base.js#L186\n if (Array.isArray(tag.__emotion_styles)) {\n tag.__emotion_styles = processor(tag.__emotion_styles);\n }\n};\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from './StyledEngineProvider';\nexport { default as GlobalStyles } from './GlobalStyles';","import _extends from \"@babel/runtime/helpers/esm/extends\";\n// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\nexport function isPlainObject(item) {\n if (typeof item !== 'object' || item === null) {\n return false;\n }\n const prototype = Object.getPrototypeOf(item);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);\n}\nfunction deepClone(source) {\n if (!isPlainObject(source)) {\n return source;\n }\n const output = {};\n Object.keys(source).forEach(key => {\n output[key] = deepClone(source[key]);\n });\n return output;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n if (isPlainObject(source[key]) &&\n // Avoid prototype pollution\n Object.prototype.hasOwnProperty.call(target, key) && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else if (options.clone) {\n output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];\n } else {\n output[key] = source[key];\n }\n });\n }\n return output;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || [];\n // Sort in ascending order\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return _extends({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n};\n\n// Keep in mind that @media is inclusive by the CSS specification.\nexport default function createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n },\n unit = 'px',\n step = 5\n } = breakpoints,\n other = _objectWithoutPropertiesLoose(breakpoints, _excluded);\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n return up(key);\n }\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n return _extends({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}","const shape = {\n borderRadius: 4\n};\nexport default shape;","import deepmerge from '@mui/utils/deepmerge';\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n });\n}\nexport default merge;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport deepmerge from '@mui/utils/deepmerge';\nimport merge from './merge';\n\n// The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n};\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n return acc;\n }, {});\n }\n const output = styleFromPropValue(propValue);\n return output;\n}\nfunction breakpoints(styleFunction) {\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme\n }, props[key]));\n }\n return acc;\n }, null);\n return merge(base, extended);\n };\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\nexport function createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n const breakpointsInOrder = (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nexport function removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n if (isBreakpointUnused) {\n delete acc[key];\n }\n return acc;\n }, style);\n}\nexport function mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n}\n\n// compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n return base;\n}\nexport function resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n if (keys.length === 0) {\n return breakpointValues;\n }\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else if (typeof breakpointValues === 'object') {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous];\n previous = breakpoint;\n } else {\n acc[breakpoint] = breakpointValues;\n }\n return acc;\n }, {});\n}\nexport default breakpoints;","import _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.\n//\n// A strict capitalization should uppercase the first letter of each word in the sentence.\n// We only handle the first word.\nexport default function capitalize(string) {\n if (typeof string !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`capitalize(string)\\` expects a string argument.` : _formatMuiErrorMessage(7));\n }\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","import capitalize from '@mui/utils/capitalize';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path, checkVars = true) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n // Check if CSS variables are used\n if (obj && obj.vars && checkVars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n if (val != null) {\n return val;\n }\n }\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n return null;\n }, obj);\n}\nexport function getStyleValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n if (transform) {\n value = transform(value, userValue, themeMapping);\n }\n return value;\n}\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n const styleFromPropValue = propValueFinal => {\n let value = getStyleValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getStyleValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\nexport default style;","export default function memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}","import responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport { getPath } from './style';\nimport merge from './merge';\nimport memoize from './memoize';\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n};\n\n// memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\nconst getCssProperties = memoize(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nexport const marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nexport const paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n const themeSpacing = (_getPath = getPath(theme, themeKey, false)) != null ? _getPath : defaultValue;\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n return themeSpacing * abs;\n };\n }\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n return themeSpacing[abs];\n };\n }\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n if (propValue >= 0) {\n return transformed;\n }\n if (typeof transformed === 'number') {\n return -transformed;\n }\n return `-${transformed}`;\n}\nexport function getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n}\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});\n}\nexport function margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nexport function padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","import { createUnarySpacing } from '../spacing';\n\n// The different signatures imply different meaning for their arguments that can't be expressed structurally.\n// We express the difference with variable names.\n\nexport default function createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n }\n\n // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://m2.material.io/design/layout/understanding-layout.html\n const transform = createUnarySpacing({\n spacing: spacingInput\n });\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n spacing.mui = true;\n return spacing;\n}","import merge from './merge';\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n // false positive\n // eslint-disable-next-line react/function-component-definition\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return merge(acc, handlers[prop](props));\n }\n return acc;\n }, {});\n };\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\nexport default compose;","import responsivePropType from './responsivePropType';\nimport style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nexport function borderTransform(value) {\n if (typeof value !== 'number') {\n return value;\n }\n return `${value}px solid`;\n}\nfunction createBorderStyle(prop, transform) {\n return style({\n prop,\n themeKey: 'borders',\n transform\n });\n}\nexport const border = createBorderStyle('border', borderTransform);\nexport const borderTop = createBorderStyle('borderTop', borderTransform);\nexport const borderRight = createBorderStyle('borderRight', borderTransform);\nexport const borderBottom = createBorderStyle('borderBottom', borderTransform);\nexport const borderLeft = createBorderStyle('borderLeft', borderTransform);\nexport const borderColor = createBorderStyle('borderColor');\nexport const borderTopColor = createBorderStyle('borderTopColor');\nexport const borderRightColor = createBorderStyle('borderRightColor');\nexport const borderBottomColor = createBorderStyle('borderBottomColor');\nexport const borderLeftColor = createBorderStyle('borderLeftColor');\nexport const outline = createBorderStyle('outline', borderTransform);\nexport const outlineColor = createBorderStyle('outlineColor');\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius, outline, outlineColor);\nexport default borders;","import style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nimport responsivePropType from './responsivePropType';\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\n\n// false positive\n// eslint-disable-next-line react/function-component-definition\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;","import style from './style';\nimport compose from './compose';\nexport function paletteTransform(value, userValue) {\n if (userValue === 'grey') {\n return userValue;\n }\n return value;\n}\nexport const color = style({\n prop: 'color',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette',\n transform: paletteTransform\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;","import style from './style';\nimport compose from './compose';\nimport { handleBreakpoints, values as breakpointsValues } from './breakpoints';\nexport function sizingTransform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\nexport const width = style({\n prop: 'width',\n transform: sizingTransform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme2;\n const breakpoint = ((_props$theme = props.theme) == null || (_props$theme = _props$theme.breakpoints) == null || (_props$theme = _props$theme.values) == null ? void 0 : _props$theme[propValue]) || breakpointsValues[propValue];\n if (!breakpoint) {\n return {\n maxWidth: sizingTransform(propValue)\n };\n }\n if (((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.breakpoints) == null ? void 0 : _props$theme2.unit) !== 'px') {\n return {\n maxWidth: `${breakpoint}${props.theme.breakpoints.unit}`\n };\n }\n return {\n maxWidth: breakpoint\n };\n };\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform: sizingTransform\n});\nexport const height = style({\n prop: 'height',\n transform: sizingTransform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform: sizingTransform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform: sizingTransform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform: sizingTransform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform: sizingTransform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;","import { padding, margin } from '../spacing';\nimport { borderRadius, borderTransform } from '../borders';\nimport { gap, rowGap, columnGap } from '../cssGrid';\nimport { paletteTransform } from '../palette';\nimport { maxWidth, sizingTransform } from '../sizing';\nconst defaultSxConfig = {\n // borders\n border: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderTop: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderRight: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderBottom: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderLeft: {\n themeKey: 'borders',\n transform: borderTransform\n },\n borderColor: {\n themeKey: 'palette'\n },\n borderTopColor: {\n themeKey: 'palette'\n },\n borderRightColor: {\n themeKey: 'palette'\n },\n borderBottomColor: {\n themeKey: 'palette'\n },\n borderLeftColor: {\n themeKey: 'palette'\n },\n outline: {\n themeKey: 'borders',\n transform: borderTransform\n },\n outlineColor: {\n themeKey: 'palette'\n },\n borderRadius: {\n themeKey: 'shape.borderRadius',\n style: borderRadius\n },\n // palette\n color: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n bgcolor: {\n themeKey: 'palette',\n cssProperty: 'backgroundColor',\n transform: paletteTransform\n },\n backgroundColor: {\n themeKey: 'palette',\n transform: paletteTransform\n },\n // spacing\n p: {\n style: padding\n },\n pt: {\n style: padding\n },\n pr: {\n style: padding\n },\n pb: {\n style: padding\n },\n pl: {\n style: padding\n },\n px: {\n style: padding\n },\n py: {\n style: padding\n },\n padding: {\n style: padding\n },\n paddingTop: {\n style: padding\n },\n paddingRight: {\n style: padding\n },\n paddingBottom: {\n style: padding\n },\n paddingLeft: {\n style: padding\n },\n paddingX: {\n style: padding\n },\n paddingY: {\n style: padding\n },\n paddingInline: {\n style: padding\n },\n paddingInlineStart: {\n style: padding\n },\n paddingInlineEnd: {\n style: padding\n },\n paddingBlock: {\n style: padding\n },\n paddingBlockStart: {\n style: padding\n },\n paddingBlockEnd: {\n style: padding\n },\n m: {\n style: margin\n },\n mt: {\n style: margin\n },\n mr: {\n style: margin\n },\n mb: {\n style: margin\n },\n ml: {\n style: margin\n },\n mx: {\n style: margin\n },\n my: {\n style: margin\n },\n margin: {\n style: margin\n },\n marginTop: {\n style: margin\n },\n marginRight: {\n style: margin\n },\n marginBottom: {\n style: margin\n },\n marginLeft: {\n style: margin\n },\n marginX: {\n style: margin\n },\n marginY: {\n style: margin\n },\n marginInline: {\n style: margin\n },\n marginInlineStart: {\n style: margin\n },\n marginInlineEnd: {\n style: margin\n },\n marginBlock: {\n style: margin\n },\n marginBlockStart: {\n style: margin\n },\n marginBlockEnd: {\n style: margin\n },\n // display\n displayPrint: {\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n },\n display: {},\n overflow: {},\n textOverflow: {},\n visibility: {},\n whiteSpace: {},\n // flexbox\n flexBasis: {},\n flexDirection: {},\n flexWrap: {},\n justifyContent: {},\n alignItems: {},\n alignContent: {},\n order: {},\n flex: {},\n flexGrow: {},\n flexShrink: {},\n alignSelf: {},\n justifyItems: {},\n justifySelf: {},\n // grid\n gap: {\n style: gap\n },\n rowGap: {\n style: rowGap\n },\n columnGap: {\n style: columnGap\n },\n gridColumn: {},\n gridRow: {},\n gridAutoFlow: {},\n gridAutoColumns: {},\n gridAutoRows: {},\n gridTemplateColumns: {},\n gridTemplateRows: {},\n gridTemplateAreas: {},\n gridArea: {},\n // positions\n position: {},\n zIndex: {\n themeKey: 'zIndex'\n },\n top: {},\n right: {},\n bottom: {},\n left: {},\n // shadows\n boxShadow: {\n themeKey: 'shadows'\n },\n // sizing\n width: {\n transform: sizingTransform\n },\n maxWidth: {\n style: maxWidth\n },\n minWidth: {\n transform: sizingTransform\n },\n height: {\n transform: sizingTransform\n },\n maxHeight: {\n transform: sizingTransform\n },\n minHeight: {\n transform: sizingTransform\n },\n boxSizing: {},\n // typography\n fontFamily: {\n themeKey: 'typography'\n },\n fontSize: {\n themeKey: 'typography'\n },\n fontStyle: {\n themeKey: 'typography'\n },\n fontWeight: {\n themeKey: 'typography'\n },\n letterSpacing: {},\n textTransform: {},\n lineHeight: {},\n textAlign: {},\n typography: {\n cssProperty: false,\n themeKey: 'typography'\n }\n};\nexport default defaultSxConfig;","import capitalize from '@mui/utils/capitalize';\nimport merge from '../merge';\nimport { getPath, getStyleValue as getValue } from '../style';\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from '../breakpoints';\nimport defaultSxConfig from './defaultSxConfig';\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function unstable_createStyleFunctionSx() {\n function getThemeValue(prop, val, theme, config) {\n const props = {\n [prop]: val,\n theme\n };\n const options = config[prop];\n if (!options) {\n return {\n [prop]: val\n };\n }\n const {\n cssProperty = prop,\n themeKey,\n transform,\n style\n } = options;\n if (val == null) {\n return null;\n }\n\n // TODO v6: remove, see https://github.com/mui/material-ui/pull/38123\n if (themeKey === 'typography' && val === 'inherit') {\n return {\n [prop]: val\n };\n }\n const themeMapping = getPath(theme, themeKey) || {};\n if (style) {\n return style(props);\n }\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n if (cssProperty === false) {\n return value;\n }\n return {\n [cssProperty]: value\n };\n };\n return handleBreakpoints(props, val, styleFromPropValue);\n }\n function styleFunctionSx(props) {\n var _theme$unstable_sxCon;\n const {\n sx,\n theme = {}\n } = props || {};\n if (!sx) {\n return null; // Emotion & styled-components will neglect null\n }\n const config = (_theme$unstable_sxCon = theme.unstable_sxConfig) != null ? _theme$unstable_sxCon : defaultSxConfig;\n\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n function traverse(sxInput) {\n let sxObject = sxInput;\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n if (!sxObject) {\n return null;\n }\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (config[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme, config));\n }\n }\n });\n return removeUnusedBreakpoints(breakpointsKeys, css);\n }\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;","/**\n * A universal utility to style components with multiple color modes. Always use it from the theme object.\n * It works with:\n * - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)\n * - [CSS theme variables](https://mui.com/material-ui/experimental-api/css-theme-variables/overview/)\n * - Zero-runtime engine\n *\n * Tips: Use an array over object spread and place `theme.applyStyles()` last.\n *\n * ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]\n *\n * 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}\n *\n * @example\n * 1. using with `styled`:\n * ```jsx\n * const Component = styled('div')(({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]);\n * ```\n *\n * @example\n * 2. using with `sx` prop:\n * ```jsx\n * [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ]}\n * />\n * ```\n *\n * @example\n * 3. theming a component:\n * ```jsx\n * extendTheme({\n * components: {\n * MuiButton: {\n * styleOverrides: {\n * root: ({ theme }) => [\n * { background: '#e5e5e5' },\n * theme.applyStyles('dark', {\n * background: '#1c1c1c',\n * color: '#fff',\n * }),\n * ],\n * },\n * }\n * }\n * })\n *```\n */\nexport default function applyStyles(key, styles) {\n // @ts-expect-error this is 'any' type\n const theme = this;\n if (theme.vars && typeof theme.getColorSchemeSelector === 'function') {\n // If CssVarsProvider is used as a provider,\n // returns '* :where([data-mui-color-scheme=\"light|dark\"]) &'\n const selector = theme.getColorSchemeSelector(key).replace(/(\\[[^\\]]+\\])/, '*:where($1)');\n return {\n [selector]: styles\n };\n }\n if (theme.palette.mode === key) {\n return styles;\n }\n return {};\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport createBreakpoints from './createBreakpoints';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport styleFunctionSx from '../styleFunctionSx/styleFunctionSx';\nimport defaultSxConfig from '../styleFunctionSx/defaultSxConfig';\nimport applyStyles from './applyStyles';\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: _extends({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: _extends({}, shape, shapeInput)\n }, other);\n muiTheme.applyStyles = applyStyles;\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nexport default createTheme;","'use client';\n\nimport * as React from 'react';\nimport { ThemeContext } from '@mui/styled-engine';\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction useTheme(defaultTheme = null) {\n const contextTheme = React.useContext(ThemeContext);\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\nexport default useTheme;","'use client';\n\nimport createTheme from './createTheme';\nimport useThemeWithoutDefault from './useThemeWithoutDefault';\nexport const systemDefaultTheme = createTheme();\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\nexport default useTheme;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GlobalStyles as MuiGlobalStyles } from '@mui/styled-engine';\nimport useTheme from '../useTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction GlobalStyles({\n styles,\n themeId,\n defaultTheme = {}\n}) {\n const upperTheme = useTheme(defaultTheme);\n const globalStyles = typeof styles === 'function' ? styles(themeId ? upperTheme[themeId] || upperTheme : upperTheme) : styles;\n return /*#__PURE__*/_jsx(MuiGlobalStyles, {\n styles: globalStyles\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? GlobalStyles.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n defaultTheme: PropTypes.object,\n /**\n * @ignore\n */\n styles: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.array, PropTypes.func, PropTypes.number, PropTypes.object, PropTypes.string, PropTypes.bool]),\n /**\n * @ignore\n */\n themeId: PropTypes.string\n} : void 0;\nexport default GlobalStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"sx\"];\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport defaultSxConfig from './defaultSxConfig';\nconst splitProps = props => {\n var _props$theme$unstable, _props$theme;\n const result = {\n systemProps: {},\n otherProps: {}\n };\n const config = (_props$theme$unstable = props == null || (_props$theme = props.theme) == null ? void 0 : _props$theme.unstable_sxConfig) != null ? _props$theme$unstable : defaultSxConfig;\n Object.keys(props).forEach(prop => {\n if (config[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\nexport default function extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n if (!isPlainObject(result)) {\n return systemProps;\n }\n return _extends({}, systemProps, result);\n };\n } else {\n finalSx = _extends({}, systemProps, inSx);\n }\n return _extends({}, otherProps, {\n sx: finalSx\n });\n}","const defaultGenerator = componentName => componentName;\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n generate(componentName) {\n return generate(componentName);\n },\n reset() {\n generate = defaultGenerator;\n }\n };\n};\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t prop !== 'theme' && prop !== 'sx' && prop !== 'as'\n })(styleFunctionSx);\n const Box = /*#__PURE__*/React.forwardRef(function Box(inProps, ref) {\n const theme = useTheme(defaultTheme);\n const _extendSxProp = extendSxProp(inProps),\n {\n className,\n component = 'div'\n } = _extendSxProp,\n other = _objectWithoutPropertiesLoose(_extendSxProp, _excluded);\n return /*#__PURE__*/_jsx(BoxRoot, _extends({\n as: component,\n ref: ref,\n className: clsx(className, generateClassName ? generateClassName(defaultClassName) : defaultClassName),\n theme: themeId ? theme[themeId] || theme : theme\n }, other));\n });\n return Box;\n}","import ClassNameGenerator from '../ClassNameGenerator';\nexport const globalStateClasses = {\n active: 'active',\n checked: 'checked',\n completed: 'completed',\n disabled: 'disabled',\n error: 'error',\n expanded: 'expanded',\n focused: 'focused',\n focusVisible: 'focusVisible',\n open: 'open',\n readOnly: 'readOnly',\n required: 'required',\n selected: 'selected'\n};\nexport default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {\n const globalStateClass = globalStateClasses[slot];\n return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}\nexport function isGlobalState(slot) {\n return globalStateClasses[slot] !== undefined;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);\n });\n return result;\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nconst boxClasses = generateUtilityClasses('MuiBox', ['root']);\nexport default boxClasses;","'use client';\n\nimport PropTypes from 'prop-types';\nimport ClassNameGenerator from '@mui/utils/ClassNameGenerator';\nimport createBox from '../createBox';\nimport boxClasses from './boxClasses';\nconst Box = createBox({\n defaultClassName: boxClasses.root,\n generateClassName: ClassNameGenerator.generate\n});\nprocess.env.NODE_ENV !== \"production\" ? Box.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default Box;","/**\n * @license React\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var b=Symbol.for(\"react.element\"),c=Symbol.for(\"react.portal\"),d=Symbol.for(\"react.fragment\"),e=Symbol.for(\"react.strict_mode\"),f=Symbol.for(\"react.profiler\"),g=Symbol.for(\"react.provider\"),h=Symbol.for(\"react.context\"),k=Symbol.for(\"react.server_context\"),l=Symbol.for(\"react.forward_ref\"),m=Symbol.for(\"react.suspense\"),n=Symbol.for(\"react.suspense_list\"),p=Symbol.for(\"react.memo\"),q=Symbol.for(\"react.lazy\"),t=Symbol.for(\"react.offscreen\"),u;u=Symbol.for(\"react.module.reference\");\nfunction v(a){if(\"object\"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}exports.ContextConsumer=h;exports.ContextProvider=g;exports.Element=b;exports.ForwardRef=l;exports.Fragment=d;exports.Lazy=q;exports.Memo=p;exports.Portal=c;exports.Profiler=f;exports.StrictMode=e;exports.Suspense=m;\nexports.SuspenseList=n;exports.isAsyncMode=function(){return!1};exports.isConcurrentMode=function(){return!1};exports.isContextConsumer=function(a){return v(a)===h};exports.isContextProvider=function(a){return v(a)===g};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===b};exports.isForwardRef=function(a){return v(a)===l};exports.isFragment=function(a){return v(a)===d};exports.isLazy=function(a){return v(a)===q};exports.isMemo=function(a){return v(a)===p};\nexports.isPortal=function(a){return v(a)===c};exports.isProfiler=function(a){return v(a)===f};exports.isStrictMode=function(a){return v(a)===e};exports.isSuspense=function(a){return v(a)===m};exports.isSuspenseList=function(a){return v(a)===n};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||\"object\"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?!0:!1};exports.typeOf=v;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\n","import { ForwardRef, Memo } from 'react-is';\n\n// Simplified polyfill for IE11 support\n// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3\nconst fnNameMatchRegex = /^\\s*function(?:\\s|\\s*\\/\\*.*\\*\\/\\s*)+([^(\\s/]*)\\s*/;\nexport function getFunctionName(fn) {\n const match = `${fn}`.match(fnNameMatchRegex);\n const name = match && match[1];\n return name || '';\n}\nfunction getFunctionComponentName(Component, fallback = '') {\n return Component.displayName || Component.name || getFunctionName(Component) || fallback;\n}\nfunction getWrappedName(outerType, innerType, wrapperName) {\n const functionName = getFunctionComponentName(innerType);\n return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);\n}\n\n/**\n * cherry-pick from\n * https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js\n * originally forked from recompose/getDisplayName with added IE11 support\n */\nexport default function getDisplayName(Component) {\n if (Component == null) {\n return undefined;\n }\n if (typeof Component === 'string') {\n return Component;\n }\n if (typeof Component === 'function') {\n return getFunctionComponentName(Component, 'Component');\n }\n\n // TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`\n if (typeof Component === 'object') {\n switch (Component.$$typeof) {\n case ForwardRef:\n return getWrappedName(Component, Component.render, 'ForwardRef');\n case Memo:\n return getWrappedName(Component, Component.type, 'memo');\n default:\n return undefined;\n }\n }\n return undefined;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nimport styledEngineStyled, { internal_processStyles as processStyles } from '@mui/styled-engine';\nimport { isPlainObject } from '@mui/utils/deepmerge';\nimport capitalize from '@mui/utils/capitalize';\nimport getDisplayName from '@mui/utils/getDisplayName';\nimport createTheme from './createTheme';\nimport styleFunctionSx from './styleFunctionSx';\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport const systemDefaultTheme = createTheme();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle(_extends({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, _extends({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = _objectWithoutPropertiesLoose(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props(_extends({\n ownerState\n }, props, ownerState));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style(_extends({\n ownerState\n }, props, ownerState)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nexport default function createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return styleFunctionSx(_extends({}, props, {\n theme: resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n processStyles(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = _objectWithoutPropertiesLoose(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = styledEngineStyled(tag, _extends({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || isPlainObject(stylesArg)) {\n return props => processStyleArg(stylesArg, _extends({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, _extends({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme(_extends({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, _extends({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${capitalize(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${getDisplayName(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","import createStyled from './createStyled';\nconst styled = createStyled();\nexport default styled;","import _extends from \"@babel/runtime/helpers/esm/extends\";\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n Object.keys(defaultProps).forEach(propName => {\n if (propName.toString().match(/^(components|slots)$/)) {\n output[propName] = _extends({}, defaultProps[propName], output[propName]);\n } else if (propName.toString().match(/^(componentsProps|slotProps)$/)) {\n const defaultSlotProps = defaultProps[propName] || {};\n const slotProps = props[propName];\n output[propName] = {};\n if (!slotProps || !Object.keys(slotProps)) {\n // Reduce the iteration if the slot props is empty\n output[propName] = defaultSlotProps;\n } else if (!defaultSlotProps || !Object.keys(defaultSlotProps)) {\n // Reduce the iteration if the default slot props is empty\n output[propName] = slotProps;\n } else {\n output[propName] = _extends({}, slotProps);\n Object.keys(defaultSlotProps).forEach(slotPropName => {\n output[propName][slotPropName] = resolveProps(defaultSlotProps[slotPropName], slotProps[slotPropName]);\n });\n }\n } else if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\n}","import resolveProps from '@mui/utils/resolveProps';\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n return resolveProps(theme.components[name].defaultProps, props);\n}","'use client';\n\nimport getThemeProps from './getThemeProps';\nimport useTheme from '../useTheme';\nexport default function useThemeProps({\n props,\n name,\n defaultTheme,\n themeId\n}) {\n let theme = useTheme(defaultTheme);\n if (themeId) {\n theme = theme[themeId] || theme;\n }\n const mergedProps = getThemeProps({\n theme,\n name,\n props\n });\n return mergedProps;\n}","'use client';\n\nimport * as React from 'react';\n\n/**\n * A version of `React.useLayoutEffect` that does not show a warning when server-side rendering.\n * This is useful for effects that are only needed for client-side rendering but not for SSR.\n *\n * Before you use this hook, make sure to read https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * and confirm it doesn't apply to your use-case.\n */\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '@mui/utils/useEnhancedEffect';\nimport { getThemeProps } from '../useThemeProps';\nimport useTheme from '../useThemeWithoutDefault';\n\n/**\n * @deprecated Not used internally. Use `MediaQueryListEvent` from lib.dom.d.ts instead.\n */\n\n/**\n * @deprecated Not used internally. Use `MediaQueryList` from lib.dom.d.ts instead.\n */\n\n/**\n * @deprecated Not used internally. Use `(event: MediaQueryListEvent) => void` instead.\n */\n\nfunction useMediaQueryOld(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n const [match, setMatch] = React.useState(() => {\n if (noSsr && matchMedia) {\n return matchMedia(query).matches;\n }\n if (ssrMatchMedia) {\n return ssrMatchMedia(query).matches;\n }\n\n // Once the component is mounted, we rely on the\n // event listeners to return the correct matches value.\n return defaultMatches;\n });\n useEnhancedEffect(() => {\n let active = true;\n if (!matchMedia) {\n return undefined;\n }\n const queryList = matchMedia(query);\n const updateMatch = () => {\n // Workaround Safari wrong implementation of matchMedia\n // TODO can we remove it?\n // https://github.com/mui/material-ui/pull/17315#issuecomment-528286677\n if (active) {\n setMatch(queryList.matches);\n }\n };\n updateMatch();\n // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n queryList.addListener(updateMatch);\n return () => {\n active = false;\n queryList.removeListener(updateMatch);\n };\n }, [query, matchMedia]);\n return match;\n}\n\n// eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseSyncExternalStore = React['useSyncExternalStore' + ''];\nfunction useMediaQueryNew(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr) {\n const getDefaultSnapshot = React.useCallback(() => defaultMatches, [defaultMatches]);\n const getServerSnapshot = React.useMemo(() => {\n if (noSsr && matchMedia) {\n return () => matchMedia(query).matches;\n }\n if (ssrMatchMedia !== null) {\n const {\n matches\n } = ssrMatchMedia(query);\n return () => matches;\n }\n return getDefaultSnapshot;\n }, [getDefaultSnapshot, query, ssrMatchMedia, noSsr, matchMedia]);\n const [getSnapshot, subscribe] = React.useMemo(() => {\n if (matchMedia === null) {\n return [getDefaultSnapshot, () => () => {}];\n }\n const mediaQueryList = matchMedia(query);\n return [() => mediaQueryList.matches, notify => {\n // TODO: Use `addEventListener` once support for Safari < 14 is dropped\n mediaQueryList.addListener(notify);\n return () => {\n mediaQueryList.removeListener(notify);\n };\n }];\n }, [getDefaultSnapshot, matchMedia, query]);\n const match = maybeReactUseSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n return match;\n}\nexport default function useMediaQuery(queryInput, options = {}) {\n const theme = useTheme();\n // Wait for jsdom to support the match media feature.\n // All the browsers MUI support have this built-in.\n // This defensive check is here for simplicity.\n // Most of the time, the match media logic isn't central to people tests.\n const supportMatchMedia = typeof window !== 'undefined' && typeof window.matchMedia !== 'undefined';\n const {\n defaultMatches = false,\n matchMedia = supportMatchMedia ? window.matchMedia : null,\n ssrMatchMedia = null,\n noSsr = false\n } = getThemeProps({\n name: 'MuiUseMediaQuery',\n props: options,\n theme\n });\n if (process.env.NODE_ENV !== 'production') {\n if (typeof queryInput === 'function' && theme === null) {\n console.error(['MUI: The `query` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n }\n }\n let query = typeof queryInput === 'function' ? queryInput(theme) : queryInput;\n query = query.replace(/^@media( ?)/m, '');\n\n // TODO: Drop `useMediaQueryOld` and use `use-sync-external-store` shim in `useMediaQueryNew` once the package is stable\n const useMediaQueryImplementation = maybeReactUseSyncExternalStore !== undefined ? useMediaQueryNew : useMediaQueryOld;\n const match = useMediaQueryImplementation(query, defaultMatches, matchMedia, ssrMatchMedia, noSsr);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue({\n query,\n match\n });\n }\n return match;\n}","function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {\n return Math.max(min, Math.min(val, max));\n}\nexport default clamp;","import _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\n/* eslint-disable @typescript-eslint/naming-convention */\nimport clamp from '@mui/utils/clamp';\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return clamp(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : _formatMuiErrorMessage(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : _formatMuiErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexport const private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nexport function private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nexport function private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nexport function private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nexport function blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\n}","// Corresponds to 10 frames at 60 Hz.\n// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.\nexport default function debounce(func, wait = 166) {\n let timeout;\n function debounced(...args) {\n const later = () => {\n // @ts-ignore\n func.apply(this, args);\n };\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n return debounced;\n}","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<>';\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n return null;\n };\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n var _muiName, _element$type;\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf( // For server components `muiName` is avaialble in element.type._payload.value.muiName\n // relevant info - https://github.com/facebook/react/blob/2807d781a08db8e9873687fccc25c0f12b4fb3d4/packages/react/src/ReactLazy.js#L45\n // eslint-disable-next-line no-underscore-dangle\n (_muiName = element.type.muiName) != null ? _muiName : (_element$type = element.type) == null || (_element$type = _element$type._payload) == null || (_element$type = _element$type.value) == null ? void 0 : _element$type.muiName) !== -1;\n}","export default function ownerDocument(node) {\n return node && node.ownerDocument || document;\n}","import ownerDocument from '../ownerDocument';\nexport default function ownerWindow(node) {\n const doc = ownerDocument(node);\n return doc.defaultView || window;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n // eslint-disable-next-line react/forbid-foreign-prop-types\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n return null;\n };\n return requireProp;\n}","/**\n * TODO v5: consider making it private\n *\n * passes {value} to {ref}\n *\n * WARNING: Be sure to only call this inside a callback that is passed as a ref.\n * Otherwise, make sure to cleanup the previous {ref} if it changes. See\n * https://github.com/mui/material-ui/issues/13539\n *\n * Useful if you want to expose the ref of an inner component to the public API\n * while still using it inside the component.\n * @param ref A ref callback or ref object. If anything falsy, this is a no-op.\n */\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","'use client';\n\nimport * as React from 'react';\nlet globalId = 0;\nfunction useGlobalId(idOverride) {\n const [defaultId, setDefaultId] = React.useState(idOverride);\n const id = idOverride || defaultId;\n React.useEffect(() => {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the incrementing value for client-side rendering only.\n // We can't use it server-side.\n // If you want to use random values please consider the Birthday Problem: https://en.wikipedia.org/wiki/Birthday_problem\n globalId += 1;\n setDefaultId(`mui-${globalId}`);\n }\n }, [defaultId]);\n return id;\n}\n\n// downstream bundlers may remove unnecessary concatenation, but won't remove toString call -- Workaround for https://github.com/webpack/webpack/issues/14814\nconst maybeReactUseId = React['useId'.toString()];\n/**\n *\n * @example
\n * @param idOverride\n * @returns {string}\n */\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n return useGlobalId(idOverride);\n}","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n const propFullNameSafe = propFullName || propName;\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n return null;\n}","'use client';\n\n/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && !Object.is(defaultValue, defaultProp)) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","'use client';\n\nimport * as React from 'react';\nimport useEnhancedEffect from '../useEnhancedEffect';\n\n/**\n * Inspired by https://github.com/facebook/react/issues/14099#issuecomment-440013892\n * See RFC in https://github.com/reactjs/rfcs/pull/220\n */\n\nfunction useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useRef((...args) =>\n // @ts-expect-error hide `this`\n (0, ref.current)(...args)).current;\n}\nexport default useEventCallback;","'use client';\n\nimport * as React from 'react';\nimport setRef from '../setRef';\nexport default function useForkRef(...refs) {\n /**\n * This will create a new function if the refs passed to this hook change and are all defined.\n * This means react will call the old forkRef with `null` and the new forkRef\n * with the ref. Cleanup naturally emerges from this behavior.\n */\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return instance => {\n refs.forEach(ref => {\n setRef(ref, instance);\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}","'use client';\n\nimport * as React from 'react';\nconst UNINITIALIZED = {};\n\n/**\n * A React.useRef() that is initialized lazily with a function. Note that it accepts an optional\n * initialization argument, so the initialization function doesn't need to be an inline closure.\n *\n * @usage\n * const ref = useLazyRef(sortColumns, columns)\n */\nexport default function useLazyRef(init, initArg) {\n const ref = React.useRef(UNINITIALIZED);\n if (ref.current === UNINITIALIZED) {\n ref.current = init(initArg);\n }\n return ref;\n}","'use client';\n\nimport * as React from 'react';\nconst EMPTY = [];\n\n/**\n * A React.useEffect equivalent that runs once, when the component is mounted.\n */\nexport default function useOnMount(fn) {\n /* eslint-disable react-hooks/exhaustive-deps */\n React.useEffect(fn, EMPTY);\n /* eslint-enable react-hooks/exhaustive-deps */\n}","'use client';\n\nimport useLazyRef from '../useLazyRef/useLazyRef';\nimport useOnMount from '../useOnMount/useOnMount';\nexport class Timeout {\n constructor() {\n this.currentId = null;\n this.clear = () => {\n if (this.currentId !== null) {\n clearTimeout(this.currentId);\n this.currentId = null;\n }\n };\n this.disposeEffect = () => {\n return this.clear;\n };\n }\n static create() {\n return new Timeout();\n }\n /**\n * Executes `fn` after `delay`, clearing any previously scheduled call.\n */\n start(delay, fn) {\n this.clear();\n this.currentId = setTimeout(() => {\n this.currentId = null;\n fn();\n }, delay);\n }\n}\nexport default function useTimeout() {\n const timeout = useLazyRef(Timeout.create).current;\n useOnMount(timeout.disposeEffect);\n return timeout;\n}","'use client';\n\n// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport { Timeout } from '../useTimeout/useTimeout';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nconst hadFocusVisibleRecentlyTimeout = new Timeout();\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n if (node.isContentEditable) {\n return true;\n }\n return false;\n}\n\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n hadKeyboardEvent = true;\n}\n\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n try {\n return target.matches(':focus-visible');\n } catch (error) {\n // Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n }\n\n // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n\n /**\n * Should be called if a blur event is fired\n */\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n hadFocusVisibleRecentlyTimeout.start(100, () => {\n hadFocusVisibleRecently = false;\n });\n isFocusVisibleRef.current = false;\n return true;\n }\n return false;\n }\n\n /**\n * Should be called if a blur event is fired\n */\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n return false;\n }\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nexport default function getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\n}","// Source from https://github.com/alitaheri/normalize-scroll-left\nlet cachedType;\n\n/**\n * Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type\n *\n * Types of scrollLeft, assuming scrollWidth=100 and direction is rtl.\n *\n * Type | <- Most Left | Most Right -> | Initial\n * ---------------- | ------------ | ------------- | -------\n * default | 0 | 100 | 100\n * negative (spec*) | -100 | 0 | 0\n * reverse | 100 | 0 | 0\n *\n * Edge 85: default\n * Safari 14: negative\n * Chrome 85: negative\n * Firefox 81: negative\n * IE11: reverse\n *\n * spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll\n */\nexport function detectScrollType() {\n if (cachedType) {\n return cachedType;\n }\n const dummy = document.createElement('div');\n const container = document.createElement('div');\n container.style.width = '10px';\n container.style.height = '1px';\n dummy.appendChild(container);\n dummy.dir = 'rtl';\n dummy.style.fontSize = '14px';\n dummy.style.width = '4px';\n dummy.style.height = '1px';\n dummy.style.position = 'absolute';\n dummy.style.top = '-1000px';\n dummy.style.overflow = 'scroll';\n document.body.appendChild(dummy);\n cachedType = 'reverse';\n if (dummy.scrollLeft > 0) {\n cachedType = 'default';\n } else {\n dummy.scrollLeft = 1;\n if (dummy.scrollLeft === 0) {\n cachedType = 'negative';\n }\n }\n document.body.removeChild(dummy);\n return cachedType;\n}\n\n// Based on https://stackoverflow.com/a/24394376\nexport function getNormalizedScrollLeft(element, direction) {\n const scrollLeft = element.scrollLeft;\n\n // Perform the calculations only when direction is rtl to avoid messing up the ltr behavior\n if (direction !== 'rtl') {\n return scrollLeft;\n }\n const type = detectScrollType();\n switch (type) {\n case 'negative':\n return element.scrollWidth - element.clientWidth + scrollLeft;\n case 'reverse':\n return element.scrollWidth - element.clientWidth - scrollLeft;\n default:\n return scrollLeft;\n }\n}","'use client';\n\nimport * as React from 'react';\nconst usePreviousProps = value => {\n const ref = React.useRef({});\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\nexport default usePreviousProps;","export default function composeClasses(slots, getUtilityClass, classes = undefined) {\n const output = {};\n Object.keys(slots).forEach(\n // `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.\n // @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208\n slot => {\n output[slot] = slots[slot].reduce((acc, key) => {\n if (key) {\n const utilityClass = getUtilityClass(key);\n if (utilityClass !== '') {\n acc.push(utilityClass);\n }\n if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n }\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * Determines if a given element is a DOM element name (i.e. not a React component).\n */\nfunction isHostComponent(element) {\n return typeof element === 'string';\n}\nexport default isHostComponent;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport isHostComponent from '../isHostComponent';\n\n/**\n * Type of the ownerState based on the type of an element it applies to.\n * This resolves to the provided OwnerState for React components and `undefined` for host components.\n * Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.\n */\n\n/**\n * Appends the ownerState object to the props, merging with the existing one if necessary.\n *\n * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.\n * @param otherProps Props of the element.\n * @param ownerState\n */\nfunction appendOwnerState(elementType, otherProps, ownerState) {\n if (elementType === undefined || isHostComponent(elementType)) {\n return otherProps;\n }\n return _extends({}, otherProps, {\n ownerState: _extends({}, otherProps.ownerState, ownerState)\n });\n}\nexport default appendOwnerState;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t prop.match(/^on[A-Z]/) && typeof object[prop] === 'function' && !excludeKeys.includes(prop)).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}\nexport default extractEventHandlers;","/**\n * Removes event handlers from the given object.\n * A field is considered an event handler if it is a function with a name beginning with `on`.\n *\n * @param object Object to remove event handlers from.\n * @returns Object with event handlers removed.\n */\nfunction omitEventHandlers(object) {\n if (object === undefined) {\n return {};\n }\n const result = {};\n Object.keys(object).filter(prop => !(prop.match(/^on[A-Z]/) && typeof object[prop] === 'function')).forEach(prop => {\n result[prop] = object[prop];\n });\n return result;\n}\nexport default omitEventHandlers;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport clsx from 'clsx';\nimport extractEventHandlers from '../extractEventHandlers';\nimport omitEventHandlers from '../omitEventHandlers';\n/**\n * Merges the slot component internal props (usually coming from a hook)\n * with the externally provided ones.\n *\n * The merge order is (the latter overrides the former):\n * 1. The internal props (specified as a getter function to work with get*Props hook result)\n * 2. Additional props (specified internally on a Base UI component)\n * 3. External props specified on the owner component. These should only be used on a root slot.\n * 4. External props specified in the `slotProps.*` prop.\n * 5. The `className` prop - combined from all the above.\n * @param parameters\n * @returns\n */\nfunction mergeSlotProps(parameters) {\n const {\n getSlotProps,\n additionalProps,\n externalSlotProps,\n externalForwardedProps,\n className\n } = parameters;\n if (!getSlotProps) {\n // The simpler case - getSlotProps is not defined, so no internal event handlers are defined,\n // so we can simply merge all the props without having to worry about extracting event handlers.\n const joinedClasses = clsx(additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, additionalProps, externalForwardedProps, externalSlotProps);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: undefined\n };\n }\n\n // In this case, getSlotProps is responsible for calling the external event handlers.\n // We don't need to include them in the merged props because of this.\n\n const eventHandlers = extractEventHandlers(_extends({}, externalForwardedProps, externalSlotProps));\n const componentsPropsWithoutEventHandlers = omitEventHandlers(externalSlotProps);\n const otherPropsWithoutEventHandlers = omitEventHandlers(externalForwardedProps);\n const internalSlotProps = getSlotProps(eventHandlers);\n\n // The order of classes is important here.\n // Emotion (that we use in libraries consuming Base UI) depends on this order\n // to properly override style. It requires the most important classes to be last\n // (see https://github.com/mui/material-ui/pull/33205) for the related discussion.\n const joinedClasses = clsx(internalSlotProps == null ? void 0 : internalSlotProps.className, additionalProps == null ? void 0 : additionalProps.className, className, externalForwardedProps == null ? void 0 : externalForwardedProps.className, externalSlotProps == null ? void 0 : externalSlotProps.className);\n const mergedStyle = _extends({}, internalSlotProps == null ? void 0 : internalSlotProps.style, additionalProps == null ? void 0 : additionalProps.style, externalForwardedProps == null ? void 0 : externalForwardedProps.style, externalSlotProps == null ? void 0 : externalSlotProps.style);\n const props = _extends({}, internalSlotProps, additionalProps, otherPropsWithoutEventHandlers, componentsPropsWithoutEventHandlers);\n if (joinedClasses.length > 0) {\n props.className = joinedClasses;\n }\n if (Object.keys(mergedStyle).length > 0) {\n props.style = mergedStyle;\n }\n return {\n props,\n internalRef: internalSlotProps.ref\n };\n}\nexport default mergeSlotProps;","/**\n * If `componentProps` is a function, calls it with the provided `ownerState`.\n * Otherwise, just returns `componentProps`.\n */\nfunction resolveComponentProps(componentProps, ownerState, slotState) {\n if (typeof componentProps === 'function') {\n return componentProps(ownerState, slotState);\n }\n return componentProps;\n}\nexport default resolveComponentProps;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"elementType\", \"externalSlotProps\", \"ownerState\", \"skipResolvingSlotProps\"];\nimport useForkRef from '../useForkRef';\nimport appendOwnerState from '../appendOwnerState';\nimport mergeSlotProps from '../mergeSlotProps';\nimport resolveComponentProps from '../resolveComponentProps';\n/**\n * @ignore - do not document.\n * Builds the props to be passed into the slot of an unstyled component.\n * It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.\n * If the slot component is not a host component, it also merges in the `ownerState`.\n *\n * @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.\n */\nfunction useSlotProps(parameters) {\n var _parameters$additiona;\n const {\n elementType,\n externalSlotProps,\n ownerState,\n skipResolvingSlotProps = false\n } = parameters,\n rest = _objectWithoutPropertiesLoose(parameters, _excluded);\n const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);\n const {\n props: mergedProps,\n internalRef\n } = mergeSlotProps(_extends({}, rest, {\n externalSlotProps: resolvedComponentsProps\n }));\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);\n const props = appendOwnerState(elementType, _extends({}, mergedProps, {\n ref\n }), ownerState);\n return props;\n}\nexport default useSlotProps;","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme;\n}","const hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport ThemeContext from '../useTheme/ThemeContext';\nimport useTheme from '../useTheme';\nimport nested from './nested';\n\n// To support composition of theme.\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mergeOuterLocalTheme(outerTheme, localTheme) {\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(outerTheme);\n if (process.env.NODE_ENV !== 'production') {\n if (!mergedTheme) {\n console.error(['MUI: You should return an object from your theme function, i.e.', ' ({})} />'].join('\\n'));\n }\n }\n return mergedTheme;\n }\n return _extends({}, outerTheme, localTheme);\n}\n\n/**\n * This component takes a `theme` prop.\n * It makes the `theme` available down the React tree thanks to React context.\n * This component should preferably be used at **the root of your component tree**.\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme\n } = props;\n const outerTheme = useTheme();\n if (process.env.NODE_ENV !== 'production') {\n if (outerTheme === null && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const theme = React.useMemo(() => {\n const output = outerTheme === null ? localTheme : mergeOuterLocalTheme(outerTheme, localTheme);\n if (output != null) {\n output[nested] = outerTheme !== null;\n }\n return output;\n }, [localTheme, outerTheme]);\n return /*#__PURE__*/_jsx(ThemeContext.Provider, {\n value: theme,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst RtlContext = /*#__PURE__*/React.createContext();\nfunction RtlProvider(_ref) {\n let {\n value\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n return /*#__PURE__*/_jsx(RtlContext.Provider, _extends({\n value: value != null ? value : true\n }, props));\n}\nprocess.env.NODE_ENV !== \"production\" ? RtlProvider.propTypes = {\n children: PropTypes.node,\n value: PropTypes.bool\n} : void 0;\nexport const useRtl = () => {\n const value = React.useContext(RtlContext);\n return value != null ? value : false;\n};\nexport default RtlProvider;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport resolveProps from '@mui/utils/resolveProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PropsContext = /*#__PURE__*/React.createContext(undefined);\nfunction DefaultPropsProvider({\n value,\n children\n}) {\n return /*#__PURE__*/_jsx(PropsContext.Provider, {\n value: value,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * @ignore\n */\n children: PropTypes.node,\n /**\n * @ignore\n */\n value: PropTypes.object\n} : void 0;\nfunction getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n if (!theme || !theme.components || !theme.components[name]) {\n return props;\n }\n const config = theme.components[name];\n if (config.defaultProps) {\n // compatible with v5 signature\n return resolveProps(config.defaultProps, props);\n }\n if (!config.styleOverrides && !config.variants) {\n // v6 signature, no property 'defaultProps'\n return resolveProps(config, props);\n }\n return props;\n}\nexport function useDefaultProps({\n props,\n name\n}) {\n const ctx = React.useContext(PropsContext);\n return getThemeProps({\n props,\n name,\n theme: {\n components: ctx\n }\n });\n}\nexport default DefaultPropsProvider;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as MuiThemeProvider, useTheme as usePrivateTheme } from '@mui/private-theming';\nimport exactProp from '@mui/utils/exactProp';\nimport { ThemeContext as StyledEngineThemeContext } from '@mui/styled-engine';\nimport useThemeWithoutDefault from '../useThemeWithoutDefault';\nimport RtlProvider from '../RtlProvider';\nimport DefaultPropsProvider from '../DefaultPropsProvider';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst EMPTY_THEME = {};\nfunction useThemeScoping(themeId, upperTheme, localTheme, isPrivate = false) {\n return React.useMemo(() => {\n const resolvedTheme = themeId ? upperTheme[themeId] || upperTheme : upperTheme;\n if (typeof localTheme === 'function') {\n const mergedTheme = localTheme(resolvedTheme);\n const result = themeId ? _extends({}, upperTheme, {\n [themeId]: mergedTheme\n }) : mergedTheme;\n // must return a function for the private theme to NOT merge with the upper theme.\n // see the test case \"use provided theme from a callback\" in ThemeProvider.test.js\n if (isPrivate) {\n return () => result;\n }\n return result;\n }\n return themeId ? _extends({}, upperTheme, {\n [themeId]: localTheme\n }) : _extends({}, upperTheme, localTheme);\n }, [themeId, upperTheme, localTheme, isPrivate]);\n}\n\n/**\n * This component makes the `theme` available down the React tree.\n * It should preferably be used at **the root of your component tree**.\n *\n * // existing use case\n * // theme scoping\n */\nfunction ThemeProvider(props) {\n const {\n children,\n theme: localTheme,\n themeId\n } = props;\n const upperTheme = useThemeWithoutDefault(EMPTY_THEME);\n const upperPrivateTheme = usePrivateTheme() || EMPTY_THEME;\n if (process.env.NODE_ENV !== 'production') {\n if (upperTheme === null && typeof localTheme === 'function' || themeId && upperTheme && !upperTheme[themeId] && typeof localTheme === 'function') {\n console.error(['MUI: You are providing a theme function prop to the ThemeProvider component:', ' outerTheme} />', '', 'However, no outer theme is present.', 'Make sure a theme is already injected higher in the React tree ' + 'or provide a theme object.'].join('\\n'));\n }\n }\n const engineTheme = useThemeScoping(themeId, upperTheme, localTheme);\n const privateTheme = useThemeScoping(themeId, upperPrivateTheme, localTheme, true);\n const rtlValue = engineTheme.direction === 'rtl';\n return /*#__PURE__*/_jsx(MuiThemeProvider, {\n theme: privateTheme,\n children: /*#__PURE__*/_jsx(StyledEngineThemeContext.Provider, {\n value: engineTheme,\n children: /*#__PURE__*/_jsx(RtlProvider, {\n value: rtlValue,\n children: /*#__PURE__*/_jsx(DefaultPropsProvider, {\n value: engineTheme == null ? void 0 : engineTheme.components,\n children: children\n })\n })\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired,\n /**\n * The design system's unique id for getting the corresponded theme when there are multiple design systems.\n */\n themeId: PropTypes.string\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = exactProp(ThemeProvider.propTypes) : void 0;\n}\nexport default ThemeProvider;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"disableGutters\", \"fixed\", \"maxWidth\", \"classes\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport composeClasses from '@mui/utils/composeClasses';\nimport capitalize from '@mui/utils/capitalize';\nimport useThemePropsSystem from '../useThemeProps';\nimport systemStyled from '../styled';\nimport createTheme from '../createTheme';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultTheme = createTheme();\nconst defaultCreateStyledComponent = systemStyled('div', {\n name: 'MuiContainer',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[`maxWidth${capitalize(String(ownerState.maxWidth))}`], ownerState.fixed && styles.fixed, ownerState.disableGutters && styles.disableGutters];\n }\n});\nconst useThemePropsDefault = inProps => useThemePropsSystem({\n props: inProps,\n name: 'MuiContainer',\n defaultTheme\n});\nconst useUtilityClasses = (ownerState, componentName) => {\n const getContainerUtilityClass = slot => {\n return generateUtilityClass(componentName, slot);\n };\n const {\n classes,\n fixed,\n disableGutters,\n maxWidth\n } = ownerState;\n const slots = {\n root: ['root', maxWidth && `maxWidth${capitalize(String(maxWidth))}`, fixed && 'fixed', disableGutters && 'disableGutters']\n };\n return composeClasses(slots, getContainerUtilityClass, classes);\n};\nexport default function createContainer(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiContainer'\n } = options;\n const ContainerRoot = createStyledComponent(({\n theme,\n ownerState\n }) => _extends({\n width: '100%',\n marginLeft: 'auto',\n boxSizing: 'border-box',\n marginRight: 'auto',\n display: 'block'\n }, !ownerState.disableGutters && {\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3)\n }\n }), ({\n theme,\n ownerState\n }) => ownerState.fixed && Object.keys(theme.breakpoints.values).reduce((acc, breakpointValueKey) => {\n const breakpoint = breakpointValueKey;\n const value = theme.breakpoints.values[breakpoint];\n if (value !== 0) {\n // @ts-ignore\n acc[theme.breakpoints.up(breakpoint)] = {\n maxWidth: `${value}${theme.breakpoints.unit}`\n };\n }\n return acc;\n }, {}), ({\n theme,\n ownerState\n }) => _extends({}, ownerState.maxWidth === 'xs' && {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up('xs')]: {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n maxWidth: Math.max(theme.breakpoints.values.xs, 444)\n }\n }, ownerState.maxWidth &&\n // @ts-ignore module augmentation fails if custom breakpoints are used\n ownerState.maxWidth !== 'xs' && {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n [theme.breakpoints.up(ownerState.maxWidth)]: {\n // @ts-ignore module augmentation fails if custom breakpoints are used\n maxWidth: `${theme.breakpoints.values[ownerState.maxWidth]}${theme.breakpoints.unit}`\n }\n }));\n const Container = /*#__PURE__*/React.forwardRef(function Container(inProps, ref) {\n const props = useThemeProps(inProps);\n const {\n className,\n component = 'div',\n disableGutters = false,\n fixed = false,\n maxWidth = 'lg'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n disableGutters,\n fixed,\n maxWidth\n });\n\n // @ts-ignore module augmentation fails if custom breakpoints are used\n const classes = useUtilityClasses(ownerState, componentName);\n return (\n /*#__PURE__*/\n // @ts-ignore theme is injected by the styled util\n _jsx(ContainerRoot, _extends({\n as: component\n // @ts-ignore module augmentation fails if custom breakpoints are used\n ,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other))\n );\n });\n process.env.NODE_ENV !== \"production\" ? Container.propTypes /* remove-proptypes */ = {\n children: PropTypes.node,\n classes: PropTypes.object,\n className: PropTypes.string,\n component: PropTypes.elementType,\n disableGutters: PropTypes.bool,\n fixed: PropTypes.bool,\n maxWidth: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]), PropTypes.string]),\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n } : void 0;\n return Container;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"component\", \"direction\", \"spacing\", \"divider\", \"children\", \"className\", \"useFlexGap\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport deepmerge from '@mui/utils/deepmerge';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport composeClasses from '@mui/utils/composeClasses';\nimport systemStyled from '../styled';\nimport useThemePropsSystem from '../useThemeProps';\nimport { extendSxProp } from '../styleFunctionSx';\nimport createTheme from '../createTheme';\nimport { handleBreakpoints, mergeBreakpointsInOrder, resolveBreakpointValues } from '../breakpoints';\nimport { createUnarySpacing, getValue } from '../spacing';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst defaultTheme = createTheme();\n// widening Theme to any so that the consumer can own the theme structure.\nconst defaultCreateStyledComponent = systemStyled('div', {\n name: 'MuiStack',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n});\nfunction useThemePropsDefault(props) {\n return useThemePropsSystem({\n props,\n name: 'MuiStack',\n defaultTheme\n });\n}\n\n/**\n * Return an array with the separator React element interspersed between\n * each React node of the input children.\n *\n * > joinChildren([1,2,3], 0)\n * [1,0,2,0,3]\n */\nfunction joinChildren(children, separator) {\n const childrenArray = React.Children.toArray(children).filter(Boolean);\n return childrenArray.reduce((output, child, index) => {\n output.push(child);\n if (index < childrenArray.length - 1) {\n output.push( /*#__PURE__*/React.cloneElement(separator, {\n key: `separator-${index}`\n }));\n }\n return output;\n }, []);\n}\nconst getSideFromDirection = direction => {\n return {\n row: 'Left',\n 'row-reverse': 'Right',\n column: 'Top',\n 'column-reverse': 'Bottom'\n }[direction];\n};\nexport const style = ({\n ownerState,\n theme\n}) => {\n let styles = _extends({\n display: 'flex',\n flexDirection: 'column'\n }, handleBreakpoints({\n theme\n }, resolveBreakpointValues({\n values: ownerState.direction,\n breakpoints: theme.breakpoints.values\n }), propValue => ({\n flexDirection: propValue\n })));\n if (ownerState.spacing) {\n const transformer = createUnarySpacing(theme);\n const base = Object.keys(theme.breakpoints.values).reduce((acc, breakpoint) => {\n if (typeof ownerState.spacing === 'object' && ownerState.spacing[breakpoint] != null || typeof ownerState.direction === 'object' && ownerState.direction[breakpoint] != null) {\n acc[breakpoint] = true;\n }\n return acc;\n }, {});\n const directionValues = resolveBreakpointValues({\n values: ownerState.direction,\n base\n });\n const spacingValues = resolveBreakpointValues({\n values: ownerState.spacing,\n base\n });\n if (typeof directionValues === 'object') {\n Object.keys(directionValues).forEach((breakpoint, index, breakpoints) => {\n const directionValue = directionValues[breakpoint];\n if (!directionValue) {\n const previousDirectionValue = index > 0 ? directionValues[breakpoints[index - 1]] : 'column';\n directionValues[breakpoint] = previousDirectionValue;\n }\n });\n }\n const styleFromPropValue = (propValue, breakpoint) => {\n if (ownerState.useFlexGap) {\n return {\n gap: getValue(transformer, propValue)\n };\n }\n return {\n // The useFlexGap={false} implement relies on each child to give up control of the margin.\n // We need to reset the margin to avoid double spacing.\n '& > :not(style):not(style)': {\n margin: 0\n },\n '& > :not(style) ~ :not(style)': {\n [`margin${getSideFromDirection(breakpoint ? directionValues[breakpoint] : ownerState.direction)}`]: getValue(transformer, propValue)\n }\n };\n };\n styles = deepmerge(styles, handleBreakpoints({\n theme\n }, spacingValues, styleFromPropValue));\n }\n styles = mergeBreakpointsInOrder(theme.breakpoints, styles);\n return styles;\n};\nexport default function createStack(options = {}) {\n const {\n // This will allow adding custom styled fn (for example for custom sx style function)\n createStyledComponent = defaultCreateStyledComponent,\n useThemeProps = useThemePropsDefault,\n componentName = 'MuiStack'\n } = options;\n const useUtilityClasses = () => {\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, slot => generateUtilityClass(componentName, slot), {});\n };\n const StackRoot = createStyledComponent(style);\n const Stack = /*#__PURE__*/React.forwardRef(function Grid(inProps, ref) {\n const themeProps = useThemeProps(inProps);\n const props = extendSxProp(themeProps); // `color` type conflicts with html color attribute.\n const {\n component = 'div',\n direction = 'column',\n spacing = 0,\n divider,\n children,\n className,\n useFlexGap = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = {\n direction,\n spacing,\n useFlexGap\n };\n const classes = useUtilityClasses();\n return /*#__PURE__*/_jsx(StackRoot, _extends({\n as: component,\n ownerState: ownerState,\n ref: ref,\n className: clsx(classes.root, className)\n }, other, {\n children: divider ? joinChildren(children, divider) : children\n }));\n });\n process.env.NODE_ENV !== \"production\" ? Stack.propTypes /* remove-proptypes */ = {\n children: PropTypes.node,\n direction: PropTypes.oneOfType([PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row']), PropTypes.arrayOf(PropTypes.oneOf(['column-reverse', 'column', 'row-reverse', 'row'])), PropTypes.object]),\n divider: PropTypes.node,\n spacing: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])), PropTypes.number, PropTypes.object, PropTypes.string]),\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n } : void 0;\n return Stack;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, mixins) {\n return _extends({\n toolbar: {\n minHeight: 56,\n [breakpoints.up('xs')]: {\n '@media (orientation: landscape)': {\n minHeight: 48\n }\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}","function _interopRequireDefault(e) {\n return e && e.__esModule ? e : {\n \"default\": e\n };\n}\nmodule.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.alpha = alpha;\nexports.blend = blend;\nexports.colorChannel = void 0;\nexports.darken = darken;\nexports.decomposeColor = decomposeColor;\nexports.emphasize = emphasize;\nexports.getContrastRatio = getContrastRatio;\nexports.getLuminance = getLuminance;\nexports.hexToRgb = hexToRgb;\nexports.hslToRgb = hslToRgb;\nexports.lighten = lighten;\nexports.private_safeAlpha = private_safeAlpha;\nexports.private_safeColorChannel = void 0;\nexports.private_safeDarken = private_safeDarken;\nexports.private_safeEmphasize = private_safeEmphasize;\nexports.private_safeLighten = private_safeLighten;\nexports.recomposeColor = recomposeColor;\nexports.rgbToHex = rgbToHex;\nvar _formatMuiErrorMessage2 = _interopRequireDefault(require(\"@mui/utils/formatMuiErrorMessage\"));\nvar _clamp = _interopRequireDefault(require(\"@mui/utils/clamp\"));\n/* eslint-disable @typescript-eslint/naming-convention */\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clampWrapper(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n return (0, _clamp.default)(value, min, max);\n}\n\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\nfunction hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\nfunction decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : (0, _formatMuiErrorMessage2.default)(9, color));\n }\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : (0, _formatMuiErrorMessage2.default)(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\nconst colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\nexports.colorChannel = colorChannel;\nconst private_safeColorChannel = (color, warning) => {\n try {\n return colorChannel(color);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n};\n\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla', 'color'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\nexports.private_safeColorChannel = private_safeColorChannel;\nfunction recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n return `${type}(${values})`;\n}\n\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\nfunction rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\nfunction hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\nfunction getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' || color.type === 'hsla' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n });\n\n // Truncate at 3 digits\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\nfunction getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction alpha(color, value) {\n color = decomposeColor(color);\n value = clampWrapper(value);\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n return recomposeColor(color);\n}\nfunction private_safeAlpha(color, value, warning) {\n try {\n return alpha(color, value);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeDarken(color, coefficient, warning) {\n try {\n return darken(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clampWrapper(coefficient);\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n return recomposeColor(color);\n}\nfunction private_safeLighten(color, coefficient, warning) {\n try {\n return lighten(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\nfunction emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\nfunction private_safeEmphasize(color, coefficient, warning) {\n try {\n return emphasize(color, coefficient);\n } catch (error) {\n if (warning && process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n return color;\n }\n}\n\n/**\n * Blend a transparent overlay color with a background color, resulting in a single\n * RGB color.\n * @param {string} background - CSS color\n * @param {string} overlay - CSS color\n * @param {number} opacity - Opacity multiplier in the range 0 - 1\n * @param {number} [gamma=1.0] - Gamma correction factor. For gamma-correct blending, 2.2 is usual.\n */\nfunction blend(background, overlay, opacity, gamma = 1.0) {\n const blendChannel = (b, o) => Math.round((b ** (1 / gamma) * (1 - opacity) + o ** (1 / gamma) * opacity) ** gamma);\n const backgroundColor = decomposeColor(background);\n const overlayColor = decomposeColor(overlay);\n const rgb = [blendChannel(backgroundColor.values[0], overlayColor.values[0]), blendChannel(backgroundColor.values[1], overlayColor.values[1]), blendChannel(backgroundColor.values[2], overlayColor.values[2])];\n return recomposeColor({\n type: 'rgb',\n values: rgb\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport { darken, getContrastRatio, lighten } from '@mui/system/colorManipulator';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport purple from '../colors/purple';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport lightBlue from '../colors/lightBlue';\nimport green from '../colors/green';\nexport const light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport const dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = _objectWithoutPropertiesLoose(palette, _excluded);\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode);\n\n // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n function getContrastText(background) {\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n return contrastText;\n }\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = _extends({}, color);\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n return color;\n };\n const modes = {\n dark,\n light\n };\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n const paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: _extends({}, common),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nimport deepmerge from '@mui/utils/deepmerge';\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n\n/**\n * @see @link{https://m2.material.io/design/typography/the-type-system.html}\n * @see @link{https://m2.material.io/design/typography/understanding-typography.html}\n */\nexport default function createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n const coef = fontSize / 14;\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps),\n // TODO v6: Remove handling of 'inherit' variant from the theme as it is already handled in Material UI's Typography component. Also, remember to remove the associated types.\n inherit: {\n fontFamily: 'inherit',\n fontWeight: 'inherit',\n fontSize: 'inherit',\n lineHeight: 'inherit',\n letterSpacing: 'inherit'\n }\n };\n return deepmerge(_extends({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n });\n}","const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n}\n\n// Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n};\n\n// Follow https://m2.material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n const constant = height / 36;\n\n // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nexport default function createTransitions(inputTransitions) {\n const mergedEasing = _extends({}, easing, inputTransitions.easing);\n const mergedDuration = _extends({}, duration, inputTransitions.duration);\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string';\n // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n const isNumber = value => !isNaN(parseFloat(value));\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n if (typeof options !== 'object') {\n console.error(['MUI: Secong argument of transition.create must be an object.', \"Arguments should be either `create('prop1', options)` or `create(['prop1', 'prop2'], options)`\"].join('\\n'));\n }\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n return _extends({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _formatMuiErrorMessage from \"@mui/utils/formatMuiErrorMessage\";\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nimport deepmerge from '@mui/utils/deepmerge';\nimport styleFunctionSx, { unstable_defaultSxConfig as defaultSxConfig } from '@mui/system/styleFunctionSx';\nimport systemCreateTheme from '@mui/system/createTheme';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport createTransitions from './createTransitions';\nimport zIndex from './zIndex';\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n if (options.vars) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: \\`vars\\` is a private field used for CSS variables support.\nPlease use another name.` : _formatMuiErrorMessage(18));\n }\n const palette = createPalette(paletteInput);\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n transitions: createTransitions(transitionsInput),\n zIndex: _extends({}, zIndex)\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n if (process.env.NODE_ENV !== 'production') {\n // TODO v6: Refactor to use globalStateClassesMapping from @mui/utils once `readOnly` state class is used in Rating component.\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n const traverse = (node, component) => {\n let key;\n\n // eslint-disable-next-line guard-for-in, no-restricted-syntax\n for (key in node) {\n const child = node[key];\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n }\n // Remove the style to prevent global conflicts.\n node[key] = {};\n }\n }\n };\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n muiTheme.unstable_sxConfig = _extends({}, defaultSxConfig, other == null ? void 0 : other.unstable_sxConfig);\n muiTheme.unstable_sx = function sx(props) {\n return styleFunctionSx({\n sx: props,\n theme: this\n });\n };\n return muiTheme;\n}\nlet warnedOnce = false;\nexport function createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n return createTheme(...args);\n}\nexport default createTheme;","export function isUnitless(value) {\n return String(parseFloat(value)).length === String(value).length;\n}\n\n// Ported from Compass\n// https://github.com/Compass/compass/blob/master/core/stylesheets/compass/typography/_units.scss\n// Emulate the sass function \"unit\"\nexport function getUnit(input) {\n return String(input).match(/[\\d.\\-+]*\\s*(.*)/)[1] || '';\n}\n\n// Emulate the sass function \"unitless\"\nexport function toUnitless(length) {\n return parseFloat(length);\n}\n\n// Convert any CSS or value to any another.\n// From https://github.com/KyleAMathews/convert-css-length\nexport function convertLength(baseFontSize) {\n return (length, toUnit) => {\n const fromUnit = getUnit(length);\n\n // Optimize for cases where `from` and `to` units are accidentally the same.\n if (fromUnit === toUnit) {\n return length;\n }\n\n // Convert input length to pixels.\n let pxLength = toUnitless(length);\n if (fromUnit !== 'px') {\n if (fromUnit === 'em') {\n pxLength = toUnitless(length) * toUnitless(baseFontSize);\n } else if (fromUnit === 'rem') {\n pxLength = toUnitless(length) * toUnitless(baseFontSize);\n }\n }\n\n // Convert length in pixels to the output unit\n let outputLength = pxLength;\n if (toUnit !== 'px') {\n if (toUnit === 'em') {\n outputLength = pxLength / toUnitless(baseFontSize);\n } else if (toUnit === 'rem') {\n outputLength = pxLength / toUnitless(baseFontSize);\n } else {\n return length;\n }\n }\n return parseFloat(outputLength.toFixed(5)) + toUnit;\n };\n}\nexport function alignProperty({\n size,\n grid\n}) {\n const sizeBelow = size - size % grid;\n const sizeAbove = sizeBelow + grid;\n return size - sizeBelow < sizeAbove - size ? sizeBelow : sizeAbove;\n}\n\n// fontGrid finds a minimal grid (in rem) for the fontSize values so that the\n// lineHeight falls under a x pixels grid, 4px in the case of Material Design,\n// without changing the relative line height\nexport function fontGrid({\n lineHeight,\n pixels,\n htmlFontSize\n}) {\n return pixels / (lineHeight * htmlFontSize);\n}\n\n/**\n * generate a responsive version of a given CSS property\n * @example\n * responsiveProperty({\n * cssProperty: 'fontSize',\n * min: 15,\n * max: 20,\n * unit: 'px',\n * breakpoints: [300, 600],\n * })\n *\n * // this returns\n *\n * {\n * fontSize: '15px',\n * '@media (min-width:300px)': {\n * fontSize: '17.5px',\n * },\n * '@media (min-width:600px)': {\n * fontSize: '20px',\n * },\n * }\n * @param {Object} params\n * @param {string} params.cssProperty - The CSS property to be made responsive\n * @param {number} params.min - The smallest value of the CSS property\n * @param {number} params.max - The largest value of the CSS property\n * @param {string} [params.unit] - The unit to be used for the CSS property\n * @param {Array.number} [params.breakpoints] - An array of breakpoints\n * @param {number} [params.alignStep] - Round scaled value to fall under this grid\n * @returns {Object} responsive styles for {params.cssProperty}\n */\nexport function responsiveProperty({\n cssProperty,\n min,\n max,\n unit = 'rem',\n breakpoints = [600, 900, 1200],\n transform = null\n}) {\n const output = {\n [cssProperty]: `${min}${unit}`\n };\n const factor = (max - min) / breakpoints[breakpoints.length - 1];\n breakpoints.forEach(breakpoint => {\n let value = min + factor * breakpoint;\n if (transform !== null) {\n value = transform(value);\n }\n output[`@media (min-width:${breakpoint}px)`] = {\n [cssProperty]: `${Math.round(value * 10000) / 10000}${unit}`\n };\n });\n return output;\n}","'use client';\n\nimport createTheme from './createTheme';\nconst defaultTheme = createTheme();\nexport default defaultTheme;","'use client';\n\nimport * as React from 'react';\nimport { useTheme as useThemeSystem } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nexport default function useTheme() {\n const theme = useThemeSystem(defaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n return theme[THEME_ID] || theme;\n}","'use client';\n\nimport systemUseThemeProps from '@mui/system/useThemeProps';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nexport default function useThemeProps({\n props,\n name\n}) {\n return systemUseThemeProps({\n props,\n name,\n defaultTheme,\n themeId: THEME_ID\n });\n}","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nmodule.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = createStyled;\nexports.shouldForwardProp = shouldForwardProp;\nexports.systemDefaultTheme = void 0;\nvar _extends2 = _interopRequireDefault(require(\"@babel/runtime/helpers/extends\"));\nvar _objectWithoutPropertiesLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/objectWithoutPropertiesLoose\"));\nvar _styledEngine = _interopRequireWildcard(require(\"@mui/styled-engine\"));\nvar _deepmerge = require(\"@mui/utils/deepmerge\");\nvar _capitalize = _interopRequireDefault(require(\"@mui/utils/capitalize\"));\nvar _getDisplayName = _interopRequireDefault(require(\"@mui/utils/getDisplayName\"));\nvar _createTheme = _interopRequireDefault(require(\"./createTheme\"));\nvar _styleFunctionSx = _interopRequireDefault(require(\"./styleFunctionSx\"));\nconst _excluded = [\"ownerState\"],\n _excluded2 = [\"variants\"],\n _excluded3 = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"];\n/* eslint-disable no-underscore-dangle */\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != typeof e && \"function\" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\n// https://github.com/emotion-js/emotion/blob/26ded6109fcd8ca9875cc2ce4564fee678a3f3c5/packages/styled/src/utils.js#L40\nfunction isStringTag(tag) {\n return typeof tag === 'string' &&\n // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96;\n}\n\n// Update /system/styled/#api in case if this changes\nfunction shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nconst systemDefaultTheme = exports.systemDefaultTheme = (0, _createTheme.default)();\nconst lowercaseFirstLetter = string => {\n if (!string) {\n return string;\n }\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\nfunction resolveTheme({\n defaultTheme,\n theme,\n themeId\n}) {\n return isEmpty(theme) ? defaultTheme : theme[themeId] || theme;\n}\nfunction defaultOverridesResolver(slot) {\n if (!slot) {\n return null;\n }\n return (props, styles) => styles[slot];\n}\nfunction processStyleArg(callableStyle, _ref) {\n let {\n ownerState\n } = _ref,\n props = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);\n const resolvedStylesArg = typeof callableStyle === 'function' ? callableStyle((0, _extends2.default)({\n ownerState\n }, props)) : callableStyle;\n if (Array.isArray(resolvedStylesArg)) {\n return resolvedStylesArg.flatMap(resolvedStyle => processStyleArg(resolvedStyle, (0, _extends2.default)({\n ownerState\n }, props)));\n }\n if (!!resolvedStylesArg && typeof resolvedStylesArg === 'object' && Array.isArray(resolvedStylesArg.variants)) {\n const {\n variants = []\n } = resolvedStylesArg,\n otherStyles = (0, _objectWithoutPropertiesLoose2.default)(resolvedStylesArg, _excluded2);\n let result = otherStyles;\n variants.forEach(variant => {\n let isMatch = true;\n if (typeof variant.props === 'function') {\n isMatch = variant.props((0, _extends2.default)({\n ownerState\n }, props, ownerState));\n } else {\n Object.keys(variant.props).forEach(key => {\n if ((ownerState == null ? void 0 : ownerState[key]) !== variant.props[key] && props[key] !== variant.props[key]) {\n isMatch = false;\n }\n });\n }\n if (isMatch) {\n if (!Array.isArray(result)) {\n result = [result];\n }\n result.push(typeof variant.style === 'function' ? variant.style((0, _extends2.default)({\n ownerState\n }, props, ownerState)) : variant.style);\n }\n });\n return result;\n }\n return resolvedStylesArg;\n}\nfunction createStyled(input = {}) {\n const {\n themeId,\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp\n } = input;\n const systemSx = props => {\n return (0, _styleFunctionSx.default)((0, _extends2.default)({}, props, {\n theme: resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }))\n }));\n };\n systemSx.__mui_systemSx = true;\n return (tag, inputOptions = {}) => {\n // Filter out the `sx` style function from the previous styled component to prevent unnecessary styles generated by the composite components.\n (0, _styledEngine.internal_processStyles)(tag, styles => styles.filter(style => !(style != null && style.__mui_systemSx)));\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n overridesResolver = defaultOverridesResolver(lowercaseFirstLetter(componentSlot))\n } = inputOptions,\n options = (0, _objectWithoutPropertiesLoose2.default)(inputOptions, _excluded3);\n\n // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver :\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n componentSlot && componentSlot !== 'Root' && componentSlot !== 'root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n // TODO v6: remove `lowercaseFirstLetter()` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n let shouldForwardPropOption = shouldForwardProp;\n\n // TODO v6: remove `Root` in the next major release\n // For more details: https://github.com/mui/material-ui/pull/37908\n if (componentSlot === 'Root' || componentSlot === 'root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n } else if (isStringTag(tag)) {\n // for string (html) tag, preserve the behavior in emotion & styled-components.\n shouldForwardPropOption = undefined;\n }\n const defaultStyledResolver = (0, _styledEngine.default)(tag, (0, _extends2.default)({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n const transformStyleArg = stylesArg => {\n // On the server Emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n if (typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg || (0, _deepmerge.isPlainObject)(stylesArg)) {\n return props => processStyleArg(stylesArg, (0, _extends2.default)({}, props, {\n theme: resolveTheme({\n theme: props.theme,\n defaultTheme,\n themeId\n })\n }));\n }\n return stylesArg;\n };\n const muiStyledResolver = (styleArg, ...expressions) => {\n let transformedStyleArg = transformStyleArg(styleArg);\n const expressionsWithDefaultTheme = expressions ? expressions.map(transformStyleArg) : [];\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n if (!theme.components || !theme.components[componentName] || !theme.components[componentName].styleOverrides) {\n return null;\n }\n const styleOverrides = theme.components[componentName].styleOverrides;\n const resolvedStyleOverrides = {};\n // TODO: v7 remove iteration and use `resolveStyleArg(styleOverrides[slot])` directly\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = processStyleArg(slotStyle, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n return overridesResolver(props, resolvedStyleOverrides);\n });\n }\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n var _theme$components;\n const theme = resolveTheme((0, _extends2.default)({}, props, {\n defaultTheme,\n themeId\n }));\n const themeVariants = theme == null || (_theme$components = theme.components) == null || (_theme$components = _theme$components[componentName]) == null ? void 0 : _theme$components.variants;\n return processStyleArg({\n variants: themeVariants\n }, (0, _extends2.default)({}, props, {\n theme\n }));\n });\n }\n if (!skipSx) {\n expressionsWithDefaultTheme.push(systemSx);\n }\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill('');\n // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n }\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n if (componentName) {\n displayName = `${componentName}${(0, _capitalize.default)(componentSlot || '')}`;\n }\n if (displayName === undefined) {\n displayName = `Styled(${(0, _getDisplayName.default)(tag)})`;\n }\n Component.displayName = displayName;\n }\n if (tag.muiName) {\n Component.muiName = tag.muiName;\n }\n return Component;\n };\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n return muiStyledResolver;\n };\n}","// copied from @mui/system/createStyled\nfunction slotShouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport default slotShouldForwardProp;","import slotShouldForwardProp from './slotShouldForwardProp';\nconst rootShouldForwardProp = prop => slotShouldForwardProp(prop) && prop !== 'classes';\nexport default rootShouldForwardProp;","'use client';\n\nimport createStyled from '@mui/system/createStyled';\nimport defaultTheme from './defaultTheme';\nimport THEME_ID from './identifier';\nimport rootShouldForwardProp from './rootShouldForwardProp';\nexport { default as slotShouldForwardProp } from './slotShouldForwardProp';\nexport { default as rootShouldForwardProp } from './rootShouldForwardProp';\nconst styled = createStyled({\n themeId: THEME_ID,\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"theme\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { ThemeProvider as SystemThemeProvider } from '@mui/system';\nimport THEME_ID from './identifier';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function ThemeProvider(_ref) {\n let {\n theme: themeInput\n } = _ref,\n props = _objectWithoutPropertiesLoose(_ref, _excluded);\n const scopedTheme = themeInput[THEME_ID];\n return /*#__PURE__*/_jsx(SystemThemeProvider, _extends({}, props, {\n themeId: scopedTheme ? THEME_ID : undefined,\n theme: scopedTheme || themeInput\n }));\n}\nprocess.env.NODE_ENV !== \"production\" ? ThemeProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n /**\n * A theme object. You can provide a function to extend the outer theme.\n */\n theme: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired\n} : void 0;","// Inspired by https://github.com/material-components/material-components-ios/blob/bca36107405594d5b7b16265a5b0ed698f85a5ee/components/Elevation/src/UIColor%2BMaterialElevation.m#L61\nconst getOverlayAlpha = elevation => {\n let alphaValue;\n if (elevation < 1) {\n alphaValue = 5.11916 * elevation ** 2;\n } else {\n alphaValue = 4.5 * Math.log(elevation + 1) + 2;\n }\n return (alphaValue / 100).toFixed(2);\n};\nexport default getOverlayAlpha;","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]\n };\n return composeClasses(slots, getSvgIconUtilityClass, classes);\n};\nconst SvgIconRoot = styled('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette2, _palette3;\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n // the will define the property that has `currentColor`\n // for example heroicons uses fill=\"none\" and stroke=\"currentColor\"\n fill: ownerState.hasSvgAsChild ? undefined : 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null || (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null || (_theme$transitions2 = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null || (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null || (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null || (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875rem'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null || (_palette = _palette[ownerState.color]) == null ? void 0 : _palette.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null || (_palette2 = _palette2.action) == null ? void 0 : _palette2.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null || (_palette3 = _palette3.action) == null ? void 0 : _palette3.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const hasSvgAsChild = /*#__PURE__*/React.isValidElement(children) && children.type === 'svg';\n const ownerState = _extends({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox,\n hasSvgAsChild\n });\n const more = {};\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, hasSvgAsChild && children.props, {\n ownerState: ownerState,\n children: [hasSvgAsChild ? children.props.children : children, titleAccess ? /*#__PURE__*/_jsx(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]),\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: PropTypes.bool,\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default SvgIcon;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SvgIcon from '../SvgIcon';\n\n/**\n * Private module reserved for @mui packages.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createSvgIcon(path, displayName) {\n function Component(props, ref) {\n return /*#__PURE__*/_jsx(SvgIcon, _extends({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n }\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","'use client';\n\nimport { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/utils';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';\n// TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n }\n ClassNameGenerator.configure(generator);\n }\n};","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n * \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\nimport { forceReflow } from './utils/reflow';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n *
\n * {\"I'll receive my-node-* classes\"}\n *
\n *
\n * \n *
\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n if (node) forceReflow(node);\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","export const reflow = node => node.scrollTop;\nexport function getTransitionProps(props, options) {\n var _style$transitionDura, _style$transitionTimi;\n const {\n timeout,\n easing,\n style = {}\n } = props;\n return {\n duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,\n delay: style.transitionDelay\n };\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getCollapseUtilityClass(slot) {\n return generateUtilityClass('MuiCollapse', slot);\n}\nconst collapseClasses = generateUtilityClasses('MuiCollapse', ['root', 'horizontal', 'vertical', 'entered', 'hidden', 'wrapper', 'wrapperInner']);\nexport default collapseClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"addEndListener\", \"children\", \"className\", \"collapsedSize\", \"component\", \"easing\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"orientation\", \"style\", \"timeout\", \"TransitionComponent\"];\nimport * as React from 'react';\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport { Transition } from 'react-transition-group';\nimport useTimeout from '@mui/utils/useTimeout';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport { duration } from '../styles/createTransitions';\nimport { getTransitionProps } from '../transitions/utils';\nimport useTheme from '../styles/useTheme';\nimport { useForkRef } from '../utils';\nimport { getCollapseUtilityClass } from './collapseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n orientation,\n classes\n } = ownerState;\n const slots = {\n root: ['root', `${orientation}`],\n entered: ['entered'],\n hidden: ['hidden'],\n wrapper: ['wrapper', `${orientation}`],\n wrapperInner: ['wrapperInner', `${orientation}`]\n };\n return composeClasses(slots, getCollapseUtilityClass, classes);\n};\nconst CollapseRoot = styled('div', {\n name: 'MuiCollapse',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.orientation], ownerState.state === 'entered' && styles.entered, ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && styles.hidden];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n height: 0,\n overflow: 'hidden',\n transition: theme.transitions.create('height')\n}, ownerState.orientation === 'horizontal' && {\n height: 'auto',\n width: 0,\n transition: theme.transitions.create('width')\n}, ownerState.state === 'entered' && _extends({\n height: 'auto',\n overflow: 'visible'\n}, ownerState.orientation === 'horizontal' && {\n width: 'auto'\n}), ownerState.state === 'exited' && !ownerState.in && ownerState.collapsedSize === '0px' && {\n visibility: 'hidden'\n}));\nconst CollapseWrapper = styled('div', {\n name: 'MuiCollapse',\n slot: 'Wrapper',\n overridesResolver: (props, styles) => styles.wrapper\n})(({\n ownerState\n}) => _extends({\n // Hack to get children with a negative margin to not falsify the height computation.\n display: 'flex',\n width: '100%'\n}, ownerState.orientation === 'horizontal' && {\n width: 'auto',\n height: '100%'\n}));\nconst CollapseWrapperInner = styled('div', {\n name: 'MuiCollapse',\n slot: 'WrapperInner',\n overridesResolver: (props, styles) => styles.wrapperInner\n})(({\n ownerState\n}) => _extends({\n width: '100%'\n}, ownerState.orientation === 'horizontal' && {\n width: 'auto',\n height: '100%'\n}));\n\n/**\n * The Collapse transition is used by the\n * [Vertical Stepper](/material-ui/react-stepper/#vertical-stepper) StepContent component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\nconst Collapse = /*#__PURE__*/React.forwardRef(function Collapse(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiCollapse'\n });\n const {\n addEndListener,\n children,\n className,\n collapsedSize: collapsedSizeProp = '0px',\n component,\n easing,\n in: inProp,\n onEnter,\n onEntered,\n onEntering,\n onExit,\n onExited,\n onExiting,\n orientation = 'vertical',\n style,\n timeout = duration.standard,\n // eslint-disable-next-line react/prop-types\n TransitionComponent = Transition\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n orientation,\n collapsedSize: collapsedSizeProp\n });\n const classes = useUtilityClasses(ownerState);\n const theme = useTheme();\n const timer = useTimeout();\n const wrapperRef = React.useRef(null);\n const autoTransitionDuration = React.useRef();\n const collapsedSize = typeof collapsedSizeProp === 'number' ? `${collapsedSizeProp}px` : collapsedSizeProp;\n const isHorizontal = orientation === 'horizontal';\n const size = isHorizontal ? 'width' : 'height';\n const nodeRef = React.useRef(null);\n const handleRef = useForkRef(ref, nodeRef);\n const normalizedTransitionCallback = callback => maybeIsAppearing => {\n if (callback) {\n const node = nodeRef.current;\n\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (maybeIsAppearing === undefined) {\n callback(node);\n } else {\n callback(node, maybeIsAppearing);\n }\n }\n };\n const getWrapperSize = () => wrapperRef.current ? wrapperRef.current[isHorizontal ? 'clientWidth' : 'clientHeight'] : 0;\n const handleEnter = normalizedTransitionCallback((node, isAppearing) => {\n if (wrapperRef.current && isHorizontal) {\n // Set absolute position to get the size of collapsed content\n wrapperRef.current.style.position = 'absolute';\n }\n node.style[size] = collapsedSize;\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n const handleEntering = normalizedTransitionCallback((node, isAppearing) => {\n const wrapperSize = getWrapperSize();\n if (wrapperRef.current && isHorizontal) {\n // After the size is read reset the position back to default\n wrapperRef.current.style.position = '';\n }\n const {\n duration: transitionDuration,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'enter'\n });\n if (timeout === 'auto') {\n const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);\n node.style.transitionDuration = `${duration2}ms`;\n autoTransitionDuration.current = duration2;\n } else {\n node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;\n }\n node.style[size] = `${wrapperSize}px`;\n node.style.transitionTimingFunction = transitionTimingFunction;\n if (onEntering) {\n onEntering(node, isAppearing);\n }\n });\n const handleEntered = normalizedTransitionCallback((node, isAppearing) => {\n node.style[size] = 'auto';\n if (onEntered) {\n onEntered(node, isAppearing);\n }\n });\n const handleExit = normalizedTransitionCallback(node => {\n node.style[size] = `${getWrapperSize()}px`;\n if (onExit) {\n onExit(node);\n }\n });\n const handleExited = normalizedTransitionCallback(onExited);\n const handleExiting = normalizedTransitionCallback(node => {\n const wrapperSize = getWrapperSize();\n const {\n duration: transitionDuration,\n easing: transitionTimingFunction\n } = getTransitionProps({\n style,\n timeout,\n easing\n }, {\n mode: 'exit'\n });\n if (timeout === 'auto') {\n // TODO: rename getAutoHeightDuration to something more generic (width support)\n // Actually it just calculates animation duration based on size\n const duration2 = theme.transitions.getAutoHeightDuration(wrapperSize);\n node.style.transitionDuration = `${duration2}ms`;\n autoTransitionDuration.current = duration2;\n } else {\n node.style.transitionDuration = typeof transitionDuration === 'string' ? transitionDuration : `${transitionDuration}ms`;\n }\n node.style[size] = collapsedSize;\n node.style.transitionTimingFunction = transitionTimingFunction;\n if (onExiting) {\n onExiting(node);\n }\n });\n const handleAddEndListener = next => {\n if (timeout === 'auto') {\n timer.start(autoTransitionDuration.current || 0, next);\n }\n if (addEndListener) {\n // Old call signature before `react-transition-group` implemented `nodeRef`\n addEndListener(nodeRef.current, next);\n }\n };\n return /*#__PURE__*/_jsx(TransitionComponent, _extends({\n in: inProp,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n addEndListener: handleAddEndListener,\n nodeRef: nodeRef,\n timeout: timeout === 'auto' ? null : timeout\n }, other, {\n children: (state, childProps) => /*#__PURE__*/_jsx(CollapseRoot, _extends({\n as: component,\n className: clsx(classes.root, className, {\n 'entered': classes.entered,\n 'exited': !inProp && collapsedSize === '0px' && classes.hidden\n }[state]),\n style: _extends({\n [isHorizontal ? 'minWidth' : 'minHeight']: collapsedSize\n }, style),\n ref: handleRef\n }, childProps, {\n // `ownerState` is set after `childProps` to override any existing `ownerState` property in `childProps`\n // that might have been forwarded from the Transition component.\n ownerState: _extends({}, ownerState, {\n state\n }),\n children: /*#__PURE__*/_jsx(CollapseWrapper, {\n ownerState: _extends({}, ownerState, {\n state\n }),\n className: classes.wrapper,\n ref: wrapperRef,\n children: /*#__PURE__*/_jsx(CollapseWrapperInner, {\n ownerState: _extends({}, ownerState, {\n state\n }),\n className: classes.wrapperInner,\n children: children\n })\n })\n }))\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Collapse.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * Add a custom transition end trigger. Called with the transitioning DOM\n * node and a done callback. Allows for more fine grained transition end\n * logic. Note: Timeouts are still used as a fallback if provided.\n */\n addEndListener: PropTypes.func,\n /**\n * The content node to be collapsed.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The width (horizontal) or height (vertical) of the container when collapsed.\n * @default '0px'\n */\n collapsedSize: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: elementTypeAcceptingRef,\n /**\n * The transition timing function.\n * You may specify a single easing or a object containing enter and exit values.\n */\n easing: PropTypes.oneOfType([PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string\n }), PropTypes.string]),\n /**\n * If `true`, the component will transition in.\n */\n in: PropTypes.bool,\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n /**\n * The transition orientation.\n * @default 'vertical'\n */\n orientation: PropTypes.oneOf(['horizontal', 'vertical']),\n /**\n * @ignore\n */\n style: PropTypes.object,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n *\n * Set to 'auto' to automatically calculate transition time based on height.\n * @default duration.standard\n */\n timeout: PropTypes.oneOfType([PropTypes.oneOf(['auto']), PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nCollapse.muiSupportAuto = true;\nexport default Collapse;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getPaperUtilityClass(slot) {\n return generateUtilityClass('MuiPaper', slot);\n}\nconst paperClasses = generateUtilityClasses('MuiPaper', ['root', 'rounded', 'outlined', 'elevation', 'elevation0', 'elevation1', 'elevation2', 'elevation3', 'elevation4', 'elevation5', 'elevation6', 'elevation7', 'elevation8', 'elevation9', 'elevation10', 'elevation11', 'elevation12', 'elevation13', 'elevation14', 'elevation15', 'elevation16', 'elevation17', 'elevation18', 'elevation19', 'elevation20', 'elevation21', 'elevation22', 'elevation23', 'elevation24']);\nexport default paperClasses;","'use client';\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"elevation\", \"square\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport integerPropType from '@mui/utils/integerPropType';\nimport chainPropTypes from '@mui/utils/chainPropTypes';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { alpha } from '@mui/system/colorManipulator';\nimport styled from '../styles/styled';\nimport getOverlayAlpha from '../styles/getOverlayAlpha';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport useTheme from '../styles/useTheme';\nimport { getPaperUtilityClass } from './paperClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n square,\n elevation,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, !square && 'rounded', variant === 'elevation' && `elevation${elevation}`]\n };\n return composeClasses(slots, getPaperUtilityClass, classes);\n};\nconst PaperRoot = styled('div', {\n name: 'MuiPaper',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], !ownerState.square && styles.rounded, ownerState.variant === 'elevation' && styles[`elevation${ownerState.elevation}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$vars$overlays;\n return _extends({\n backgroundColor: (theme.vars || theme).palette.background.paper,\n color: (theme.vars || theme).palette.text.primary,\n transition: theme.transitions.create('box-shadow')\n }, !ownerState.square && {\n borderRadius: theme.shape.borderRadius\n }, ownerState.variant === 'outlined' && {\n border: `1px solid ${(theme.vars || theme).palette.divider}`\n }, ownerState.variant === 'elevation' && _extends({\n boxShadow: (theme.vars || theme).shadows[ownerState.elevation]\n }, !theme.vars && theme.palette.mode === 'dark' && {\n backgroundImage: `linear-gradient(${alpha('#fff', getOverlayAlpha(ownerState.elevation))}, ${alpha('#fff', getOverlayAlpha(ownerState.elevation))})`\n }, theme.vars && {\n backgroundImage: (_theme$vars$overlays = theme.vars.overlays) == null ? void 0 : _theme$vars$overlays[ownerState.elevation]\n }));\n});\nconst Paper = /*#__PURE__*/React.forwardRef(function Paper(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiPaper'\n });\n const {\n className,\n component = 'div',\n elevation = 1,\n square = false,\n variant = 'elevation'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = _extends({}, props, {\n component,\n elevation,\n square,\n variant\n });\n const classes = useUtilityClasses(ownerState);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const theme = useTheme();\n if (theme.shadows[elevation] === undefined) {\n console.error([`MUI: The elevation provided is not available in the theme.`, `Please make sure that \\`theme.shadows[${elevation}]\\` is defined.`].join('\\n'));\n }\n }\n return /*#__PURE__*/_jsx(PaperRoot, _extends({\n as: component,\n ownerState: ownerState,\n className: clsx(classes.root, className),\n ref: ref\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Paper.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n /**\n * Shadow depth, corresponds to `dp` in the spec.\n * It accepts values between 0 and 24 inclusive.\n * @default 1\n */\n elevation: chainPropTypes(integerPropType, props => {\n const {\n elevation,\n variant\n } = props;\n if (elevation > 0 && variant === 'outlined') {\n return new Error(`MUI: Combining \\`elevation={${elevation}}\\` with \\`variant=\"${variant}\"\\` has no effect. Either use \\`elevation={0}\\` or use a different \\`variant\\`.`);\n }\n return null;\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The variant to use.\n * @default 'elevation'\n */\n variant: PropTypes /* @typescript-to-proptypes-ignore */.oneOfType([PropTypes.oneOf(['elevation', 'outlined']), PropTypes.string])\n} : void 0;\nexport default Paper;","'use client';\n\nimport * as React from 'react';\n\n/**\n * @ignore - internal component.\n * @type {React.Context<{} | {expanded: boolean, disabled: boolean, toggle: () => void}>}\n */\nconst AccordionContext = /*#__PURE__*/React.createContext({});\nif (process.env.NODE_ENV !== 'production') {\n AccordionContext.displayName = 'AccordionContext';\n}\nexport default AccordionContext;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\", \"elementType\", \"ownerState\", \"externalForwardedProps\", \"getSlotOwnerState\", \"internalForwardedProps\"],\n _excluded2 = [\"component\", \"slots\", \"slotProps\"],\n _excluded3 = [\"component\"];\nimport useForkRef from '@mui/utils/useForkRef';\nimport appendOwnerState from '@mui/utils/appendOwnerState';\nimport resolveComponentProps from '@mui/utils/resolveComponentProps';\nimport mergeSlotProps from '@mui/utils/mergeSlotProps';\n/**\n * An internal function to create a Material UI slot.\n *\n * This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop\n * while Base UI does not need to support leaf component customization.\n *\n * @param {string} name: name of the slot\n * @param {object} parameters\n * @returns {[Slot, slotProps]} The slot's React component and the slot's props\n *\n * Note: the returned slot's props\n * - will never contain `component` prop.\n * - might contain `as` prop.\n */\nexport default function useSlot(\n/**\n * The slot's name. All Material UI components should have `root` slot.\n *\n * If the name is `root`, the logic behaves differently from other slots,\n * e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.\n */\nname, parameters) {\n const {\n className,\n elementType: initialElementType,\n ownerState,\n externalForwardedProps,\n getSlotOwnerState,\n internalForwardedProps\n } = parameters,\n useSlotPropsParams = _objectWithoutPropertiesLoose(parameters, _excluded);\n const {\n component: rootComponent,\n slots = {\n [name]: undefined\n },\n slotProps = {\n [name]: undefined\n }\n } = externalForwardedProps,\n other = _objectWithoutPropertiesLoose(externalForwardedProps, _excluded2);\n const elementType = slots[name] || initialElementType;\n\n // `slotProps[name]` can be a callback that receives the component's ownerState.\n // `resolvedComponentsProps` is always a plain object.\n const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);\n const _mergeSlotProps = mergeSlotProps(_extends({\n className\n }, useSlotPropsParams, {\n externalForwardedProps: name === 'root' ? other : undefined,\n externalSlotProps: resolvedComponentsProps\n })),\n {\n props: {\n component: slotComponent\n },\n internalRef\n } = _mergeSlotProps,\n mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);\n const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);\n const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};\n const finalOwnerState = _extends({}, ownerState, slotOwnerState);\n const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;\n const props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {\n as: LeafComponent\n }, {\n ref\n }), finalOwnerState);\n Object.keys(slotOwnerState).forEach(propName => {\n delete props[propName];\n });\n return [elementType, props];\n}","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getAccordionUtilityClass(slot) {\n return generateUtilityClass('MuiAccordion', slot);\n}\nconst accordionClasses = generateUtilityClasses('MuiAccordion', ['root', 'rounded', 'expanded', 'disabled', 'gutters', 'region']);\nexport default accordionClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"defaultExpanded\", \"disabled\", \"disableGutters\", \"expanded\", \"onChange\", \"square\", \"slots\", \"slotProps\", \"TransitionComponent\", \"TransitionProps\"];\nimport * as React from 'react';\nimport { isFragment } from 'react-is';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport chainPropTypes from '@mui/utils/chainPropTypes';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '../zero-styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport Collapse from '../Collapse';\nimport Paper from '../Paper';\nimport AccordionContext from './AccordionContext';\nimport useControlled from '../utils/useControlled';\nimport useSlot from '../utils/useSlot';\nimport accordionClasses, { getAccordionUtilityClass } from './accordionClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n square,\n expanded,\n disabled,\n disableGutters\n } = ownerState;\n const slots = {\n root: ['root', !square && 'rounded', expanded && 'expanded', disabled && 'disabled', !disableGutters && 'gutters'],\n region: ['region']\n };\n return composeClasses(slots, getAccordionUtilityClass, classes);\n};\nconst AccordionRoot = styled(Paper, {\n name: 'MuiAccordion',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [{\n [`& .${accordionClasses.region}`]: styles.region\n }, styles.root, !ownerState.square && styles.rounded, !ownerState.disableGutters && styles.gutters];\n }\n})(({\n theme\n}) => {\n const transition = {\n duration: theme.transitions.duration.shortest\n };\n return {\n position: 'relative',\n transition: theme.transitions.create(['margin'], transition),\n overflowAnchor: 'none',\n // Keep the same scrolling position\n '&::before': {\n position: 'absolute',\n left: 0,\n top: -1,\n right: 0,\n height: 1,\n content: '\"\"',\n opacity: 1,\n backgroundColor: (theme.vars || theme).palette.divider,\n transition: theme.transitions.create(['opacity', 'background-color'], transition)\n },\n '&:first-of-type': {\n '&::before': {\n display: 'none'\n }\n },\n [`&.${accordionClasses.expanded}`]: {\n '&::before': {\n opacity: 0\n },\n '&:first-of-type': {\n marginTop: 0\n },\n '&:last-of-type': {\n marginBottom: 0\n },\n '& + &': {\n '&::before': {\n display: 'none'\n }\n }\n },\n [`&.${accordionClasses.disabled}`]: {\n backgroundColor: (theme.vars || theme).palette.action.disabledBackground\n }\n };\n}, ({\n theme\n}) => ({\n variants: [{\n props: props => !props.square,\n style: {\n borderRadius: 0,\n '&:first-of-type': {\n borderTopLeftRadius: (theme.vars || theme).shape.borderRadius,\n borderTopRightRadius: (theme.vars || theme).shape.borderRadius\n },\n '&:last-of-type': {\n borderBottomLeftRadius: (theme.vars || theme).shape.borderRadius,\n borderBottomRightRadius: (theme.vars || theme).shape.borderRadius,\n // Fix a rendering issue on Edge\n '@supports (-ms-ime-align: auto)': {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0\n }\n }\n }\n }, {\n props: props => !props.disableGutters,\n style: {\n [`&.${accordionClasses.expanded}`]: {\n margin: '16px 0'\n }\n }\n }]\n}));\nconst Accordion = /*#__PURE__*/React.forwardRef(function Accordion(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiAccordion'\n });\n const {\n children: childrenProp,\n className,\n defaultExpanded = false,\n disabled = false,\n disableGutters = false,\n expanded: expandedProp,\n onChange,\n square = false,\n slots = {},\n slotProps = {},\n TransitionComponent: TransitionComponentProp,\n TransitionProps: TransitionPropsProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [expanded, setExpandedState] = useControlled({\n controlled: expandedProp,\n default: defaultExpanded,\n name: 'Accordion',\n state: 'expanded'\n });\n const handleChange = React.useCallback(event => {\n setExpandedState(!expanded);\n if (onChange) {\n onChange(event, !expanded);\n }\n }, [expanded, onChange, setExpandedState]);\n const [summary, ...children] = React.Children.toArray(childrenProp);\n const contextValue = React.useMemo(() => ({\n expanded,\n disabled,\n disableGutters,\n toggle: handleChange\n }), [expanded, disabled, disableGutters, handleChange]);\n const ownerState = _extends({}, props, {\n square,\n disabled,\n disableGutters,\n expanded\n });\n const classes = useUtilityClasses(ownerState);\n const backwardCompatibleSlots = _extends({\n transition: TransitionComponentProp\n }, slots);\n const backwardCompatibleSlotProps = _extends({\n transition: TransitionPropsProp\n }, slotProps);\n const [TransitionSlot, transitionProps] = useSlot('transition', {\n elementType: Collapse,\n externalForwardedProps: {\n slots: backwardCompatibleSlots,\n slotProps: backwardCompatibleSlotProps\n },\n ownerState\n });\n return /*#__PURE__*/_jsxs(AccordionRoot, _extends({\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState,\n square: square\n }, other, {\n children: [/*#__PURE__*/_jsx(AccordionContext.Provider, {\n value: contextValue,\n children: summary\n }), /*#__PURE__*/_jsx(TransitionSlot, _extends({\n in: expanded,\n timeout: \"auto\"\n }, transitionProps, {\n children: /*#__PURE__*/_jsx(\"div\", {\n \"aria-labelledby\": summary.props.id,\n id: summary.props['aria-controls'],\n role: \"region\",\n className: classes.region,\n children: children\n })\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Accordion.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: chainPropTypes(PropTypes.node.isRequired, props => {\n const summary = React.Children.toArray(props.children)[0];\n if (isFragment(summary)) {\n return new Error(\"MUI: The Accordion doesn't accept a Fragment as a child. \" + 'Consider providing an array instead.');\n }\n if (! /*#__PURE__*/React.isValidElement(summary)) {\n return new Error('MUI: Expected the first child of Accordion to be a valid element.');\n }\n return null;\n }),\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * If `true`, expands the accordion by default.\n * @default false\n */\n defaultExpanded: PropTypes.bool,\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n /**\n * If `true`, it removes the margin between two expanded accordion items and the increase of height.\n * @default false\n */\n disableGutters: PropTypes.bool,\n /**\n * If `true`, expands the accordion, otherwise collapse it.\n * Setting this prop enables control over the accordion.\n */\n expanded: PropTypes.bool,\n /**\n * Callback fired when the expand/collapse state is changed.\n *\n * @param {React.SyntheticEvent} event The event source of the callback. **Warning**: This is a generic event not a change event.\n * @param {boolean} expanded The `expanded` state of the accordion.\n */\n onChange: PropTypes.func,\n /**\n * The props used for each slot inside.\n * @default {}\n */\n slotProps: PropTypes.shape({\n transition: PropTypes.oneOfType([PropTypes.func, PropTypes.object])\n }),\n /**\n * The components used for each slot inside.\n * @default {}\n */\n slots: PropTypes.shape({\n transition: PropTypes.elementType\n }),\n /**\n * If `true`, rounded corners are disabled.\n * @default false\n */\n square: PropTypes.bool,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),\n /**\n * The component used for the transition.\n * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @deprecated Use `slots.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).\n */\n TransitionComponent: PropTypes.elementType,\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](https://reactcommunity.org/react-transition-group/transition/) component.\n * @deprecated Use `slotProps.transition` instead. This prop will be removed in v7. [How to migrate](/material-ui/migration/migrating-from-deprecated-apis/).\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Accordion;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getAccordionDetailsUtilityClass(slot) {\n return generateUtilityClass('MuiAccordionDetails', slot);\n}\nconst accordionDetailsClasses = generateUtilityClasses('MuiAccordionDetails', ['root']);\nexport default accordionDetailsClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '@mui/utils/composeClasses';\nimport { styled } from '../zero-styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport { getAccordionDetailsUtilityClass } from './accordionDetailsClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getAccordionDetailsUtilityClass, classes);\n};\nconst AccordionDetailsRoot = styled('div', {\n name: 'MuiAccordionDetails',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => ({\n padding: theme.spacing(1, 2, 2)\n}));\nconst AccordionDetails = /*#__PURE__*/React.forwardRef(function AccordionDetails(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiAccordionDetails'\n });\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const ownerState = props;\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(AccordionDetailsRoot, _extends({\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? AccordionDetails.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────┐\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the d.ts file and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string,\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\n} : void 0;\nexport default AccordionDetails;","'use client';\n\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\n\n/**\n * @ignore - internal component.\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction Ripple(props) {\n const {\n className,\n classes,\n pulsate = false,\n rippleX,\n rippleY,\n rippleSize,\n in: inProp,\n onExited,\n timeout\n } = props;\n const [leaving, setLeaving] = React.useState(false);\n const rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n const rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n const childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n if (!inProp && !leaving) {\n setLeaving(true);\n }\n React.useEffect(() => {\n if (!inProp && onExited != null) {\n // react-transition-group#onExited\n const timeoutId = setTimeout(onExited, timeout);\n return () => {\n clearTimeout(timeoutId);\n };\n }\n return undefined;\n }, [onExited, inProp, timeout]);\n return /*#__PURE__*/_jsx(\"span\", {\n className: rippleClassName,\n style: rippleStyles,\n children: /*#__PURE__*/_jsx(\"span\", {\n className: childClassName\n })\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object.isRequired,\n className: PropTypes.string,\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getTouchRippleUtilityClass(slot) {\n return generateUtilityClass('MuiTouchRipple', slot);\n}\nconst touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);\nexport default touchRippleClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"center\", \"classes\", \"className\"];\nlet _ = t => t,\n _t,\n _t2,\n _t3,\n _t4;\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport { keyframes } from '@mui/system';\nimport useTimeout from '@mui/utils/useTimeout';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport Ripple from './Ripple';\nimport touchRippleClasses from './touchRippleClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst DURATION = 550;\nexport const DELAY_RIPPLE = 80;\nconst enterKeyframe = keyframes(_t || (_t = _`\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n`));\nconst exitKeyframe = keyframes(_t2 || (_t2 = _`\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n`));\nconst pulsateKeyframe = keyframes(_t3 || (_t3 = _`\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n`));\nexport const TouchRippleRoot = styled('span', {\n name: 'MuiTouchRipple',\n slot: 'Root'\n})({\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n});\n\n// This `styled()` function invokes keyframes. `styled-components` only supports keyframes\n// in string templates. Do not convert these styles in JS object as it will break.\nexport const TouchRippleRipple = styled(Ripple, {\n name: 'MuiTouchRipple',\n slot: 'Ripple'\n})(_t4 || (_t4 = _`\n opacity: 0;\n position: absolute;\n\n &.${0} {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n &.${0} {\n animation-duration: ${0}ms;\n }\n\n & .${0} {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .${0} {\n opacity: 0;\n animation-name: ${0};\n animation-duration: ${0}ms;\n animation-timing-function: ${0};\n }\n\n & .${0} {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ${0};\n animation-duration: 2500ms;\n animation-timing-function: ${0};\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n`), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.ripplePulsate, ({\n theme\n}) => theme.transitions.duration.shorter, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, ({\n theme\n}) => theme.transitions.easing.easeInOut, touchRippleClasses.childPulsate, pulsateKeyframe, ({\n theme\n}) => theme.transitions.easing.easeInOut);\n\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\nconst TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiTouchRipple'\n });\n const {\n center: centerProp = false,\n classes = {},\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [ripples, setRipples] = React.useState([]);\n const nextKey = React.useRef(0);\n const rippleCallback = React.useRef(null);\n React.useEffect(() => {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]);\n\n // Used to filter out mouse emulated events on mobile.\n const ignoringMouseDown = React.useRef(false);\n // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n const startTimer = useTimeout();\n\n // This is the hook called once the previous timeout is ready.\n const startTimerCommit = React.useRef(null);\n const container = React.useRef(null);\n const startCommit = React.useCallback(params => {\n const {\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n } = params;\n setRipples(oldRipples => [...oldRipples, /*#__PURE__*/_jsx(TouchRippleRipple, {\n classes: {\n ripple: clsx(classes.ripple, touchRippleClasses.ripple),\n rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),\n ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),\n child: clsx(classes.child, touchRippleClasses.child),\n childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),\n childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)\n },\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n }, nextKey.current)]);\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n const start = React.useCallback((event = {}, options = {}, cb = () => {}) => {\n const {\n pulsate = false,\n center = centerProp || options.pulsate,\n fakeElement = false // For test purposes\n } = options;\n if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n if ((event == null ? void 0 : event.type) === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n const element = fakeElement ? null : container.current;\n const rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n };\n\n // Get the size of the ripple\n let rippleX;\n let rippleY;\n let rippleSize;\n if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n const {\n clientX,\n clientY\n } = event.touches && event.touches.length > 0 ? event.touches[0] : event;\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n if (center) {\n rippleSize = Math.sqrt((2 * rect.width ** 2 + rect.height ** 2) / 3);\n\n // For some reason the animation is broken on Mobile Chrome if the size is even.\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n const sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n const sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(sizeX ** 2 + sizeY ** 2);\n }\n\n // Touche devices\n if (event != null && event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = () => {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n };\n // Delay the execution of the ripple effect.\n // We have to make a tradeoff with this delay value.\n startTimer.start(DELAY_RIPPLE, () => {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n });\n }\n } else {\n startCommit({\n pulsate,\n rippleX,\n rippleY,\n rippleSize,\n cb\n });\n }\n }, [centerProp, startCommit, startTimer]);\n const pulsate = React.useCallback(() => {\n start({}, {\n pulsate: true\n });\n }, [start]);\n const stop = React.useCallback((event, cb) => {\n startTimer.clear();\n\n // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.start(0, () => {\n stop(event, cb);\n });\n return;\n }\n startTimerCommit.current = null;\n setRipples(oldRipples => {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, [startTimer]);\n React.useImperativeHandle(ref, () => ({\n pulsate,\n start,\n stop\n }), [pulsate, start, stop]);\n return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({\n className: clsx(touchRippleClasses.root, classes.root, className),\n ref: container\n }, other, {\n children: /*#__PURE__*/_jsx(TransitionGroup, {\n component: null,\n exit: true,\n children: ripples\n })\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default TouchRipple;","import generateUtilityClasses from '@mui/utils/generateUtilityClasses';\nimport generateUtilityClass from '@mui/utils/generateUtilityClass';\nexport function getButtonBaseUtilityClass(slot) {\n return generateUtilityClass('MuiButtonBase', slot);\n}\nconst buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);\nexport default buttonBaseClasses;","'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"action\", \"centerRipple\", \"children\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"LinkComponent\", \"onBlur\", \"onClick\", \"onContextMenu\", \"onDragLeave\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"tabIndex\", \"TouchRippleProps\", \"touchRippleRef\", \"type\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport refType from '@mui/utils/refType';\nimport elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';\nimport composeClasses from '@mui/utils/composeClasses';\nimport styled from '../styles/styled';\nimport { useDefaultProps } from '../DefaultPropsProvider';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nimport buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n focusVisible,\n focusVisibleClassName,\n classes\n } = ownerState;\n const slots = {\n root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']\n };\n const composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);\n if (focusVisible && focusVisibleClassName) {\n composedClasses.root += ` ${focusVisibleClassName}`;\n }\n return composedClasses;\n};\nexport const ButtonBaseRoot = styled('button', {\n name: 'MuiButtonBase',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n boxSizing: 'border-box',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n MozAppearance: 'none',\n // Reset\n WebkitAppearance: 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n },\n [`&.${buttonBaseClasses.disabled}`]: {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n});\n\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\nconst ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {\n const props = useDefaultProps({\n props: inProps,\n name: 'MuiButtonBase'\n });\n const {\n action,\n centerRipple = false,\n children,\n className,\n component = 'button',\n disabled = false,\n disableRipple = false,\n disableTouchRipple = false,\n focusRipple = false,\n LinkComponent = 'a',\n onBlur,\n onClick,\n onContextMenu,\n onDragLeave,\n onFocus,\n onFocusVisible,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseLeave,\n onMouseUp,\n onTouchEnd,\n onTouchMove,\n onTouchStart,\n tabIndex = 0,\n TouchRippleProps,\n touchRippleRef,\n type\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const buttonRef = React.useRef(null);\n const rippleRef = React.useRef(null);\n const handleRippleRef = useForkRef(rippleRef, touchRippleRef);\n const {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible();\n const [focusVisible, setFocusVisible] = React.useState(false);\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n React.useImperativeHandle(action, () => ({\n focusVisible: () => {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n }), []);\n const [mountedState, setMountedState] = React.useState(false);\n React.useEffect(() => {\n setMountedState(true);\n }, []);\n const enableTouchRipple = mountedState && !disableRipple && !disabled;\n React.useEffect(() => {\n if (focusVisible && focusRipple && !disableRipple && mountedState) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible, mountedState]);\n function useRippleHandler(rippleAction, eventCallback, skipRippleAction = disableTouchRipple) {\n return useEventCallback(event => {\n if (eventCallback) {\n eventCallback(event);\n }\n const ignore = skipRippleAction;\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n return true;\n });\n }\n const handleMouseDown = useRippleHandler('start', onMouseDown);\n const handleContextMenu = useRippleHandler('stop', onContextMenu);\n const handleDragLeave = useRippleHandler('stop', onDragLeave);\n const handleMouseUp = useRippleHandler('stop', onMouseUp);\n const handleMouseLeave = useRippleHandler('stop', event => {\n if (focusVisible) {\n event.preventDefault();\n }\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n const handleTouchStart = useRippleHandler('start', onTouchStart);\n const handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n const handleTouchMove = useRippleHandler('stop', onTouchMove);\n const handleBlur = useRippleHandler('stop', event => {\n handleBlurVisible(event);\n if (isFocusVisibleRef.current === false) {\n setFocusVisible(false);\n }\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n const handleFocus = useEventCallback(event => {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n handleFocusVisible(event);\n if (isFocusVisibleRef.current === true) {\n setFocusVisible(true);\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n if (onFocus) {\n onFocus(event);\n }\n });\n const isNonNativeButton = () => {\n const button = buttonRef.current;\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n\n /**\n * IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n const keydownRef = React.useRef(false);\n const handleKeyDown = useEventCallback(event => {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n rippleRef.current.stop(event, () => {\n rippleRef.current.start(event);\n });\n }\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n // Keyboard accessibility for non interactive elements\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n if (onClick) {\n onClick(event);\n }\n }\n });\n const handleKeyUp = useEventCallback(event => {\n // calling preventDefault in keyUp on a