(resolve => resolve());\n }\n\n try {\n const response = await this.acquireTokenPopup(params);\n this.handleAcquireTokenSuccess(response);\n this.setAuthenticationState(AuthenticationState.Authenticated);\n return response;\n } catch (error) {\n Logger.ERROR(error);\n\n this.setError(error);\n this.setAuthenticationState(AuthenticationState.Unauthenticated);\n\n throw error;\n }\n } else {\n Logger.ERROR(error as any);\n\n this.setError(error);\n this.setAuthenticationState(AuthenticationState.Unauthenticated);\n\n throw error;\n }\n };\n\n private authenticationRedirectCallback = (error: AuthError) => {\n if (error) {\n this.setError(error);\n }\n this.processLogin();\n };\n\n private initializeProvider = async () => {\n this.dispatchAction(AuthenticationActionCreators.initializing());\n\n await this.processLogin();\n\n this.dispatchAction(AuthenticationActionCreators.initialized());\n };\n\n private processLogin = async () => {\n if (this.getError()) {\n this.handleLoginFailed();\n\n this.setAuthenticationState(AuthenticationState.Unauthenticated);\n } else if (this.getAccount()) {\n try {\n // If the IdToken has expired, refresh it. Otherwise use the cached token\n await this.getIdToken();\n\n this.handleLoginSuccess();\n } catch (error) {\n // Swallow the error if the user isn't authenticated, just set to Unauthenticated\n if (!(error instanceof ClientAuthError && error.errorCode === 'user_login_error')) {\n Logger.ERROR(error);\n this.setError(error);\n }\n\n this.setAuthenticationState(AuthenticationState.Unauthenticated);\n }\n } else if (this.getLoginInProgress()) {\n this.setAuthenticationState(AuthenticationState.InProgress);\n } else {\n this.setAuthenticationState(AuthenticationState.Unauthenticated);\n }\n };\n\n private setAuthenticationState = (state: AuthenticationState): AuthenticationState => {\n if (this.authenticationState !== state) {\n this.authenticationState = state;\n\n this.dispatchAction(AuthenticationActionCreators.authenticatedStateChanged(state));\n this._onAuthenticationStateHandlers.forEach(listener => listener(state));\n }\n\n return this.authenticationState;\n };\n\n private setAccountInfo = (response: AuthResponse): IAccountInfo => {\n const accountInfo: IAccountInfo = this.getAccountInfo() || ({ account: response.account } as IAccountInfo);\n\n // Depending on the token type of the auth response, update the correct property\n if (response.tokenType === TokenType.IdToken) {\n accountInfo.jwtIdToken = response.idToken.rawIdToken;\n } else if (response.tokenType === TokenType.AccessToken) {\n accountInfo.jwtAccessToken = response.accessToken;\n }\n\n this._accountInfo = { ...accountInfo };\n this._onAccountInfoHandlers.forEach(listener => listener(this._accountInfo));\n\n return { ...this._accountInfo };\n };\n\n private dispatchAction = (action: AnyAction): void => {\n if (this._reduxStore) {\n this._reduxStore.dispatch(action);\n } else {\n this._actionQueue.push(action);\n }\n };\n\n private handleAcquireTokenSuccess = (response: AuthResponse): void => {\n this.setAccountInfo(response);\n\n if (response.tokenType === TokenType.IdToken) {\n const token = new IdTokenResponse(response);\n this.dispatchAction(AuthenticationActionCreators.acquireIdTokenSuccess(token));\n } else if (response.tokenType === TokenType.AccessToken) {\n const token = new AccessTokenResponse(response);\n this.dispatchAction(AuthenticationActionCreators.acquireAccessTokenSuccess(token));\n }\n };\n\n private handleLoginFailed = (): void => {\n const error = this.getError();\n if (error) {\n this.dispatchAction(AuthenticationActionCreators.loginFailed());\n }\n };\n\n private handleLoginSuccess = (): void => {\n const account = this.getAccountInfo();\n if (account) {\n this.dispatchAction(AuthenticationActionCreators.loginSuccessful(account));\n }\n };\n}\n","export class Logger {\n public static VERBOSE(message: string, ...optionalParams: any[]) {\n // eslint-disable-next-line no-console\n console.log(...['[VERBOSE] ' + message].concat(optionalParams));\n }\n\n public static INFO(message: string, ...optionalParams: any[]) {\n // eslint-disable-next-line no-console\n console.info(...['[INFO] ' + message].concat(optionalParams));\n }\n\n public static WARN(message: string, ...optionalParams: any[]) {\n // eslint-disable-next-line no-console\n console.warn(...['[WARN] ' + message].concat(optionalParams));\n }\n\n public static ERROR(message: string, ...optionalParams: any[]) {\n // eslint-disable-next-line no-console\n console.error(...['[ERROR] ' + message].concat(optionalParams));\n }\n}\n","import * as React from 'react';\n\nimport { AzureAD, IAzureADProps } from './AzureAD';\n\nexport const withAuthentication = (\n WrappedComponent: React.ComponentType
,\n parameters: IAzureADProps,\n): React.FunctionComponent
=> {\n // tslint:disable-next-line: no-shadowed-variable\n const withAuthentication: React.FunctionComponent = (props: any) => {\n const propParams: IAzureADProps = { forceLogin: true, ...parameters };\n\n withAuthentication.displayName = `withAuthentication(${WrappedComponent.displayName || WrappedComponent.name}`;\n return (\n \n \n \n );\n };\n\n return withAuthentication;\n};\n","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nvar Motion = (function (_React$Component) {\n _inherits(Motion, _React$Component);\n\n _createClass(Motion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyle: _propTypes2['default'].objectOf(_propTypes2['default'].number),\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired,\n children: _propTypes2['default'].func.isRequired,\n onRest: _propTypes2['default'].func\n },\n enumerable: true\n }]);\n\n function Motion(props) {\n var _this = this;\n\n _classCallCheck(this, Motion);\n\n _React$Component.call(this, props);\n this.wasAnimating = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyle = null;\n\n this.clearUnreadPropStyle = function (destStyle) {\n var dirty = false;\n var _state = _this.state;\n var currentStyle = _state.currentStyle;\n var currentVelocity = _state.currentVelocity;\n var lastIdealStyle = _state.lastIdealStyle;\n var lastIdealVelocity = _state.lastIdealVelocity;\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyle = _extends({}, currentStyle);\n currentVelocity = _extends({}, currentVelocity);\n lastIdealStyle = _extends({}, lastIdealStyle);\n lastIdealVelocity = _extends({}, lastIdealVelocity);\n }\n\n currentStyle[key] = styleValue;\n currentVelocity[key] = 0;\n lastIdealStyle[key] = styleValue;\n lastIdealVelocity[key] = 0;\n }\n }\n\n if (dirty) {\n _this.setState({ currentStyle: currentStyle, currentVelocity: currentVelocity, lastIdealStyle: lastIdealStyle, lastIdealVelocity: lastIdealVelocity });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // check if we need to animate in the first place\n var propsStyle = _this.props.style;\n if (_shouldStopAnimation2['default'](_this.state.currentStyle, propsStyle, _this.state.currentVelocity)) {\n if (_this.wasAnimating && _this.props.onRest) {\n _this.props.onRest();\n }\n\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.wasAnimating = false;\n _this.accumulatedTime = 0;\n return;\n }\n\n _this.wasAnimating = true;\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n\n for (var key in propsStyle) {\n if (!Object.prototype.hasOwnProperty.call(propsStyle, key)) {\n continue;\n }\n\n var styleValue = propsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyle[key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocity[key];\n for (var i = 0; i < framesToCatchUp; i++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyle: newCurrentStyle,\n currentVelocity: newCurrentVelocity,\n lastIdealStyle: newLastIdealStyle,\n lastIdealVelocity: newLastIdealVelocity\n });\n\n _this.unreadPropStyle = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n Motion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyle = _props.defaultStyle;\n var style = _props.style;\n\n var currentStyle = defaultStyle || _stripStyle2['default'](style);\n var currentVelocity = _mapToZero2['default'](currentStyle);\n return {\n currentStyle: currentStyle,\n currentVelocity: currentVelocity,\n lastIdealStyle: currentStyle,\n lastIdealVelocity: currentVelocity\n };\n };\n\n // it's possible that currentStyle's value is stale: if props is immediately\n // changed from 0 to 400 to spring(0) again, the async currentStyle is still\n // at 0 (didn't have time to tick and interpolate even once). If we naively\n // compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n // In reality currentStyle should be 400\n\n Motion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n Motion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyle != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyle);\n }\n\n this.unreadPropStyle = props.style;\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n Motion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n Motion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyle);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return Motion;\n})(_react2['default'].Component);\n\nexports['default'] = Motion;\nmodule.exports = exports['default'];\n\n// after checking for unreadPropStyle != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n//# sourceMappingURL=performance-now.js.map\n","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\nfunction shouldStopAnimationAll(currentStyles, styles, currentVelocities) {\n for (var i = 0; i < currentStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], styles[i], currentVelocities[i])) {\n return false;\n }\n }\n return true;\n}\n\nvar StaggeredMotion = (function (_React$Component) {\n _inherits(StaggeredMotion, _React$Component);\n\n _createClass(StaggeredMotion, null, [{\n key: 'propTypes',\n value: {\n // TOOD: warn against putting a config in here\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].objectOf(_propTypes2['default'].number)),\n styles: _propTypes2['default'].func.isRequired,\n children: _propTypes2['default'].func.isRequired\n },\n enumerable: true\n }]);\n\n function StaggeredMotion(props) {\n var _this = this;\n\n _classCallCheck(this, StaggeredMotion);\n\n _React$Component.call(this, props);\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _state = _this.state;\n var currentStyles = _state.currentStyles;\n var currentVelocities = _state.currentVelocities;\n var lastIdealStyles = _state.lastIdealStyles;\n var lastIdealVelocities = _state.lastIdealVelocities;\n\n var someDirty = false;\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i];\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n someDirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n }\n }\n }\n\n if (someDirty) {\n _this.setState({ currentStyles: currentStyles, currentVelocities: currentVelocities, lastIdealStyles: lastIdealStyles, lastIdealVelocities: lastIdealVelocities });\n }\n };\n\n this.startAnimationIfNecessary = function () {\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n var destStyles = _this.props.styles(_this.state.lastIdealStyles);\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n\n for (var i = 0; i < destStyles.length; i++) {\n var destStyle = destStyles[i];\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in destStyle) {\n if (!Object.prototype.hasOwnProperty.call(destStyle, key)) {\n continue;\n }\n\n var styleValue = destStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = _this.state.lastIdealStyles[i][key];\n var newLastIdealVelocityValue = _this.state.lastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n StaggeredMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n\n var currentStyles = defaultStyles || styles().map(_stripStyle2['default']);\n var currentVelocities = currentStyles.map(function (currentStyle) {\n return _mapToZero2['default'](currentStyle);\n });\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: currentStyles,\n lastIdealVelocities: currentVelocities\n };\n };\n\n StaggeredMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n StaggeredMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles != null) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n this.unreadPropStyles = props.styles(this.state.lastIdealStyles);\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n StaggeredMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n StaggeredMotion.prototype.render = function render() {\n var renderedChildren = this.props.children(this.state.currentStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return StaggeredMotion;\n})(_react2['default'].Component);\n\nexports['default'] = StaggeredMotion;\nmodule.exports = exports['default'];\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400\n\n// after checking for unreadPropStyles != null, we manually go set the\n// non-interpolating values (those that are a number, without a spring\n// config)","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _mapToZero = require('./mapToZero');\n\nvar _mapToZero2 = _interopRequireDefault(_mapToZero);\n\nvar _stripStyle = require('./stripStyle');\n\nvar _stripStyle2 = _interopRequireDefault(_stripStyle);\n\nvar _stepper3 = require('./stepper');\n\nvar _stepper4 = _interopRequireDefault(_stepper3);\n\nvar _mergeDiff = require('./mergeDiff');\n\nvar _mergeDiff2 = _interopRequireDefault(_mergeDiff);\n\nvar _performanceNow = require('performance-now');\n\nvar _performanceNow2 = _interopRequireDefault(_performanceNow);\n\nvar _raf = require('raf');\n\nvar _raf2 = _interopRequireDefault(_raf);\n\nvar _shouldStopAnimation = require('./shouldStopAnimation');\n\nvar _shouldStopAnimation2 = _interopRequireDefault(_shouldStopAnimation);\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar msPerFrame = 1000 / 60;\n\n// the children function & (potential) styles function asks as param an\n// Array, where each TransitionPlainStyle is of the format\n// {key: string, data?: any, style: PlainStyle}. However, the way we keep\n// internal states doesn't contain such a data structure (check the state and\n// TransitionMotionState). So when children function and others ask for such\n// data we need to generate them on the fly by combining mergedPropsStyles and\n// currentStyles/lastIdealStyles\nfunction rehydrateStyles(mergedPropsStyles, unreadPropStyles, plainStyles) {\n // Copy the value to a `const` so that Flow understands that the const won't\n // change and will be non-nullable in the callback below.\n var cUnreadPropStyles = unreadPropStyles;\n if (cUnreadPropStyles == null) {\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n return {\n key: mergedPropsStyle.key,\n data: mergedPropsStyle.data,\n style: plainStyles[i]\n };\n });\n }\n return mergedPropsStyles.map(function (mergedPropsStyle, i) {\n for (var j = 0; j < cUnreadPropStyles.length; j++) {\n if (cUnreadPropStyles[j].key === mergedPropsStyle.key) {\n return {\n key: cUnreadPropStyles[j].key,\n data: cUnreadPropStyles[j].data,\n style: plainStyles[i]\n };\n }\n }\n return { key: mergedPropsStyle.key, data: mergedPropsStyle.data, style: plainStyles[i] };\n });\n}\n\nfunction shouldStopAnimationAll(currentStyles, destStyles, currentVelocities, mergedPropsStyles) {\n if (mergedPropsStyles.length !== destStyles.length) {\n return false;\n }\n\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (mergedPropsStyles[i].key !== destStyles[i].key) {\n return false;\n }\n }\n\n // we have the invariant that mergedPropsStyles and\n // currentStyles/currentVelocities/last* are synced in terms of cells, see\n // mergeAndSync comment for more info\n for (var i = 0; i < mergedPropsStyles.length; i++) {\n if (!_shouldStopAnimation2['default'](currentStyles[i], destStyles[i].style, currentVelocities[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n// core key merging logic\n\n// things to do: say previously merged style is {a, b}, dest style (prop) is {b,\n// c}, previous current (interpolating) style is {a, b}\n// **invariant**: current[i] corresponds to merged[i] in terms of key\n\n// steps:\n// turn merged style into {a?, b, c}\n// add c, value of c is destStyles.c\n// maybe remove a, aka call willLeave(a), then merged is either {b, c} or {a, b, c}\n// turn current (interpolating) style from {a, b} into {a?, b, c}\n// maybe remove a\n// certainly add c, value of c is willEnter(c)\n// loop over merged and construct new current\n// dest doesn't change, that's owner's\nfunction mergeAndSync(willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldLastIdealStyles, oldLastIdealVelocities) {\n var newMergedPropsStyles = _mergeDiff2['default'](oldMergedPropsStyles, destStyles, function (oldIndex, oldMergedPropsStyle) {\n var leavingStyle = willLeave(oldMergedPropsStyle);\n if (leavingStyle == null) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n if (_shouldStopAnimation2['default'](oldCurrentStyles[oldIndex], leavingStyle, oldCurrentVelocities[oldIndex])) {\n didLeave({ key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data });\n return null;\n }\n return { key: oldMergedPropsStyle.key, data: oldMergedPropsStyle.data, style: leavingStyle };\n });\n\n var newCurrentStyles = [];\n var newCurrentVelocities = [];\n var newLastIdealStyles = [];\n var newLastIdealVelocities = [];\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyleCell = newMergedPropsStyles[i];\n var foundOldIndex = null;\n for (var j = 0; j < oldMergedPropsStyles.length; j++) {\n if (oldMergedPropsStyles[j].key === newMergedPropsStyleCell.key) {\n foundOldIndex = j;\n break;\n }\n }\n // TODO: key search code\n if (foundOldIndex == null) {\n var plainStyle = willEnter(newMergedPropsStyleCell);\n newCurrentStyles[i] = plainStyle;\n newLastIdealStyles[i] = plainStyle;\n\n var velocity = _mapToZero2['default'](newMergedPropsStyleCell.style);\n newCurrentVelocities[i] = velocity;\n newLastIdealVelocities[i] = velocity;\n } else {\n newCurrentStyles[i] = oldCurrentStyles[foundOldIndex];\n newLastIdealStyles[i] = oldLastIdealStyles[foundOldIndex];\n newCurrentVelocities[i] = oldCurrentVelocities[foundOldIndex];\n newLastIdealVelocities[i] = oldLastIdealVelocities[foundOldIndex];\n }\n }\n\n return [newMergedPropsStyles, newCurrentStyles, newCurrentVelocities, newLastIdealStyles, newLastIdealVelocities];\n}\n\nvar TransitionMotion = (function (_React$Component) {\n _inherits(TransitionMotion, _React$Component);\n\n _createClass(TransitionMotion, null, [{\n key: 'propTypes',\n value: {\n defaultStyles: _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].number).isRequired\n })),\n styles: _propTypes2['default'].oneOfType([_propTypes2['default'].func, _propTypes2['default'].arrayOf(_propTypes2['default'].shape({\n key: _propTypes2['default'].string.isRequired,\n data: _propTypes2['default'].any,\n style: _propTypes2['default'].objectOf(_propTypes2['default'].oneOfType([_propTypes2['default'].number, _propTypes2['default'].object])).isRequired\n }))]).isRequired,\n children: _propTypes2['default'].func.isRequired,\n willEnter: _propTypes2['default'].func,\n willLeave: _propTypes2['default'].func,\n didLeave: _propTypes2['default'].func\n },\n enumerable: true\n }, {\n key: 'defaultProps',\n value: {\n willEnter: function willEnter(styleThatEntered) {\n return _stripStyle2['default'](styleThatEntered.style);\n },\n // recall: returning null makes the current unmounting TransitionStyle\n // disappear immediately\n willLeave: function willLeave() {\n return null;\n },\n didLeave: function didLeave() {}\n },\n enumerable: true\n }]);\n\n function TransitionMotion(props) {\n var _this = this;\n\n _classCallCheck(this, TransitionMotion);\n\n _React$Component.call(this, props);\n this.unmounting = false;\n this.animationID = null;\n this.prevTime = 0;\n this.accumulatedTime = 0;\n this.unreadPropStyles = null;\n\n this.clearUnreadPropStyle = function (unreadPropStyles) {\n var _mergeAndSync = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, unreadPropStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var mergedPropsStyles = _mergeAndSync[0];\n var currentStyles = _mergeAndSync[1];\n var currentVelocities = _mergeAndSync[2];\n var lastIdealStyles = _mergeAndSync[3];\n var lastIdealVelocities = _mergeAndSync[4];\n\n for (var i = 0; i < unreadPropStyles.length; i++) {\n var unreadPropStyle = unreadPropStyles[i].style;\n var dirty = false;\n\n for (var key in unreadPropStyle) {\n if (!Object.prototype.hasOwnProperty.call(unreadPropStyle, key)) {\n continue;\n }\n\n var styleValue = unreadPropStyle[key];\n if (typeof styleValue === 'number') {\n if (!dirty) {\n dirty = true;\n currentStyles[i] = _extends({}, currentStyles[i]);\n currentVelocities[i] = _extends({}, currentVelocities[i]);\n lastIdealStyles[i] = _extends({}, lastIdealStyles[i]);\n lastIdealVelocities[i] = _extends({}, lastIdealVelocities[i]);\n mergedPropsStyles[i] = {\n key: mergedPropsStyles[i].key,\n data: mergedPropsStyles[i].data,\n style: _extends({}, mergedPropsStyles[i].style)\n };\n }\n currentStyles[i][key] = styleValue;\n currentVelocities[i][key] = 0;\n lastIdealStyles[i][key] = styleValue;\n lastIdealVelocities[i][key] = 0;\n mergedPropsStyles[i].style[key] = styleValue;\n }\n }\n }\n\n // unlike the other 2 components, we can't detect staleness and optionally\n // opt out of setState here. each style object's data might contain new\n // stuff we're not/cannot compare\n _this.setState({\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n mergedPropsStyles: mergedPropsStyles,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities\n });\n };\n\n this.startAnimationIfNecessary = function () {\n if (_this.unmounting) {\n return;\n }\n\n // TODO: when config is {a: 10} and dest is {a: 10} do we raf once and\n // call cb? No, otherwise accidental parent rerender causes cb trigger\n _this.animationID = _raf2['default'](function (timestamp) {\n // https://github.com/chenglou/react-motion/pull/420\n // > if execution passes the conditional if (this.unmounting), then\n // executes async defaultRaf and after that component unmounts and after\n // that the callback of defaultRaf is called, then setState will be called\n // on unmounted component.\n if (_this.unmounting) {\n return;\n }\n\n var propStyles = _this.props.styles;\n var destStyles = typeof propStyles === 'function' ? propStyles(rehydrateStyles(_this.state.mergedPropsStyles, _this.unreadPropStyles, _this.state.lastIdealStyles)) : propStyles;\n\n // check if we need to animate in the first place\n if (shouldStopAnimationAll(_this.state.currentStyles, destStyles, _this.state.currentVelocities, _this.state.mergedPropsStyles)) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.accumulatedTime = 0;\n return;\n }\n\n var currentTime = timestamp || _performanceNow2['default']();\n var timeDelta = currentTime - _this.prevTime;\n _this.prevTime = currentTime;\n _this.accumulatedTime = _this.accumulatedTime + timeDelta;\n // more than 10 frames? prolly switched browser tab. Restart\n if (_this.accumulatedTime > msPerFrame * 10) {\n _this.accumulatedTime = 0;\n }\n\n if (_this.accumulatedTime === 0) {\n // no need to cancel animationID here; shouldn't have any in flight\n _this.animationID = null;\n _this.startAnimationIfNecessary();\n return;\n }\n\n var currentFrameCompletion = (_this.accumulatedTime - Math.floor(_this.accumulatedTime / msPerFrame) * msPerFrame) / msPerFrame;\n var framesToCatchUp = Math.floor(_this.accumulatedTime / msPerFrame);\n\n var _mergeAndSync2 = mergeAndSync(_this.props.willEnter, _this.props.willLeave, _this.props.didLeave, _this.state.mergedPropsStyles, destStyles, _this.state.currentStyles, _this.state.currentVelocities, _this.state.lastIdealStyles, _this.state.lastIdealVelocities);\n\n var newMergedPropsStyles = _mergeAndSync2[0];\n var newCurrentStyles = _mergeAndSync2[1];\n var newCurrentVelocities = _mergeAndSync2[2];\n var newLastIdealStyles = _mergeAndSync2[3];\n var newLastIdealVelocities = _mergeAndSync2[4];\n\n for (var i = 0; i < newMergedPropsStyles.length; i++) {\n var newMergedPropsStyle = newMergedPropsStyles[i].style;\n var newCurrentStyle = {};\n var newCurrentVelocity = {};\n var newLastIdealStyle = {};\n var newLastIdealVelocity = {};\n\n for (var key in newMergedPropsStyle) {\n if (!Object.prototype.hasOwnProperty.call(newMergedPropsStyle, key)) {\n continue;\n }\n\n var styleValue = newMergedPropsStyle[key];\n if (typeof styleValue === 'number') {\n newCurrentStyle[key] = styleValue;\n newCurrentVelocity[key] = 0;\n newLastIdealStyle[key] = styleValue;\n newLastIdealVelocity[key] = 0;\n } else {\n var newLastIdealStyleValue = newLastIdealStyles[i][key];\n var newLastIdealVelocityValue = newLastIdealVelocities[i][key];\n for (var j = 0; j < framesToCatchUp; j++) {\n var _stepper = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n newLastIdealStyleValue = _stepper[0];\n newLastIdealVelocityValue = _stepper[1];\n }\n\n var _stepper2 = _stepper4['default'](msPerFrame / 1000, newLastIdealStyleValue, newLastIdealVelocityValue, styleValue.val, styleValue.stiffness, styleValue.damping, styleValue.precision);\n\n var nextIdealX = _stepper2[0];\n var nextIdealV = _stepper2[1];\n\n newCurrentStyle[key] = newLastIdealStyleValue + (nextIdealX - newLastIdealStyleValue) * currentFrameCompletion;\n newCurrentVelocity[key] = newLastIdealVelocityValue + (nextIdealV - newLastIdealVelocityValue) * currentFrameCompletion;\n newLastIdealStyle[key] = newLastIdealStyleValue;\n newLastIdealVelocity[key] = newLastIdealVelocityValue;\n }\n }\n\n newLastIdealStyles[i] = newLastIdealStyle;\n newLastIdealVelocities[i] = newLastIdealVelocity;\n newCurrentStyles[i] = newCurrentStyle;\n newCurrentVelocities[i] = newCurrentVelocity;\n }\n\n _this.animationID = null;\n // the amount we're looped over above\n _this.accumulatedTime -= framesToCatchUp * msPerFrame;\n\n _this.setState({\n currentStyles: newCurrentStyles,\n currentVelocities: newCurrentVelocities,\n lastIdealStyles: newLastIdealStyles,\n lastIdealVelocities: newLastIdealVelocities,\n mergedPropsStyles: newMergedPropsStyles\n });\n\n _this.unreadPropStyles = null;\n\n _this.startAnimationIfNecessary();\n });\n };\n\n this.state = this.defaultState();\n }\n\n TransitionMotion.prototype.defaultState = function defaultState() {\n var _props = this.props;\n var defaultStyles = _props.defaultStyles;\n var styles = _props.styles;\n var willEnter = _props.willEnter;\n var willLeave = _props.willLeave;\n var didLeave = _props.didLeave;\n\n var destStyles = typeof styles === 'function' ? styles(defaultStyles) : styles;\n\n // this is special. for the first time around, we don't have a comparison\n // between last (no last) and current merged props. we'll compute last so:\n // say default is {a, b} and styles (dest style) is {b, c}, we'll\n // fabricate last as {a, b}\n var oldMergedPropsStyles = undefined;\n if (defaultStyles == null) {\n oldMergedPropsStyles = destStyles;\n } else {\n oldMergedPropsStyles = defaultStyles.map(function (defaultStyleCell) {\n // TODO: key search code\n for (var i = 0; i < destStyles.length; i++) {\n if (destStyles[i].key === defaultStyleCell.key) {\n return destStyles[i];\n }\n }\n return defaultStyleCell;\n });\n }\n var oldCurrentStyles = defaultStyles == null ? destStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _stripStyle2['default'](s.style);\n });\n var oldCurrentVelocities = defaultStyles == null ? destStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n }) : defaultStyles.map(function (s) {\n return _mapToZero2['default'](s.style);\n });\n\n var _mergeAndSync3 = mergeAndSync(\n // Because this is an old-style createReactClass component, Flow doesn't\n // understand that the willEnter and willLeave props have default values\n // and will always be present.\n willEnter, willLeave, didLeave, oldMergedPropsStyles, destStyles, oldCurrentStyles, oldCurrentVelocities, oldCurrentStyles, // oldLastIdealStyles really\n oldCurrentVelocities);\n\n var mergedPropsStyles = _mergeAndSync3[0];\n var currentStyles = _mergeAndSync3[1];\n var currentVelocities = _mergeAndSync3[2];\n var lastIdealStyles = _mergeAndSync3[3];\n var lastIdealVelocities = _mergeAndSync3[4];\n // oldLastIdealVelocities really\n\n return {\n currentStyles: currentStyles,\n currentVelocities: currentVelocities,\n lastIdealStyles: lastIdealStyles,\n lastIdealVelocities: lastIdealVelocities,\n mergedPropsStyles: mergedPropsStyles\n };\n };\n\n // after checking for unreadPropStyles != null, we manually go set the\n // non-interpolating values (those that are a number, without a spring\n // config)\n\n TransitionMotion.prototype.componentDidMount = function componentDidMount() {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n };\n\n TransitionMotion.prototype.componentWillReceiveProps = function componentWillReceiveProps(props) {\n if (this.unreadPropStyles) {\n // previous props haven't had the chance to be set yet; set them here\n this.clearUnreadPropStyle(this.unreadPropStyles);\n }\n\n var styles = props.styles;\n if (typeof styles === 'function') {\n this.unreadPropStyles = styles(rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.lastIdealStyles));\n } else {\n this.unreadPropStyles = styles;\n }\n\n if (this.animationID == null) {\n this.prevTime = _performanceNow2['default']();\n this.startAnimationIfNecessary();\n }\n };\n\n TransitionMotion.prototype.componentWillUnmount = function componentWillUnmount() {\n this.unmounting = true;\n if (this.animationID != null) {\n _raf2['default'].cancel(this.animationID);\n this.animationID = null;\n }\n };\n\n TransitionMotion.prototype.render = function render() {\n var hydratedStyles = rehydrateStyles(this.state.mergedPropsStyles, this.unreadPropStyles, this.state.currentStyles);\n var renderedChildren = this.props.children(hydratedStyles);\n return renderedChildren && _react2['default'].Children.only(renderedChildren);\n };\n\n return TransitionMotion;\n})(_react2['default'].Component);\n\nexports['default'] = TransitionMotion;\nmodule.exports = exports['default'];\n\n// list of styles, each containing interpolating values. Part of what's passed\n// to children function. Notice that this is\n// Array, without the wrapper that is {key: ...,\n// data: ... style: ActualInterpolatingStyleObject}. Only mergedPropsStyles\n// contains the key & data info (so that we only have a single source of truth\n// for these, and to save space). Check the comment for `rehydrateStyles` to\n// see how we regenerate the entirety of what's passed to children function\n\n// the array that keeps track of currently rendered stuff! Including stuff\n// that you've unmounted but that's still animating. This is where it lives\n\n// it's possible that currentStyle's value is stale: if props is immediately\n// changed from 0 to 400 to spring(0) again, the async currentStyle is still\n// at 0 (didn't have time to tick and interpolate even once). If we naively\n// compare currentStyle with destVal it'll be 0 === 0 (no animation, stop).\n// In reality currentStyle should be 400","\n\n// core keys merging algorithm. If previous render's keys are [a, b], and the\n// next render's [c, b, d], what's the final merged keys and ordering?\n\n// - c and a must both be before b\n// - b before d\n// - ordering between a and c ambiguous\n\n// this reduces to merging two partially ordered lists (e.g. lists where not\n// every item has a definite ordering, like comparing a and c above). For the\n// ambiguous ordering we deterministically choose to place the next render's\n// item after the previous'; so c after a\n\n// this is called a topological sorting. Except the existing algorithms don't\n// work well with js bc of the amount of allocation, and isn't optimized for our\n// current use-case bc the runtime is linear in terms of edges (see wiki for\n// meaning), which is huge when two lists have many common elements\n'use strict';\n\nexports.__esModule = true;\nexports['default'] = mergeDiff;\n\nfunction mergeDiff(prev, next, onRemove) {\n // bookkeeping for easier access of a key's index below. This is 2 allocations +\n // potentially triggering chrome hash map mode for objs (so it might be faster\n\n var prevKeyIndex = {};\n for (var i = 0; i < prev.length; i++) {\n prevKeyIndex[prev[i].key] = i;\n }\n var nextKeyIndex = {};\n for (var i = 0; i < next.length; i++) {\n nextKeyIndex[next[i].key] = i;\n }\n\n // first, an overly elaborate way of merging prev and next, eliminating\n // duplicates (in terms of keys). If there's dupe, keep the item in next).\n // This way of writing it saves allocations\n var ret = [];\n for (var i = 0; i < next.length; i++) {\n ret[i] = next[i];\n }\n for (var i = 0; i < prev.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(nextKeyIndex, prev[i].key)) {\n // this is called my TM's `mergeAndSync`, which calls willLeave. We don't\n // merge in keys that the user desires to kill\n var fill = onRemove(i, prev[i]);\n if (fill != null) {\n ret.push(fill);\n }\n }\n }\n\n // now all the items all present. Core sorting logic to have the right order\n return ret.sort(function (a, b) {\n var nextOrderA = nextKeyIndex[a.key];\n var nextOrderB = nextKeyIndex[b.key];\n var prevOrderA = prevKeyIndex[a.key];\n var prevOrderB = prevKeyIndex[b.key];\n\n if (nextOrderA != null && nextOrderB != null) {\n // both keys in next\n return nextKeyIndex[a.key] - nextKeyIndex[b.key];\n } else if (prevOrderA != null && prevOrderB != null) {\n // both keys in prev\n return prevKeyIndex[a.key] - prevKeyIndex[b.key];\n } else if (nextOrderA != null) {\n // key a in next, key b in prev\n\n // how to determine the order between a and b? We find a \"pivot\" (term\n // abuse), a key present in both prev and next, that is sandwiched between\n // a and b. In the context of our above example, if we're comparing a and\n // d, b's (the only) pivot\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n\n if (nextOrderA < nextKeyIndex[pivot] && prevOrderB > prevKeyIndex[pivot]) {\n return -1;\n } else if (nextOrderA > nextKeyIndex[pivot] && prevOrderB < prevKeyIndex[pivot]) {\n return 1;\n }\n }\n // pluggable. default to: next bigger than prev\n return 1;\n }\n // prevOrderA, nextOrderB\n for (var i = 0; i < next.length; i++) {\n var pivot = next[i].key;\n if (!Object.prototype.hasOwnProperty.call(prevKeyIndex, pivot)) {\n continue;\n }\n if (nextOrderB < nextKeyIndex[pivot] && prevOrderA > prevKeyIndex[pivot]) {\n return 1;\n } else if (nextOrderB > nextKeyIndex[pivot] && prevOrderA < prevKeyIndex[pivot]) {\n return -1;\n }\n }\n // pluggable. default to: next bigger than prev\n return -1;\n });\n}\n\nmodule.exports = exports['default'];\n// to loop through and find a key's index each time), but I no longer care","'use strict';\n\nexports.__esModule = true;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nexports['default'] = spring;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }\n\nvar _presets = require('./presets');\n\nvar _presets2 = _interopRequireDefault(_presets);\n\nvar defaultConfig = _extends({}, _presets2['default'].noWobble, {\n precision: 0.01\n});\n\nfunction spring(val, config) {\n return _extends({}, defaultConfig, config, { val: val });\n}\n\nmodule.exports = exports['default'];","'use strict';\n\nexports.__esModule = true;\nexports['default'] = reorderKeys;\n\nvar hasWarned = false;\n\nfunction reorderKeys() {\n if (process.env.NODE_ENV === 'development') {\n if (!hasWarned) {\n hasWarned = true;\n console.error('`reorderKeys` has been removed, since it is no longer needed for TransitionMotion\\'s new styles array API.');\n }\n }\n}\n\nmodule.exports = exports['default'];","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n arrayMap = require('./_arrayMap'),\n baseUnary = require('./_baseUnary'),\n cacheHas = require('./_cacheHas');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\nfunction baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseDifference;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar getDisplayName = function getDisplayName(Component) {\n if (typeof Component === 'string') {\n return Component;\n }\n\n if (!Component) {\n return undefined;\n }\n\n return Component.displayName || Component.name || 'Component';\n};\n\nvar _default = getDisplayName;\nexports.default = _default;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _react = require(\"react\");\n\nvar _setDisplayName = _interopRequireDefault(require(\"./setDisplayName\"));\n\nvar _wrapDisplayName = _interopRequireDefault(require(\"./wrapDisplayName\"));\n\nvar mapProps = function mapProps(propsMapper) {\n return function (BaseComponent) {\n var factory = (0, _react.createFactory)(BaseComponent);\n\n var MapProps = function MapProps(props) {\n return factory(propsMapper(props));\n };\n\n if (process.env.NODE_ENV !== 'production') {\n return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'mapProps'))(MapProps);\n }\n\n return MapProps;\n };\n};\n\nvar _default = mapProps;\nexports.default = _default;","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","\"use strict\";\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar pick = function pick(obj, keys) {\n var result = {};\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n\n return result;\n};\n\nvar _default = pick;\nexports.default = _default;","/**\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 * @typechecks\n * \n */\n\n/*eslint-disable no-self-compare */\n\n'use strict';\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n // Added the nonzero y check to make Flow happy, but it is redundant\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) {\n return true;\n }\n\n if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n // Test for A's keys different from B.\n for (var i = 0; i < keysA.length; i++) {\n if (!hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n\n return true;\n}\n\nmodule.exports = shallowEqual;","var baseSetData = require('./_baseSetData'),\n createBind = require('./_createBind'),\n createCurry = require('./_createCurry'),\n createHybrid = require('./_createHybrid'),\n createPartial = require('./_createPartial'),\n getData = require('./_getData'),\n mergeData = require('./_mergeData'),\n setData = require('./_setData'),\n setWrapToString = require('./_setWrapToString'),\n toInteger = require('./toInteger');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n}\n\nmodule.exports = createWrap;\n","var createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n}\n\nmodule.exports = createBind;\n","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n createHybrid = require('./_createHybrid'),\n createRecurry = require('./_createRecurry'),\n getHolder = require('./_getHolder'),\n replaceHolders = require('./_replaceHolders'),\n root = require('./_root');\n\n/**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createCurry;\n","/**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\nfunction countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n}\n\nmodule.exports = countHolders;\n","var LazyWrapper = require('./_LazyWrapper'),\n getData = require('./_getData'),\n getFuncName = require('./_getFuncName'),\n lodash = require('./wrapperLodash');\n\n/**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\nfunction isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n}\n\nmodule.exports = isLaziable;\n","var realNames = require('./_realNames');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\nfunction getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n}\n\nmodule.exports = getFuncName;\n","/** Used to lookup unminified function names. */\nvar realNames = {};\n\nmodule.exports = realNames;\n","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n baseLodash = require('./_baseLodash'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike'),\n wrapperClone = require('./_wrapperClone');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\nfunction lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n}\n\n// Ensure wrappers are instances of `baseLodash`.\nlodash.prototype = baseLodash.prototype;\nlodash.prototype.constructor = lodash;\n\nmodule.exports = lodash;\n","var LazyWrapper = require('./_LazyWrapper'),\n LodashWrapper = require('./_LodashWrapper'),\n copyArray = require('./_copyArray');\n\n/**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\nfunction wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n}\n\nmodule.exports = wrapperClone;\n","/** Used to match wrap detail comments. */\nvar reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n/**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\nfunction getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n}\n\nmodule.exports = getWrapDetails;\n","/** Used to match wrap detail comments. */\nvar reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/;\n\n/**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\nfunction insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n}\n\nmodule.exports = insertWrapDetails;\n","var arrayEach = require('./_arrayEach'),\n arrayIncludes = require('./_arrayIncludes');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n/** Used to associate wrap methods with their bit flags. */\nvar wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n];\n\n/**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\nfunction updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n}\n\nmodule.exports = updateWrapDetails;\n","var copyArray = require('./_copyArray'),\n isIndex = require('./_isIndex');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\nfunction reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n}\n\nmodule.exports = reorder;\n","var apply = require('./_apply'),\n createCtor = require('./_createCtor'),\n root = require('./_root');\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1;\n\n/**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\nfunction createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n}\n\nmodule.exports = createPartial;\n","var composeArgs = require('./_composeArgs'),\n composeArgsRight = require('./_composeArgsRight'),\n replaceHolders = require('./_replaceHolders');\n\n/** Used as the internal argument placeholder. */\nvar PLACEHOLDER = '__lodash_placeholder__';\n\n/** Used to compose bitmasks for function metadata. */\nvar WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMin = Math.min;\n\n/**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\nfunction mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n}\n\nmodule.exports = mergeData;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var basePickBy = require('./_basePickBy'),\n hasIn = require('./hasIn');\n\n/**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\nfunction basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n}\n\nmodule.exports = basePick;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inheritsLoose2 = _interopRequireDefault(require(\"@babel/runtime/helpers/inheritsLoose\"));\n\nvar _react = require(\"react\");\n\nvar _setDisplayName = _interopRequireDefault(require(\"./setDisplayName\"));\n\nvar _wrapDisplayName = _interopRequireDefault(require(\"./wrapDisplayName\"));\n\nvar shouldUpdate = function shouldUpdate(test) {\n return function (BaseComponent) {\n var factory = (0, _react.createFactory)(BaseComponent);\n\n var ShouldUpdate =\n /*#__PURE__*/\n function (_Component) {\n (0, _inheritsLoose2.default)(ShouldUpdate, _Component);\n\n function ShouldUpdate() {\n return _Component.apply(this, arguments) || this;\n }\n\n var _proto = ShouldUpdate.prototype;\n\n _proto.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n return test(this.props, nextProps);\n };\n\n _proto.render = function render() {\n return factory(this.props);\n };\n\n return ShouldUpdate;\n }(_react.Component);\n\n if (process.env.NODE_ENV !== 'production') {\n return (0, _setDisplayName.default)((0, _wrapDisplayName.default)(BaseComponent, 'shouldUpdate'))(ShouldUpdate);\n }\n\n return ShouldUpdate;\n };\n};\n\nvar _default = shouldUpdate;\nexports.default = _default;","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\nfunction baseLt(value, other) {\n return value < other;\n}\n\nmodule.exports = baseLt;\n","/**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\nfunction baseGt(value, other) {\n return value > other;\n}\n\nmodule.exports = baseGt;\n","var baseRange = require('./_baseRange'),\n isIterateeCall = require('./_isIterateeCall'),\n toFinite = require('./toFinite');\n\n/**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\nfunction createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n}\n\nmodule.exports = createRange;\n","/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeCeil = Math.ceil,\n nativeMax = Math.max;\n\n/**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\nfunction baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n}\n\nmodule.exports = baseRange;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var Set = require('./_Set'),\n noop = require('./noop'),\n setToArray = require('./_setToArray');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\nvar createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n};\n\nmodule.exports = createSet;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var castPath = require('./_castPath'),\n last = require('./last'),\n parent = require('./_parent'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n","var baseGet = require('./_baseGet'),\n baseSlice = require('./_baseSlice');\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n","/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n","var isPlainObject = require('./isPlainObject');\n\n/**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\nfunction customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n}\n\nmodule.exports = customOmitClone;\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.bodyOpenClassName = exports.portalClassName = undefined;\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require(\"react-dom\");\n\nvar _reactDom2 = _interopRequireDefault(_reactDom);\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _ModalPortal = require(\"./ModalPortal\");\n\nvar _ModalPortal2 = _interopRequireDefault(_ModalPortal);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _reactLifecyclesCompat = require(\"react-lifecycles-compat\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar portalClassName = exports.portalClassName = \"ReactModalPortal\";\nvar bodyOpenClassName = exports.bodyOpenClassName = \"ReactModal__Body--open\";\n\nvar isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;\n\nvar getCreatePortal = function getCreatePortal() {\n return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;\n};\n\nfunction getParentElement(parentSelector) {\n return parentSelector();\n}\n\nvar Modal = function (_Component) {\n _inherits(Modal, _Component);\n\n function Modal() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, Modal);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {\n !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);\n var parent = getParentElement(_this.props.parentSelector);\n if (parent && parent.contains(_this.node)) {\n parent.removeChild(_this.node);\n } else {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"parentSelector\" prop did not returned any DOM ' + \"element. Make sure that the parent element is unmounted to \" + \"avoid any memory leaks.\");\n }\n }, _this.portalRef = function (ref) {\n _this.portal = ref;\n }, _this.renderPortal = function (props) {\n var createPortal = getCreatePortal();\n var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);\n _this.portalRef(portal);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(Modal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!_safeHTMLElement.canUseDOM) return;\n\n if (!isReact16) {\n this.node = document.createElement(\"div\");\n }\n this.node.className = this.props.portalClassName;\n\n var parent = getParentElement(this.props.parentSelector);\n parent.appendChild(this.node);\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"getSnapshotBeforeUpdate\",\n value: function getSnapshotBeforeUpdate(prevProps) {\n var prevParent = getParentElement(prevProps.parentSelector);\n var nextParent = getParentElement(this.props.parentSelector);\n return { prevParent: prevParent, nextParent: nextParent };\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, _, snapshot) {\n if (!_safeHTMLElement.canUseDOM) return;\n var _props = this.props,\n isOpen = _props.isOpen,\n portalClassName = _props.portalClassName;\n\n\n if (prevProps.portalClassName !== portalClassName) {\n this.node.className = portalClassName;\n }\n\n var prevParent = snapshot.prevParent,\n nextParent = snapshot.nextParent;\n\n if (nextParent !== prevParent) {\n prevParent.removeChild(this.node);\n nextParent.appendChild(this.node);\n }\n\n // Stop unnecessary renders if modal is remaining closed\n if (!prevProps.isOpen && !isOpen) return;\n\n !isReact16 && this.renderPortal(this.props);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;\n\n var state = this.portal.state;\n var now = Date.now();\n var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);\n\n if (closesAt) {\n if (!state.beforeClose) {\n this.portal.closeWithTimeout();\n }\n\n setTimeout(this.removePortal, closesAt - now);\n } else {\n this.removePortal();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n if (!_safeHTMLElement.canUseDOM || !isReact16) {\n return null;\n }\n\n if (!this.node && isReact16) {\n this.node = document.createElement(\"div\");\n }\n\n var createPortal = getCreatePortal();\n return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({\n ref: this.portalRef,\n defaultStyles: Modal.defaultStyles\n }, this.props)), this.node);\n }\n }], [{\n key: \"setAppElement\",\n value: function setAppElement(element) {\n ariaAppHider.setElement(element);\n }\n\n /* eslint-disable react/no-unused-prop-types */\n\n /* eslint-enable react/no-unused-prop-types */\n\n }]);\n\n return Modal;\n}(_react.Component);\n\nModal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n portalClassName: _propTypes2.default.string,\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({\n base: _propTypes2.default.string.isRequired,\n afterOpen: _propTypes2.default.string.isRequired,\n beforeClose: _propTypes2.default.string.isRequired\n })]),\n appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default),\n onAfterOpen: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n ariaHideApp: _propTypes2.default.bool,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n parentSelector: _propTypes2.default.func,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func\n};\nModal.defaultProps = {\n isOpen: false,\n portalClassName: portalClassName,\n bodyOpenClassName: bodyOpenClassName,\n role: \"dialog\",\n ariaHideApp: true,\n closeTimeoutMS: 0,\n shouldFocusAfterRender: true,\n shouldCloseOnEsc: true,\n shouldCloseOnOverlayClick: true,\n shouldReturnFocusAfterClose: true,\n preventScroll: false,\n parentSelector: function parentSelector() {\n return document.body;\n },\n overlayElement: function overlayElement(props, contentEl) {\n return _react2.default.createElement(\n \"div\",\n props,\n contentEl\n );\n },\n contentElement: function contentElement(props, children) {\n return _react2.default.createElement(\n \"div\",\n props,\n children\n );\n }\n};\nModal.defaultStyles = {\n overlay: {\n position: \"fixed\",\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: \"rgba(255, 255, 255, 0.75)\"\n },\n content: {\n position: \"absolute\",\n top: \"40px\",\n left: \"40px\",\n right: \"40px\",\n bottom: \"40px\",\n border: \"1px solid #ccc\",\n background: \"#fff\",\n overflow: \"auto\",\n WebkitOverflowScrolling: \"touch\",\n borderRadius: \"4px\",\n outline: \"none\",\n padding: \"20px\"\n }\n};\n\n\n(0, _reactLifecyclesCompat.polyfill)(Modal);\n\nexports.default = Modal;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = require(\"react\");\n\nvar _propTypes = require(\"prop-types\");\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _focusManager = require(\"../helpers/focusManager\");\n\nvar focusManager = _interopRequireWildcard(_focusManager);\n\nvar _scopeTab = require(\"../helpers/scopeTab\");\n\nvar _scopeTab2 = _interopRequireDefault(_scopeTab);\n\nvar _ariaAppHider = require(\"../helpers/ariaAppHider\");\n\nvar ariaAppHider = _interopRequireWildcard(_ariaAppHider);\n\nvar _classList = require(\"../helpers/classList\");\n\nvar classList = _interopRequireWildcard(_classList);\n\nvar _safeHTMLElement = require(\"../helpers/safeHTMLElement\");\n\nvar _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);\n\nvar _portalOpenInstances = require(\"../helpers/portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nrequire(\"../helpers/bodyTrap\");\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n// so that our CSS is statically analyzable\nvar CLASS_NAMES = {\n overlay: \"ReactModal__Overlay\",\n content: \"ReactModal__Content\"\n};\n\nvar TAB_KEY = 9;\nvar ESC_KEY = 27;\n\nvar ariaHiddenInstances = 0;\n\nvar ModalPortal = function (_Component) {\n _inherits(ModalPortal, _Component);\n\n function ModalPortal(props) {\n _classCallCheck(this, ModalPortal);\n\n var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));\n\n _this.setOverlayRef = function (overlay) {\n _this.overlay = overlay;\n _this.props.overlayRef && _this.props.overlayRef(overlay);\n };\n\n _this.setContentRef = function (content) {\n _this.content = content;\n _this.props.contentRef && _this.props.contentRef(content);\n };\n\n _this.afterClose = function () {\n var _this$props = _this.props,\n appElement = _this$props.appElement,\n ariaHideApp = _this$props.ariaHideApp,\n htmlOpenClassName = _this$props.htmlOpenClassName,\n bodyOpenClassName = _this$props.bodyOpenClassName;\n\n // Remove classes.\n\n bodyOpenClassName && classList.remove(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.remove(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n // Reset aria-hidden attribute if all modals have been removed\n if (ariaHideApp && ariaHiddenInstances > 0) {\n ariaHiddenInstances -= 1;\n\n if (ariaHiddenInstances === 0) {\n ariaAppHider.show(appElement);\n }\n }\n\n if (_this.props.shouldFocusAfterRender) {\n if (_this.props.shouldReturnFocusAfterClose) {\n focusManager.returnFocus(_this.props.preventScroll);\n focusManager.teardownScopedFocus();\n } else {\n focusManager.popWithoutFocus();\n }\n }\n\n if (_this.props.onAfterClose) {\n _this.props.onAfterClose();\n }\n\n _portalOpenInstances2.default.deregister(_this);\n };\n\n _this.open = function () {\n _this.beforeOpen();\n if (_this.state.afterOpen && _this.state.beforeClose) {\n clearTimeout(_this.closeTimer);\n _this.setState({ beforeClose: false });\n } else {\n if (_this.props.shouldFocusAfterRender) {\n focusManager.setupScopedFocus(_this.node);\n focusManager.markForFocusLater();\n }\n\n _this.setState({ isOpen: true }, function () {\n _this.setState({ afterOpen: true });\n\n if (_this.props.isOpen && _this.props.onAfterOpen) {\n _this.props.onAfterOpen({\n overlayEl: _this.overlay,\n contentEl: _this.content\n });\n }\n });\n }\n };\n\n _this.close = function () {\n if (_this.props.closeTimeoutMS > 0) {\n _this.closeWithTimeout();\n } else {\n _this.closeWithoutTimeout();\n }\n };\n\n _this.focusContent = function () {\n return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });\n };\n\n _this.closeWithTimeout = function () {\n var closesAt = Date.now() + _this.props.closeTimeoutMS;\n _this.setState({ beforeClose: true, closesAt: closesAt }, function () {\n _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());\n });\n };\n\n _this.closeWithoutTimeout = function () {\n _this.setState({\n beforeClose: false,\n isOpen: false,\n afterOpen: false,\n closesAt: null\n }, _this.afterClose);\n };\n\n _this.handleKeyDown = function (event) {\n if (event.keyCode === TAB_KEY) {\n (0, _scopeTab2.default)(_this.content, event);\n }\n\n if (_this.props.shouldCloseOnEsc && event.keyCode === ESC_KEY) {\n event.stopPropagation();\n _this.requestClose(event);\n }\n };\n\n _this.handleOverlayOnClick = function (event) {\n if (_this.shouldClose === null) {\n _this.shouldClose = true;\n }\n\n if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {\n if (_this.ownerHandlesClose()) {\n _this.requestClose(event);\n } else {\n _this.focusContent();\n }\n }\n _this.shouldClose = null;\n };\n\n _this.handleContentOnMouseUp = function () {\n _this.shouldClose = false;\n };\n\n _this.handleOverlayOnMouseDown = function (event) {\n if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {\n event.preventDefault();\n }\n };\n\n _this.handleContentOnClick = function () {\n _this.shouldClose = false;\n };\n\n _this.handleContentOnMouseDown = function () {\n _this.shouldClose = false;\n };\n\n _this.requestClose = function (event) {\n return _this.ownerHandlesClose() && _this.props.onRequestClose(event);\n };\n\n _this.ownerHandlesClose = function () {\n return _this.props.onRequestClose;\n };\n\n _this.shouldBeClosed = function () {\n return !_this.state.isOpen && !_this.state.beforeClose;\n };\n\n _this.contentHasFocus = function () {\n return document.activeElement === _this.content || _this.content.contains(document.activeElement);\n };\n\n _this.buildClassName = function (which, additional) {\n var classNames = (typeof additional === \"undefined\" ? \"undefined\" : _typeof(additional)) === \"object\" ? additional : {\n base: CLASS_NAMES[which],\n afterOpen: CLASS_NAMES[which] + \"--after-open\",\n beforeClose: CLASS_NAMES[which] + \"--before-close\"\n };\n var className = classNames.base;\n if (_this.state.afterOpen) {\n className = className + \" \" + classNames.afterOpen;\n }\n if (_this.state.beforeClose) {\n className = className + \" \" + classNames.beforeClose;\n }\n return typeof additional === \"string\" && additional ? className + \" \" + additional : className;\n };\n\n _this.attributesFromObject = function (prefix, items) {\n return Object.keys(items).reduce(function (acc, name) {\n acc[prefix + \"-\" + name] = items[name];\n return acc;\n }, {});\n };\n\n _this.state = {\n afterOpen: false,\n beforeClose: false\n };\n\n _this.shouldClose = null;\n _this.moveFromContentToOverlay = null;\n return _this;\n }\n\n _createClass(ModalPortal, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.isOpen) {\n this.open();\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n if (process.env.NODE_ENV !== \"production\") {\n if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"bodyOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {\n // eslint-disable-next-line no-console\n console.warn('React-Modal: \"htmlOpenClassName\" prop has been modified. ' + \"This may cause unexpected behavior when multiple modals are open.\");\n }\n }\n\n if (this.props.isOpen && !prevProps.isOpen) {\n this.open();\n } else if (!this.props.isOpen && prevProps.isOpen) {\n this.close();\n }\n\n // Focus only needs to be set once when the modal is being opened\n if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {\n this.focusContent();\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.state.isOpen) {\n this.afterClose();\n }\n clearTimeout(this.closeTimer);\n }\n }, {\n key: \"beforeOpen\",\n value: function beforeOpen() {\n var _props = this.props,\n appElement = _props.appElement,\n ariaHideApp = _props.ariaHideApp,\n htmlOpenClassName = _props.htmlOpenClassName,\n bodyOpenClassName = _props.bodyOpenClassName;\n\n // Add classes.\n\n bodyOpenClassName && classList.add(document.body, bodyOpenClassName);\n\n htmlOpenClassName && classList.add(document.getElementsByTagName(\"html\")[0], htmlOpenClassName);\n\n if (ariaHideApp) {\n ariaHiddenInstances += 1;\n ariaAppHider.hide(appElement);\n }\n\n _portalOpenInstances2.default.register(this);\n }\n\n // Don't steal focus from inner elements\n\n }, {\n key: \"render\",\n value: function render() {\n var _props2 = this.props,\n id = _props2.id,\n className = _props2.className,\n overlayClassName = _props2.overlayClassName,\n defaultStyles = _props2.defaultStyles,\n children = _props2.children;\n\n var contentStyles = className ? {} : defaultStyles.content;\n var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;\n\n if (this.shouldBeClosed()) {\n return null;\n }\n\n var overlayProps = {\n ref: this.setOverlayRef,\n className: this.buildClassName(\"overlay\", overlayClassName),\n style: _extends({}, overlayStyles, this.props.style.overlay),\n onClick: this.handleOverlayOnClick,\n onMouseDown: this.handleOverlayOnMouseDown\n };\n\n var contentProps = _extends({\n id: id,\n ref: this.setContentRef,\n style: _extends({}, contentStyles, this.props.style.content),\n className: this.buildClassName(\"content\", className),\n tabIndex: \"-1\",\n onKeyDown: this.handleKeyDown,\n onMouseDown: this.handleContentOnMouseDown,\n onMouseUp: this.handleContentOnMouseUp,\n onClick: this.handleContentOnClick,\n role: this.props.role,\n \"aria-label\": this.props.contentLabel\n }, this.attributesFromObject(\"aria\", _extends({ modal: true }, this.props.aria)), this.attributesFromObject(\"data\", this.props.data || {}), {\n \"data-testid\": this.props.testId\n });\n\n var contentElement = this.props.contentElement(contentProps, children);\n return this.props.overlayElement(overlayProps, contentElement);\n }\n }]);\n\n return ModalPortal;\n}(_react.Component);\n\nModalPortal.defaultProps = {\n style: {\n overlay: {},\n content: {}\n },\n defaultStyles: {}\n};\nModalPortal.propTypes = {\n isOpen: _propTypes2.default.bool.isRequired,\n defaultStyles: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n style: _propTypes2.default.shape({\n content: _propTypes2.default.object,\n overlay: _propTypes2.default.object\n }),\n className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),\n bodyOpenClassName: _propTypes2.default.string,\n htmlOpenClassName: _propTypes2.default.string,\n ariaHideApp: _propTypes2.default.bool,\n appElement: _propTypes2.default.instanceOf(_safeHTMLElement2.default),\n onAfterOpen: _propTypes2.default.func,\n onAfterClose: _propTypes2.default.func,\n onRequestClose: _propTypes2.default.func,\n closeTimeoutMS: _propTypes2.default.number,\n shouldFocusAfterRender: _propTypes2.default.bool,\n shouldCloseOnOverlayClick: _propTypes2.default.bool,\n shouldReturnFocusAfterClose: _propTypes2.default.bool,\n preventScroll: _propTypes2.default.bool,\n role: _propTypes2.default.string,\n contentLabel: _propTypes2.default.string,\n aria: _propTypes2.default.object,\n data: _propTypes2.default.object,\n children: _propTypes2.default.node,\n shouldCloseOnEsc: _propTypes2.default.bool,\n overlayRef: _propTypes2.default.func,\n contentRef: _propTypes2.default.func,\n id: _propTypes2.default.string,\n overlayElement: _propTypes2.default.func,\n contentElement: _propTypes2.default.func,\n testId: _propTypes2.default.string\n};\nexports.default = ModalPortal;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.handleBlur = handleBlur;\nexports.handleFocus = handleFocus;\nexports.markForFocusLater = markForFocusLater;\nexports.returnFocus = returnFocus;\nexports.popWithoutFocus = popWithoutFocus;\nexports.setupScopedFocus = setupScopedFocus;\nexports.teardownScopedFocus = teardownScopedFocus;\n\nvar _tabbable = require(\"../helpers/tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar focusLaterElements = [];\nvar modalElement = null;\nvar needToFocus = false;\n\nfunction handleBlur() {\n needToFocus = true;\n}\n\nfunction handleFocus() {\n if (needToFocus) {\n needToFocus = false;\n if (!modalElement) {\n return;\n }\n // need to see how jQuery shims document.on('focusin') so we don't need the\n // setTimeout, firefox doesn't support focusin, if it did, we could focus\n // the element outside of a setTimeout. Side-effect of this implementation\n // is that the document.body gets focus, and then we focus our element right\n // after, seems fine.\n setTimeout(function () {\n if (modalElement.contains(document.activeElement)) {\n return;\n }\n var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;\n el.focus();\n }, 0);\n }\n}\n\nfunction markForFocusLater() {\n focusLaterElements.push(document.activeElement);\n}\n\n/* eslint-disable no-console */\nfunction returnFocus() {\n var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var toFocus = null;\n try {\n if (focusLaterElements.length !== 0) {\n toFocus = focusLaterElements.pop();\n toFocus.focus({ preventScroll: preventScroll });\n }\n return;\n } catch (e) {\n console.warn([\"You tried to return focus to\", toFocus, \"but it is not in the DOM anymore\"].join(\" \"));\n }\n}\n/* eslint-enable no-console */\n\nfunction popWithoutFocus() {\n focusLaterElements.length > 0 && focusLaterElements.pop();\n}\n\nfunction setupScopedFocus(element) {\n modalElement = element;\n\n if (window.addEventListener) {\n window.addEventListener(\"blur\", handleBlur, false);\n document.addEventListener(\"focus\", handleFocus, true);\n } else {\n window.attachEvent(\"onBlur\", handleBlur);\n document.attachEvent(\"onFocus\", handleFocus);\n }\n}\n\nfunction teardownScopedFocus() {\n modalElement = null;\n\n if (window.addEventListener) {\n window.removeEventListener(\"blur\", handleBlur);\n document.removeEventListener(\"focus\", handleFocus);\n } else {\n window.detachEvent(\"onBlur\", handleBlur);\n document.detachEvent(\"onFocus\", handleFocus);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = scopeTab;\n\nvar _tabbable = require(\"./tabbable\");\n\nvar _tabbable2 = _interopRequireDefault(_tabbable);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction scopeTab(node, event) {\n var tabbable = (0, _tabbable2.default)(node);\n\n if (!tabbable.length) {\n // Do nothing, since there are no elements that can receive focus.\n event.preventDefault();\n return;\n }\n\n var target = void 0;\n\n var shiftKey = event.shiftKey;\n var head = tabbable[0];\n var tail = tabbable[tabbable.length - 1];\n\n // proceed with default browser behavior on tab.\n // Focus on last element on shift + tab.\n if (node === document.activeElement) {\n if (!shiftKey) return;\n target = tail;\n }\n\n if (tail === document.activeElement && !shiftKey) {\n target = head;\n }\n\n if (head === document.activeElement && shiftKey) {\n target = tail;\n }\n\n if (target) {\n event.preventDefault();\n target.focus();\n return;\n }\n\n // Safari radio issue.\n //\n // Safari does not move the focus to the radio button,\n // so we need to force it to really walk through all elements.\n //\n // This is very error prone, since we are trying to guess\n // if it is a safari browser from the first occurence between\n // chrome or safari.\n //\n // The chrome user agent contains the first ocurrence\n // as the 'chrome/version' and later the 'safari/version'.\n var checkSafari = /(\\bChrome\\b|\\bSafari\\b)\\//.exec(navigator.userAgent);\n var isSafariDesktop = checkSafari != null && checkSafari[1] != \"Chrome\" && /\\biPod\\b|\\biPad\\b/g.exec(navigator.userAgent) == null;\n\n // If we are not in safari desktop, let the browser control\n // the focus\n if (!isSafariDesktop) return;\n\n var x = tabbable.indexOf(document.activeElement);\n\n if (x > -1) {\n x += shiftKey ? -1 : 1;\n }\n\n target = tabbable[x];\n\n // If the tabbable element does not exist,\n // focus head/tail based on shiftKey\n if (typeof target === \"undefined\") {\n event.preventDefault();\n target = shiftKey ? tail : head;\n target.focus();\n return;\n }\n\n event.preventDefault();\n\n target.focus();\n}\nmodule.exports = exports[\"default\"];","/*!\n Copyright (c) 2015 Jed Watson.\n Based on code that is Copyright 2013-2015, Facebook, Inc.\n All rights reserved.\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar canUseDOM = !!(\n\t\ttypeof window !== 'undefined' &&\n\t\twindow.document &&\n\t\twindow.document.createElement\n\t);\n\n\tvar ExecutionEnvironment = {\n\n\t\tcanUseDOM: canUseDOM,\n\n\t\tcanUseWorkers: typeof Worker !== 'undefined',\n\n\t\tcanUseEventListeners:\n\t\t\tcanUseDOM && !!(window.addEventListener || window.attachEvent),\n\n\t\tcanUseViewport: canUseDOM && !!window.screen\n\n\t};\n\n\tif (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\tdefine(function () {\n\t\t\treturn ExecutionEnvironment;\n\t\t});\n\t} else if (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = ExecutionEnvironment;\n\t} else {\n\t\twindow.ExecutionEnvironment = ExecutionEnvironment;\n\t}\n\n}());\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.dumpClassLists = dumpClassLists;\nvar htmlClassList = {};\nvar docBodyClassList = {};\n\nfunction dumpClassLists() {\n if (process.env.NODE_ENV !== \"production\") {\n var classes = document.getElementsByTagName(\"html\")[0].className;\n var buffer = \"Show tracked classes:\\n\\n\";\n\n buffer += \" (\" + classes + \"):\\n\";\n for (var x in htmlClassList) {\n buffer += \" \" + x + \" \" + htmlClassList[x] + \"\\n\";\n }\n\n classes = document.body.className;\n\n // eslint-disable-next-line max-len\n buffer += \"\\n\\ndoc.body (\" + classes + \"):\\n\";\n for (var _x in docBodyClassList) {\n buffer += \" \" + _x + \" \" + docBodyClassList[_x] + \"\\n\";\n }\n\n buffer += \"\\n\";\n\n // eslint-disable-next-line no-console\n console.log(buffer);\n }\n}\n\n/**\n * Track the number of reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar incrementReference = function incrementReference(poll, className) {\n if (!poll[className]) {\n poll[className] = 0;\n }\n poll[className] += 1;\n return className;\n};\n\n/**\n * Drop the reference of a class.\n * @param {object} poll The poll to receive the reference.\n * @param {string} className The class name.\n * @return {string}\n */\nvar decrementReference = function decrementReference(poll, className) {\n if (poll[className]) {\n poll[className] -= 1;\n }\n return className;\n};\n\n/**\n * Track a class and add to the given class list.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be tracked.\n */\nvar trackClass = function trackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n incrementReference(poll, className);\n classListRef.add(className);\n });\n};\n\n/**\n * Untrack a class and remove from the given class list if the reference\n * reaches 0.\n * @param {Object} classListRef A class list of an element.\n * @param {Object} poll The poll to be used.\n * @param {Array} classes The list of classes to be untracked.\n */\nvar untrackClass = function untrackClass(classListRef, poll, classes) {\n classes.forEach(function (className) {\n decrementReference(poll, className);\n poll[className] === 0 && classListRef.remove(className);\n });\n};\n\n/**\n * Public inferface to add classes to the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar add = exports.add = function add(element, classString) {\n return trackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};\n\n/**\n * Public inferface to remove classes from the document.body.\n * @param {string} bodyClass The class string to be added.\n * It may contain more then one class\n * with ' ' as separator.\n */\nvar remove = exports.remove = function remove(element, classString) {\n return untrackClass(element.classList, element.nodeName.toLowerCase() == \"html\" ? htmlClassList : docBodyClassList, classString.split(\" \"));\n};","\"use strict\";\n\nvar _portalOpenInstances = require(\"./portalOpenInstances\");\n\nvar _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// Body focus trap see Issue #742\n\nvar before = void 0,\n after = void 0,\n instances = [];\n\nfunction focusContent() {\n if (instances.length === 0) {\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.warn(\"React-Modal: Open instances > 0 expected\");\n }\n return;\n }\n instances[instances.length - 1].focusContent();\n}\n\nfunction bodyTrap(eventType, openInstances) {\n if (!before || !after) {\n before = document.createElement(\"div\");\n before.setAttribute(\"data-react-modal-body-trap\", \"\");\n before.style.position = \"absolute\";\n before.style.opacity = \"0\";\n before.setAttribute(\"tabindex\", \"0\");\n before.addEventListener(\"focus\", focusContent);\n after = before.cloneNode();\n after.addEventListener(\"focus\", focusContent);\n }\n\n instances = openInstances;\n\n if (instances.length > 0) {\n // Add focus trap\n if (document.body.firstChild !== before) {\n document.body.insertBefore(before, document.body.firstChild);\n }\n if (document.body.lastChild !== after) {\n document.body.appendChild(after);\n }\n } else {\n // Remove focus trap\n if (before.parentElement) {\n before.parentElement.removeChild(before);\n }\n if (after.parentElement) {\n after.parentElement.removeChild(after);\n }\n }\n}\n\n_portalOpenInstances2.default.subscribe(bodyTrap);","var arrayMap = require('./_arrayMap'),\n baseGet = require('./_baseGet'),\n baseIteratee = require('./_baseIteratee'),\n baseMap = require('./_baseMap'),\n baseSortBy = require('./_baseSortBy'),\n baseUnary = require('./_baseUnary'),\n compareMultiple = require('./_compareMultiple'),\n identity = require('./identity'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\nfunction baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(baseIteratee));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n}\n\nmodule.exports = baseOrderBy;\n","var baseEach = require('./_baseEach'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n}\n\nmodule.exports = baseMap;\n","/**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\nfunction baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n}\n\nmodule.exports = baseSortBy;\n","var compareAscending = require('./_compareAscending');\n\n/**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\nfunction compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n}\n\nmodule.exports = compareMultiple;\n","var isSymbol = require('./isSymbol');\n\n/**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\nfunction compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n}\n\nmodule.exports = compareAscending;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar dateTag = '[object Date]';\n\n/**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\nfunction baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n}\n\nmodule.exports = baseIsDate;\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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __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\nexport var __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\nexport function __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\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __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\nexport function __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\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __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\nexport function __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}\r\n\r\nexport function __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};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\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 CryptoUtils = /** @class */ (function () {\r\n function CryptoUtils() {\r\n }\r\n /**\r\n * Creates a new random GUID\r\n * @returns string (GUID)\r\n */\r\n CryptoUtils.createNewGuid = function () {\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 var cryptoObj = window.crypto; // for IE 11\r\n if (cryptoObj && cryptoObj.getRandomValues) {\r\n var buffer = new Uint8Array(16);\r\n 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 CryptoUtils.decimalToHex(buffer[0]) + CryptoUtils.decimalToHex(buffer[1])\r\n + CryptoUtils.decimalToHex(buffer[2]) + CryptoUtils.decimalToHex(buffer[3])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[4]) + CryptoUtils.decimalToHex(buffer[5])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[6]) + CryptoUtils.decimalToHex(buffer[7])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[8]) + CryptoUtils.decimalToHex(buffer[9])\r\n + \"-\" + CryptoUtils.decimalToHex(buffer[10]) + CryptoUtils.decimalToHex(buffer[11])\r\n + CryptoUtils.decimalToHex(buffer[12]) + CryptoUtils.decimalToHex(buffer[13])\r\n + CryptoUtils.decimalToHex(buffer[14]) + CryptoUtils.decimalToHex(buffer[15]);\r\n }\r\n else {\r\n var guidHolder = \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\";\r\n var hex = \"0123456789abcdef\";\r\n var r = 0;\r\n var guidResponse = \"\";\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 CryptoUtils.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 /**\r\n * Decimal to Hex\r\n *\r\n * @param num\r\n */\r\n CryptoUtils.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 // See: https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_4_%E2%80%93_escaping_the_string_before_encoding_it\r\n /**\r\n * encoding string to base64 - platform specific check\r\n *\r\n * @param input\r\n */\r\n CryptoUtils.base64Encode = function (input) {\r\n return btoa(encodeURIComponent(input).replace(/%([0-9A-F]{2})/g, function toSolidBytes(match, p1) {\r\n return String.fromCharCode(Number(\"0x\" + p1));\r\n }));\r\n };\r\n /**\r\n * Decodes a base64 encoded string.\r\n *\r\n * @param input\r\n */\r\n CryptoUtils.base64Decode = 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 return decodeURIComponent(atob(encodedString).split(\"\").map(function (c) {\r\n return \"%\" + (\"00\" + c.charCodeAt(0).toString(16)).slice(-2);\r\n }).join(\"\"));\r\n };\r\n /**\r\n * deserialize a string\r\n *\r\n * @param query\r\n */\r\n CryptoUtils.deserialize = function (query) {\r\n var match; // Regex for replacing addition symbol with a space\r\n var pl = /\\+/g;\r\n var search = /([^&=]+)=([^&]*)/g;\r\n var decode = function (s) { return decodeURIComponent(s.replace(pl, \" \")); };\r\n var obj = {};\r\n match = search.exec(query);\r\n while (match) {\r\n obj[decode(match[1])] = decode(match[2]);\r\n match = search.exec(query);\r\n }\r\n return obj;\r\n };\r\n return CryptoUtils;\r\n}());\r\nexport { CryptoUtils };\r\n//# sourceMappingURL=CryptoUtils.js.map","/*\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 * Constants\r\n */\r\nvar Constants = /** @class */ (function () {\r\n function Constants() {\r\n }\r\n Object.defineProperty(Constants, \"libraryName\", {\r\n get: function () { return \"Msal.js\"; } // used in telemetry sdkName\r\n ,\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"claims\", {\r\n get: function () { return \"claims\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"clientId\", {\r\n get: function () { return \"clientId\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"adalIdToken\", {\r\n get: function () { return \"adal.idtoken\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"cachePrefix\", {\r\n get: function () { return \"msal\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"scopes\", {\r\n get: function () { return \"scopes\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"no_account\", {\r\n get: function () { return \"NO_ACCOUNT\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"upn\", {\r\n get: function () { return \"upn\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"domain_hint\", {\r\n get: function () { return \"domain_hint\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"prompt_select_account\", {\r\n get: function () { return \"&prompt=select_account\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"prompt_none\", {\r\n get: function () { return \"&prompt=none\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"prompt\", {\r\n get: function () { return \"prompt\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"response_mode_fragment\", {\r\n get: function () { return \"&response_mode=fragment\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"resourceDelimiter\", {\r\n get: function () { return \"|\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"cacheDelimiter\", {\r\n get: function () { return \".\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"popUpWidth\", {\r\n get: function () { return this._popUpWidth; },\r\n set: function (width) {\r\n this._popUpWidth = width;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"popUpHeight\", {\r\n get: function () { return this._popUpHeight; },\r\n set: function (height) {\r\n this._popUpHeight = height;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"login\", {\r\n get: function () { return \"LOGIN\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"renewToken\", {\r\n get: function () { return \"RENEW_TOKEN\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"unknown\", {\r\n get: function () { return \"UNKNOWN\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"ADFS\", {\r\n get: function () { return \"adfs\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"homeAccountIdentifier\", {\r\n get: function () { return \"homeAccountIdentifier\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"common\", {\r\n get: function () { return \"common\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"openidScope\", {\r\n get: function () { return \"openid\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"profileScope\", {\r\n get: function () { return \"profile\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"oidcScopes\", {\r\n get: function () { return [this.openidScope, this.profileScope]; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"interactionTypeRedirect\", {\r\n get: function () { return \"redirectInteraction\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"interactionTypePopup\", {\r\n get: function () { return \"popupInteraction\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"interactionTypeSilent\", {\r\n get: function () { return \"silentInteraction\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Constants, \"inProgress\", {\r\n get: function () { return \"inProgress\"; },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Constants._popUpWidth = 483;\r\n Constants._popUpHeight = 600;\r\n return Constants;\r\n}());\r\nexport { Constants };\r\n/**\r\n * Keys in the hashParams\r\n */\r\nexport var ServerHashParamKeys;\r\n(function (ServerHashParamKeys) {\r\n ServerHashParamKeys[\"SCOPE\"] = \"scope\";\r\n ServerHashParamKeys[\"STATE\"] = \"state\";\r\n ServerHashParamKeys[\"ERROR\"] = \"error\";\r\n ServerHashParamKeys[\"ERROR_DESCRIPTION\"] = \"error_description\";\r\n ServerHashParamKeys[\"ACCESS_TOKEN\"] = \"access_token\";\r\n ServerHashParamKeys[\"ID_TOKEN\"] = \"id_token\";\r\n ServerHashParamKeys[\"EXPIRES_IN\"] = \"expires_in\";\r\n ServerHashParamKeys[\"SESSION_STATE\"] = \"session_state\";\r\n ServerHashParamKeys[\"CLIENT_INFO\"] = \"client_info\";\r\n})(ServerHashParamKeys || (ServerHashParamKeys = {}));\r\n/**\r\n * @hidden\r\n * @ignore\r\n * response_type from OpenIDConnect\r\n * References: https://openid.net/specs/oauth-v2-multiple-response-types-1_0.html & https://tools.ietf.org/html/rfc6749#section-4.2.1\r\n *\r\n */\r\nexport var ResponseTypes = {\r\n id_token: \"id_token\",\r\n token: \"token\",\r\n id_token_token: \"id_token token\"\r\n};\r\n/**\r\n * @hidden\r\n * CacheKeys for MSAL\r\n */\r\nexport var TemporaryCacheKeys;\r\n(function (TemporaryCacheKeys) {\r\n TemporaryCacheKeys[\"AUTHORITY\"] = \"authority\";\r\n TemporaryCacheKeys[\"ACQUIRE_TOKEN_ACCOUNT\"] = \"acquireTokenAccount\";\r\n TemporaryCacheKeys[\"SESSION_STATE\"] = \"session.state\";\r\n TemporaryCacheKeys[\"STATE_LOGIN\"] = \"state.login\";\r\n TemporaryCacheKeys[\"STATE_ACQ_TOKEN\"] = \"state.acquireToken\";\r\n TemporaryCacheKeys[\"STATE_RENEW\"] = \"state.renew\";\r\n TemporaryCacheKeys[\"NONCE_IDTOKEN\"] = \"nonce.idtoken\";\r\n TemporaryCacheKeys[\"LOGIN_REQUEST\"] = \"login.request\";\r\n TemporaryCacheKeys[\"RENEW_STATUS\"] = \"token.renew.status\";\r\n TemporaryCacheKeys[\"URL_HASH\"] = \"urlHash\";\r\n TemporaryCacheKeys[\"INTERACTION_STATUS\"] = \"interaction_status\";\r\n TemporaryCacheKeys[\"REDIRECT_REQUEST\"] = \"redirect_request\";\r\n})(TemporaryCacheKeys || (TemporaryCacheKeys = {}));\r\nexport var PersistentCacheKeys;\r\n(function (PersistentCacheKeys) {\r\n PersistentCacheKeys[\"IDTOKEN\"] = \"idtoken\";\r\n PersistentCacheKeys[\"CLIENT_INFO\"] = \"client.info\";\r\n})(PersistentCacheKeys || (PersistentCacheKeys = {}));\r\nexport var ErrorCacheKeys;\r\n(function (ErrorCacheKeys) {\r\n ErrorCacheKeys[\"LOGIN_ERROR\"] = \"login.error\";\r\n ErrorCacheKeys[\"ERROR\"] = \"error\";\r\n ErrorCacheKeys[\"ERROR_DESC\"] = \"error.description\";\r\n})(ErrorCacheKeys || (ErrorCacheKeys = {}));\r\nexport var DEFAULT_AUTHORITY = \"https://login.microsoftonline.com/common/\";\r\nexport var AAD_INSTANCE_DISCOVERY_ENDPOINT = DEFAULT_AUTHORITY + \"/discovery/instance?api-version=1.1&authorization_endpoint=\";\r\nexport var WELL_KNOWN_SUFFIX = \".well-known/openid-configuration\";\r\n/**\r\n * @hidden\r\n * SSO Types - generated to populate hints\r\n */\r\nexport var 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[\"ORGANIZATIONS\"] = \"organizations\";\r\n SSOTypes[\"ID_TOKEN\"] = \"id_token\";\r\n SSOTypes[\"ACCOUNT_ID\"] = \"accountIdentifier\";\r\n SSOTypes[\"HOMEACCOUNT_ID\"] = \"homeAccountIdentifier\";\r\n})(SSOTypes || (SSOTypes = {}));\r\n/**\r\n * @hidden\r\n */\r\nexport var BlacklistedEQParams = [\r\n SSOTypes.SID,\r\n SSOTypes.LOGIN_HINT\r\n];\r\nexport var NetworkRequestType = {\r\n GET: \"GET\",\r\n POST: \"POST\"\r\n};\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 * @hidden\r\n */\r\nexport var PromptState = {\r\n LOGIN: \"login\",\r\n SELECT_ACCOUNT: \"select_account\",\r\n CONSENT: \"consent\",\r\n NONE: \"none\"\r\n};\r\n/**\r\n * Frame name prefixes for the hidden iframe created in silent frames\r\n */\r\nexport var FramePrefix = {\r\n ID_TOKEN_FRAME: \"msalIdTokenFrame\",\r\n TOKEN_FRAME: \"msalRenewFrame\"\r\n};\r\n/**\r\n * MSAL JS Library Version\r\n */\r\nexport function libraryVersion() {\r\n return \"1.4.4\";\r\n}\r\n//# sourceMappingURL=Constants.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nexport var AuthErrorMessage = {\r\n unexpectedError: {\r\n code: \"unexpected_error\",\r\n desc: \"Unexpected error in authentication.\"\r\n },\r\n noWindowObjectError: {\r\n code: \"no_window_object\",\r\n desc: \"No window object available. 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 tslib_1.__extends(AuthError, _super);\r\n function AuthError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorMessage) || this;\r\n Object.setPrototypeOf(_this, AuthError.prototype);\r\n _this.errorCode = errorCode;\r\n _this.errorMessage = errorMessage;\r\n _this.name = \"AuthError\";\r\n return _this;\r\n }\r\n AuthError.createUnexpectedError = function (errDesc) {\r\n return new AuthError(AuthErrorMessage.unexpectedError.code, AuthErrorMessage.unexpectedError.desc + \": \" + errDesc);\r\n };\r\n AuthError.createNoWindowObjectError = function (errDesc) {\r\n return new AuthError(AuthErrorMessage.noWindowObjectError.code, AuthErrorMessage.noWindowObjectError.desc + \" \" + errDesc);\r\n };\r\n return AuthError;\r\n}(Error));\r\nexport { AuthError };\r\n//# sourceMappingURL=AuthError.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { ClientConfigurationErrorMessage, ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { XhrClient } from \"../XHRClient\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\nimport { TrustedAuthority } from \"./TrustedAuthority\";\r\nimport { NetworkRequestType, Constants, WELL_KNOWN_SUFFIX } from \"../utils/Constants\";\r\n/**\r\n * @hidden\r\n */\r\nexport var AuthorityType;\r\n(function (AuthorityType) {\r\n AuthorityType[AuthorityType[\"Default\"] = 0] = \"Default\";\r\n AuthorityType[AuthorityType[\"Adfs\"] = 1] = \"Adfs\";\r\n})(AuthorityType || (AuthorityType = {}));\r\n/**\r\n * @hidden\r\n */\r\nvar Authority = /** @class */ (function () {\r\n function Authority(authority, validateAuthority, authorityMetadata) {\r\n this.IsValidationEnabled = validateAuthority;\r\n this.CanonicalAuthority = authority;\r\n this.validateAsUri();\r\n this.tenantDiscoveryResponse = authorityMetadata;\r\n }\r\n Authority.isAdfs = function (authorityUrl) {\r\n var components = UrlUtils.GetUrlComponents(authorityUrl);\r\n var pathSegments = components.PathSegments;\r\n return (pathSegments.length && pathSegments[0].toLowerCase() === Constants.ADFS);\r\n };\r\n Object.defineProperty(Authority.prototype, \"AuthorityType\", {\r\n get: function () {\r\n return Authority.isAdfs(this.canonicalAuthority) ? AuthorityType.Adfs : AuthorityType.Default;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"Tenant\", {\r\n get: function () {\r\n return this.CanonicalAuthorityUrlComponents.PathSegments[0];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"AuthorizationEndpoint\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.AuthorizationEndpoint.replace(/{tenant}|{tenantid}/g, this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"EndSessionEndpoint\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.EndSessionEndpoint.replace(/{tenant}|{tenantid}/g, this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"SelfSignedJwtAudience\", {\r\n get: function () {\r\n this.validateResolved();\r\n return this.tenantDiscoveryResponse.Issuer.replace(/{tenant}|{tenantid}/g, this.Tenant);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Authority.prototype.validateResolved = function () {\r\n if (!this.hasCachedMetadata()) {\r\n throw \"Please call ResolveEndpointsAsync first\";\r\n }\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;\r\n },\r\n set: function (url) {\r\n this.canonicalAuthority = UrlUtils.CanonicalizeUri(url);\r\n this.canonicalAuthorityUrlComponents = null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"CanonicalAuthorityUrlComponents\", {\r\n get: function () {\r\n if (!this.canonicalAuthorityUrlComponents) {\r\n this.canonicalAuthorityUrlComponents = UrlUtils.GetUrlComponents(this.CanonicalAuthority);\r\n }\r\n return this.canonicalAuthorityUrlComponents;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(Authority.prototype, \"DefaultOpenIdConfigurationEndpoint\", {\r\n // http://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata\r\n get: function () {\r\n return (this.AuthorityType === AuthorityType.Adfs) ? \"\" + this.CanonicalAuthority + WELL_KNOWN_SUFFIX : this.CanonicalAuthority + \"v2.0/\" + WELL_KNOWN_SUFFIX;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Given a string, validate that it is of the form https://domain/path\r\n */\r\n Authority.prototype.validateAsUri = function () {\r\n var components;\r\n try {\r\n components = this.CanonicalAuthorityUrlComponents;\r\n }\r\n catch (e) {\r\n throw ClientConfigurationErrorMessage.invalidAuthorityType;\r\n }\r\n if (!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\r\n throw ClientConfigurationErrorMessage.authorityUriInsecure;\r\n }\r\n if (!components.PathSegments || components.PathSegments.length < 1) {\r\n throw ClientConfigurationErrorMessage.authorityUriInvalidPath;\r\n }\r\n };\r\n /**\r\n * Calls the OIDC endpoint and returns the response\r\n */\r\n Authority.prototype.DiscoverEndpoints = function (openIdConfigurationEndpoint, telemetryManager, correlationId) {\r\n var client = new XhrClient();\r\n var httpMethod = NetworkRequestType.GET;\r\n var httpEvent = telemetryManager.createAndStartHttpEvent(correlationId, httpMethod, openIdConfigurationEndpoint, \"openIdConfigurationEndpoint\");\r\n return client.sendRequestAsync(openIdConfigurationEndpoint, httpMethod, /* enableCaching: */ true)\r\n .then(function (response) {\r\n httpEvent.httpResponseStatus = response.statusCode;\r\n telemetryManager.stopEvent(httpEvent);\r\n return {\r\n AuthorizationEndpoint: response.body.authorization_endpoint,\r\n EndSessionEndpoint: response.body.end_session_endpoint,\r\n Issuer: response.body.issuer\r\n };\r\n })\r\n .catch(function (err) {\r\n httpEvent.serverErrorCode = err;\r\n telemetryManager.stopEvent(httpEvent);\r\n throw err;\r\n });\r\n };\r\n /**\r\n * Returns a promise.\r\n * Checks to see if the authority is in the cache\r\n * Discover endpoints via openid-configuration\r\n * If successful, caches the endpoint for later use in OIDC\r\n */\r\n Authority.prototype.resolveEndpointsAsync = function (telemetryManager, correlationId) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var host, openIdConfigurationEndpointResponse, _a;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n if (!this.IsValidationEnabled) return [3 /*break*/, 3];\r\n host = this.canonicalAuthorityUrlComponents.HostNameAndPort;\r\n if (!(TrustedAuthority.getTrustedHostList().length === 0)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, TrustedAuthority.setTrustedAuthoritiesFromNetwork(this.canonicalAuthority, telemetryManager, correlationId)];\r\n case 1:\r\n _b.sent();\r\n _b.label = 2;\r\n case 2:\r\n if (!TrustedAuthority.IsInTrustedHostList(host)) {\r\n throw ClientConfigurationError.createUntrustedAuthorityError(host);\r\n }\r\n _b.label = 3;\r\n case 3:\r\n openIdConfigurationEndpointResponse = this.GetOpenIdConfigurationEndpoint();\r\n _a = this;\r\n return [4 /*yield*/, this.DiscoverEndpoints(openIdConfigurationEndpointResponse, telemetryManager, correlationId)];\r\n case 4:\r\n _a.tenantDiscoveryResponse = _b.sent();\r\n return [2 /*return*/, this.tenantDiscoveryResponse];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * Checks if there is a cached tenant discovery response with required fields.\r\n */\r\n Authority.prototype.hasCachedMetadata = function () {\r\n return !!(this.tenantDiscoveryResponse &&\r\n this.tenantDiscoveryResponse.AuthorizationEndpoint &&\r\n this.tenantDiscoveryResponse.EndSessionEndpoint &&\r\n this.tenantDiscoveryResponse.Issuer);\r\n };\r\n /**\r\n * Returns a promise which resolves to the OIDC endpoint\r\n * Only responds with the endpoint\r\n */\r\n Authority.prototype.GetOpenIdConfigurationEndpoint = function () {\r\n return this.DefaultOpenIdConfigurationEndpoint;\r\n };\r\n return Authority;\r\n}());\r\nexport { Authority };\r\n//# sourceMappingURL=Authority.js.map","/*\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 * 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 a string's value is a valid JSON object\r\n *\r\n * @param str\r\n */\r\n StringUtils.validateAndParseJsonCacheKey = function (str) {\r\n try {\r\n var parsedKey = JSON.parse(str);\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 (parsedKey && typeof parsedKey === \"object\") ? parsedKey : null;\r\n }\r\n catch (error) {\r\n return null;\r\n }\r\n };\r\n return StringUtils;\r\n}());\r\nexport { StringUtils };\r\n//# sourceMappingURL=StringUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { AuthError } from \"./AuthError\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nexport var ClientAuthErrorMessage = {\r\n multipleCacheAuthorities: {\r\n code: \"multiple_authorities\",\r\n desc: \"Multiple authorities found in the cache. Pass authority in the API overload.\"\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 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 tokenRenewalError: {\r\n code: \"token_renewal_error\",\r\n desc: \"Token renewal operation failed due to timeout.\"\r\n },\r\n invalidIdToken: {\r\n code: \"invalid_id_token\",\r\n desc: \"Invalid ID token format.\"\r\n },\r\n invalidStateError: {\r\n code: \"invalid_state_error\",\r\n desc: \"Invalid state.\"\r\n },\r\n nonceMismatchError: {\r\n code: \"nonce_mismatch_error\",\r\n desc: \"Nonce is not matching, Nonce received: \"\r\n },\r\n loginProgressError: {\r\n code: \"login_progress_error\",\r\n desc: \"Login_In_Progress: Error during login call - login is already in progress.\"\r\n },\r\n acquireTokenProgressError: {\r\n code: \"acquiretoken_progress_error\",\r\n desc: \"AcquireToken_In_Progress: Error during login call - login is already in progress.\"\r\n },\r\n userCancelledError: {\r\n code: \"user_cancelled\",\r\n desc: \"User cancelled the flow.\"\r\n },\r\n callbackError: {\r\n code: \"callback_error\",\r\n desc: \"Error occurred in token received callback function.\"\r\n },\r\n userLoginRequiredError: {\r\n code: \"user_login_error\",\r\n desc: \"User login is required. For silent calls, request must contain either sid or login_hint\"\r\n },\r\n userDoesNotExistError: {\r\n code: \"user_non_existent\",\r\n desc: \"User object does not exist. Please call a login API.\"\r\n },\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 clientInfoNotPopulatedError: {\r\n code: \"client_info_not_populated_error\",\r\n desc: \"The service did not populate client_info in the response, Please verify with the service team\"\r\n },\r\n nullOrEmptyIdToken: {\r\n code: \"null_or_empty_id_token\",\r\n desc: \"The idToken is null or empty. Please review the trace to determine the root cause.\"\r\n },\r\n idTokenNotParsed: {\r\n code: \"id_token_parsing_error\",\r\n desc: \"ID token cannot be parsed. Please review stack trace to determine root cause.\"\r\n },\r\n tokenEncodingError: {\r\n code: \"token_encoding_error\",\r\n desc: \"The token to be decoded is not encoded correctly.\"\r\n },\r\n invalidInteractionType: {\r\n code: \"invalid_interaction_type\",\r\n desc: \"The interaction type passed to the handler was incorrect or unknown\"\r\n },\r\n cacheParseError: {\r\n code: \"cannot_parse_cache\",\r\n desc: \"The cached token key is not a valid JSON and cannot be parsed\"\r\n },\r\n blockTokenRequestsInHiddenIframe: {\r\n code: \"block_token_requests\",\r\n desc: \"Token calls are blocked in hidden iframes\"\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 tslib_1.__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 ClientAuthError.createEndpointResolutionError = function (errDetail) {\r\n var errorMessage = ClientAuthErrorMessage.endpointResolutionError.desc;\r\n if (errDetail && !StringUtils.isEmpty(errDetail)) {\r\n errorMessage += \" Details: \" + errDetail;\r\n }\r\n return new ClientAuthError(ClientAuthErrorMessage.endpointResolutionError.code, errorMessage);\r\n };\r\n ClientAuthError.createMultipleAuthoritiesInCacheError = function (scope) {\r\n return new ClientAuthError(ClientAuthErrorMessage.multipleCacheAuthorities.code, \"Cache error for scope \" + scope + \": \" + ClientAuthErrorMessage.multipleCacheAuthorities.desc + \".\");\r\n };\r\n ClientAuthError.createPopupWindowError = function (errDetail) {\r\n var errorMessage = ClientAuthErrorMessage.popUpWindowError.desc;\r\n if (errDetail && !StringUtils.isEmpty(errDetail)) {\r\n errorMessage += \" Details: \" + errDetail;\r\n }\r\n return new ClientAuthError(ClientAuthErrorMessage.popUpWindowError.code, errorMessage);\r\n };\r\n ClientAuthError.createTokenRenewalTimeoutError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenRenewalError.code, ClientAuthErrorMessage.tokenRenewalError.desc);\r\n };\r\n ClientAuthError.createInvalidIdTokenError = function (idToken) {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidIdToken.code, ClientAuthErrorMessage.invalidIdToken.desc + \" Given token: \" + idToken);\r\n };\r\n // TODO: Is this not a security flaw to send the user the state expected??\r\n ClientAuthError.createInvalidStateError = function (invalidState, actualState) {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidStateError.code, ClientAuthErrorMessage.invalidStateError.desc + \" \" + invalidState + \", state expected : \" + actualState + \".\");\r\n };\r\n // TODO: Is this not a security flaw to send the user the Nonce expected??\r\n ClientAuthError.createNonceMismatchError = function (invalidNonce, actualNonce) {\r\n return new ClientAuthError(ClientAuthErrorMessage.nonceMismatchError.code, ClientAuthErrorMessage.nonceMismatchError.desc + \" \" + invalidNonce + \", nonce expected : \" + actualNonce + \".\");\r\n };\r\n ClientAuthError.createLoginInProgressError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.loginProgressError.code, ClientAuthErrorMessage.loginProgressError.desc);\r\n };\r\n ClientAuthError.createAcquireTokenInProgressError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.acquireTokenProgressError.code, ClientAuthErrorMessage.acquireTokenProgressError.desc);\r\n };\r\n ClientAuthError.createUserCancelledError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.userCancelledError.code, ClientAuthErrorMessage.userCancelledError.desc);\r\n };\r\n ClientAuthError.createErrorInCallbackFunction = function (errorDesc) {\r\n return new ClientAuthError(ClientAuthErrorMessage.callbackError.code, ClientAuthErrorMessage.callbackError.desc + \" \" + errorDesc + \".\");\r\n };\r\n ClientAuthError.createUserLoginRequiredError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.userLoginRequiredError.code, ClientAuthErrorMessage.userLoginRequiredError.desc);\r\n };\r\n ClientAuthError.createUserDoesNotExistError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.userDoesNotExistError.code, ClientAuthErrorMessage.userDoesNotExistError.desc);\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 ClientAuthError.createClientInfoNotPopulatedError = function (caughtError) {\r\n return new ClientAuthError(ClientAuthErrorMessage.clientInfoNotPopulatedError.code, ClientAuthErrorMessage.clientInfoNotPopulatedError.desc + \" Failed with error: \" + caughtError);\r\n };\r\n ClientAuthError.createIdTokenNullOrEmptyError = function (invalidRawTokenString) {\r\n return new ClientAuthError(ClientAuthErrorMessage.nullOrEmptyIdToken.code, ClientAuthErrorMessage.nullOrEmptyIdToken.desc + \" Raw ID Token Value: \" + invalidRawTokenString);\r\n };\r\n ClientAuthError.createIdTokenParsingError = function (caughtParsingError) {\r\n return new ClientAuthError(ClientAuthErrorMessage.idTokenNotParsed.code, ClientAuthErrorMessage.idTokenNotParsed.desc + \" Failed with error: \" + caughtParsingError);\r\n };\r\n ClientAuthError.createTokenEncodingError = function (incorrectlyEncodedToken) {\r\n return new ClientAuthError(ClientAuthErrorMessage.tokenEncodingError.code, ClientAuthErrorMessage.tokenEncodingError.desc + \" Attempted to decode: \" + incorrectlyEncodedToken);\r\n };\r\n ClientAuthError.createInvalidInteractionTypeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.invalidInteractionType.code, ClientAuthErrorMessage.invalidInteractionType.desc);\r\n };\r\n ClientAuthError.createCacheParseError = function (key) {\r\n var errorMessage = \"invalid key: \" + key + \", \" + ClientAuthErrorMessage.cacheParseError.desc;\r\n return new ClientAuthError(ClientAuthErrorMessage.cacheParseError.code, errorMessage);\r\n };\r\n ClientAuthError.createBlockTokenRequestsInHiddenIframeError = function () {\r\n return new ClientAuthError(ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.code, ClientAuthErrorMessage.blockTokenRequestsInHiddenIframe.desc);\r\n };\r\n return ClientAuthError;\r\n}(AuthError));\r\nexport { ClientAuthError };\r\n//# sourceMappingURL=ClientAuthError.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { ClientAuthError } from \"./ClientAuthError\";\r\nexport var ClientConfigurationErrorMessage = {\r\n configurationNotSet: {\r\n code: \"no_config_set\",\r\n desc: \"Configuration has not been set. Please call the UserAgentApplication constructor with a valid Configuration object.\"\r\n },\r\n storageNotSupported: {\r\n code: \"storage_not_supported\",\r\n desc: \"The value for the cacheLocation is not supported.\"\r\n },\r\n noRedirectCallbacksSet: {\r\n code: \"no_redirect_callbacks\",\r\n desc: \"No redirect callbacks have been set. Please call handleRedirectCallback() 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 scopesRequired: {\r\n code: \"scopes_required\",\r\n desc: \"Scopes are required to obtain an access token.\"\r\n },\r\n emptyScopes: {\r\n code: \"empty_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as empty array.\"\r\n },\r\n nonArrayScopes: {\r\n code: \"nonarray_input_scopes_error\",\r\n desc: \"Scopes cannot be passed as non-array.\"\r\n },\r\n invalidPrompt: {\r\n code: \"invalid_prompt_value\",\r\n desc: \"Supported prompt values are 'login', 'select_account', 'consent' and 'none'\",\r\n },\r\n invalidAuthorityType: {\r\n code: \"invalid_authority_type\",\r\n desc: \"The given authority is not a valid type of authority supported by MSAL. Please see here for valid authorities: .\"\r\n },\r\n authorityUriInsecure: {\r\n code: \"authority_uri_insecure\",\r\n desc: \"Authority URIs must use https.\"\r\n },\r\n authorityUriInvalidPath: {\r\n code: \"authority_uri_invalid_path\",\r\n desc: \"Given authority URI is invalid.\"\r\n },\r\n unsupportedAuthorityValidation: {\r\n code: \"unsupported_authority_validation\",\r\n desc: \"The authority validation is not supported for this authority type.\"\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 or set validateAuthority=false.\"\r\n },\r\n b2cAuthorityUriInvalidPath: {\r\n code: \"b2c_authority_uri_invalid_path\",\r\n desc: \"The given URI for the B2C authority is invalid.\"\r\n },\r\n b2cKnownAuthoritiesNotSet: {\r\n code: \"b2c_known_authorities_not_set\",\r\n desc: \"Must set known authorities when validateAuthority is set to True and using B2C\"\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 emptyRequestError: {\r\n code: \"empty_request_error\",\r\n desc: \"Request object is required.\"\r\n },\r\n invalidCorrelationIdError: {\r\n code: \"invalid_guid_sent_as_correlationId\",\r\n desc: \"Please set the correlationId as a valid guid\"\r\n },\r\n telemetryConfigError: {\r\n code: \"telemetry_config_error\",\r\n desc: \"Telemetry config is not configured with required values\"\r\n },\r\n ssoSilentError: {\r\n code: \"sso_silent_error\",\r\n desc: \"request must contain either sid or login_hint\"\r\n },\r\n invalidAuthorityMetadataError: {\r\n code: \"authority_metadata_error\",\r\n desc: \"Invalid authorityMetadata. Must be a JSON object containing authorization_endpoint, end_session_endpoint, and issuer fields.\"\r\n }\r\n};\r\n/**\r\n * Error thrown when there is an error in configuration of the .js library.\r\n */\r\nvar ClientConfigurationError = /** @class */ (function (_super) {\r\n tslib_1.__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 ClientConfigurationError.createNoSetConfigurationError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.configurationNotSet.code, \"\" + ClientConfigurationErrorMessage.configurationNotSet.desc);\r\n };\r\n ClientConfigurationError.createStorageNotSupportedError = function (givenCacheLocation) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.storageNotSupported.code, ClientConfigurationErrorMessage.storageNotSupported.desc + \" Given location: \" + givenCacheLocation);\r\n };\r\n ClientConfigurationError.createRedirectCallbacksNotSetError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.noRedirectCallbacksSet.code, ClientConfigurationErrorMessage.noRedirectCallbacksSet.desc);\r\n };\r\n ClientConfigurationError.createInvalidCallbackObjectError = function (callbackObject) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCallbackObject.code, ClientConfigurationErrorMessage.invalidCallbackObject.desc + \" Given value for callback function: \" + callbackObject);\r\n };\r\n ClientConfigurationError.createEmptyScopesArrayError = function (scopesValue) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.emptyScopes.code, ClientConfigurationErrorMessage.emptyScopes.desc + \" Given value: \" + scopesValue + \".\");\r\n };\r\n ClientConfigurationError.createScopesNonArrayError = function (scopesValue) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.nonArrayScopes.code, ClientConfigurationErrorMessage.nonArrayScopes.desc + \" Given value: \" + scopesValue + \".\");\r\n };\r\n ClientConfigurationError.createScopesRequiredError = function (scopesValue) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.scopesRequired.code, ClientConfigurationErrorMessage.scopesRequired.desc + \" Given value: \" + scopesValue);\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 ClientConfigurationError.createClaimsRequestParsingError = function (claimsRequestParseError) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.claimsRequestParsingError.code, ClientConfigurationErrorMessage.claimsRequestParsingError.desc + \" Given value: \" + claimsRequestParseError);\r\n };\r\n ClientConfigurationError.createEmptyRequestError = function () {\r\n var _a = ClientConfigurationErrorMessage.emptyRequestError, code = _a.code, desc = _a.desc;\r\n return new ClientConfigurationError(code, desc);\r\n };\r\n ClientConfigurationError.createInvalidCorrelationIdError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidCorrelationIdError.code, ClientConfigurationErrorMessage.invalidCorrelationIdError.desc);\r\n };\r\n ClientConfigurationError.createKnownAuthoritiesNotSetError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.code, ClientConfigurationErrorMessage.b2cKnownAuthoritiesNotSet.desc);\r\n };\r\n ClientConfigurationError.createInvalidAuthorityTypeError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityType.code, ClientConfigurationErrorMessage.invalidAuthorityType.desc);\r\n };\r\n ClientConfigurationError.createUntrustedAuthorityError = function (host) {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.untrustedAuthority.code, ClientConfigurationErrorMessage.untrustedAuthority.desc + \" Provided Authority: \" + host);\r\n };\r\n ClientConfigurationError.createTelemetryConfigError = function (config) {\r\n var _a = ClientConfigurationErrorMessage.telemetryConfigError, code = _a.code, desc = _a.desc;\r\n var requiredKeys = {\r\n applicationName: \"string\",\r\n applicationVersion: \"string\",\r\n telemetryEmitter: \"function\"\r\n };\r\n var missingKeys = Object.keys(requiredKeys)\r\n .reduce(function (keys, key) {\r\n return config[key] ? keys : keys.concat([key + \" (\" + requiredKeys[key] + \")\"]);\r\n }, []);\r\n return new ClientConfigurationError(code, desc + \" mising values: \" + missingKeys.join(\",\"));\r\n };\r\n ClientConfigurationError.createSsoSilentError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.ssoSilentError.code, ClientConfigurationErrorMessage.ssoSilentError.desc);\r\n };\r\n ClientConfigurationError.createInvalidAuthorityMetadataError = function () {\r\n return new ClientConfigurationError(ClientConfigurationErrorMessage.invalidAuthorityMetadataError.code, ClientConfigurationErrorMessage.invalidAuthorityMetadataError.desc);\r\n };\r\n return ClientConfigurationError;\r\n}(ClientAuthError));\r\nexport { ClientConfigurationError };\r\n//# sourceMappingURL=ClientConfigurationError.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nimport { Constants } from \"./utils/Constants\";\r\nvar ScopeSet = /** @class */ (function () {\r\n function ScopeSet() {\r\n }\r\n /**\r\n * Check if there are dup scopes in a given request\r\n *\r\n * @param cachedScopes\r\n * @param scopes\r\n */\r\n // TODO: Rename this, intersecting scopes isn't a great name for duplicate checker\r\n ScopeSet.isIntersectingScopes = function (cachedScopes, scopes) {\r\n var convertedCachedScopes = this.trimAndConvertArrayToLowerCase(cachedScopes.slice());\r\n var requestScopes = this.trimAndConvertArrayToLowerCase(scopes.slice());\r\n for (var i = 0; i < requestScopes.length; i++) {\r\n if (convertedCachedScopes.indexOf(requestScopes[i].toLowerCase()) > -1) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n /**\r\n * Check if a given scope is present in the request\r\n *\r\n * @param cachedScopes\r\n * @param scopes\r\n */\r\n ScopeSet.containsScope = function (cachedScopes, scopes) {\r\n var convertedCachedScopes = this.trimAndConvertArrayToLowerCase(cachedScopes.slice());\r\n var requestScopes = this.trimAndConvertArrayToLowerCase(scopes.slice());\r\n return requestScopes.every(function (value) { return convertedCachedScopes.indexOf(value.toString().toLowerCase()) >= 0; });\r\n };\r\n /**\r\n * Trims and converts string to lower case\r\n *\r\n * @param scopes\r\n */\r\n // TODO: Rename this, too generic name for a function that only deals with scopes\r\n ScopeSet.trimAndConvertToLowerCase = function (scope) {\r\n return scope.trim().toLowerCase();\r\n };\r\n /**\r\n * Performs trimAndConvertToLowerCase on string array\r\n * @param scopes\r\n */\r\n ScopeSet.trimAndConvertArrayToLowerCase = function (scopes) {\r\n var _this = this;\r\n return scopes.map(function (scope) { return _this.trimAndConvertToLowerCase(scope); });\r\n };\r\n /**\r\n * Trims each scope in scopes array\r\n * @param scopes\r\n */\r\n ScopeSet.trimScopes = function (scopes) {\r\n return scopes.map(function (scope) { return scope.trim(); });\r\n };\r\n /**\r\n * Remove one element from a scope array\r\n *\r\n * @param scopes\r\n * @param scope\r\n */\r\n // TODO: Rename this, too generic name for a function that only deals with scopes\r\n ScopeSet.removeElement = function (scopes, scope) {\r\n var scopeVal = this.trimAndConvertToLowerCase(scope);\r\n return scopes.filter(function (value) { return value !== scopeVal; });\r\n };\r\n /**\r\n * Parse the scopes into a formatted scopeList\r\n * @param scopes\r\n */\r\n ScopeSet.parseScope = function (scopes) {\r\n var scopeList = \"\";\r\n if (scopes) {\r\n for (var i = 0; i < scopes.length; ++i) {\r\n scopeList += (i !== scopes.length - 1) ? scopes[i] + \" \" : scopes[i];\r\n }\r\n }\r\n return scopeList;\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Used to validate the scopes input parameter requested by the developer.\r\n * @param {Array} scopes - 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 * @ignore\r\n */\r\n ScopeSet.validateInputScope = function (scopes, scopesRequired) {\r\n if (!scopes) {\r\n if (scopesRequired) {\r\n throw ClientConfigurationError.createScopesRequiredError(scopes);\r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n // Check that scopes is an array object (also throws error if scopes == null)\r\n if (!Array.isArray(scopes)) {\r\n throw ClientConfigurationError.createScopesNonArrayError(scopes);\r\n }\r\n // Check that scopes is not an empty array\r\n if (scopes.length < 1 && scopesRequired) {\r\n throw ClientConfigurationError.createEmptyScopesArrayError(scopes.toString());\r\n }\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Extracts scope value from the state sent with the authentication request.\r\n * @param {string} state\r\n * @returns {string} scope.\r\n * @ignore\r\n */\r\n ScopeSet.getScopeFromState = function (state) {\r\n if (state) {\r\n var splitIndex = state.indexOf(Constants.resourceDelimiter);\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return \"\";\r\n };\r\n /**\r\n * @ignore\r\n * Appends extraScopesToConsent if passed\r\n * @param {@link AuthenticationParameters}\r\n */\r\n ScopeSet.appendScopes = function (reqScopes, reqExtraScopesToConsent) {\r\n if (reqScopes) {\r\n var convertedExtraScopes = reqExtraScopesToConsent ? this.trimAndConvertArrayToLowerCase(reqExtraScopesToConsent.slice()) : null;\r\n var convertedReqScopes = this.trimAndConvertArrayToLowerCase(reqScopes.slice());\r\n return convertedExtraScopes ? convertedReqScopes.concat(convertedExtraScopes) : convertedReqScopes;\r\n }\r\n return null;\r\n };\r\n // #endregion\r\n /**\r\n * @ignore\r\n * Returns true if the scopes array only contains openid and/or profile\r\n */\r\n ScopeSet.onlyContainsOidcScopes = function (scopes) {\r\n var scopesCount = scopes.length;\r\n var oidcScopesFound = 0;\r\n if (scopes.indexOf(Constants.openidScope) > -1) {\r\n oidcScopesFound += 1;\r\n }\r\n if (scopes.indexOf(Constants.profileScope) > -1) {\r\n oidcScopesFound += 1;\r\n }\r\n return (scopesCount > 0 && scopesCount === oidcScopesFound);\r\n };\r\n /**\r\n * @ignore\r\n * Returns true if the scopes array only contains openid and/or profile\r\n */\r\n ScopeSet.containsAnyOidcScopes = function (scopes) {\r\n var containsOpenIdScope = scopes.indexOf(Constants.openidScope) > -1;\r\n var containsProfileScope = scopes.indexOf(Constants.profileScope) > -1;\r\n return (containsOpenIdScope || containsProfileScope);\r\n };\r\n /**\r\n * @ignore\r\n * Returns true if the clientId is the only scope in the array\r\n */\r\n ScopeSet.onlyContainsClientId = function (scopes, clientId) {\r\n // Double negation to force false value returned in case scopes is null\r\n return !!scopes && (scopes.indexOf(clientId) > -1 && scopes.length === 1);\r\n };\r\n /**\r\n * @ignore\r\n * Adds missing OIDC scopes to scopes array without duplication. Since STS requires OIDC scopes for\r\n * all implicit flow requests, 'openid' and 'profile' should always be included in the final request\r\n */\r\n ScopeSet.appendDefaultScopes = function (scopes) {\r\n var extendedScopes = scopes;\r\n if (extendedScopes.indexOf(Constants.openidScope) === -1) {\r\n extendedScopes.push(Constants.openidScope);\r\n }\r\n if (extendedScopes.indexOf(Constants.profileScope) === -1) {\r\n extendedScopes.push(Constants.profileScope);\r\n }\r\n return extendedScopes;\r\n };\r\n /**\r\n * @ignore\r\n * Removes present OIDC scopes from scopes array.\r\n */\r\n ScopeSet.removeDefaultScopes = function (scopes) {\r\n return scopes.filter(function (scope) {\r\n return (scope !== Constants.openidScope && scope !== Constants.profileScope);\r\n });\r\n };\r\n /**\r\n * @ignore\r\n * Removes clientId from scopes array if included as only scope. If it's not the only scope, it is treated as a resource scope.\r\n * @param scopes Array: Pre-normalized scopes array\r\n * @param clientId string: The application's clientId that is searched for in the scopes array\r\n */\r\n ScopeSet.translateClientIdIfSingleScope = function (scopes, clientId) {\r\n return this.onlyContainsClientId(scopes, clientId) ? Constants.oidcScopes : scopes;\r\n };\r\n return ScopeSet;\r\n}());\r\nexport { ScopeSet };\r\n//# sourceMappingURL=ScopeSet.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { Constants, SSOTypes, ServerHashParamKeys } from \"./Constants\";\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar UrlUtils = /** @class */ (function () {\r\n function UrlUtils() {\r\n }\r\n /**\r\n * generates the URL with QueryString Parameters\r\n * @param scopes\r\n */\r\n UrlUtils.createNavigateUrl = function (serverRequestParams) {\r\n var str = this.createNavigationUrlString(serverRequestParams);\r\n var authEndpoint = serverRequestParams.authorityInstance.AuthorizationEndpoint;\r\n // if the endpoint already has queryparams, lets add to it, otherwise add the first one\r\n if (authEndpoint.indexOf(\"?\") < 0) {\r\n authEndpoint += \"?\";\r\n }\r\n else {\r\n authEndpoint += \"&\";\r\n }\r\n var requestUrl = \"\" + authEndpoint + str.join(\"&\");\r\n return requestUrl;\r\n };\r\n /**\r\n * Generate the array of all QueryStringParams to be sent to the server\r\n * @param scopes\r\n */\r\n UrlUtils.createNavigationUrlString = function (serverRequestParams) {\r\n var scopes = ScopeSet.appendDefaultScopes(serverRequestParams.scopes);\r\n var str = [];\r\n str.push(\"response_type=\" + serverRequestParams.responseType);\r\n str.push(\"scope=\" + encodeURIComponent(ScopeSet.parseScope(scopes)));\r\n str.push(\"client_id=\" + encodeURIComponent(serverRequestParams.clientId));\r\n str.push(\"redirect_uri=\" + encodeURIComponent(serverRequestParams.redirectUri));\r\n str.push(\"state=\" + encodeURIComponent(serverRequestParams.state));\r\n str.push(\"nonce=\" + encodeURIComponent(serverRequestParams.nonce));\r\n str.push(\"client_info=1\");\r\n str.push(\"x-client-SKU=\" + serverRequestParams.xClientSku);\r\n str.push(\"x-client-Ver=\" + serverRequestParams.xClientVer);\r\n if (serverRequestParams.promptValue) {\r\n str.push(\"prompt=\" + encodeURIComponent(serverRequestParams.promptValue));\r\n }\r\n if (serverRequestParams.claimsValue) {\r\n str.push(\"claims=\" + encodeURIComponent(serverRequestParams.claimsValue));\r\n }\r\n if (serverRequestParams.queryParameters) {\r\n str.push(serverRequestParams.queryParameters);\r\n }\r\n if (serverRequestParams.extraQueryParameters) {\r\n str.push(serverRequestParams.extraQueryParameters);\r\n }\r\n str.push(\"client-request-id=\" + encodeURIComponent(serverRequestParams.correlationId));\r\n return str;\r\n };\r\n /**\r\n * Returns current window URL as redirect uri\r\n */\r\n UrlUtils.getCurrentUrl = function () {\r\n return window.location.href.split(\"?\")[0].split(\"#\")[0];\r\n };\r\n /**\r\n * Returns given URL with query string removed\r\n */\r\n UrlUtils.removeHashFromUrl = function (url) {\r\n return 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 UrlUtils.replaceTenantPath = function (url, tenantId) {\r\n var lowerCaseUrl = url.toLowerCase();\r\n var urlObject = this.GetUrlComponents(lowerCaseUrl);\r\n var pathArray = urlObject.PathSegments;\r\n if (tenantId && (pathArray.length !== 0 && (pathArray[0] === Constants.common || pathArray[0] === SSOTypes.ORGANIZATIONS))) {\r\n pathArray[0] = tenantId;\r\n }\r\n return this.constructAuthorityUriFromObject(urlObject, pathArray);\r\n };\r\n UrlUtils.constructAuthorityUriFromObject = function (urlObject, pathArray) {\r\n return this.CanonicalizeUri(urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + pathArray.join(\"/\"));\r\n };\r\n /**\r\n * Checks if an authority is common (ex. https://a:b/common/)\r\n * @param url The url\r\n * @returns true if authority is common and false otherwise\r\n */\r\n UrlUtils.isCommonAuthority = function (url) {\r\n var authority = this.CanonicalizeUri(url);\r\n var pathArray = this.GetUrlComponents(authority).PathSegments;\r\n return (pathArray.length !== 0 && pathArray[0] === Constants.common);\r\n };\r\n /**\r\n * Checks if an authority is for organizations (ex. https://a:b/organizations/)\r\n * @param url The url\r\n * @returns true if authority is for and false otherwise\r\n */\r\n UrlUtils.isOrganizationsAuthority = function (url) {\r\n var authority = this.CanonicalizeUri(url);\r\n var pathArray = this.GetUrlComponents(authority).PathSegments;\r\n return (pathArray.length !== 0 && pathArray[0] === SSOTypes.ORGANIZATIONS);\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 UrlUtils.GetUrlComponents = function (url) {\r\n if (!url) {\r\n throw \"Url required\";\r\n }\r\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\r\n var regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\r\n var match = url.match(regEx);\r\n if (!match || match.length < 6) {\r\n throw \"Valid url required\";\r\n }\r\n var urlComponents = {\r\n Protocol: match[1],\r\n HostNameAndPort: match[4],\r\n AbsolutePath: match[5]\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 (match[6]) {\r\n urlComponents.Search = match[6];\r\n }\r\n if (match[8]) {\r\n urlComponents.Hash = match[8];\r\n }\r\n return urlComponents;\r\n };\r\n /**\r\n * Given a url or path, append a trailing slash if one doesnt exist\r\n *\r\n * @param url\r\n */\r\n UrlUtils.CanonicalizeUri = function (url) {\r\n if (url) {\r\n url = url.toLowerCase();\r\n }\r\n if (url && !UrlUtils.endsWith(url, \"/\")) {\r\n url += \"/\";\r\n }\r\n return url;\r\n };\r\n /**\r\n * Checks to see if the url ends with the suffix\r\n * Required because we are compiling for es5 instead of es6\r\n * @param url\r\n * @param str\r\n */\r\n // TODO: Rename this, not clear what it is supposed to do\r\n UrlUtils.endsWith = function (url, suffix) {\r\n if (!url || !suffix) {\r\n return false;\r\n }\r\n return url.indexOf(suffix, url.length - suffix.length) !== -1;\r\n };\r\n /**\r\n * Utils function to remove the login_hint and domain_hint from the i/p extraQueryParameters\r\n * @param url\r\n * @param name\r\n */\r\n UrlUtils.urlRemoveQueryStringParameter = function (url, name) {\r\n if (StringUtils.isEmpty(url)) {\r\n return url;\r\n }\r\n var regex = new RegExp(\"(\\\\&\" + name + \"=)[^\\&]+\");\r\n url = url.replace(regex, \"\");\r\n // name=value&\r\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+&\");\r\n url = url.replace(regex, \"\");\r\n // name=value\r\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+\");\r\n url = url.replace(regex, \"\");\r\n return url;\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Returns the anchor part(#) of the URL\r\n */\r\n UrlUtils.getHashFromUrl = function (urlStringOrFragment) {\r\n var hashIndex1 = urlStringOrFragment.indexOf(\"#\");\r\n var hashIndex2 = urlStringOrFragment.indexOf(\"#/\");\r\n if (hashIndex2 > -1) {\r\n return urlStringOrFragment.substring(hashIndex2 + 2);\r\n }\r\n else if (hashIndex1 > -1) {\r\n return urlStringOrFragment.substring(hashIndex1 + 1);\r\n }\r\n return urlStringOrFragment;\r\n };\r\n /**\r\n * @hidden\r\n * Check if the url contains a hash with known properties\r\n * @ignore\r\n */\r\n UrlUtils.urlContainsHash = function (urlString) {\r\n var parameters = UrlUtils.deserializeHash(urlString);\r\n return (parameters.hasOwnProperty(ServerHashParamKeys.ERROR_DESCRIPTION) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ERROR) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ACCESS_TOKEN) ||\r\n parameters.hasOwnProperty(ServerHashParamKeys.ID_TOKEN));\r\n };\r\n /**\r\n * @hidden\r\n * Returns deserialized portion of URL hash\r\n * @ignore\r\n */\r\n UrlUtils.deserializeHash = function (urlFragment) {\r\n var hash = UrlUtils.getHashFromUrl(urlFragment);\r\n return CryptoUtils.deserialize(hash);\r\n };\r\n /**\r\n * @ignore\r\n * @param {string} URI\r\n * @returns {string} host from the URI\r\n *\r\n * extract URI from the host\r\n */\r\n UrlUtils.getHostFromUri = function (uri) {\r\n // remove http:// or https:// from uri\r\n var extractedUri = String(uri).replace(/^(https?:)\\/\\//, \"\");\r\n extractedUri = extractedUri.split(\"/\")[0];\r\n return extractedUri;\r\n };\r\n return UrlUtils;\r\n}());\r\nexport { UrlUtils };\r\n//# sourceMappingURL=UrlUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar AccessTokenKey = /** @class */ (function () {\r\n function AccessTokenKey(authority, clientId, scopes, uid, utid) {\r\n this.authority = UrlUtils.CanonicalizeUri(authority);\r\n this.clientId = clientId;\r\n this.scopes = scopes;\r\n this.homeAccountIdentifier = CryptoUtils.base64Encode(uid) + \".\" + CryptoUtils.base64Encode(utid);\r\n }\r\n return AccessTokenKey;\r\n}());\r\nexport { AccessTokenKey };\r\n//# sourceMappingURL=AccessTokenKey.js.map","/*\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 AccessTokenValue = /** @class */ (function () {\r\n function AccessTokenValue(accessToken, idToken, expiresIn, homeAccountIdentifier) {\r\n this.accessToken = accessToken;\r\n this.idToken = idToken;\r\n this.expiresIn = expiresIn;\r\n this.homeAccountIdentifier = homeAccountIdentifier;\r\n }\r\n return AccessTokenValue;\r\n}());\r\nexport { AccessTokenValue };\r\n//# sourceMappingURL=AccessTokenValue.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { SSOTypes, Constants, PromptState, ResponseTypes } from \"./utils/Constants\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { name as libraryVersion } from \"./packageMetadata\";\r\n/**\r\n * Nonce: OIDC Nonce definition: https://openid.net/specs/openid-connect-core-1_0.html#IDToken\r\n * State: OAuth Spec: https://tools.ietf.org/html/rfc6749#section-10.12\r\n * @hidden\r\n */\r\nvar ServerRequestParameters = /** @class */ (function () {\r\n /**\r\n * Constructor\r\n * @param authority\r\n * @param clientId\r\n * @param scope\r\n * @param responseType\r\n * @param redirectUri\r\n * @param state\r\n */\r\n function ServerRequestParameters(authority, clientId, responseType, redirectUri, scopes, state, correlationId) {\r\n this.authorityInstance = authority;\r\n this.clientId = clientId;\r\n this.nonce = CryptoUtils.createNewGuid();\r\n // set scope to clientId if null\r\n this.scopes = scopes ? scopes.slice() : Constants.oidcScopes;\r\n this.scopes = ScopeSet.trimScopes(this.scopes);\r\n // set state (already set at top level)\r\n this.state = state;\r\n // set correlationId\r\n this.correlationId = correlationId;\r\n // telemetry information\r\n this.xClientSku = \"MSAL.JS\";\r\n this.xClientVer = libraryVersion;\r\n this.responseType = responseType;\r\n this.redirectUri = redirectUri;\r\n }\r\n Object.defineProperty(ServerRequestParameters.prototype, \"authority\", {\r\n get: function () {\r\n return this.authorityInstance ? this.authorityInstance.CanonicalAuthority : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Utility to populate QueryParameters and ExtraQueryParameters to ServerRequestParamerers\r\n * @param request\r\n * @param serverAuthenticationRequest\r\n */\r\n ServerRequestParameters.prototype.populateQueryParams = function (account, request, adalIdTokenObject, silentCall) {\r\n var queryParameters = {};\r\n if (request) {\r\n // add the prompt parameter to serverRequestParameters if passed\r\n if (request.prompt) {\r\n this.promptValue = request.prompt;\r\n }\r\n // Add claims challenge to serverRequestParameters if passed\r\n if (request.claimsRequest) {\r\n this.claimsValue = request.claimsRequest;\r\n }\r\n // if the developer provides one of these, give preference to developer choice\r\n if (ServerRequestParameters.isSSOParam(request)) {\r\n queryParameters = this.constructUnifiedCacheQueryParameter(request, null);\r\n }\r\n }\r\n if (adalIdTokenObject) {\r\n queryParameters = this.constructUnifiedCacheQueryParameter(null, adalIdTokenObject);\r\n }\r\n /*\r\n * adds sid/login_hint if not populated\r\n * this.logger.verbose(\"Calling addHint parameters\");\r\n */\r\n queryParameters = this.addHintParameters(account, queryParameters);\r\n // sanity check for developer passed extraQueryParameters\r\n var eQParams = request ? request.extraQueryParameters : null;\r\n // Populate the extraQueryParameters to be sent to the server\r\n this.queryParameters = ServerRequestParameters.generateQueryParametersString(queryParameters);\r\n this.extraQueryParameters = ServerRequestParameters.generateQueryParametersString(eQParams, silentCall);\r\n };\r\n // #region QueryParam helpers\r\n /**\r\n * Constructs extraQueryParameters to be sent to the server for the AuthenticationParameters set by the developer\r\n * in any login() or acquireToken() calls\r\n * @param idTokenObject\r\n * @param extraQueryParameters\r\n * @param sid\r\n * @param loginHint\r\n */\r\n // TODO: check how this behaves when domain_hint only is sent in extraparameters and idToken has no upn.\r\n ServerRequestParameters.prototype.constructUnifiedCacheQueryParameter = function (request, idTokenObject) {\r\n // preference order: account > sid > login_hint\r\n var ssoType;\r\n var ssoData;\r\n var serverReqParam = {};\r\n // if account info is passed, account.sid > account.login_hint\r\n if (request) {\r\n if (request.account) {\r\n var account = request.account;\r\n if (account.sid) {\r\n ssoType = SSOTypes.SID;\r\n ssoData = account.sid;\r\n }\r\n else if (account.userName) {\r\n ssoType = SSOTypes.LOGIN_HINT;\r\n ssoData = account.userName;\r\n }\r\n }\r\n // sid from request\r\n else if (request.sid) {\r\n ssoType = SSOTypes.SID;\r\n ssoData = request.sid;\r\n }\r\n // loginHint from request\r\n else if (request.loginHint) {\r\n ssoType = SSOTypes.LOGIN_HINT;\r\n ssoData = request.loginHint;\r\n }\r\n }\r\n // adalIdToken retrieved from cache\r\n else if (idTokenObject) {\r\n if (idTokenObject.hasOwnProperty(Constants.upn)) {\r\n ssoType = SSOTypes.ID_TOKEN;\r\n ssoData = idTokenObject.upn;\r\n }\r\n }\r\n serverReqParam = this.addSSOParameter(ssoType, ssoData);\r\n return serverReqParam;\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Adds login_hint to authorization URL which is used to pre-fill the username field of sign in page for the user if known ahead of time\r\n * domain_hint if added skips the email based discovery process of the user - only supported for interactive calls in implicit_flow\r\n * domain_req utid received as part of the clientInfo\r\n * login_req uid received as part of clientInfo\r\n * Also does a sanity check for extraQueryParameters passed by the user to ensure no repeat queryParameters\r\n *\r\n * @param {@link Account} account - Account for which the token is requested\r\n * @param queryparams\r\n * @param {@link ServerRequestParameters}\r\n * @ignore\r\n */\r\n ServerRequestParameters.prototype.addHintParameters = function (account, qParams) {\r\n /*\r\n * This is a final check for all queryParams added so far; preference order: sid > login_hint\r\n * sid cannot be passed along with login_hint or domain_hint, hence we check both are not populated yet in queryParameters\r\n */\r\n if (account && !qParams[SSOTypes.SID]) {\r\n // sid - populate only if login_hint is not already populated and the account has sid\r\n var populateSID = !qParams[SSOTypes.LOGIN_HINT] && account.sid && this.promptValue === PromptState.NONE;\r\n if (populateSID) {\r\n qParams = this.addSSOParameter(SSOTypes.SID, account.sid, qParams);\r\n }\r\n // login_hint - account.userName\r\n else {\r\n var populateLoginHint = !qParams[SSOTypes.LOGIN_HINT] && account.userName && !StringUtils.isEmpty(account.userName);\r\n if (populateLoginHint) {\r\n qParams = this.addSSOParameter(SSOTypes.LOGIN_HINT, account.userName, qParams);\r\n }\r\n }\r\n }\r\n return qParams;\r\n };\r\n /**\r\n * Add SID to extraQueryParameters\r\n * @param sid\r\n */\r\n ServerRequestParameters.prototype.addSSOParameter = function (ssoType, ssoData, ssoParam) {\r\n if (!ssoParam) {\r\n ssoParam = {};\r\n }\r\n if (!ssoData) {\r\n return ssoParam;\r\n }\r\n switch (ssoType) {\r\n case SSOTypes.SID: {\r\n ssoParam[SSOTypes.SID] = ssoData;\r\n break;\r\n }\r\n case SSOTypes.ID_TOKEN: {\r\n ssoParam[SSOTypes.LOGIN_HINT] = ssoData;\r\n break;\r\n }\r\n case SSOTypes.LOGIN_HINT: {\r\n ssoParam[SSOTypes.LOGIN_HINT] = ssoData;\r\n break;\r\n }\r\n }\r\n return ssoParam;\r\n };\r\n /**\r\n * Utility to generate a QueryParameterString from a Key-Value mapping of extraQueryParameters passed\r\n * @param extraQueryParameters\r\n */\r\n ServerRequestParameters.generateQueryParametersString = function (queryParameters, silentCall) {\r\n var paramsString = null;\r\n if (queryParameters) {\r\n Object.keys(queryParameters).forEach(function (key) {\r\n // sid cannot be passed along with login_hint or domain_hint\r\n if (key === Constants.domain_hint && (silentCall || queryParameters[SSOTypes.SID])) {\r\n return;\r\n }\r\n if (!paramsString) {\r\n paramsString = key + \"=\" + encodeURIComponent(queryParameters[key]);\r\n }\r\n else {\r\n paramsString += \"&\" + key + \"=\" + encodeURIComponent(queryParameters[key]);\r\n }\r\n });\r\n }\r\n return paramsString;\r\n };\r\n // #endregion\r\n /**\r\n * Check to see if there are SSO params set in the Request\r\n * @param request\r\n */\r\n ServerRequestParameters.isSSOParam = function (request) {\r\n return request && (request.account || request.sid || request.loginHint);\r\n };\r\n /**\r\n * Returns the correct response_type string attribute for an acquireToken request configuration\r\n * @param accountsMatch boolean: Determines whether the account in the request matches the cached account\r\n * @param scopes Array: AuthenticationRequest scopes configuration\r\n * @param loginScopesOnly boolean: True if the scopes array ONLY contains the clientId or any combination of OIDC scopes, without resource scopes\r\n */\r\n ServerRequestParameters.determineResponseType = function (accountsMatch, scopes) {\r\n // Supports getting an id_token by sending in clientId as only scope or OIDC scopes as only scopes\r\n if (ScopeSet.onlyContainsOidcScopes(scopes)) {\r\n return ResponseTypes.id_token;\r\n }\r\n // If accounts match, check if OIDC scopes are included, otherwise return id_token_token\r\n return (accountsMatch) ? this.responseTypeForMatchingAccounts(scopes) : ResponseTypes.id_token_token;\r\n };\r\n /**\r\n * Returns the correct response_type string attribute for an acquireToken request configuration that contains an\r\n * account that matches the account in the MSAL cache.\r\n * @param scopes Array: AuthenticationRequest scopes configuration\r\n */\r\n ServerRequestParameters.responseTypeForMatchingAccounts = function (scopes) {\r\n // Opt-into also requesting an ID token by sending in 'openid', 'profile' or both along with resource scopes when login is not necessary.\r\n return (ScopeSet.containsAnyOidcScopes(scopes)) ? ResponseTypes.id_token_token : ResponseTypes.token;\r\n };\r\n return ServerRequestParameters;\r\n}());\r\nexport { ServerRequestParameters };\r\n//# sourceMappingURL=ServerRequestParameters.js.map","/* eslint-disable header/header */\r\nexport var name = \"msal\";\r\nexport var version = \"1.4.6\";\r\n//# sourceMappingURL=packageMetadata.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { NetworkRequestType } from \"./utils/Constants\";\r\n/**\r\n * XHR client for JSON endpoints\r\n * https://www.npmjs.com/package/async-promise\r\n * @hidden\r\n */\r\nvar XhrClient = /** @class */ (function () {\r\n function XhrClient() {\r\n }\r\n XhrClient.prototype.sendRequestAsync = function (url, method, enableCaching) {\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 if (enableCaching) {\r\n /*\r\n * TODO: (shivb) ensure that this can be cached\r\n * xhr.setRequestHeader(\"Cache-Control\", \"Public\");\r\n */\r\n }\r\n xhr.onload = function () {\r\n if (xhr.status < 200 || xhr.status >= 300) {\r\n reject(_this.handleError(xhr.responseText));\r\n }\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(xhr.responseText);\r\n }\r\n catch (e) {\r\n reject(_this.handleError(xhr.responseText));\r\n }\r\n var response = {\r\n statusCode: xhr.status,\r\n body: jsonResponse\r\n };\r\n resolve(response);\r\n };\r\n xhr.onerror = function () {\r\n reject(xhr.status);\r\n };\r\n if (method === NetworkRequestType.GET) {\r\n xhr.send();\r\n }\r\n else {\r\n throw \"not implemented\";\r\n }\r\n });\r\n };\r\n XhrClient.prototype.handleError = function (responseText) {\r\n var jsonResponse;\r\n try {\r\n jsonResponse = JSON.parse(responseText);\r\n if (jsonResponse.error) {\r\n return jsonResponse.error;\r\n }\r\n else {\r\n throw responseText;\r\n }\r\n }\r\n catch (e) {\r\n return responseText;\r\n }\r\n };\r\n return XhrClient;\r\n}());\r\nexport { XhrClient };\r\n//# sourceMappingURL=XHRClient.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { XhrClient } from \"../XHRClient\";\r\nimport { AAD_INSTANCE_DISCOVERY_ENDPOINT, NetworkRequestType } from \"../utils/Constants\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\nvar TrustedAuthority = /** @class */ (function () {\r\n function TrustedAuthority() {\r\n }\r\n /**\r\n *\r\n * @param validateAuthority\r\n * @param knownAuthorities\r\n */\r\n TrustedAuthority.setTrustedAuthoritiesFromConfig = function (validateAuthority, knownAuthorities) {\r\n if (validateAuthority && !this.getTrustedHostList().length) {\r\n knownAuthorities.forEach(function (authority) {\r\n TrustedAuthority.TrustedHostList.push(authority.toLowerCase());\r\n });\r\n }\r\n };\r\n /**\r\n *\r\n * @param telemetryManager\r\n * @param correlationId\r\n */\r\n TrustedAuthority.getAliases = function (authorityToVerify, telemetryManager, correlationId) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var client, httpMethod, instanceDiscoveryEndpoint, httpEvent;\r\n return tslib_1.__generator(this, function (_a) {\r\n client = new XhrClient();\r\n httpMethod = NetworkRequestType.GET;\r\n instanceDiscoveryEndpoint = \"\" + AAD_INSTANCE_DISCOVERY_ENDPOINT + authorityToVerify + \"oauth2/v2.0/authorize\";\r\n httpEvent = telemetryManager.createAndStartHttpEvent(correlationId, httpMethod, instanceDiscoveryEndpoint, \"getAliases\");\r\n return [2 /*return*/, client.sendRequestAsync(instanceDiscoveryEndpoint, httpMethod, true)\r\n .then(function (response) {\r\n httpEvent.httpResponseStatus = response.statusCode;\r\n telemetryManager.stopEvent(httpEvent);\r\n return response.body.metadata;\r\n })\r\n .catch(function (err) {\r\n httpEvent.serverErrorCode = err;\r\n telemetryManager.stopEvent(httpEvent);\r\n throw err;\r\n })];\r\n });\r\n });\r\n };\r\n /**\r\n *\r\n * @param telemetryManager\r\n * @param correlationId\r\n */\r\n TrustedAuthority.setTrustedAuthoritiesFromNetwork = function (authorityToVerify, telemetryManager, correlationId) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var metadata, host;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, this.getAliases(authorityToVerify, telemetryManager, correlationId)];\r\n case 1:\r\n metadata = _a.sent();\r\n metadata.forEach(function (entry) {\r\n var authorities = entry.aliases;\r\n authorities.forEach(function (authority) {\r\n TrustedAuthority.TrustedHostList.push(authority.toLowerCase());\r\n });\r\n });\r\n host = UrlUtils.GetUrlComponents(authorityToVerify).HostNameAndPort;\r\n if (TrustedAuthority.getTrustedHostList().length && !TrustedAuthority.IsInTrustedHostList(host)) {\r\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\r\n TrustedAuthority.TrustedHostList.push(host.toLowerCase());\r\n }\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n TrustedAuthority.getTrustedHostList = function () {\r\n return this.TrustedHostList;\r\n };\r\n /**\r\n * Checks to see if the host is in a list of trusted hosts\r\n * @param host\r\n */\r\n TrustedAuthority.IsInTrustedHostList = function (host) {\r\n return this.TrustedHostList.indexOf(host.toLowerCase()) > -1;\r\n };\r\n TrustedAuthority.TrustedHostList = [];\r\n return TrustedAuthority;\r\n}());\r\nexport { TrustedAuthority };\r\n//# sourceMappingURL=TrustedAuthority.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { version as libraryVersion } from \"./packageMetadata\";\r\nexport var 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 = {}));\r\nvar Logger = /** @class */ (function () {\r\n function Logger(localCallback, options) {\r\n if (options === void 0) { options = {}; }\r\n /**\r\n * @hidden\r\n */\r\n this.level = LogLevel.Info;\r\n var _a = options.correlationId, correlationId = _a === void 0 ? \"\" : _a, _b = options.level, level = _b === void 0 ? LogLevel.Info : _b, _c = options.piiLoggingEnabled, piiLoggingEnabled = _c === void 0 ? false : _c;\r\n this.localCallback = localCallback;\r\n this.correlationId = correlationId;\r\n this.level = level;\r\n this.piiLoggingEnabled = piiLoggingEnabled;\r\n }\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.logMessage = function (logLevel, logMessage, containsPii) {\r\n if ((logLevel > this.level) || (!this.piiLoggingEnabled && containsPii)) {\r\n return;\r\n }\r\n var timestamp = new Date().toUTCString();\r\n var log;\r\n if (!StringUtils.isEmpty(this.correlationId)) {\r\n log = timestamp + \":\" + this.correlationId + \"-\" + libraryVersion + \"-\" + LogLevel[logLevel] + (containsPii ? \"-pii\" : \"\") + \" \" + logMessage;\r\n }\r\n else {\r\n log = timestamp + \":\" + libraryVersion + \"-\" + LogLevel[logLevel] + (containsPii ? \"-pii\" : \"\") + \" \" + logMessage;\r\n }\r\n this.executeCallback(logLevel, log, containsPii);\r\n };\r\n /**\r\n * @hidden\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 * @hidden\r\n */\r\n Logger.prototype.error = function (message) {\r\n this.logMessage(LogLevel.Error, message, false);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.errorPii = function (message) {\r\n this.logMessage(LogLevel.Error, message, true);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.warning = function (message) {\r\n this.logMessage(LogLevel.Warning, message, false);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.warningPii = function (message) {\r\n this.logMessage(LogLevel.Warning, message, true);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.info = function (message) {\r\n this.logMessage(LogLevel.Info, message, false);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.infoPii = function (message) {\r\n this.logMessage(LogLevel.Info, message, true);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.verbose = function (message) {\r\n this.logMessage(LogLevel.Verbose, message, false);\r\n };\r\n /**\r\n * @hidden\r\n */\r\n Logger.prototype.verbosePii = function (message) {\r\n this.logMessage(LogLevel.Verbose, message, true);\r\n };\r\n Logger.prototype.isPiiLoggingEnabled = function () {\r\n return this.piiLoggingEnabled;\r\n };\r\n return Logger;\r\n}());\r\nexport { Logger };\r\n//# sourceMappingURL=Logger.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { ClientAuthError } from \"./error/ClientAuthError\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar ClientInfo = /** @class */ (function () {\r\n function ClientInfo(rawClientInfo, authority) {\r\n if (!rawClientInfo || StringUtils.isEmpty(rawClientInfo)) {\r\n this.uid = \"\";\r\n this.utid = \"\";\r\n return;\r\n }\r\n try {\r\n var decodedClientInfo = CryptoUtils.base64Decode(rawClientInfo);\r\n var clientInfo = JSON.parse(decodedClientInfo);\r\n if (clientInfo) {\r\n if (clientInfo.hasOwnProperty(\"uid\")) {\r\n this.uid = authority ? ClientInfo.stripPolicyFromUid(clientInfo.uid, authority) : clientInfo.uid;\r\n }\r\n if (clientInfo.hasOwnProperty(\"utid\")) {\r\n this.utid = clientInfo.utid;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createClientInfoDecodingError(e);\r\n }\r\n }\r\n Object.defineProperty(ClientInfo.prototype, \"uid\", {\r\n get: function () {\r\n return this._uid ? this._uid : \"\";\r\n },\r\n set: function (uid) {\r\n this._uid = uid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ClientInfo.prototype, \"utid\", {\r\n get: function () {\r\n return this._utid ? this._utid : \"\";\r\n },\r\n set: function (utid) {\r\n this._utid = utid;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ClientInfo.createClientInfoFromIdToken = function (idToken, authority) {\r\n var clientInfo = {\r\n uid: idToken.subject,\r\n utid: \"\"\r\n };\r\n return new ClientInfo(CryptoUtils.base64Encode(JSON.stringify(clientInfo)), authority);\r\n };\r\n ClientInfo.stripPolicyFromUid = function (uid, authority) {\r\n var uidSegments = uid.split(\"-\");\r\n // Reverse the url segments so the last one is more easily accessible\r\n var urlSegments = authority.split(\"/\").reverse();\r\n var policy = \"\";\r\n if (!StringUtils.isEmpty(urlSegments[0])) {\r\n policy = urlSegments[0];\r\n }\r\n else if (urlSegments.length > 1) {\r\n // If the original url had a trailing slash, urlSegments[0] would be \"\" so take the next element\r\n policy = urlSegments[1];\r\n }\r\n if (uidSegments[uidSegments.length - 1] === policy) {\r\n // If the last segment of uid matches the last segment of authority url, remove the last segment of uid\r\n return uidSegments.slice(0, uidSegments.length - 1).join(\"-\");\r\n }\r\n return uid;\r\n };\r\n ClientInfo.prototype.encodeClientInfo = function () {\r\n var clientInfo = JSON.stringify({ uid: this.uid, utid: this.utid });\r\n return CryptoUtils.base64Encode(clientInfo);\r\n };\r\n return ClientInfo;\r\n}());\r\nexport { ClientInfo };\r\n//# sourceMappingURL=ClientInfo.js.map","/*\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 TimeUtils = /** @class */ (function () {\r\n function TimeUtils() {\r\n }\r\n /**\r\n * Returns time in seconds for expiration based on string value passed in.\r\n *\r\n * @param expiresIn\r\n */\r\n TimeUtils.parseExpiresIn = function (expiresIn) {\r\n // if AAD did not send \"expires_in\" property, use default expiration of 3599 seconds, for some reason AAD sends 3599 as \"expires_in\" value instead of 3600\r\n if (!expiresIn) {\r\n expiresIn = \"3599\";\r\n }\r\n return parseInt(expiresIn, 10);\r\n };\r\n /**\r\n * Return the current time in Unix time (seconds). Date.getTime() returns in milliseconds.\r\n */\r\n TimeUtils.now = function () {\r\n return Math.round(new Date().getTime() / 1000.0);\r\n };\r\n /**\r\n * Returns the amount of time in milliseconds since the page loaded.\r\n */\r\n TimeUtils.relativeNowMs = function () {\r\n return window.performance.now();\r\n };\r\n return TimeUtils;\r\n}());\r\nexport { TimeUtils };\r\n//# sourceMappingURL=TimeUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar TokenUtils = /** @class */ (function () {\r\n function TokenUtils() {\r\n }\r\n /**\r\n * decode a JWT\r\n *\r\n * @param jwtToken\r\n */\r\n TokenUtils.decodeJwt = function (jwtToken) {\r\n if (StringUtils.isEmpty(jwtToken)) {\r\n return null;\r\n }\r\n var idTokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n var matches = idTokenPartsRegex.exec(jwtToken);\r\n if (!matches || matches.length < 4) {\r\n // this._requestContext.logger.warn(\"The returned id_token is not parseable.\");\r\n return null;\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 * Evaluates whether token cache item expiration is within expiration offset range\r\n * @param tokenCacheItem\r\n */\r\n TokenUtils.validateExpirationIsWithinOffset = function (expiration, tokenRenewalOffsetSeconds) {\r\n var offset = tokenRenewalOffsetSeconds || 300;\r\n return expiration && (expiration > TimeUtils.now() + offset);\r\n };\r\n /**\r\n * Extract IdToken by decoding the RAWIdToken\r\n *\r\n * @param encodedIdToken\r\n */\r\n TokenUtils.extractIdToken = function (encodedIdToken) {\r\n // id token will be decoded to get the username\r\n var decodedToken = this.decodeJwt(encodedIdToken);\r\n if (!decodedToken) {\r\n return null;\r\n }\r\n try {\r\n var base64IdToken = decodedToken.JWSPayload;\r\n var base64Decoded = CryptoUtils.base64Decode(base64IdToken);\r\n if (!base64Decoded) {\r\n // this._requestContext.logger.info(\"The returned id_token could not be base64 url safe decoded.\");\r\n return null;\r\n }\r\n // ECMA script has JSON built-in support\r\n return JSON.parse(base64Decoded);\r\n }\r\n catch (err) {\r\n // this._requestContext.logger.error(\"The returned id_token could not be decoded\" + err);\r\n }\r\n return null;\r\n };\r\n return TokenUtils;\r\n}());\r\nexport { TokenUtils };\r\n//# sourceMappingURL=TokenUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { ClientAuthError } from \"./error/ClientAuthError\";\r\nimport { TokenUtils } from \"./utils/TokenUtils\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar IdToken = /** @class */ (function () {\r\n /* tslint:disable:no-string-literal */\r\n function IdToken(rawIdToken) {\r\n if (StringUtils.isEmpty(rawIdToken)) {\r\n throw ClientAuthError.createIdTokenNullOrEmptyError(rawIdToken);\r\n }\r\n try {\r\n this.rawIdToken = rawIdToken;\r\n this.claims = TokenUtils.extractIdToken(rawIdToken);\r\n if (this.claims) {\r\n if (this.claims.hasOwnProperty(\"iss\")) {\r\n this.issuer = this.claims[\"iss\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"oid\")) {\r\n this.objectId = this.claims[\"oid\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"sub\")) {\r\n this.subject = this.claims[\"sub\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"tid\")) {\r\n this.tenantId = this.claims[\"tid\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"ver\")) {\r\n this.version = this.claims[\"ver\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"preferred_username\")) {\r\n this.preferredName = this.claims[\"preferred_username\"];\r\n }\r\n else if (this.claims.hasOwnProperty(\"upn\")) {\r\n this.preferredName = this.claims[\"upn\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"name\")) {\r\n this.name = this.claims[\"name\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"nonce\")) {\r\n this.nonce = this.claims[\"nonce\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"exp\")) {\r\n this.expiration = this.claims[\"exp\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"home_oid\")) {\r\n this.homeObjectId = this.claims[\"home_oid\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"sid\")) {\r\n this.sid = this.claims[\"sid\"];\r\n }\r\n if (this.claims.hasOwnProperty(\"cloud_instance_host_name\")) {\r\n this.cloudInstance = this.claims[\"cloud_instance_host_name\"];\r\n }\r\n /* tslint:enable:no-string-literal */\r\n }\r\n }\r\n catch (e) {\r\n /*\r\n * TODO: This error here won't really every be thrown, since extractIdToken() returns null if the decodeJwt() fails.\r\n * Need to add better error handling here to account for being unable to decode jwts.\r\n */\r\n throw ClientAuthError.createIdTokenParsingError(e);\r\n }\r\n }\r\n return IdToken;\r\n}());\r\nexport { IdToken };\r\n//# sourceMappingURL=IdToken.js.map","/*\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 AccessTokenCacheItem = /** @class */ (function () {\r\n function AccessTokenCacheItem(key, value) {\r\n this.key = key;\r\n this.value = value;\r\n }\r\n return AccessTokenCacheItem;\r\n}());\r\nexport { AccessTokenCacheItem };\r\n//# sourceMappingURL=AccessTokenCacheItem.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { AuthError } from \"../error/AuthError\";\r\n/**\r\n * @hidden\r\n */\r\nvar BrowserStorage = /** @class */ (function () {\r\n function BrowserStorage(cacheLocation) {\r\n if (!window) {\r\n throw AuthError.createNoWindowObjectError(\"Browser storage class could not find window object\");\r\n }\r\n var storageSupported = typeof window[cacheLocation] !== \"undefined\" && window[cacheLocation] !== null;\r\n if (!storageSupported) {\r\n throw ClientConfigurationError.createStorageNotSupportedError(cacheLocation);\r\n }\r\n this.cacheLocation = cacheLocation;\r\n }\r\n /**\r\n * add value to storage\r\n * @param key\r\n * @param value\r\n * @param enableCookieStorage\r\n */\r\n BrowserStorage.prototype.setItem = function (key, value, enableCookieStorage) {\r\n window[this.cacheLocation].setItem(key, value);\r\n if (enableCookieStorage) {\r\n this.setItemCookie(key, value);\r\n }\r\n };\r\n /**\r\n * get one item by key from storage\r\n * @param key\r\n * @param enableCookieStorage\r\n */\r\n BrowserStorage.prototype.getItem = function (key, enableCookieStorage) {\r\n if (enableCookieStorage && this.getItemCookie(key)) {\r\n return this.getItemCookie(key);\r\n }\r\n return window[this.cacheLocation].getItem(key);\r\n };\r\n /**\r\n * remove value from storage\r\n * @param key\r\n */\r\n BrowserStorage.prototype.removeItem = function (key) {\r\n return window[this.cacheLocation].removeItem(key);\r\n };\r\n /**\r\n * clear storage (remove all items from it)\r\n */\r\n BrowserStorage.prototype.clear = function () {\r\n return window[this.cacheLocation].clear();\r\n };\r\n /**\r\n * add value to cookies\r\n * @param cName\r\n * @param cValue\r\n * @param expires\r\n */\r\n BrowserStorage.prototype.setItemCookie = function (cName, cValue, expires) {\r\n var cookieStr = cName + \"=\" + cValue + \";path=/;\";\r\n if (expires) {\r\n var expireTime = this.getCookieExpirationTime(expires);\r\n cookieStr += \"expires=\" + expireTime + \";\";\r\n }\r\n document.cookie = cookieStr;\r\n };\r\n /**\r\n * get one item by key from cookies\r\n * @param cName\r\n */\r\n BrowserStorage.prototype.getItemCookie = function (cName) {\r\n var name = cName + \"=\";\r\n var ca = document.cookie.split(\";\");\r\n for (var i = 0; i < ca.length; i++) {\r\n var c = ca[i];\r\n while (c.charAt(0) === \" \") {\r\n c = c.substring(1);\r\n }\r\n if (c.indexOf(name) === 0) {\r\n return c.substring(name.length, c.length);\r\n }\r\n }\r\n return \"\";\r\n };\r\n /**\r\n * Clear an item in the cookies by key\r\n * @param cName\r\n */\r\n BrowserStorage.prototype.clearItemCookie = function (cName) {\r\n this.setItemCookie(cName, \"\", -1);\r\n };\r\n /**\r\n * Get cookie expiration time\r\n * @param cookieLifeDays\r\n */\r\n BrowserStorage.prototype.getCookieExpirationTime = function (cookieLifeDays) {\r\n var today = new Date();\r\n var expr = new Date(today.getTime() + cookieLifeDays * 24 * 60 * 60 * 1000);\r\n return expr.toUTCString();\r\n };\r\n return BrowserStorage;\r\n}());\r\nexport { BrowserStorage };\r\n//# sourceMappingURL=BrowserStorage.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Constants, PromptState, BlacklistedEQParams } from \"./Constants\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { StringUtils } from \"./StringUtils\";\r\nimport { CryptoUtils } from \"./CryptoUtils\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\n/**\r\n * @hidden\r\n */\r\nvar RequestUtils = /** @class */ (function () {\r\n function RequestUtils() {\r\n }\r\n /**\r\n * @ignore\r\n *\r\n * @param request\r\n * @param isLoginCall\r\n * @param cacheStorage\r\n * @param clientId\r\n *\r\n * validates all request parameters and generates a consumable request object\r\n */\r\n RequestUtils.validateRequest = function (request, isLoginCall, clientId, interactionType) {\r\n // Throw error if request is empty for acquire * calls\r\n if (!isLoginCall && !request) {\r\n throw ClientConfigurationError.createEmptyRequestError();\r\n }\r\n var scopes;\r\n var extraQueryParameters;\r\n if (request) {\r\n // if extraScopesToConsent is passed in loginCall, append them to the login request; Validate and filter scopes (the validate function will throw if validation fails)\r\n scopes = isLoginCall ? ScopeSet.appendScopes(request.scopes, request.extraScopesToConsent) : request.scopes;\r\n ScopeSet.validateInputScope(scopes, !isLoginCall);\r\n scopes = ScopeSet.translateClientIdIfSingleScope(scopes, clientId);\r\n // validate prompt parameter\r\n this.validatePromptParameter(request.prompt);\r\n // validate extraQueryParameters\r\n extraQueryParameters = this.validateEQParameters(request.extraQueryParameters, request.claimsRequest);\r\n // validate claimsRequest\r\n this.validateClaimsRequest(request.claimsRequest);\r\n }\r\n // validate and generate state and correlationId\r\n var state = this.validateAndGenerateState(request && request.state, interactionType);\r\n var correlationId = this.validateAndGenerateCorrelationId(request && request.correlationId);\r\n var validatedRequest = tslib_1.__assign({}, request, { extraQueryParameters: extraQueryParameters,\r\n scopes: scopes,\r\n state: state,\r\n correlationId: correlationId });\r\n return validatedRequest;\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * Utility to test if valid prompt value is passed in the request\r\n * @param request\r\n */\r\n RequestUtils.validatePromptParameter = function (prompt) {\r\n if (prompt) {\r\n if ([PromptState.LOGIN, PromptState.SELECT_ACCOUNT, PromptState.CONSENT, PromptState.NONE].indexOf(prompt) < 0) {\r\n throw ClientConfigurationError.createInvalidPromptError(prompt);\r\n }\r\n }\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * Removes unnecessary or duplicate query parameters from extraQueryParameters\r\n * @param request\r\n */\r\n RequestUtils.validateEQParameters = function (extraQueryParameters, claimsRequest) {\r\n var eQParams = tslib_1.__assign({}, extraQueryParameters);\r\n if (!eQParams) {\r\n return null;\r\n }\r\n if (claimsRequest) {\r\n // this.logger.warning(\"Removed duplicate claims from extraQueryParameters. Please use either the claimsRequest field OR pass as extraQueryParameter - not both.\");\r\n delete eQParams[Constants.claims];\r\n }\r\n BlacklistedEQParams.forEach(function (param) {\r\n if (eQParams[param]) {\r\n // this.logger.warning(\"Removed duplicate \" + param + \" from extraQueryParameters. Please use the \" + param + \" field in request object.\");\r\n delete eQParams[param];\r\n }\r\n });\r\n return eQParams;\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * Validates the claims passed in request is a JSON\r\n * TODO: More validation will be added when the server team tells us how they have actually implemented claims\r\n * @param claimsRequest\r\n */\r\n RequestUtils.validateClaimsRequest = function (claimsRequest) {\r\n if (!claimsRequest) {\r\n return;\r\n }\r\n try {\r\n JSON.parse(claimsRequest);\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createClaimsRequestParsingError(e);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * generate unique state per request\r\n * @param userState User-provided state value\r\n * @returns State string include library state and user state\r\n */\r\n RequestUtils.validateAndGenerateState = function (userState, interactionType) {\r\n return !StringUtils.isEmpty(userState) ? \"\" + RequestUtils.generateLibraryState(interactionType) + Constants.resourceDelimiter + userState : RequestUtils.generateLibraryState(interactionType);\r\n };\r\n /**\r\n * Generates the state value used by the library.\r\n *\r\n * @returns Base64 encoded string representing the state\r\n */\r\n RequestUtils.generateLibraryState = function (interactionType) {\r\n var stateObject = {\r\n id: CryptoUtils.createNewGuid(),\r\n ts: TimeUtils.now(),\r\n method: interactionType\r\n };\r\n var stateString = JSON.stringify(stateObject);\r\n return CryptoUtils.base64Encode(stateString);\r\n };\r\n /**\r\n * Decodes the state value into a StateObject\r\n *\r\n * @param state State value returned in the request\r\n * @returns Parsed values from the encoded state value\r\n */\r\n RequestUtils.parseLibraryState = function (state) {\r\n var libraryState = decodeURIComponent(state).split(Constants.resourceDelimiter)[0];\r\n if (CryptoUtils.isGuid(libraryState)) {\r\n // If state is guid, assume timestamp is now and is redirect, as redirect should be only method where this can happen.\r\n return {\r\n id: libraryState,\r\n ts: TimeUtils.now(),\r\n method: Constants.interactionTypeRedirect\r\n };\r\n }\r\n try {\r\n var stateString = CryptoUtils.base64Decode(libraryState);\r\n var stateObject = JSON.parse(stateString);\r\n return stateObject;\r\n }\r\n catch (e) {\r\n throw ClientAuthError.createInvalidStateError(state, null);\r\n }\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * validate correlationId and generate if not valid or not set by the user\r\n * @param correlationId\r\n */\r\n RequestUtils.validateAndGenerateCorrelationId = function (correlationId) {\r\n // validate user set correlationId or set one for the user if null\r\n if (correlationId && !CryptoUtils.isGuid(correlationId)) {\r\n throw ClientConfigurationError.createInvalidCorrelationIdError();\r\n }\r\n return CryptoUtils.isGuid(correlationId) ? correlationId : CryptoUtils.createNewGuid();\r\n };\r\n /**\r\n * Create a request signature\r\n * @param request\r\n */\r\n RequestUtils.createRequestSignature = function (request) {\r\n return \"\" + request.scopes.join(\" \").toLowerCase() + Constants.resourceDelimiter + request.authority;\r\n };\r\n return RequestUtils;\r\n}());\r\nexport { RequestUtils };\r\n//# sourceMappingURL=RequestUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Constants, PersistentCacheKeys, TemporaryCacheKeys, ErrorCacheKeys, ServerHashParamKeys } from \"../utils/Constants\";\r\nimport { AccessTokenCacheItem } from \"./AccessTokenCacheItem\";\r\nimport { BrowserStorage } from \"./BrowserStorage\";\r\nimport { RequestUtils } from \"../utils/RequestUtils\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar AuthCache = /** @class */ (function (_super) {\r\n tslib_1.__extends(AuthCache, _super);\r\n function AuthCache(clientId, cacheLocation, storeAuthStateInCookie) {\r\n var _this = _super.call(this, cacheLocation) || this;\r\n _this.clientId = clientId;\r\n // This is hardcoded to true for now. We may make this configurable in the future\r\n _this.rollbackEnabled = true;\r\n _this.migrateCacheEntries(storeAuthStateInCookie);\r\n return _this;\r\n }\r\n /**\r\n * Support roll back to old cache schema until the next major release: true by default now\r\n * @param storeAuthStateInCookie\r\n */\r\n AuthCache.prototype.migrateCacheEntries = function (storeAuthStateInCookie) {\r\n var _this = this;\r\n var idTokenKey = Constants.cachePrefix + \".\" + PersistentCacheKeys.IDTOKEN;\r\n var clientInfoKey = Constants.cachePrefix + \".\" + PersistentCacheKeys.CLIENT_INFO;\r\n var errorKey = Constants.cachePrefix + \".\" + ErrorCacheKeys.ERROR;\r\n var errorDescKey = Constants.cachePrefix + \".\" + ErrorCacheKeys.ERROR_DESC;\r\n var idTokenValue = _super.prototype.getItem.call(this, idTokenKey);\r\n var clientInfoValue = _super.prototype.getItem.call(this, clientInfoKey);\r\n var errorValue = _super.prototype.getItem.call(this, errorKey);\r\n var errorDescValue = _super.prototype.getItem.call(this, errorDescKey);\r\n var values = [idTokenValue, clientInfoValue, errorValue, errorDescValue];\r\n var keysToMigrate = [PersistentCacheKeys.IDTOKEN, PersistentCacheKeys.CLIENT_INFO, ErrorCacheKeys.ERROR, ErrorCacheKeys.ERROR_DESC];\r\n keysToMigrate.forEach(function (cacheKey, index) { return _this.duplicateCacheEntry(cacheKey, values[index], storeAuthStateInCookie); });\r\n };\r\n /**\r\n * Utility function to help with roll back keys\r\n * @param newKey\r\n * @param value\r\n * @param storeAuthStateInCookie\r\n */\r\n AuthCache.prototype.duplicateCacheEntry = function (newKey, value, storeAuthStateInCookie) {\r\n if (value) {\r\n this.setItem(newKey, value, storeAuthStateInCookie);\r\n }\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 AuthCache.prototype.generateCacheKey = function (key, addInstanceId) {\r\n try {\r\n // Defined schemas do not need the key appended\r\n JSON.parse(key);\r\n return key;\r\n }\r\n catch (e) {\r\n if (key.indexOf(\"\" + Constants.cachePrefix) === 0 || key.indexOf(Constants.adalIdToken) === 0) {\r\n return key;\r\n }\r\n return addInstanceId ? Constants.cachePrefix + \".\" + this.clientId + \".\" + key : Constants.cachePrefix + \".\" + key;\r\n }\r\n };\r\n /**\r\n * Validates that the input cache key contains the account search terms (clientId and homeAccountIdentifier) and\r\n * then whether or not it contains the \"scopes\", depending on the token type being searched for. With matching account\r\n * search terms, Access Token search tries to match the \"scopes\" keyword, while Id Token search expects \"scopes\" to not be included.\r\n * @param key\r\n * @param clientId\r\n * @param homeAccountIdentifier\r\n * @param tokenType\r\n */\r\n AuthCache.prototype.matchKeyForType = function (key, clientId, homeAccountIdentifier, tokenType) {\r\n // All valid token cache item keys are valid JSON objects, ignore keys that aren't\r\n var parsedKey = StringUtils.validateAndParseJsonCacheKey(key);\r\n if (!parsedKey) {\r\n return null;\r\n }\r\n // Does the cache item match the request account\r\n var accountMatches = key.match(clientId) && key.match(homeAccountIdentifier);\r\n // Does the cache item match the requested token type\r\n var tokenTypeMatches = false;\r\n switch (tokenType) {\r\n case ServerHashParamKeys.ACCESS_TOKEN:\r\n // Cache item is an access token if scopes are included in the cache item key\r\n tokenTypeMatches = !!key.match(Constants.scopes);\r\n break;\r\n case ServerHashParamKeys.ID_TOKEN:\r\n // Cache may be an ID token if scopes are NOT included in the cache item key\r\n tokenTypeMatches = !key.match(Constants.scopes);\r\n break;\r\n }\r\n return (accountMatches && tokenTypeMatches) ? parsedKey : null;\r\n };\r\n /**\r\n * add value to storage\r\n * @param key\r\n * @param value\r\n * @param enableCookieStorage\r\n */\r\n AuthCache.prototype.setItem = function (key, value, enableCookieStorage) {\r\n _super.prototype.setItem.call(this, this.generateCacheKey(key, true), value, enableCookieStorage);\r\n // Values stored in cookies will have rollback disabled to minimize cookie length\r\n if (this.rollbackEnabled && !enableCookieStorage) {\r\n _super.prototype.setItem.call(this, this.generateCacheKey(key, false), value, enableCookieStorage);\r\n }\r\n };\r\n /**\r\n * get one item by key from storage\r\n * @param key\r\n * @param enableCookieStorage\r\n */\r\n AuthCache.prototype.getItem = function (key, enableCookieStorage) {\r\n return _super.prototype.getItem.call(this, this.generateCacheKey(key, true), enableCookieStorage);\r\n };\r\n /**\r\n * remove value from storage\r\n * @param key\r\n */\r\n AuthCache.prototype.removeItem = function (key) {\r\n _super.prototype.removeItem.call(this, this.generateCacheKey(key, true));\r\n if (this.rollbackEnabled) {\r\n _super.prototype.removeItem.call(this, this.generateCacheKey(key, false));\r\n }\r\n };\r\n /**\r\n * Reset the cache items\r\n */\r\n AuthCache.prototype.resetCacheItems = function () {\r\n var storage = window[this.cacheLocation];\r\n var key;\r\n for (key in storage) {\r\n // Check if key contains msal prefix; For now, we are clearing all cache items created by MSAL.js\r\n if (storage.hasOwnProperty(key) && (key.indexOf(Constants.cachePrefix) !== -1)) {\r\n _super.prototype.removeItem.call(this, key);\r\n // TODO: Clear cache based on client id (clarify use cases where this is needed)\r\n }\r\n }\r\n };\r\n /**\r\n * Reset all temporary cache items\r\n */\r\n AuthCache.prototype.resetTempCacheItems = function (state) {\r\n var _this = this;\r\n var stateId = state && RequestUtils.parseLibraryState(state).id;\r\n var isTokenRenewalInProgress = this.tokenRenewalInProgress(state);\r\n var storage = window[this.cacheLocation];\r\n // check state and remove associated cache\r\n if (stateId && !isTokenRenewalInProgress) {\r\n Object.keys(storage).forEach(function (key) {\r\n if (key.indexOf(stateId) !== -1) {\r\n _this.removeItem(key);\r\n _super.prototype.clearItemCookie.call(_this, key);\r\n }\r\n });\r\n }\r\n // delete the interaction status cache\r\n this.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n this.removeItem(TemporaryCacheKeys.REDIRECT_REQUEST);\r\n };\r\n /**\r\n * Set cookies for IE\r\n * @param cName\r\n * @param cValue\r\n * @param expires\r\n */\r\n AuthCache.prototype.setItemCookie = function (cName, cValue, expires) {\r\n _super.prototype.setItemCookie.call(this, this.generateCacheKey(cName, true), cValue, expires);\r\n if (this.rollbackEnabled) {\r\n _super.prototype.setItemCookie.call(this, this.generateCacheKey(cName, false), cValue, expires);\r\n }\r\n };\r\n AuthCache.prototype.clearItemCookie = function (cName) {\r\n _super.prototype.clearItemCookie.call(this, this.generateCacheKey(cName, true));\r\n if (this.rollbackEnabled) {\r\n _super.prototype.clearItemCookie.call(this, this.generateCacheKey(cName, false));\r\n }\r\n };\r\n /**\r\n * get one item by key from cookies\r\n * @param cName\r\n */\r\n AuthCache.prototype.getItemCookie = function (cName) {\r\n return _super.prototype.getItemCookie.call(this, this.generateCacheKey(cName, true));\r\n };\r\n /**\r\n * Get all tokens of a certain type from the cache\r\n * @param clientId\r\n * @param homeAccountIdentifier\r\n * @param tokenType\r\n */\r\n AuthCache.prototype.getAllTokensByType = function (clientId, homeAccountIdentifier, tokenType) {\r\n var _this = this;\r\n var results = Object.keys(window[this.cacheLocation]).reduce(function (tokens, key) {\r\n var matchedTokenKey = _this.matchKeyForType(key, clientId, homeAccountIdentifier, tokenType);\r\n if (matchedTokenKey) {\r\n var value = _this.getItem(key);\r\n if (value) {\r\n try {\r\n var newAccessTokenCacheItem = new AccessTokenCacheItem(matchedTokenKey, JSON.parse(value));\r\n return tokens.concat([newAccessTokenCacheItem]);\r\n }\r\n catch (err) {\r\n // Skip cache items with non-valid JSON values\r\n return tokens;\r\n }\r\n }\r\n }\r\n return tokens;\r\n }, []);\r\n return results;\r\n };\r\n /**\r\n * Get all access tokens in the cache\r\n * @param clientId\r\n * @param homeAccountIdentifier\r\n */\r\n AuthCache.prototype.getAllAccessTokens = function (clientId, homeAccountIdentifier) {\r\n return this.getAllTokensByType(clientId, homeAccountIdentifier, ServerHashParamKeys.ACCESS_TOKEN);\r\n };\r\n /**\r\n * Get all id tokens in the cache in the form of AccessTokenCacheItem objects so they are\r\n * in a normalized format and can make use of the existing cached access token validation logic\r\n */\r\n AuthCache.prototype.getAllIdTokens = function (clientId, homeAccountIdentifier) {\r\n return this.getAllTokensByType(clientId, homeAccountIdentifier, ServerHashParamKeys.ID_TOKEN);\r\n };\r\n /**\r\n * Get all access and ID tokens in the cache\r\n * @param clientId\r\n * @param homeAccountIdentifier\r\n */\r\n AuthCache.prototype.getAllTokens = function (clientId, homeAccountIdentifier) {\r\n var accessTokens = this.getAllAccessTokens(clientId, homeAccountIdentifier);\r\n var idTokens = this.getAllIdTokens(clientId, homeAccountIdentifier);\r\n return accessTokens.concat(idTokens);\r\n };\r\n /**\r\n * Return if the token renewal is still in progress\r\n *\r\n * @param stateValue\r\n */\r\n AuthCache.prototype.tokenRenewalInProgress = function (stateValue) {\r\n var renewStatus = this.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, stateValue));\r\n return !!(renewStatus && renewStatus === Constants.inProgress);\r\n };\r\n /**\r\n * Clear all cookies\r\n */\r\n AuthCache.prototype.clearMsalCookie = function (state) {\r\n var _this = this;\r\n /*\r\n * If state is truthy, remove values associated with that request.\r\n * Otherwise, remove all MSAL cookies.\r\n */\r\n if (state) {\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, state));\r\n this.clearItemCookie(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, state));\r\n }\r\n else {\r\n var cookies = document.cookie.split(\";\");\r\n cookies.forEach(function (cookieString) {\r\n var cookieName = cookieString.trim().split(\"=\")[0];\r\n if (cookieName.indexOf(Constants.cachePrefix) > -1) {\r\n _super.prototype.clearItemCookie.call(_this, cookieName);\r\n }\r\n });\r\n }\r\n };\r\n /**\r\n * Create acquireTokenAccountKey to cache account object\r\n * @param accountId\r\n * @param state\r\n */\r\n AuthCache.generateAcquireTokenAccountKey = function (accountId, state) {\r\n var stateId = RequestUtils.parseLibraryState(state).id;\r\n return \"\" + TemporaryCacheKeys.ACQUIRE_TOKEN_ACCOUNT + Constants.resourceDelimiter + accountId + Constants.resourceDelimiter + stateId;\r\n };\r\n /**\r\n * Create authorityKey to cache authority\r\n * @param state\r\n */\r\n AuthCache.generateAuthorityKey = function (state) {\r\n return AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.AUTHORITY, state);\r\n };\r\n /**\r\n * Generates the cache key for temporary cache items, using request state\r\n * @param tempCacheKey Cache key prefix\r\n * @param state Request state value\r\n */\r\n AuthCache.generateTemporaryCacheKey = function (tempCacheKey, state) {\r\n // Use the state id (a guid), in the interest of shorter key names, which is important for cookies.\r\n var stateId = RequestUtils.parseLibraryState(state).id;\r\n return \"\" + tempCacheKey + Constants.resourceDelimiter + stateId;\r\n };\r\n return AuthCache;\r\n}(BrowserStorage));\r\nexport { AuthCache };\r\n//# sourceMappingURL=AuthCache.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\n/**\r\n * accountIdentifier combination of idToken.uid and idToken.utid\r\n * homeAccountIdentifier combination of clientInfo.uid and clientInfo.utid\r\n * userName idToken.preferred_username\r\n * name idToken.name\r\n * idToken idToken\r\n * sid idToken.sid - session identifier\r\n * environment idtoken.issuer (the authority that issues the token)\r\n */\r\nvar Account = /** @class */ (function () {\r\n /**\r\n * Creates an Account Object\r\n * @praram accountIdentifier\r\n * @param homeAccountIdentifier\r\n * @param userName\r\n * @param name\r\n * @param idToken\r\n * @param sid\r\n * @param environment\r\n */\r\n function Account(accountIdentifier, homeAccountIdentifier, userName, name, idTokenClaims, sid, environment) {\r\n this.accountIdentifier = accountIdentifier;\r\n this.homeAccountIdentifier = homeAccountIdentifier;\r\n this.userName = userName;\r\n this.name = name;\r\n // will be deprecated soon\r\n this.idToken = idTokenClaims;\r\n this.idTokenClaims = idTokenClaims;\r\n this.sid = sid;\r\n this.environment = environment;\r\n }\r\n /**\r\n * @hidden\r\n * @param idToken\r\n * @param clientInfo\r\n */\r\n Account.createAccount = function (idToken, clientInfo) {\r\n // create accountIdentifier\r\n var accountIdentifier = idToken.objectId || idToken.subject;\r\n // create homeAccountIdentifier\r\n var uid = clientInfo ? clientInfo.uid : \"\";\r\n var utid = clientInfo ? clientInfo.utid : \"\";\r\n var homeAccountIdentifier;\r\n if (!StringUtils.isEmpty(uid)) {\r\n homeAccountIdentifier = StringUtils.isEmpty(utid) ? CryptoUtils.base64Encode(uid) : CryptoUtils.base64Encode(uid) + \".\" + CryptoUtils.base64Encode(utid);\r\n }\r\n return new Account(accountIdentifier, homeAccountIdentifier, idToken.preferredName, idToken.name, idToken.claims, idToken.sid, idToken.issuer);\r\n };\r\n /**\r\n * Utils function to compare two Account objects - used to check if the same user account is logged in\r\n *\r\n * @param a1: Account object\r\n * @param a2: Account object\r\n */\r\n Account.compareAccounts = function (a1, a2) {\r\n if (!a1 || !a2) {\r\n return false;\r\n }\r\n if (a1.homeAccountIdentifier && a2.homeAccountIdentifier) {\r\n if (a1.homeAccountIdentifier === a2.homeAccountIdentifier) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n };\r\n return Account;\r\n}());\r\nexport { Account };\r\n//# sourceMappingURL=Account.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { ClientAuthError } from \"../error/ClientAuthError\";\r\nimport { UrlUtils } from \"./UrlUtils\";\r\nimport { TemporaryCacheKeys, Constants } from \"./Constants\";\r\nimport { TimeUtils } from \"./TimeUtils\";\r\nvar WindowUtils = /** @class */ (function () {\r\n function WindowUtils() {\r\n }\r\n /**\r\n * @hidden\r\n * Checks if the current page is running in an iframe.\r\n * @ignore\r\n */\r\n WindowUtils.isInIframe = function () {\r\n return window.parent !== window;\r\n };\r\n /**\r\n * @hidden\r\n * Check if the current page is running in a popup.\r\n * @ignore\r\n */\r\n WindowUtils.isInPopup = function () {\r\n return !!(window.opener && window.opener !== window);\r\n };\r\n /**\r\n * @hidden\r\n * @param prefix\r\n * @param scopes\r\n * @param authority\r\n */\r\n WindowUtils.generateFrameName = function (prefix, requestSignature) {\r\n return \"\" + prefix + Constants.resourceDelimiter + requestSignature;\r\n };\r\n /**\r\n * @hidden\r\n * Polls an iframe until it loads a url with a hash\r\n * @ignore\r\n */\r\n WindowUtils.monitorIframeForHash = function (contentWindow, timeout, urlNavigate, logger) {\r\n return new Promise(function (resolve, reject) {\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 = TimeUtils.relativeNowMs();\r\n var timeoutMark = nowMark + timeout;\r\n logger.verbose(\"monitorWindowForIframe polling started\");\r\n var intervalId = setInterval(function () {\r\n if (TimeUtils.relativeNowMs() > timeoutMark) {\r\n logger.error(\"monitorIframeForHash unable to find hash in url, timing out\");\r\n logger.errorPii(\"monitorIframeForHash polling timed out for url: \" + urlNavigate);\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createTokenRenewalTimeoutError());\r\n return;\r\n }\r\n var href;\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.location.href;\r\n }\r\n catch (e) { }\r\n if (href && UrlUtils.urlContainsHash(href)) {\r\n logger.verbose(\"monitorIframeForHash found url in hash\");\r\n clearInterval(intervalId);\r\n resolve(contentWindow.location.hash);\r\n }\r\n }, WindowUtils.POLLING_INTERVAL_MS);\r\n });\r\n };\r\n /**\r\n * @hidden\r\n * Polls a popup until it loads a url with a hash\r\n * @ignore\r\n */\r\n WindowUtils.monitorPopupForHash = function (contentWindow, timeout, urlNavigate, logger) {\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 = timeout / WindowUtils.POLLING_INTERVAL_MS;\r\n var ticks = 0;\r\n logger.verbose(\"monitorWindowForHash polling started\");\r\n var intervalId = setInterval(function () {\r\n if (contentWindow.closed) {\r\n logger.error(\"monitorWindowForHash window closed\");\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createUserCancelledError());\r\n return;\r\n }\r\n var href;\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.location.href;\r\n }\r\n catch (e) { }\r\n // Don't process blank pages or cross domain\r\n if (!href || href === \"about:blank\") {\r\n return;\r\n }\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 (href && UrlUtils.urlContainsHash(href)) {\r\n logger.verbose(\"monitorPopupForHash found url in hash\");\r\n clearInterval(intervalId);\r\n resolve(contentWindow.location.hash);\r\n }\r\n else if (ticks > maxTicks) {\r\n logger.error(\"monitorPopupForHash unable to find hash in url, timing out\");\r\n logger.errorPii(\"monitorPopupForHash polling timed out for url: \" + urlNavigate);\r\n clearInterval(intervalId);\r\n reject(ClientAuthError.createTokenRenewalTimeoutError());\r\n }\r\n }, WindowUtils.POLLING_INTERVAL_MS);\r\n });\r\n };\r\n /**\r\n * @hidden\r\n * Loads iframe with authorization endpoint URL\r\n * @ignore\r\n */\r\n WindowUtils.loadFrame = function (urlNavigate, frameName, timeoutMs, logger) {\r\n var _this = this;\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 logger.infoPii(\"LoadFrame: \" + frameName);\r\n return new Promise(function (resolve, reject) {\r\n setTimeout(function () {\r\n var frameHandle = _this.loadFrameSync(urlNavigate, frameName, logger);\r\n if (!frameHandle) {\r\n reject(\"Unable to load iframe with name: \" + frameName);\r\n return;\r\n }\r\n resolve(frameHandle);\r\n }, timeoutMs);\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 WindowUtils.loadFrameSync = function (urlNavigate, frameName, logger) {\r\n var frameHandle = WindowUtils.addHiddenIFrame(frameName, logger);\r\n // returning to handle null in loadFrame, also to avoid null object access errors\r\n if (!frameHandle) {\r\n return null;\r\n }\r\n else if (frameHandle.src === \"\" || frameHandle.src === \"about:blank\") {\r\n frameHandle.src = urlNavigate;\r\n logger.infoPii(\"Frame Name : \" + frameName + \" Navigated to: \" + urlNavigate);\r\n }\r\n return frameHandle;\r\n };\r\n /**\r\n * @hidden\r\n * Adds the hidden iframe for silent token renewal.\r\n * @ignore\r\n */\r\n WindowUtils.addHiddenIFrame = function (iframeId, logger) {\r\n if (typeof iframeId === \"undefined\") {\r\n return null;\r\n }\r\n logger.infoPii(\"Add msal frame to document:\" + iframeId);\r\n var adalFrame = document.getElementById(iframeId);\r\n if (!adalFrame) {\r\n if (document.createElement &&\r\n document.documentElement &&\r\n (window.navigator.userAgent.indexOf(\"MSIE 5.0\") === -1)) {\r\n var ifr = document.createElement(\"iframe\");\r\n ifr.setAttribute(\"id\", iframeId);\r\n ifr.setAttribute(\"aria-hidden\", \"true\");\r\n ifr.style.visibility = \"hidden\";\r\n ifr.style.position = \"absolute\";\r\n ifr.style.width = ifr.style.height = \"0\";\r\n ifr.style.border = \"0\";\r\n ifr.setAttribute(\"sandbox\", \"allow-scripts allow-same-origin allow-forms\");\r\n adalFrame = document.getElementsByTagName(\"body\")[0].appendChild(ifr);\r\n }\r\n else if (document.body && document.body.insertAdjacentHTML) {\r\n document.body.insertAdjacentHTML(\"beforeend\", \"\");\r\n }\r\n if (window.frames && window.frames[iframeId]) {\r\n adalFrame = window.frames[iframeId];\r\n }\r\n }\r\n return adalFrame;\r\n };\r\n /**\r\n * @hidden\r\n * Removes a hidden iframe from the page.\r\n * @ignore\r\n */\r\n WindowUtils.removeHiddenIframe = function (iframe) {\r\n if (document.body === iframe.parentNode) {\r\n document.body.removeChild(iframe);\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * Find and return the iframe element with the given hash\r\n * @ignore\r\n */\r\n WindowUtils.getIframeWithHash = function (hash) {\r\n var iframes = document.getElementsByTagName(\"iframe\");\r\n var iframeArray = Array.apply(null, Array(iframes.length)).map(function (iframe, index) { return iframes.item(index); }); // eslint-disable-line prefer-spread\r\n return iframeArray.filter(function (iframe) {\r\n try {\r\n return iframe.contentWindow.location.hash === hash;\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n })[0];\r\n };\r\n /**\r\n * @hidden\r\n * Returns an array of all the popups opened by MSAL\r\n * @ignore\r\n */\r\n WindowUtils.getPopups = function () {\r\n if (!window.openedWindows) {\r\n window.openedWindows = [];\r\n }\r\n return window.openedWindows;\r\n };\r\n /**\r\n * @hidden\r\n * Find and return the popup with the given hash\r\n * @ignore\r\n */\r\n WindowUtils.getPopUpWithHash = function (hash) {\r\n return WindowUtils.getPopups().filter(function (popup) {\r\n try {\r\n return popup.location.hash === hash;\r\n }\r\n catch (e) {\r\n return false;\r\n }\r\n })[0];\r\n };\r\n /**\r\n * @hidden\r\n * Add the popup to the known list of popups\r\n * @ignore\r\n */\r\n WindowUtils.trackPopup = function (popup) {\r\n WindowUtils.getPopups().push(popup);\r\n };\r\n /**\r\n * @hidden\r\n * Close all popups\r\n * @ignore\r\n */\r\n WindowUtils.closePopups = function () {\r\n WindowUtils.getPopups().forEach(function (popup) { return popup.close(); });\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * blocks any login/acquireToken calls to reload from within a hidden iframe (generated for silent calls)\r\n */\r\n WindowUtils.blockReloadInHiddenIframes = function () {\r\n // return an error if called from the hidden iframe created by the msal js silent calls\r\n if (UrlUtils.urlContainsHash(window.location.hash) && WindowUtils.isInIframe()) {\r\n throw ClientAuthError.createBlockTokenRequestsInHiddenIframeError();\r\n }\r\n };\r\n /**\r\n *\r\n * @param cacheStorage\r\n */\r\n WindowUtils.checkIfBackButtonIsPressed = function (cacheStorage) {\r\n var redirectCache = cacheStorage.getItem(TemporaryCacheKeys.REDIRECT_REQUEST);\r\n // if redirect request is set and there is no hash\r\n if (redirectCache && !UrlUtils.urlContainsHash(window.location.hash)) {\r\n var splitCache = redirectCache.split(Constants.resourceDelimiter);\r\n splitCache.shift();\r\n var state = splitCache.length > 0 ? splitCache.join(Constants.resourceDelimiter) : null;\r\n cacheStorage.resetTempCacheItems(state);\r\n }\r\n };\r\n /**\r\n * Removes url fragment from browser url\r\n */\r\n WindowUtils.clearUrlFragment = function () {\r\n // Office.js sets history.replaceState to null\r\n if (typeof history.replaceState === \"function\") {\r\n // Full removes \"#\" from url\r\n history.replaceState(null, null, \"\" + window.location.pathname + window.location.search);\r\n }\r\n else {\r\n window.location.hash = \"\";\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * Interval in milliseconds that we poll a window\r\n * @ignore\r\n */\r\n WindowUtils.POLLING_INTERVAL_MS = 50;\r\n return WindowUtils;\r\n}());\r\nexport { WindowUtils };\r\n//# sourceMappingURL=WindowUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { ResponseTypes, ServerHashParamKeys } from \"./Constants\";\r\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 ResponseUtils = /** @class */ (function () {\r\n function ResponseUtils() {\r\n }\r\n ResponseUtils.setResponseIdToken = function (originalResponse, idTokenObj) {\r\n if (!originalResponse) {\r\n return null;\r\n }\r\n else if (!idTokenObj) {\r\n return originalResponse;\r\n }\r\n var exp = Number(idTokenObj.expiration);\r\n if (exp && !originalResponse.expiresOn) {\r\n originalResponse.expiresOn = new Date(exp * 1000);\r\n }\r\n return tslib_1.__assign({}, originalResponse, { idToken: idTokenObj, idTokenClaims: idTokenObj.claims, uniqueId: idTokenObj.objectId || idTokenObj.subject, tenantId: idTokenObj.tenantId });\r\n };\r\n ResponseUtils.buildAuthResponse = function (idToken, authResponse, serverAuthenticationRequest, account, scopes, accountState) {\r\n switch (serverAuthenticationRequest.responseType) {\r\n case ResponseTypes.id_token:\r\n authResponse = tslib_1.__assign({}, authResponse, { tokenType: ServerHashParamKeys.ID_TOKEN, account: account, scopes: scopes, accountState: accountState });\r\n authResponse = ResponseUtils.setResponseIdToken(authResponse, idToken);\r\n return (authResponse.idToken) ? authResponse : null;\r\n case ResponseTypes.id_token_token:\r\n authResponse = ResponseUtils.setResponseIdToken(authResponse, idToken);\r\n return (authResponse && authResponse.accessToken && authResponse.idToken) ? authResponse : null;\r\n case ResponseTypes.token:\r\n authResponse = ResponseUtils.setResponseIdToken(authResponse, idToken);\r\n return authResponse;\r\n default:\r\n return null;\r\n }\r\n };\r\n return ResponseUtils;\r\n}());\r\nexport { ResponseUtils };\r\n//# sourceMappingURL=ResponseUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\n/**\r\n * @hidden\r\n */\r\nimport { Authority } from \"./Authority\";\r\nimport { StringUtils } from \"../utils/StringUtils\";\r\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\r\nvar AuthorityFactory = /** @class */ (function () {\r\n function AuthorityFactory() {\r\n }\r\n AuthorityFactory.saveMetadataFromNetwork = function (authorityInstance, telemetryManager, correlationId) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var metadata;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0: return [4 /*yield*/, authorityInstance.resolveEndpointsAsync(telemetryManager, correlationId)];\r\n case 1:\r\n metadata = _a.sent();\r\n this.metadataMap.set(authorityInstance.CanonicalAuthority, metadata);\r\n return [2 /*return*/, metadata];\r\n }\r\n });\r\n });\r\n };\r\n AuthorityFactory.getMetadata = function (authorityUrl) {\r\n return this.metadataMap.get(authorityUrl);\r\n };\r\n AuthorityFactory.saveMetadataFromConfig = function (authorityUrl, authorityMetadataJson) {\r\n try {\r\n if (authorityMetadataJson) {\r\n var parsedMetadata = JSON.parse(authorityMetadataJson);\r\n if (!parsedMetadata.authorization_endpoint || !parsedMetadata.end_session_endpoint || !parsedMetadata.issuer) {\r\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\r\n }\r\n this.metadataMap.set(authorityUrl, {\r\n AuthorizationEndpoint: parsedMetadata.authorization_endpoint,\r\n EndSessionEndpoint: parsedMetadata.end_session_endpoint,\r\n Issuer: parsedMetadata.issuer\r\n });\r\n }\r\n }\r\n catch (e) {\r\n throw ClientConfigurationError.createInvalidAuthorityMetadataError();\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 (eg aad, b2c)\r\n */\r\n AuthorityFactory.CreateInstance = function (authorityUrl, validateAuthority, authorityMetadata) {\r\n if (StringUtils.isEmpty(authorityUrl)) {\r\n return null;\r\n }\r\n if (authorityMetadata) {\r\n // todo: log statements\r\n this.saveMetadataFromConfig(authorityUrl, authorityMetadata);\r\n }\r\n return new Authority(authorityUrl, validateAuthority, this.metadataMap.get(authorityUrl));\r\n };\r\n AuthorityFactory.metadataMap = new Map();\r\n return AuthorityFactory;\r\n}());\r\nexport { AuthorityFactory };\r\n//# sourceMappingURL=AuthorityFactory.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { Logger } from \"./Logger\";\r\nimport { UrlUtils } from \"./utils/UrlUtils\";\r\n/**\r\n * Defaults for the Configuration Options\r\n */\r\nvar FRAME_TIMEOUT = 6000;\r\nvar OFFSET = 300;\r\nvar NAVIGATE_FRAME_WAIT = 500;\r\nvar DEFAULT_AUTH_OPTIONS = {\r\n clientId: \"\",\r\n authority: null,\r\n validateAuthority: true,\r\n authorityMetadata: \"\",\r\n knownAuthorities: [],\r\n redirectUri: function () { return UrlUtils.getCurrentUrl(); },\r\n postLogoutRedirectUri: function () { return UrlUtils.getCurrentUrl(); },\r\n navigateToLoginRequestUrl: true\r\n};\r\nvar DEFAULT_CACHE_OPTIONS = {\r\n cacheLocation: \"sessionStorage\",\r\n storeAuthStateInCookie: false\r\n};\r\nvar DEFAULT_SYSTEM_OPTIONS = {\r\n logger: new Logger(null),\r\n loadFrameTimeout: FRAME_TIMEOUT,\r\n tokenRenewalOffsetSeconds: OFFSET,\r\n navigateFrameWait: NAVIGATE_FRAME_WAIT\r\n};\r\nvar DEFAULT_FRAMEWORK_OPTIONS = {\r\n isAngular: false,\r\n unprotectedResources: new Array(),\r\n protectedResourceMap: new Map()\r\n};\r\n/**\r\n * MSAL function that sets the default options when not explicitly configured from app developer\r\n *\r\n * @param TAuthOptions\r\n * @param TCacheOptions\r\n * @param TSystemOptions\r\n * @param TFrameworkOptions\r\n * @param TAuthorityDataOptions\r\n *\r\n * @returns TConfiguration object\r\n */\r\nexport function buildConfiguration(_a) {\r\n var auth = _a.auth, _b = _a.cache, cache = _b === void 0 ? {} : _b, _c = _a.system, system = _c === void 0 ? {} : _c, _d = _a.framework, framework = _d === void 0 ? {} : _d;\r\n var overlayedConfig = {\r\n auth: tslib_1.__assign({}, DEFAULT_AUTH_OPTIONS, auth),\r\n cache: tslib_1.__assign({}, DEFAULT_CACHE_OPTIONS, cache),\r\n system: tslib_1.__assign({}, DEFAULT_SYSTEM_OPTIONS, system),\r\n framework: tslib_1.__assign({}, DEFAULT_FRAMEWORK_OPTIONS, framework)\r\n };\r\n return overlayedConfig;\r\n}\r\n//# sourceMappingURL=Configuration.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { AuthError } from \"./AuthError\";\r\nexport var ServerErrorMessage = {\r\n serverUnavailable: {\r\n code: \"server_unavailable\",\r\n desc: \"Server is temporarily unavailable.\"\r\n },\r\n unknownServerError: {\r\n code: \"unknown_server_error\"\r\n },\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 tslib_1.__extends(ServerError, _super);\r\n function ServerError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"ServerError\";\r\n Object.setPrototypeOf(_this, ServerError.prototype);\r\n return _this;\r\n }\r\n ServerError.createServerUnavailableError = function () {\r\n return new ServerError(ServerErrorMessage.serverUnavailable.code, ServerErrorMessage.serverUnavailable.desc);\r\n };\r\n ServerError.createUnknownServerError = function (errorDesc) {\r\n return new ServerError(ServerErrorMessage.unknownServerError.code, errorDesc);\r\n };\r\n return ServerError;\r\n}(AuthError));\r\nexport { ServerError };\r\n//# sourceMappingURL=ServerError.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { ServerError } from \"./ServerError\";\r\nexport var InteractionRequiredAuthErrorMessage = {\r\n interactionRequired: {\r\n code: \"interaction_required\"\r\n },\r\n consentRequired: {\r\n code: \"consent_required\"\r\n },\r\n loginRequired: {\r\n code: \"login_required\"\r\n },\r\n};\r\n/**\r\n * Error thrown when the user is required to perform an interactive token request.\r\n */\r\nvar InteractionRequiredAuthError = /** @class */ (function (_super) {\r\n tslib_1.__extends(InteractionRequiredAuthError, _super);\r\n function InteractionRequiredAuthError(errorCode, errorMessage) {\r\n var _this = _super.call(this, errorCode, errorMessage) || this;\r\n _this.name = \"InteractionRequiredAuthError\";\r\n Object.setPrototypeOf(_this, InteractionRequiredAuthError.prototype);\r\n return _this;\r\n }\r\n InteractionRequiredAuthError.isInteractionRequiredError = function (errorString) {\r\n var interactionRequiredCodes = [\r\n InteractionRequiredAuthErrorMessage.interactionRequired.code,\r\n InteractionRequiredAuthErrorMessage.consentRequired.code,\r\n InteractionRequiredAuthErrorMessage.loginRequired.code\r\n ];\r\n return errorString && interactionRequiredCodes.indexOf(errorString) > -1;\r\n };\r\n InteractionRequiredAuthError.createLoginRequiredAuthError = function (errorDesc) {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.loginRequired.code, errorDesc);\r\n };\r\n InteractionRequiredAuthError.createInteractionRequiredAuthError = function (errorDesc) {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.interactionRequired.code, errorDesc);\r\n };\r\n InteractionRequiredAuthError.createConsentRequiredAuthError = function (errorDesc) {\r\n return new InteractionRequiredAuthError(InteractionRequiredAuthErrorMessage.consentRequired.code, errorDesc);\r\n };\r\n return InteractionRequiredAuthError;\r\n}(ServerError));\r\nexport { InteractionRequiredAuthError };\r\n//# sourceMappingURL=InteractionRequiredAuthError.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nexport function buildResponseStateOnly(state) {\r\n return {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: \"\",\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: \"\",\r\n scopes: null,\r\n expiresOn: null,\r\n account: null,\r\n accountState: state,\r\n fromCache: false\r\n };\r\n}\r\n//# sourceMappingURL=AuthResponse.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nexport var EVENT_NAME_PREFIX = \"msal.\";\r\nexport var EVENT_NAME_KEY = \"event_name\";\r\nexport var START_TIME_KEY = \"start_time\";\r\nexport var ELAPSED_TIME_KEY = \"elapsed_time\";\r\nexport var TELEMETRY_BLOB_EVENT_NAMES = {\r\n MsalCorrelationIdConstStrKey: \"Microsoft.MSAL.correlation_id\",\r\n ApiTelemIdConstStrKey: \"msal.api_telem_id\",\r\n ApiIdConstStrKey: \"msal.api_id\",\r\n BrokerAppConstStrKey: \"Microsoft_MSAL_broker_app\",\r\n CacheEventCountConstStrKey: \"Microsoft_MSAL_cache_event_count\",\r\n HttpEventCountTelemetryBatchKey: \"Microsoft_MSAL_http_event_count\",\r\n IdpConstStrKey: \"Microsoft_MSAL_idp\",\r\n IsSilentTelemetryBatchKey: \"\",\r\n IsSuccessfulConstStrKey: \"Microsoft_MSAL_is_successful\",\r\n ResponseTimeConstStrKey: \"Microsoft_MSAL_response_time\",\r\n TenantIdConstStrKey: \"Microsoft_MSAL_tenant_id\",\r\n UiEventCountTelemetryBatchKey: \"Microsoft_MSAL_ui_event_count\"\r\n};\r\n// This is used to replace the real tenant in telemetry info\r\nexport var TENANT_PLACEHOLDER = \"\";\r\n//# sourceMappingURL=TelemetryConstants.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nvar _a;\r\nimport * as tslib_1 from \"tslib\";\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { TELEMETRY_BLOB_EVENT_NAMES } from \"./TelemetryConstants\";\r\nimport { scrubTenantFromUri, hashPersonalIdentifier, prependEventNamePrefix } from \"./TelemetryUtils\";\r\nexport var EVENT_KEYS = {\r\n AUTHORITY: prependEventNamePrefix(\"authority\"),\r\n AUTHORITY_TYPE: prependEventNamePrefix(\"authority_type\"),\r\n PROMPT: prependEventNamePrefix(\"ui_behavior\"),\r\n TENANT_ID: prependEventNamePrefix(\"tenant_id\"),\r\n USER_ID: prependEventNamePrefix(\"user_id\"),\r\n WAS_SUCESSFUL: prependEventNamePrefix(\"was_successful\"),\r\n API_ERROR_CODE: prependEventNamePrefix(\"api_error_code\"),\r\n LOGIN_HINT: prependEventNamePrefix(\"login_hint\")\r\n};\r\nexport var API_CODE;\r\n(function (API_CODE) {\r\n API_CODE[API_CODE[\"AcquireTokenRedirect\"] = 2001] = \"AcquireTokenRedirect\";\r\n API_CODE[API_CODE[\"AcquireTokenSilent\"] = 2002] = \"AcquireTokenSilent\";\r\n API_CODE[API_CODE[\"AcquireTokenPopup\"] = 2003] = \"AcquireTokenPopup\";\r\n API_CODE[API_CODE[\"LoginRedirect\"] = 2004] = \"LoginRedirect\";\r\n API_CODE[API_CODE[\"LoginPopup\"] = 2005] = \"LoginPopup\";\r\n API_CODE[API_CODE[\"Logout\"] = 2006] = \"Logout\";\r\n})(API_CODE || (API_CODE = {}));\r\nexport var API_EVENT_IDENTIFIER;\r\n(function (API_EVENT_IDENTIFIER) {\r\n API_EVENT_IDENTIFIER[\"AcquireTokenRedirect\"] = \"AcquireTokenRedirect\";\r\n API_EVENT_IDENTIFIER[\"AcquireTokenSilent\"] = \"AcquireTokenSilent\";\r\n API_EVENT_IDENTIFIER[\"AcquireTokenPopup\"] = \"AcquireTokenPopup\";\r\n API_EVENT_IDENTIFIER[\"LoginRedirect\"] = \"LoginRedirect\";\r\n API_EVENT_IDENTIFIER[\"LoginPopup\"] = \"LoginPopup\";\r\n API_EVENT_IDENTIFIER[\"Logout\"] = \"Logout\";\r\n})(API_EVENT_IDENTIFIER || (API_EVENT_IDENTIFIER = {}));\r\nvar mapEventIdentiferToCode = (_a = {},\r\n _a[API_EVENT_IDENTIFIER.AcquireTokenSilent] = API_CODE.AcquireTokenSilent,\r\n _a[API_EVENT_IDENTIFIER.AcquireTokenPopup] = API_CODE.AcquireTokenPopup,\r\n _a[API_EVENT_IDENTIFIER.AcquireTokenRedirect] = API_CODE.AcquireTokenRedirect,\r\n _a[API_EVENT_IDENTIFIER.LoginPopup] = API_CODE.LoginPopup,\r\n _a[API_EVENT_IDENTIFIER.LoginRedirect] = API_CODE.LoginRedirect,\r\n _a[API_EVENT_IDENTIFIER.Logout] = API_CODE.Logout,\r\n _a);\r\nvar ApiEvent = /** @class */ (function (_super) {\r\n tslib_1.__extends(ApiEvent, _super);\r\n function ApiEvent(correlationId, piiEnabled, apiEventIdentifier) {\r\n var _this = _super.call(this, prependEventNamePrefix(\"api_event\"), correlationId, apiEventIdentifier) || this;\r\n if (apiEventIdentifier) {\r\n _this.apiCode = mapEventIdentiferToCode[apiEventIdentifier];\r\n _this.apiEventIdentifier = apiEventIdentifier;\r\n }\r\n _this.piiEnabled = piiEnabled;\r\n return _this;\r\n }\r\n Object.defineProperty(ApiEvent.prototype, \"apiEventIdentifier\", {\r\n set: function (apiEventIdentifier) {\r\n this.event[TELEMETRY_BLOB_EVENT_NAMES.ApiTelemIdConstStrKey] = apiEventIdentifier;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"apiCode\", {\r\n set: function (apiCode) {\r\n this.event[TELEMETRY_BLOB_EVENT_NAMES.ApiIdConstStrKey] = apiCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"authority\", {\r\n set: function (uri) {\r\n this.event[EVENT_KEYS.AUTHORITY] = scrubTenantFromUri(uri).toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"apiErrorCode\", {\r\n set: function (errorCode) {\r\n this.event[EVENT_KEYS.API_ERROR_CODE] = errorCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"tenantId\", {\r\n set: function (tenantId) {\r\n this.event[EVENT_KEYS.TENANT_ID] = this.piiEnabled && tenantId ?\r\n hashPersonalIdentifier(tenantId)\r\n : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"accountId\", {\r\n set: function (accountId) {\r\n this.event[EVENT_KEYS.USER_ID] = this.piiEnabled && accountId ?\r\n hashPersonalIdentifier(accountId)\r\n : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"wasSuccessful\", {\r\n get: function () {\r\n return this.event[EVENT_KEYS.WAS_SUCESSFUL] === true;\r\n },\r\n set: function (wasSuccessful) {\r\n this.event[EVENT_KEYS.WAS_SUCESSFUL] = wasSuccessful;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"loginHint\", {\r\n set: function (loginHint) {\r\n this.event[EVENT_KEYS.LOGIN_HINT] = this.piiEnabled && loginHint ?\r\n hashPersonalIdentifier(loginHint)\r\n : null;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"authorityType\", {\r\n set: function (authorityType) {\r\n this.event[EVENT_KEYS.AUTHORITY_TYPE] = authorityType.toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ApiEvent.prototype, \"promptType\", {\r\n set: function (promptType) {\r\n this.event[EVENT_KEYS.PROMPT] = promptType.toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return ApiEvent;\r\n}(TelemetryEvent));\r\nexport default ApiEvent;\r\n//# sourceMappingURL=ApiEvent.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { TENANT_PLACEHOLDER, EVENT_NAME_PREFIX } from \"./TelemetryConstants\";\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\nimport { UrlUtils } from \"../utils/UrlUtils\";\r\nimport { Authority } from \"../authority/Authority\";\r\nexport var scrubTenantFromUri = function (uri) {\r\n var url = UrlUtils.GetUrlComponents(uri);\r\n // validate trusted host\r\n if (Authority.isAdfs(uri)) {\r\n /**\r\n * returning what was passed because the library needs to work with uris that are non\r\n * AAD trusted but passed by users such as B2C or others.\r\n * HTTP Events for instance can take a url to the open id config endpoint\r\n */\r\n return uri;\r\n }\r\n var pathParams = url.PathSegments;\r\n if (pathParams && pathParams.length >= 2) {\r\n var tenantPosition = pathParams[1] === \"tfp\" ? 2 : 1;\r\n if (tenantPosition < pathParams.length) {\r\n pathParams[tenantPosition] = TENANT_PLACEHOLDER;\r\n }\r\n }\r\n return url.Protocol + \"//\" + url.HostNameAndPort + \"/\" + pathParams.join(\"/\");\r\n};\r\nexport var hashPersonalIdentifier = function (valueToHash) {\r\n /*\r\n * TODO sha256 this\r\n * Current test runner is being funny with node libs that are webpacked anyway\r\n * need a different solution\r\n */\r\n return CryptoUtils.base64Encode(valueToHash);\r\n};\r\nexport var prependEventNamePrefix = function (suffix) { return \"\" + EVENT_NAME_PREFIX + (suffix || \"\"); };\r\nexport var supportsBrowserPerformance = function () { return !!(typeof window !== \"undefined\" &&\r\n \"performance\" in window &&\r\n window.performance.mark &&\r\n window.performance.measure); };\r\nexport var endBrowserPerformanceMeasurement = function (measureName, startMark, endMark) {\r\n if (supportsBrowserPerformance()) {\r\n window.performance.mark(endMark);\r\n window.performance.measure(measureName, startMark, endMark);\r\n window.performance.clearMeasures(measureName);\r\n window.performance.clearMarks(startMark);\r\n window.performance.clearMarks(endMark);\r\n }\r\n};\r\nexport var startBrowserPerformanceMeasurement = function (startMark) {\r\n if (supportsBrowserPerformance()) {\r\n window.performance.mark(startMark);\r\n }\r\n};\r\n//# sourceMappingURL=TelemetryUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { TELEMETRY_BLOB_EVENT_NAMES, EVENT_NAME_KEY, START_TIME_KEY, ELAPSED_TIME_KEY } from \"./TelemetryConstants\";\r\nimport { prependEventNamePrefix, startBrowserPerformanceMeasurement, endBrowserPerformanceMeasurement } from \"./TelemetryUtils\";\r\nimport { CryptoUtils } from \"../utils/CryptoUtils\";\r\nvar TelemetryEvent = /** @class */ (function () {\r\n function TelemetryEvent(eventName, correlationId, eventLabel) {\r\n var _a;\r\n this.eventId = CryptoUtils.createNewGuid();\r\n this.label = eventLabel;\r\n this.event = (_a = {},\r\n _a[prependEventNamePrefix(EVENT_NAME_KEY)] = eventName,\r\n _a[prependEventNamePrefix(ELAPSED_TIME_KEY)] = -1,\r\n _a[\"\" + TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey] = correlationId,\r\n _a);\r\n }\r\n TelemetryEvent.prototype.setElapsedTime = function (time) {\r\n this.event[prependEventNamePrefix(ELAPSED_TIME_KEY)] = time;\r\n };\r\n TelemetryEvent.prototype.stop = function () {\r\n // Set duration of event\r\n this.setElapsedTime(+Date.now() - +this.startTimestamp);\r\n endBrowserPerformanceMeasurement(this.displayName, this.perfStartMark, this.perfEndMark);\r\n };\r\n TelemetryEvent.prototype.start = function () {\r\n this.startTimestamp = Date.now();\r\n this.event[prependEventNamePrefix(START_TIME_KEY)] = this.startTimestamp;\r\n startBrowserPerformanceMeasurement(this.perfStartMark);\r\n };\r\n Object.defineProperty(TelemetryEvent.prototype, \"telemetryCorrelationId\", {\r\n get: function () {\r\n return this.event[\"\" + TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey];\r\n },\r\n set: function (value) {\r\n this.event[\"\" + TELEMETRY_BLOB_EVENT_NAMES.MsalCorrelationIdConstStrKey] = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TelemetryEvent.prototype, \"eventName\", {\r\n get: function () {\r\n return this.event[prependEventNamePrefix(EVENT_NAME_KEY)];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n TelemetryEvent.prototype.get = function () {\r\n return tslib_1.__assign({}, this.event, { eventId: this.eventId });\r\n };\r\n Object.defineProperty(TelemetryEvent.prototype, \"key\", {\r\n get: function () {\r\n return this.telemetryCorrelationId + \"_\" + this.eventId + \"-\" + this.eventName;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TelemetryEvent.prototype, \"displayName\", {\r\n get: function () {\r\n return \"Msal-\" + this.label + \"-\" + this.telemetryCorrelationId;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TelemetryEvent.prototype, \"perfStartMark\", {\r\n get: function () {\r\n return \"start-\" + this.key;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TelemetryEvent.prototype, \"perfEndMark\", {\r\n get: function () {\r\n return \"end-\" + this.key;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return TelemetryEvent;\r\n}());\r\nexport default TelemetryEvent;\r\n//# sourceMappingURL=TelemetryEvent.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { TELEMETRY_BLOB_EVENT_NAMES } from \"./TelemetryConstants\";\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { prependEventNamePrefix } from \"./TelemetryUtils\";\r\nvar DefaultEvent = /** @class */ (function (_super) {\r\n tslib_1.__extends(DefaultEvent, _super);\r\n // TODO Platform Type\r\n function DefaultEvent(platform, correlationId, clientId, eventCount) {\r\n var _this = _super.call(this, prependEventNamePrefix(\"default_event\"), correlationId, \"DefaultEvent\") || this;\r\n _this.event[prependEventNamePrefix(\"client_id\")] = clientId;\r\n _this.event[prependEventNamePrefix(\"sdk_plaform\")] = platform.sdk;\r\n _this.event[prependEventNamePrefix(\"sdk_version\")] = platform.sdkVersion;\r\n _this.event[prependEventNamePrefix(\"application_name\")] = platform.applicationName;\r\n _this.event[prependEventNamePrefix(\"application_version\")] = platform.applicationVersion;\r\n _this.event[prependEventNamePrefix(\"effective_connection_speed\")] = platform.networkInformation && platform.networkInformation.connectionSpeed;\r\n _this.event[\"\" + TELEMETRY_BLOB_EVENT_NAMES.UiEventCountTelemetryBatchKey] = _this.getEventCount(prependEventNamePrefix(\"ui_event\"), eventCount);\r\n _this.event[\"\" + TELEMETRY_BLOB_EVENT_NAMES.HttpEventCountTelemetryBatchKey] = _this.getEventCount(prependEventNamePrefix(\"http_event\"), eventCount);\r\n _this.event[\"\" + TELEMETRY_BLOB_EVENT_NAMES.CacheEventCountConstStrKey] = _this.getEventCount(prependEventNamePrefix(\"cache_event\"), eventCount);\r\n return _this;\r\n // / Device id?\r\n }\r\n DefaultEvent.prototype.getEventCount = function (eventName, eventCount) {\r\n if (!eventCount[eventName]) {\r\n return 0;\r\n }\r\n return eventCount[eventName];\r\n };\r\n return DefaultEvent;\r\n}(TelemetryEvent));\r\nexport default DefaultEvent;\r\n//# sourceMappingURL=DefaultEvent.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport TelemetryEvent from \"./TelemetryEvent\";\r\nimport { scrubTenantFromUri, prependEventNamePrefix } from \"./TelemetryUtils\";\r\nimport { ServerRequestParameters } from \"../ServerRequestParameters\";\r\nexport var EVENT_KEYS = {\r\n HTTP_PATH: prependEventNamePrefix(\"http_path\"),\r\n USER_AGENT: prependEventNamePrefix(\"user_agent\"),\r\n QUERY_PARAMETERS: prependEventNamePrefix(\"query_parameters\"),\r\n API_VERSION: prependEventNamePrefix(\"api_version\"),\r\n RESPONSE_CODE: prependEventNamePrefix(\"response_code\"),\r\n O_AUTH_ERROR_CODE: prependEventNamePrefix(\"oauth_error_code\"),\r\n HTTP_METHOD: prependEventNamePrefix(\"http_method\"),\r\n REQUEST_ID_HEADER: prependEventNamePrefix(\"request_id_header\"),\r\n SPE_INFO: prependEventNamePrefix(\"spe_info\"),\r\n SERVER_ERROR_CODE: prependEventNamePrefix(\"server_error_code\"),\r\n SERVER_SUB_ERROR_CODE: prependEventNamePrefix(\"server_sub_error_code\"),\r\n URL: prependEventNamePrefix(\"url\")\r\n};\r\nvar HttpEvent = /** @class */ (function (_super) {\r\n tslib_1.__extends(HttpEvent, _super);\r\n function HttpEvent(correlationId, eventLabel) {\r\n return _super.call(this, prependEventNamePrefix(\"http_event\"), correlationId, eventLabel) || this;\r\n }\r\n Object.defineProperty(HttpEvent.prototype, \"url\", {\r\n set: function (url) {\r\n var scrubbedUri = scrubTenantFromUri(url);\r\n this.event[EVENT_KEYS.URL] = scrubbedUri && scrubbedUri.toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"httpPath\", {\r\n set: function (httpPath) {\r\n this.event[EVENT_KEYS.HTTP_PATH] = scrubTenantFromUri(httpPath).toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"userAgent\", {\r\n set: function (userAgent) {\r\n this.event[EVENT_KEYS.USER_AGENT] = userAgent;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"queryParams\", {\r\n set: function (queryParams) {\r\n this.event[EVENT_KEYS.QUERY_PARAMETERS] = ServerRequestParameters.generateQueryParametersString(queryParams);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"apiVersion\", {\r\n set: function (apiVersion) {\r\n this.event[EVENT_KEYS.API_VERSION] = apiVersion.toLowerCase();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"httpResponseStatus\", {\r\n set: function (statusCode) {\r\n this.event[EVENT_KEYS.RESPONSE_CODE] = statusCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"oAuthErrorCode\", {\r\n set: function (errorCode) {\r\n this.event[EVENT_KEYS.O_AUTH_ERROR_CODE] = errorCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"httpMethod\", {\r\n set: function (httpMethod) {\r\n this.event[EVENT_KEYS.HTTP_METHOD] = httpMethod;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"requestIdHeader\", {\r\n set: function (requestIdHeader) {\r\n this.event[EVENT_KEYS.REQUEST_ID_HEADER] = requestIdHeader;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"speInfo\", {\r\n /**\r\n * Indicates whether the request was executed on a ring serving SPE traffic.\r\n * An empty string indicates this occurred on an outer ring, and the string \"I\"\r\n * indicates the request occurred on the inner ring\r\n */\r\n set: function (speInfo) {\r\n this.event[EVENT_KEYS.SPE_INFO] = speInfo;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"serverErrorCode\", {\r\n set: function (errorCode) {\r\n this.event[EVENT_KEYS.SERVER_ERROR_CODE] = errorCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(HttpEvent.prototype, \"serverSubErrorCode\", {\r\n set: function (subErrorCode) {\r\n this.event[EVENT_KEYS.SERVER_SUB_ERROR_CODE] = subErrorCode;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return HttpEvent;\r\n}(TelemetryEvent));\r\nexport default HttpEvent;\r\n//# sourceMappingURL=HttpEvent.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport DefaultEvent from \"./DefaultEvent\";\r\nimport { Constants } from \"../utils/Constants\";\r\nimport ApiEvent from \"./ApiEvent\";\r\nimport HttpEvent from \"./HttpEvent\";\r\nimport { version as libraryVersion } from \"../packageMetadata\";\r\nvar TelemetryManager = /** @class */ (function () {\r\n function TelemetryManager(config, telemetryEmitter, logger) {\r\n // correlation Id to list of events\r\n this.completedEvents = {};\r\n // event key to event\r\n this.inProgressEvents = {};\r\n // correlation id to map of eventname to count\r\n this.eventCountByCorrelationId = {};\r\n // Implement after API EVENT\r\n this.onlySendFailureTelemetry = false;\r\n // TODO THROW if bad options\r\n this.telemetryPlatform = tslib_1.__assign({ sdk: Constants.libraryName, sdkVersion: libraryVersion, networkInformation: {\r\n // @ts-ignore\r\n connectionSpeed: typeof navigator !== \"undefined\" && navigator.connection && navigator.connection.effectiveType\r\n } }, config.platform);\r\n this.clientId = config.clientId;\r\n this.onlySendFailureTelemetry = config.onlySendFailureTelemetry;\r\n /*\r\n * TODO, when i get to wiring this through, think about what it means if\r\n * a developer does not implement telem at all, we still instrument, but telemetryEmitter can be\r\n * optional?\r\n */\r\n this.telemetryEmitter = telemetryEmitter;\r\n this.logger = logger;\r\n }\r\n TelemetryManager.getTelemetrymanagerStub = function (clientId, logger) {\r\n var applicationName = \"UnSetStub\";\r\n var applicationVersion = \"0.0\";\r\n var telemetryEmitter = function () { };\r\n var telemetryPlatform = {\r\n applicationName: applicationName,\r\n applicationVersion: applicationVersion\r\n };\r\n var telemetryManagerConfig = {\r\n platform: telemetryPlatform,\r\n clientId: clientId\r\n };\r\n return new this(telemetryManagerConfig, telemetryEmitter, logger);\r\n };\r\n TelemetryManager.prototype.startEvent = function (event) {\r\n this.logger.verbose(\"Telemetry Event started: \" + event.key);\r\n if (!this.telemetryEmitter) {\r\n return;\r\n }\r\n event.start();\r\n this.inProgressEvents[event.key] = event;\r\n };\r\n TelemetryManager.prototype.stopEvent = function (event) {\r\n this.logger.verbose(\"Telemetry Event stopped: \" + event.key);\r\n if (!this.telemetryEmitter || !this.inProgressEvents[event.key]) {\r\n return;\r\n }\r\n event.stop();\r\n this.incrementEventCount(event);\r\n var completedEvents = this.completedEvents[event.telemetryCorrelationId];\r\n this.completedEvents[event.telemetryCorrelationId] = (completedEvents || []).concat([event]);\r\n delete this.inProgressEvents[event.key];\r\n };\r\n TelemetryManager.prototype.flush = function (correlationId) {\r\n var _this = this;\r\n this.logger.verbose(\"Flushing telemetry events: \" + correlationId);\r\n // If there is only unfinished events should this still return them?\r\n if (!this.telemetryEmitter || !this.completedEvents[correlationId]) {\r\n return;\r\n }\r\n var orphanedEvents = this.getOrphanedEvents(correlationId);\r\n orphanedEvents.forEach(function (event) { return _this.incrementEventCount(event); });\r\n var eventsToFlush = this.completedEvents[correlationId].concat(orphanedEvents);\r\n delete this.completedEvents[correlationId];\r\n var eventCountsToFlush = this.eventCountByCorrelationId[correlationId];\r\n delete this.eventCountByCorrelationId[correlationId];\r\n // TODO add funcitonality for onlyFlushFailures after implementing api event? ??\r\n if (!eventsToFlush || !eventsToFlush.length) {\r\n return;\r\n }\r\n var defaultEvent = new DefaultEvent(this.telemetryPlatform, correlationId, this.clientId, eventCountsToFlush);\r\n var eventsWithDefaultEvent = eventsToFlush.concat([defaultEvent]);\r\n this.telemetryEmitter(eventsWithDefaultEvent.map(function (e) { return e.get(); }));\r\n };\r\n TelemetryManager.prototype.createAndStartApiEvent = function (correlationId, apiEventIdentifier) {\r\n var apiEvent = new ApiEvent(correlationId, this.logger.isPiiLoggingEnabled(), apiEventIdentifier);\r\n this.startEvent(apiEvent);\r\n return apiEvent;\r\n };\r\n TelemetryManager.prototype.stopAndFlushApiEvent = function (correlationId, apiEvent, wasSuccessful, errorCode) {\r\n apiEvent.wasSuccessful = wasSuccessful;\r\n if (errorCode) {\r\n apiEvent.apiErrorCode = errorCode;\r\n }\r\n this.stopEvent(apiEvent);\r\n this.flush(correlationId);\r\n };\r\n TelemetryManager.prototype.createAndStartHttpEvent = function (correlation, httpMethod, url, eventLabel) {\r\n var httpEvent = new HttpEvent(correlation, eventLabel);\r\n httpEvent.url = url;\r\n httpEvent.httpMethod = httpMethod;\r\n this.startEvent(httpEvent);\r\n return httpEvent;\r\n };\r\n TelemetryManager.prototype.incrementEventCount = function (event) {\r\n var _a;\r\n /*\r\n * TODO, name cache event different?\r\n * if type is cache event, change name\r\n */\r\n var eventName = event.eventName;\r\n var eventCount = this.eventCountByCorrelationId[event.telemetryCorrelationId];\r\n if (!eventCount) {\r\n this.eventCountByCorrelationId[event.telemetryCorrelationId] = (_a = {},\r\n _a[eventName] = 1,\r\n _a);\r\n }\r\n else {\r\n eventCount[eventName] = eventCount[eventName] ? eventCount[eventName] + 1 : 1;\r\n }\r\n };\r\n TelemetryManager.prototype.getOrphanedEvents = function (correlationId) {\r\n var _this = this;\r\n return Object.keys(this.inProgressEvents)\r\n .reduce(function (memo, eventKey) {\r\n if (eventKey.indexOf(correlationId) !== -1) {\r\n var event_1 = _this.inProgressEvents[eventKey];\r\n delete _this.inProgressEvents[eventKey];\r\n return memo.concat([event_1]);\r\n }\r\n return memo;\r\n }, []);\r\n };\r\n return TelemetryManager;\r\n}());\r\nexport default TelemetryManager;\r\n//# sourceMappingURL=TelemetryManager.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport { ScopeSet } from \"../ScopeSet\";\r\nimport { UrlUtils } from \"./UrlUtils\";\r\n/**\r\n * @hidden\r\n */\r\nvar AuthCacheUtils = /** @class */ (function () {\r\n function AuthCacheUtils() {\r\n }\r\n AuthCacheUtils.filterTokenCacheItemsByScope = function (tokenCacheItems, requestScopes) {\r\n return tokenCacheItems.filter(function (cacheItem) {\r\n var cachedScopes = cacheItem.key.scopes.split(\" \");\r\n var searchScopes = ScopeSet.removeDefaultScopes(requestScopes);\r\n // If requestScopes contain only default scopes search for default scopes otherwise search for everything but default scopes\r\n return searchScopes.length === 0 ? ScopeSet.containsScope(cachedScopes, requestScopes) : ScopeSet.containsScope(cachedScopes, searchScopes);\r\n });\r\n };\r\n AuthCacheUtils.filterTokenCacheItemsByAuthority = function (tokenCacheItems, authority) {\r\n return tokenCacheItems.filter(function (cacheItem) { return UrlUtils.CanonicalizeUri(cacheItem.key.authority) === authority; });\r\n };\r\n AuthCacheUtils.filterTokenCacheItemsByDomain = function (tokenCacheItems, requestDomain) {\r\n return tokenCacheItems.filter(function (cacheItem) {\r\n var cacheItemDomain = UrlUtils.GetUrlComponents(cacheItem.key.authority).HostNameAndPort;\r\n return cacheItemDomain === requestDomain;\r\n });\r\n };\r\n return AuthCacheUtils;\r\n}());\r\nexport { AuthCacheUtils };\r\n//# sourceMappingURL=AuthCacheUtils.js.map","/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { AccessTokenKey } from \"./cache/AccessTokenKey\";\r\nimport { AccessTokenValue } from \"./cache/AccessTokenValue\";\r\nimport { ServerRequestParameters } from \"./ServerRequestParameters\";\r\nimport { AuthorityType } from \"./authority/Authority\";\r\nimport { ClientInfo } from \"./ClientInfo\";\r\nimport { IdToken } from \"./IdToken\";\r\nimport { AuthCache } from \"./cache/AuthCache\";\r\nimport { Account } from \"./Account\";\r\nimport { ScopeSet } from \"./ScopeSet\";\r\nimport { StringUtils } from \"./utils/StringUtils\";\r\nimport { WindowUtils } from \"./utils/WindowUtils\";\r\nimport { TokenUtils } from \"./utils/TokenUtils\";\r\nimport { TimeUtils } from \"./utils/TimeUtils\";\r\nimport { UrlUtils } from \"./utils/UrlUtils\";\r\nimport { RequestUtils } from \"./utils/RequestUtils\";\r\nimport { ResponseUtils } from \"./utils/ResponseUtils\";\r\nimport { AuthorityFactory } from \"./authority/AuthorityFactory\";\r\nimport { buildConfiguration } from \"./Configuration\";\r\nimport { ClientConfigurationError } from \"./error/ClientConfigurationError\";\r\nimport { AuthError } from \"./error/AuthError\";\r\nimport { ClientAuthError, ClientAuthErrorMessage } from \"./error/ClientAuthError\";\r\nimport { ServerError } from \"./error/ServerError\";\r\nimport { InteractionRequiredAuthError } from \"./error/InteractionRequiredAuthError\";\r\nimport { buildResponseStateOnly } from \"./AuthResponse\";\r\nimport TelemetryManager from \"./telemetry/TelemetryManager\";\r\nimport { API_EVENT_IDENTIFIER } from \"./telemetry/ApiEvent\";\r\nimport { Constants, ServerHashParamKeys, ResponseTypes, TemporaryCacheKeys, PersistentCacheKeys, ErrorCacheKeys, FramePrefix } from \"./utils/Constants\";\r\nimport { CryptoUtils } from \"./utils/CryptoUtils\";\r\nimport { TrustedAuthority } from \"./authority/TrustedAuthority\";\r\nimport { AuthCacheUtils } from \"./utils/AuthCacheUtils\";\r\n// default authority\r\nvar DEFAULT_AUTHORITY = \"https://login.microsoftonline.com/common\";\r\n/**\r\n * UserAgentApplication class\r\n *\r\n * Object Instance that the developer can use to make loginXX OR acquireTokenXX functions\r\n */\r\nvar UserAgentApplication = /** @class */ (function () {\r\n /**\r\n * @constructor\r\n * Constructor for the UserAgentApplication used to instantiate the UserAgentApplication object\r\n *\r\n * Important attributes in the Configuration object for auth are:\r\n * - clientID: the application ID of your application.\r\n * 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 *\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 *\r\n * In Azure B2C, authority is of the form https://<instance>/tfp/<tenant>/<policyName>/\r\n *\r\n * @param {@link (Configuration:type)} configuration object for the MSAL UserAgentApplication instance\r\n */\r\n function UserAgentApplication(configuration) {\r\n // callbacks for token/error\r\n this.authResponseCallback = null;\r\n this.tokenReceivedCallback = null;\r\n this.errorReceivedCallback = null;\r\n // Set the Configuration\r\n this.config = buildConfiguration(configuration);\r\n this.logger = this.config.system.logger;\r\n this.clientId = this.config.auth.clientId;\r\n this.inCookie = this.config.cache.storeAuthStateInCookie;\r\n this.telemetryManager = this.getTelemetryManagerFromConfig(this.config.system.telemetry, this.clientId);\r\n TrustedAuthority.setTrustedAuthoritiesFromConfig(this.config.auth.validateAuthority, this.config.auth.knownAuthorities);\r\n AuthorityFactory.saveMetadataFromConfig(this.config.auth.authority, this.config.auth.authorityMetadata);\r\n // if no authority is passed, set the default: \"https://login.microsoftonline.com/common\"\r\n this.authority = this.config.auth.authority || DEFAULT_AUTHORITY;\r\n // cache keys msal - typescript throws an error if any value other than \"localStorage\" or \"sessionStorage\" is passed\r\n this.cacheStorage = new AuthCache(this.clientId, this.config.cache.cacheLocation, this.inCookie);\r\n // Initialize window handling code\r\n window.activeRenewals = {};\r\n window.renewStates = [];\r\n window.callbackMappedToRenewStates = {};\r\n window.promiseMappedToRenewStates = {};\r\n window.msal = this;\r\n var urlHash = window.location.hash;\r\n var urlContainsHash = UrlUtils.urlContainsHash(urlHash);\r\n // check if back button is pressed\r\n WindowUtils.checkIfBackButtonIsPressed(this.cacheStorage);\r\n // On the server 302 - Redirect, handle this\r\n if (urlContainsHash) {\r\n var stateInfo = this.getResponseState(urlHash);\r\n if (stateInfo.method === Constants.interactionTypeRedirect) {\r\n this.handleRedirectAuthenticationResponse(urlHash);\r\n }\r\n }\r\n }\r\n Object.defineProperty(UserAgentApplication.prototype, \"authority\", {\r\n /**\r\n * Method to manage the authority URL.\r\n *\r\n * @returns {string} authority\r\n */\r\n get: function () {\r\n return this.authorityInstance.CanonicalAuthority;\r\n },\r\n /**\r\n * setter for the authority URL\r\n * @param {string} authority\r\n */\r\n // If the developer passes an authority, create an instance\r\n set: function (val) {\r\n this.authorityInstance = AuthorityFactory.CreateInstance(val, this.config.auth.validateAuthority);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Get the current authority instance from the MSAL configuration object\r\n *\r\n * @returns {@link Authority} authority instance\r\n */\r\n UserAgentApplication.prototype.getAuthorityInstance = function () {\r\n return this.authorityInstance;\r\n };\r\n UserAgentApplication.prototype.handleRedirectCallback = function (authOrTokenCallback, errorReceivedCallback) {\r\n if (!authOrTokenCallback) {\r\n throw ClientConfigurationError.createInvalidCallbackObjectError(authOrTokenCallback);\r\n }\r\n // Set callbacks\r\n if (errorReceivedCallback) {\r\n this.tokenReceivedCallback = authOrTokenCallback;\r\n this.errorReceivedCallback = errorReceivedCallback;\r\n this.logger.warning(\"This overload for callback is deprecated - please change the format of the callbacks to a single callback as shown: (err: AuthError, response: AuthResponse).\");\r\n }\r\n else {\r\n this.authResponseCallback = authOrTokenCallback;\r\n }\r\n if (this.redirectError) {\r\n this.authErrorHandler(Constants.interactionTypeRedirect, this.redirectError, this.redirectResponse);\r\n }\r\n else if (this.redirectResponse) {\r\n this.authResponseHandler(Constants.interactionTypeRedirect, this.redirectResponse);\r\n }\r\n };\r\n /**\r\n * Public API to verify if the URL contains the hash with known properties\r\n * @param hash\r\n */\r\n UserAgentApplication.prototype.urlContainsHash = function (hash) {\r\n this.logger.verbose(\"UrlContainsHash has been called\");\r\n return UrlUtils.urlContainsHash(hash);\r\n };\r\n UserAgentApplication.prototype.authResponseHandler = function (interactionType, response, resolve) {\r\n this.logger.verbose(\"AuthResponseHandler has been called\");\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n this.logger.verbose(\"Interaction type is redirect\");\r\n if (this.errorReceivedCallback) {\r\n this.logger.verbose(\"Two callbacks were provided to handleRedirectCallback, calling success callback with response\");\r\n this.tokenReceivedCallback(response);\r\n }\r\n else if (this.authResponseCallback) {\r\n this.logger.verbose(\"One callback was provided to handleRedirectCallback, calling authResponseCallback with response\");\r\n this.authResponseCallback(null, response);\r\n }\r\n }\r\n else if (interactionType === Constants.interactionTypePopup) {\r\n this.logger.verbose(\"Interaction type is popup, resolving\");\r\n resolve(response);\r\n }\r\n else {\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n };\r\n UserAgentApplication.prototype.authErrorHandler = function (interactionType, authErr, response, reject) {\r\n this.logger.verbose(\"AuthErrorHandler has been called\");\r\n // set interaction_status to complete\r\n this.cacheStorage.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n this.logger.verbose(\"Interaction type is redirect\");\r\n if (this.errorReceivedCallback) {\r\n this.logger.verbose(\"Two callbacks were provided to handleRedirectCallback, calling error callback\");\r\n this.errorReceivedCallback(authErr, response.accountState);\r\n }\r\n else if (this.authResponseCallback) {\r\n this.logger.verbose(\"One callback was provided to handleRedirectCallback, calling authResponseCallback with error\");\r\n this.authResponseCallback(authErr, response);\r\n }\r\n else {\r\n this.logger.verbose(\"handleRedirectCallback has not been called and no callbacks are registered, throwing error\");\r\n throw authErr;\r\n }\r\n }\r\n else if (interactionType === Constants.interactionTypePopup) {\r\n this.logger.verbose(\"Interaction type is popup, rejecting\");\r\n reject(authErr);\r\n }\r\n else {\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n };\r\n // #endregion\r\n /**\r\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint.\r\n * @param {@link (AuthenticationParameters:type)}\r\n */\r\n UserAgentApplication.prototype.loginRedirect = function (userRequest) {\r\n this.logger.verbose(\"LoginRedirect has been called\");\r\n // validate request\r\n var request = RequestUtils.validateRequest(userRequest, true, this.clientId, Constants.interactionTypeRedirect);\r\n this.acquireTokenInteractive(Constants.interactionTypeRedirect, true, request, null, null);\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.\r\n * @param {@link (AuthenticationParameters:type)}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n */\r\n UserAgentApplication.prototype.acquireTokenRedirect = function (userRequest) {\r\n this.logger.verbose(\"AcquireTokenRedirect has been called\");\r\n // validate request\r\n var request = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypeRedirect);\r\n this.acquireTokenInteractive(Constants.interactionTypeRedirect, false, request, null, null);\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 {@link (AuthenticationParameters:type)}\r\n *\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 UserAgentApplication.prototype.loginPopup = function (userRequest) {\r\n var _this = this;\r\n this.logger.verbose(\"LoginPopup has been called\");\r\n // validate request\r\n var request = RequestUtils.validateRequest(userRequest, true, this.clientId, Constants.interactionTypePopup);\r\n var apiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.LoginPopup);\r\n return new Promise(function (resolve, reject) {\r\n _this.acquireTokenInteractive(Constants.interactionTypePopup, true, request, resolve, reject);\r\n })\r\n .then(function (resp) {\r\n _this.logger.verbose(\"Successfully logged in\");\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return resp;\r\n })\r\n .catch(function (error) {\r\n _this.cacheStorage.resetTempCacheItems(request.state);\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n };\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 * @param {@link AuthenticationParameters}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\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 UserAgentApplication.prototype.acquireTokenPopup = function (userRequest) {\r\n var _this = this;\r\n this.logger.verbose(\"AcquireTokenPopup has been called\");\r\n // validate request\r\n var request = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypePopup);\r\n var apiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.AcquireTokenPopup);\r\n return new Promise(function (resolve, reject) {\r\n _this.acquireTokenInteractive(Constants.interactionTypePopup, false, request, resolve, reject);\r\n })\r\n .then(function (resp) {\r\n _this.logger.verbose(\"Successfully acquired token\");\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return resp;\r\n })\r\n .catch(function (error) {\r\n _this.cacheStorage.resetTempCacheItems(request.state);\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n };\r\n // #region Acquire Token\r\n /**\r\n * Use when initiating the login process or when you want to obtain an access_token for your API,\r\n * either by redirecting the user's browser window to the authorization endpoint or via opening a popup window in the user's browser.\r\n * @param {@link (AuthenticationParameters:type)}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\r\n */\r\n UserAgentApplication.prototype.acquireTokenInteractive = function (interactionType, isLoginCall, request, resolve, reject) {\r\n var _this = this;\r\n this.logger.verbose(\"AcquireTokenInteractive has been called\");\r\n // block the request if made from the hidden iframe\r\n WindowUtils.blockReloadInHiddenIframes();\r\n var interactionProgress = this.cacheStorage.getItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n this.cacheStorage.setItem(TemporaryCacheKeys.REDIRECT_REQUEST, \"\" + Constants.inProgress + Constants.resourceDelimiter + request.state);\r\n }\r\n // If already in progress, do not proceed\r\n if (interactionProgress === Constants.inProgress) {\r\n var thrownError = isLoginCall ? ClientAuthError.createLoginInProgressError() : ClientAuthError.createAcquireTokenInProgressError();\r\n var stateOnlyResponse = buildResponseStateOnly(this.getAccountState(request.state));\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType, thrownError, stateOnlyResponse, reject);\r\n return;\r\n }\r\n // Get the account object if a session exists\r\n var account;\r\n if (request && request.account && !isLoginCall) {\r\n account = request.account;\r\n this.logger.verbose(\"Account set from request\");\r\n }\r\n else {\r\n account = this.getAccount();\r\n this.logger.verbose(\"Account set from MSAL Cache\");\r\n }\r\n // If no session exists, prompt the user to login.\r\n if (!account && !ServerRequestParameters.isSSOParam(request)) {\r\n if (isLoginCall) {\r\n // extract ADAL id_token if exists\r\n var adalIdToken = this.extractADALIdToken();\r\n // silent login if ADAL id_token is retrieved successfully - SSO\r\n if (adalIdToken && !request.scopes) {\r\n this.logger.info(\"ADAL's idToken exists. Extracting login information from ADAL's idToken\");\r\n var tokenRequest = this.buildIDTokenRequest(request);\r\n this.silentLogin = true;\r\n this.acquireTokenSilent(tokenRequest).then(function (response) {\r\n _this.silentLogin = false;\r\n _this.logger.info(\"Unified cache call is successful\");\r\n _this.authResponseHandler(interactionType, response, resolve);\r\n return;\r\n }, function (error) {\r\n _this.silentLogin = false;\r\n _this.logger.error(\"Error occurred during unified cache ATS: \" + error);\r\n // proceed to login since ATS failed\r\n _this.acquireTokenHelper(null, interactionType, isLoginCall, request, resolve, reject);\r\n });\r\n }\r\n // No ADAL token found, proceed to login\r\n else {\r\n this.logger.verbose(\"Login call but no token found, proceed to login\");\r\n this.acquireTokenHelper(null, interactionType, isLoginCall, request, resolve, reject);\r\n }\r\n }\r\n // AcquireToken call, but no account or context given, so throw error\r\n else {\r\n this.logger.verbose(\"AcquireToken call, no context or account given\");\r\n this.logger.info(\"User login is required\");\r\n var stateOnlyResponse = buildResponseStateOnly(this.getAccountState(request.state));\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType, ClientAuthError.createUserLoginRequiredError(), stateOnlyResponse, reject);\r\n return;\r\n }\r\n }\r\n // User session exists\r\n else {\r\n this.logger.verbose(\"User session exists, login not required\");\r\n this.acquireTokenHelper(account, interactionType, isLoginCall, request, resolve, reject);\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n * Helper function to acquireToken\r\n *\r\n */\r\n UserAgentApplication.prototype.acquireTokenHelper = function (account, interactionType, isLoginCall, request, resolve, reject) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var requestSignature, serverAuthenticationRequest, acquireTokenAuthority, popUpWindow, responseType, loginStartPage, urlNavigate, hash, error_1, navigate, err_1;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n this.logger.verbose(\"AcquireTokenHelper has been called\");\r\n this.logger.verbose(\"Interaction type: \" + interactionType + \". isLoginCall: \" + isLoginCall);\r\n // Track the acquireToken progress\r\n this.cacheStorage.setItem(TemporaryCacheKeys.INTERACTION_STATUS, Constants.inProgress);\r\n requestSignature = request.scopes ? request.scopes.join(\" \").toLowerCase() : Constants.oidcScopes.join(\" \");\r\n this.logger.verbosePii(\"Request signature: \" + requestSignature);\r\n acquireTokenAuthority = (request && request.authority) ? AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata) : this.authorityInstance;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 11, , 12]);\r\n if (!!acquireTokenAuthority.hasCachedMetadata()) return [3 /*break*/, 3];\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n return [4 /*yield*/, AuthorityFactory.saveMetadataFromNetwork(acquireTokenAuthority, this.telemetryManager, request.correlationId)];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n _a.label = 4;\r\n case 4:\r\n responseType = isLoginCall ? ResponseTypes.id_token : this.getTokenType(account, request.scopes);\r\n loginStartPage = request.redirectStartPage || window.location.href;\r\n serverAuthenticationRequest = new ServerRequestParameters(acquireTokenAuthority, this.clientId, responseType, this.getRedirectUri(request && request.redirectUri), request.scopes, request.state, request.correlationId);\r\n this.logger.verbose(\"Finished building server authentication request\");\r\n this.updateCacheEntries(serverAuthenticationRequest, account, isLoginCall, loginStartPage);\r\n this.logger.verbose(\"Updating cache entries\");\r\n // populate QueryParameters (sid/login_hint) and any other extraQueryParameters set by the developer\r\n serverAuthenticationRequest.populateQueryParams(account, request);\r\n this.logger.verbose(\"Query parameters populated from account\");\r\n urlNavigate = UrlUtils.createNavigateUrl(serverAuthenticationRequest) + Constants.response_mode_fragment;\r\n // set state in cache\r\n if (interactionType === Constants.interactionTypeRedirect) {\r\n if (!isLoginCall) {\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, request.state), serverAuthenticationRequest.state, this.inCookie);\r\n this.logger.verbose(\"State cached for redirect\");\r\n this.logger.verbosePii(\"State cached: \" + serverAuthenticationRequest.state);\r\n }\r\n else {\r\n this.logger.verbose(\"Interaction type redirect but login call is true. State not cached\");\r\n }\r\n }\r\n else if (interactionType === Constants.interactionTypePopup) {\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n window.requestType = isLoginCall ? Constants.login : Constants.renewToken;\r\n this.logger.verbose(\"State saved to window\");\r\n this.logger.verbosePii(\"State saved: \" + serverAuthenticationRequest.state);\r\n // Register callback to capture results from server\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n }\r\n else {\r\n this.logger.verbose(\"Invalid interaction error. State not cached\");\r\n throw ClientAuthError.createInvalidInteractionTypeError();\r\n }\r\n if (!(interactionType === Constants.interactionTypePopup)) return [3 /*break*/, 9];\r\n this.logger.verbose(\"Interaction type is popup. Generating popup window\");\r\n // Generate a popup window\r\n try {\r\n popUpWindow = this.openPopup(urlNavigate, \"msal\", Constants.popUpWidth, Constants.popUpHeight);\r\n // Push popup window handle onto stack for tracking\r\n WindowUtils.trackPopup(popUpWindow);\r\n }\r\n catch (e) {\r\n this.logger.info(ClientAuthErrorMessage.popUpWindowError.code + \":\" + ClientAuthErrorMessage.popUpWindowError.desc);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, ClientAuthErrorMessage.popUpWindowError.code);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, ClientAuthErrorMessage.popUpWindowError.desc);\r\n if (reject) {\r\n reject(ClientAuthError.createPopupWindowError());\r\n return [2 /*return*/];\r\n }\r\n }\r\n if (!popUpWindow) return [3 /*break*/, 8];\r\n _a.label = 5;\r\n case 5:\r\n _a.trys.push([5, 7, , 8]);\r\n return [4 /*yield*/, WindowUtils.monitorPopupForHash(popUpWindow, this.config.system.loadFrameTimeout, urlNavigate, this.logger)];\r\n case 6:\r\n hash = _a.sent();\r\n this.handleAuthenticationResponse(hash);\r\n // Request completed successfully, set to completed\r\n this.cacheStorage.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n this.logger.info(\"Closing popup window\");\r\n // TODO: Check how this can be extracted for any framework specific code?\r\n if (this.config.framework.isAngular) {\r\n this.broadcast(\"msal:popUpHashChanged\", hash);\r\n }\r\n WindowUtils.closePopups();\r\n return [3 /*break*/, 8];\r\n case 7:\r\n error_1 = _a.sent();\r\n if (reject) {\r\n reject(error_1);\r\n }\r\n if (this.config.framework.isAngular) {\r\n this.broadcast(\"msal:popUpClosed\", error_1.errorCode + Constants.resourceDelimiter + error_1.errorMessage);\r\n }\r\n else {\r\n // Request failed, set to canceled\r\n this.cacheStorage.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n popUpWindow.close();\r\n }\r\n return [3 /*break*/, 8];\r\n case 8: return [3 /*break*/, 10];\r\n case 9:\r\n // If onRedirectNavigate is implemented, invoke it and provide urlNavigate\r\n if (request.onRedirectNavigate) {\r\n this.logger.verbose(\"Invoking onRedirectNavigate callback\");\r\n navigate = request.onRedirectNavigate(urlNavigate);\r\n // Returning false from onRedirectNavigate will stop navigation\r\n if (navigate !== false) {\r\n this.logger.verbose(\"onRedirectNavigate did not return false, navigating\");\r\n this.navigateWindow(urlNavigate);\r\n }\r\n else {\r\n this.logger.verbose(\"onRedirectNavigate returned false, stopping navigation\");\r\n }\r\n }\r\n else {\r\n // Otherwise, perform navigation\r\n this.logger.verbose(\"Navigating window to urlNavigate\");\r\n this.navigateWindow(urlNavigate);\r\n }\r\n _a.label = 10;\r\n case 10: return [3 /*break*/, 12];\r\n case 11:\r\n err_1 = _a.sent();\r\n this.logger.error(err_1);\r\n this.cacheStorage.resetTempCacheItems(request.state);\r\n this.authErrorHandler(interactionType, ClientAuthError.createEndpointResolutionError(err_1.toString), buildResponseStateOnly(request.state), reject);\r\n if (popUpWindow) {\r\n popUpWindow.close();\r\n }\r\n return [3 /*break*/, 12];\r\n case 12: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * API interfacing idToken request when applications already have a session/hint acquired by authorization client applications\r\n * @param request\r\n */\r\n UserAgentApplication.prototype.ssoSilent = function (request) {\r\n this.logger.verbose(\"ssoSilent has been called\");\r\n // throw an error on an empty request\r\n if (!request) {\r\n throw ClientConfigurationError.createEmptyRequestError();\r\n }\r\n // throw an error on no hints passed\r\n if (!request.sid && !request.loginHint) {\r\n throw ClientConfigurationError.createSsoSilentError();\r\n }\r\n return this.acquireTokenSilent(tslib_1.__assign({}, request, { scopes: Constants.oidcScopes }));\r\n };\r\n /**\r\n * Use this function to obtain a token before every call to the API / resource provider\r\n *\r\n * MSAL return's a cached token when available\r\n * Or it send's a request to the STS to obtain a new token using a hidden iframe.\r\n *\r\n * @param {@link AuthenticationParameters}\r\n *\r\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\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 */\r\n UserAgentApplication.prototype.acquireTokenSilent = function (userRequest) {\r\n var _this = this;\r\n this.logger.verbose(\"AcquireTokenSilent has been called\");\r\n // validate the request\r\n var request = RequestUtils.validateRequest(userRequest, false, this.clientId, Constants.interactionTypeSilent);\r\n var apiEvent = this.telemetryManager.createAndStartApiEvent(request.correlationId, API_EVENT_IDENTIFIER.AcquireTokenSilent);\r\n var requestSignature = RequestUtils.createRequestSignature(request);\r\n return new Promise(function (resolve, reject) { return tslib_1.__awaiter(_this, void 0, void 0, function () {\r\n var scope, account, adalIdToken, responseType, serverAuthenticationRequest, adalIdTokenObject, userContainedClaims, authErr, cacheResultResponse, logMessage, err_2;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n // block the request if made from the hidden iframe\r\n WindowUtils.blockReloadInHiddenIframes();\r\n scope = request.scopes.join(\" \").toLowerCase();\r\n this.logger.verbosePii(\"Serialized scopes: \" + scope);\r\n if (request.account) {\r\n account = request.account;\r\n this.logger.verbose(\"Account set from request\");\r\n }\r\n else {\r\n account = this.getAccount();\r\n this.logger.verbose(\"Account set from MSAL Cache\");\r\n }\r\n adalIdToken = this.cacheStorage.getItem(Constants.adalIdToken);\r\n // In the event of no account being passed in the config, no session id, and no pre-existing adalIdToken, user will need to log in\r\n if (!account && !(request.sid || request.loginHint) && StringUtils.isEmpty(adalIdToken)) {\r\n this.logger.info(\"User login is required\");\r\n // The promise rejects with a UserLoginRequiredError, which should be caught and user should be prompted to log in interactively\r\n return [2 /*return*/, reject(ClientAuthError.createUserLoginRequiredError())];\r\n }\r\n responseType = this.getTokenType(account, request.scopes);\r\n this.logger.verbose(\"Response type: \" + responseType);\r\n serverAuthenticationRequest = new ServerRequestParameters(AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata), this.clientId, responseType, this.getRedirectUri(request.redirectUri), request.scopes, request.state, request.correlationId);\r\n this.logger.verbose(\"Finished building server authentication request\");\r\n // populate QueryParameters (sid/login_hint) and any other extraQueryParameters set by the developer\r\n if (ServerRequestParameters.isSSOParam(request) || account) {\r\n serverAuthenticationRequest.populateQueryParams(account, request, null, true);\r\n this.logger.verbose(\"Query parameters populated from existing SSO or account\");\r\n }\r\n // if user didn't pass login_hint/sid and adal's idtoken is present, extract the login_hint from the adalIdToken\r\n else if (!account && !StringUtils.isEmpty(adalIdToken)) {\r\n adalIdTokenObject = TokenUtils.extractIdToken(adalIdToken);\r\n this.logger.verbose(\"ADAL's idToken exists. Extracting login information from ADAL's idToken to populate query parameters\");\r\n serverAuthenticationRequest.populateQueryParams(account, null, adalIdTokenObject, true);\r\n }\r\n else {\r\n this.logger.verbose(\"No additional query parameters added\");\r\n }\r\n userContainedClaims = request.claimsRequest || serverAuthenticationRequest.claimsValue;\r\n // If request.forceRefresh is set to true, force a request for a new token instead of getting it from the cache\r\n if (!userContainedClaims && !request.forceRefresh) {\r\n try {\r\n cacheResultResponse = this.getCachedToken(serverAuthenticationRequest, account);\r\n }\r\n catch (e) {\r\n authErr = e;\r\n }\r\n }\r\n if (!cacheResultResponse) return [3 /*break*/, 1];\r\n this.logger.verbose(\"Token found in cache lookup\");\r\n this.logger.verbosePii(\"Scopes found: \" + JSON.stringify(cacheResultResponse.scopes));\r\n resolve(cacheResultResponse);\r\n return [2 /*return*/, null];\r\n case 1:\r\n if (!authErr) return [3 /*break*/, 2];\r\n this.logger.infoPii(authErr.errorCode + \":\" + authErr.errorMessage);\r\n reject(authErr);\r\n return [2 /*return*/, null];\r\n case 2:\r\n logMessage = void 0;\r\n if (userContainedClaims) {\r\n logMessage = \"Skipped cache lookup since claims were given\";\r\n }\r\n else if (request.forceRefresh) {\r\n logMessage = \"Skipped cache lookup since request.forceRefresh option was set to true\";\r\n }\r\n else {\r\n logMessage = \"No valid token found in cache lookup\";\r\n }\r\n this.logger.verbose(logMessage);\r\n // Cache result can return null if cache is empty. In that case, set authority to default value if no authority is passed to the API.\r\n if (!serverAuthenticationRequest.authorityInstance) {\r\n serverAuthenticationRequest.authorityInstance = request.authority ?\r\n AuthorityFactory.CreateInstance(request.authority, this.config.auth.validateAuthority, request.authorityMetadata)\r\n : this.authorityInstance;\r\n }\r\n this.logger.verbosePii(\"Authority instance: \" + serverAuthenticationRequest.authority);\r\n _a.label = 3;\r\n case 3:\r\n _a.trys.push([3, 7, , 8]);\r\n if (!!serverAuthenticationRequest.authorityInstance.hasCachedMetadata()) return [3 /*break*/, 5];\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n return [4 /*yield*/, AuthorityFactory.saveMetadataFromNetwork(serverAuthenticationRequest.authorityInstance, this.telemetryManager, request.correlationId)];\r\n case 4:\r\n _a.sent();\r\n this.logger.verbose(\"Authority has been updated with endpoint discovery response\");\r\n return [3 /*break*/, 6];\r\n case 5:\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n _a.label = 6;\r\n case 6:\r\n /*\r\n * refresh attempt with iframe\r\n * Already renewing for this scope, callback when we get the token.\r\n */\r\n if (window.activeRenewals[requestSignature]) {\r\n this.logger.verbose(\"Renewing token in progress. Registering callback\");\r\n // Active renewals contains the state for each renewal.\r\n this.registerCallback(window.activeRenewals[requestSignature], requestSignature, resolve, reject);\r\n }\r\n else {\r\n if (request.scopes && ScopeSet.onlyContainsOidcScopes(request.scopes)) {\r\n /*\r\n * App uses idToken to send to api endpoints\r\n * Default scope is tracked as OIDC scopes to store this token\r\n */\r\n this.logger.verbose(\"OpenID Connect scopes only, renewing idToken\");\r\n this.silentLogin = true;\r\n this.renewIdToken(requestSignature, resolve, reject, account, serverAuthenticationRequest);\r\n }\r\n else {\r\n // renew access token\r\n this.logger.verbose(\"Renewing access token\");\r\n this.renewToken(requestSignature, resolve, reject, account, serverAuthenticationRequest);\r\n }\r\n }\r\n return [3 /*break*/, 8];\r\n case 7:\r\n err_2 = _a.sent();\r\n this.logger.error(err_2);\r\n reject(ClientAuthError.createEndpointResolutionError(err_2.toString()));\r\n return [2 /*return*/, null];\r\n case 8: return [2 /*return*/];\r\n }\r\n });\r\n }); })\r\n .then(function (res) {\r\n _this.logger.verbose(\"Successfully acquired token\");\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, true);\r\n return res;\r\n })\r\n .catch(function (error) {\r\n _this.cacheStorage.resetTempCacheItems(request.state);\r\n _this.telemetryManager.stopAndFlushApiEvent(request.correlationId, apiEvent, false, error.errorCode);\r\n throw error;\r\n });\r\n };\r\n // #endregion\r\n // #region Popup Window Creation\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 * @ignore\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.openPopup = function (urlNavigate, title, popUpWidth, popUpHeight) {\r\n this.logger.verbose(\"OpenPopup has been called\");\r\n try {\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 width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\r\n var height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\r\n var left = ((width / 2) - (popUpWidth / 2)) + winLeft;\r\n var top_1 = ((height / 2) - (popUpHeight / 2)) + winTop;\r\n // open the window\r\n var popupWindow = window.open(urlNavigate, title, \"width=\" + popUpWidth + \", height=\" + popUpHeight + \", top=\" + top_1 + \", left=\" + left + \", scrollbars=yes\");\r\n if (!popupWindow) {\r\n throw ClientAuthError.createPopupWindowError();\r\n }\r\n if (popupWindow.focus) {\r\n popupWindow.focus();\r\n }\r\n return popupWindow;\r\n }\r\n catch (e) {\r\n this.cacheStorage.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n throw ClientAuthError.createPopupWindowError(e.toString());\r\n }\r\n };\r\n // #endregion\r\n // #region Iframe Management\r\n /**\r\n * @hidden\r\n * Calling _loadFrame but with a timeout to signal failure in loadframeStatus. Callbacks are left.\r\n * registered when network errors occur and subsequent token requests for same resource are registered to the pending request.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.loadIframeTimeout = function (urlNavigate, frameName, requestSignature) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var expectedState, iframe, _a, hash, error_2;\r\n return tslib_1.__generator(this, function (_b) {\r\n switch (_b.label) {\r\n case 0:\r\n expectedState = window.activeRenewals[requestSignature];\r\n this.logger.verbosePii(\"Set loading state to pending for: \" + requestSignature + \":\" + expectedState);\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState), Constants.inProgress);\r\n if (!this.config.system.navigateFrameWait) return [3 /*break*/, 2];\r\n return [4 /*yield*/, WindowUtils.loadFrame(urlNavigate, frameName, this.config.system.navigateFrameWait, this.logger)];\r\n case 1:\r\n _a = _b.sent();\r\n return [3 /*break*/, 3];\r\n case 2:\r\n _a = WindowUtils.loadFrameSync(urlNavigate, frameName, this.logger);\r\n _b.label = 3;\r\n case 3:\r\n iframe = _a;\r\n _b.label = 4;\r\n case 4:\r\n _b.trys.push([4, 6, , 7]);\r\n return [4 /*yield*/, WindowUtils.monitorIframeForHash(iframe.contentWindow, this.config.system.loadFrameTimeout, urlNavigate, this.logger)];\r\n case 5:\r\n hash = _b.sent();\r\n if (hash) {\r\n this.handleAuthenticationResponse(hash);\r\n }\r\n return [3 /*break*/, 7];\r\n case 6:\r\n error_2 = _b.sent();\r\n if (this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState)) === Constants.inProgress) {\r\n // fail the iframe session if it's in pending state\r\n this.logger.verbose(\"Loading frame has timed out after: \" + (this.config.system.loadFrameTimeout / 1000) + \" seconds for scope/authority \" + requestSignature + \":\" + expectedState);\r\n // Error after timeout\r\n if (expectedState && window.callbackMappedToRenewStates[expectedState]) {\r\n window.callbackMappedToRenewStates[expectedState](null, error_2);\r\n }\r\n this.cacheStorage.removeItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, expectedState));\r\n }\r\n WindowUtils.removeHiddenIframe(iframe);\r\n throw error_2;\r\n case 7:\r\n WindowUtils.removeHiddenIframe(iframe);\r\n return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n // #endregion\r\n // #region General Helpers\r\n /**\r\n * @hidden\r\n * Used to redirect the browser to the STS authorization endpoint\r\n * @param {string} urlNavigate - URL of the authorization endpoint\r\n */\r\n UserAgentApplication.prototype.navigateWindow = function (urlNavigate, popupWindow) {\r\n // Navigate if valid URL\r\n if (urlNavigate && !StringUtils.isEmpty(urlNavigate)) {\r\n var navigateWindow = popupWindow ? popupWindow : window;\r\n var logMessage = popupWindow ? \"Navigated Popup window to:\" + urlNavigate : \"Navigate to:\" + urlNavigate;\r\n this.logger.infoPii(logMessage);\r\n navigateWindow.location.assign(urlNavigate);\r\n }\r\n else {\r\n this.logger.info(\"Navigate url is empty\");\r\n throw AuthError.createUnexpectedError(\"Navigate url is empty\");\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * Used to add the developer requested callback to the array of callbacks for the specified scopes. The updated array is stored on the window object\r\n * @param {string} expectedState - Unique state identifier (guid).\r\n * @param {string} scope - Developer requested permissions. Not all scopes are guaranteed to be included in the access token returned.\r\n * @param {Function} resolve - The resolve function of the promise object.\r\n * @param {Function} reject - The reject function of the promise object.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.registerCallback = function (expectedState, requestSignature, resolve, reject) {\r\n var _this = this;\r\n // track active renewals\r\n window.activeRenewals[requestSignature] = expectedState;\r\n // initialize callbacks mapped array\r\n if (!window.promiseMappedToRenewStates[expectedState]) {\r\n window.promiseMappedToRenewStates[expectedState] = [];\r\n }\r\n // indexing on the current state, push the callback params to callbacks mapped\r\n window.promiseMappedToRenewStates[expectedState].push({ resolve: resolve, reject: reject });\r\n // Store the server response in the current window??\r\n if (!window.callbackMappedToRenewStates[expectedState]) {\r\n window.callbackMappedToRenewStates[expectedState] = function (response, error) {\r\n // reset active renewals\r\n window.activeRenewals[requestSignature] = null;\r\n // for all promiseMappedtoRenewStates for a given 'state' - call the reject/resolve with error/token respectively\r\n for (var i = 0; i < window.promiseMappedToRenewStates[expectedState].length; ++i) {\r\n try {\r\n if (error) {\r\n window.promiseMappedToRenewStates[expectedState][i].reject(error);\r\n }\r\n else if (response) {\r\n window.promiseMappedToRenewStates[expectedState][i].resolve(response);\r\n }\r\n else {\r\n _this.cacheStorage.resetTempCacheItems(expectedState);\r\n throw AuthError.createUnexpectedError(\"Error and response are both null\");\r\n }\r\n }\r\n catch (e) {\r\n _this.logger.warning(e);\r\n }\r\n }\r\n // reset\r\n window.promiseMappedToRenewStates[expectedState] = null;\r\n window.callbackMappedToRenewStates[expectedState] = null;\r\n };\r\n }\r\n };\r\n // #endregion\r\n // #region Logout\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 */\r\n UserAgentApplication.prototype.logout = function (correlationId) {\r\n this.logger.verbose(\"Logout has been called\");\r\n this.logoutAsync(correlationId);\r\n };\r\n /**\r\n * Async version of logout(). Use to log out the current user.\r\n * @param correlationId Request correlationId\r\n */\r\n UserAgentApplication.prototype.logoutAsync = function (correlationId) {\r\n return tslib_1.__awaiter(this, void 0, void 0, function () {\r\n var requestCorrelationId, apiEvent, correlationIdParam, postLogoutQueryParam, urlNavigate, error_3;\r\n return tslib_1.__generator(this, function (_a) {\r\n switch (_a.label) {\r\n case 0:\r\n requestCorrelationId = correlationId || CryptoUtils.createNewGuid();\r\n apiEvent = this.telemetryManager.createAndStartApiEvent(requestCorrelationId, API_EVENT_IDENTIFIER.Logout);\r\n this.clearCache();\r\n this.account = null;\r\n _a.label = 1;\r\n case 1:\r\n _a.trys.push([1, 5, , 6]);\r\n if (!!this.authorityInstance.hasCachedMetadata()) return [3 /*break*/, 3];\r\n this.logger.verbose(\"No cached metadata for authority\");\r\n return [4 /*yield*/, AuthorityFactory.saveMetadataFromNetwork(this.authorityInstance, this.telemetryManager, correlationId)];\r\n case 2:\r\n _a.sent();\r\n return [3 /*break*/, 4];\r\n case 3:\r\n this.logger.verbose(\"Cached metadata found for authority\");\r\n _a.label = 4;\r\n case 4:\r\n correlationIdParam = \"client-request-id=\" + requestCorrelationId;\r\n postLogoutQueryParam = void 0;\r\n if (this.getPostLogoutRedirectUri()) {\r\n postLogoutQueryParam = \"&post_logout_redirect_uri=\" + encodeURIComponent(this.getPostLogoutRedirectUri());\r\n this.logger.verbose(\"redirectUri found and set\");\r\n }\r\n else {\r\n postLogoutQueryParam = \"\";\r\n this.logger.verbose(\"No redirectUri set for app. postLogoutQueryParam is empty\");\r\n }\r\n urlNavigate = void 0;\r\n if (this.authorityInstance.EndSessionEndpoint) {\r\n urlNavigate = this.authorityInstance.EndSessionEndpoint + \"?\" + correlationIdParam + postLogoutQueryParam;\r\n this.logger.verbose(\"EndSessionEndpoint found and urlNavigate set\");\r\n this.logger.verbosePii(\"urlNavigate set to: \" + this.authorityInstance.EndSessionEndpoint);\r\n }\r\n else {\r\n urlNavigate = this.authority + \"oauth2/v2.0/logout?\" + correlationIdParam + postLogoutQueryParam;\r\n this.logger.verbose(\"No endpoint, urlNavigate set to default\");\r\n }\r\n this.telemetryManager.stopAndFlushApiEvent(requestCorrelationId, apiEvent, true);\r\n this.logger.verbose(\"Navigating window to urlNavigate\");\r\n this.navigateWindow(urlNavigate);\r\n return [3 /*break*/, 6];\r\n case 5:\r\n error_3 = _a.sent();\r\n this.telemetryManager.stopAndFlushApiEvent(requestCorrelationId, apiEvent, false, error_3.errorCode);\r\n return [3 /*break*/, 6];\r\n case 6: return [2 /*return*/];\r\n }\r\n });\r\n });\r\n };\r\n /**\r\n * @hidden\r\n * Clear all access tokens and ID tokens in the cache.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.clearCache = function () {\r\n this.logger.verbose(\"Clearing cache\");\r\n window.renewStates = [];\r\n var tokenCacheItems = this.cacheStorage.getAllTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n for (var i = 0; i < tokenCacheItems.length; i++) {\r\n this.cacheStorage.removeItem(JSON.stringify(tokenCacheItems[i].key));\r\n }\r\n this.cacheStorage.resetCacheItems();\r\n this.cacheStorage.clearMsalCookie();\r\n this.logger.verbose(\"Cache cleared\");\r\n };\r\n /**\r\n * @hidden\r\n * Clear a given access token from the cache.\r\n *\r\n * @param accessToken\r\n */\r\n UserAgentApplication.prototype.clearCacheForScope = function (accessToken) {\r\n this.logger.verbose(\"Clearing access token from cache\");\r\n var accessTokenItems = this.cacheStorage.getAllAccessTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n for (var i = 0; i < accessTokenItems.length; i++) {\r\n var token = accessTokenItems[i];\r\n if (token.value.accessToken === accessToken) {\r\n this.cacheStorage.removeItem(JSON.stringify(token.key));\r\n this.logger.verbosePii(\"Access token removed: \" + token.key);\r\n }\r\n }\r\n };\r\n // #endregion\r\n // #region Response\r\n /**\r\n * @hidden\r\n * @ignore\r\n * Checks if the redirect response is received from the STS. In case of redirect, the url fragment has either id_token, access_token or error.\r\n * @param {string} hash - Hash passed from redirect page.\r\n * @returns {Boolean} - true if response contains id_token, access_token or error, false otherwise.\r\n */\r\n UserAgentApplication.prototype.isCallback = function (hash) {\r\n this.logger.info(\"isCallback will be deprecated in favor of urlContainsHash in MSAL.js v2.0.\");\r\n this.logger.verbose(\"isCallback has been called\");\r\n return UrlUtils.urlContainsHash(hash);\r\n };\r\n /**\r\n * @hidden\r\n * Used to call the constructor callback with the token/error\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n UserAgentApplication.prototype.processCallBack = function (hash, stateInfo, parentCallback) {\r\n this.logger.info(\"ProcessCallBack has been called. Processing callback from redirect response\");\r\n // get the state info from the hash\r\n if (!stateInfo) {\r\n this.logger.verbose(\"StateInfo is null, getting stateInfo from hash\");\r\n stateInfo = this.getResponseState(hash);\r\n }\r\n var response;\r\n var authErr;\r\n // Save the token info from the hash\r\n try {\r\n response = this.saveTokenFromHash(hash, stateInfo);\r\n }\r\n catch (err) {\r\n authErr = err;\r\n }\r\n try {\r\n // Clear the cookie in the hash\r\n this.cacheStorage.clearMsalCookie(stateInfo.state);\r\n var accountState = this.getAccountState(stateInfo.state);\r\n if (response) {\r\n if ((stateInfo.requestType === Constants.renewToken) || response.accessToken) {\r\n if (window.parent !== window) {\r\n this.logger.verbose(\"Window is in iframe, acquiring token silently\");\r\n }\r\n else {\r\n this.logger.verbose(\"Acquiring token interactive in progress\");\r\n }\r\n this.logger.verbose(\"Response tokenType set to \" + ServerHashParamKeys.ACCESS_TOKEN);\r\n response.tokenType = ServerHashParamKeys.ACCESS_TOKEN;\r\n }\r\n else if (stateInfo.requestType === Constants.login) {\r\n this.logger.verbose(\"Response tokenType set to \" + ServerHashParamKeys.ID_TOKEN);\r\n response.tokenType = ServerHashParamKeys.ID_TOKEN;\r\n }\r\n if (!parentCallback) {\r\n this.logger.verbose(\"Setting redirectResponse\");\r\n this.redirectResponse = response;\r\n return;\r\n }\r\n }\r\n else if (!parentCallback) {\r\n this.logger.verbose(\"Response is null, setting redirectResponse with state\");\r\n this.redirectResponse = buildResponseStateOnly(accountState);\r\n this.redirectError = authErr;\r\n this.cacheStorage.resetTempCacheItems(stateInfo.state);\r\n return;\r\n }\r\n this.logger.verbose(\"Calling callback provided to processCallback\");\r\n parentCallback(response, authErr);\r\n }\r\n catch (err) {\r\n this.logger.error(\"Error occurred in token received callback function: \" + err);\r\n throw ClientAuthError.createErrorInCallbackFunction(err.toString());\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * This method must be called for processing the response received from the STS if using popups or iframes. It extracts the hash, processes the token or error\r\n * information and saves it in the cache. It then resolves the promises with the result.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n UserAgentApplication.prototype.handleAuthenticationResponse = function (hash) {\r\n this.logger.verbose(\"HandleAuthenticationResponse has been called\");\r\n // retrieve the hash\r\n var locationHash = hash || window.location.hash;\r\n // if (window.parent !== window), by using self, window.parent becomes equal to window in getResponseState method specifically\r\n var stateInfo = this.getResponseState(locationHash);\r\n this.logger.verbose(\"Obtained state from response\");\r\n var tokenResponseCallback = window.callbackMappedToRenewStates[stateInfo.state];\r\n this.processCallBack(locationHash, stateInfo, tokenResponseCallback);\r\n };\r\n /**\r\n * @hidden\r\n * This method must be called for processing the response received from the STS when using redirect flows. It extracts the hash, processes the token or error\r\n * information and saves it in the cache. The result can then be accessed by user registered callbacks.\r\n * @param {string} [hash=window.location.hash] - Hash fragment of Url.\r\n */\r\n UserAgentApplication.prototype.handleRedirectAuthenticationResponse = function (hash) {\r\n this.logger.info(\"Returned from redirect url\");\r\n this.logger.verbose(\"HandleRedirectAuthenticationResponse has been called\");\r\n // clear hash from window\r\n WindowUtils.clearUrlFragment();\r\n this.logger.verbose(\"Window.location.hash cleared\");\r\n // if (window.parent !== window), by using self, window.parent becomes equal to window in getResponseState method specifically\r\n var stateInfo = this.getResponseState(hash);\r\n // if set to navigate to loginRequest page post login\r\n if (this.config.auth.navigateToLoginRequestUrl && window.parent === window) {\r\n this.logger.verbose(\"Window.parent is equal to window, not in popup or iframe. Navigation to login request url after login turned on\");\r\n var loginRequestUrl = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, stateInfo.state), this.inCookie);\r\n // Redirect to home page if login request url is null (real null or the string null)\r\n if (!loginRequestUrl || loginRequestUrl === \"null\") {\r\n this.logger.error(\"Unable to get valid login request url from cache, redirecting to home page\");\r\n window.location.assign(\"/\");\r\n return;\r\n }\r\n else {\r\n this.logger.verbose(\"Valid login request url obtained from cache\");\r\n var currentUrl = UrlUtils.removeHashFromUrl(window.location.href);\r\n var finalRedirectUrl = UrlUtils.removeHashFromUrl(loginRequestUrl);\r\n if (currentUrl !== finalRedirectUrl) {\r\n this.logger.verbose(\"Current url is not login request url, navigating\");\r\n this.logger.verbosePii(\"CurrentUrl: \" + currentUrl + \", finalRedirectUrl: \" + finalRedirectUrl);\r\n window.location.assign(\"\" + finalRedirectUrl + hash);\r\n return;\r\n }\r\n else {\r\n this.logger.verbose(\"Current url matches login request url\");\r\n var loginRequestUrlComponents = UrlUtils.GetUrlComponents(loginRequestUrl);\r\n if (loginRequestUrlComponents.Hash) {\r\n this.logger.verbose(\"Login request url contains hash, resetting non-msal hash\");\r\n window.location.hash = loginRequestUrlComponents.Hash;\r\n }\r\n }\r\n }\r\n }\r\n else if (!this.config.auth.navigateToLoginRequestUrl) {\r\n this.logger.verbose(\"Default navigation to start page after login turned off\");\r\n }\r\n this.processCallBack(hash, stateInfo, null);\r\n };\r\n /**\r\n * @hidden\r\n * Creates a stateInfo object from the URL fragment and returns it.\r\n * @param {string} hash - Hash passed from redirect page\r\n * @returns {TokenResponse} an object created from the redirect response from AAD comprising of the keys - parameters, requestType, stateMatch, stateResponse and valid.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.getResponseState = function (hash) {\r\n this.logger.verbose(\"GetResponseState has been called\");\r\n var parameters = UrlUtils.deserializeHash(hash);\r\n var stateResponse;\r\n if (!parameters) {\r\n throw AuthError.createUnexpectedError(\"Hash was not parsed correctly.\");\r\n }\r\n if (parameters.hasOwnProperty(ServerHashParamKeys.STATE)) {\r\n this.logger.verbose(\"Hash contains state. Creating stateInfo object\");\r\n var parsedState = RequestUtils.parseLibraryState(parameters.state);\r\n stateResponse = {\r\n requestType: Constants.unknown,\r\n state: parameters.state,\r\n timestamp: parsedState.ts,\r\n method: parsedState.method,\r\n stateMatch: false\r\n };\r\n }\r\n else {\r\n throw AuthError.createUnexpectedError(\"Hash does not contain state.\");\r\n }\r\n /*\r\n * async calls can fire iframe and login request at the same time if developer does not use the API as expected\r\n * incoming callback needs to be looked up to find the request type\r\n */\r\n // loginRedirect\r\n if (stateResponse.state === this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, stateResponse.state), this.inCookie) || stateResponse.state === this.silentAuthenticationState) {\r\n this.logger.verbose(\"State matches cached state, setting requestType to login\");\r\n stateResponse.requestType = Constants.login;\r\n stateResponse.stateMatch = true;\r\n return stateResponse;\r\n }\r\n // acquireTokenRedirect\r\n else if (stateResponse.state === this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_ACQ_TOKEN, stateResponse.state), this.inCookie)) {\r\n this.logger.verbose(\"State matches cached state, setting requestType to renewToken\");\r\n stateResponse.requestType = Constants.renewToken;\r\n stateResponse.stateMatch = true;\r\n return stateResponse;\r\n }\r\n // external api requests may have many renewtoken requests for different resource\r\n if (!stateResponse.stateMatch) {\r\n this.logger.verbose(\"State does not match cached state, setting requestType to type from window\");\r\n stateResponse.requestType = window.requestType;\r\n var statesInParentContext = window.renewStates;\r\n for (var i = 0; i < statesInParentContext.length; i++) {\r\n if (statesInParentContext[i] === stateResponse.state) {\r\n this.logger.verbose(\"Matching state found for request\");\r\n stateResponse.stateMatch = true;\r\n break;\r\n }\r\n }\r\n if (!stateResponse.stateMatch) {\r\n this.logger.verbose(\"Matching state not found for request\");\r\n }\r\n }\r\n return stateResponse;\r\n };\r\n // #endregion\r\n // #region Token Processing (Extract to TokenProcessing.ts)\r\n /**\r\n * @hidden\r\n * Used to get token for the specified set of scopes from the cache\r\n * @param {@link ServerRequestParameters} - Request sent to the STS to obtain an id_token/access_token\r\n * @param {Account} account - Account for which the scopes were requested\r\n */\r\n UserAgentApplication.prototype.getCachedToken = function (serverAuthenticationRequest, account) {\r\n this.logger.verbose(\"GetCachedToken has been called\");\r\n var scopes = serverAuthenticationRequest.scopes;\r\n /**\r\n * Id Token should be returned in every acquireTokenSilent call. The only exception is a response_type = token\r\n * request when a valid ID Token is not present in the cache.\r\n */\r\n var idToken = this.getCachedIdToken(serverAuthenticationRequest, account);\r\n var authResponse = this.getCachedAccessToken(serverAuthenticationRequest, account, scopes);\r\n var accountState = this.getAccountState(serverAuthenticationRequest.state);\r\n return ResponseUtils.buildAuthResponse(idToken, authResponse, serverAuthenticationRequest, account, scopes, accountState);\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Uses passed in authority to further filter an array of tokenCacheItems until only the token being searched for remains, then returns that tokenCacheItem.\r\n * This method will throw if authority filtering still yields multiple matching tokens and will return null if not tokens match the authority passed in.\r\n *\r\n * @param authority\r\n * @param tokenCacheItems\r\n * @param request\r\n * @param requestScopes\r\n * @param tokenType\r\n */\r\n UserAgentApplication.prototype.getTokenCacheItemByAuthority = function (authority, tokenCacheItems, requestScopes, tokenType) {\r\n var _this = this;\r\n var filteredAuthorityItems;\r\n if (UrlUtils.isCommonAuthority(authority) || UrlUtils.isOrganizationsAuthority(authority)) {\r\n filteredAuthorityItems = AuthCacheUtils.filterTokenCacheItemsByDomain(tokenCacheItems, UrlUtils.GetUrlComponents(authority).HostNameAndPort);\r\n }\r\n else {\r\n filteredAuthorityItems = AuthCacheUtils.filterTokenCacheItemsByAuthority(tokenCacheItems, authority);\r\n }\r\n if (filteredAuthorityItems.length === 1) {\r\n return filteredAuthorityItems[0];\r\n }\r\n else if (filteredAuthorityItems.length > 1) {\r\n this.logger.warning(\"Multiple matching tokens found. Cleaning cache and requesting a new token.\");\r\n filteredAuthorityItems.forEach(function (accessTokenCacheItem) {\r\n _this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n });\r\n return null;\r\n }\r\n else {\r\n this.logger.verbose(\"No matching tokens of type \" + tokenType + \" found\");\r\n return null;\r\n }\r\n };\r\n /**\r\n *\r\n * @hidden\r\n *\r\n * Searches the token cache for an ID Token that matches the request parameter and returns it as an IdToken object.\r\n *\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n */\r\n UserAgentApplication.prototype.getCachedIdToken = function (serverAuthenticationRequest, account) {\r\n this.logger.verbose(\"Getting all cached tokens of type ID Token\");\r\n var idTokenCacheItems = this.cacheStorage.getAllIdTokens(this.clientId, account ? account.homeAccountIdentifier : null);\r\n var matchAuthority = serverAuthenticationRequest.authority || this.authority;\r\n var idTokenCacheItem = this.getTokenCacheItemByAuthority(matchAuthority, idTokenCacheItems, null, ServerHashParamKeys.ID_TOKEN);\r\n if (idTokenCacheItem) {\r\n this.logger.verbose(\"Evaluating ID token found\");\r\n var idTokenIsStillValid = this.evaluateTokenExpiration(idTokenCacheItem);\r\n if (idTokenIsStillValid) {\r\n this.logger.verbose(\"ID token expiration is within offset, using ID token found in cache\");\r\n var idTokenValue = idTokenCacheItem.value;\r\n if (idTokenValue) {\r\n this.logger.verbose(\"ID Token found in cache is valid and unexpired\");\r\n }\r\n else {\r\n this.logger.verbose(\"ID Token found in cache is invalid\");\r\n }\r\n return (idTokenValue) ? new IdToken(idTokenValue.idToken) : null;\r\n }\r\n else {\r\n this.logger.verbose(\"Cached ID token is expired, removing from cache\");\r\n this.cacheStorage.removeItem(JSON.stringify(idTokenCacheItem.key));\r\n return null;\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"No tokens found\");\r\n return null;\r\n }\r\n };\r\n /**\r\n *\r\n * @hidden\r\n *\r\n * Searches the token cache for an access token that matches the request parameters and returns it as an AuthResponse.\r\n *\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n * @param scopes\r\n */\r\n UserAgentApplication.prototype.getCachedAccessToken = function (serverAuthenticationRequest, account, scopes) {\r\n this.logger.verbose(\"Getting all cached tokens of type Access Token\");\r\n var tokenCacheItems = this.cacheStorage.getAllAccessTokens(this.clientId, account ? account.homeAccountIdentifier : null);\r\n var scopeFilteredTokenCacheItems = AuthCacheUtils.filterTokenCacheItemsByScope(tokenCacheItems, scopes);\r\n var matchAuthority = serverAuthenticationRequest.authority || this.authority;\r\n // serverAuthenticationRequest.authority can only be common or organizations if not null\r\n var accessTokenCacheItem = this.getTokenCacheItemByAuthority(matchAuthority, scopeFilteredTokenCacheItems, scopes, ServerHashParamKeys.ACCESS_TOKEN);\r\n if (!accessTokenCacheItem) {\r\n this.logger.verbose(\"No matching token found when filtering by scope and authority\");\r\n var authorityList = this.getUniqueAuthority(tokenCacheItems, \"authority\");\r\n if (authorityList.length > 1) {\r\n throw ClientAuthError.createMultipleAuthoritiesInCacheError(scopes.toString());\r\n }\r\n this.logger.verbose(\"Single authority used, setting authorityInstance\");\r\n serverAuthenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(authorityList[0], this.config.auth.validateAuthority);\r\n return null;\r\n }\r\n else {\r\n serverAuthenticationRequest.authorityInstance = AuthorityFactory.CreateInstance(accessTokenCacheItem.key.authority, this.config.auth.validateAuthority);\r\n this.logger.verbose(\"Evaluating access token found\");\r\n var tokenIsStillValid = this.evaluateTokenExpiration(accessTokenCacheItem);\r\n // The response value will stay null if token retrieved from the cache is expired, otherwise it will be populated with said token's data\r\n if (tokenIsStillValid) {\r\n this.logger.verbose(\"Access token expiration is within offset, using access token found in cache\");\r\n if (!account) {\r\n account = this.getAccount();\r\n if (!account) {\r\n throw AuthError.createUnexpectedError(\"Account should not be null here.\");\r\n }\r\n }\r\n var aState = this.getAccountState(serverAuthenticationRequest.state);\r\n var response = {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: ServerHashParamKeys.ACCESS_TOKEN,\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: accessTokenCacheItem.value.accessToken,\r\n scopes: accessTokenCacheItem.key.scopes.split(\" \"),\r\n expiresOn: new Date(Number(accessTokenCacheItem.value.expiresIn) * 1000),\r\n account: account,\r\n accountState: aState,\r\n fromCache: true\r\n };\r\n return response;\r\n }\r\n else {\r\n this.logger.verbose(\"Access token expired, removing from cache\");\r\n this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n return null;\r\n }\r\n }\r\n };\r\n /**\r\n * Returns true if the token passed in is within the acceptable expiration time offset, false if it is expired.\r\n * @param tokenCacheItem\r\n * @param serverAuthenticationRequest\r\n */\r\n UserAgentApplication.prototype.evaluateTokenExpiration = function (tokenCacheItem) {\r\n var expiration = Number(tokenCacheItem.value.expiresIn);\r\n return TokenUtils.validateExpirationIsWithinOffset(expiration, this.config.system.tokenRenewalOffsetSeconds);\r\n };\r\n /**\r\n * @hidden\r\n * Used to get a unique list of authorities from the cache\r\n * @param {Array} accessTokenCacheItems - accessTokenCacheItems saved in the cache\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.getUniqueAuthority = function (accessTokenCacheItems, property) {\r\n this.logger.verbose(\"GetUniqueAuthority has been called\");\r\n var authorityList = [];\r\n var flags = [];\r\n accessTokenCacheItems.forEach(function (element) {\r\n if (element.key.hasOwnProperty(property) && (flags.indexOf(element.key[property]) === -1)) {\r\n flags.push(element.key[property]);\r\n authorityList.push(element.key[property]);\r\n }\r\n });\r\n return authorityList;\r\n };\r\n /**\r\n * @hidden\r\n * Check if ADAL id_token exists and return if exists.\r\n *\r\n */\r\n UserAgentApplication.prototype.extractADALIdToken = function () {\r\n this.logger.verbose(\"ExtractADALIdToken has been called\");\r\n var adalIdToken = this.cacheStorage.getItem(Constants.adalIdToken);\r\n return (!StringUtils.isEmpty(adalIdToken)) ? TokenUtils.extractIdToken(adalIdToken) : null;\r\n };\r\n /**\r\n * @hidden\r\n * Acquires access token using a hidden iframe.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.renewToken = function (requestSignature, resolve, reject, account, serverAuthenticationRequest) {\r\n this.logger.verbose(\"RenewToken has been called\");\r\n this.logger.verbosePii(\"RenewToken scope and authority: \" + requestSignature);\r\n var frameName = WindowUtils.generateFrameName(FramePrefix.TOKEN_FRAME, requestSignature);\r\n WindowUtils.addHiddenIFrame(frameName, this.logger);\r\n this.updateCacheEntries(serverAuthenticationRequest, account, false);\r\n this.logger.verbosePii(\"RenewToken expected state: \" + serverAuthenticationRequest.state);\r\n // Build urlNavigate with \"prompt=none\" and navigate to URL in hidden iFrame\r\n var urlNavigate = UrlUtils.urlRemoveQueryStringParameter(UrlUtils.createNavigateUrl(serverAuthenticationRequest), Constants.prompt) + Constants.prompt_none + Constants.response_mode_fragment;\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n window.requestType = Constants.renewToken;\r\n this.logger.verbose(\"Set window.renewState and requestType\");\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n this.logger.infoPii(\"Navigate to: \" + urlNavigate);\r\n this.loadIframeTimeout(urlNavigate, frameName, requestSignature).catch(function (error) { return reject(error); });\r\n };\r\n /**\r\n * @hidden\r\n * Renews idtoken for app's own backend when clientId is passed as a single scope in the scopes array.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.renewIdToken = function (requestSignature, resolve, reject, account, serverAuthenticationRequest) {\r\n this.logger.info(\"RenewIdToken has been called\");\r\n var frameName = WindowUtils.generateFrameName(FramePrefix.ID_TOKEN_FRAME, requestSignature);\r\n WindowUtils.addHiddenIFrame(frameName, this.logger);\r\n this.updateCacheEntries(serverAuthenticationRequest, account, false);\r\n this.logger.verbose(\"RenewIdToken expected state: \" + serverAuthenticationRequest.state);\r\n // Build urlNavigate with \"prompt=none\" and navigate to URL in hidden iFrame\r\n var urlNavigate = UrlUtils.urlRemoveQueryStringParameter(UrlUtils.createNavigateUrl(serverAuthenticationRequest), Constants.prompt) + Constants.prompt_none + Constants.response_mode_fragment;\r\n if (this.silentLogin) {\r\n this.logger.verbose(\"Silent login is true, set silentAuthenticationState\");\r\n window.requestType = Constants.login;\r\n this.silentAuthenticationState = serverAuthenticationRequest.state;\r\n }\r\n else {\r\n this.logger.verbose(\"Not silent login, set window.renewState and requestType\");\r\n window.requestType = Constants.renewToken;\r\n window.renewStates.push(serverAuthenticationRequest.state);\r\n }\r\n // note: scope here is clientId\r\n this.registerCallback(serverAuthenticationRequest.state, requestSignature, resolve, reject);\r\n this.logger.infoPii(\"Navigate to:\\\" \" + urlNavigate);\r\n this.loadIframeTimeout(urlNavigate, frameName, requestSignature).catch(function (error) { return reject(error); });\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * This method builds an Access Token Cache item and saves it to the cache, returning the original\r\n * AuthResponse augmented with a parsed expiresOn attribute.\r\n *\r\n * @param response The AuthResponse object that contains the token to be saved\r\n * @param authority The authority under which the ID token will be cached\r\n * @param scopes The scopes to be added to the cache item key (undefined for ID token cache items)\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n * @param expiration Token expiration timestamp\r\n */\r\n UserAgentApplication.prototype.saveToken = function (response, authority, scopes, clientInfo, expiration) {\r\n var accessTokenKey = new AccessTokenKey(authority, this.clientId, scopes, clientInfo.uid, clientInfo.utid);\r\n var accessTokenValue = new AccessTokenValue(response.accessToken, response.idToken.rawIdToken, expiration.toString(), clientInfo.encodeClientInfo());\r\n this.cacheStorage.setItem(JSON.stringify(accessTokenKey), JSON.stringify(accessTokenValue));\r\n if (expiration) {\r\n this.logger.verbose(\"New expiration set for token\");\r\n response.expiresOn = new Date(expiration * 1000);\r\n }\r\n else {\r\n this.logger.error(\"Could not parse expiresIn parameter for access token\");\r\n }\r\n return response;\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * This method sets up the elements of an ID Token cache item and calls saveToken to save it in\r\n * Access Token Cache item format for the client application to use.\r\n *\r\n * @param response The AuthResponse object that will be used to build the cache item\r\n * @param authority The authority under which the ID token will be cached\r\n * @param parameters The response's Hash Params, which contain the ID token returned from the server\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n * @param idTokenObj ID Token object from which the ID token's expiration is extracted\r\n */\r\n /* tslint:disable:no-string-literal */\r\n UserAgentApplication.prototype.saveIdToken = function (response, authority, parameters, clientInfo, idTokenObj) {\r\n this.logger.verbose(\"SaveIdToken has been called\");\r\n var idTokenResponse = tslib_1.__assign({}, response);\r\n // Scopes are undefined so they don't show up in ID token cache key\r\n var scopes;\r\n idTokenResponse.scopes = Constants.oidcScopes;\r\n idTokenResponse.accessToken = parameters[ServerHashParamKeys.ID_TOKEN];\r\n var expiration = Number(idTokenObj.expiration);\r\n // Set ID Token item in cache\r\n this.logger.verbose(\"Saving ID token to cache\");\r\n return this.saveToken(idTokenResponse, authority, scopes, clientInfo, expiration);\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * This method sets up the elements of an Access Token cache item and calls saveToken to save it to the cache\r\n *\r\n * @param response The AuthResponse object that will be used to build the cache item\r\n * @param authority The authority under which the access token will be cached\r\n * @param parameters The response's Hash Params, which contain the access token returned from the server\r\n * @param clientInfo Client Info object that is used to generate the homeAccountIdentifier\r\n */\r\n /* tslint:disable:no-string-literal */\r\n UserAgentApplication.prototype.saveAccessToken = function (response, authority, parameters, clientInfo) {\r\n this.logger.verbose(\"SaveAccessToken has been called\");\r\n var accessTokenResponse = tslib_1.__assign({}, response);\r\n // read the scopes\r\n var scope = parameters[ServerHashParamKeys.SCOPE];\r\n var consentedScopes = scope.split(\" \");\r\n // retrieve all access tokens from the cache, remove the dup scopes\r\n var accessTokenCacheItems = this.cacheStorage.getAllAccessTokens(this.clientId, authority);\r\n this.logger.verbose(\"Retrieving all access tokens from cache and removing duplicates\");\r\n for (var i = 0; i < accessTokenCacheItems.length; i++) {\r\n var accessTokenCacheItem = accessTokenCacheItems[i];\r\n if (accessTokenCacheItem.key.homeAccountIdentifier === response.account.homeAccountIdentifier) {\r\n var cachedScopes = accessTokenCacheItem.key.scopes.split(\" \");\r\n if (ScopeSet.isIntersectingScopes(cachedScopes, consentedScopes)) {\r\n this.cacheStorage.removeItem(JSON.stringify(accessTokenCacheItem.key));\r\n }\r\n }\r\n }\r\n accessTokenResponse.accessToken = parameters[ServerHashParamKeys.ACCESS_TOKEN];\r\n accessTokenResponse.scopes = consentedScopes;\r\n var expiresIn = TimeUtils.parseExpiresIn(parameters[ServerHashParamKeys.EXPIRES_IN]);\r\n var parsedState = RequestUtils.parseLibraryState(parameters[ServerHashParamKeys.STATE]);\r\n var expiration = parsedState.ts + expiresIn;\r\n this.logger.verbose(\"Saving access token to cache\");\r\n return this.saveToken(accessTokenResponse, authority, scope, clientInfo, expiration);\r\n };\r\n /**\r\n * @hidden\r\n * Saves token or error received in the response from AAD in the cache. In case of id_token, it also creates the account object.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.saveTokenFromHash = function (hash, stateInfo) {\r\n this.logger.verbose(\"SaveTokenFromHash has been called\");\r\n this.logger.info(\"State status: \" + stateInfo.stateMatch + \"; Request type: \" + stateInfo.requestType);\r\n var response = {\r\n uniqueId: \"\",\r\n tenantId: \"\",\r\n tokenType: \"\",\r\n idToken: null,\r\n idTokenClaims: null,\r\n accessToken: null,\r\n scopes: [],\r\n expiresOn: null,\r\n account: null,\r\n accountState: \"\",\r\n fromCache: false\r\n };\r\n var error;\r\n var hashParams = UrlUtils.deserializeHash(hash);\r\n var authorityKey = \"\";\r\n var acquireTokenAccountKey = \"\";\r\n var idTokenObj = null;\r\n // If server returns an error\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ERROR_DESCRIPTION) || hashParams.hasOwnProperty(ServerHashParamKeys.ERROR)) {\r\n this.logger.verbose(\"Server returned an error\");\r\n this.logger.infoPii(\"Error : \" + hashParams[ServerHashParamKeys.ERROR] + \"; Error description: \" + hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, hashParams[ServerHashParamKeys.ERROR]);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n // login\r\n if (stateInfo.requestType === Constants.login) {\r\n this.logger.verbose(\"RequestType is login, caching login error, generating authorityKey\");\r\n this.cacheStorage.setItem(ErrorCacheKeys.LOGIN_ERROR, hashParams[ServerHashParamKeys.ERROR_DESCRIPTION] + \":\" + hashParams[ServerHashParamKeys.ERROR]);\r\n authorityKey = AuthCache.generateAuthorityKey(stateInfo.state);\r\n }\r\n // acquireToken\r\n if (stateInfo.requestType === Constants.renewToken) {\r\n this.logger.verbose(\"RequestType is renewToken, generating acquireTokenAccountKey\");\r\n authorityKey = AuthCache.generateAuthorityKey(stateInfo.state);\r\n var account = this.getAccount();\r\n var accountId = void 0;\r\n if (account && !StringUtils.isEmpty(account.homeAccountIdentifier)) {\r\n accountId = account.homeAccountIdentifier;\r\n this.logger.verbose(\"AccountId is set\");\r\n }\r\n else {\r\n accountId = Constants.no_account;\r\n this.logger.verbose(\"AccountId is set as no_account\");\r\n }\r\n acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountId, stateInfo.state);\r\n }\r\n var _a = ServerHashParamKeys.ERROR, hashErr = hashParams[_a], _b = ServerHashParamKeys.ERROR_DESCRIPTION, hashErrDesc = hashParams[_b];\r\n if (InteractionRequiredAuthError.isInteractionRequiredError(hashErr) ||\r\n InteractionRequiredAuthError.isInteractionRequiredError(hashErrDesc)) {\r\n error = new InteractionRequiredAuthError(hashParams[ServerHashParamKeys.ERROR], hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n }\r\n else {\r\n error = new ServerError(hashParams[ServerHashParamKeys.ERROR], hashParams[ServerHashParamKeys.ERROR_DESCRIPTION]);\r\n }\r\n }\r\n // If the server returns \"Success\"\r\n else {\r\n this.logger.verbose(\"Server returns success\");\r\n // Verify the state from redirect and record tokens to storage if exists\r\n if (stateInfo.stateMatch) {\r\n this.logger.info(\"State is right\");\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.SESSION_STATE)) {\r\n this.logger.verbose(\"Fragment has session state, caching\");\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.SESSION_STATE, stateInfo.state), hashParams[ServerHashParamKeys.SESSION_STATE]);\r\n }\r\n response.accountState = this.getAccountState(stateInfo.state);\r\n var clientInfo = void 0;\r\n // Process access_token\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ACCESS_TOKEN)) {\r\n this.logger.info(\"Fragment has access token\");\r\n response.accessToken = hashParams[ServerHashParamKeys.ACCESS_TOKEN];\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.SCOPE)) {\r\n response.scopes = hashParams[ServerHashParamKeys.SCOPE].split(\" \");\r\n }\r\n // retrieve the id_token from response if present\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ID_TOKEN)) {\r\n this.logger.verbose(\"Fragment has id_token\");\r\n idTokenObj = new IdToken(hashParams[ServerHashParamKeys.ID_TOKEN]);\r\n }\r\n else {\r\n this.logger.verbose(\"No idToken on fragment, getting idToken from cache\");\r\n idTokenObj = new IdToken(this.cacheStorage.getItem(PersistentCacheKeys.IDTOKEN));\r\n }\r\n response = ResponseUtils.setResponseIdToken(response, idTokenObj);\r\n // set authority\r\n var authority = this.populateAuthority(stateInfo.state, this.inCookie, this.cacheStorage, idTokenObj);\r\n this.logger.verbose(\"Got authority from cache\");\r\n // retrieve client_info - if it is not found, generate the uid and utid from idToken\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.CLIENT_INFO)) {\r\n this.logger.verbose(\"Fragment has clientInfo\");\r\n clientInfo = new ClientInfo(hashParams[ServerHashParamKeys.CLIENT_INFO], authority);\r\n }\r\n else if (this.authorityInstance.AuthorityType === AuthorityType.Adfs) {\r\n clientInfo = ClientInfo.createClientInfoFromIdToken(idTokenObj, authority);\r\n }\r\n else {\r\n this.logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n response.account = Account.createAccount(idTokenObj, clientInfo);\r\n this.logger.verbose(\"Account object created from response\");\r\n var accountKey = void 0;\r\n if (response.account && !StringUtils.isEmpty(response.account.homeAccountIdentifier)) {\r\n this.logger.verbose(\"AccountKey set\");\r\n accountKey = response.account.homeAccountIdentifier;\r\n }\r\n else {\r\n this.logger.verbose(\"AccountKey set as no_account\");\r\n accountKey = Constants.no_account;\r\n }\r\n acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountKey, stateInfo.state);\r\n var acquireTokenAccountKey_noaccount = AuthCache.generateAcquireTokenAccountKey(Constants.no_account, stateInfo.state);\r\n this.logger.verbose(\"AcquireTokenAccountKey generated\");\r\n var cachedAccount = this.cacheStorage.getItem(acquireTokenAccountKey);\r\n var acquireTokenAccount = void 0;\r\n // Check with the account in the Cache\r\n if (!StringUtils.isEmpty(cachedAccount)) {\r\n acquireTokenAccount = JSON.parse(cachedAccount);\r\n this.logger.verbose(\"AcquireToken request account retrieved from cache\");\r\n if (response.account && acquireTokenAccount && Account.compareAccounts(response.account, acquireTokenAccount)) {\r\n response = this.saveAccessToken(response, authority, hashParams, clientInfo);\r\n this.logger.info(\"The user object received in the response is the same as the one passed in the acquireToken request\");\r\n }\r\n else {\r\n this.logger.warning(\"The account object created from the response is not the same as the one passed in the acquireToken request\");\r\n }\r\n }\r\n else if (!StringUtils.isEmpty(this.cacheStorage.getItem(acquireTokenAccountKey_noaccount))) {\r\n this.logger.verbose(\"No acquireToken account retrieved from cache\");\r\n response = this.saveAccessToken(response, authority, hashParams, clientInfo);\r\n }\r\n }\r\n // Process id_token\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.ID_TOKEN)) {\r\n this.logger.info(\"Fragment has idToken\");\r\n // set the idToken\r\n idTokenObj = new IdToken(hashParams[ServerHashParamKeys.ID_TOKEN]);\r\n // set authority\r\n var authority = this.populateAuthority(stateInfo.state, this.inCookie, this.cacheStorage, idTokenObj);\r\n response = ResponseUtils.setResponseIdToken(response, idTokenObj);\r\n if (hashParams.hasOwnProperty(ServerHashParamKeys.CLIENT_INFO)) {\r\n this.logger.verbose(\"Fragment has clientInfo\");\r\n clientInfo = new ClientInfo(hashParams[ServerHashParamKeys.CLIENT_INFO], authority);\r\n }\r\n else if (this.authorityInstance.AuthorityType === AuthorityType.Adfs) {\r\n clientInfo = ClientInfo.createClientInfoFromIdToken(idTokenObj, authority);\r\n }\r\n else {\r\n this.logger.warning(\"ClientInfo not received in the response from AAD\");\r\n }\r\n this.account = Account.createAccount(idTokenObj, clientInfo);\r\n response.account = this.account;\r\n this.logger.verbose(\"Account object created from response\");\r\n if (idTokenObj && idTokenObj.nonce) {\r\n this.logger.verbose(\"IdToken has nonce\");\r\n // check nonce integrity if idToken has nonce - throw an error if not matched\r\n var cachedNonce = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, stateInfo.state), this.inCookie);\r\n if (idTokenObj.nonce !== cachedNonce) {\r\n this.account = null;\r\n this.cacheStorage.setItem(ErrorCacheKeys.LOGIN_ERROR, \"Nonce Mismatch. Expected Nonce: \" + cachedNonce + \",\" + \"Actual Nonce: \" + idTokenObj.nonce);\r\n this.logger.error(\"Nonce Mismatch. Expected Nonce: \" + cachedNonce + \", Actual Nonce: \" + idTokenObj.nonce);\r\n error = ClientAuthError.createNonceMismatchError(cachedNonce, idTokenObj.nonce);\r\n }\r\n // Save the token\r\n else {\r\n this.logger.verbose(\"Nonce matches, saving idToken to cache\");\r\n this.cacheStorage.setItem(PersistentCacheKeys.IDTOKEN, hashParams[ServerHashParamKeys.ID_TOKEN], this.inCookie);\r\n this.cacheStorage.setItem(PersistentCacheKeys.CLIENT_INFO, clientInfo.encodeClientInfo(), this.inCookie);\r\n // Save idToken as access token item for app itself\r\n this.saveIdToken(response, authority, hashParams, clientInfo, idTokenObj);\r\n }\r\n }\r\n else {\r\n this.logger.verbose(\"No idToken or no nonce. Cache key for Authority set as state\");\r\n authorityKey = stateInfo.state;\r\n acquireTokenAccountKey = stateInfo.state;\r\n this.logger.error(\"Invalid id_token received in the response\");\r\n error = ClientAuthError.createInvalidIdTokenError(idTokenObj);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, error.errorCode);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, error.errorMessage);\r\n }\r\n }\r\n }\r\n // State mismatch - unexpected/invalid state\r\n else {\r\n this.logger.verbose(\"State mismatch\");\r\n authorityKey = stateInfo.state;\r\n acquireTokenAccountKey = stateInfo.state;\r\n var expectedState = this.cacheStorage.getItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, stateInfo.state), this.inCookie);\r\n this.logger.error(\"State Mismatch. Expected State: \" + expectedState + \", Actual State: \" + stateInfo.state);\r\n error = ClientAuthError.createInvalidStateError(stateInfo.state, expectedState);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR, error.errorCode);\r\n this.cacheStorage.setItem(ErrorCacheKeys.ERROR_DESC, error.errorMessage);\r\n }\r\n }\r\n // Set status to completed\r\n this.cacheStorage.removeItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.RENEW_STATUS, stateInfo.state));\r\n this.cacheStorage.resetTempCacheItems(stateInfo.state);\r\n this.logger.verbose(\"Status set to complete, temporary cache cleared\");\r\n // this is required if navigateToLoginRequestUrl=false\r\n if (this.inCookie) {\r\n this.logger.verbose(\"InCookie is true, setting authorityKey in cookie\");\r\n this.cacheStorage.setItemCookie(authorityKey, \"\", -1);\r\n this.cacheStorage.clearMsalCookie(stateInfo.state);\r\n }\r\n if (error) {\r\n // Error case, set status to cancelled\r\n throw error;\r\n }\r\n if (!response) {\r\n throw AuthError.createUnexpectedError(\"Response is null\");\r\n }\r\n return response;\r\n };\r\n /**\r\n * Set Authority when saving Token from the hash\r\n * @param state\r\n * @param inCookie\r\n * @param cacheStorage\r\n * @param idTokenObj\r\n * @param response\r\n */\r\n UserAgentApplication.prototype.populateAuthority = function (state, inCookie, cacheStorage, idTokenObj) {\r\n this.logger.verbose(\"PopulateAuthority has been called\");\r\n var authorityKey = AuthCache.generateAuthorityKey(state);\r\n var cachedAuthority = cacheStorage.getItem(authorityKey, inCookie);\r\n // retrieve the authority from cache and replace with tenantID\r\n return StringUtils.isEmpty(cachedAuthority) ? cachedAuthority : UrlUtils.replaceTenantPath(cachedAuthority, idTokenObj.tenantId);\r\n };\r\n /* tslint:enable:no-string-literal */\r\n // #endregion\r\n // #region Account\r\n /**\r\n * Returns the signed in account\r\n * (the account object is created at the time of successful login)\r\n * or null when no state is found\r\n * @returns {@link Account} - the account object stored in MSAL\r\n */\r\n UserAgentApplication.prototype.getAccount = function () {\r\n // if a session already exists, get the account from the session\r\n if (this.account) {\r\n return this.account;\r\n }\r\n // frame is used to get idToken and populate the account for the given session\r\n var rawIdToken = this.cacheStorage.getItem(PersistentCacheKeys.IDTOKEN, this.inCookie);\r\n var rawClientInfo = this.cacheStorage.getItem(PersistentCacheKeys.CLIENT_INFO, this.inCookie);\r\n if (!StringUtils.isEmpty(rawIdToken) && !StringUtils.isEmpty(rawClientInfo)) {\r\n var idToken = new IdToken(rawIdToken);\r\n var clientInfo = new ClientInfo(rawClientInfo, \"\");\r\n this.account = Account.createAccount(idToken, clientInfo);\r\n return this.account;\r\n }\r\n // if login not yet done, return null\r\n return null;\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Extracts state value from the accountState sent with the authentication request.\r\n * @returns {string} scope.\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.getAccountState = function (state) {\r\n if (state) {\r\n var splitIndex = state.indexOf(Constants.resourceDelimiter);\r\n if (splitIndex > -1 && splitIndex + 1 < state.length) {\r\n return state.substring(splitIndex + 1);\r\n }\r\n }\r\n return state;\r\n };\r\n /**\r\n * Use to get a list of unique accounts in MSAL cache based on homeAccountIdentifier.\r\n *\r\n * @param {@link Array} Account - all unique accounts in MSAL cache.\r\n */\r\n UserAgentApplication.prototype.getAllAccounts = function () {\r\n var accounts = [];\r\n var accessTokenCacheItems = this.cacheStorage.getAllAccessTokens(Constants.clientId, Constants.homeAccountIdentifier);\r\n for (var i = 0; i < accessTokenCacheItems.length; i++) {\r\n var idToken = new IdToken(accessTokenCacheItems[i].value.idToken);\r\n var clientInfo = new ClientInfo(accessTokenCacheItems[i].value.homeAccountIdentifier, \"\");\r\n var account = Account.createAccount(idToken, clientInfo);\r\n accounts.push(account);\r\n }\r\n return this.getUniqueAccounts(accounts);\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Used to filter accounts based on homeAccountIdentifier\r\n * @param {Array} Accounts - accounts saved in the cache\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.getUniqueAccounts = function (accounts) {\r\n if (!accounts || accounts.length <= 1) {\r\n return accounts;\r\n }\r\n var flags = [];\r\n var uniqueAccounts = [];\r\n for (var index = 0; index < accounts.length; ++index) {\r\n if (accounts[index].homeAccountIdentifier && flags.indexOf(accounts[index].homeAccountIdentifier) === -1) {\r\n flags.push(accounts[index].homeAccountIdentifier);\r\n uniqueAccounts.push(accounts[index]);\r\n }\r\n }\r\n return uniqueAccounts;\r\n };\r\n // #endregion\r\n // #region Angular\r\n /**\r\n * @hidden\r\n *\r\n * Broadcast messages - Used only for Angular? *\r\n * @param eventName\r\n * @param data\r\n */\r\n UserAgentApplication.prototype.broadcast = function (eventName, data) {\r\n var evt = new CustomEvent(eventName, { detail: data });\r\n window.dispatchEvent(evt);\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Helper function to retrieve the cached token\r\n *\r\n * @param scopes\r\n * @param {@link Account} account\r\n * @param state\r\n * @return {@link AuthResponse} AuthResponse\r\n */\r\n UserAgentApplication.prototype.getCachedTokenInternal = function (scopes, account, state, correlationId) {\r\n // Get the current session's account object\r\n var accountObject = account || this.getAccount();\r\n if (!accountObject) {\r\n return null;\r\n }\r\n // Construct AuthenticationRequest based on response type; set \"redirectUri\" from the \"request\" which makes this call from Angular - for this.getRedirectUri()\r\n var newAuthority = this.authorityInstance ? this.authorityInstance : AuthorityFactory.CreateInstance(this.authority, this.config.auth.validateAuthority);\r\n var responseType = this.getTokenType(accountObject, scopes);\r\n var serverAuthenticationRequest = new ServerRequestParameters(newAuthority, this.clientId, responseType, this.getRedirectUri(), scopes, state, correlationId);\r\n // get cached token\r\n return this.getCachedToken(serverAuthenticationRequest, account);\r\n };\r\n /**\r\n * @hidden\r\n *\r\n * Get scopes for the Endpoint - Used in Angular to track protected and unprotected resources without interaction from the developer app\r\n * Note: Please check if we need to set the \"redirectUri\" from the \"request\" which makes this call from Angular - for this.getRedirectUri()\r\n *\r\n * @param endpoint\r\n */\r\n UserAgentApplication.prototype.getScopesForEndpoint = function (endpoint) {\r\n // if user specified list of unprotectedResources, no need to send token to these endpoints, return null.\r\n if (this.config.framework.unprotectedResources.length > 0) {\r\n for (var i = 0; i < this.config.framework.unprotectedResources.length; i++) {\r\n if (endpoint.indexOf(this.config.framework.unprotectedResources[i]) > -1) {\r\n return null;\r\n }\r\n }\r\n }\r\n // process all protected resources and send the matched one\r\n if (this.config.framework.protectedResourceMap.size > 0) {\r\n for (var _i = 0, _a = Array.from(this.config.framework.protectedResourceMap.keys()); _i < _a.length; _i++) {\r\n var key = _a[_i];\r\n // configEndpoint is like /api/Todo requested endpoint can be /api/Todo/1\r\n if (endpoint.indexOf(key) > -1) {\r\n return this.config.framework.protectedResourceMap.get(key);\r\n }\r\n }\r\n }\r\n /*\r\n * default resource will be clientid if nothing specified\r\n * App will use idtoken for calls to itself\r\n * check if it's staring from http or https, needs to match with app host\r\n */\r\n if (endpoint.indexOf(\"http://\") > -1 || endpoint.indexOf(\"https://\") > -1) {\r\n if (UrlUtils.getHostFromUri(endpoint) === UrlUtils.getHostFromUri(this.getRedirectUri())) {\r\n return new Array(this.clientId);\r\n }\r\n }\r\n else {\r\n /*\r\n * in angular level, the url for $http interceptor call could be relative url,\r\n * if it's relative call, we'll treat it as app backend call.\r\n */\r\n return new Array(this.clientId);\r\n }\r\n // if not the app's own backend or not a domain listed in the endpoints structure\r\n return null;\r\n };\r\n /**\r\n * Return boolean flag to developer to help inform if login is in progress\r\n * @returns {boolean} true/false\r\n */\r\n UserAgentApplication.prototype.getLoginInProgress = function () {\r\n return this.cacheStorage.getItem(TemporaryCacheKeys.INTERACTION_STATUS) === Constants.inProgress;\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param loginInProgress\r\n */\r\n UserAgentApplication.prototype.setInteractionInProgress = function (inProgress) {\r\n if (inProgress) {\r\n this.cacheStorage.setItem(TemporaryCacheKeys.INTERACTION_STATUS, Constants.inProgress);\r\n }\r\n else {\r\n this.cacheStorage.removeItem(TemporaryCacheKeys.INTERACTION_STATUS);\r\n }\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param loginInProgress\r\n */\r\n UserAgentApplication.prototype.setloginInProgress = function (loginInProgress) {\r\n this.setInteractionInProgress(loginInProgress);\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * returns the status of acquireTokenInProgress\r\n */\r\n UserAgentApplication.prototype.getAcquireTokenInProgress = function () {\r\n return this.cacheStorage.getItem(TemporaryCacheKeys.INTERACTION_STATUS) === Constants.inProgress;\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * @param acquireTokenInProgress\r\n */\r\n UserAgentApplication.prototype.setAcquireTokenInProgress = function (acquireTokenInProgress) {\r\n this.setInteractionInProgress(acquireTokenInProgress);\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * returns the logger handle\r\n */\r\n UserAgentApplication.prototype.getLogger = function () {\r\n return this.logger;\r\n };\r\n /**\r\n * Sets the logger callback.\r\n * @param logger Logger callback\r\n */\r\n UserAgentApplication.prototype.setLogger = function (logger) {\r\n this.logger = logger;\r\n };\r\n // #endregion\r\n // #region Getters and Setters\r\n /**\r\n * Use to get the redirect uri configured in MSAL or null.\r\n * Evaluates redirectUri if its a function, otherwise simply returns its value.\r\n *\r\n * @returns {string} redirect URL\r\n */\r\n UserAgentApplication.prototype.getRedirectUri = function (reqRedirectUri) {\r\n if (reqRedirectUri) {\r\n return reqRedirectUri;\r\n }\r\n else if (typeof this.config.auth.redirectUri === \"function\") {\r\n return this.config.auth.redirectUri();\r\n }\r\n return this.config.auth.redirectUri;\r\n };\r\n /**\r\n * Use to get the post logout redirect uri configured in MSAL or null.\r\n * Evaluates postLogoutredirectUri if its a function, otherwise simply returns its value.\r\n *\r\n * @returns {string} post logout redirect URL\r\n */\r\n UserAgentApplication.prototype.getPostLogoutRedirectUri = function () {\r\n if (typeof this.config.auth.postLogoutRedirectUri === \"function\") {\r\n return this.config.auth.postLogoutRedirectUri();\r\n }\r\n return this.config.auth.postLogoutRedirectUri;\r\n };\r\n /**\r\n * Use to get the current {@link Configuration} object in MSAL\r\n *\r\n * @returns {@link Configuration}\r\n */\r\n UserAgentApplication.prototype.getCurrentConfiguration = function () {\r\n if (!this.config) {\r\n throw ClientConfigurationError.createNoSetConfigurationError();\r\n }\r\n return this.config;\r\n };\r\n /**\r\n * @ignore\r\n *\r\n * Utils function to create the Authentication\r\n * @param {@link account} account object\r\n * @param scopes\r\n *\r\n * @returns {string} token type: token, id_token or id_token token\r\n *\r\n */\r\n UserAgentApplication.prototype.getTokenType = function (accountObject, scopes) {\r\n var accountsMatch = Account.compareAccounts(accountObject, this.getAccount());\r\n return ServerRequestParameters.determineResponseType(accountsMatch, scopes);\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Sets the cachekeys for and stores the account information in cache\r\n * @param account\r\n * @param state\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.setAccountCache = function (account, state) {\r\n // Cache acquireTokenAccountKey\r\n var accountId = account ? this.getAccountId(account) : Constants.no_account;\r\n var acquireTokenAccountKey = AuthCache.generateAcquireTokenAccountKey(accountId, state);\r\n this.cacheStorage.setItem(acquireTokenAccountKey, JSON.stringify(account));\r\n };\r\n /**\r\n * @hidden\r\n * @ignore\r\n *\r\n * Sets the cacheKey for and stores the authority information in cache\r\n * @param state\r\n * @param authority\r\n * @hidden\r\n */\r\n UserAgentApplication.prototype.setAuthorityCache = function (state, authority) {\r\n // Cache authorityKey\r\n var authorityKey = AuthCache.generateAuthorityKey(state);\r\n this.cacheStorage.setItem(authorityKey, UrlUtils.CanonicalizeUri(authority), this.inCookie);\r\n };\r\n /**\r\n * Updates account, authority, and nonce in cache\r\n * @param serverAuthenticationRequest\r\n * @param account\r\n * @hidden\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.updateCacheEntries = function (serverAuthenticationRequest, account, isLoginCall, loginStartPage) {\r\n // Cache Request Originator Page\r\n if (loginStartPage) {\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.LOGIN_REQUEST, serverAuthenticationRequest.state), loginStartPage, this.inCookie);\r\n }\r\n // Cache account and authority\r\n if (isLoginCall) {\r\n // Cache the state\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.STATE_LOGIN, serverAuthenticationRequest.state), serverAuthenticationRequest.state, this.inCookie);\r\n }\r\n else {\r\n this.setAccountCache(account, serverAuthenticationRequest.state);\r\n }\r\n // Cache authorityKey\r\n this.setAuthorityCache(serverAuthenticationRequest.state, serverAuthenticationRequest.authority);\r\n // Cache nonce\r\n this.cacheStorage.setItem(AuthCache.generateTemporaryCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN, serverAuthenticationRequest.state), serverAuthenticationRequest.nonce, this.inCookie);\r\n };\r\n /**\r\n * Returns the unique identifier for the logged in account\r\n * @param account\r\n * @hidden\r\n * @ignore\r\n */\r\n UserAgentApplication.prototype.getAccountId = function (account) {\r\n // return `${account.accountIdentifier}` + Constants.resourceDelimiter + `${account.homeAccountIdentifier}`;\r\n var accountId;\r\n if (!StringUtils.isEmpty(account.homeAccountIdentifier)) {\r\n accountId = account.homeAccountIdentifier;\r\n }\r\n else {\r\n accountId = Constants.no_account;\r\n }\r\n return accountId;\r\n };\r\n /**\r\n * @ignore\r\n * @param extraQueryParameters\r\n *\r\n * Construct 'tokenRequest' from the available data in adalIdToken\r\n */\r\n UserAgentApplication.prototype.buildIDTokenRequest = function (request) {\r\n var tokenRequest = {\r\n scopes: Constants.oidcScopes,\r\n authority: this.authority,\r\n account: this.getAccount(),\r\n extraQueryParameters: request.extraQueryParameters,\r\n correlationId: request.correlationId\r\n };\r\n return tokenRequest;\r\n };\r\n /**\r\n * @ignore\r\n * @param config\r\n * @param clientId\r\n *\r\n * Construct TelemetryManager from Configuration\r\n */\r\n UserAgentApplication.prototype.getTelemetryManagerFromConfig = function (config, clientId) {\r\n if (!config) { // if unset\r\n return TelemetryManager.getTelemetrymanagerStub(clientId, this.logger);\r\n }\r\n // if set then validate\r\n var applicationName = config.applicationName, applicationVersion = config.applicationVersion, telemetryEmitter = config.telemetryEmitter;\r\n if (!applicationName || !applicationVersion || !telemetryEmitter) {\r\n throw ClientConfigurationError.createTelemetryConfigError(config);\r\n }\r\n // if valid then construct\r\n var telemetryPlatform = {\r\n applicationName: applicationName,\r\n applicationVersion: applicationVersion\r\n };\r\n var telemetryManagerConfig = {\r\n platform: telemetryPlatform,\r\n clientId: clientId\r\n };\r\n return new TelemetryManager(telemetryManagerConfig, telemetryEmitter, this.logger);\r\n };\r\n return UserAgentApplication;\r\n}());\r\nexport { UserAgentApplication };\r\n//# sourceMappingURL=UserAgentApplication.js.map","/**\n * Safe chained function\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n *\n * @param {function} functions to chain\n * @returns {function|null}\n */\nexport default function createChainedFunction() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n return funcs.reduce(function (acc, func) {\n if (func == null) {\n return acc;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof func !== 'function') {\n console.error('Material-UI: Invalid Argument Type, must only provide functions, undefined, or null.');\n }\n }\n\n return function chainedFunction() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, function () {});\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport SvgIcon from '../SvgIcon';\n/**\n * Private module reserved for @material-ui/x packages.\n */\n\nexport default function createSvgIcon(path, displayName) {\n var Component = function Component(props, ref) {\n return /*#__PURE__*/React.createElement(SvgIcon, _extends({\n ref: ref\n }, props), 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 = \"\".concat(displayName, \"Icon\");\n }\n\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\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) {\n var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 166;\n var timeout;\n\n function debounced() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n // eslint-disable-next-line consistent-this\n var that = this;\n\n var later = function later() {\n func.apply(that, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = function () {\n clearTimeout(timeout);\n };\n\n return debounced;\n}","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return function () {\n return null;\n };\n }\n\n return function (props, propName, componentName, location, propFullName) {\n var componentNameSafe = componentName || '<>';\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(\"The \".concat(location, \" `\").concat(propFullNameSafe, \"` of \") + \"`\".concat(componentNameSafe, \"` is deprecated. \").concat(reason));\n }\n\n return null;\n };\n}","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(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 var doc = ownerDocument(node);\n return doc.defaultView || window;\n}","export default function requirePropFactory(componentNameInError) {\n if (process.env.NODE_ENV === 'production') {\n return function () {\n return null;\n };\n }\n\n var requireProp = function requireProp(requiredProp) {\n return function (props, propName, componentName, location, propFullName) {\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(\"The prop `\".concat(propFullNameSafe, \"` of \") + \"`\".concat(componentNameInError, \"` must be used on `\").concat(requiredProp, \"`.\"));\n }\n\n return null;\n };\n };\n\n return requireProp;\n}","// TODO v5: consider to make it private\nexport default function setRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n ref.current = value;\n }\n}","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n var propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(\"The prop `\".concat(propFullNameSafe, \"` is not supported. Please remove it.\"));\n }\n\n return null;\n}","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled(_ref) {\n var controlled = _ref.controlled,\n defaultProp = _ref.default,\n name = _ref.name,\n _ref$state = _ref.state,\n state = _ref$state === void 0 ? 'value' : _ref$state;\n\n var _React$useRef = React.useRef(controlled !== undefined),\n isControlled = _React$useRef.current;\n\n var _React$useState = React.useState(defaultProp),\n valueState = _React$useState[0],\n setValue = _React$useState[1];\n\n var value = isControlled ? controlled : valueState;\n\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(function () {\n if (isControlled !== (controlled !== undefined)) {\n console.error([\"Material-UI: A component is changing the \".concat(isControlled ? '' : 'un', \"controlled \").concat(state, \" state of \").concat(name, \" to be \").concat(isControlled ? 'un' : '', \"controlled.\"), 'Elements should not switch from uncontrolled to controlled (or vice versa).', \"Decide between using a controlled or uncontrolled \".concat(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 }, [controlled]);\n\n var _React$useRef2 = React.useRef(defaultProp),\n defaultValue = _React$useRef2.current;\n\n React.useEffect(function () {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([\"Material-UI: A component is changing the default \".concat(state, \" state of an uncontrolled \").concat(name, \" after being initialized. \") + \"To suppress this warning opt to use a controlled \".concat(name, \".\")].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n\n var setValueIfUncontrolled = React.useCallback(function (newValue) {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","import * as React from 'react';\nvar useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n *\n * @param {function} fn\n */\n\nexport default function useEventCallback(fn) {\n var ref = React.useRef(fn);\n useEnhancedEffect(function () {\n ref.current = fn;\n });\n return React.useCallback(function () {\n return (0, ref.current).apply(void 0, arguments);\n }, []);\n}","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are 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(function () {\n if (refA == null && refB == null) {\n return null;\n }\n\n return function (refValue) {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","import * as React from 'react';\n/**\n * Private module reserved for @material-ui/x packages.\n */\n\nexport default function useId(idOverride) {\n var _React$useState = React.useState(idOverride),\n defaultId = _React$useState[0],\n setDefaultId = _React$useState[1];\n\n var id = idOverride || defaultId;\n React.useEffect(function () {\n if (defaultId == null) {\n // Fallback to this default id when possible.\n // Use the random value for client-side rendering only.\n // We can't use it server-side.\n setDefaultId(\"mui-\".concat(Math.round(Math.random() * 1e5)));\n }\n }, [defaultId]);\n return id;\n}","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nvar hadKeyboardEvent = true;\nvar hadFocusVisibleRecently = false;\nvar hadFocusVisibleRecentlyTimeout = null;\nvar 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 * 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 * @return {boolean}\n */\n\nfunction focusTriggersKeyboardModality(node) {\n var type = node.type,\n tagName = node.tagName;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\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 */\n\n\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n\n hadKeyboardEvent = true;\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 */\n\n\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\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}\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}\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}\n\nfunction isFocusVisible(event) {\n var target = event.target;\n\n try {\n return target.matches(':focus-visible');\n } catch (error) {} // 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 // no need for validFocusTarget check. the user does that by attaching it to\n // focusable events only\n\n\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n/**\n * Should be called if a blur event is fired on a focus-visible element\n */\n\n\nfunction handleBlurVisible() {\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 window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}\n\nexport default function useIsFocusVisible() {\n var ref = React.useCallback(function (instance) {\n var node = ReactDOM.findDOMNode(instance);\n\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(isFocusVisible);\n }\n\n return {\n isFocusVisible: isFocusVisible,\n onBlurVisible: handleBlurVisible,\n ref: ref\n };\n}","export { 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 unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef'; // eslint-disable-next-line camelcase\n\nexport { default as unstable_useId } from './unstable_useId';\nexport { default as useIsFocusVisible } from './useIsFocusVisible';","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@material-ui/utils/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 iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n\n /* eslint-disable prefer-template */\n var url = 'https://material-ui.com/production-error/?code=' + code;\n\n for (var 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\n return 'Minified Material-UI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n}\n","import {path} from \"d3-path\";\nimport constant from \"./constant.js\";\nimport curveLinear from \"./curve/linear.js\";\nimport line from \"./line.js\";\nimport {x as pointX, y as pointY} from \"./point.js\";\n\nexport default function() {\n var x0 = pointX,\n x1 = null,\n y0 = constant(0),\n y1 = pointY,\n defined = constant(true),\n context = null,\n curve = curveLinear,\n output = null;\n\n function area(data) {\n var i,\n j,\n k,\n n = data.length,\n d,\n defined0 = false,\n buffer,\n x0z = new Array(n),\n y0z = new Array(n);\n\n if (context == null) output = curve(buffer = path());\n\n for (i = 0; i <= n; ++i) {\n if (!(i < n && defined(d = data[i], i, data)) === defined0) {\n if (defined0 = !defined0) {\n j = i;\n output.areaStart();\n output.lineStart();\n } else {\n output.lineEnd();\n output.lineStart();\n for (k = i - 1; k >= j; --k) {\n output.point(x0z[k], y0z[k]);\n }\n output.lineEnd();\n output.areaEnd();\n }\n }\n if (defined0) {\n x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);\n output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);\n }\n }\n\n if (buffer) return output = null, buffer + \"\" || null;\n }\n\n function arealine() {\n return line().defined(defined).curve(curve).context(context);\n }\n\n area.x = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), x1 = null, area) : x0;\n };\n\n area.x0 = function(_) {\n return arguments.length ? (x0 = typeof _ === \"function\" ? _ : constant(+_), area) : x0;\n };\n\n area.x1 = function(_) {\n return arguments.length ? (x1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : x1;\n };\n\n area.y = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), y1 = null, area) : y0;\n };\n\n area.y0 = function(_) {\n return arguments.length ? (y0 = typeof _ === \"function\" ? _ : constant(+_), area) : y0;\n };\n\n area.y1 = function(_) {\n return arguments.length ? (y1 = _ == null ? null : typeof _ === \"function\" ? _ : constant(+_), area) : y1;\n };\n\n area.lineX0 =\n area.lineY0 = function() {\n return arealine().x(x0).y(y0);\n };\n\n area.lineY1 = function() {\n return arealine().x(x0).y(y1);\n };\n\n area.lineX1 = function() {\n return arealine().x(x1).y(y0);\n };\n\n area.defined = function(_) {\n return arguments.length ? (defined = typeof _ === \"function\" ? _ : constant(!!_), area) : defined;\n };\n\n area.curve = function(_) {\n return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;\n };\n\n area.context = function(_) {\n return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;\n };\n\n return area;\n}\n","export default function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n}\n","import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\nexport default function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: number(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n}\n","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\nvar plainObjectConstrurctor = {}.constructor;\nfunction cloneStyle(style) {\n if (style == null || typeof style !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n\n/**\n * Create a rule instance.\n */\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n\n/**\n * Converts array values to string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\nvar toCssValue = function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n};\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(prop + \": \" + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop + \": \" + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += '\\n';\n result += \"\" + indentStr(_prop2 + \": \" + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\\n\" + result + \"\\n\";\n return indentStr(selector + \" {\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\nvar escape = (function (str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n});\n\nvar BaseStyleRule =\n/*#__PURE__*/\nfunction () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.key = void 0;\n this.isProcessed = false;\n this.style = void 0;\n this.renderer = void 0;\n this.renderable = void 0;\n this.options = void 0;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = name in this.style; // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\nvar StyleRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n _this.selectorText = void 0;\n _this.id = void 0;\n _this.renderable = void 0;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n\n /**\n * Apply rule to an element inline.\n */\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(name, style, options) {\n if (name[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(name, style, options);\n }\n};\n\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule =\n/*#__PURE__*/\nfunction () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.at = void 0;\n this.key = void 0;\n this.query = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name || \"@\" + this.at;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\\n\" + children + \"\\n}\" : '';\n };\n\n return ConditionalRule;\n}();\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\n\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule =\n/*#__PURE__*/\nfunction () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.key = void 0;\n this.name = void 0;\n this.id = void 0;\n this.rules = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\\n\" + children + \"\\n\";\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar plugin = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\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 = _BaseStyleRule.call.apply(_BaseStyleRule, [this].concat(args)) || this;\n _this.renderable = void 0;\n return _this;\n }\n\n var _proto = KeyframeRule.prototype;\n\n /**\n * Generates a CSS string.\n */\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule =\n/*#__PURE__*/\nfunction () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule =\n/*#__PURE__*/\nfunction () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.key = void 0;\n this.style = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule =\n/*#__PURE__*/\nfunction () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.key = void 0;\n this.value = void 0;\n this.options = void 0;\n this.isProcessed = false;\n this.renderable = void 0;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\n\nvar plugins = [pluginStyleRule, pluginConditionalRule, plugin, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\n\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList =\n/*#__PURE__*/\nfunction () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name,\n keyframes: this.keyframes,\n selector: undefined\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Get a rule.\n */\n ;\n\n _proto.get = function get(name) {\n return this.map[name];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n data = arguments.length <= 1 ? undefined : arguments[1]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0]; // $FlowFixMe[invalid-tuple-index]\n\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.map[name], data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var styleRule = rule;\n var style = styleRule.style;\n plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== styleRule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins.onProcessStyle(styleRule.style, styleRule, sheet); // Update and add props.\n\n for (var prop in styleRule.style) {\n var nextValue = styleRule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n styleRule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = styleRule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n styleRule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += '\\n';\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(styles, options) {\n this.options = void 0;\n this.deployed = void 0;\n this.attached = void 0;\n this.rules = void 0;\n this.renderer = void 0;\n this.classes = void 0;\n this.keyframes = void 0;\n this.queue = void 0;\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name.\n */\n ;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = typeof name === 'object' ? name : this.rules.get(name);\n\n if (!rule || // Style sheet was created without link: true and attached, in this case we\n // won't be able to remove the CSS rule from the DOM.\n this.attached && !rule.renderable) {\n return false;\n }\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry =\n/*#__PURE__*/\nfunction () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = void 0;\n }\n\n var _proto = PluginsRegistry.prototype;\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n // $FlowFixMe[prop-missing]\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n\n/**\n * Sheets registry to access them all at one place.\n */\nvar SheetsRegistry =\n/*#__PURE__*/\nfunction () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n\n /**\n * Register a Style Sheet.\n */\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += '\\n';\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\nvar registry = new SheetsRegistry();\n\n/* eslint-disable */\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar globalThis = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\n\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis[ns] == null) globalThis[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis[ns]++;\n\nvar maxRules = 1e10;\n\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n return function (rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n};\n\n/**\n * Cache the value from the first time a function is called.\n */\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n\n/**\n * Get a style property value.\n */\nvar getPropertyValue = function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n};\n\n/**\n * Set a style property.\n */\nvar setProperty = function setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n};\n\n/**\n * Remove a style property.\n */\nvar removeProperty = function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n};\n\n/**\n * Set the selector.\n */\nvar setSelector = function setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n};\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n\n/**\n * Find a node before which we can insert the sheet.\n */\nfunction findPrevNode(options) {\n var registry$1 = registry.registry;\n\n if (registry$1.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry$1, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n // https://stackoverflow.com/questions/41328728/force-casting-in-flow\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n try {\n if ('insertRule' in container) {\n var c = container;\n c.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n var _c = container;\n\n _c.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n return maxIndex;\n }\n\n return index;\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer =\n/*#__PURE__*/\nfunction () {\n // HTMLStyleElement needs fixing https://github.com/facebook/flow/issues/2696\n // Will be empty if link: true option is not set, because\n // it is only for use together with insertRule API.\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.element = void 0;\n this.sheet = void 0;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) registry.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.sheet) return;\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.\n // Though IE will keep them and we need a consistent behavior.\n\n if (this.sheet.options.link) {\n this.cssRules = [];\n this.element.textContent = '\\n';\n }\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.\n\n\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), _insertionIndex);\n\n if (latestNativeParent === false) {\n return false;\n }\n\n this.refCssRule(rule, _insertionIndex, latestNativeParent);\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);\n\n var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n this.refCssRule(rule, insertionIndex, nativeRule);\n return nativeRule;\n };\n\n _proto.refCssRule = function refCssRule(rule, index, cssRule) {\n rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules\n // like rules inside media queries or keyframes\n\n if (rule.options.parent instanceof StyleSheet) {\n this.cssRules[index] = cssRule;\n }\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n return this.cssRules.indexOf(cssRule);\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n *\n * Only used for some old browsers because they can't set a selector.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss =\n/*#__PURE__*/\nfunction () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.5.1\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = registry.index === 0 ? 0 : registry.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n registry.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n }\n\n // Enable rule without name for inline styles.\n if (typeof name === 'object') {\n // $FlowFixMe[incompatible-call]\n return this.createRule(undefined, name, style);\n } // $FlowFixMe[incompatible-type]\n\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n\n var rule = createRule(name, style, ruleOptions);\n\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n */\nvar SheetsManager =\n/*#__PURE__*/\nfunction () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\n\n/**\n * Export a constant indicating if this browser has CSSTOM support.\n * https://developers.google.com/web/updates/2018/03/cssom\n */\nvar hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;\n/**\n * Creates a new instance of Jss.\n */\n\nvar create = function create(options) {\n return new Jss(options);\n};\n/**\n * A global Jss instance.\n */\n\nvar jss = create();\n\nexport default jss;\nexport { RuleList, SheetsManager, SheetsRegistry, create, createGenerateId, createRule, getDynamicStyles, hasCSSTOMSupport, registry as sheets, toCssValue };\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getDisplayName } from '@material-ui/utils';\nexport default function mergeClasses() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var baseClasses = options.baseClasses,\n newClasses = options.newClasses,\n Component = options.Component;\n\n if (!newClasses) {\n return baseClasses;\n }\n\n var nextClasses = _extends({}, baseClasses);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof newClasses === 'string') {\n console.error([\"Material-UI: The value `\".concat(newClasses, \"` \") + \"provided to the classes prop of \".concat(getDisplayName(Component), \" is incorrect.\"), 'You might want to use the className prop instead.'].join('\\n'));\n return baseClasses;\n }\n }\n\n Object.keys(newClasses).forEach(function (key) {\n if (process.env.NODE_ENV !== 'production') {\n if (!baseClasses[key] && newClasses[key]) {\n console.error([\"Material-UI: The key `\".concat(key, \"` \") + \"provided to the classes prop is not implemented in \".concat(getDisplayName(Component), \".\"), \"You can only override one of the following: \".concat(Object.keys(baseClasses).join(','), \".\")].join('\\n'));\n }\n\n if (newClasses[key] && typeof newClasses[key] !== 'string') {\n console.error([\"Material-UI: The key `\".concat(key, \"` \") + \"provided to the classes prop is not valid for \".concat(getDisplayName(Component), \".\"), \"You need to provide a non empty string instead of: \".concat(newClasses[key], \".\")].join('\\n'));\n }\n }\n\n if (newClasses[key]) {\n nextClasses[key] = \"\".concat(baseClasses[key], \" \").concat(newClasses[key]);\n }\n });\n return nextClasses;\n}","// Used https://github.com/thinkloop/multi-key-cache as inspiration\nvar multiKeyStore = {\n set: function set(cache, key1, key2, value) {\n var subCache = cache.get(key1);\n\n if (!subCache) {\n subCache = new Map();\n cache.set(key1, subCache);\n }\n\n subCache.set(key2, value);\n },\n get: function get(cache, key1, key2) {\n var subCache = cache.get(key1);\n return subCache ? subCache.get(key2) : undefined;\n },\n delete: function _delete(cache, key1, key2) {\n var subCache = cache.get(key1);\n subCache.delete(key2);\n }\n};\nexport default multiKeyStore;","import React from 'react';\nvar ThemeContext = React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\n\nexport default ThemeContext;","import React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n var theme = React.useContext(ThemeContext);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","var hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import nested from '../ThemeProvider/nested';\n/**\n * This is the list of the style rule name we use as drop in replacement for the built-in\n * pseudo classes (:checked, :disabled, :focused, etc.).\n *\n * Why do they exist in the first place?\n * These classes are used at a specificity of 2.\n * It allows them to override previously definied styles as well as\n * being untouched by simple user overrides.\n */\n\nvar pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected']; // Returns a function which generates unique class names based on counters.\n// When new generator function is created, rule counter is reset.\n// We need to reset the rule counter for SSR for each request.\n//\n// It's inspired by\n// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js\n\nexport default function createGenerateClassName() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var _options$disableGloba = options.disableGlobal,\n disableGlobal = _options$disableGloba === void 0 ? false : _options$disableGloba,\n _options$productionPr = options.productionPrefix,\n productionPrefix = _options$productionPr === void 0 ? 'jss' : _options$productionPr,\n _options$seed = options.seed,\n seed = _options$seed === void 0 ? '' : _options$seed;\n var seedPrefix = seed === '' ? '' : \"\".concat(seed, \"-\");\n var ruleCounter = 0;\n\n var getNextCounterId = function getNextCounterId() {\n ruleCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (ruleCounter >= 1e10) {\n console.warn(['Material-UI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return function (rule, styleSheet) {\n var name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (pseudoClasses.indexOf(rule.key) !== -1) {\n return \"Mui-\".concat(rule.key);\n }\n\n var prefix = \"\".concat(seedPrefix).concat(name, \"-\").concat(rule.key);\n\n if (!styleSheet.options.theme[nested] || seed !== '') {\n return prefix;\n }\n\n return \"\".concat(prefix, \"-\").concat(getNextCounterId());\n }\n\n if (process.env.NODE_ENV === 'production') {\n return \"\".concat(seedPrefix).concat(productionPrefix).concat(getNextCounterId());\n }\n\n var suffix = \"\".concat(rule.key, \"-\").concat(getNextCounterId()); // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return \"\".concat(seedPrefix).concat(styleSheet.options.classNamePrefix, \"-\").concat(suffix);\n }\n\n return \"\".concat(seedPrefix).concat(suffix);\n };\n}","import warning from 'tiny-warning';\nimport { createRule } from 'jss';\n\nvar now = Date.now();\nvar fnValuesNs = \"fnValues\" + now;\nvar fnRuleNs = \"fnStyle\" + ++now;\n\nvar functionPlugin = function functionPlugin() {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = createRule(name, {}, options);\n rule[fnRuleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n // We need to extract function values from the declaration, so that we can keep core unaware of them.\n // We need to do that only once.\n // We don't need to extract functions on each style update, since this can happen only once.\n // We don't support function values inside of function rules.\n if (fnValuesNs in rule || fnRuleNs in rule) return style;\n var fnValues = {};\n\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fnValues[prop] = value;\n } // $FlowFixMe[prop-missing]\n\n\n rule[fnValuesNs] = fnValues;\n return style;\n },\n onUpdate: function onUpdate(data, rule, sheet, options) {\n var styleRule = rule; // $FlowFixMe[prop-missing]\n\n var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n\n if (fnRule) {\n // Empty object will remove all currently defined props\n // in case function rule returns a falsy value.\n styleRule.style = fnRule(data) || {};\n\n if (process.env.NODE_ENV === 'development') {\n for (var prop in styleRule.style) {\n if (typeof styleRule.style[prop] === 'function') {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;\n break;\n }\n }\n }\n } // $FlowFixMe[prop-missing]\n\n\n var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.\n\n if (fnValues) {\n for (var _prop in fnValues) {\n styleRule.prop(_prop, fnValues[_prop](data), options);\n }\n }\n }\n };\n};\n\nexport default functionPlugin;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { RuleList } from 'jss';\n\nvar at = '@global';\nvar atPrefix = '@global ';\n\nvar GlobalContainerRule =\n/*#__PURE__*/\nfunction () {\n function GlobalContainerRule(key, styles, options) {\n this.type = 'global';\n this.at = at;\n this.rules = void 0;\n this.options = void 0;\n this.key = void 0;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = GlobalContainerRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (rule) this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString() {\n return this.rules.toString();\n };\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule =\n/*#__PURE__*/\nfunction () {\n function GlobalPrefixedRule(key, style, options) {\n this.type = 'global';\n this.at = at;\n this.options = void 0;\n this.rule = void 0;\n this.isProcessed = false;\n this.key = void 0;\n this.key = key;\n this.options = options;\n var selector = key.substr(atPrefix.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this\n }));\n }\n\n var _proto2 = GlobalPrefixedRule.prototype;\n\n _proto2.toString = function toString(options) {\n return this.rule ? this.rule.toString(options) : '';\n };\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + \" \" + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n var rules = style ? style[at] : null;\n if (!rules) return;\n\n for (var name in rules) {\n sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[at];\n}\n\nfunction handlePrefixedGlobalRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;\n var selector = addScope(prop.substr(at.length), rule.selector);\n sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\n\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default jssGlobal;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n/**\n * Convert nested rules to separate, remove them from original styles.\n *\n * @param {Rule} rule\n * @api public\n */\n\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n rule = rule;\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.\n\n result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + \" \" + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, prevOptions) {\n // Options has been already created, now we only increase index.\n if (prevOptions) return _extends({}, prevOptions, {\n index: prevOptions.index + 1 // $FlowFixMe[prop-missing]\n\n });\n var nestingLevel = rule.options.nestingLevel;\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n var options = _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.\n\n });\n\n delete options.name;\n return options;\n }\n\n function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style') return style;\n var styleRule = rule;\n var container = styleRule.options.parent;\n var options;\n var replaceRef;\n\n for (var prop in style) {\n var isNested = prop.indexOf('&') !== -1;\n var isNestedConditional = prop[0] === '@';\n if (!isNested && !isNestedConditional) continue;\n options = getOptions(styleRule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n\n if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.\n\n selector = selector.replace(refRegExp, replaceRef);\n container.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n } else if (isNestedConditional) {\n // Place conditional right after the parent rule to ensure right ordering.\n container.addRule(prop, {}, options) // Flow expects more options but they aren't required\n // And flow doesn't know this will always be a StyleRule which has the addRule method\n // $FlowFixMe[incompatible-use]\n // $FlowFixMe[prop-missing]\n .addRule(styleRule.key, style[prop], {\n selector: styleRule.selector\n });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssNested;\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","import hyphenate from 'hyphenate-style-name';\n\n/**\n * Convert camel cased property names to dash separated.\n *\n * @param {Object} style\n * @return {Object}\n */\n\nfunction convertCase(style) {\n var converted = {};\n\n for (var prop in style) {\n var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);\n converted[key] = style[prop];\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);\n }\n\n return converted;\n}\n/**\n * Allow camel cased property names by converting them back to dasherized.\n *\n * @param {Rule} rule\n */\n\n\nfunction camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default camelCase;\n","import { hasCSSTOMSupport } from 'jss';\n\nvar px = hasCSSTOMSupport && CSS ? CSS.px : 'px';\nvar ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';\nvar percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';\n/**\n * Generated jss-plugin-default-unit CSS property units\n *\n * @type object\n */\n\nvar defaultUnits = {\n // Animation properties\n 'animation-delay': ms,\n 'animation-duration': ms,\n // Background properties\n 'background-position': px,\n 'background-position-x': px,\n 'background-position-y': px,\n 'background-size': px,\n // Border Properties\n border: px,\n 'border-bottom': px,\n 'border-bottom-left-radius': px,\n 'border-bottom-right-radius': px,\n 'border-bottom-width': px,\n 'border-left': px,\n 'border-left-width': px,\n 'border-radius': px,\n 'border-right': px,\n 'border-right-width': px,\n 'border-top': px,\n 'border-top-left-radius': px,\n 'border-top-right-radius': px,\n 'border-top-width': px,\n 'border-width': px,\n 'border-block': px,\n 'border-block-end': px,\n 'border-block-end-width': px,\n 'border-block-start': px,\n 'border-block-start-width': px,\n 'border-block-width': px,\n 'border-inline': px,\n 'border-inline-end': px,\n 'border-inline-end-width': px,\n 'border-inline-start': px,\n 'border-inline-start-width': px,\n 'border-inline-width': px,\n 'border-start-start-radius': px,\n 'border-start-end-radius': px,\n 'border-end-start-radius': px,\n 'border-end-end-radius': px,\n // Margin properties\n margin: px,\n 'margin-bottom': px,\n 'margin-left': px,\n 'margin-right': px,\n 'margin-top': px,\n 'margin-block': px,\n 'margin-block-end': px,\n 'margin-block-start': px,\n 'margin-inline': px,\n 'margin-inline-end': px,\n 'margin-inline-start': px,\n // Padding properties\n padding: px,\n 'padding-bottom': px,\n 'padding-left': px,\n 'padding-right': px,\n 'padding-top': px,\n 'padding-block': px,\n 'padding-block-end': px,\n 'padding-block-start': px,\n 'padding-inline': px,\n 'padding-inline-end': px,\n 'padding-inline-start': px,\n // Mask properties\n 'mask-position-x': px,\n 'mask-position-y': px,\n 'mask-size': px,\n // Width and height properties\n height: px,\n width: px,\n 'min-height': px,\n 'max-height': px,\n 'min-width': px,\n 'max-width': px,\n // Position properties\n bottom: px,\n left: px,\n top: px,\n right: px,\n inset: px,\n 'inset-block': px,\n 'inset-block-end': px,\n 'inset-block-start': px,\n 'inset-inline': px,\n 'inset-inline-end': px,\n 'inset-inline-start': px,\n // Shadow properties\n 'box-shadow': px,\n 'text-shadow': px,\n // Column properties\n 'column-gap': px,\n 'column-rule': px,\n 'column-rule-width': px,\n 'column-width': px,\n // Font and text properties\n 'font-size': px,\n 'font-size-delta': px,\n 'letter-spacing': px,\n 'text-decoration-thickness': px,\n 'text-indent': px,\n 'text-stroke': px,\n 'text-stroke-width': px,\n 'word-spacing': px,\n // Motion properties\n motion: px,\n 'motion-offset': px,\n // Outline properties\n outline: px,\n 'outline-offset': px,\n 'outline-width': px,\n // Perspective properties\n perspective: px,\n 'perspective-origin-x': percent,\n 'perspective-origin-y': percent,\n // Transform properties\n 'transform-origin': percent,\n 'transform-origin-x': percent,\n 'transform-origin-y': percent,\n 'transform-origin-z': percent,\n // Transition properties\n 'transition-delay': ms,\n 'transition-duration': ms,\n // Alignment properties\n 'vertical-align': px,\n 'flex-basis': px,\n // Some random properties\n 'shape-margin': px,\n size: px,\n gap: px,\n // Grid properties\n grid: px,\n 'grid-gap': px,\n 'row-gap': px,\n 'grid-row-gap': px,\n 'grid-column-gap': px,\n 'grid-template-rows': px,\n 'grid-template-columns': px,\n 'grid-auto-rows': px,\n 'grid-auto-columns': px,\n // Not existing properties.\n // Used to avoid issues with jss-plugin-expand integration.\n 'box-shadow-x': px,\n 'box-shadow-y': px,\n 'box-shadow-blur': px,\n 'box-shadow-spread': px,\n 'font-line-height': px,\n 'text-shadow-x': px,\n 'text-shadow-y': px,\n 'text-shadow-blur': px\n};\n\n/**\n * Clones the object and adds a camel cased property version.\n */\nfunction addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var _key in obj) {\n newObj[_key] = obj[_key];\n newObj[_key.replace(regExp, replace)] = obj[_key];\n }\n\n return newObj;\n}\n\nvar units = addCamelCasedVersion(defaultUnits);\n/**\n * Recursive deep style passing function\n */\n\nfunction iterate(prop, value, options) {\n if (value == null) return value;\n\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n value[i] = iterate(prop, value[i], options);\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n for (var innerProp in value) {\n value[innerProp] = iterate(innerProp, value[innerProp], options);\n }\n } else {\n for (var _innerProp in value) {\n value[_innerProp] = iterate(prop + \"-\" + _innerProp, value[_innerProp], options);\n }\n }\n } else if (typeof value === 'number' && !Number.isNaN(value)) {\n var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.\n\n if (unit && !(value === 0 && unit === px)) {\n return typeof unit === 'function' ? unit(value).toString() : \"\" + value + unit;\n }\n\n return value.toString();\n }\n\n return value;\n}\n/**\n * Add unit to numeric values.\n */\n\n\nfunction defaultUnit(options) {\n if (options === void 0) {\n options = {};\n }\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default defaultUnit;\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import isInBrowser from 'is-in-browser';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\n\n// Export javascript style and css style vendor prefixes.\nvar js = '';\nvar css = '';\nvar vendor = '';\nvar browser = '';\nvar isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.\n\nif (isInBrowser) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n\n var _document$createEleme = document.createElement('p'),\n style = _document$createEleme.style;\n\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n } // Correctly detect the Edge browser.\n\n\n if (js === 'Webkit' && 'msHyphens' in style) {\n js = 'ms';\n css = jsCssMap.ms;\n browser = 'edge';\n } // Correctly detect the Safari browser.\n\n\n if (js === 'Webkit' && '-apple-trailing-word' in style) {\n vendor = 'apple';\n }\n}\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String, vendor: String, browser: String}}\n * @api public\n */\n\n\nvar prefix = {\n js: js,\n css: css,\n vendor: vendor,\n browser: browser,\n isTouch: isTouch\n};\n\n/**\n * Test if a keyframe at-rule should be prefixed or not\n *\n * @param {String} vendor prefix string for the current browser.\n * @return {String}\n * @api public\n */\n\nfunction supportedKeyframes(key) {\n // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'\n if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.\n // https://caniuse.com/#search=keyframes\n\n if (prefix.js === 'ms') return key;\n return \"@\" + prefix.css + \"keyframes\" + key.substr(10);\n}\n\n// https://caniuse.com/#search=appearance\n\nvar appearence = {\n noPrefill: ['appearance'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'appearance') return false;\n if (prefix.js === 'ms') return \"-webkit-\" + prop;\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=color-adjust\n\nvar colorAdjust = {\n noPrefill: ['color-adjust'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'color-adjust') return false;\n if (prefix.js === 'Webkit') return prefix.css + \"print-\" + prop;\n return prop;\n }\n};\n\nvar regExp = /[-\\s]+(.)?/g;\n/**\n * Replaces the letter with the capital letter\n *\n * @param {String} match\n * @param {String} c\n * @return {String}\n * @api private\n */\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}\n/**\n * Convert dash separated strings to camel-cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\n\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\n/**\n * Convert dash separated strings to pascal cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction pascalize(str) {\n return camelize(\"-\" + str);\n}\n\n// but we can use a longhand property instead.\n// https://caniuse.com/#search=mask\n\nvar mask = {\n noPrefill: ['mask'],\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^mask/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var longhand = 'mask-image';\n\n if (camelize(longhand) in style) {\n return prop;\n }\n\n if (prefix.js + pascalize(longhand) in style) {\n return prefix.css + prop;\n }\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=text-orientation\n\nvar textOrientation = {\n noPrefill: ['text-orientation'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'text-orientation') return false;\n\n if (prefix.vendor === 'apple' && !prefix.isTouch) {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=transform\n\nvar transform = {\n noPrefill: ['transform'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transform') return false;\n\n if (options.transform) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=transition\n\nvar transition = {\n noPrefill: ['transition'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transition') return false;\n\n if (options.transition) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=writing-mode\n\nvar writingMode = {\n noPrefill: ['writing-mode'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'writing-mode') return false;\n\n if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=user-select\n\nvar userSelect = {\n noPrefill: ['user-select'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'user-select') return false;\n\n if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=multicolumn\n// https://github.com/postcss/autoprefixer/issues/491\n// https://github.com/postcss/autoprefixer/issues/177\n\nvar breakPropsOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^break-/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var jsProp = \"WebkitColumn\" + pascalize(prop);\n return jsProp in style ? prefix.css + \"column-\" + prop : false;\n }\n\n if (prefix.js === 'Moz') {\n var _jsProp = \"page\" + pascalize(prop);\n\n return _jsProp in style ? \"page-\" + prop : false;\n }\n\n return false;\n }\n};\n\n// See https://github.com/postcss/autoprefixer/issues/324.\n\nvar inlineLogicalOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^(border|margin|padding)-inline/.test(prop)) return false;\n if (prefix.js === 'Moz') return prop;\n var newProp = prop.replace('-inline', '');\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\n// Camelization is required because we can't test using.\n// CSS syntax for e.g. in FF.\n\nvar unprefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n return camelize(prop) in style ? prop : false;\n }\n};\n\nvar prefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.\n\n if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.\n\n if (prop[0] === '-' && prop[1] === '-') return prop;\n if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.\n\n if (prefix.js !== 'Webkit' && \"Webkit\" + pascalized in style) return \"-webkit-\" + prop;\n return false;\n }\n};\n\n// https://caniuse.com/#search=scroll-snap\n\nvar scrollSnap = {\n supportedProperty: function supportedProperty(prop) {\n if (prop.substring(0, 11) !== 'scroll-snap') return false;\n\n if (prefix.js === 'ms') {\n return \"\" + prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=overscroll-behavior\n\nvar overscrollBehavior = {\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'overscroll-behavior') return false;\n\n if (prefix.js === 'ms') {\n return prefix.css + \"scroll-chaining\";\n }\n\n return prop;\n }\n};\n\nvar propMap = {\n 'flex-grow': 'flex-positive',\n 'flex-shrink': 'flex-negative',\n 'flex-basis': 'flex-preferred-size',\n 'justify-content': 'flex-pack',\n order: 'flex-order',\n 'align-items': 'flex-align',\n 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.\n\n}; // Support old flex spec from 2012.\n\nvar flex2012 = {\n supportedProperty: function supportedProperty(prop, style) {\n var newProp = propMap[prop];\n if (!newProp) return false;\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\nvar propMap$1 = {\n flex: 'box-flex',\n 'flex-grow': 'box-flex',\n 'flex-direction': ['box-orient', 'box-direction'],\n order: 'box-ordinal-group',\n 'align-items': 'box-align',\n 'flex-flow': ['box-orient', 'box-direction'],\n 'justify-content': 'box-pack'\n};\nvar propKeys = Object.keys(propMap$1);\n\nvar prefixCss = function prefixCss(p) {\n return prefix.css + p;\n}; // Support old flex spec from 2009.\n\n\nvar flex2009 = {\n supportedProperty: function supportedProperty(prop, style, _ref) {\n var multiple = _ref.multiple;\n\n if (propKeys.indexOf(prop) > -1) {\n var newProp = propMap$1[prop];\n\n if (!Array.isArray(newProp)) {\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n\n if (!multiple) return false;\n\n for (var i = 0; i < newProp.length; i++) {\n if (!(prefix.js + pascalize(newProp[0]) in style)) {\n return false;\n }\n }\n\n return newProp.map(prefixCss);\n }\n\n return false;\n }\n};\n\n// plugins = [\n// ...plugins,\n// breakPropsOld,\n// inlineLogicalOld,\n// unprefixed,\n// prefixed,\n// scrollSnap,\n// flex2012,\n// flex2009\n// ]\n// Plugins without 'noPrefill' value, going last.\n// 'flex-*' plugins should be at the bottom.\n// 'flex2009' going after 'flex2012'.\n// 'prefixed' going after 'unprefixed'\n\nvar plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];\nvar propertyDetectors = plugins.filter(function (p) {\n return p.supportedProperty;\n}).map(function (p) {\n return p.supportedProperty;\n});\nvar noPrefill = plugins.filter(function (p) {\n return p.noPrefill;\n}).reduce(function (a, p) {\n a.push.apply(a, _toConsumableArray(p.noPrefill));\n return a;\n}, []);\n\nvar el;\nvar cache = {};\n\nif (isInBrowser) {\n el = document.createElement('p'); // We test every property on vendor prefix requirement.\n // Once tested, result is cached. It gives us up to 70% perf boost.\n // http://jsperf.com/element-style-object-access-vs-plain-object\n //\n // Prefill cache with known css properties to reduce amount of\n // properties we need to feature test at runtime.\n // http://davidwalsh.name/vendor-prefix\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key$1 in computed) {\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];\n } // Properties that cannot be correctly detected using the\n // cache prefill method.\n\n\n noPrefill.forEach(function (x) {\n return delete cache[x];\n });\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @param {Object} [options]\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop, options) {\n if (options === void 0) {\n options = {};\n }\n\n // For server-side rendering.\n if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {\n return cache[prop];\n } // Check if 'transition' or 'transform' natively supported in browser.\n\n\n if (prop === 'transition' || prop === 'transform') {\n options[prop] = prop in el.style;\n } // Find a plugin for current prefix property.\n\n\n for (var i = 0; i < propertyDetectors.length; i++) {\n cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.\n\n if (cache[prop]) break;\n } // Reset styles for current property.\n // Firefox can even throw an error for invalid properties, e.g., \"0\".\n\n\n try {\n el.style[prop] = '';\n } catch (err) {\n return false;\n }\n\n return cache[prop];\n}\n\nvar cache$1 = {};\nvar transitionProperties = {\n transition: 1,\n 'transition-property': 1,\n '-webkit-transition': 1,\n '-webkit-transition-property': 1\n};\nvar transPropsRegExp = /(^\\s*[\\w-]+)|, (\\s*[\\w-]+)(?![^()]*\\))/g;\nvar el$1;\n/**\n * Returns prefixed value transition/transform if needed.\n *\n * @param {String} match\n * @param {String} p1\n * @param {String} p2\n * @return {String}\n * @api private\n */\n\nfunction prefixTransitionCallback(match, p1, p2) {\n if (p1 === 'var') return 'var';\n if (p1 === 'all') return 'all';\n if (p2 === 'all') return ', all';\n var prefixedValue = p1 ? supportedProperty(p1) : \", \" + supportedProperty(p2);\n if (!prefixedValue) return p1 || p2;\n return prefixedValue;\n}\n\nif (isInBrowser) el$1 = document.createElement('p');\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\n\nfunction supportedValue(property, value) {\n // For server-side rendering.\n var prefixedValue = value;\n if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n // eslint-disable-next-line no-restricted-globals\n\n if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {\n return prefixedValue;\n } // Create cache key for current value.\n\n\n var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {\n return cache$1[cacheKey];\n } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.\n\n\n try {\n // Test value as it is.\n el$1.style[property] = prefixedValue;\n } catch (err) {\n // Return false if value not supported.\n cache$1[cacheKey] = false;\n return false;\n } // If 'transition' or 'transition-property' property.\n\n\n if (transitionProperties[property]) {\n prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);\n } else if (el$1.style[property] === '') {\n // Value with a vendor prefix.\n prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n\n if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.\n\n el$1.style[property] = prefixedValue; // Return false if value not supported.\n\n if (el$1.style[property] === '') {\n cache$1[cacheKey] = false;\n return false;\n }\n } // Reset styles for current property.\n\n\n el$1.style[property] = ''; // Write current value to cache.\n\n cache$1[cacheKey] = prefixedValue;\n return cache$1[cacheKey];\n}\n\nexport { prefix, supportedKeyframes, supportedProperty, supportedValue };\n","import { supportedKeyframes, supportedValue, supportedProperty } from 'css-vendor';\nimport { toCssValue } from 'jss';\n\n/**\n * Add vendor prefix to a property name when needed.\n *\n * @api public\n */\n\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n var atRule = rule;\n atRule.at = supportedKeyframes(atRule.at);\n }\n }\n\n function prefixStyle(style) {\n for (var prop in style) {\n var value = style[prop];\n\n if (prop === 'fallbacks' && Array.isArray(value)) {\n style[prop] = value.map(prefixStyle);\n continue;\n }\n\n var changeProp = false;\n var supportedProp = supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n var changeValue = false;\n var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));\n if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue$1 || value;\n }\n }\n\n return style;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n return prefixStyle(style);\n }\n\n function onChangeValue(value, prop) {\n return supportedValue(prop, toCssValue(value)) || value;\n }\n\n return {\n onProcessRule: onProcessRule,\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssVendorPrefixer;\n","/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n}\n\nexport default jssPropsSort;\n","import functions from 'jss-plugin-rule-value-function';\nimport global from 'jss-plugin-global';\nimport nested from 'jss-plugin-nested';\nimport camelCase from 'jss-plugin-camel-case';\nimport defaultUnit from 'jss-plugin-default-unit';\nimport vendorPrefixer from 'jss-plugin-vendor-prefixer';\nimport propsSort from 'jss-plugin-props-sort'; // Subset of jss-preset-default with only the plugins the Material-UI components are using.\n\nexport default function jssPreset() {\n return {\n plugins: [functions(), global(), nested(), camelCase(), defaultUnit(), // Disable the vendor prefixer server-side, it does nothing.\n // This way, we can get a performance boost.\n // In the documentation, we are using `autoprefixer` to solve this problem.\n typeof window === 'undefined' ? null : vendorPrefixer(), propsSort()]\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@material-ui/utils';\nimport createGenerateClassName from '../createGenerateClassName';\nimport { create } from 'jss';\nimport jssPreset from '../jssPreset'; // Default JSS instance.\n\nvar jss = create(jssPreset()); // Use a singleton or the provided one by the context.\n//\n// The counter-based approach doesn't tolerate any mistake.\n// It's much safer to use the same counter everywhere.\n\nvar generateClassName = createGenerateClassName(); // Exported for test purposes\n\nexport var sheetsManager = new Map();\nvar defaultOptions = {\n disableGeneration: false,\n generateClassName: generateClassName,\n jss: jss,\n sheetsCache: null,\n sheetsManager: sheetsManager,\n sheetsRegistry: null\n};\nexport var StylesContext = React.createContext(defaultOptions);\n\nif (process.env.NODE_ENV !== 'production') {\n StylesContext.displayName = 'StylesContext';\n}\n\nvar injectFirstNode;\nexport default function StylesProvider(props) {\n var children = props.children,\n _props$injectFirst = props.injectFirst,\n injectFirst = _props$injectFirst === void 0 ? false : _props$injectFirst,\n _props$disableGenerat = props.disableGeneration,\n disableGeneration = _props$disableGenerat === void 0 ? false : _props$disableGenerat,\n localOptions = _objectWithoutProperties(props, [\"children\", \"injectFirst\", \"disableGeneration\"]);\n\n var outerOptions = React.useContext(StylesContext);\n\n var context = _extends({}, outerOptions, {\n disableGeneration: disableGeneration\n }, localOptions);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window === 'undefined' && !context.sheetsManager) {\n console.error('Material-UI: You need to use the ServerStyleSheets API when rendering on the server.');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (context.jss.options.insertionPoint && injectFirst) {\n console.error('Material-UI: You cannot use a custom insertionPoint and at the same time.');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (injectFirst && localOptions.jss) {\n console.error('Material-UI: You cannot use the jss and injectFirst props at the same time.');\n }\n }\n\n if (!context.jss.options.insertionPoint && injectFirst && typeof window !== 'undefined') {\n if (!injectFirstNode) {\n var head = document.head;\n injectFirstNode = document.createComment('mui-inject-first');\n head.insertBefore(injectFirstNode, head.firstChild);\n }\n\n context.jss = create({\n plugins: jssPreset().plugins,\n insertionPoint: injectFirstNode\n });\n }\n\n return /*#__PURE__*/React.createElement(StylesContext.Provider, {\n value: context\n }, children);\n}\nprocess.env.NODE_ENV !== \"production\" ? StylesProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node.isRequired,\n\n /**\n * You can disable the generation of the styles with this option.\n * It can be useful when traversing the React tree outside of the HTML\n * rendering step on the server.\n * Let's say you are using react-apollo to extract all\n * the queries made by the interface server-side - you can significantly speed up the traversal with this prop.\n */\n disableGeneration: PropTypes.bool,\n\n /**\n * JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n\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 Material-UI's styles, set this prop.\n */\n injectFirst: PropTypes.bool,\n\n /**\n * JSS's instance.\n */\n jss: PropTypes.object,\n\n /**\n * @ignore\n */\n serverGenerateClassName: PropTypes.func,\n\n /**\n * @ignore\n *\n * Beta feature.\n *\n * Cache for the sheets.\n */\n sheetsCache: PropTypes.object,\n\n /**\n * @ignore\n *\n * The sheetsManager is used to deduplicate style sheet injection in the page.\n * It's deduplicating using the (theme, styles) couple.\n * On the server, you should provide a new instance for each request.\n */\n sheetsManager: PropTypes.object,\n\n /**\n * @ignore\n *\n * Collect the sheets.\n */\n sheetsRegistry: PropTypes.object\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? StylesProvider.propTypes = exactProp(StylesProvider.propTypes) : void 0;\n}","/* eslint-disable import/prefer-default-export */\n// Global index counter to preserve source order.\n// We create the style sheet during the creation of the component,\n// children are handled after the parents, so the order of style elements would be parent->child.\n// It is a problem though when a parent passes a className\n// which needs to override any child's styles.\n// StyleSheet of the child has a higher specificity, because of the source order.\n// So our solution is to render sheets them in the reverse order child->sheet, so\n// that parent has a higher specificity.\nvar indexCounter = -1e9;\nexport function increment() {\n indexCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (indexCounter >= 0) {\n console.warn(['Material-UI: You might have a memory leak.', 'The indexCounter is not supposed to grow that much.'].join('\\n'));\n }\n }\n\n return indexCounter;\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nexport function isPlainObject(item) {\n return item && _typeof(item) === 'object' && item.constructor === Object;\n}\nexport default function deepmerge(target, source) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n clone: true\n };\n var output = options.clone ? _extends({}, target) : target;\n\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(function (key) {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n\n if (isPlainObject(source[key]) && key in target) {\n output[key] = deepmerge(target[key], source[key], options);\n } else {\n output[key] = source[key];\n }\n });\n }\n\n return output;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport { deepmerge } from '@material-ui/utils';\nimport noopTheme from './noopTheme';\nexport default function getStylesCreator(stylesOrCreator) {\n var themingEnabled = typeof stylesOrCreator === 'function';\n\n if (process.env.NODE_ENV !== 'production') {\n if (_typeof(stylesOrCreator) !== 'object' && !themingEnabled) {\n console.error(['Material-UI: The `styles` argument provided is invalid.', 'You need to provide a function generating the styles or a styles object.'].join('\\n'));\n }\n }\n\n return {\n create: function create(theme, name) {\n var styles;\n\n try {\n styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n if (themingEnabled === true && theme === noopTheme) {\n // TODO: prepend error message/name instead\n console.error(['Material-UI: The `styles` 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\n throw err;\n }\n\n if (!name || !theme.overrides || !theme.overrides[name]) {\n return styles;\n }\n\n var overrides = theme.overrides[name];\n\n var stylesWithOverrides = _extends({}, styles);\n\n Object.keys(overrides).forEach(function (key) {\n if (process.env.NODE_ENV !== 'production') {\n if (!stylesWithOverrides[key]) {\n console.warn(['Material-UI: You are trying to override a style that does not exist.', \"Fix the `\".concat(key, \"` key of `theme.overrides.\").concat(name, \"`.\")].join('\\n'));\n }\n }\n\n stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key], overrides[key]);\n });\n return stylesWithOverrides;\n },\n options: {}\n };\n}","// We use the same empty object to ref count the styles that don't need a theme object.\nvar noopTheme = {};\nexport default noopTheme;","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport React from 'react';\nimport { getDynamicStyles } from 'jss';\nimport mergeClasses from '../mergeClasses';\nimport multiKeyStore from './multiKeyStore';\nimport useTheme from '../useTheme';\nimport { StylesContext } from '../StylesProvider';\nimport { increment } from './indexCounter';\nimport getStylesCreator from '../getStylesCreator';\nimport noopTheme from '../getStylesCreator/noopTheme';\n\nfunction getClasses(_ref, classes, Component) {\n var state = _ref.state,\n stylesOptions = _ref.stylesOptions;\n\n if (stylesOptions.disableGeneration) {\n return classes || {};\n }\n\n if (!state.cacheClasses) {\n state.cacheClasses = {\n // Cache for the finalized classes value.\n value: null,\n // Cache for the last used classes prop pointer.\n lastProp: null,\n // Cache for the last used rendered classes pointer.\n lastJSS: {}\n };\n } // Tracks if either the rendered classes or classes prop has changed,\n // requiring the generation of a new finalized classes object.\n\n\n var generate = false;\n\n if (state.classes !== state.cacheClasses.lastJSS) {\n state.cacheClasses.lastJSS = state.classes;\n generate = true;\n }\n\n if (classes !== state.cacheClasses.lastProp) {\n state.cacheClasses.lastProp = classes;\n generate = true;\n }\n\n if (generate) {\n state.cacheClasses.value = mergeClasses({\n baseClasses: state.cacheClasses.lastJSS,\n newClasses: classes,\n Component: Component\n });\n }\n\n return state.cacheClasses.value;\n}\n\nfunction attach(_ref2, props) {\n var state = _ref2.state,\n theme = _ref2.theme,\n stylesOptions = _ref2.stylesOptions,\n stylesCreator = _ref2.stylesCreator,\n name = _ref2.name;\n\n if (stylesOptions.disableGeneration) {\n return;\n }\n\n var sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);\n\n if (!sheetManager) {\n sheetManager = {\n refs: 0,\n staticSheet: null,\n dynamicStyles: null\n };\n multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager);\n }\n\n var options = _extends({}, stylesCreator.options, stylesOptions, {\n theme: theme,\n flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl'\n });\n\n options.generateId = options.serverGenerateClassName || options.generateClassName;\n var sheetsRegistry = stylesOptions.sheetsRegistry;\n\n if (sheetManager.refs === 0) {\n var staticSheet;\n\n if (stylesOptions.sheetsCache) {\n staticSheet = multiKeyStore.get(stylesOptions.sheetsCache, stylesCreator, theme);\n }\n\n var styles = stylesCreator.create(theme, name);\n\n if (!staticSheet) {\n staticSheet = stylesOptions.jss.createStyleSheet(styles, _extends({\n link: false\n }, options));\n staticSheet.attach();\n\n if (stylesOptions.sheetsCache) {\n multiKeyStore.set(stylesOptions.sheetsCache, stylesCreator, theme, staticSheet);\n }\n }\n\n if (sheetsRegistry) {\n sheetsRegistry.add(staticSheet);\n }\n\n sheetManager.staticSheet = staticSheet;\n sheetManager.dynamicStyles = getDynamicStyles(styles);\n }\n\n if (sheetManager.dynamicStyles) {\n var dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, _extends({\n link: true\n }, options));\n dynamicSheet.update(props);\n dynamicSheet.attach();\n state.dynamicSheet = dynamicSheet;\n state.classes = mergeClasses({\n baseClasses: sheetManager.staticSheet.classes,\n newClasses: dynamicSheet.classes\n });\n\n if (sheetsRegistry) {\n sheetsRegistry.add(dynamicSheet);\n }\n } else {\n state.classes = sheetManager.staticSheet.classes;\n }\n\n sheetManager.refs += 1;\n}\n\nfunction update(_ref3, props) {\n var state = _ref3.state;\n\n if (state.dynamicSheet) {\n state.dynamicSheet.update(props);\n }\n}\n\nfunction detach(_ref4) {\n var state = _ref4.state,\n theme = _ref4.theme,\n stylesOptions = _ref4.stylesOptions,\n stylesCreator = _ref4.stylesCreator;\n\n if (stylesOptions.disableGeneration) {\n return;\n }\n\n var sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);\n sheetManager.refs -= 1;\n var sheetsRegistry = stylesOptions.sheetsRegistry;\n\n if (sheetManager.refs === 0) {\n multiKeyStore.delete(stylesOptions.sheetsManager, stylesCreator, theme);\n stylesOptions.jss.removeStyleSheet(sheetManager.staticSheet);\n\n if (sheetsRegistry) {\n sheetsRegistry.remove(sheetManager.staticSheet);\n }\n }\n\n if (state.dynamicSheet) {\n stylesOptions.jss.removeStyleSheet(state.dynamicSheet);\n\n if (sheetsRegistry) {\n sheetsRegistry.remove(state.dynamicSheet);\n }\n }\n}\n\nfunction useSynchronousEffect(func, values) {\n var key = React.useRef([]);\n var output; // Store \"generation\" key. Just returns a new object every time\n\n var currentKey = React.useMemo(function () {\n return {};\n }, values); // eslint-disable-line react-hooks/exhaustive-deps\n // \"the first render\", or \"memo dropped the value\"\n\n if (key.current !== currentKey) {\n key.current = currentKey;\n output = func();\n }\n\n React.useEffect(function () {\n return function () {\n if (output) {\n output();\n }\n };\n }, [currentKey] // eslint-disable-line react-hooks/exhaustive-deps\n );\n}\n\nexport default function makeStyles(stylesOrCreator) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var name = options.name,\n classNamePrefixOption = options.classNamePrefix,\n Component = options.Component,\n _options$defaultTheme = options.defaultTheme,\n defaultTheme = _options$defaultTheme === void 0 ? noopTheme : _options$defaultTheme,\n stylesOptions2 = _objectWithoutProperties(options, [\"name\", \"classNamePrefix\", \"Component\", \"defaultTheme\"]);\n\n var stylesCreator = getStylesCreator(stylesOrCreator);\n var classNamePrefix = name || classNamePrefixOption || 'makeStyles';\n stylesCreator.options = {\n index: increment(),\n name: name,\n meta: classNamePrefix,\n classNamePrefix: classNamePrefix\n };\n\n var useStyles = function useStyles() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var theme = useTheme() || defaultTheme;\n\n var stylesOptions = _extends({}, React.useContext(StylesContext), stylesOptions2);\n\n var instance = React.useRef();\n var shouldUpdate = React.useRef();\n useSynchronousEffect(function () {\n var current = {\n name: name,\n state: {},\n stylesCreator: stylesCreator,\n stylesOptions: stylesOptions,\n theme: theme\n };\n attach(current, props);\n shouldUpdate.current = false;\n instance.current = current;\n return function () {\n detach(current);\n };\n }, [theme, stylesCreator]);\n React.useEffect(function () {\n if (shouldUpdate.current) {\n update(instance.current, props);\n }\n\n shouldUpdate.current = true;\n });\n var classes = getClasses(instance.current, props.classes, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(classes);\n }\n\n return classes;\n };\n\n return useStyles;\n}","/* eslint-disable no-restricted-syntax */\nexport default function getThemeProps(params) {\n var theme = params.theme,\n name = params.name,\n props = params.props;\n\n if (!theme || !theme.props || !theme.props[name]) {\n return props;\n } // Resolve default props, code borrow from React source.\n // https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221\n\n\n var defaultProps = theme.props[name];\n var propName;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n\n return props;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { chainPropTypes, getDisplayName } from '@material-ui/utils';\nimport makeStyles from '../makeStyles';\nimport getThemeProps from '../getThemeProps';\nimport useTheme from '../useTheme'; // Link a style sheet with a component.\n// It does not modify the component passed to it;\n// instead, it returns a new component, with a `classes` property.\n\nvar withStyles = function withStyles(stylesOrCreator) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function (Component) {\n var defaultTheme = options.defaultTheme,\n _options$withTheme = options.withTheme,\n withTheme = _options$withTheme === void 0 ? false : _options$withTheme,\n name = options.name,\n stylesOptions = _objectWithoutProperties(options, [\"defaultTheme\", \"withTheme\", \"name\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (Component === undefined) {\n throw new Error(['You are calling withStyles(styles)(Component) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n }\n\n var classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n var displayName = getDisplayName(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n var useStyles = makeStyles(stylesOrCreator, _extends({\n defaultTheme: defaultTheme,\n Component: Component,\n name: name || Component.displayName,\n classNamePrefix: classNamePrefix\n }, stylesOptions));\n var WithStyles = /*#__PURE__*/React.forwardRef(function WithStyles(props, ref) {\n var classesProp = props.classes,\n innerRef = props.innerRef,\n other = _objectWithoutProperties(props, [\"classes\", \"innerRef\"]); // The wrapper receives only user supplied props, which could be a subset of\n // the actual props Component might receive due to merging with defaultProps.\n // So copying it here would give us the same result in the wrapper as well.\n\n\n var classes = useStyles(_extends({}, Component.defaultProps, props));\n var theme;\n var more = other;\n\n if (typeof name === 'string' || withTheme) {\n // name and withTheme are invariant in the outer scope\n // eslint-disable-next-line react-hooks/rules-of-hooks\n theme = useTheme() || defaultTheme;\n\n if (name) {\n more = getThemeProps({\n theme: theme,\n name: name,\n props: other\n });\n } // Provide the theme to the wrapped component.\n // So we don't have to use the `withTheme()` Higher-order Component.\n\n\n if (withTheme && !more.theme) {\n more.theme = theme;\n }\n }\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n ref: innerRef || ref,\n classes: classes\n }, more));\n });\n process.env.NODE_ENV !== \"production\" ? WithStyles.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * Use that prop to pass a ref to the decorated component.\n * @deprecated\n */\n innerRef: chainPropTypes(PropTypes.oneOfType([PropTypes.func, PropTypes.object]), function (props) {\n if (props.innerRef == null) {\n return null;\n }\n\n return null; // return new Error(\n // 'Material-UI: The `innerRef` prop is deprecated and will be removed in v5. ' +\n // 'Refs are now automatically forwarded to the inner component.',\n // );\n })\n } : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n WithStyles.displayName = \"WithStyles(\".concat(getDisplayName(Component), \")\");\n }\n\n hoistNonReactStatics(WithStyles, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithStyles.Naked = Component;\n WithStyles.options = options;\n WithStyles.useStyles = useStyles;\n }\n\n return WithStyles;\n };\n};\n\nexport default withStyles;","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport var keys = ['xs', 'sm', 'md', 'lg', 'xl']; // Keep in mind that @media is inclusive by the CSS specification.\n\nexport default function createBreakpoints(breakpoints) {\n var _breakpoints$values = breakpoints.values,\n values = _breakpoints$values === void 0 ? {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n } : _breakpoints$values,\n _breakpoints$unit = breakpoints.unit,\n unit = _breakpoints$unit === void 0 ? 'px' : _breakpoints$unit,\n _breakpoints$step = breakpoints.step,\n step = _breakpoints$step === void 0 ? 5 : _breakpoints$step,\n other = _objectWithoutProperties(breakpoints, [\"values\", \"unit\", \"step\"]);\n\n function up(key) {\n var value = typeof values[key] === 'number' ? values[key] : key;\n return \"@media (min-width:\".concat(value).concat(unit, \")\");\n }\n\n function down(key) {\n var endIndex = keys.indexOf(key) + 1;\n var upperbound = values[keys[endIndex]];\n\n if (endIndex === keys.length) {\n // xl down applies to all sizes\n return up('xs');\n }\n\n var value = typeof upperbound === 'number' && endIndex > 0 ? upperbound : key;\n return \"@media (max-width:\".concat(value - step / 100).concat(unit, \")\");\n }\n\n function between(start, end) {\n var endIndex = keys.indexOf(end);\n\n if (endIndex === keys.length - 1) {\n return up(start);\n }\n\n return \"@media (min-width:\".concat(typeof values[start] === 'number' ? values[start] : start).concat(unit, \") and \") + \"(max-width:\".concat((endIndex !== -1 && typeof values[keys[endIndex + 1]] === 'number' ? values[keys[endIndex + 1]] : end) - step / 100).concat(unit, \")\");\n }\n\n function only(key) {\n return between(key, key);\n }\n\n function width(key) {\n return values[key];\n }\n\n return _extends({\n keys: keys,\n values: values,\n up: up,\n down: down,\n between: between,\n only: only,\n width: width\n }, other);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, spacing, mixins) {\n var _toolbar;\n\n return _extends({\n gutters: function gutters() {\n var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // To deprecate in v4.1\n // warning(\n // false,\n // [\n // 'Material-UI: Theme.mixins.gutters() is deprecated.',\n // 'You can use the source of the mixin directly:',\n // `\n // paddingLeft: theme.spacing(2),\n // paddingRight: theme.spacing(2),\n // [theme.breakpoints.up('sm')]: {\n // paddingLeft: theme.spacing(3),\n // paddingRight: theme.spacing(3),\n // },\n // `,\n // ].join('\\n'),\n // );\n return _extends({\n paddingLeft: spacing(2),\n paddingRight: spacing(2)\n }, styles, _defineProperty({}, breakpoints.up('sm'), _extends({\n paddingLeft: spacing(3),\n paddingRight: spacing(3)\n }, styles[breakpoints.up('sm')])));\n },\n toolbar: (_toolbar = {\n minHeight: 56\n }, _defineProperty(_toolbar, \"\".concat(breakpoints.up('xs'), \" and (orientation: landscape)\"), {\n minHeight: 48\n }), _defineProperty(_toolbar, breakpoints.up('sm'), {\n minHeight: 64\n }), _toolbar)\n }, mixins);\n}","var common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","var 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: '#d5d5d5',\n A200: '#aaaaaa',\n A400: '#303030',\n A700: '#616161'\n};\nexport default grey;","var indigo = {\n 50: '#e8eaf6',\n 100: '#c5cae9',\n 200: '#9fa8da',\n 300: '#7986cb',\n 400: '#5c6bc0',\n 500: '#3f51b5',\n 600: '#3949ab',\n 700: '#303f9f',\n 800: '#283593',\n 900: '#1a237e',\n A100: '#8c9eff',\n A200: '#536dfe',\n A400: '#3d5afe',\n A700: '#304ffe'\n};\nexport default indigo;","var pink = {\n 50: '#fce4ec',\n 100: '#f8bbd0',\n 200: '#f48fb1',\n 300: '#f06292',\n 400: '#ec407a',\n 500: '#e91e63',\n 600: '#d81b60',\n 700: '#c2185b',\n 800: '#ad1457',\n 900: '#880e4f',\n A100: '#ff80ab',\n A200: '#ff4081',\n A400: '#f50057',\n A700: '#c51162'\n};\nexport default pink;","var 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;","var 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;","var 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;","var 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;","import { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@material-ui/utils\";\n\n/* eslint-disable no-use-before-define */\n\n/**\n * Returns a number whose value is limited to the given range.\n *\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 clamp(value) {\n var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(\"Material-UI: The value provided \".concat(value, \" is out of range [\").concat(min, \", \").concat(max, \"].\"));\n }\n }\n\n return Math.min(Math.max(min, value), max);\n}\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n *\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\n\n\nexport function hexToRgb(color) {\n color = color.substr(1);\n var re = new RegExp(\".{1,\".concat(color.length >= 6 ? 2 : 1, \"}\"), 'g');\n var colors = color.match(re);\n\n if (colors && colors[0].length === 1) {\n colors = colors.map(function (n) {\n return n + n;\n });\n }\n\n return colors ? \"rgb\".concat(colors.length === 4 ? 'a' : '', \"(\").concat(colors.map(function (n, index) {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', '), \")\") : '';\n}\n\nfunction intToHex(int) {\n var hex = int.toString(16);\n return hex.length === 1 ? \"0\".concat(hex) : hex;\n}\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n *\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\n\n\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n\n var _decomposeColor = decomposeColor(color),\n values = _decomposeColor.values;\n\n return \"#\".concat(values.map(function (n) {\n return intToHex(n);\n }).join(''));\n}\n/**\n * Converts a color from hsl format to rgb format.\n *\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\n\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n var _color = color,\n values = _color.values;\n var h = values[0];\n var s = values[1] / 100;\n var l = values[2] / 100;\n var a = s * Math.min(l, 1 - l);\n\n var f = function f(n) {\n var k = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (n + h / 30) % 12;\n return l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n };\n\n var type = 'rgb';\n var rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n\n return recomposeColor({\n type: type,\n values: rgb\n });\n}\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\n\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n\n var marker = color.indexOf('(');\n var type = color.substring(0, marker);\n\n if (['rgb', 'rgba', 'hsl', 'hsla'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: Unsupported `\".concat(color, \"` color.\\nWe support the following formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla().\") : _formatMuiErrorMessage(3, color));\n }\n\n var values = color.substring(marker + 1, color.length - 1).split(',');\n values = values.map(function (value) {\n return parseFloat(value);\n });\n return {\n type: type,\n values: values\n };\n}\n/**\n * Converts a color object with type and values to a string.\n *\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\n\nexport function recomposeColor(color) {\n var type = color.type;\n var values = color.values;\n\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map(function (n, i) {\n return i < 3 ? parseInt(n, 10) : n;\n });\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = \"\".concat(values[1], \"%\");\n values[2] = \"\".concat(values[2], \"%\");\n }\n\n return \"\".concat(type, \"(\").concat(values.join(', '), \")\");\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 *\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 */\n\nexport function getContrastRatio(foreground, background) {\n var lumA = getLuminance(foreground);\n var lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\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 *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\n\nexport function getLuminance(color) {\n color = decomposeColor(color);\n var rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(function (val) {\n val /= 255; // normalized\n\n return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);\n }); // Truncate at 3 digits\n\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\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 */\n\nexport function emphasize(color) {\n var coefficient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.15;\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}\n/**\n * Set the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\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 */\n\nexport function fade(color, value) {\n color = decomposeColor(color);\n value = clamp(value);\n\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n\n color.values[3] = value;\n return recomposeColor(color);\n}\n/**\n * Darkens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\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 */\n\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (var i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n\n return recomposeColor(color);\n}\n/**\n * Lightens a color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\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 */\n\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\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 (var i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(color);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@material-ui/utils\";\nimport { deepmerge } from '@material-ui/utils';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport indigo from '../colors/indigo';\nimport pink from '../colors/pink';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport green from '../colors/green';\nimport { darken, getContrastRatio, lighten } from './colorManipulator';\nexport var 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.54)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)',\n // Text hints.\n hint: '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: grey[50]\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 var dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n hint: '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: grey[800],\n default: '#303030'\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};\n\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n var tonalOffsetLight = tonalOffset.light || tonalOffset;\n var tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n\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}\n\nexport default function createPalette(palette) {\n var _palette$primary = palette.primary,\n primary = _palette$primary === void 0 ? {\n light: indigo[300],\n main: indigo[500],\n dark: indigo[700]\n } : _palette$primary,\n _palette$secondary = palette.secondary,\n secondary = _palette$secondary === void 0 ? {\n light: pink.A200,\n main: pink.A400,\n dark: pink.A700\n } : _palette$secondary,\n _palette$error = palette.error,\n error = _palette$error === void 0 ? {\n light: red[300],\n main: red[500],\n dark: red[700]\n } : _palette$error,\n _palette$warning = palette.warning,\n warning = _palette$warning === void 0 ? {\n light: orange[300],\n main: orange[500],\n dark: orange[700]\n } : _palette$warning,\n _palette$info = palette.info,\n info = _palette$info === void 0 ? {\n light: blue[300],\n main: blue[500],\n dark: blue[700]\n } : _palette$info,\n _palette$success = palette.success,\n success = _palette$success === void 0 ? {\n light: green[300],\n main: green[500],\n dark: green[700]\n } : _palette$success,\n _palette$type = palette.type,\n type = _palette$type === void 0 ? 'light' : _palette$type,\n _palette$contrastThre = palette.contrastThreshold,\n contrastThreshold = _palette$contrastThre === void 0 ? 3 : _palette$contrastThre,\n _palette$tonalOffset = palette.tonalOffset,\n tonalOffset = _palette$tonalOffset === void 0 ? 0.2 : _palette$tonalOffset,\n other = _objectWithoutProperties(palette, [\"primary\", \"secondary\", \"error\", \"warning\", \"info\", \"success\", \"type\", \"contrastThreshold\", \"tonalOffset\"]); // 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\n\n function getContrastText(background) {\n var contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n\n if (process.env.NODE_ENV !== 'production') {\n var contrast = getContrastRatio(background, contrastText);\n\n if (contrast < 3) {\n console.error([\"Material-UI: The contrast ratio of \".concat(contrast, \":1 for \").concat(contrastText, \" on \").concat(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\n return contrastText;\n }\n\n var augmentColor = function augmentColor(color) {\n var mainShade = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;\n var lightShade = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 300;\n var darkShade = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 700;\n color = _extends({}, color);\n\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n\n if (!color.main) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: The color provided to augmentColor(color) is invalid.\\nThe color object needs to have a `main` property or a `\".concat(mainShade, \"` property.\") : _formatMuiErrorMessage(4, mainShade));\n }\n\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? \"Material-UI: The color provided to augmentColor(color) is invalid.\\n`color.main` should be a string, but `\".concat(JSON.stringify(color.main), \"` was provided instead.\\n\\nDid you intend to use one of the following approaches?\\n\\nimport {\\xA0green } from \\\"@material-ui/core/colors\\\";\\n\\nconst theme1 = createMuiTheme({ palette: {\\n primary: green,\\n} });\\n\\nconst theme2 = createMuiTheme({ palette: {\\n primary: { main: green[500] },\\n} });\") : _formatMuiErrorMessage(5, JSON.stringify(color.main)));\n }\n\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n\n return color;\n };\n\n var types = {\n dark: dark,\n light: light\n };\n\n if (process.env.NODE_ENV !== 'production') {\n if (!types[type]) {\n console.error(\"Material-UI: The palette type `\".concat(type, \"` is not supported.\"));\n }\n }\n\n var paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: common,\n // The palette type, can be light or dark.\n type: type,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor(primary),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor(secondary, 'A400', 'A200', 'A700'),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor(error),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor(warning),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor(info),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor(success),\n // The grey colors.\n grey: grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold: contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText: getContrastText,\n // Generate a rich color object.\n augmentColor: 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: tonalOffset\n }, types[type]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nvar caseAllCaps = {\n textTransform: 'uppercase'\n};\nvar defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n/**\n * @see @link{https://material.io/design/typography/the-type-system.html}\n * @see @link{https://material.io/design/typography/understanding-typography.html}\n */\n\nexport default function createTypography(palette, typography) {\n var _ref = typeof typography === 'function' ? typography(palette) : typography,\n _ref$fontFamily = _ref.fontFamily,\n fontFamily = _ref$fontFamily === void 0 ? defaultFontFamily : _ref$fontFamily,\n _ref$fontSize = _ref.fontSize,\n fontSize = _ref$fontSize === void 0 ? 14 : _ref$fontSize,\n _ref$fontWeightLight = _ref.fontWeightLight,\n fontWeightLight = _ref$fontWeightLight === void 0 ? 300 : _ref$fontWeightLight,\n _ref$fontWeightRegula = _ref.fontWeightRegular,\n fontWeightRegular = _ref$fontWeightRegula === void 0 ? 400 : _ref$fontWeightRegula,\n _ref$fontWeightMedium = _ref.fontWeightMedium,\n fontWeightMedium = _ref$fontWeightMedium === void 0 ? 500 : _ref$fontWeightMedium,\n _ref$fontWeightBold = _ref.fontWeightBold,\n fontWeightBold = _ref$fontWeightBold === void 0 ? 700 : _ref$fontWeightBold,\n _ref$htmlFontSize = _ref.htmlFontSize,\n htmlFontSize = _ref$htmlFontSize === void 0 ? 16 : _ref$htmlFontSize,\n allVariants = _ref.allVariants,\n pxToRem2 = _ref.pxToRem,\n other = _objectWithoutProperties(_ref, [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('Material-UI: `fontSize` is required to be a number.');\n }\n\n if (typeof htmlFontSize !== 'number') {\n console.error('Material-UI: `htmlFontSize` is required to be a number.');\n }\n }\n\n var coef = fontSize / 14;\n\n var pxToRem = pxToRem2 || function (size) {\n return \"\".concat(size / htmlFontSize * coef, \"rem\");\n };\n\n var buildVariant = function buildVariant(fontWeight, size, lineHeight, letterSpacing, casing) {\n return _extends({\n fontFamily: fontFamily,\n fontWeight: fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight: lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: \"\".concat(round(letterSpacing / size), \"em\")\n } : {}, casing, allVariants);\n };\n\n var 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 };\n return deepmerge(_extends({\n htmlFontSize: htmlFontSize,\n pxToRem: pxToRem,\n round: round,\n // TODO v5: remove\n fontFamily: fontFamily,\n fontSize: fontSize,\n fontWeightLight: fontWeightLight,\n fontWeightRegular: fontWeightRegular,\n fontWeightMedium: fontWeightMedium,\n fontWeightBold: fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n\n });\n}","var shadowKeyUmbraOpacity = 0.2;\nvar shadowKeyPenumbraOpacity = 0.14;\nvar shadowAmbientShadowOpacity = 0.12;\n\nfunction createShadow() {\n return [\"\".concat(arguments.length <= 0 ? undefined : arguments[0], \"px \").concat(arguments.length <= 1 ? undefined : arguments[1], \"px \").concat(arguments.length <= 2 ? undefined : arguments[2], \"px \").concat(arguments.length <= 3 ? undefined : arguments[3], \"px rgba(0,0,0,\").concat(shadowKeyUmbraOpacity, \")\"), \"\".concat(arguments.length <= 4 ? undefined : arguments[4], \"px \").concat(arguments.length <= 5 ? undefined : arguments[5], \"px \").concat(arguments.length <= 6 ? undefined : arguments[6], \"px \").concat(arguments.length <= 7 ? undefined : arguments[7], \"px rgba(0,0,0,\").concat(shadowKeyPenumbraOpacity, \")\"), \"\".concat(arguments.length <= 8 ? undefined : arguments[8], \"px \").concat(arguments.length <= 9 ? undefined : arguments[9], \"px \").concat(arguments.length <= 10 ? undefined : arguments[10], \"px \").concat(arguments.length <= 11 ? undefined : arguments[11], \"px rgba(0,0,0,\").concat(shadowAmbientShadowOpacity, \")\")].join(',');\n} // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\n\n\nvar 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;","var shape = {\n borderRadius: 4\n};\nexport default shape;","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nexport default function _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}","export default function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}","export default function _iterableToArrayLimit(arr, i) {\n if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}","export default function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","import { deepmerge } from '@material-ui/utils';\n\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n\n });\n}\n\nexport default merge;","import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport PropTypes from 'prop-types';\nimport merge from './merge'; // The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\n\nvar values = {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920\n};\nvar 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: function up(key) {\n return \"@media (min-width:\".concat(values[key], \"px)\");\n }\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n if (process.env.NODE_ENV !== 'production') {\n if (!props.theme) {\n console.error('Material-UI: You are calling a style function without a theme value.');\n }\n }\n\n if (Array.isArray(propValue)) {\n var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n return propValue.reduce(function (acc, item, index) {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n\n if (_typeof(propValue) === 'object') {\n var _themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n\n return Object.keys(propValue).reduce(function (acc, breakpoint) {\n acc[_themeBreakpoints.up(breakpoint)] = styleFromPropValue(propValue[breakpoint]);\n return acc;\n }, {});\n }\n\n var output = styleFromPropValue(propValue);\n return output;\n}\n\nfunction breakpoints(styleFunction) {\n var newStyleFunction = function newStyleFunction(props) {\n var base = styleFunction(props);\n var themeBreakpoints = props.theme.breakpoints || defaultBreakpoints;\n var extended = themeBreakpoints.keys.reduce(function (acc, key) {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme: props.theme\n }, props[key]));\n }\n\n return acc;\n }, null);\n return merge(base, extended);\n };\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'].concat(_toConsumableArray(styleFunction.filterProps));\n return newStyleFunction;\n}\n\nexport default breakpoints;","import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport merge from './merge';\nimport memoize from './memoize';\nvar properties = {\n m: 'margin',\n p: 'padding'\n};\nvar directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nvar aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n}; // memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\n\nvar getCssProperties = memoize(function (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\n var _prop$split = prop.split(''),\n _prop$split2 = _slicedToArray(_prop$split, 2),\n a = _prop$split2[0],\n b = _prop$split2[1];\n\n var property = properties[a];\n var direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(function (dir) {\n return property + dir;\n }) : [property + direction];\n});\nvar spacingKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY'];\nexport function createUnarySpacing(theme) {\n var themeSpacing = theme.spacing || 8;\n\n if (typeof themeSpacing === 'number') {\n return function (abs) {\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(\"Material-UI: Expected spacing argument to be a number, got \".concat(abs, \".\"));\n }\n }\n\n return themeSpacing * abs;\n };\n }\n\n if (Array.isArray(themeSpacing)) {\n return function (abs) {\n if (process.env.NODE_ENV !== 'production') {\n if (abs > themeSpacing.length - 1) {\n console.error([\"Material-UI: The value provided (\".concat(abs, \") overflows.\"), \"The supported values are: \".concat(JSON.stringify(themeSpacing), \".\"), \"\".concat(abs, \" > \").concat(themeSpacing.length - 1, \", you need to add the missing values.\")].join('\\n'));\n }\n }\n\n return themeSpacing[abs];\n };\n }\n\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.error([\"Material-UI: The `theme.spacing` value (\".concat(themeSpacing, \") is invalid.\"), 'It should be a number, an array or a function.'].join('\\n'));\n }\n\n return function () {\n return undefined;\n };\n}\n\nfunction getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n\n var abs = Math.abs(propValue);\n var transformed = transformer(abs);\n\n if (propValue >= 0) {\n return transformed;\n }\n\n if (typeof transformed === 'number') {\n return -transformed;\n }\n\n return \"-\".concat(transformed);\n}\n\nfunction getStyleFromPropValue(cssProperties, transformer) {\n return function (propValue) {\n return cssProperties.reduce(function (acc, cssProperty) {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n };\n}\n\nfunction spacing(props) {\n var theme = props.theme;\n var transformer = createUnarySpacing(theme);\n return Object.keys(props).map(function (prop) {\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 (spacingKeys.indexOf(prop) === -1) {\n return null;\n }\n\n var cssProperties = getCssProperties(prop);\n var styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n var propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n }).reduce(merge, {});\n}\n\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce(function (obj, key) {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","export default function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n\n return cache[arg];\n };\n}","import { createUnarySpacing } from '@material-ui/system';\nvar warnOnce;\nexport default function createSpacing() {\n var spacingInput = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 8;\n\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid applied, which aligns both spacing and the overall layout.\n // Smaller components, such as icons and type, can align to a 4dp grid.\n // https://material.io/design/layout/understanding-layout.html#usage\n\n\n var transform = createUnarySpacing({\n spacing: spacingInput\n });\n\n var spacing = function spacing() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!(args.length <= 4)) {\n console.error(\"Material-UI: Too many arguments provided, expected between 0 and 4, got \".concat(args.length));\n }\n }\n\n if (args.length === 0) {\n return transform(1);\n }\n\n if (args.length === 1) {\n return transform(args[0]);\n }\n\n return args.map(function (argument) {\n if (typeof argument === 'string') {\n return argument;\n }\n\n var output = transform(argument);\n return typeof output === 'number' ? \"\".concat(output, \"px\") : output;\n }).join(' ');\n }; // Backward compatibility, to remove in v5.\n\n\n Object.defineProperty(spacing, 'unit', {\n get: function get() {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnOnce || process.env.NODE_ENV === 'test') {\n console.error(['Material-UI: theme.spacing.unit usage has been deprecated.', 'It will be removed in v5.', 'You can replace `theme.spacing.unit * y` with `theme.spacing(y)`.', '', 'You can use the `https://github.com/mui-org/material-ui/tree/master/packages/material-ui-codemod/README.md#theme-spacing-api` migration helper to make the process smoother.'].join('\\n'));\n }\n\n warnOnce = true;\n }\n\n return spacingInput;\n }\n });\n spacing.mui = true;\n return spacing;\n}","import _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\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 var 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}; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\n\nexport var 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};\n\nfunction formatMs(milliseconds) {\n return \"\".concat(Math.round(milliseconds), \"ms\");\n}\n/**\n * @param {string|Array} props\n * @param {object} param\n * @param {string} param.prop\n * @param {number} param.duration\n * @param {string} param.easing\n * @param {number} param.delay\n */\n\n\nexport default {\n easing: easing,\n duration: duration,\n create: function create() {\n var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['all'];\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var _options$duration = options.duration,\n durationOption = _options$duration === void 0 ? duration.standard : _options$duration,\n _options$easing = options.easing,\n easingOption = _options$easing === void 0 ? easing.easeInOut : _options$easing,\n _options$delay = options.delay,\n delay = _options$delay === void 0 ? 0 : _options$delay,\n other = _objectWithoutProperties(options, [\"duration\", \"easing\", \"delay\"]);\n\n if (process.env.NODE_ENV !== 'production') {\n var isString = function isString(value) {\n return typeof value === 'string';\n };\n\n var isNumber = function isNumber(value) {\n return !isNaN(parseFloat(value));\n };\n\n if (!isString(props) && !Array.isArray(props)) {\n console.error('Material-UI: Argument \"props\" must be a string or Array.');\n }\n\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(\"Material-UI: Argument \\\"duration\\\" must be a number or a string but found \".concat(durationOption, \".\"));\n }\n\n if (!isString(easingOption)) {\n console.error('Material-UI: Argument \"easing\" must be a string.');\n }\n\n if (!isNumber(delay) && !isString(delay)) {\n console.error('Material-UI: Argument \"delay\" must be a number or a string.');\n }\n\n if (Object.keys(other).length !== 0) {\n console.error(\"Material-UI: Unrecognized argument(s) [\".concat(Object.keys(other).join(','), \"].\"));\n }\n }\n\n return (Array.isArray(props) ? props : [props]).map(function (animatedProp) {\n return \"\".concat(animatedProp, \" \").concat(typeof durationOption === 'string' ? durationOption : formatMs(durationOption), \" \").concat(easingOption, \" \").concat(typeof delay === 'string' ? delay : formatMs(delay));\n }).join(',');\n },\n getAutoHeightDuration: function getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n\n var constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n\n return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);\n }\n};","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nvar zIndex = {\n mobileStepper: 1000,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport { deepmerge } from '@material-ui/utils';\nimport createBreakpoints from './createBreakpoints';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\nimport transitions from './transitions';\nimport zIndex from './zIndex';\n\nfunction createMuiTheme() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n var _options$breakpoints = options.breakpoints,\n breakpointsInput = _options$breakpoints === void 0 ? {} : _options$breakpoints,\n _options$mixins = options.mixins,\n mixinsInput = _options$mixins === void 0 ? {} : _options$mixins,\n _options$palette = options.palette,\n paletteInput = _options$palette === void 0 ? {} : _options$palette,\n spacingInput = options.spacing,\n _options$typography = options.typography,\n typographyInput = _options$typography === void 0 ? {} : _options$typography,\n other = _objectWithoutProperties(options, [\"breakpoints\", \"mixins\", \"palette\", \"spacing\", \"typography\"]);\n\n var palette = createPalette(paletteInput);\n var breakpoints = createBreakpoints(breakpointsInput);\n var spacing = createSpacing(spacingInput);\n var muiTheme = deepmerge({\n breakpoints: breakpoints,\n direction: 'ltr',\n mixins: createMixins(breakpoints, spacing, mixinsInput),\n overrides: {},\n // Inject custom styles\n palette: palette,\n props: {},\n // Provide default props\n shadows: shadows,\n typography: createTypography(palette, typographyInput),\n spacing: spacing,\n shape: shape,\n transitions: transitions,\n zIndex: zIndex\n }, other);\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 muiTheme = args.reduce(function (acc, argument) {\n return deepmerge(acc, argument);\n }, muiTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n var pseudoClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected'];\n\n var traverse = function traverse(node, parentKey) {\n var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var key; // eslint-disable-next-line guard-for-in, no-restricted-syntax\n\n for (key in node) {\n var child = node[key];\n\n if (depth === 1) {\n if (key.indexOf('Mui') === 0 && child) {\n traverse(child, key, depth + 1);\n }\n } else if (pseudoClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n console.error([\"Material-UI: The `\".concat(parentKey, \"` component increases \") + \"the CSS specificity of the `\".concat(key, \"` internal state.\"), 'You can not override it like this: ', JSON.stringify(node, null, 2), '', 'Instead, you need to use the $ruleName syntax:', JSON.stringify({\n root: _defineProperty({}, \"&$\".concat(key), child)\n }, null, 2), '', 'https://material-ui.com/r/pseudo-classes-guide'].join('\\n'));\n } // Remove the style to prevent global conflicts.\n\n\n node[key] = {};\n }\n }\n };\n\n traverse(muiTheme.overrides);\n }\n\n return muiTheme;\n}\n\nexport default createMuiTheme;","import createMuiTheme from './createMuiTheme';\nvar defaultTheme = createMuiTheme();\nexport default defaultTheme;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { withStyles as withStylesWithoutDefault } from '@material-ui/styles';\nimport defaultTheme from './defaultTheme';\n\nfunction withStyles(stylesOrCreator, options) {\n return withStylesWithoutDefault(stylesOrCreator, _extends({\n defaultTheme: defaultTheme\n }, options));\n}\n\nexport default withStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport capitalize from '../utils/capitalize';\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n fontSize: theme.typography.pxToRem(24),\n transition: theme.transitions.create('fill', {\n duration: theme.transitions.duration.shorter\n })\n },\n\n /* Styles applied to the root element if `color=\"primary\"`. */\n colorPrimary: {\n color: theme.palette.primary.main\n },\n\n /* Styles applied to the root element if `color=\"secondary\"`. */\n colorSecondary: {\n color: theme.palette.secondary.main\n },\n\n /* Styles applied to the root element if `color=\"action\"`. */\n colorAction: {\n color: theme.palette.action.active\n },\n\n /* Styles applied to the root element if `color=\"error\"`. */\n colorError: {\n color: theme.palette.error.main\n },\n\n /* Styles applied to the root element if `color=\"disabled\"`. */\n colorDisabled: {\n color: theme.palette.action.disabled\n },\n\n /* Styles applied to the root element if `fontSize=\"inherit\"`. */\n fontSizeInherit: {\n fontSize: 'inherit'\n },\n\n /* Styles applied to the root element if `fontSize=\"small\"`. */\n fontSizeSmall: {\n fontSize: theme.typography.pxToRem(20)\n },\n\n /* Styles applied to the root element if `fontSize=\"large\"`. */\n fontSizeLarge: {\n fontSize: theme.typography.pxToRem(35)\n }\n };\n};\nvar SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(props, ref) {\n var children = props.children,\n classes = props.classes,\n className = props.className,\n _props$color = props.color,\n color = _props$color === void 0 ? 'inherit' : _props$color,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'svg' : _props$component,\n _props$fontSize = props.fontSize,\n fontSize = _props$fontSize === void 0 ? 'default' : _props$fontSize,\n htmlColor = props.htmlColor,\n titleAccess = props.titleAccess,\n _props$viewBox = props.viewBox,\n viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,\n other = _objectWithoutProperties(props, [\"children\", \"classes\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"titleAccess\", \"viewBox\"]);\n\n return /*#__PURE__*/React.createElement(Component, _extends({\n className: clsx(classes.root, className, color !== 'inherit' && classes[\"color\".concat(capitalize(color))], fontSize !== 'default' && classes[\"fontSize\".concat(capitalize(fontSize))]),\n focusable: \"false\",\n viewBox: viewBox,\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, other), children, titleAccess ? /*#__PURE__*/React.createElement(\"title\", null, titleAccess) : null);\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component. It supports those theme colors that make sense for this component.\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n */\n color: PropTypes.oneOf(['action', 'disabled', 'error', 'inherit', 'primary', 'secondary']),\n\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\n /* @typescript-to-proptypes-ignore */\n .elementType,\n\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n */\n fontSize: PropTypes.oneOf(['default', 'inherit', 'large', 'small']),\n\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n\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 property.\n */\n shapeRendering: PropTypes.string,\n\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 /**\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 */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default withStyles(styles, {\n name: 'MuiSvgIcon'\n})(SvgIcon);"],"sourceRoot":""}