/) !== null) {\n tagsOccurrenceHash['nestedDivs'] = 1;\n }\n Array.from(rawMessage.matchAll(/<(a|div|span|p|strong|b|h\\d|ul|ol|li|mark|em)>/g)).forEach(matchedTag => {\n tagsOccurrenceHash[matchedTag[1]] = tagsOccurrenceHash[matchedTag[1]] !== undefined ? Number(tagsOccurrenceHash[matchedTag[1]]) + 1 : 0;\n });\n if (rawMessage.indexOf('{lineBreaker}') > 0) {\n constructedValues['lineBreaker'] = lineBreakerElement || /*#__PURE__*/React.createElement(\"br\", null);\n }\n if (rawMessage.indexOf('{nonBreakingSpace}') > 0) {\n constructedValues['nonBreakingSpace'] = String.fromCharCode(0x00a0);\n }\n if (values && rawMessageVariables.length > 0) {\n rawMessageVariables.forEach(variable => {\n constructedValues[variable[1]] = values[variable[1]];\n });\n }\n return {\n rawMessage,\n tagsOccurrenceHash,\n constructedValues\n };\n};","// this file should replace all its replicas in every package that has duplicates to it.\nexport const SUPPORTED_LANGUAGES_CONST = ['bg', 'cs', 'ca', 'da', 'de', 'el', 'en', 'es', 'fi', 'fr', 'hr', 'hu', 'it', 'ja', 'km', 'ko', 'nb', 'nl', 'pl', 'pt', 'ro', 'ru', 'sv', 'th', 'tr', 'uk', 'vi', 'zh', 'ms', 'id'];\nexport const SUPPORTED_LANGUAGES = [...SUPPORTED_LANGUAGES_CONST];\n\n// these locales don't have own translations but use existing ones\nexport const SUPPORTED_LOCALES_WITHOUT_TRANSLATIONS = ['en-SG'];\nexport const SUPPORTED_LOCALES = [...SUPPORTED_LANGUAGES, 'en-GB', 'pt-BR', ...SUPPORTED_LOCALES_WITHOUT_TRANSLATIONS];\nexport const britishEnglishRegex = new RegExp(/en[-_]gb/, 'gmi');\nexport const singaporeEnglishRegex = new RegExp(/en[-_]sg/, 'gmi');\nexport const brazilianPortugueseRegex = new RegExp(/pt[-_]br/, 'gmi');\nexport const DEFAULT_LOCALE = 'en';\nexport const isLanguageSupported = language => SUPPORTED_LANGUAGES.includes(language.toLowerCase());\nexport const isLocaleSupported = locale => {\n return SUPPORTED_LOCALES.includes(locale.toLowerCase()) || britishEnglishRegex.test(locale) || singaporeEnglishRegex.test(locale) || brazilianPortugueseRegex.test(locale);\n};\nexport const getLanguageFromLocale = (locale = '') => {\n const [language] = locale.toLowerCase().split(/[-_]/);\n return language;\n};\nexport const getAvailableLanguage = locale => {\n const language = getLanguageFromLocale(locale);\n if (isLanguageSupported(language)) {\n return language;\n }\n return DEFAULT_LOCALE;\n};\nexport const getAvailableLocale = locale => {\n if (!locale) {\n return DEFAULT_LOCALE;\n }\n if (isLocaleSupported(locale)) {\n if (locale.match(britishEnglishRegex)) return 'en-GB';\n if (locale.match(singaporeEnglishRegex)) return 'en-SG';\n if (locale.match(brazilianPortugueseRegex)) return 'pt-BR';\n return locale.toLowerCase();\n }\n const language = getLanguageFromLocale(locale);\n if (isLanguageSupported(language)) {\n return language.toLowerCase();\n }\n return DEFAULT_LOCALE;\n};","/**\n * Log levels.\n */\nexport let LogLevel = /*#__PURE__*/function (LogLevel) {\n LogLevel[\"INFO\"] = \"info\";\n LogLevel[\"WARNING\"] = \"warning\";\n LogLevel[\"ERROR\"] = \"error\";\n LogLevel[\"EXCEPTION\"] = \"exception\";\n return LogLevel;\n}({});\nexport let Facility = /*#__PURE__*/function (Facility) {\n Facility[\"LIVE\"] = \"live\";\n Facility[\"TEST\"] = \"test\";\n return Facility;\n}({});\nexport let LogPlatform = /*#__PURE__*/function (LogPlatform) {\n LogPlatform[\"APP\"] = \"app\";\n LogPlatform[\"WEB\"] = \"web\";\n return LogPlatform;\n}({});\nexport let Viewport = /*#__PURE__*/function (Viewport) {\n Viewport[\"MOBILE\"] = \"mobile\";\n Viewport[\"TABLET\"] = \"tablet\";\n Viewport[\"DESKTOP\"] = \"desktop\";\n return Viewport;\n}({});\n\n/**\n * Properties supplied by the consumer,\n * could be extended -- see createLogger() below\n */\n\n// @ts-ignore","/* eslint-disable no-console */\n\nimport { logSentry } from \"../sentry/index\";\nimport { Platform, getPlatform } from \"../platform\";\nimport { Environment, getEnvironment } from \"../environment\";\nimport normalizeExperimentsCookie from \"../experiments/normalizeExperimentsCookie\";\nimport getClientId from \"../getClientId/getClientId\";\nimport { Facility, LogLevel, LogPlatform, Viewport } from \"./types\";\nconst logToConsole = ({\n log_level: logLevel,\n short_message: shortMessage,\n ...data\n}) => {\n const prefix = `[${logLevel.toUpperCase()}]`;\n const logFunction = {\n [LogLevel.INFO]: console.info,\n [LogLevel.WARNING]: console.warn,\n [LogLevel.ERROR]: console.error,\n [LogLevel.EXCEPTION]: console.error\n }[logLevel];\n if (Object.keys(data).length > 0) {\n logFunction(prefix, shortMessage, data);\n } else {\n logFunction(prefix, shortMessage);\n }\n};\nconst maskCustomerEmailInUrl = url => {\n const urlObject = new URL(url);\n if (urlObject.searchParams.has('email')) {\n urlObject.searchParams.delete('email');\n }\n return urlObject.href;\n};\nconst getUrl = () => {\n if (getPlatform() === Platform.ReactNative) {\n // HACK: There's no way to know the page we are at either\n return undefined;\n }\n return maskCustomerEmailInUrl(window.location.href);\n};\nconst getFacility = () => {\n if (getPlatform() === Platform.ReactNative) {\n // HACK: There's no way to differentiate QA vs PROD on React Native,\n // without accessing `basePath`. We always send `live`\n // so the exceptions appear on our dashboards\n return Facility.LIVE;\n }\n return getEnvironment() === Environment.PROD ? Facility.LIVE : Facility.TEST;\n};\nconst getLogPlatform = () => {\n return getPlatform() === Platform.Web ? LogPlatform.WEB : LogPlatform.APP;\n};\n\n// https://github.com/goeuro/app/blob/master/packages/frontend-components/src/helpers/useResponsive.ts\nconst getViewpoint = () => {\n if (window.innerWidth < 768) {\n return Viewport.MOBILE;\n }\n if (window.innerWidth < 1024) {\n return Viewport.TABLET;\n }\n return Viewport.DESKTOP;\n};\nconst getConnectionInfo = () => {\n const nav = navigator;\n const connection = nav.connection || nav.mozConnection || nav.webkitConnection;\n const connectionType = connection?.type;\n const connectionEffectiveType = connection?.effectiveType;\n return {\n connection_type: connectionType,\n connection_effective_type: connectionEffectiveType\n };\n};\nconst sendData = (config, data) => {\n if (getEnvironment() === Environment.DEV) {\n // Don't send logs on development\n logToConsole(data);\n return;\n }\n const B2BDetails = window?.['wl_config'] ? {\n partner_id: window['wl_config']?.partnerId\n } : {};\n const payload = {\n log_package: config.logPackage,\n log_version: config.logVersion,\n url: getUrl(),\n facility: getFacility(),\n platform: getLogPlatform(),\n viewport: getViewpoint(),\n ...getConnectionInfo(),\n experiments: normalizeExperimentsCookie(),\n client_id: getClientId(),\n ...data,\n ...B2BDetails\n };\n logSentry(data, payload);\n\n // We use fetch directly because:\n //\n // 1. Logger is used at the most earliest stage of app bootstrapping\n // -> we want to reduce the amount of loaded code at this\n // 2. Axios uses logger, so we want to avoid circular dependencies\n //\n // eslint-disable-next-line rulesdir/no-fetch\n fetch('https://logger.omio.com/frontend', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(payload)\n }).catch(e => {\n console.error('Failed to send log data', e);\n });\n};\n/**\n * @deprecated use LoggerConfig instead\n */\n\n/**\n * @deprecated Use createLogger instead that accepts a LoggerConfig object with log_package and log_version as required fields.\n * @param client\n * @param options\n */\n\n/**\n * Logger factory.\n *\n * How to use: create `src/shared/logger.ts` files like so:\n *\n * import { createLogger } from '@app/fe-utils/src/logger';\n *\n * interface ExtraProps {\n * // Define here all extra fields you want to pass to logger methods\n * }\n *\n * Follow the guide in order to add your package to allowed packages in the logger service:\n * https://goeuro.atlassian.net/wiki/spaces/ARCH/pages/4702928953/Frontend+Logging+Standards\n *\n * const { logInfo, logWarning, logError, logException } = createLogger
('my-bookings-fe');\n *\n * export { logInfo, logWarning, logError, logException };\n *\n *\n *\n * @param config logger config\n */\n\nexport function createLogger(config) {\n if (typeof config === 'string') {\n console.warn('createLogger(client: string , options?: LoggerOptions) is deprecated. Use createLogger(config: LoggerConfig) instead.');\n // log_version: -1 is an invalid version, DO NOT CHANGE IT\n // logs will not show up in Kibana from packages if deprecated method is used\n return createLogger({\n logPackage: config,\n logVersion: -1\n });\n } else {\n const getExtraData = config?.getExtraData || (() => ({}));\n return {\n logInfo: payload => sendData(config, {\n ...payload,\n ...getExtraData(),\n log_level: LogLevel.INFO\n }),\n logWarning: payload => sendData(config, {\n ...payload,\n ...getExtraData(),\n log_level: LogLevel.WARNING\n }),\n logError: payload => sendData(config, {\n ...payload,\n ...getExtraData(),\n log_level: LogLevel.ERROR\n }),\n logException: payload => sendData(config, {\n ...payload,\n ...getExtraData(),\n log_level: LogLevel.EXCEPTION\n })\n };\n }\n}","import { parseExperimentsCookie } from \"../../../goeuro-experiments/src/core/helpers/parseExperimentsCookie\";\nexport default (() => parseExperimentsCookie(document.cookie)?.reduce((prev, curr) => {\n return `${curr.label}=${curr.bucket};${prev}`;\n}, ''));","export let Platform = /*#__PURE__*/function (Platform) {\n Platform[\"ReactNative\"] = \"ReactNative\";\n Platform[\"WebView\"] = \"WebView\";\n Platform[\"Web\"] = \"Web\";\n return Platform;\n}({});\nconst isRN = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';\n\n// check if window is defined to avoid SSR issues on LPS.\nconst hasGoEuroBridge = () => typeof window !== 'undefined' && (window.goEuroBridge || window.ReactNativeWebView || window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.goEuroBridge || window.location?.href.includes('isWebView'));\n\n// check if navigator is defined to avoid SSR issues on LPS.\nconst hasMobileAppUserAgent = () => typeof navigator !== 'undefined' && (navigator.userAgent?.includes('GoEuroIOS') || navigator.userAgent?.includes('GoEuroAndroid'));\nconst isWebView = hasGoEuroBridge() || hasMobileAppUserAgent();\n\n/**\n * Returns the platform: ReactNative, WebView or Web.\n */\nexport const getPlatform = () => {\n if (isRN) {\n return Platform.ReactNative;\n }\n if (isWebView) {\n return Platform.WebView;\n }\n return Platform.Web;\n};\nexport const isExpo = () => process.env.EXPO_PUBLIC_IS_EXPO === 'true';","const SUGGESTER_PATH = '/suggester-api/v5/position';\nconst SUGGESTER_API_URL = `${\"\"}${SUGGESTER_PATH}`;\nexport const REBATE_API_URL = `/discount-cards-search/rebate`;\nexport const SEARCH_TRIGGER_URL = `${\"\"}/growth/search-trigger/search`;\nexport const getSuggesterApiUrl = host => {\n if (!\"\") {\n return host ? `//${host}${SUGGESTER_PATH}` : `${SUGGESTER_PATH}`;\n }\n return SUGGESTER_API_URL;\n};","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport Button from \"../../../../frontend-components/src/Button/index\";\nconst getSelectedPassengerLabel = passengers => {\n const selectedTypes = passengers.map(passenger => passenger.type);\n const uniqueSelectedTypes = Array.from(new Set(selectedTypes));\n if (uniqueSelectedTypes.length === 1) {\n const type = uniqueSelectedTypes[0];\n switch (type) {\n case 'adult':\n return `pcc_select_adults`;\n case 'youth':\n return `pcc_select_youths`;\n case 'senior':\n return `pcc_select_seniors`;\n default:\n return `pcc_select_passengers`;\n }\n } else {\n return `pcc_select_passengers`;\n }\n};\nexport const SelectPassengerButton = ({\n passengers,\n onClick,\n dataE2E\n}) => {\n return /*#__PURE__*/React.createElement(Button, {\n variant: \"primary\",\n \"data-e2e\": dataE2E,\n onClick: onClick\n }, passengers.length === 0 ? /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"lps.ferret.mobilePanel.confirmButton\"\n }) : /*#__PURE__*/React.createElement(FormattedMessage, {\n id: getSelectedPassengerLabel(passengers),\n values: {\n COUNT: passengers.length\n }\n }));\n};","import { breakpoints } from \"../../../frontend-components/src/helpers/breakpoints\";\nexport const platform = 'web';\nexport const isDesktopScreenWidth = () => window.innerWidth >= breakpoints.DESKTOP;\nexport const isTabletScreenWidth = () => window.innerWidth >= breakpoints.TABLET && window.innerWidth < breakpoints.DESKTOP;","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport Touchable from \"../../../../frontend-components/src/Touchable/index\";\nimport { platform } from \"../../platform/platform\";\nexport const HeaderWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-e896oo-0\"\n})([\"background-color:\", \";display:flex;flex-direction:row;align-items:center;height:57px;padding-horizontal:20px;shadow-color:#000;shadow-opacity:0.5;shadow-radius:5px;elevation:5;justify-content:space-between;border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:\", \";\", \";\", \"\"], theme.colors.white, theme.colors.divider, theme.shadows.header, platform === 'web' && `\n position: absolute;\n top: 0;\n width: 100%;\n z-index: 10;\n `);\nexport const IconWrapper = /*#__PURE__*/styled(Touchable).withConfig({\n componentId: \"sc-e896oo-1\"\n})([\"width:24px;height:24px;\", \";\"], platform === 'web' ? `margin-left: ${theme.space.medium}px` : '');\nexport const HeaderTitle = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-e896oo-2\"\n})([\"align-items:center;justify-content:center;flex:1;margin-right:\", \"px;text-align:center;\"], theme.space.medium);","import React from \"react\";\nimport { H5 } from \"../../../../frontend-components/src/Typography/index\";\nimport { Close } from \"../../../../frontend-components/src/Icons2/Close\";\nimport { semanticColors } from \"../../../../frontend-components/src/style-values/colors\";\nimport { HeaderWrapper, HeaderTitle, IconWrapper } from \"./Header.styles\";\nexport const Header = ({\n children,\n onClose\n}) => /*#__PURE__*/React.createElement(HeaderWrapper, null, /*#__PURE__*/React.createElement(IconWrapper, {\n onClick: onClose\n}, /*#__PURE__*/React.createElement(Close, {\n size: 24,\n color: semanticColors.iconColor\n})), /*#__PURE__*/React.createElement(HeaderTitle, null, /*#__PURE__*/React.createElement(H5, null, children)));","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const Container = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-hhsvo4-0\"\n})([\"padding:\", \"px;\", \"{padding:\", \"px \", \"px;}\"], theme.space.medium, theme.mediaQueries.tabletAndLarger, theme.space.smallmedium, theme.space.medium);","import React, { useState } from \"react\";\nimport { useIntl } from \"react-intl\";\nimport Input from \"../../../../frontend-components/src/Input/index\";\nimport { Search } from \"../../../../frontend-components/src/Icons2/Search\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport { Container } from \"./DiscountCardsSearchInput.styles\";\nconst DiscountCardsSearchInput = ({\n onChange\n}) => {\n const [value, setValue] = useState('');\n const {\n formatMessage\n } = useIntl();\n const label = formatMessage({\n id: 'passenger_config_components.search_discount_cards'\n });\n const onChangeText = value => {\n setValue(value);\n onChange(value);\n };\n return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Input, {\n iconBeforeInput: /*#__PURE__*/React.createElement(Search, {\n size: 24,\n color: theme.colors.iconColor\n }),\n label: label,\n placeholder: label,\n type: \"text\",\n value: value,\n onChangeText: onChangeText\n }));\n};\nexport default DiscountCardsSearchInput;","export default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}","import getWindow from \"./getWindow.js\";\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };","export var max = Math.max;\nexport var min = Math.min;\nexport var round = Math.round;","import { isHTMLElement } from \"./instanceOf.js\";\nimport { round } from \"../utils/math.js\";\nexport default function getBoundingClientRect(element, includeScale) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n var rect = element.getBoundingClientRect();\n var scaleX = 1;\n var scaleY = 1;\n\n if (isHTMLElement(element) && includeScale) {\n var offsetHeight = element.offsetHeight;\n var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale\n // Fallback to 1 in case both values are `0`\n\n if (offsetWidth > 0) {\n scaleX = round(rect.width) / offsetWidth || 1;\n }\n\n if (offsetHeight > 0) {\n scaleY = round(rect.height) / offsetHeight || 1;\n }\n }\n\n return {\n width: rect.width / scaleX,\n height: rect.height / scaleY,\n top: rect.top / scaleY,\n right: rect.right / scaleX,\n bottom: rect.bottom / scaleY,\n left: rect.left / scaleX,\n x: rect.left / scaleX,\n y: rect.top / scaleY\n };\n}","import getWindow from \"./getWindow.js\";\nexport default function getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}","export default function getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}","import { isElement } from \"./instanceOf.js\";\nexport default function getDocumentElement(element) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]\n element.document) || window.document).documentElement;\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nexport default function getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}","import getWindow from \"./getWindow.js\";\nexport default function getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}","import getComputedStyle from \"./getComputedStyle.js\";\nexport default function isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getNodeScroll from \"./getNodeScroll.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport { round } from \"../utils/math.js\";\n\nfunction isElementScaled(element) {\n var rect = element.getBoundingClientRect();\n var scaleX = round(rect.width) / element.offsetWidth || 1;\n var scaleY = round(rect.height) / element.offsetHeight || 1;\n return scaleX !== 1 || scaleY !== 1;\n} // Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\n\n\nexport default function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}","import getWindowScroll from \"./getWindowScroll.js\";\nimport getWindow from \"./getWindow.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nimport getHTMLElementScroll from \"./getHTMLElementScroll.js\";\nexport default function getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}","export default function getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}","import getBoundingClientRect from \"./getBoundingClientRect.js\"; // Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\n\nexport default function getLayoutRect(element) {\n var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n\n var width = element.offsetWidth;\n var height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: width,\n height: height\n };\n}","import getNodeName from \"./getNodeName.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport { isShadowRoot } from \"./instanceOf.js\";\nexport default function getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || ( // DOM Element detected\n isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}","import getParentNode from \"./getParentNode.js\";\nimport isScrollParent from \"./isScrollParent.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport { isHTMLElement } from \"./instanceOf.js\";\nexport default function getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}","import getScrollParent from \"./getScrollParent.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport getWindow from \"./getWindow.js\";\nimport isScrollParent from \"./isScrollParent.js\";\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\n\nexport default function listScrollParents(element, list) {\n var _element$ownerDocumen;\n\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}","import getNodeName from \"./getNodeName.js\";\nexport default function isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}","import getWindow from \"./getWindow.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isHTMLElement, isShadowRoot } from \"./instanceOf.js\";\nimport isTableElement from \"./isTableElement.js\";\nimport getParentNode from \"./getParentNode.js\";\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;\n var isIE = navigator.userAgent.indexOf('Trident') !== -1;\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n var elementCss = getComputedStyle(element);\n\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n var currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nexport default function getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}","export var top = 'top';\nexport var bottom = 'bottom';\nexport var right = 'right';\nexport var left = 'left';\nexport var auto = 'auto';\nexport var basePlacements = [top, bottom, right, left];\nexport var start = 'start';\nexport var end = 'end';\nexport var clippingParents = 'clippingParents';\nexport var viewport = 'viewport';\nexport var popper = 'popper';\nexport var reference = 'reference';\nexport var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nexport var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nexport var beforeRead = 'beforeRead';\nexport var read = 'read';\nexport var afterRead = 'afterRead'; // pure-logic modifiers\n\nexport var beforeMain = 'beforeMain';\nexport var main = 'main';\nexport var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nexport var beforeWrite = 'beforeWrite';\nexport var write = 'write';\nexport var afterWrite = 'afterWrite';\nexport var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];","import { modifierPhases } from \"../enums.js\"; // source: https://stackoverflow.com/questions/49875255\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nexport default function orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}","import getCompositeRect from \"./dom-utils/getCompositeRect.js\";\nimport getLayoutRect from \"./dom-utils/getLayoutRect.js\";\nimport listScrollParents from \"./dom-utils/listScrollParents.js\";\nimport getOffsetParent from \"./dom-utils/getOffsetParent.js\";\nimport getComputedStyle from \"./dom-utils/getComputedStyle.js\";\nimport orderModifiers from \"./utils/orderModifiers.js\";\nimport debounce from \"./utils/debounce.js\";\nimport validateModifiers from \"./utils/validateModifiers.js\";\nimport uniqueBy from \"./utils/uniqueBy.js\";\nimport getBasePlacement from \"./utils/getBasePlacement.js\";\nimport mergeByName from \"./utils/mergeByName.js\";\nimport detectOverflow from \"./utils/detectOverflow.js\";\nimport { isElement } from \"./dom-utils/instanceOf.js\";\nimport { auto } from \"./enums.js\";\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nexport function popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(setOptionsAction) {\n var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;\n cleanupModifierEffects();\n state.options = Object.assign({}, defaultOptions, state.options, options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\nexport var createPopper = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules\n\nexport { detectOverflow };","export default function debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}","export default function mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign({}, existing, current, {\n options: Object.assign({}, existing.options, current.options),\n data: Object.assign({}, existing.data, current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}","import getWindow from \"../dom-utils/getWindow.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};","import { auto } from \"../enums.js\";\nexport default function getBasePlacement(placement) {\n return placement.split('-')[0];\n}","export default function getVariation(placement) {\n return placement.split('-')[1];\n}","export default function getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}","import getBasePlacement from \"./getBasePlacement.js\";\nimport getVariation from \"./getVariation.js\";\nimport getMainAxisFromPlacement from \"./getMainAxisFromPlacement.js\";\nimport { top, right, bottom, left, start, end } from \"../enums.js\";\nexport default function computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n\n default:\n }\n }\n\n return offsets;\n}","import computeOffsets from \"../utils/computeOffsets.js\";\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};","import { top, left, right, bottom, end } from \"../enums.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getWindow from \"../dom-utils/getWindow.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getComputedStyle from \"../dom-utils/getComputedStyle.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport { round } from \"../utils/math.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsetsByDPR(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0\n };\n}\n\nexport function mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n variation = _ref2.variation,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive,\n roundOffsets = _ref2.roundOffsets,\n isFixed = _ref2.isFixed;\n var _offsets$x = offsets.x,\n x = _offsets$x === void 0 ? 0 : _offsets$x,\n _offsets$y = offsets.y,\n y = _offsets$y === void 0 ? 0 : _offsets$y;\n\n var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref3.x;\n y = _ref3.y;\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n var heightProp = 'clientHeight';\n var widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n\n offsetParent = offsetParent;\n\n if (placement === top || (placement === left || placement === right) && variation === end) {\n sideY = bottom;\n var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left || (placement === top || placement === bottom) && variation === end) {\n sideX = right;\n var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n var _ref4 = roundOffsets === true ? roundOffsetsByDPR({\n x: x,\n y: y\n }) : {\n x: x,\n y: y\n };\n\n x = _ref4.x;\n y = _ref4.y;\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref5) {\n var state = _ref5.state,\n options = _ref5.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive,\n _options$roundOffsets = options.roundOffsets,\n roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration,\n isFixed: state.options.strategy === 'fixed'\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive,\n roundOffsets: roundOffsets\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets: roundOffsets\n })));\n }\n\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};","import getNodeName from \"../dom-utils/getNodeName.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect,\n requires: ['computeStyles']\n};","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport { top, left, right, placements } from \"../enums.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport function distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};","var hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nexport default function getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}","var hash = {\n start: 'end',\n end: 'start'\n};\nexport default function getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash[matched];\n });\n}","import { isShadowRoot } from \"./instanceOf.js\";\nexport default function contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe[prop-missing]: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}","export default function rectToClientRect(rect) {\n return Object.assign({}, rect, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}","import { viewport } from \"../enums.js\";\nimport getViewportRect from \"./getViewportRect.js\";\nimport getDocumentRect from \"./getDocumentRect.js\";\nimport listScrollParents from \"./listScrollParents.js\";\nimport getOffsetParent from \"./getOffsetParent.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport { isElement, isHTMLElement } from \"./instanceOf.js\";\nimport getBoundingClientRect from \"./getBoundingClientRect.js\";\nimport getParentNode from \"./getParentNode.js\";\nimport contains from \"./contains.js\";\nimport getNodeName from \"./getNodeName.js\";\nimport rectToClientRect from \"../utils/rectToClientRect.js\";\nimport { max, min } from \"../utils/math.js\";\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nexport default function getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}","import getWindow from \"./getWindow.js\";\nimport getDocumentElement from \"./getDocumentElement.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nexport default function getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}","import getDocumentElement from \"./getDocumentElement.js\";\nimport getComputedStyle from \"./getComputedStyle.js\";\nimport getWindowScrollBarX from \"./getWindowScrollBarX.js\";\nimport getWindowScroll from \"./getWindowScroll.js\";\nimport { max } from \"../utils/math.js\"; // Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\n\nexport default function getDocumentRect(element) {\n var _element$ownerDocumen;\n\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}","import getFreshSideObject from \"./getFreshSideObject.js\";\nexport default function mergePaddingObject(paddingObject) {\n return Object.assign({}, getFreshSideObject(), paddingObject);\n}","export default function getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}","export default function expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}","import getClippingRect from \"../dom-utils/getClippingRect.js\";\nimport getDocumentElement from \"../dom-utils/getDocumentElement.js\";\nimport getBoundingClientRect from \"../dom-utils/getBoundingClientRect.js\";\nimport computeOffsets from \"./computeOffsets.js\";\nimport rectToClientRect from \"./rectToClientRect.js\";\nimport { clippingParents, reference, popper, bottom, top, right, basePlacements, viewport } from \"../enums.js\";\nimport { isElement } from \"../dom-utils/instanceOf.js\";\nimport mergePaddingObject from \"./mergePaddingObject.js\";\nimport expandToHashMap from \"./expandToHashMap.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport default function detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(state.elements.reference);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}","import { max as mathMax, min as mathMin } from \"./math.js\";\nexport function within(min, value, max) {\n return mathMax(min, mathMin(value, max));\n}\nexport function withinMaxClamp(min, value, max) {\n var v = within(min, value, max);\n return v > max ? max : v;\n}","import { top, left, right, bottom, start } from \"../enums.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport getAltAxis from \"../utils/getAltAxis.js\";\nimport { within, withinMaxClamp } from \"../utils/within.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport getVariation from \"../utils/getVariation.js\";\nimport getFreshSideObject from \"../utils/getFreshSideObject.js\";\nimport { min as mathMin, max as mathMax } from \"../utils/math.js\";\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {\n placement: state.placement\n })) : tetherOffset;\n var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {\n mainAxis: tetherOffsetValue,\n altAxis: tetherOffsetValue\n } : Object.assign({\n mainAxis: 0,\n altAxis: 0\n }, tetherOffsetValue);\n var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var _offsetModifierState$;\n\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = offset + overflow[mainSide];\n var max = offset - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;\n var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = offset + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? mathMin(min, tetherMin) : min, offset, tether ? mathMax(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _offsetModifierState$2;\n\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _len = altAxis === 'y' ? 'height' : 'width';\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;\n\n var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;\n\n var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;\n\n var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};","export default function getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}","import getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getLayoutRect from \"../dom-utils/getLayoutRect.js\";\nimport contains from \"../dom-utils/contains.js\";\nimport getOffsetParent from \"../dom-utils/getOffsetParent.js\";\nimport getMainAxisFromPlacement from \"../utils/getMainAxisFromPlacement.js\";\nimport { within } from \"../utils/within.js\";\nimport mergePaddingObject from \"../utils/mergePaddingObject.js\";\nimport expandToHashMap from \"../utils/expandToHashMap.js\";\nimport { left, right, basePlacements, top, bottom } from \"../enums.js\";\nimport { isHTMLElement } from \"../dom-utils/instanceOf.js\"; // eslint-disable-next-line import/no-unused-modules\n\nvar toPaddingObject = function toPaddingObject(padding, state) {\n padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {\n placement: state.placement\n })) : padding;\n return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name,\n options = _ref.options;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = toPaddingObject(options.padding, state);\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect(_ref2) {\n var state = _ref2.state,\n options = _ref2.options;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};","import { top, bottom, left, right } from \"../enums.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign({}, state.attributes.popper, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};","import { popperGenerator, detectOverflow } from \"./createPopper.js\";\nimport eventListeners from \"./modifiers/eventListeners.js\";\nimport popperOffsets from \"./modifiers/popperOffsets.js\";\nimport computeStyles from \"./modifiers/computeStyles.js\";\nimport applyStyles from \"./modifiers/applyStyles.js\";\nimport offset from \"./modifiers/offset.js\";\nimport flip from \"./modifiers/flip.js\";\nimport preventOverflow from \"./modifiers/preventOverflow.js\";\nimport arrow from \"./modifiers/arrow.js\";\nimport hide from \"./modifiers/hide.js\";\nvar defaultModifiers = [eventListeners, popperOffsets, computeStyles, applyStyles, offset, flip, preventOverflow, arrow, hide];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow }; // eslint-disable-next-line import/no-unused-modules\n\nexport { createPopper as createPopperLite } from \"./popper-lite.js\"; // eslint-disable-next-line import/no-unused-modules\n\nexport * from \"./modifiers/index.js\";","import getOppositePlacement from \"../utils/getOppositePlacement.js\";\nimport getBasePlacement from \"../utils/getBasePlacement.js\";\nimport getOppositeVariationPlacement from \"../utils/getOppositeVariationPlacement.js\";\nimport detectOverflow from \"../utils/detectOverflow.js\";\nimport computeAutoPlacement from \"../utils/computeAutoPlacement.js\";\nimport { bottom, top, start, right, left, auto } from \"../enums.js\";\nimport getVariation from \"../utils/getVariation.js\"; // eslint-disable-next-line import/no-unused-modules\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nexport default {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};","import getVariation from \"./getVariation.js\";\nimport { variationPlacements, basePlacements, placements as allPlacements } from \"../enums.js\";\nimport detectOverflow from \"./detectOverflow.js\";\nimport getBasePlacement from \"./getBasePlacement.js\";\nexport default function computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? allPlacements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements;\n var allowedPlacements = placements.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}","/**!\n* tippy.js v6.3.7\n* (c) 2017-2021 atomiks\n* MIT License\n*/\nimport { createPopper, applyStyles } from '@popperjs/core';\n\nvar ROUND_ARROW = '';\nvar BOX_CLASS = \"tippy-box\";\nvar CONTENT_CLASS = \"tippy-content\";\nvar BACKDROP_CLASS = \"tippy-backdrop\";\nvar ARROW_CLASS = \"tippy-arrow\";\nvar SVG_ARROW_CLASS = \"tippy-svg-arrow\";\nvar TOUCH_OPTIONS = {\n passive: true,\n capture: true\n};\nvar TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {\n return document.body;\n};\n\nfunction hasOwnProperty(obj, key) {\n return {}.hasOwnProperty.call(obj, key);\n}\nfunction getValueAtIndexOrReturn(value, index, defaultValue) {\n if (Array.isArray(value)) {\n var v = value[index];\n return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;\n }\n\n return value;\n}\nfunction isType(value, type) {\n var str = {}.toString.call(value);\n return str.indexOf('[object') === 0 && str.indexOf(type + \"]\") > -1;\n}\nfunction invokeWithArgsOrReturn(value, args) {\n return typeof value === 'function' ? value.apply(void 0, args) : value;\n}\nfunction debounce(fn, ms) {\n // Avoid wrapping in `setTimeout` if ms is 0 anyway\n if (ms === 0) {\n return fn;\n }\n\n var timeout;\n return function (arg) {\n clearTimeout(timeout);\n timeout = setTimeout(function () {\n fn(arg);\n }, ms);\n };\n}\nfunction removeProperties(obj, keys) {\n var clone = Object.assign({}, obj);\n keys.forEach(function (key) {\n delete clone[key];\n });\n return clone;\n}\nfunction splitBySpaces(value) {\n return value.split(/\\s+/).filter(Boolean);\n}\nfunction normalizeToArray(value) {\n return [].concat(value);\n}\nfunction pushIfUnique(arr, value) {\n if (arr.indexOf(value) === -1) {\n arr.push(value);\n }\n}\nfunction unique(arr) {\n return arr.filter(function (item, index) {\n return arr.indexOf(item) === index;\n });\n}\nfunction getBasePlacement(placement) {\n return placement.split('-')[0];\n}\nfunction arrayFrom(value) {\n return [].slice.call(value);\n}\nfunction removeUndefinedProps(obj) {\n return Object.keys(obj).reduce(function (acc, key) {\n if (obj[key] !== undefined) {\n acc[key] = obj[key];\n }\n\n return acc;\n }, {});\n}\n\nfunction div() {\n return document.createElement('div');\n}\nfunction isElement(value) {\n return ['Element', 'Fragment'].some(function (type) {\n return isType(value, type);\n });\n}\nfunction isNodeList(value) {\n return isType(value, 'NodeList');\n}\nfunction isMouseEvent(value) {\n return isType(value, 'MouseEvent');\n}\nfunction isReferenceElement(value) {\n return !!(value && value._tippy && value._tippy.reference === value);\n}\nfunction getArrayOfElements(value) {\n if (isElement(value)) {\n return [value];\n }\n\n if (isNodeList(value)) {\n return arrayFrom(value);\n }\n\n if (Array.isArray(value)) {\n return value;\n }\n\n return arrayFrom(document.querySelectorAll(value));\n}\nfunction setTransitionDuration(els, value) {\n els.forEach(function (el) {\n if (el) {\n el.style.transitionDuration = value + \"ms\";\n }\n });\n}\nfunction setVisibilityState(els, state) {\n els.forEach(function (el) {\n if (el) {\n el.setAttribute('data-state', state);\n }\n });\n}\nfunction getOwnerDocument(elementOrElements) {\n var _element$ownerDocumen;\n\n var _normalizeToArray = normalizeToArray(elementOrElements),\n element = _normalizeToArray[0]; // Elements created via a have an ownerDocument with no reference to the body\n\n\n return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;\n}\nfunction isCursorOutsideInteractiveBorder(popperTreeData, event) {\n var clientX = event.clientX,\n clientY = event.clientY;\n return popperTreeData.every(function (_ref) {\n var popperRect = _ref.popperRect,\n popperState = _ref.popperState,\n props = _ref.props;\n var interactiveBorder = props.interactiveBorder;\n var basePlacement = getBasePlacement(popperState.placement);\n var offsetData = popperState.modifiersData.offset;\n\n if (!offsetData) {\n return true;\n }\n\n var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;\n var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;\n var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;\n var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;\n var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;\n var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;\n var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;\n var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;\n return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;\n });\n}\nfunction updateTransitionEndListener(box, action, listener) {\n var method = action + \"EventListener\"; // some browsers apparently support `transition` (unprefixed) but only fire\n // `webkitTransitionEnd`...\n\n ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {\n box[method](event, listener);\n });\n}\n/**\n * Compared to xxx.contains, this function works for dom structures with shadow\n * dom\n */\n\nfunction actualContains(parent, child) {\n var target = child;\n\n while (target) {\n var _target$getRootNode;\n\n if (parent.contains(target)) {\n return true;\n }\n\n target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;\n }\n\n return false;\n}\n\nvar currentInput = {\n isTouch: false\n};\nvar lastMouseMoveTime = 0;\n/**\n * When a `touchstart` event is fired, it's assumed the user is using touch\n * input. We'll bind a `mousemove` event listener to listen for mouse input in\n * the future. This way, the `isTouch` property is fully dynamic and will handle\n * hybrid devices that use a mix of touch + mouse input.\n */\n\nfunction onDocumentTouchStart() {\n if (currentInput.isTouch) {\n return;\n }\n\n currentInput.isTouch = true;\n\n if (window.performance) {\n document.addEventListener('mousemove', onDocumentMouseMove);\n }\n}\n/**\n * When two `mousemove` event are fired consecutively within 20ms, it's assumed\n * the user is using mouse input again. `mousemove` can fire on touch devices as\n * well, but very rarely that quickly.\n */\n\nfunction onDocumentMouseMove() {\n var now = performance.now();\n\n if (now - lastMouseMoveTime < 20) {\n currentInput.isTouch = false;\n document.removeEventListener('mousemove', onDocumentMouseMove);\n }\n\n lastMouseMoveTime = now;\n}\n/**\n * When an element is in focus and has a tippy, leaving the tab/window and\n * returning causes it to show again. For mouse users this is unexpected, but\n * for keyboard use it makes sense.\n * TODO: find a better technique to solve this problem\n */\n\nfunction onWindowBlur() {\n var activeElement = document.activeElement;\n\n if (isReferenceElement(activeElement)) {\n var instance = activeElement._tippy;\n\n if (activeElement.blur && !instance.state.isVisible) {\n activeElement.blur();\n }\n }\n}\nfunction bindGlobalEventListeners() {\n document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);\n window.addEventListener('blur', onWindowBlur);\n}\n\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\nvar isIE11 = isBrowser ? // @ts-ignore\n!!window.msCrypto : false;\n\nfunction createMemoryLeakWarning(method) {\n var txt = method === 'destroy' ? 'n already-' : ' ';\n return [method + \"() was called on a\" + txt + \"destroyed instance. This is a no-op but\", 'indicates a potential memory leak.'].join(' ');\n}\nfunction clean(value) {\n var spacesAndTabs = /[ \\t]{2,}/g;\n var lineStartWithSpaces = /^[ \\t]*/gm;\n return value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\n}\n\nfunction getDevMessage(message) {\n return clean(\"\\n %ctippy.js\\n\\n %c\" + clean(message) + \"\\n\\n %c\\uD83D\\uDC77\\u200D This is a development-only message. It will be removed in production.\\n \");\n}\n\nfunction getFormattedMessage(message) {\n return [getDevMessage(message), // title\n 'color: #00C584; font-size: 1.3em; font-weight: bold;', // message\n 'line-height: 1.5', // footer\n 'color: #a6a095;'];\n} // Assume warnings and errors never have the same message\n\nvar visitedMessages;\n\nif (process.env.NODE_ENV !== \"production\") {\n resetVisitedMessages();\n}\n\nfunction resetVisitedMessages() {\n visitedMessages = new Set();\n}\nfunction warnWhen(condition, message) {\n if (condition && !visitedMessages.has(message)) {\n var _console;\n\n visitedMessages.add(message);\n\n (_console = console).warn.apply(_console, getFormattedMessage(message));\n }\n}\nfunction errorWhen(condition, message) {\n if (condition && !visitedMessages.has(message)) {\n var _console2;\n\n visitedMessages.add(message);\n\n (_console2 = console).error.apply(_console2, getFormattedMessage(message));\n }\n}\nfunction validateTargets(targets) {\n var didPassFalsyValue = !targets;\n var didPassPlainObject = Object.prototype.toString.call(targets) === '[object Object]' && !targets.addEventListener;\n errorWhen(didPassFalsyValue, ['tippy() was passed', '`' + String(targets) + '`', 'as its targets (first) argument. Valid types are: String, Element,', 'Element[], or NodeList.'].join(' '));\n errorWhen(didPassPlainObject, ['tippy() was passed a plain object which is not supported as an argument', 'for virtual positioning. Use props.getReferenceClientRect instead.'].join(' '));\n}\n\nvar pluginProps = {\n animateFill: false,\n followCursor: false,\n inlinePositioning: false,\n sticky: false\n};\nvar renderProps = {\n allowHTML: false,\n animation: 'fade',\n arrow: true,\n content: '',\n inertia: false,\n maxWidth: 350,\n role: 'tooltip',\n theme: '',\n zIndex: 9999\n};\nvar defaultProps = Object.assign({\n appendTo: TIPPY_DEFAULT_APPEND_TO,\n aria: {\n content: 'auto',\n expanded: 'auto'\n },\n delay: 0,\n duration: [300, 250],\n getReferenceClientRect: null,\n hideOnClick: true,\n ignoreAttributes: false,\n interactive: false,\n interactiveBorder: 2,\n interactiveDebounce: 0,\n moveTransition: '',\n offset: [0, 10],\n onAfterUpdate: function onAfterUpdate() {},\n onBeforeUpdate: function onBeforeUpdate() {},\n onCreate: function onCreate() {},\n onDestroy: function onDestroy() {},\n onHidden: function onHidden() {},\n onHide: function onHide() {},\n onMount: function onMount() {},\n onShow: function onShow() {},\n onShown: function onShown() {},\n onTrigger: function onTrigger() {},\n onUntrigger: function onUntrigger() {},\n onClickOutside: function onClickOutside() {},\n placement: 'top',\n plugins: [],\n popperOptions: {},\n render: null,\n showOnCreate: false,\n touch: true,\n trigger: 'mouseenter focus',\n triggerTarget: null\n}, pluginProps, renderProps);\nvar defaultKeys = Object.keys(defaultProps);\nvar setDefaultProps = function setDefaultProps(partialProps) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n validateProps(partialProps, []);\n }\n\n var keys = Object.keys(partialProps);\n keys.forEach(function (key) {\n defaultProps[key] = partialProps[key];\n });\n};\nfunction getExtendedPassedProps(passedProps) {\n var plugins = passedProps.plugins || [];\n var pluginProps = plugins.reduce(function (acc, plugin) {\n var name = plugin.name,\n defaultValue = plugin.defaultValue;\n\n if (name) {\n var _name;\n\n acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;\n }\n\n return acc;\n }, {});\n return Object.assign({}, passedProps, pluginProps);\n}\nfunction getDataAttributeProps(reference, plugins) {\n var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {\n plugins: plugins\n }))) : defaultKeys;\n var props = propKeys.reduce(function (acc, key) {\n var valueAsString = (reference.getAttribute(\"data-tippy-\" + key) || '').trim();\n\n if (!valueAsString) {\n return acc;\n }\n\n if (key === 'content') {\n acc[key] = valueAsString;\n } else {\n try {\n acc[key] = JSON.parse(valueAsString);\n } catch (e) {\n acc[key] = valueAsString;\n }\n }\n\n return acc;\n }, {});\n return props;\n}\nfunction evaluateProps(reference, props) {\n var out = Object.assign({}, props, {\n content: invokeWithArgsOrReturn(props.content, [reference])\n }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));\n out.aria = Object.assign({}, defaultProps.aria, out.aria);\n out.aria = {\n expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,\n content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content\n };\n return out;\n}\nfunction validateProps(partialProps, plugins) {\n if (partialProps === void 0) {\n partialProps = {};\n }\n\n if (plugins === void 0) {\n plugins = [];\n }\n\n var keys = Object.keys(partialProps);\n keys.forEach(function (prop) {\n var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps));\n var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); // Check if the prop exists in `plugins`\n\n if (didPassUnknownProp) {\n didPassUnknownProp = plugins.filter(function (plugin) {\n return plugin.name === prop;\n }).length === 0;\n }\n\n warnWhen(didPassUnknownProp, [\"`\" + prop + \"`\", \"is not a valid prop. You may have spelled it incorrectly, or if it's\", 'a plugin, forgot to pass it in an array as props.plugins.', '\\n\\n', 'All props: https://atomiks.github.io/tippyjs/v6/all-props/\\n', 'Plugins: https://atomiks.github.io/tippyjs/v6/plugins/'].join(' '));\n });\n}\n\nvar innerHTML = function innerHTML() {\n return 'innerHTML';\n};\n\nfunction dangerouslySetInnerHTML(element, html) {\n element[innerHTML()] = html;\n}\n\nfunction createArrowElement(value) {\n var arrow = div();\n\n if (value === true) {\n arrow.className = ARROW_CLASS;\n } else {\n arrow.className = SVG_ARROW_CLASS;\n\n if (isElement(value)) {\n arrow.appendChild(value);\n } else {\n dangerouslySetInnerHTML(arrow, value);\n }\n }\n\n return arrow;\n}\n\nfunction setContent(content, props) {\n if (isElement(props.content)) {\n dangerouslySetInnerHTML(content, '');\n content.appendChild(props.content);\n } else if (typeof props.content !== 'function') {\n if (props.allowHTML) {\n dangerouslySetInnerHTML(content, props.content);\n } else {\n content.textContent = props.content;\n }\n }\n}\nfunction getChildren(popper) {\n var box = popper.firstElementChild;\n var boxChildren = arrayFrom(box.children);\n return {\n box: box,\n content: boxChildren.find(function (node) {\n return node.classList.contains(CONTENT_CLASS);\n }),\n arrow: boxChildren.find(function (node) {\n return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);\n }),\n backdrop: boxChildren.find(function (node) {\n return node.classList.contains(BACKDROP_CLASS);\n })\n };\n}\nfunction render(instance) {\n var popper = div();\n var box = div();\n box.className = BOX_CLASS;\n box.setAttribute('data-state', 'hidden');\n box.setAttribute('tabindex', '-1');\n var content = div();\n content.className = CONTENT_CLASS;\n content.setAttribute('data-state', 'hidden');\n setContent(content, instance.props);\n popper.appendChild(box);\n box.appendChild(content);\n onUpdate(instance.props, instance.props);\n\n function onUpdate(prevProps, nextProps) {\n var _getChildren = getChildren(popper),\n box = _getChildren.box,\n content = _getChildren.content,\n arrow = _getChildren.arrow;\n\n if (nextProps.theme) {\n box.setAttribute('data-theme', nextProps.theme);\n } else {\n box.removeAttribute('data-theme');\n }\n\n if (typeof nextProps.animation === 'string') {\n box.setAttribute('data-animation', nextProps.animation);\n } else {\n box.removeAttribute('data-animation');\n }\n\n if (nextProps.inertia) {\n box.setAttribute('data-inertia', '');\n } else {\n box.removeAttribute('data-inertia');\n }\n\n box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + \"px\" : nextProps.maxWidth;\n\n if (nextProps.role) {\n box.setAttribute('role', nextProps.role);\n } else {\n box.removeAttribute('role');\n }\n\n if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {\n setContent(content, instance.props);\n }\n\n if (nextProps.arrow) {\n if (!arrow) {\n box.appendChild(createArrowElement(nextProps.arrow));\n } else if (prevProps.arrow !== nextProps.arrow) {\n box.removeChild(arrow);\n box.appendChild(createArrowElement(nextProps.arrow));\n }\n } else if (arrow) {\n box.removeChild(arrow);\n }\n }\n\n return {\n popper: popper,\n onUpdate: onUpdate\n };\n} // Runtime check to identify if the render function is the default one; this\n// way we can apply default CSS transitions logic and it can be tree-shaken away\n\nrender.$$tippy = true;\n\nvar idCounter = 1;\nvar mouseMoveListeners = []; // Used by `hideAll()`\n\nvar mountedInstances = [];\nfunction createTippy(reference, passedProps) {\n var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================\n // 🔒 Private members\n // ===========================================================================\n\n var showTimeout;\n var hideTimeout;\n var scheduleHideAnimationFrame;\n var isVisibleFromClick = false;\n var didHideDueToDocumentMouseDown = false;\n var didTouchMove = false;\n var ignoreOnFirstUpdate = false;\n var lastTriggerEvent;\n var currentTransitionEndListener;\n var onFirstUpdate;\n var listeners = [];\n var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce);\n var currentTarget; // ===========================================================================\n // 🔑 Public members\n // ===========================================================================\n\n var id = idCounter++;\n var popperInstance = null;\n var plugins = unique(props.plugins);\n var state = {\n // Is the instance currently enabled?\n isEnabled: true,\n // Is the tippy currently showing and not transitioning out?\n isVisible: false,\n // Has the instance been destroyed?\n isDestroyed: false,\n // Is the tippy currently mounted to the DOM?\n isMounted: false,\n // Has the tippy finished transitioning in?\n isShown: false\n };\n var instance = {\n // properties\n id: id,\n reference: reference,\n popper: div(),\n popperInstance: popperInstance,\n props: props,\n state: state,\n plugins: plugins,\n // methods\n clearDelayTimeouts: clearDelayTimeouts,\n setProps: setProps,\n setContent: setContent,\n show: show,\n hide: hide,\n hideWithInteractivity: hideWithInteractivity,\n enable: enable,\n disable: disable,\n unmount: unmount,\n destroy: destroy\n }; // TODO: Investigate why this early return causes a TDZ error in the tests —\n // it doesn't seem to happen in the browser\n\n /* istanbul ignore if */\n\n if (!props.render) {\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(true, 'render() function has not been supplied.');\n }\n\n return instance;\n } // ===========================================================================\n // Initial mutations\n // ===========================================================================\n\n\n var _props$render = props.render(instance),\n popper = _props$render.popper,\n onUpdate = _props$render.onUpdate;\n\n popper.setAttribute('data-tippy-root', '');\n popper.id = \"tippy-\" + instance.id;\n instance.popper = popper;\n reference._tippy = instance;\n popper._tippy = instance;\n var pluginsHooks = plugins.map(function (plugin) {\n return plugin.fn(instance);\n });\n var hasAriaExpanded = reference.hasAttribute('aria-expanded');\n addListeners();\n handleAriaExpandedAttribute();\n handleStyles();\n invokeHook('onCreate', [instance]);\n\n if (props.showOnCreate) {\n scheduleShow();\n } // Prevent a tippy with a delay from hiding if the cursor left then returned\n // before it started hiding\n\n\n popper.addEventListener('mouseenter', function () {\n if (instance.props.interactive && instance.state.isVisible) {\n instance.clearDelayTimeouts();\n }\n });\n popper.addEventListener('mouseleave', function () {\n if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n }\n });\n return instance; // ===========================================================================\n // 🔒 Private methods\n // ===========================================================================\n\n function getNormalizedTouchSettings() {\n var touch = instance.props.touch;\n return Array.isArray(touch) ? touch : [touch, 0];\n }\n\n function getIsCustomTouchBehavior() {\n return getNormalizedTouchSettings()[0] === 'hold';\n }\n\n function getIsDefaultRenderFn() {\n var _instance$props$rende;\n\n // @ts-ignore\n return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);\n }\n\n function getCurrentTarget() {\n return currentTarget || reference;\n }\n\n function getDocument() {\n var parent = getCurrentTarget().parentNode;\n return parent ? getOwnerDocument(parent) : document;\n }\n\n function getDefaultTemplateChildren() {\n return getChildren(popper);\n }\n\n function getDelay(isShow) {\n // For touch or keyboard input, force `0` delay for UX reasons\n // Also if the instance is mounted but not visible (transitioning out),\n // ignore delay\n if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {\n return 0;\n }\n\n return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);\n }\n\n function handleStyles(fromHide) {\n if (fromHide === void 0) {\n fromHide = false;\n }\n\n popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';\n popper.style.zIndex = \"\" + instance.props.zIndex;\n }\n\n function invokeHook(hook, args, shouldInvokePropsHook) {\n if (shouldInvokePropsHook === void 0) {\n shouldInvokePropsHook = true;\n }\n\n pluginsHooks.forEach(function (pluginHooks) {\n if (pluginHooks[hook]) {\n pluginHooks[hook].apply(pluginHooks, args);\n }\n });\n\n if (shouldInvokePropsHook) {\n var _instance$props;\n\n (_instance$props = instance.props)[hook].apply(_instance$props, args);\n }\n }\n\n function handleAriaContentAttribute() {\n var aria = instance.props.aria;\n\n if (!aria.content) {\n return;\n }\n\n var attr = \"aria-\" + aria.content;\n var id = popper.id;\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n var currentValue = node.getAttribute(attr);\n\n if (instance.state.isVisible) {\n node.setAttribute(attr, currentValue ? currentValue + \" \" + id : id);\n } else {\n var nextValue = currentValue && currentValue.replace(id, '').trim();\n\n if (nextValue) {\n node.setAttribute(attr, nextValue);\n } else {\n node.removeAttribute(attr);\n }\n }\n });\n }\n\n function handleAriaExpandedAttribute() {\n if (hasAriaExpanded || !instance.props.aria.expanded) {\n return;\n }\n\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n if (instance.props.interactive) {\n node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');\n } else {\n node.removeAttribute('aria-expanded');\n }\n });\n }\n\n function cleanupInteractiveMouseListeners() {\n getDocument().removeEventListener('mousemove', debouncedOnMouseMove);\n mouseMoveListeners = mouseMoveListeners.filter(function (listener) {\n return listener !== debouncedOnMouseMove;\n });\n }\n\n function onDocumentPress(event) {\n // Moved finger to scroll instead of an intentional tap outside\n if (currentInput.isTouch) {\n if (didTouchMove || event.type === 'mousedown') {\n return;\n }\n }\n\n var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper\n\n if (instance.props.interactive && actualContains(popper, actualTarget)) {\n return;\n } // Clicked on the event listeners target\n\n\n if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {\n return actualContains(el, actualTarget);\n })) {\n if (currentInput.isTouch) {\n return;\n }\n\n if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {\n return;\n }\n } else {\n invokeHook('onClickOutside', [instance, event]);\n }\n\n if (instance.props.hideOnClick === true) {\n instance.clearDelayTimeouts();\n instance.hide(); // `mousedown` event is fired right before `focus` if pressing the\n // currentTarget. This lets a tippy with `focus` trigger know that it\n // should not show\n\n didHideDueToDocumentMouseDown = true;\n setTimeout(function () {\n didHideDueToDocumentMouseDown = false;\n }); // The listener gets added in `scheduleShow()`, but this may be hiding it\n // before it shows, and hide()'s early bail-out behavior can prevent it\n // from being cleaned up\n\n if (!instance.state.isMounted) {\n removeDocumentPress();\n }\n }\n }\n\n function onTouchMove() {\n didTouchMove = true;\n }\n\n function onTouchStart() {\n didTouchMove = false;\n }\n\n function addDocumentPress() {\n var doc = getDocument();\n doc.addEventListener('mousedown', onDocumentPress, true);\n doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function removeDocumentPress() {\n var doc = getDocument();\n doc.removeEventListener('mousedown', onDocumentPress, true);\n doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);\n doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);\n doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);\n }\n\n function onTransitionedOut(duration, callback) {\n onTransitionEnd(duration, function () {\n if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {\n callback();\n }\n });\n }\n\n function onTransitionedIn(duration, callback) {\n onTransitionEnd(duration, callback);\n }\n\n function onTransitionEnd(duration, callback) {\n var box = getDefaultTemplateChildren().box;\n\n function listener(event) {\n if (event.target === box) {\n updateTransitionEndListener(box, 'remove', listener);\n callback();\n }\n } // Make callback synchronous if duration is 0\n // `transitionend` won't fire otherwise\n\n\n if (duration === 0) {\n return callback();\n }\n\n updateTransitionEndListener(box, 'remove', currentTransitionEndListener);\n updateTransitionEndListener(box, 'add', listener);\n currentTransitionEndListener = listener;\n }\n\n function on(eventType, handler, options) {\n if (options === void 0) {\n options = false;\n }\n\n var nodes = normalizeToArray(instance.props.triggerTarget || reference);\n nodes.forEach(function (node) {\n node.addEventListener(eventType, handler, options);\n listeners.push({\n node: node,\n eventType: eventType,\n handler: handler,\n options: options\n });\n });\n }\n\n function addListeners() {\n if (getIsCustomTouchBehavior()) {\n on('touchstart', onTrigger, {\n passive: true\n });\n on('touchend', onMouseLeave, {\n passive: true\n });\n }\n\n splitBySpaces(instance.props.trigger).forEach(function (eventType) {\n if (eventType === 'manual') {\n return;\n }\n\n on(eventType, onTrigger);\n\n switch (eventType) {\n case 'mouseenter':\n on('mouseleave', onMouseLeave);\n break;\n\n case 'focus':\n on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);\n break;\n\n case 'focusin':\n on('focusout', onBlurOrFocusOut);\n break;\n }\n });\n }\n\n function removeListeners() {\n listeners.forEach(function (_ref) {\n var node = _ref.node,\n eventType = _ref.eventType,\n handler = _ref.handler,\n options = _ref.options;\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function onTrigger(event) {\n var _lastTriggerEvent;\n\n var shouldScheduleClickHide = false;\n\n if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {\n return;\n }\n\n var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';\n lastTriggerEvent = event;\n currentTarget = event.currentTarget;\n handleAriaExpandedAttribute();\n\n if (!instance.state.isVisible && isMouseEvent(event)) {\n // If scrolling, `mouseenter` events can be fired if the cursor lands\n // over a new target, but `mousemove` events don't get fired. This\n // causes interactive tooltips to get stuck open until the cursor is\n // moved\n mouseMoveListeners.forEach(function (listener) {\n return listener(event);\n });\n } // Toggle show/hide when clicking click-triggered tooltips\n\n\n if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {\n shouldScheduleClickHide = true;\n } else {\n scheduleShow(event);\n }\n\n if (event.type === 'click') {\n isVisibleFromClick = !shouldScheduleClickHide;\n }\n\n if (shouldScheduleClickHide && !wasFocused) {\n scheduleHide(event);\n }\n }\n\n function onMouseMove(event) {\n var target = event.target;\n var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);\n\n if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {\n return;\n }\n\n var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {\n var _instance$popperInsta;\n\n var instance = popper._tippy;\n var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;\n\n if (state) {\n return {\n popperRect: popper.getBoundingClientRect(),\n popperState: state,\n props: props\n };\n }\n\n return null;\n }).filter(Boolean);\n\n if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {\n cleanupInteractiveMouseListeners();\n scheduleHide(event);\n }\n }\n\n function onMouseLeave(event) {\n var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;\n\n if (shouldBail) {\n return;\n }\n\n if (instance.props.interactive) {\n instance.hideWithInteractivity(event);\n return;\n }\n\n scheduleHide(event);\n }\n\n function onBlurOrFocusOut(event) {\n if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {\n return;\n } // If focus was moved to within the popper\n\n\n if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {\n return;\n }\n\n scheduleHide(event);\n }\n\n function isEventListenerStopped(event) {\n return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;\n }\n\n function createPopperInstance() {\n destroyPopperInstance();\n var _instance$props2 = instance.props,\n popperOptions = _instance$props2.popperOptions,\n placement = _instance$props2.placement,\n offset = _instance$props2.offset,\n getReferenceClientRect = _instance$props2.getReferenceClientRect,\n moveTransition = _instance$props2.moveTransition;\n var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;\n var computedReference = getReferenceClientRect ? {\n getBoundingClientRect: getReferenceClientRect,\n contextElement: getReferenceClientRect.contextElement || getCurrentTarget()\n } : reference;\n var tippyModifier = {\n name: '$$tippy',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: function fn(_ref2) {\n var state = _ref2.state;\n\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh.box;\n\n ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {\n if (attr === 'placement') {\n box.setAttribute('data-placement', state.placement);\n } else {\n if (state.attributes.popper[\"data-popper-\" + attr]) {\n box.setAttribute(\"data-\" + attr, '');\n } else {\n box.removeAttribute(\"data-\" + attr);\n }\n }\n });\n state.attributes.popper = {};\n }\n }\n };\n var modifiers = [{\n name: 'offset',\n options: {\n offset: offset\n }\n }, {\n name: 'preventOverflow',\n options: {\n padding: {\n top: 2,\n bottom: 2,\n left: 5,\n right: 5\n }\n }\n }, {\n name: 'flip',\n options: {\n padding: 5\n }\n }, {\n name: 'computeStyles',\n options: {\n adaptive: !moveTransition\n }\n }, tippyModifier];\n\n if (getIsDefaultRenderFn() && arrow) {\n modifiers.push({\n name: 'arrow',\n options: {\n element: arrow,\n padding: 3\n }\n });\n }\n\n modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);\n instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {\n placement: placement,\n onFirstUpdate: onFirstUpdate,\n modifiers: modifiers\n }));\n }\n\n function destroyPopperInstance() {\n if (instance.popperInstance) {\n instance.popperInstance.destroy();\n instance.popperInstance = null;\n }\n }\n\n function mount() {\n var appendTo = instance.props.appendTo;\n var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so\n // it's directly after the reference element so the elements inside the\n // tippy can be tabbed to\n // If there are clipping issues, the user can specify a different appendTo\n // and ensure focus management is handled correctly manually\n\n var node = getCurrentTarget();\n\n if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {\n parentNode = node.parentNode;\n } else {\n parentNode = invokeWithArgsOrReturn(appendTo, [node]);\n } // The popper element needs to exist on the DOM before its position can be\n // updated as Popper needs to read its dimensions\n\n\n if (!parentNode.contains(popper)) {\n parentNode.appendChild(popper);\n }\n\n instance.state.isMounted = true;\n createPopperInstance();\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n // Accessibility check\n warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ['Interactive tippy element may not be accessible via keyboard', 'navigation because it is not directly after the reference element', 'in the DOM source order.', '\\n\\n', 'Using a wrapper or
tag around the reference element', 'solves this by creating a new parentNode context.', '\\n\\n', 'Specifying `appendTo: document.body` silences this warning, but it', 'assumes you are using a focus management solution to handle', 'keyboard navigation.', '\\n\\n', 'See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity'].join(' '));\n }\n }\n\n function getNestedPopperTree() {\n return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));\n }\n\n function scheduleShow(event) {\n instance.clearDelayTimeouts();\n\n if (event) {\n invokeHook('onTrigger', [instance, event]);\n }\n\n addDocumentPress();\n var delay = getDelay(true);\n\n var _getNormalizedTouchSe = getNormalizedTouchSettings(),\n touchValue = _getNormalizedTouchSe[0],\n touchDelay = _getNormalizedTouchSe[1];\n\n if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {\n delay = touchDelay;\n }\n\n if (delay) {\n showTimeout = setTimeout(function () {\n instance.show();\n }, delay);\n } else {\n instance.show();\n }\n }\n\n function scheduleHide(event) {\n instance.clearDelayTimeouts();\n invokeHook('onUntrigger', [instance, event]);\n\n if (!instance.state.isVisible) {\n removeDocumentPress();\n return;\n } // For interactive tippies, scheduleHide is added to a document.body handler\n // from onMouseLeave so must intercept scheduled hides from mousemove/leave\n // events when trigger contains mouseenter and click, and the tip is\n // currently shown as a result of a click.\n\n\n if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {\n return;\n }\n\n var delay = getDelay(false);\n\n if (delay) {\n hideTimeout = setTimeout(function () {\n if (instance.state.isVisible) {\n instance.hide();\n }\n }, delay);\n } else {\n // Fixes a `transitionend` problem when it fires 1 frame too\n // late sometimes, we don't want hide() to be called.\n scheduleHideAnimationFrame = requestAnimationFrame(function () {\n instance.hide();\n });\n }\n } // ===========================================================================\n // 🔑 Public methods\n // ===========================================================================\n\n\n function enable() {\n instance.state.isEnabled = true;\n }\n\n function disable() {\n // Disabling the instance should also hide it\n // https://github.com/atomiks/tippy.js-react/issues/106\n instance.hide();\n instance.state.isEnabled = false;\n }\n\n function clearDelayTimeouts() {\n clearTimeout(showTimeout);\n clearTimeout(hideTimeout);\n cancelAnimationFrame(scheduleHideAnimationFrame);\n }\n\n function setProps(partialProps) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('setProps'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n invokeHook('onBeforeUpdate', [instance, partialProps]);\n removeListeners();\n var prevProps = instance.props;\n var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {\n ignoreAttributes: true\n }));\n instance.props = nextProps;\n addListeners();\n\n if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {\n cleanupInteractiveMouseListeners();\n debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);\n } // Ensure stale aria-expanded attributes are removed\n\n\n if (prevProps.triggerTarget && !nextProps.triggerTarget) {\n normalizeToArray(prevProps.triggerTarget).forEach(function (node) {\n node.removeAttribute('aria-expanded');\n });\n } else if (nextProps.triggerTarget) {\n reference.removeAttribute('aria-expanded');\n }\n\n handleAriaExpandedAttribute();\n handleStyles();\n\n if (onUpdate) {\n onUpdate(prevProps, nextProps);\n }\n\n if (instance.popperInstance) {\n createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,\n // and the nested ones get re-rendered first.\n // https://github.com/atomiks/tippyjs-react/issues/177\n // TODO: find a cleaner / more efficient solution(!)\n\n getNestedPopperTree().forEach(function (nestedPopper) {\n // React (and other UI libs likely) requires a rAF wrapper as it flushes\n // its work in one\n requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);\n });\n }\n\n invokeHook('onAfterUpdate', [instance, partialProps]);\n }\n\n function setContent(content) {\n instance.setProps({\n content: content\n });\n }\n\n function show() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('show'));\n } // Early bail-out\n\n\n var isAlreadyVisible = instance.state.isVisible;\n var isDestroyed = instance.state.isDestroyed;\n var isDisabled = !instance.state.isEnabled;\n var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;\n var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);\n\n if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {\n return;\n } // Normalize `disabled` behavior across browsers.\n // Firefox allows events on disabled elements, but Chrome doesn't.\n // Using a wrapper element (i.e. ) is recommended.\n\n\n if (getCurrentTarget().hasAttribute('disabled')) {\n return;\n }\n\n invokeHook('onShow', [instance], false);\n\n if (instance.props.onShow(instance) === false) {\n return;\n }\n\n instance.state.isVisible = true;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'visible';\n }\n\n handleStyles();\n addDocumentPress();\n\n if (!instance.state.isMounted) {\n popper.style.transition = 'none';\n } // If flipping to the opposite side after hiding at least once, the\n // animation will use the wrong placement without resetting the duration\n\n\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh2.box,\n content = _getDefaultTemplateCh2.content;\n\n setTransitionDuration([box, content], 0);\n }\n\n onFirstUpdate = function onFirstUpdate() {\n var _instance$popperInsta2;\n\n if (!instance.state.isVisible || ignoreOnFirstUpdate) {\n return;\n }\n\n ignoreOnFirstUpdate = true; // reflow\n\n void popper.offsetHeight;\n popper.style.transition = instance.props.moveTransition;\n\n if (getIsDefaultRenderFn() && instance.props.animation) {\n var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),\n _box = _getDefaultTemplateCh3.box,\n _content = _getDefaultTemplateCh3.content;\n\n setTransitionDuration([_box, _content], duration);\n setVisibilityState([_box, _content], 'visible');\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the\n // popper has been positioned for the first time\n\n (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();\n invokeHook('onMount', [instance]);\n\n if (instance.props.animation && getIsDefaultRenderFn()) {\n onTransitionedIn(duration, function () {\n instance.state.isShown = true;\n invokeHook('onShown', [instance]);\n });\n }\n };\n\n mount();\n }\n\n function hide() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hide'));\n } // Early bail-out\n\n\n var isAlreadyHidden = !instance.state.isVisible;\n var isDestroyed = instance.state.isDestroyed;\n var isDisabled = !instance.state.isEnabled;\n var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);\n\n if (isAlreadyHidden || isDestroyed || isDisabled) {\n return;\n }\n\n invokeHook('onHide', [instance], false);\n\n if (instance.props.onHide(instance) === false) {\n return;\n }\n\n instance.state.isVisible = false;\n instance.state.isShown = false;\n ignoreOnFirstUpdate = false;\n isVisibleFromClick = false;\n\n if (getIsDefaultRenderFn()) {\n popper.style.visibility = 'hidden';\n }\n\n cleanupInteractiveMouseListeners();\n removeDocumentPress();\n handleStyles(true);\n\n if (getIsDefaultRenderFn()) {\n var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),\n box = _getDefaultTemplateCh4.box,\n content = _getDefaultTemplateCh4.content;\n\n if (instance.props.animation) {\n setTransitionDuration([box, content], duration);\n setVisibilityState([box, content], 'hidden');\n }\n }\n\n handleAriaContentAttribute();\n handleAriaExpandedAttribute();\n\n if (instance.props.animation) {\n if (getIsDefaultRenderFn()) {\n onTransitionedOut(duration, instance.unmount);\n }\n } else {\n instance.unmount();\n }\n }\n\n function hideWithInteractivity(event) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('hideWithInteractivity'));\n }\n\n getDocument().addEventListener('mousemove', debouncedOnMouseMove);\n pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);\n debouncedOnMouseMove(event);\n }\n\n function unmount() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('unmount'));\n }\n\n if (instance.state.isVisible) {\n instance.hide();\n }\n\n if (!instance.state.isMounted) {\n return;\n }\n\n destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper\n // tree by default. This seems mainly for interactive tippies, but we should\n // find a workaround if possible\n\n getNestedPopperTree().forEach(function (nestedPopper) {\n nestedPopper._tippy.unmount();\n });\n\n if (popper.parentNode) {\n popper.parentNode.removeChild(popper);\n }\n\n mountedInstances = mountedInstances.filter(function (i) {\n return i !== instance;\n });\n instance.state.isMounted = false;\n invokeHook('onHidden', [instance]);\n }\n\n function destroy() {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n warnWhen(instance.state.isDestroyed, createMemoryLeakWarning('destroy'));\n }\n\n if (instance.state.isDestroyed) {\n return;\n }\n\n instance.clearDelayTimeouts();\n instance.unmount();\n removeListeners();\n delete reference._tippy;\n instance.state.isDestroyed = true;\n invokeHook('onDestroy', [instance]);\n }\n}\n\nfunction tippy(targets, optionalProps) {\n if (optionalProps === void 0) {\n optionalProps = {};\n }\n\n var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n validateTargets(targets);\n validateProps(optionalProps, plugins);\n }\n\n bindGlobalEventListeners();\n var passedProps = Object.assign({}, optionalProps, {\n plugins: plugins\n });\n var elements = getArrayOfElements(targets);\n /* istanbul ignore else */\n\n if (process.env.NODE_ENV !== \"production\") {\n var isSingleContentElement = isElement(passedProps.content);\n var isMoreThanOneReferenceElement = elements.length > 1;\n warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ['tippy() was passed an Element as the `content` prop, but more than', 'one tippy instance was created by this invocation. This means the', 'content element will only be appended to the last tippy instance.', '\\n\\n', 'Instead, pass the .innerHTML of the element, or use a function that', 'returns a cloned version of the element instead.', '\\n\\n', '1) content: element.innerHTML\\n', '2) content: () => element.cloneNode(true)'].join(' '));\n }\n\n var instances = elements.reduce(function (acc, reference) {\n var instance = reference && createTippy(reference, passedProps);\n\n if (instance) {\n acc.push(instance);\n }\n\n return acc;\n }, []);\n return isElement(targets) ? instances[0] : instances;\n}\n\ntippy.defaultProps = defaultProps;\ntippy.setDefaultProps = setDefaultProps;\ntippy.currentInput = currentInput;\nvar hideAll = function hideAll(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n excludedReferenceOrInstance = _ref.exclude,\n duration = _ref.duration;\n\n mountedInstances.forEach(function (instance) {\n var isExcluded = false;\n\n if (excludedReferenceOrInstance) {\n isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;\n }\n\n if (!isExcluded) {\n var originalDuration = instance.props.duration;\n instance.setProps({\n duration: duration\n });\n instance.hide();\n\n if (!instance.state.isDestroyed) {\n instance.setProps({\n duration: originalDuration\n });\n }\n }\n });\n};\n\n// every time the popper is destroyed (i.e. a new target), removing the styles\n// and causing transitions to break for singletons when the console is open, but\n// most notably for non-transform styles being used, `gpuAcceleration: false`.\n\nvar applyStylesModifier = Object.assign({}, applyStyles, {\n effect: function effect(_ref) {\n var state = _ref.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n } // intentionally return no cleanup function\n // return () => { ... }\n\n }\n});\n\nvar createSingleton = function createSingleton(tippyInstances, optionalProps) {\n var _optionalProps$popper;\n\n if (optionalProps === void 0) {\n optionalProps = {};\n }\n\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(!Array.isArray(tippyInstances), ['The first argument passed to createSingleton() must be an array of', 'tippy instances. The passed value was', String(tippyInstances)].join(' '));\n }\n\n var individualInstances = tippyInstances;\n var references = [];\n var triggerTargets = [];\n var currentTarget;\n var overrides = optionalProps.overrides;\n var interceptSetPropsCleanups = [];\n var shownOnCreate = false;\n\n function setTriggerTargets() {\n triggerTargets = individualInstances.map(function (instance) {\n return normalizeToArray(instance.props.triggerTarget || instance.reference);\n }).reduce(function (acc, item) {\n return acc.concat(item);\n }, []);\n }\n\n function setReferences() {\n references = individualInstances.map(function (instance) {\n return instance.reference;\n });\n }\n\n function enableInstances(isEnabled) {\n individualInstances.forEach(function (instance) {\n if (isEnabled) {\n instance.enable();\n } else {\n instance.disable();\n }\n });\n }\n\n function interceptSetProps(singleton) {\n return individualInstances.map(function (instance) {\n var originalSetProps = instance.setProps;\n\n instance.setProps = function (props) {\n originalSetProps(props);\n\n if (instance.reference === currentTarget) {\n singleton.setProps(props);\n }\n };\n\n return function () {\n instance.setProps = originalSetProps;\n };\n });\n } // have to pass singleton, as it maybe undefined on first call\n\n\n function prepareInstance(singleton, target) {\n var index = triggerTargets.indexOf(target); // bail-out\n\n if (target === currentTarget) {\n return;\n }\n\n currentTarget = target;\n var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {\n acc[prop] = individualInstances[index].props[prop];\n return acc;\n }, {});\n singleton.setProps(Object.assign({}, overrideProps, {\n getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {\n var _references$index;\n\n return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();\n }\n }));\n }\n\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n var plugin = {\n fn: function fn() {\n return {\n onDestroy: function onDestroy() {\n enableInstances(true);\n },\n onHidden: function onHidden() {\n currentTarget = null;\n },\n onClickOutside: function onClickOutside(instance) {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n currentTarget = null;\n }\n },\n onShow: function onShow(instance) {\n if (instance.props.showOnCreate && !shownOnCreate) {\n shownOnCreate = true;\n prepareInstance(instance, references[0]);\n }\n },\n onTrigger: function onTrigger(instance, event) {\n prepareInstance(instance, event.currentTarget);\n }\n };\n }\n };\n var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {\n plugins: [plugin].concat(optionalProps.plugins || []),\n triggerTarget: triggerTargets,\n popperOptions: Object.assign({}, optionalProps.popperOptions, {\n modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])\n })\n }));\n var originalShow = singleton.show;\n\n singleton.show = function (target) {\n originalShow(); // first time, showOnCreate or programmatic call with no params\n // default to showing first instance\n\n if (!currentTarget && target == null) {\n return prepareInstance(singleton, references[0]);\n } // triggered from event (do nothing as prepareInstance already called by onTrigger)\n // programmatic call with no params when already visible (do nothing again)\n\n\n if (currentTarget && target == null) {\n return;\n } // target is index of instance\n\n\n if (typeof target === 'number') {\n return references[target] && prepareInstance(singleton, references[target]);\n } // target is a child tippy instance\n\n\n if (individualInstances.indexOf(target) >= 0) {\n var ref = target.reference;\n return prepareInstance(singleton, ref);\n } // target is a ReferenceElement\n\n\n if (references.indexOf(target) >= 0) {\n return prepareInstance(singleton, target);\n }\n };\n\n singleton.showNext = function () {\n var first = references[0];\n\n if (!currentTarget) {\n return singleton.show(0);\n }\n\n var index = references.indexOf(currentTarget);\n singleton.show(references[index + 1] || first);\n };\n\n singleton.showPrevious = function () {\n var last = references[references.length - 1];\n\n if (!currentTarget) {\n return singleton.show(last);\n }\n\n var index = references.indexOf(currentTarget);\n var target = references[index - 1] || last;\n singleton.show(target);\n };\n\n var originalSetProps = singleton.setProps;\n\n singleton.setProps = function (props) {\n overrides = props.overrides || overrides;\n originalSetProps(props);\n };\n\n singleton.setInstances = function (nextInstances) {\n enableInstances(true);\n interceptSetPropsCleanups.forEach(function (fn) {\n return fn();\n });\n individualInstances = nextInstances;\n enableInstances(false);\n setReferences();\n setTriggerTargets();\n interceptSetPropsCleanups = interceptSetProps(singleton);\n singleton.setProps({\n triggerTarget: triggerTargets\n });\n };\n\n interceptSetPropsCleanups = interceptSetProps(singleton);\n return singleton;\n};\n\nvar BUBBLING_EVENTS_MAP = {\n mouseover: 'mouseenter',\n focusin: 'focus',\n click: 'click'\n};\n/**\n * Creates a delegate instance that controls the creation of tippy instances\n * for child elements (`target` CSS selector).\n */\n\nfunction delegate(targets, props) {\n /* istanbul ignore else */\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(!(props && props.target), ['You must specity a `target` prop indicating a CSS selector string matching', 'the target elements that should receive a tippy.'].join(' '));\n }\n\n var listeners = [];\n var childTippyInstances = [];\n var disabled = false;\n var target = props.target;\n var nativeProps = removeProperties(props, ['target']);\n var parentProps = Object.assign({}, nativeProps, {\n trigger: 'manual',\n touch: false\n });\n var childProps = Object.assign({\n touch: defaultProps.touch\n }, nativeProps, {\n showOnCreate: true\n });\n var returnValue = tippy(targets, parentProps);\n var normalizedReturnValue = normalizeToArray(returnValue);\n\n function onTrigger(event) {\n if (!event.target || disabled) {\n return;\n }\n\n var targetNode = event.target.closest(target);\n\n if (!targetNode) {\n return;\n } // Get relevant trigger with fallbacks:\n // 1. Check `data-tippy-trigger` attribute on target node\n // 2. Fallback to `trigger` passed to `delegate()`\n // 3. Fallback to `defaultProps.trigger`\n\n\n var trigger = targetNode.getAttribute('data-tippy-trigger') || props.trigger || defaultProps.trigger; // @ts-ignore\n\n if (targetNode._tippy) {\n return;\n }\n\n if (event.type === 'touchstart' && typeof childProps.touch === 'boolean') {\n return;\n }\n\n if (event.type !== 'touchstart' && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) {\n return;\n }\n\n var instance = tippy(targetNode, childProps);\n\n if (instance) {\n childTippyInstances = childTippyInstances.concat(instance);\n }\n }\n\n function on(node, eventType, handler, options) {\n if (options === void 0) {\n options = false;\n }\n\n node.addEventListener(eventType, handler, options);\n listeners.push({\n node: node,\n eventType: eventType,\n handler: handler,\n options: options\n });\n }\n\n function addEventListeners(instance) {\n var reference = instance.reference;\n on(reference, 'touchstart', onTrigger, TOUCH_OPTIONS);\n on(reference, 'mouseover', onTrigger);\n on(reference, 'focusin', onTrigger);\n on(reference, 'click', onTrigger);\n }\n\n function removeEventListeners() {\n listeners.forEach(function (_ref) {\n var node = _ref.node,\n eventType = _ref.eventType,\n handler = _ref.handler,\n options = _ref.options;\n node.removeEventListener(eventType, handler, options);\n });\n listeners = [];\n }\n\n function applyMutations(instance) {\n var originalDestroy = instance.destroy;\n var originalEnable = instance.enable;\n var originalDisable = instance.disable;\n\n instance.destroy = function (shouldDestroyChildInstances) {\n if (shouldDestroyChildInstances === void 0) {\n shouldDestroyChildInstances = true;\n }\n\n if (shouldDestroyChildInstances) {\n childTippyInstances.forEach(function (instance) {\n instance.destroy();\n });\n }\n\n childTippyInstances = [];\n removeEventListeners();\n originalDestroy();\n };\n\n instance.enable = function () {\n originalEnable();\n childTippyInstances.forEach(function (instance) {\n return instance.enable();\n });\n disabled = false;\n };\n\n instance.disable = function () {\n originalDisable();\n childTippyInstances.forEach(function (instance) {\n return instance.disable();\n });\n disabled = true;\n };\n\n addEventListeners(instance);\n }\n\n normalizedReturnValue.forEach(applyMutations);\n return returnValue;\n}\n\nvar animateFill = {\n name: 'animateFill',\n defaultValue: false,\n fn: function fn(instance) {\n var _instance$props$rende;\n\n // @ts-ignore\n if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {\n if (process.env.NODE_ENV !== \"production\") {\n errorWhen(instance.props.animateFill, 'The `animateFill` plugin requires the default render function.');\n }\n\n return {};\n }\n\n var _getChildren = getChildren(instance.popper),\n box = _getChildren.box,\n content = _getChildren.content;\n\n var backdrop = instance.props.animateFill ? createBackdropElement() : null;\n return {\n onCreate: function onCreate() {\n if (backdrop) {\n box.insertBefore(backdrop, box.firstElementChild);\n box.setAttribute('data-animatefill', '');\n box.style.overflow = 'hidden';\n instance.setProps({\n arrow: false,\n animation: 'shift-away'\n });\n }\n },\n onMount: function onMount() {\n if (backdrop) {\n var transitionDuration = box.style.transitionDuration;\n var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the\n // tooltip element. `clip-path` is the other alternative but is not\n // well-supported and is buggy on some devices.\n\n content.style.transitionDelay = Math.round(duration / 10) + \"ms\";\n backdrop.style.transitionDuration = transitionDuration;\n setVisibilityState([backdrop], 'visible');\n }\n },\n onShow: function onShow() {\n if (backdrop) {\n backdrop.style.transitionDuration = '0ms';\n }\n },\n onHide: function onHide() {\n if (backdrop) {\n setVisibilityState([backdrop], 'hidden');\n }\n }\n };\n }\n};\n\nfunction createBackdropElement() {\n var backdrop = div();\n backdrop.className = BACKDROP_CLASS;\n setVisibilityState([backdrop], 'hidden');\n return backdrop;\n}\n\nvar mouseCoords = {\n clientX: 0,\n clientY: 0\n};\nvar activeInstances = [];\n\nfunction storeMouseCoords(_ref) {\n var clientX = _ref.clientX,\n clientY = _ref.clientY;\n mouseCoords = {\n clientX: clientX,\n clientY: clientY\n };\n}\n\nfunction addMouseCoordsListener(doc) {\n doc.addEventListener('mousemove', storeMouseCoords);\n}\n\nfunction removeMouseCoordsListener(doc) {\n doc.removeEventListener('mousemove', storeMouseCoords);\n}\n\nvar followCursor = {\n name: 'followCursor',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference;\n var doc = getOwnerDocument(instance.props.triggerTarget || reference);\n var isInternalUpdate = false;\n var wasFocusEvent = false;\n var isUnmounted = true;\n var prevProps = instance.props;\n\n function getIsInitialBehavior() {\n return instance.props.followCursor === 'initial' && instance.state.isVisible;\n }\n\n function addListener() {\n doc.addEventListener('mousemove', onMouseMove);\n }\n\n function removeListener() {\n doc.removeEventListener('mousemove', onMouseMove);\n }\n\n function unsetGetReferenceClientRect() {\n isInternalUpdate = true;\n instance.setProps({\n getReferenceClientRect: null\n });\n isInternalUpdate = false;\n }\n\n function onMouseMove(event) {\n // If the instance is interactive, avoid updating the position unless it's\n // over the reference element\n var isCursorOverReference = event.target ? reference.contains(event.target) : true;\n var followCursor = instance.props.followCursor;\n var clientX = event.clientX,\n clientY = event.clientY;\n var rect = reference.getBoundingClientRect();\n var relativeX = clientX - rect.left;\n var relativeY = clientY - rect.top;\n\n if (isCursorOverReference || !instance.props.interactive) {\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: function getReferenceClientRect() {\n var rect = reference.getBoundingClientRect();\n var x = clientX;\n var y = clientY;\n\n if (followCursor === 'initial') {\n x = rect.left + relativeX;\n y = rect.top + relativeY;\n }\n\n var top = followCursor === 'horizontal' ? rect.top : y;\n var right = followCursor === 'vertical' ? rect.right : x;\n var bottom = followCursor === 'horizontal' ? rect.bottom : y;\n var left = followCursor === 'vertical' ? rect.left : x;\n return {\n width: right - left,\n height: bottom - top,\n top: top,\n right: right,\n bottom: bottom,\n left: left\n };\n }\n });\n }\n }\n\n function create() {\n if (instance.props.followCursor) {\n activeInstances.push({\n instance: instance,\n doc: doc\n });\n addMouseCoordsListener(doc);\n }\n }\n\n function destroy() {\n activeInstances = activeInstances.filter(function (data) {\n return data.instance !== instance;\n });\n\n if (activeInstances.filter(function (data) {\n return data.doc === doc;\n }).length === 0) {\n removeMouseCoordsListener(doc);\n }\n }\n\n return {\n onCreate: create,\n onDestroy: destroy,\n onBeforeUpdate: function onBeforeUpdate() {\n prevProps = instance.props;\n },\n onAfterUpdate: function onAfterUpdate(_, _ref2) {\n var followCursor = _ref2.followCursor;\n\n if (isInternalUpdate) {\n return;\n }\n\n if (followCursor !== undefined && prevProps.followCursor !== followCursor) {\n destroy();\n\n if (followCursor) {\n create();\n\n if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {\n addListener();\n }\n } else {\n removeListener();\n unsetGetReferenceClientRect();\n }\n }\n },\n onMount: function onMount() {\n if (instance.props.followCursor && !wasFocusEvent) {\n if (isUnmounted) {\n onMouseMove(mouseCoords);\n isUnmounted = false;\n }\n\n if (!getIsInitialBehavior()) {\n addListener();\n }\n }\n },\n onTrigger: function onTrigger(_, event) {\n if (isMouseEvent(event)) {\n mouseCoords = {\n clientX: event.clientX,\n clientY: event.clientY\n };\n }\n\n wasFocusEvent = event.type === 'focus';\n },\n onHidden: function onHidden() {\n if (instance.props.followCursor) {\n unsetGetReferenceClientRect();\n removeListener();\n isUnmounted = true;\n }\n }\n };\n }\n};\n\nfunction getProps(props, modifier) {\n var _props$popperOptions;\n\n return {\n popperOptions: Object.assign({}, props.popperOptions, {\n modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) {\n var name = _ref.name;\n return name !== modifier.name;\n }), [modifier])\n })\n };\n}\n\nvar inlinePositioning = {\n name: 'inlinePositioning',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference;\n\n function isEnabled() {\n return !!instance.props.inlinePositioning;\n }\n\n var placement;\n var cursorRectIndex = -1;\n var isInternalUpdate = false;\n var triedPlacements = [];\n var modifier = {\n name: 'tippyInlinePositioning',\n enabled: true,\n phase: 'afterWrite',\n fn: function fn(_ref2) {\n var state = _ref2.state;\n\n if (isEnabled()) {\n if (triedPlacements.indexOf(state.placement) !== -1) {\n triedPlacements = [];\n }\n\n if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {\n triedPlacements.push(state.placement);\n instance.setProps({\n // @ts-ignore - unneeded DOMRect properties\n getReferenceClientRect: function getReferenceClientRect() {\n return _getReferenceClientRect(state.placement);\n }\n });\n }\n\n placement = state.placement;\n }\n }\n };\n\n function _getReferenceClientRect(placement) {\n return getInlineBoundingClientRect(getBasePlacement(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex);\n }\n\n function setInternalProps(partialProps) {\n isInternalUpdate = true;\n instance.setProps(partialProps);\n isInternalUpdate = false;\n }\n\n function addModifier() {\n if (!isInternalUpdate) {\n setInternalProps(getProps(instance.props, modifier));\n }\n }\n\n return {\n onCreate: addModifier,\n onAfterUpdate: addModifier,\n onTrigger: function onTrigger(_, event) {\n if (isMouseEvent(event)) {\n var rects = arrayFrom(instance.reference.getClientRects());\n var cursorRect = rects.find(function (rect) {\n return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;\n });\n var index = rects.indexOf(cursorRect);\n cursorRectIndex = index > -1 ? index : cursorRectIndex;\n }\n },\n onHidden: function onHidden() {\n cursorRectIndex = -1;\n }\n };\n }\n};\nfunction getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {\n // Not an inline element, or placement is not yet known\n if (clientRects.length < 2 || currentBasePlacement === null) {\n return boundingRect;\n } // There are two rects and they are disjoined\n\n\n if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {\n return clientRects[cursorRectIndex] || boundingRect;\n }\n\n switch (currentBasePlacement) {\n case 'top':\n case 'bottom':\n {\n var firstRect = clientRects[0];\n var lastRect = clientRects[clientRects.length - 1];\n var isTop = currentBasePlacement === 'top';\n var top = firstRect.top;\n var bottom = lastRect.bottom;\n var left = isTop ? firstRect.left : lastRect.left;\n var right = isTop ? firstRect.right : lastRect.right;\n var width = right - left;\n var height = bottom - top;\n return {\n top: top,\n bottom: bottom,\n left: left,\n right: right,\n width: width,\n height: height\n };\n }\n\n case 'left':\n case 'right':\n {\n var minLeft = Math.min.apply(Math, clientRects.map(function (rects) {\n return rects.left;\n }));\n var maxRight = Math.max.apply(Math, clientRects.map(function (rects) {\n return rects.right;\n }));\n var measureRects = clientRects.filter(function (rect) {\n return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight;\n });\n var _top = measureRects[0].top;\n var _bottom = measureRects[measureRects.length - 1].bottom;\n var _left = minLeft;\n var _right = maxRight;\n\n var _width = _right - _left;\n\n var _height = _bottom - _top;\n\n return {\n top: _top,\n bottom: _bottom,\n left: _left,\n right: _right,\n width: _width,\n height: _height\n };\n }\n\n default:\n {\n return boundingRect;\n }\n }\n}\n\nvar sticky = {\n name: 'sticky',\n defaultValue: false,\n fn: function fn(instance) {\n var reference = instance.reference,\n popper = instance.popper;\n\n function getReference() {\n return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference;\n }\n\n function shouldCheck(value) {\n return instance.props.sticky === true || instance.props.sticky === value;\n }\n\n var prevRefRect = null;\n var prevPopRect = null;\n\n function updatePosition() {\n var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null;\n var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null;\n\n if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {\n if (instance.popperInstance) {\n instance.popperInstance.update();\n }\n }\n\n prevRefRect = currentRefRect;\n prevPopRect = currentPopRect;\n\n if (instance.state.isMounted) {\n requestAnimationFrame(updatePosition);\n }\n }\n\n return {\n onMount: function onMount() {\n if (instance.props.sticky) {\n updatePosition();\n }\n }\n };\n }\n};\n\nfunction areRectsDifferent(rectA, rectB) {\n if (rectA && rectB) {\n return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;\n }\n\n return true;\n}\n\ntippy.setDefaultProps({\n render: render\n});\n\nexport default tippy;\nexport { animateFill, createSingleton, delegate, followCursor, hideAll, inlinePositioning, ROUND_ARROW as roundArrow, sticky };\n//# sourceMappingURL=tippy.esm.js.map\n","import tippy, { createSingleton } from 'tippy.js';\nexport { default as tippy } from 'tippy.js';\nimport React, { useLayoutEffect, useEffect, useRef, useState, cloneElement, useMemo, forwardRef as forwardRef$1 } from 'react';\nimport { createPortal } from 'react-dom';\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nvar isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\nfunction preserveRef(ref, node) {\n if (ref) {\n if (typeof ref === 'function') {\n ref(node);\n }\n\n if ({}.hasOwnProperty.call(ref, 'current')) {\n ref.current = node;\n }\n }\n}\nfunction ssrSafeCreateDiv() {\n return isBrowser && document.createElement('div');\n}\nfunction toDataAttributes(attrs) {\n var dataAttrs = {\n 'data-placement': attrs.placement\n };\n\n if (attrs.referenceHidden) {\n dataAttrs['data-reference-hidden'] = '';\n }\n\n if (attrs.escaped) {\n dataAttrs['data-escaped'] = '';\n }\n\n return dataAttrs;\n}\n\nfunction deepEqual(x, y) {\n if (x === y) {\n return true;\n } else if (typeof x === 'object' && x != null && typeof y === 'object' && y != null) {\n if (Object.keys(x).length !== Object.keys(y).length) {\n return false;\n }\n\n for (var prop in x) {\n if (y.hasOwnProperty(prop)) {\n if (!deepEqual(x[prop], y[prop])) {\n return false;\n }\n } else {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n}\n\nfunction uniqueByShape(arr) {\n var output = [];\n arr.forEach(function (item) {\n if (!output.find(function (outputItem) {\n return deepEqual(item, outputItem);\n })) {\n output.push(item);\n }\n });\n return output;\n}\nfunction deepPreserveProps(instanceProps, componentProps) {\n var _instanceProps$popper, _componentProps$poppe;\n\n return Object.assign({}, componentProps, {\n popperOptions: Object.assign({}, instanceProps.popperOptions, componentProps.popperOptions, {\n modifiers: uniqueByShape([].concat(((_instanceProps$popper = instanceProps.popperOptions) == null ? void 0 : _instanceProps$popper.modifiers) || [], ((_componentProps$poppe = componentProps.popperOptions) == null ? void 0 : _componentProps$poppe.modifiers) || []))\n })\n });\n}\n\nvar useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;\nfunction useMutableBox(initialValue) {\n // Using refs instead of state as it's recommended to not store imperative\n // values in state due to memory problems in React(?)\n var ref = useRef();\n\n if (!ref.current) {\n ref.current = typeof initialValue === 'function' ? initialValue() : initialValue;\n }\n\n return ref.current;\n}\n\nfunction updateClassName(box, action, classNames) {\n classNames.split(/\\s+/).forEach(function (name) {\n if (name) {\n box.classList[action](name);\n }\n });\n}\n\nvar classNamePlugin = {\n name: 'className',\n defaultValue: '',\n fn: function fn(instance) {\n var box = instance.popper.firstElementChild;\n\n var isDefaultRenderFn = function isDefaultRenderFn() {\n var _instance$props$rende;\n\n return !!((_instance$props$rende = instance.props.render) == null ? void 0 : _instance$props$rende.$$tippy);\n };\n\n function add() {\n if (instance.props.className && !isDefaultRenderFn()) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(['@tippyjs/react: Cannot use `className` prop in conjunction with', '`render` prop. Place the className on the element you are', 'rendering.'].join(' '));\n }\n\n return;\n }\n\n updateClassName(box, 'add', instance.props.className);\n }\n\n function remove() {\n if (isDefaultRenderFn()) {\n updateClassName(box, 'remove', instance.props.className);\n }\n }\n\n return {\n onCreate: add,\n onBeforeUpdate: remove,\n onAfterUpdate: add\n };\n }\n};\n\nfunction TippyGenerator(tippy) {\n function Tippy(_ref) {\n var children = _ref.children,\n content = _ref.content,\n visible = _ref.visible,\n singleton = _ref.singleton,\n render = _ref.render,\n reference = _ref.reference,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$ignoreAttributes = _ref.ignoreAttributes,\n ignoreAttributes = _ref$ignoreAttributes === void 0 ? true : _ref$ignoreAttributes,\n __source = _ref.__source,\n __self = _ref.__self,\n restOfNativeProps = _objectWithoutPropertiesLoose(_ref, [\"children\", \"content\", \"visible\", \"singleton\", \"render\", \"reference\", \"disabled\", \"ignoreAttributes\", \"__source\", \"__self\"]);\n\n var isControlledMode = visible !== undefined;\n var isSingletonMode = singleton !== undefined;\n\n var _useState = useState(false),\n mounted = _useState[0],\n setMounted = _useState[1];\n\n var _useState2 = useState({}),\n attrs = _useState2[0],\n setAttrs = _useState2[1];\n\n var _useState3 = useState(),\n singletonContent = _useState3[0],\n setSingletonContent = _useState3[1];\n\n var mutableBox = useMutableBox(function () {\n return {\n container: ssrSafeCreateDiv(),\n renders: 1\n };\n });\n var props = Object.assign({\n ignoreAttributes: ignoreAttributes\n }, restOfNativeProps, {\n content: mutableBox.container\n });\n\n if (isControlledMode) {\n if (process.env.NODE_ENV !== 'production') {\n ['trigger', 'hideOnClick', 'showOnCreate'].forEach(function (nativeStateProp) {\n if (props[nativeStateProp] !== undefined) {\n console.warn([\"@tippyjs/react: Cannot specify `\" + nativeStateProp + \"` prop in\", \"controlled mode (`visible` prop)\"].join(' '));\n }\n });\n }\n\n props.trigger = 'manual';\n props.hideOnClick = false;\n }\n\n if (isSingletonMode) {\n disabled = true;\n }\n\n var computedProps = props;\n var plugins = props.plugins || [];\n\n if (render) {\n computedProps = Object.assign({}, props, {\n plugins: isSingletonMode && singleton.data != null ? [].concat(plugins, [{\n fn: function fn() {\n return {\n onTrigger: function onTrigger(instance, event) {\n var node = singleton.data.children.find(function (_ref2) {\n var instance = _ref2.instance;\n return instance.reference === event.currentTarget;\n });\n instance.state.$$activeSingletonInstance = node.instance;\n setSingletonContent(node.content);\n }\n };\n }\n }]) : plugins,\n render: function render() {\n return {\n popper: mutableBox.container\n };\n }\n });\n }\n\n var deps = [reference].concat(children ? [children.type] : []); // CREATE\n\n useIsomorphicLayoutEffect(function () {\n var element = reference;\n\n if (reference && reference.hasOwnProperty('current')) {\n element = reference.current;\n }\n\n var instance = tippy(element || mutableBox.ref || ssrSafeCreateDiv(), Object.assign({}, computedProps, {\n plugins: [classNamePlugin].concat(props.plugins || [])\n }));\n mutableBox.instance = instance;\n\n if (disabled) {\n instance.disable();\n }\n\n if (visible) {\n instance.show();\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance: instance,\n content: content,\n props: computedProps,\n setSingletonContent: setSingletonContent\n });\n }\n\n setMounted(true);\n return function () {\n instance.destroy();\n singleton == null ? void 0 : singleton.cleanup(instance);\n };\n }, deps); // UPDATE\n\n useIsomorphicLayoutEffect(function () {\n var _instance$popperInsta;\n\n // Prevent this effect from running on 1st render\n if (mutableBox.renders === 1) {\n mutableBox.renders++;\n return;\n }\n\n var instance = mutableBox.instance;\n instance.setProps(deepPreserveProps(instance.props, computedProps)); // Fixes #264\n\n (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.forceUpdate();\n\n if (disabled) {\n instance.disable();\n } else {\n instance.enable();\n }\n\n if (isControlledMode) {\n if (visible) {\n instance.show();\n } else {\n instance.hide();\n }\n }\n\n if (isSingletonMode) {\n singleton.hook({\n instance: instance,\n content: content,\n props: computedProps,\n setSingletonContent: setSingletonContent\n });\n }\n });\n useIsomorphicLayoutEffect(function () {\n var _instance$props$poppe;\n\n if (!render) {\n return;\n }\n\n var instance = mutableBox.instance;\n instance.setProps({\n popperOptions: Object.assign({}, instance.props.popperOptions, {\n modifiers: [].concat((((_instance$props$poppe = instance.props.popperOptions) == null ? void 0 : _instance$props$poppe.modifiers) || []).filter(function (_ref3) {\n var name = _ref3.name;\n return name !== '$$tippyReact';\n }), [{\n name: '$$tippyReact',\n enabled: true,\n phase: 'beforeWrite',\n requires: ['computeStyles'],\n fn: function fn(_ref4) {\n var _state$modifiersData;\n\n var state = _ref4.state;\n var hideData = (_state$modifiersData = state.modifiersData) == null ? void 0 : _state$modifiersData.hide; // WARNING: this is a high-risk path that can cause an infinite\n // loop. This expression _must_ evaluate to false when required\n\n if (attrs.placement !== state.placement || attrs.referenceHidden !== (hideData == null ? void 0 : hideData.isReferenceHidden) || attrs.escaped !== (hideData == null ? void 0 : hideData.hasPopperEscaped)) {\n setAttrs({\n placement: state.placement,\n referenceHidden: hideData == null ? void 0 : hideData.isReferenceHidden,\n escaped: hideData == null ? void 0 : hideData.hasPopperEscaped\n });\n }\n\n state.attributes.popper = {};\n }\n }])\n })\n });\n }, [attrs.placement, attrs.referenceHidden, attrs.escaped].concat(deps));\n return /*#__PURE__*/React.createElement(React.Fragment, null, children ? /*#__PURE__*/cloneElement(children, {\n ref: function ref(node) {\n mutableBox.ref = node;\n preserveRef(children.ref, node);\n }\n }) : null, mounted && /*#__PURE__*/createPortal(render ? render(toDataAttributes(attrs), singletonContent, mutableBox.instance) : content, mutableBox.container));\n }\n\n return Tippy;\n}\n\nfunction useSingletonGenerator(createSingleton) {\n return function useSingleton(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$disabled = _ref.disabled,\n disabled = _ref$disabled === void 0 ? false : _ref$disabled,\n _ref$overrides = _ref.overrides,\n overrides = _ref$overrides === void 0 ? [] : _ref$overrides;\n\n var _useState = useState(false),\n mounted = _useState[0],\n setMounted = _useState[1];\n\n var mutableBox = useMutableBox({\n children: [],\n renders: 1\n });\n useIsomorphicLayoutEffect(function () {\n if (!mounted) {\n setMounted(true);\n return;\n }\n\n var children = mutableBox.children,\n sourceData = mutableBox.sourceData;\n\n if (!sourceData) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(['@tippyjs/react: The `source` variable from `useSingleton()` has', 'not been passed to a component.'].join(' '));\n }\n\n return;\n }\n\n var instance = createSingleton(children.map(function (child) {\n return child.instance;\n }), Object.assign({}, sourceData.props, {\n popperOptions: sourceData.instance.props.popperOptions,\n overrides: overrides,\n plugins: [classNamePlugin].concat(sourceData.props.plugins || [])\n }));\n mutableBox.instance = instance;\n\n if (disabled) {\n instance.disable();\n }\n\n return function () {\n instance.destroy();\n mutableBox.children = children.filter(function (_ref2) {\n var instance = _ref2.instance;\n return !instance.state.isDestroyed;\n });\n };\n }, [mounted]);\n useIsomorphicLayoutEffect(function () {\n if (!mounted) {\n return;\n }\n\n if (mutableBox.renders === 1) {\n mutableBox.renders++;\n return;\n }\n\n var children = mutableBox.children,\n instance = mutableBox.instance,\n sourceData = mutableBox.sourceData;\n\n if (!(instance && sourceData)) {\n return;\n }\n\n var _sourceData$props = sourceData.props,\n content = _sourceData$props.content,\n props = _objectWithoutPropertiesLoose(_sourceData$props, [\"content\"]);\n\n instance.setProps(deepPreserveProps(instance.props, Object.assign({}, props, {\n overrides: overrides\n })));\n instance.setInstances(children.map(function (child) {\n return child.instance;\n }));\n\n if (disabled) {\n instance.disable();\n } else {\n instance.enable();\n }\n });\n return useMemo(function () {\n var source = {\n data: mutableBox,\n hook: function hook(data) {\n mutableBox.sourceData = data;\n mutableBox.setSingletonContent = data.setSingletonContent;\n },\n cleanup: function cleanup() {\n mutableBox.sourceData = null;\n }\n };\n var target = {\n hook: function hook(data) {\n var _mutableBox$instance, _mutableBox$instance2;\n\n mutableBox.children = mutableBox.children.filter(function (_ref3) {\n var instance = _ref3.instance;\n return data.instance !== instance;\n });\n mutableBox.children.push(data);\n\n if (((_mutableBox$instance = mutableBox.instance) == null ? void 0 : _mutableBox$instance.state.isMounted) && ((_mutableBox$instance2 = mutableBox.instance) == null ? void 0 : _mutableBox$instance2.state.$$activeSingletonInstance) === data.instance) {\n mutableBox.setSingletonContent == null ? void 0 : mutableBox.setSingletonContent(data.content);\n }\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map(function (child) {\n return child.instance;\n }));\n }\n },\n cleanup: function cleanup(instance) {\n mutableBox.children = mutableBox.children.filter(function (data) {\n return data.instance !== instance;\n });\n\n if (mutableBox.instance && !mutableBox.instance.state.isDestroyed) {\n mutableBox.instance.setInstances(mutableBox.children.map(function (child) {\n return child.instance;\n }));\n }\n }\n };\n return [source, target];\n }, []);\n };\n}\n\nvar forwardRef = (function (Tippy, defaultProps) {\n return /*#__PURE__*/forwardRef$1(function TippyWrapper(_ref, _ref2) {\n var children = _ref.children,\n props = _objectWithoutPropertiesLoose(_ref, [\"children\"]);\n\n return (\n /*#__PURE__*/\n // If I spread them separately here, Babel adds the _extends ponyfill for\n // some reason\n React.createElement(Tippy, Object.assign({}, defaultProps, props), children ? /*#__PURE__*/cloneElement(children, {\n ref: function ref(node) {\n preserveRef(_ref2, node);\n preserveRef(children.ref, node);\n }\n }) : null)\n );\n });\n});\n\nvar useSingleton = /*#__PURE__*/useSingletonGenerator(createSingleton);\nvar index = /*#__PURE__*/forwardRef( /*#__PURE__*/TippyGenerator(tippy));\n\nexport default index;\nexport { useSingleton };\n//# sourceMappingURL=tippy-react.esm.js.map\n","import Tippy from \"@tippyjs/react\";\nimport styled, { css } from \"styled-components\";\nimport theme from \"../style-values\";\nimport { sizeValues } from \"../style-values/font\";\nexport const TooltipContent = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-16a65va-0\"\n})([\"display:inline-block;position:relative;cursor:default;\"]);\n\n// Re-do simple styles in styled components in order to not load the whole external css\n// https://github.com/atomiks/tippyjs/blob/master/src/scss/index.scss\nconst TippyArrowCopiedStyles = /*#__PURE__*/css([\".tippy-arrow{color:\", \";position:absolute;width:16px;height:16px;&::before{content:'';position:absolute;border-color:transparent;border-style:solid;}}&[data-placement^='top'] > .tippy-arrow{bottom:0;left:0;transform:translate3d(97px,0,0);&::before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top;}}&[data-placement^='bottom'] > .tippy-arrow{top:0;&::before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom;}}&[data-placement^='left'] > .tippy-arrow{right:0;&::before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left;}}&[data-placement^='right'] > .tippy-arrow{left:0;&::before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right;}}\"], theme.colors.bodyText);\nconst TippyBoxCopiedStyles = /*#__PURE__*/css([\"&[data-animation^='shift-away'][data-state^='hidden']{opacity:0;&[data-placement^='top']{transform:translateY(10px);}&[data-placement^='bottom']{transform:translateY(-10px);}&[data-placement^='left']{transform:translateX(10px);}&[data-placement^='right']{transform:translateX(-10px);}}\"]);\nexport const TippyTooltip = /*#__PURE__*/styled(Tippy).withConfig({\n componentId: \"sc-16a65va-1\"\n})([\"background:\", \";padding:0;margin:0;border-radius:\", \"px;box-shadow:0 4px 4px 0 \", \";\", \";\", \";\"], theme.colors.bodyText, theme.space.tiny, theme.colors.containerShadow, TippyArrowCopiedStyles, TippyBoxCopiedStyles);\nconst sizeToWidth = ({\n size\n}) => {\n const map = {\n small: 'width: 110px;',\n medium: 'width: 210px;'\n };\n return size ? map[size] : '';\n};\nexport const TooltipOverlay = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-16a65va-2\"\n})([\"color:\", \";padding:\", \"px;font-size:\", \"px;line-height:\", \"px;display:flex;align-items:center;justify-content:center;\", \";\", \"\"], theme.colors.white, theme.space.small, sizeValues.normal, theme.space.medium, props => props.height && `min-height: ${props.height}px`, props => props.variant === 'primary' ? ` text-align: center;\n ${sizeToWidth({\n size: props.size\n})}; ` : ` text-align: left;\n max-width: 300px; `);","import React from \"react\";\nimport { TooltipContent, TippyTooltip, TooltipOverlay } from \"./Tooltip.styles\";\nconst Tooltip = ({\n children,\n overlay,\n height,\n visible,\n // this is only for storybook\n size = 'medium',\n placement = 'top',\n isWebView = false,\n overlayVariant = 'primary',\n // It seems that the onTrigger function is called when passed undefined in Tippy.js even though it is an optional prop and it throws error\n onToolTipShown = () => {}\n}) => /*#__PURE__*/React.createElement(TooltipContent, null, /*#__PURE__*/React.createElement(TippyTooltip, {\n content: /*#__PURE__*/React.createElement(TooltipOverlay, {\n height: height,\n size: size,\n variant: overlayVariant\n }, overlay),\n placement: placement,\n visible: visible,\n onTrigger: onToolTipShown,\n animation: \"shift-away\",\n delay: [500, 0],\n duration: [200, 200]\n}, /* Details on adding empty click handler for Webview - UP-1250 */isWebView ?\n/*#__PURE__*/\n// FIXME\n// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions\nReact.createElement(\"div\", {\n onClick: () => {}\n}, children) : children));\nexport default Tooltip;","export const Platform = {\n OS: 'web'\n};","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nexport const carrierLogoWrapperCss = /*#__PURE__*/css([\"color:\", \";text-transform:uppercase;font-size:\", \";font-weight:\", \";position:relative;\"], theme.colors.bodyText, theme.fontSizes.tiny, theme.fontWeights.semibold);","import styled from \"styled-components\";\nimport { carrierLogoWrapperCss } from \"./CarrierLogo.styles.shared\";\nexport const CarrierLogoText = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-1g2y4v5-0\"\n})([\"\", \"\"], carrierLogoWrapperCss);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { useState } from \"react\";\nimport { getEnvironment, Environment } from \"../../../fe-utils/src/environment/index\";\nimport Image from \"../Image\";\nimport Platform from \"../Platform\";\nimport { CarrierLogoText } from \"./CarrierLogo.styles\";\nconst CarrierLogo = ({\n carrierName,\n onResourceError,\n logo,\n height,\n ...rest\n}) => {\n const [hasResource, setResource] = useState(true);\n const handleResourceError = () => {\n setResource(false);\n if (onResourceError) {\n onResourceError(carrierName, height);\n }\n };\n // react-native Image.getSize function constantly fails on android qa environment with carrier image logos (ongoing research), so this change will disable image rendering on android on QA only\n // Will be reverted once the issue is resolved\n return hasResource && !(Platform.OS === 'android' && getEnvironment() !== Environment.PROD) ? /*#__PURE__*/React.createElement(Image, _extends({\n src: logo,\n height: height,\n onError: handleResourceError,\n alt: carrierName\n }, rest)) : /*#__PURE__*/React.createElement(CarrierLogoText, rest, carrierName);\n};\nexport default CarrierLogo;","import CarrierLogo from \"./CarrierLogo\";\nexport default CarrierLogo;","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nexport const BoxSizing = /*#__PURE__*/css([\"width:24px;height:24px;border-radius:12px;border:2px solid \", \";\"], theme.colors.radioButtonBorder);","import styled from \"styled-components\";\nimport Box from \"../Box\";\nimport theme from \"../style-values\";\nimport { BoxSizing } from \"./RadioButton.style.shared\";\nexport const DefaultRadioButton = /*#__PURE__*/styled.input.withConfig({\n componentId: \"sc-qb71ge-0\"\n})([\"appearance:none;position:absolute;width:24px;height:24px;top:0;left:0;margin:0;opacity:0;&:enabled{cursor:pointer;}\"]);\nexport const Control = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-qb71ge-1\"\n})([\"\", \" display:inline-block;padding:0;transition:all 0.125s ease-in-out;box-sizing:border-box;pointer-events:none;&::after{display:block;content:'';background:\", \";opacity:0;height:100%;width:100%;border-radius:50%;transition:opacity 0.125s ease-in-out;pointer-events:none;}input:active + &,input:focus-visible + &{background:#bfdaea;}input:checked + &{padding:3px;&::after{opacity:1;}}input:disabled + &{background:\", \";border-color:\", \";&::after{background:\", \";}}\"], BoxSizing, theme.colors.radioButtonDot, theme.colors.white, theme.colors.radioButtonDisabled, theme.colors.radioButtonDisabled);\nexport const ControlContainer = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-qb71ge-2\"\n})([\"display:flex;position:relative;margin:\", \";\"], ({\n labelGroup\n}) => labelGroup ? `0 0 0 ${theme.space.small}px` : `0 ${theme.space.small}px 0 0`);\nexport const Label = /*#__PURE__*/styled.label.withConfig({\n componentId: \"sc-qb71ge-3\"\n})([\"font-size:\", \";color:\", \" \", \";\"], theme.fontSizes.medium, ({\n disabled\n}) => disabled ? theme.colors.radioButtonDisabled : theme.colors.radioButtonLabel, ({\n disabled\n}) => disabled && `cursor: pointer;`);\nexport const Container = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-qb71ge-4\"\n})([\"position:relative;display:flex;align-items:center;flex-wrap:wrap;cursor:pointer;\", \" \", \"\"], props => props.autoWidth ? '' : 'width: 100%;', props => props.labelGroup && `\n\t${ControlContainer} {\n\t\torder: 2;\n\t}\n\t${Label} {\n\t\torder: 1;\n\t\tmargin-right: auto;\n\t}\n\t`);","import React from \"react\";\nimport Spinner from \"../Spinner/index\";\nimport { Container, ControlContainer, Control, DefaultRadioButton, Label } from \"./RadioButton.style\";\nexport const RadioButton = ({\n name = undefined,\n value = undefined,\n id = undefined,\n onChange = undefined,\n onFocus = undefined,\n children = undefined,\n clickEventName = 'onChange',\n labelGroup = false,\n checked = false,\n disabled = false,\n autoWidth = false,\n loading = false\n}) => {\n return /*#__PURE__*/React.createElement(Container, {\n labelGroup: labelGroup,\n autoWidth: autoWidth,\n \"data-component\": \"radioButton\"\n }, /*#__PURE__*/React.createElement(ControlContainer, {\n labelGroup: labelGroup\n }, loading ? /*#__PURE__*/React.createElement(Spinner, {\n size: 24,\n variant: \"blue\"\n }) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DefaultRadioButton, {\n type: \"radio\",\n name: name,\n id: id,\n value: value,\n checked: checked,\n disabled: disabled,\n onFocus: onFocus,\n [clickEventName]: onChange\n }), /*#__PURE__*/React.createElement(Control, null))), children && /*#__PURE__*/React.createElement(Label, {\n htmlFor: id,\n disabled: disabled\n }, children));\n};\nexport default RadioButton;","import { css } from \"styled-components\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const discountCardItemWrapperCss = /*#__PURE__*/css([\"margin:0 16px;padding:16px 0;border-bottom-color:\", \";border-bottom-width:1px;&:last-child{border-bottom:none;}\"], theme.colors.sectionDivider);\nexport const discountCardItemTexCss = /*#__PURE__*/css([\"color:\", \";font-size:\", \";line-height:\", \";font-family:\", \";\"], theme.colors.palette.deepBlue[400], theme.fontSizes.medium, theme.lineHeights.normal, theme.fonts.medium);","import styled from \"styled-components\";\nimport { discountCardItemWrapperCss, discountCardItemTexCss } from \"./DiscountCardItem.styles.shared\";\nexport const DiscountCardItemWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1l0ibio-0\"\n})([\"\", \" cursor:pointer;border-bottom-style:solid;\"], discountCardItemWrapperCss);\nexport const DiscountCardItemText = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1l0ibio-1\"\n})([\"\", \"\"], discountCardItemTexCss);","import React from \"react\";\nimport { removeLabelSpaces } from \"../../../../fe-utils/src/appium-helpers/index\";\nimport { CheckboxWithTitle } from \"../../../../frontend-components/src/Checkbox/index\";\nimport RadioButton from \"../../../../frontend-components/src/RadioButton/index\";\nimport { DiscountCardItemWrapper, DiscountCardItemText } from \"./DiscountCardItem.styles\";\nexport const DiscountCardItem = ({\n isChecked = false,\n id,\n onChange,\n children,\n variant = 'checkbox',\n testID\n}) => {\n const handleChange = checked => {\n // convert radio to boolean\n onChange(!!checked);\n };\n if (children === undefined) {\n return null;\n }\n return /*#__PURE__*/React.createElement(DiscountCardItemWrapper, null, variant === 'checkbox' && /*#__PURE__*/React.createElement(CheckboxWithTitle, {\n testID: `pcc_checkbox_${testID}_${removeLabelSpaces(children)}`,\n id: \"discountCardCheckbox\",\n name: \"discountCardCheckbox\",\n checked: isChecked,\n onChange: handleChange\n }, /*#__PURE__*/React.createElement(DiscountCardItemText, {\n testID: `pcc_text_${testID}_${removeLabelSpaces(children)}`\n }, children)), variant === 'radio-button' && /*#__PURE__*/React.createElement(RadioButton, {\n testID: `pcc_radioButton_${testID}_${removeLabelSpaces(children)}`,\n id: id,\n checked: isChecked,\n labelGroup: true,\n value: 1,\n onChange: handleChange\n }, /*#__PURE__*/React.createElement(DiscountCardItemText, {\n testID: `pcc_text_${testID}_${removeLabelSpaces(children)}`\n }, children)));\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const InfoO = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16zm0 14a1 1 0 0 1-1-1v-7a1 1 0 1 1 2 0v7a1 1 0 0 1-1 1zm0-12a1 1 0 1 1 0 2 1 1 0 0 1 0-2z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n}));","import styled, { css } from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const headerRowCss = /*#__PURE__*/css([\"font-weight:\", \";padding:\", \"px \", \"px \", \"px;background-color:\", \";display:flex;align-items:flex-end;flex-direction:row;justify-content:space-between;\"], theme.fontWeights.semibold, theme.space.medium, theme.space.medium, theme.space.small, theme.colors.palette.gray[400]);\nexport const headerRowTextCss = /*#__PURE__*/css([\"font-size:\", \";font-weight:\", \";letter-spacing:1.2px;line-height:\", \";text-transform:uppercase;color:\", \";\"], theme.fontSizes.small, theme.fontWeights.medium, theme.lineHeights.small, theme.colors.palette.deepBlue[200]);\nexport const infoIconWrapperCss = /*#__PURE__*/css([\"width:18px;height:18px;margin:-1px 0 0 3px;\"]);\nexport const Container = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p30y3t-0\"\n})([\"width:100%;user-select:none;\", \"{min-width:336px;\"], theme.mediaQueries.tabletAndLarger);\nexport const ProviderContainer = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p30y3t-1\"\n})([\"width:100%;\"]);\nexport const HeaderRow = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p30y3t-2\"\n})([\"align-items:center;justify-content:center;\", \"\"], headerRowCss);\nexport const HeaderRowTextWrap = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p30y3t-3\"\n})([\"color:\", \";display:flex;flex-direction:row;align-items:center;\"], theme.colors.palette.deepBlue[200]);","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport { InfoO as InfoOIcon } from \"../../../../frontend-components/src/Icons2/InfoO\";\nimport { headerRowTextCss, infoIconWrapperCss } from \"./DiscountCardList.styles.shared\";\nexport { Container, HeaderRow, HeaderRowTextWrap, ProviderContainer } from \"./DiscountCardList.styles.shared\";\nexport const HeaderRowText = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-h8tvy8-0\"\n})([\"\", \"\"], headerRowTextCss);\nexport const InfoIconWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-h8tvy8-1\"\n})([\"\", \"\"], infoIconWrapperCss);\nexport const InfoO = /*#__PURE__*/styled(InfoOIcon).withConfig({\n componentId: \"sc-h8tvy8-2\"\n})([\"\"]);","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport { removeLabelSpaces } from \"../../../../fe-utils/src/appium-helpers/index\";\nimport Tooltip from \"../../../../frontend-components/src/Tooltip/index\";\nimport CarrierLogo from \"../../../../frontend-components/src/CarrierLogo/index\";\nimport { DiscountCardItem } from \"../DiscountCardItem/DiscountCardItem\";\nimport { Container, ProviderContainer, HeaderRow, HeaderRowTextWrap, HeaderRowText, InfoIconWrapper, InfoO as InfoOIcon } from \"./DiscountCardList.styles\";\nconst Provider = ({\n serviceProvider\n}) => /*#__PURE__*/React.createElement(FormattedMessage, {\n id: `searchbar.${serviceProvider}`,\n defaultMessage: `${serviceProvider}`\n});\nconst DiscountCardList = ({\n discountCards,\n onDiscountCardToggle,\n savedCards\n}) => /*#__PURE__*/React.createElement(Container, {\n id: \"discountCardList\"\n}, discountCards.map(cardsGroup => /*#__PURE__*/React.createElement(ProviderContainer, {\n key: `${cardsGroup.serviceProvider} - ${cardsGroup.groupName}`,\n \"data-e2e\": `${cardsGroup.serviceProvider} - ${cardsGroup.groupName}`\n}, /*#__PURE__*/React.createElement(HeaderRow, null, /*#__PURE__*/React.createElement(HeaderRowTextWrap, null, /*#__PURE__*/React.createElement(HeaderRowText, null, /*#__PURE__*/React.createElement(Provider, {\n serviceProvider: cardsGroup.serviceProvider\n})), /*#__PURE__*/React.createElement(Tooltip, {\n overlay: /*#__PURE__*/React.createElement(FormattedMessage, {\n id: cardsGroup.multipleSelection ? 'searchbar.discount_card.discount_card_tip_multiple' : 'searchbar.discount_card.discount_card_tip_single',\n values: {\n provider: /*#__PURE__*/React.createElement(Provider, {\n serviceProvider: cardsGroup.serviceProvider\n })\n }\n }),\n height: 60\n}, /*#__PURE__*/React.createElement(InfoIconWrapper, null, /*#__PURE__*/React.createElement(InfoOIcon, null)))), cardsGroup.logoUrl && /*#__PURE__*/React.createElement(CarrierLogo, {\n logo: cardsGroup.logoUrl,\n carrierName: cardsGroup.serviceProvider,\n height: 16\n})), cardsGroup.cards?.map(option => {\n const isChecked = savedCards.find(({\n id,\n providerId\n }) => id === option.id && providerId === cardsGroup.serviceProvider) !== undefined;\n const variant = cardsGroup.multipleSelection ? 'checkbox' : 'radio-button';\n return /*#__PURE__*/React.createElement(DiscountCardItem, {\n testID: `discountCard_${removeLabelSpaces(cardsGroup.groupName)}`,\n id: option.id,\n key: option.id,\n isChecked: isChecked,\n variant: variant,\n onChange: () => {\n onDiscountCardToggle(option);\n }\n }, option.description);\n}))));\nexport default DiscountCardList;","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Delete = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M14.117 3.284A1.664 1.664 0 0 0 12.5 2c-.788 0-1.445.55-1.618 1.284L5 4.751v1.416h15V4.75l-5.883-1.467zM7.625 20.346c.112.914.95 1.654 1.87 1.654h6.003c.921 0 1.758-.74 1.87-1.654l1.528-12.513H6.103l1.522 12.513z\",\n fill: \"#132968\"\n}));","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-discount-cards-toggle_clicked/jsonschema/3-0-0';\nexport const pccDiscountCardsToggleClicked = new BaseTrackingEvent('pcc-discount-cards-toggle_clicked', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-confirm-button_clicked/jsonschema/1-0-0';\nexport const pccConfirmButtonClicked = new BaseTrackingEvent('pcc-confirm-button_clicked', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-discount-cards-save-button_clicked/jsonschema/3-0-0';\nexport const pccDiscountCardsSaveButtonClicked = new BaseTrackingEvent('pcc-discount-cards-save-button_clicked', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-discount-card_removed/jsonschema/3-0-0';\nexport const pccDiscountCardRemoved = new BaseTrackingEvent('pcc-discount-card_removed', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-discount-cards-search_initiated/jsonschema/3-0-0';\nexport const pccDiscountCardsSearchInitiated = new BaseTrackingEvent('pcc-discount-cards-search_initiated', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/pcc-add-more-passengers-button_clicked/jsonschema/3-0-0';\nexport const pccAddMorePassengersButtonClicked = new BaseTrackingEvent('pcc-add-more-passengers-button_clicked', schema, linkedContexts);","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nexport const CircularButtonCss = /*#__PURE__*/css([\"background:transparent;margin:0;padding:0;width:32px;border:none;color:\", \";\"], theme.colors.stepperButton);\nexport const PassengerTypeCountCss = /*#__PURE__*/css([\"width:100%;display:flex;align-items:center;justify-content:space-between;flex-direction:row;color:\", \";font-size:\", \";\"], theme.colors.bodyText, theme.fontSizes.medium);\nexport const PassengerCountTextCss = /*#__PURE__*/css([\"padding-left:\", \"px;padding-right:\", \"px;:focus{border-radius:\", \";outline:1px solid \", \";}user-select:none;\"], theme.space.small, theme.space.small, theme.radii.normal, theme.colors.palette.deepBlue[500]);","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nimport { H5 } from \"../Typography\";\nimport { CircularButtonCss, PassengerCountTextCss, PassengerTypeCountCss } from \"./ButtonStepper.styles.shared\";\nexport const CircularButton = /*#__PURE__*/styled.button.withConfig({\n componentId: \"sc-x3fcy-0\"\n})([\"\", \" height:32px;outline:none;cursor:pointer;\", \"{:hover{border-radius:\", \";background-color:\", \";}}\", \";\"], CircularButtonCss, theme.mediaQueries.desktop, theme.radii.large, theme.colors.palette.lightBlue[300], props => props.disabled && `\n color: ${theme.colors.buttonDisabled};\n cursor: auto;\n :hover {\n border-radius: none; \n background-color: transparent;\n }\n `);\nexport const PassengerTypeCount = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-x3fcy-1\"\n})([\"\", \"\"], PassengerTypeCountCss);\nexport const PassengerCountText = /*#__PURE__*/styled(H5).withConfig({\n componentId: \"sc-x3fcy-2\"\n})([\"\", \" \", \";\"], PassengerCountTextCss, props => props.disabled && `color: ${theme.colors.disabledHeading}\n `);","import styled, { css } from \"styled-components\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport { CircularButton } from \"../../../../frontend-components/src/ButtonStepper/ButtonStepper.styles\";\nimport { H6, ParagraphSmall } from \"../../../../frontend-components/src/Typography/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nexport const iconSize = 40;\nexport const TrashIconContainer = /*#__PURE__*/styled(CircularButton).withConfig({\n componentId: \"sc-fobyrl-0\"\n})([\"display:flex;justify-content:center;align-items:center;width:\", \"px;height:\", \"px;margin-right:\", \"px;\", \"\"], iconSize, iconSize, theme.space.tiny, ({\n isFocused\n}) => isFocused && `\n \n border-radius: ${theme.radii.normal};\n outline: 1px solid ${theme.colors.palette.deepBlue[500]};\n `);\nexport const Container = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-fobyrl-1\"\n})([\"background-color:\", \";align-items:center;flex:0 0 auto;height:60px;border-radius:\", \";padding:\", \"px \", \"px \", \"px \", \"px;width:100%;gap:\", \"px;&:hover > \", \"{background-color:\", \";border-radius:\", \"px;border:none;}\"], theme.colors.palette.mediumBlue[100], theme.radii.normal, theme.space.small, theme.space.medium, theme.space.small, theme.space.tiny, theme.space.small, TrashIconContainer, theme.colors.palette.lightBlue[300], iconSize / 2);\nexport const DiscountCardInfo = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-fobyrl-2\"\n})([\"display:flex;flex-direction:column;flex:1;min-width:0;\"]);\nexport const TruncatedText = /*#__PURE__*/css([\"text-overflow:ellipsis;white-space:nowrap;overflow:hidden;\"]);\nexport const CardName = /*#__PURE__*/styled(ParagraphSmall).withConfig({\n componentId: \"sc-fobyrl-3\"\n})([\"\", \";\"], TruncatedText);\nexport const ProviderNameText = /*#__PURE__*/styled(H6).withConfig({\n componentId: \"sc-fobyrl-4\"\n})([\"\", \";\"], TruncatedText);","import { SelectedDiscountCard } from \"./SelectedDiscountCard\";\nexport default SelectedDiscountCard;","import React from \"react\";\nimport { Delete } from \"../../../../frontend-components/src/Icons2/Delete\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport IconContainer from \"../../../../frontend-components/src/IconContainer/index\";\nimport { useTracking } from \"../../../../tracking-provider/src/tracking/TrackingProvider\";\nimport { pccDiscountCardRemoved as pccDiscountCardRemovedEvent } from \"../../../../tracking-provider/src/cms/lib/events/passenger-config-components/index\";\nimport { CardName, Container, DiscountCardInfo, ProviderNameText, TrashIconContainer } from \"./SelectedDiscountCard.styles\";\nexport const SelectedDiscountCard = props => {\n const {\n name,\n providerName,\n onRemove,\n isFocused\n } = props;\n const trackRemove = useTracking(pccDiscountCardRemovedEvent);\n const handleRemove = () => {\n trackRemove({});\n onRemove();\n };\n return /*#__PURE__*/React.createElement(Container, {\n role: \"option\",\n accessibilityRole: \"menuitem\",\n tabIndex: -1,\n \"aria-label\": `${providerName}, ${name}, delete`,\n \"aria-selected\": isFocused\n }, /*#__PURE__*/React.createElement(TrashIconContainer, {\n tabIndex: -1,\n isFocused: isFocused,\n type: \"button\",\n onClick: handleRemove,\n onPress: handleRemove\n }, /*#__PURE__*/React.createElement(IconContainer, {\n size: 'medium',\n color: theme.colors.palette.deepBlue[500]\n }, /*#__PURE__*/React.createElement(Delete, null))), /*#__PURE__*/React.createElement(DiscountCardInfo, null, /*#__PURE__*/React.createElement(ProviderNameText, {\n numberOfLines: 1\n }, providerName), /*#__PURE__*/React.createElement(CardName, {\n numberOfLines: 1\n }, name)));\n};","import styled from \"styled-components\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nimport { Container as SelectedDiscountCardContainer } from \"../SelectedDiscountCard/SelectedDiscountCard.styles\";\nexport const Container = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-1ateros-0\"\n})([\"overflow:auto;flex-direction:column;gap:\", \"px;width:100%;\", \"{flex-direction:row;& > \", \"{width:\", \";}}\"], theme.space.small, theme.mediaQueries.mobileOnly, SelectedDiscountCardContainer, ({\n listHasOneItem\n}) => listHasOneItem ? '100%' : '75%');","import { useCallback, useEffect, useState } from \"react\";\nconst useListFocus = onItemInteract => {\n const [focusedIndex, setFocusedIndex] = useState();\n const [listNode, setListNode] = useState();\n useEffect(() => {\n if (focusedIndex === undefined || !listNode) return;\n const listItems = listNode.children;\n const handleKeyDown = event => {\n const lastIndex = listItems.length - 1;\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n setFocusedIndex(prevIndex => Math.max((prevIndex || 0) - 1, 0));\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n setFocusedIndex(prevIndex => Math.min((prevIndex || 0) + 1, lastIndex));\n } else if (event.key === ' ') {\n event.preventDefault();\n focusedIndex !== undefined && onItemInteract(focusedIndex);\n }\n };\n\n // clean up focused index if the list is empty\n if (listItems.length === 0) {\n setFocusedIndex(undefined);\n }\n // keep focus within the list items\n if (focusedIndex !== undefined && focusedIndex > listItems.length - 1) {\n setFocusedIndex(listItems.length - 1);\n }\n listNode.addEventListener('keydown', handleKeyDown);\n return () => {\n listNode?.removeEventListener('keydown', handleKeyDown);\n };\n }, [focusedIndex, onItemInteract]);\n useEffect(() => {\n if (!listNode) return;\n const handleListFocusIn = () => setFocusedIndex(0);\n const handleListFocusOut = () => setFocusedIndex(undefined);\n listNode.addEventListener('focus', handleListFocusIn);\n listNode.addEventListener('blur', handleListFocusOut);\n return () => {\n listNode.removeEventListener('focus', handleListFocusIn);\n listNode.removeEventListener('blur', handleListFocusOut);\n };\n }, [listNode]);\n\n /**\n * We keep a state of the list node element to trigger the\n * useEffect responsible for adding/removing focus and blur events.\n */\n const wrapperRef = useCallback(instance => {\n setListNode(instance);\n }, []);\n return {\n focusedIndex,\n wrapperRef\n };\n};\nexport default useListFocus;","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport { ParagraphRegular } from \"../../../../frontend-components/src/Typography/index\";\nexport const DiscountCardsListWrapper = props => {\n const {\n discountCards,\n children\n } = props;\n if (discountCards.length === 0) {\n return /*#__PURE__*/React.createElement(ParagraphRegular, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"user_account.passenger_details.no_discount_cards\"\n }));\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, children);\n};","import { SelectedDiscountCardsList } from \"./SelectedDiscountCardsList\";\nexport default SelectedDiscountCardsList;","import React from \"react\";\nimport SelectedDiscountCard from \"../SelectedDiscountCard\";\nimport { Container } from \"./SelectedDiscountCardsList.styles\";\nimport useListFocus from \"./useListFocus\";\nimport { DiscountCardsListWrapper } from \"./SelectedDiscountCardsList.shared\";\nexport const SelectedDiscountCardsList = props => {\n const {\n discountCards,\n onCardRemove\n } = props;\n const onItemInteract = index => onCardRemove(discountCards[index]);\n const {\n focusedIndex,\n wrapperRef\n } = useListFocus(onItemInteract);\n return /*#__PURE__*/React.createElement(DiscountCardsListWrapper, {\n discountCards: discountCards\n }, /*#__PURE__*/React.createElement(Container, {\n role: \"listbox\",\n tabIndex: 0,\n ref: wrapperRef,\n \"aria-label\": \"Selected Discount Cards List\",\n listHasOneItem: discountCards.length === 1\n }, discountCards.map((discountCard, index) => {\n const onRemoveCard = () => onItemInteract(index);\n return /*#__PURE__*/React.createElement(SelectedDiscountCard, {\n name: discountCard.description,\n providerName: discountCard.providerName,\n onRemove: onRemoveCard,\n isFocused: focusedIndex === index,\n key: discountCard.id\n });\n })));\n};","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nexport const DiscountCardListWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-ernk92-0\"\n})([\"overflow-y:auto;flex:1;\"]);","import styled, { css } from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const containerCss = /*#__PURE__*/css([\"flex-direction:column-reverse;justify-content:flex-end;width:100%;height:100%;\"]);\nexport const SelectedDiscountCardListContainer = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-i7tp43-0\"\n})([\"flex-grow:0;flex-shrink:0;flex-direction:column;justify-content:center;box-sizing:border-box;height:77px;padding:\", \"px \", \"px;border-color:\", \";border-style:solid;border-width:0;border-bottom-width:1px;\"], theme.space.small, theme.space.medium, theme.colors.palette.gray[500]);\nexport const cardListContainerCss = /*#__PURE__*/css([\"flex-direction:column;overflow:hidden;\"]);\nexport const SearchWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-i7tp43-1\"\n})([\"flex-shrink:0;flex-grow:0;\"]);","import styled from \"styled-components\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport { cardListContainerCss, containerCss, SelectedDiscountCardListContainer as SharedSelectedDiscountCardListContainer } from \"./DiscountCardListView.styles.shared\";\nexport const Container = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-b17t8q-0\"\n})([\"\", \" \", \"{flex-direction:row;justify-content:start;}\"], containerCss, theme.mediaQueries.tabletAndLarger);\nexport const SelectedDiscountCardListContainer = /*#__PURE__*/styled(SharedSelectedDiscountCardListContainer).withConfig({\n componentId: \"sc-b17t8q-1\"\n})([\"\", \"{flex:0.77;justify-content:flex-start;padding:10px \", \"px;height:auto;border-width:0;border-left-width:1px;}\"], theme.mediaQueries.tabletAndLarger, theme.space.large);\nexport const CardListContainer = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-b17t8q-2\"\n})([\"\", \" \", \"{flex:1;flex-shrink:0;min-width:375px;}\"], cardListContainerCss, theme.mediaQueries.tabletAndLarger);\nexport { SearchWrapper } from \"./DiscountCardListView.styles.shared\";","import React from \"react\";\nimport DiscountCardsSearchInput from \"../DiscountCardsSearchInput/DiscountCardsSearchInput\";\nimport DiscountCardList from \"../DiscountCardList/DiscountCardList\";\nimport SelectedDiscountCardsList from \"../SelectedDiscountCardsList\";\nimport { DiscountCardListWrapper } from \"./DiscountCardListWrapper\";\nimport { CardListContainer, Container, SelectedDiscountCardListContainer, SearchWrapper } from \"./DiscountCardListView.styles\";\nimport { useDiscountCardsSearch } from \"./useDiscountCardsSearch\";\nconst DiscountCardListView = ({\n discountCardGroups,\n selectedDiscountCards,\n onDiscountCardToggle\n}) => {\n const {\n filteredDiscountCardGroups,\n onSearchTextChange\n } = useDiscountCardsSearch(discountCardGroups);\n return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(CardListContainer, null, /*#__PURE__*/React.createElement(SearchWrapper, null, /*#__PURE__*/React.createElement(DiscountCardsSearchInput, {\n onChange: onSearchTextChange\n })), /*#__PURE__*/React.createElement(DiscountCardListWrapper, null, /*#__PURE__*/React.createElement(DiscountCardList, {\n discountCards: filteredDiscountCardGroups,\n savedCards: selectedDiscountCards,\n onDiscountCardToggle: onDiscountCardToggle\n }))), /*#__PURE__*/React.createElement(SelectedDiscountCardListContainer, null, /*#__PURE__*/React.createElement(SelectedDiscountCardsList, {\n discountCards: selectedDiscountCards,\n onCardRemove: onDiscountCardToggle\n })));\n};\nexport default DiscountCardListView;","import { useEffect, useRef, useState } from \"react\";\nimport { useTracking } from \"../../../../tracking-provider/src/tracking/TrackingProvider\";\nimport { pccDiscountCardsSearchInitiated as pccDiscountCardsSearchInitiatedEvent } from \"../../../../tracking-provider/src/cms/lib/events/passenger-config-components/index\";\nexport function useDiscountCardsSearch(discountCardGroups) {\n const [searchTracked, setSearchTracked] = useState(false);\n const timeoutRef = useRef();\n const [filteredDiscountCardGroups, setFilteredDiscountCardGroups] = useState(discountCardGroups);\n const trackSearchInitiated = useTracking(pccDiscountCardsSearchInitiatedEvent);\n const onSearchTextChange = rawQuery => {\n if (!searchTracked) {\n trackSearchInitiated({});\n setSearchTracked(true);\n }\n const query = rawQuery.trim().toLowerCase();\n window.clearTimeout(timeoutRef.current);\n timeoutRef.current = window.setTimeout(() => {\n if (!query) {\n setFilteredDiscountCardGroups(discountCardGroups);\n return;\n }\n const result = [];\n discountCardGroups.forEach(group => {\n const groupName = group.groupName.toLowerCase();\n const serviceProvider = group.serviceProvider.toLowerCase();\n const shouldIncludeGroup = groupName.includes(query) || serviceProvider.includes(query);\n const eligibleDiscountCards = shouldIncludeGroup ? group.cards : group.cards.filter(({\n description\n }) => description.toLowerCase().includes(query));\n if (shouldIncludeGroup) {\n result.push(group);\n } else if (eligibleDiscountCards.length > 0) {\n result.push({\n ...group,\n cards: eligibleDiscountCards\n });\n }\n });\n setFilteredDiscountCardGroups(result);\n }, 250);\n };\n useEffect(() => {\n return () => clearTimeout(timeoutRef.current);\n }, []);\n return {\n filteredDiscountCardGroups,\n onSearchTextChange\n };\n}","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nexport const DiscountCardsListViewWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-1w40r1k-0\"\n})([\"height:100%;\", \"{height:calc(100vh - 202px);max-height:522px;}\"], theme.mediaQueries.tabletAndLarger);\nexport const CustomFooter = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-1w40r1k-1\"\n})([\"padding:\", \"px \", \"px;\", \"{padding:\", \"px \", \"px;}border-top-style:solid;border-top-width:1px;border-top-color:\", \";border-top:1px solid \", \";\"], theme.space.smallmedium, theme.space.medium, theme.mediaQueries.tabletAndLarger, theme.space.medium, theme.space.large, theme.colors.divider, theme.colors.divider);\nexport const Wrapper = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-1w40r1k-2\"\n})([\"\"]);\nexport const SecondaryButtonWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-1w40r1k-3\"\n})([\"margin-right:\", \"px;flex-grow:1;flex-shrink:1;flex-basis:0;\"], theme.space.medium);\nexport const PrimaryButtonWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-1w40r1k-4\"\n})([\"flex-grow:1;flex-shrink:1;flex-basis:0;\"]);","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport LargeModal, { Header } from \"../../../../frontend-components/src/Modals/LargeModal/index\";\nimport Button from \"../../../../frontend-components/src/Button/index\";\nimport DiscountCardListView from \"../DiscountCardListView/DiscountCardListView\";\nimport { CustomFooter, DiscountCardsListViewWrapper, PrimaryButtonWrapper, SecondaryButtonWrapper, Wrapper } from \"./DiscountCardsOverlay.styles\";\nimport { useDiscountCardsOverlay } from \"./useDiscountCardsOverlay\";\nconst DiscountCardsOverlay = props => {\n const {\n discountCardGroups,\n onUpdate,\n selectedCards\n } = props;\n const {\n onClearCards,\n onDiscountCardToggle,\n onModalClose,\n selectedDiscountCards\n } = useDiscountCardsOverlay(selectedCards, discountCardGroups, onUpdate);\n return /*#__PURE__*/React.createElement(LargeModal, {\n header: /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"passenger_config_components.use_discount_cards\"\n })),\n onClose: onModalClose,\n footer: /*#__PURE__*/React.createElement(CustomFooter, null, /*#__PURE__*/React.createElement(Wrapper, null, selectedDiscountCards.length > 0 && /*#__PURE__*/React.createElement(SecondaryButtonWrapper, null, /*#__PURE__*/React.createElement(Button, {\n onClick: onClearCards,\n variant: \"secondary\"\n }, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"ferret.clear\"\n }))), /*#__PURE__*/React.createElement(PrimaryButtonWrapper, null, /*#__PURE__*/React.createElement(Button, {\n onClick: onModalClose,\n variant: \"primary\",\n \"data-e2e\": \"saveDiscountCardBtn\"\n }, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"save\"\n }))))),\n visible: true,\n fullWidth: true,\n widthVariant: \"wide\",\n withScrollView: false\n }, /*#__PURE__*/React.createElement(DiscountCardsListViewWrapper, null, /*#__PURE__*/React.createElement(DiscountCardListView, {\n discountCardGroups: discountCardGroups,\n selectedDiscountCards: selectedDiscountCards,\n onDiscountCardToggle: onDiscountCardToggle\n })));\n};\nexport default DiscountCardsOverlay;","import { useCallback, useState } from \"react\";\nimport { useTracking } from \"../../../../tracking-provider/src/tracking/TrackingProvider\";\nimport { pccDiscountCardsSaveButtonClicked as pccDiscountCardsSaveButtonClickedEvent } from \"../../../../tracking-provider/src/cms/lib/events/stored-passenger-components/index\";\nexport function useDiscountCardsOverlay(selectedCards, discountCardGroups, onUpdate) {\n const [selectedDiscountCards, setSelectedDiscountCards] = useState(selectedCards);\n const trackSaveButtonClick = useTracking(pccDiscountCardsSaveButtonClickedEvent);\n const onClearCards = () => {\n setSelectedDiscountCards([]);\n };\n const onSelectedDiscountCardRemove = useCallback(discountCard => {\n setSelectedDiscountCards(prevSelectedDiscountCards => {\n const updatedSelectedDiscountCards = prevSelectedDiscountCards.filter(({\n id,\n providerId\n }) => {\n const isSameCard = id === discountCard.id && providerId === discountCard.providerId;\n return !isSameCard;\n });\n return updatedSelectedDiscountCards;\n });\n }, []);\n const onDiscountCardToggle = discountCard => {\n const isCardSelected = selectedDiscountCards.some(({\n id,\n providerId\n }) => {\n return id === discountCard.id && providerId === discountCard.providerId;\n });\n if (isCardSelected) {\n onSelectedDiscountCardRemove(discountCard);\n return;\n }\n const group = discountCardGroups.find(({\n serviceProvider\n }) => serviceProvider === discountCard.providerId);\n if (!group) {\n // it should never happen\n return;\n }\n const isMultipleSelectionAllowed = group.multipleSelection;\n setSelectedDiscountCards(prevSelectedDiscountCards => {\n if (!isMultipleSelectionAllowed) {\n prevSelectedDiscountCards = prevSelectedDiscountCards.filter(({\n providerId\n }) => providerId !== discountCard.providerId);\n }\n return [discountCard, ...prevSelectedDiscountCards];\n });\n };\n const onModalClose = () => {\n trackSaveButtonClick({\n selectedDiscountCards: selectedDiscountCards.length\n });\n onUpdate(selectedDiscountCards);\n };\n return {\n onClearCards,\n onDiscountCardToggle,\n onModalClose,\n selectedDiscountCards\n };\n}","import styled, { css } from \"styled-components\";\nexport const visuallyHiddenStyles = /*#__PURE__*/css([\"border:0;clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;\"]);\n\n/**\n * Hide content visually but keep it accessible to screen readers.\n */\nexport const VisuallyHidden = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-max7ne-0\"\n})([\"\", \"\"], visuallyHiddenStyles);\nexport default VisuallyHidden;","import VisuallyHidden, { visuallyHiddenStyles } from \"./VisuallyHidden\";\nexport default VisuallyHidden;\nexport { visuallyHiddenStyles };","import styled from \"styled-components\";\nexport * from \"styled-components\";\nexport default styled; // eslint-disable-line import/no-default-export","import styled from \"styled-components\";\nimport Text from \"../Text\";\n\n/**\n * Shows text on a single line and truncates the rest with an ellipsis.\n */\nconst Truncate = /*#__PURE__*/styled(Text).withConfig({\n componentId: \"sc-1hs2xm4-0\"\n})([\"overflow:hidden;white-space:nowrap;text-overflow:ellipsis;\"]);\nexport default Truncate;","import theme from \"../../../../frontend-components/src/style-values/index\";\nimport Truncate from \"../../../../frontend-components/src/Truncate/index\";\nimport { baseHeading, h6 } from \"../../../../frontend-components/src/Typography/Typography.shared\";\nimport styled from \"../../utils/styled\";\nexport const Name = styled(Truncate)`\n ${baseHeading}\n ${h6}\n font-weight: ${theme.fontWeights.bold};\n line-height: ${theme.lineHeights.large};\n user-select: none;\n font-family: ${theme.fonts.regular};\n`;\nexport const DiscountCardName = styled(Truncate)`\n color: ${theme.colors.palette.deepBlue[400]};\n font-size: ${theme.fontSizes.normal};\n line-height: ${theme.lineHeights.normal};\n user-select: none;\n`;","import theme from \"../../../../frontend-components/src/style-values/index\";\nimport styled from \"../../utils/styled\";\nexport const Container = styled.label`\n display: flex;\n flex: 1;\n padding-left: ${theme.space.small}px;\n flex-direction: column;\n ${props => !props.disabled ? 'cursor: pointer' : ''};\n min-width: 0;\n`;\nexport * from \"./styles.shared\";","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport VisuallyHidden from \"../../../../frontend-components/src/VisuallyHidden/index\";\nimport { Container, DiscountCardName, Name } from \"./styles\";\nconst PassengerInfo = ({\n discountCards,\n isDiscountCardsEnabled,\n title,\n type,\n onClick\n}) => {\n const isClickDisabled = !onClick;\n return /*#__PURE__*/React.createElement(Container, {\n disabled: isClickDisabled,\n onClick: onClick\n }, /*#__PURE__*/React.createElement(Name, null, title), /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: `searchbar.${type}`,\n defaultMessage: type\n })), isDiscountCardsEnabled && discountCards.map(card => /*#__PURE__*/React.createElement(DiscountCardName, {\n key: `${card.id}`\n }, card.description)));\n};\nexport default PassengerInfo;","import PassengerInfo from \"./PassengerInfo\";\nexport default PassengerInfo;","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const DiscountCard = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M9 8.111c.828 0 1.5.697 1.5 1.556 0 .858-.672 1.555-1.5 1.555s-1.5-.697-1.5-1.555c0-.859.672-1.556 1.5-1.556zm5.656.365l-3.987 7.778-1.325-.73 3.987-7.778 1.325.73zm1.844 5.857c0 .859-.672 1.556-1.5 1.556s-1.5-.697-1.5-1.556c0-.858.672-1.555 1.5-1.555s1.5.697 1.5 1.555zM4.5 19h15c.825 0 1.5-.7 1.5-1.556V6.556C21 5.7 20.325 5 19.5 5h-15C3.675 5 3 5.7 3 6.556v10.888C3 18.3 3.675 19 4.5 19z\",\n fill: \"#132968\"\n}));","import { css } from \"styled-components\";\nimport { borderRadiusForSelect } from \"../style-values/spacing\";\nimport theme from \"../style-values\";\nconst disabledPill = /*#__PURE__*/css([\"opacity:0.5;\"]);\nexport const isSearchPill = variant => variant === 'search';\nexport const handleBackgroundColor = (variant, expanded) => {\n switch (variant) {\n case 'primary':\n return expanded ? theme.colors.pillExpandedBackground : theme.colors.pillBackground;\n case 'secondary':\n return expanded ? theme.colors.palette.deepBlue[400] : theme.colors.white;\n default:\n return theme.colors.pillExpandedBackground;\n }\n};\nexport const pillContainer = /*#__PURE__*/css([\"\", \" border:none;border-radius:\", \";min-height:\", \";line-height:\", \";font-size:\", \";display:flex;flex-direction:row;justify-content:space-between;align-items:center;align-self:flex-start;padding:0 \", \";\", \"\"], props => `background-color: ${handleBackgroundColor(props.variant, props.expanded)};`, borderRadiusForSelect.pill, theme.lineHeights.large, theme.lineHeights.large, theme.fontSizes.normal, props => props.size === 'medium' ? '14px' : '10px', props => props.disabled && disabledPill);\nexport const iconContainer = /*#__PURE__*/css([\"color:\", \";width:\", \";\", \"\"], props => props.expanded ? theme.colors.white : theme.colors.palette.deepBlue[500], props => props.size === 'medium' ? '20px' : '16px', ({\n variant\n}) => isSearchPill(variant) && `color: ${theme.colors.palette.deepBlue[400]};`);\nexport const text = /*#__PURE__*/css([\"color:\", \";margin-right:\", \"px;\", \" font-family:\", \";font-weight:\", \";\", \"\"], props => props.expanded ? theme.colors.white : theme.colors.palette.deepBlue[500], theme.space.tiny, props => props.align === 'left' && `margin-left:${theme.space.small}px; margin-right: 0px;`, ({\n variant\n}) => isSearchPill(variant) ? theme.fonts.regular : theme.fonts.medium, ({\n variant\n}) => isSearchPill(variant) ? theme.fontWeights.normal : theme.fontWeights.medium, ({\n variant\n}) => isSearchPill(variant) && `color: ${theme.colors.palette.deepBlue[400]};`);","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nimport Box from \"../Box/Box\";\nimport { iconContainer, isSearchPill, pillContainer, text } from \"./PillButton.shared\";\nexport const PillButtonContainer = /*#__PURE__*/styled.button.withConfig({\n componentId: \"sc-173fccl-0\"\n})([\"\", \" cursor:\", \";outline:none;\", \" \", \"{&:hover{\", \";\", \"}&:focus{\", \" \", \"}}\"], pillContainer, props => props.disabled ? 'not-allowed' : 'pointer', props => props.align === 'left' && `\n flex-direction: row-reverse;\n `, theme.mediaQueries.hoverCapable, ({\n expanded,\n variant\n}) => !expanded && !isSearchPill(variant) && `background-color: ${theme.colors.palette.mediumBlue[300]};`, ({\n variant\n}) => isSearchPill(variant) && `border: 1px solid ${theme.colors.palette.deepBlue[200]};`, ({\n variant\n}) => variant === 'primary' && `outline: 1px solid ${theme.colors.palette.deepBlue[400]};`, ({\n variant\n}) => isSearchPill(variant) && `\n border: 1px solid ${theme.colors.white};\n padding: ${theme.space.small}px ${theme.space.medium}px;\n background-color: ${theme.colors.white};\n border-radius: 36px;\n `);\nexport const IconContainer = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-173fccl-1\"\n})([\"\", \" transform:scaleY(\", \");transition:transform 0.12s ease-in-out;line-height:0;\"], iconContainer, props => props.expanded ? -1 : 1);\nexport const Text = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-173fccl-2\"\n})([\"\", \"\"], text);\nexport const PillButtonWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-173fccl-3\"\n})([\"background-color:\", \";height:4rem;\"], theme.colors.palette.gray[500]);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport { Dropdown } from \"../Icons2/Dropdown\";\nimport { IconContainer, PillButtonContainer, Text } from \"./PillButton.styles\";\nconst PillButton = ({\n children,\n variant = 'primary',\n expanded,\n disabled,\n expandable = true,\n size = 'small',\n icon: Icon = Dropdown,\n onClick,\n 'data-e2e': dataE2E,\n align = 'right',\n onKeyDown,\n ...rest\n}) => /*#__PURE__*/React.createElement(PillButtonContainer, _extends({\n type: \"button\",\n expanded: expanded\n}, expandable ? {\n 'aria-expanded': expanded\n} : {}, {\n expandable: expandable,\n variant: variant,\n disabled: disabled,\n size: size,\n onClick: onClick,\n \"data-e2e\": dataE2E,\n align: align,\n onKeyDown: onKeyDown\n}, rest), children && /*#__PURE__*/React.createElement(Text, {\n expanded: expanded,\n variant: variant,\n align: align\n}, children), (expandable || Icon) && /*#__PURE__*/React.createElement(IconContainer, {\n expanded: expanded,\n size: size,\n variant: variant\n}, /*#__PURE__*/React.createElement(Icon, null)));\nexport default PillButton;","import PillButton from \"./PillButton\";\nexport default PillButton;","import theme from \"../../../../frontend-components/src/style-values/index\";\nimport Text from \"../../../../frontend-components/src/Text/index\";\nimport styled from \"../../utils/styled\";\nexport const CountText = styled(Text)`\n color: ${theme.colors.white};\n font-size: ${theme.fontSizes.small};\n font-weight: ${theme.fontWeights.bold};\n`;","import Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport styled from \"../../utils/styled\";\nexport const PillButtonContainer = styled(Box)`\n position: relative;\n padding-right: ${theme.space.small}px;\n padding-left: ${theme.space.smallmedium}px;\n display: inline-flex;\n align-items: center;\n align-self: flex-start;\n`;\nexport const Count = styled(Box)`\n position: absolute;\n display: flex;\n justify-content: center;\n align-items: center;\n right: 0;\n top: 0;\n background-color: ${theme.colors.palette.coral[500]};\n height: ${theme.space.medium}px;\n min-width: ${({\n isHighCount\n}) => isHighCount ? theme.space.large : theme.space.medium}px;\n border-radius: ${theme.space.medium}px;\n border: 1px solid ${theme.colors.white};\n transform: translate(-20%, -20%);\n`;\nexport * from \"./styles.shared\";","import React from \"react\";\nimport { DiscountCard } from \"../../../../frontend-components/src/Icons2/DiscountCard\";\nimport PillButton from \"../../../../frontend-components/src/PillButton/index\";\nimport { PillButtonContainer, Count, CountText } from \"./styles\";\nconst DiscountCardsButton = ({\n dataE2E,\n onClick,\n 'aria-label': ariaLabel,\n cardCount = 0\n}) => {\n const hasHighDiscountCardCount = cardCount > 9;\n const discountCardCountString = hasHighDiscountCardCount ? '9+' : cardCount.toString();\n return /*#__PURE__*/React.createElement(PillButtonContainer, null, /*#__PURE__*/React.createElement(PillButton, {\n \"aria-label\": ariaLabel,\n size: \"medium\",\n icon: DiscountCard,\n \"data-e2e\": dataE2E,\n onClick: onClick,\n onKeyDown: e => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n e.preventDefault();\n onClick?.();\n }\n }\n }), cardCount > 0 && /*#__PURE__*/React.createElement(Count, {\n isHighCount: hasHighDiscountCardCount\n }, /*#__PURE__*/React.createElement(CountText, null, discountCardCountString)));\n};\nexport default DiscountCardsButton;","import DiscountCardsButton from \"./DiscountCardsButton\";\nexport default DiscountCardsButton;","import theme from \"../../../../frontend-components/src/style-values/index\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport Text from \"../../../../frontend-components/src/Text/index\";\nimport styled from \"../../utils/styled\";\nexport const Container = styled(Box)`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: ${theme.space.medium}px;\n`;\nexport const RightContainer = styled(Box)`\n display: flex;\n flex-direction: row;\n margin-left: ${theme.space.small}px;\n`;\nexport const Type = styled(Text)`\n font-size: ${theme.fontSizes.medium};\n color: ${theme.colors.palette.deepBlue[500]};\n font-family: ${theme.fonts.medium};\n font-weight: ${theme.fontWeights.medium};\n line-height: ${theme.lineHeights.large};\n user-select: none;\n`;","import styled from \"../../utils/styled\";\nexport const LeftContainer = styled.label`\n display: flex;\n flex: 1;\n flex-direction: row;\n min-width: 0;\n`;\nexport * from \"./styles.shared\";","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport Checkbox from \"../../../../frontend-components/src/Checkbox/index\";\nimport PassengerInfo from \"../PassengerInfo\";\nimport DiscountCardsButton from \"../DiscountsCardsButton\";\nimport { Container, LeftContainer, RightContainer, Type } from \"./styles\";\nconst StoredPassenger = ({\n passenger,\n isSelected,\n isDiscountCardsEnabled,\n onToggleSelection,\n onDiscountCardIconClick\n}) => {\n const onPassengerToggle = () => onToggleSelection?.(passenger.id);\n const onDiscountCardClick = () => onDiscountCardIconClick?.(passenger.id);\n return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(LeftContainer, null, /*#__PURE__*/React.createElement(Checkbox, {\n tabIndex: 0,\n checked: isSelected,\n onChange: onPassengerToggle\n }), /*#__PURE__*/React.createElement(PassengerInfo, {\n title: `${passenger.firstName} ${passenger.lastName}`,\n type: passenger.type,\n discountCards: passenger.selectedDiscountCards,\n isDiscountCardsEnabled: isDiscountCardsEnabled,\n onClick: event => {\n event.preventDefault();\n onPassengerToggle();\n }\n })), /*#__PURE__*/React.createElement(RightContainer, null, /*#__PURE__*/React.createElement(Type, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: `searchbar.${passenger.type}`,\n defaultMessage: passenger.type\n })), isDiscountCardsEnabled && /*#__PURE__*/React.createElement(DiscountCardsButton, {\n cardCount: passenger.selectedDiscountCards.length,\n \"aria-label\": `${passenger.firstName} ${passenger.lastName}: ${passenger.selectedDiscountCards.length} discount cards. Edit`,\n dataE2E: `passengerAgeAndDiscountCard-${passenger.type}-pill`,\n onClick: onDiscountCardClick\n })));\n};\nexport default StoredPassenger;","import styled from \"styled-components\";\nimport Divider from \"../../../../frontend-components/src/Divider/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const Separator = /*#__PURE__*/styled(Divider).withConfig({\n componentId: \"sc-zm625f-0\"\n})([\"margin:0 \", \"px;\"], theme.space.medium);","import styled from \"styled-components\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nimport { Separator } from \"./StoredPassengersList.styles.shared\";\nexport { Separator };\nexport const Container = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-nr5042-0\"\n})([\"overflow:auto;flex-direction:column;width:100%;\"]);","import React, { useState } from \"react\";\nimport { DiscountCardsOverlay } from \"../DiscountCardsOverlay\";\nimport StoredPassenger from \"../StoredPassenger/StoredPassenger\";\nimport { Container, Separator } from \"./StoredPassengersList.styles\";\nconst StoredPassengersList = props => {\n const {\n storedPassengers,\n discountCardsEnabled,\n onPassengerToggle,\n onPassengerUpdate,\n selectedPassengers,\n discountCardGroups,\n onDiscountCardsModalClose,\n onDiscountCardsModalOpen\n } = props;\n const [discountCardsOverlayPassenger, setDiscountCardsOverlayPassenger] = useState();\n const storedPassengersLength = storedPassengers.length;\n const onDiscountCardIconClick = selectedPassenger => {\n onDiscountCardsModalOpen?.();\n setDiscountCardsOverlayPassenger(selectedPassenger);\n };\n const onUpdatePassengerCards = discountCards => {\n onPassengerUpdate({\n ...discountCardsOverlayPassenger,\n selectedDiscountCards: discountCards\n });\n onDiscountCardsModalClose?.();\n setDiscountCardsOverlayPassenger(undefined);\n };\n return /*#__PURE__*/React.createElement(Container, null, storedPassengers.map((passenger, index) => {\n return /*#__PURE__*/React.createElement(React.Fragment, {\n key: passenger.id\n }, /*#__PURE__*/React.createElement(StoredPassenger, {\n passenger: passenger,\n isSelected: selectedPassengers.includes(passenger.id),\n isDiscountCardsEnabled: discountCardsEnabled,\n onToggleSelection: onPassengerToggle,\n onDiscountCardIconClick: () => onDiscountCardIconClick(passenger)\n }), index !== storedPassengersLength - 1 && /*#__PURE__*/React.createElement(Separator, null));\n }), discountCardsOverlayPassenger !== undefined && /*#__PURE__*/React.createElement(DiscountCardsOverlay, {\n discountCardGroups: discountCardGroups,\n onUpdate: onUpdatePassengerCards,\n selectedCards: discountCardsOverlayPassenger.selectedDiscountCards\n }));\n};\nexport default StoredPassengersList;","import styled, { css } from \"styled-components\";\nimport theme from \"../style-values\";\nimport { borderRadiusForSelect } from \"../style-values/spacing\";\nconst getBackgroundColor = (variant, invalid = false, disabled = false) => {\n const {\n inputBackgroundInvalid,\n inputBackgroundDisabled,\n pillBackground,\n inputBackground\n } = theme.colors;\n const states = {\n invalid: `${inputBackgroundInvalid}`,\n disabled: `${inputBackgroundDisabled}`,\n pill: `${pillBackground}`,\n default: `${inputBackground}`\n };\n const type = invalid && 'invalid' || disabled && 'disabled' || variant || 'default';\n return states[type];\n};\nconst getBorderColor = (variant, invalid = false, disabled = false) => {\n const {\n inputBorderColorInvalid,\n inputBorderColorDisabled,\n bodyText,\n inputBorderColor\n } = theme.colors;\n const states = {\n invalid: `${inputBorderColorInvalid}`,\n disabled: `${inputBorderColorDisabled}`,\n pill: `${bodyText}`,\n default: `${inputBorderColor}`\n };\n const type = invalid && 'invalid' || disabled && 'disabled' || variant || 'default';\n return states[type];\n};\nconst iconColor = /*#__PURE__*/css([\"color:\", \";\"], props => props.selectVariant === 'pill' ? theme.colors.bodyText : theme.colors.subHeading);\nexport const SelectContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-dvxrdz-0\"\n})([\"position:relative;\"]);\nexport const IconContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-dvxrdz-1\"\n})([\"\", \";position:absolute;top:50%;transform:translateY(-50%);line-height:0;pointer-events:none;width:18px;height:18px;right:12px;\"], iconColor);\nexport const SelectTag = /*#__PURE__*/styled.select.withConfig({\n componentId: \"sc-dvxrdz-2\"\n})([\"background-color:\", \";border:1px solid \", \";color:\", \";font-size:\", \";width:100%;appearance:none;outline:none;height:\", \";padding:0 30px 0 16px;border-radius:\", \";transition:all 300ms ease;opacity:\", \";cursor:\", \";&:active,&:focus,&:hover{border-color:\", \";}\"], ({\n selectVariant,\n invalid,\n disabled\n}) => getBackgroundColor(selectVariant, invalid, disabled), ({\n invalid\n}) => invalid ? theme.colors.inputBorderColorInvalid : 'transparent', theme.colors.bodyText, theme.fontSizes.medium, ({\n selectVariant\n}) => selectVariant === 'pill' ? '26px' : '48px', ({\n selectVariant\n}) => borderRadiusForSelect[selectVariant], ({\n disabled\n}) => disabled ? 0.5 : 1, ({\n disabled\n}) => disabled ? 'not-allowed' : 'pointer', ({\n selectVariant,\n invalid,\n disabled\n}) => getBorderColor(selectVariant, invalid, disabled));","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport { Dropdown } from \"../Icons2/Dropdown\";\nimport { IconContainer, SelectContainer, SelectTag } from \"./Select.styles\";\nconst noop = () => {};\nconst Select = ({\n id,\n name,\n options,\n value,\n placeholder,\n variant = 'default',\n invalid = false,\n disabled = false,\n onChange = noop,\n onBlur = noop,\n testID,\n ...rest\n}) => {\n return /*#__PURE__*/React.createElement(SelectContainer, null, /*#__PURE__*/React.createElement(IconContainer, {\n selectVariant: variant\n }, /*#__PURE__*/React.createElement(Dropdown, null)), /*#__PURE__*/React.createElement(SelectTag, _extends({\n id: id,\n selectVariant: variant,\n invalid: invalid,\n name: name,\n disabled: disabled,\n value: value,\n onChange: event => onChange(event.target.value),\n \"data-testid\": testID,\n onBlur: onBlur\n }, rest), placeholder && /*#__PURE__*/React.createElement(\"option\", {\n defaultChecked: true,\n hidden: true\n }, placeholder), options.map(({\n label,\n value: _value,\n disabled: _disabled\n }, index) => /*#__PURE__*/React.createElement(\"option\", {\n key: index,\n value: _value,\n label: label,\n disabled: _disabled\n }, label))));\n};\nexport default Select;","import Select from \"./Select\";\nexport default Select;","export const SHAKE_TRANSITION = {\n 0: 0,\n 10: -1,\n 20: 2,\n 30: -6,\n 40: 6,\n 50: -6,\n 60: 6,\n 70: -6,\n 80: 2,\n 90: 1,\n 100: 0\n};\nexport const DURATION = 600;","import styled, { keyframes, css } from \"styled-components\";\nimport { SHAKE_TRANSITION, DURATION } from \"./Shaker.styles.shared\";\nconst keyframe = Object.entries(SHAKE_TRANSITION).map(([percentage, translate]) => `${percentage}% { transform: translate3d(${translate}px, 0, 0); };`).join('');\nconst shakeAnimation = /*#__PURE__*/keyframes([\"\", \"\"], keyframe);\nexport const Shake = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1si1hfn-0\"\n})([\"\", \"\"], ({\n shake\n}) => shake && css([\"animation:\", \" \", \"ms cubic-bezier(0.36,0.07,0.19,0.97) both;transform:translate3d(0,0,0);backface-visibility:hidden;\"], shakeAnimation, DURATION));","import React from \"react\";\nimport { Shake } from \"./Shaker.styles\";\nconst Shaker = ({\n shake = false,\n children\n}) => /*#__PURE__*/React.createElement(Shake, {\n shake: shake\n}, children);\nexport default Shaker;","import Shaker from \"./Shaker\";\nexport default Shaker;","export const MAX_PASSENGERS = 9;\nexport const MAX_AGE = 75;\nexport const ageRanges = {\n youth: {\n start: 0,\n end: 25\n },\n adult: {\n start: 26,\n end: 57\n },\n senior: {\n start: 58,\n end: MAX_AGE\n }\n};","import { ageRanges, MAX_AGE } from \"../../config/passengersConfig\";\nexport const getAgeSelectOptions = (type, intl) => {\n const range = ageRanges[type];\n const rangeLength = range.end - range.start + 1;\n const options = [];\n for (let i = 0; i < rangeLength; i++) {\n const age = range.start + i;\n const isMaxAge = age === MAX_AGE;\n options.push({\n label: intl.formatMessage({\n id: isMaxAge ? 'searchbar.age_plus_input_value' : 'searchbar.age_input_value',\n defaultMessage: `${age} years`\n }, {\n COUNT: age\n }),\n value: `${age}`,\n testID: `Age_${age}`\n });\n }\n return options;\n};","import styled from \"../../utils/styled\";\nexport const SelectLabel = styled.label``;","import { AgeSelect } from \"./AgeSelect\";\nexport default AgeSelect;","import React from \"react\";\nimport { useIntl } from \"react-intl\";\nimport Select from \"../../../../frontend-components/src/Select/index\";\nimport Shaker from \"../../../../frontend-components/src/Shaker/index\";\nimport VisuallyHidden from \"../../../../frontend-components/src/VisuallyHidden/index\";\nimport { getAgeSelectOptions } from \"./AgeSelect.utils\";\nimport { SelectLabel } from \"./styles\";\nexport const AgeSelect = ({\n passenger: {\n id,\n type,\n age\n },\n passengerNumber,\n invalid,\n onAgeChange\n}) => {\n const intl = useIntl();\n const passengerTitle = `${intl.formatMessage({\n id: `searchbar.${type}`\n })} ${passengerNumber}`;\n const agePlaceholder = intl.formatMessage({\n id: 'searchbar.age_input_placeholder'\n });\n return /*#__PURE__*/React.createElement(Shaker, {\n shake: invalid\n }, /*#__PURE__*/React.createElement(VisuallyHidden, null, /*#__PURE__*/React.createElement(SelectLabel, {\n htmlFor: id\n }, passengerTitle, \":\", agePlaceholder, \" Edit\")), /*#__PURE__*/React.createElement(Select, {\n id: id,\n name: id,\n variant: \"pill\",\n value: age?.toString(),\n options: getAgeSelectOptions(type, intl),\n onChange: value => {\n if (value === undefined) return;\n const selectedAge = Number(value);\n onAgeChange?.(selectedAge);\n },\n placeholder: agePlaceholder,\n invalid: invalid\n }));\n};","import theme from \"../../../../frontend-components/src/style-values/index\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport styled from \"../../utils/styled\";\nexport const Container = styled(Box)`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n`;\nexport const RightContainer = styled(Box)`\n display: flex;\n flex-direction: row;\n margin-left: ${theme.space.small}px;\n`;","import styled from \"../../utils/styled\";\nexport const LeftContainer = styled.label`\n display: flex;\n flex: 1;\n flex-direction: row;\n min-width: 0;\n`;\nexport * from \"./styles.shared\";","import React from \"react\";\nimport { useIntl } from \"react-intl\";\nimport PassengerInfo from \"../PassengerInfo\";\nimport DiscountCardsButton from \"../DiscountsCardsButton\";\nimport AgeSelect from \"../AgeSelect\";\nimport { Container, LeftContainer, RightContainer } from \"./styles\";\nconst AnonymousPassenger = ({\n passenger,\n passengerNumber,\n isDiscountCardsEnabled,\n isAgeSelectVisible,\n isAgeInvalid,\n onAgeChange,\n onDiscountCardIconClick\n}) => {\n const {\n formatMessage\n } = useIntl();\n const onDiscountCardClick = () => onDiscountCardIconClick?.(passenger.id);\n const passengerTitle = `${formatMessage({\n id: `searchbar.${passenger.type}`\n })} ${passengerNumber}`;\n return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(LeftContainer, null, /*#__PURE__*/React.createElement(PassengerInfo, {\n title: passengerTitle,\n type: passenger.type,\n discountCards: passenger.selectedDiscountCards,\n isDiscountCardsEnabled: isDiscountCardsEnabled\n })), /*#__PURE__*/React.createElement(RightContainer, {\n \"data-e2e\": `passengerAgeAndDiscountCard-${passenger.type}`\n }, isAgeSelectVisible && /*#__PURE__*/React.createElement(AgeSelect, {\n passenger: passenger,\n passengerNumber: passengerNumber,\n invalid: isAgeInvalid,\n onAgeChange: onAgeChange\n }), isDiscountCardsEnabled && /*#__PURE__*/React.createElement(DiscountCardsButton, {\n cardCount: passenger.selectedDiscountCards.length,\n \"aria-label\": `${passengerTitle}: ${passenger.selectedDiscountCards.length} discount cards. Edit`,\n onClick: onDiscountCardClick\n })));\n};\nexport default AnonymousPassenger;","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const MinusButton = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 32 32\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"g\", {\n fill: \"currentColor\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16zm0-2C8.268 30 2 23.732 2 16S8.268 2 16 2s14 6.268 14 14-6.268 14-14 14z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9 15h14a1 1 0 0 1 0 2H9a1 1 0 0 1 0-2z\"\n})));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const PlusButton = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 32 32\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"g\", {\n fill: \"currentColor\"\n}, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 32c8.837 0 16-7.163 16-16S24.837 0 16 0 0 7.163 0 16s7.163 16 16 16zm0-2C8.268 30 2 23.732 2 16S8.268 2 16 2s14 6.268 14 14-6.268 14-14 14z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M16 8a1 1 0 0 1 1 1v6h6a1 1 0 0 1 0 2h-6.001L17 23a1 1 0 0 1-2 0l-.001-6H9a1 1 0 0 1 0-2h6V9a1 1 0 0 1 1-1z\"\n})));","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport { MinusButton } from \"../Icons2/MinusButton\";\nimport { PlusButton } from \"../Icons2/PlusButton\";\nimport { PassengerTypeCount, CircularButton, PassengerCountText } from \"./ButtonStepper.styles\";\nconst ButtonStepper = ({\n count,\n decrementDisabled: isDecrementDisabled,\n onDecrement,\n incrementDisabled: isIncrementDisabled,\n onIncrement,\n disabled,\n 'data-e2e': datae2e,\n 'aria-labelledby': ariaLabelledBy\n}) => {\n const decrementDisabled = disabled || isDecrementDisabled;\n const incrementDisabled = disabled || isIncrementDisabled;\n return /*#__PURE__*/React.createElement(PassengerTypeCount, null, /*#__PURE__*/React.createElement(CircularButton, _extends({\n type: \"button\",\n tabIndex: -1,\n disabled: decrementDisabled\n }, !!datae2e && {\n 'data-e2e': `${datae2e}_minus`\n }, {\n onClick: () => !decrementDisabled && onDecrement()\n }), /*#__PURE__*/React.createElement(MinusButton, null)), /*#__PURE__*/React.createElement(PassengerCountText, _extends({\n role: \"spinbutton\",\n tabIndex: 0,\n \"aria-valuenow\": count,\n \"aria-labelledby\": ariaLabelledBy,\n disabled: disabled,\n onKeyDown: e => {\n if (e.key === 'ArrowUp' || e.key === 'ArrowRight') {\n e.preventDefault();\n if (!incrementDisabled) onIncrement();\n }\n if (e.key === 'ArrowDown' || e.key === 'ArrowLeft') {\n e.preventDefault();\n if (!decrementDisabled) onDecrement();\n }\n }\n }, !!datae2e && {\n 'data-e2e': `${datae2e}_count`\n }), count), /*#__PURE__*/React.createElement(CircularButton, _extends({\n type: \"button\",\n tabIndex: -1,\n disabled: incrementDisabled\n }, !!datae2e && {\n 'data-e2e': `${datae2e}_plus`\n }, {\n onClick: () => !incrementDisabled && onIncrement()\n }), /*#__PURE__*/React.createElement(PlusButton, null)));\n};\nexport default ButtonStepper;","import Box from \"../../../../frontend-components/src/Box/index\";\nimport { H5, ParagraphRegular } from \"../../../../frontend-components/src/Typography/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport styled from \"../../utils/styled\";\nexport const PassengerTypeCounterWrapper = styled(Box)`\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n`;\nexport const PassengerTypeWrapper = styled(Box)`\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n gap: ${theme.space.small}px;\n`;\nexport const AgeLimit = styled(ParagraphRegular)``;\nexport const PassengerType = styled(H5)``;\nexport const ButtonStepperWrapper = styled(Box)`\n width: 108px;\n`;","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport ButtonStepper from \"../../../../frontend-components/src/ButtonStepper/index\";\nimport { ageRanges, MAX_PASSENGERS } from \"../../config/passengersConfig\";\nimport { PassengerTypeCounterWrapper, PassengerTypeWrapper, PassengerType as PassengerTypeText, AgeLimit, ButtonStepperWrapper } from \"./PassengerTypeCounter.styles\";\nconst ageLimit = {\n adult: `${ageRanges.adult.start}-${ageRanges.adult.end}`,\n youth: `${ageRanges.youth.start}-${ageRanges.youth.end}`,\n senior: `${ageRanges.senior.start}+`\n};\nconst PassengerTypeCounter = ({\n passengersCount,\n passengerType,\n totalNumberOfPassengers,\n allowEmptyPassengers,\n onIncrement,\n onDecrement\n}) => {\n const decrementDisabled = !allowEmptyPassengers && totalNumberOfPassengers <= 1 || passengersCount === 0;\n const incrementDisabled = totalNumberOfPassengers >= MAX_PASSENGERS;\n return /*#__PURE__*/React.createElement(PassengerTypeCounterWrapper, {\n \"data-e2e\": `${passengerType}Passenger`\n }, /*#__PURE__*/React.createElement(PassengerTypeWrapper, {\n id: `${passengerType}-passenger-type`\n }, /*#__PURE__*/React.createElement(PassengerTypeText, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: `searchbar.${passengerType}`\n })), ageLimit[passengerType] && /*#__PURE__*/React.createElement(AgeLimit, null, '(', ageLimit[passengerType], \" \", /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"passengerYearsLabel\"\n }), ')')), /*#__PURE__*/React.createElement(ButtonStepperWrapper, null, /*#__PURE__*/React.createElement(ButtonStepper, {\n \"data-e2e\": `addRemovePassengerButton_${passengerType}`,\n count: passengersCount,\n \"aria-labelledby\": `${passengerType}-passenger-type`,\n decrementDisabled: decrementDisabled,\n incrementDisabled: incrementDisabled,\n onIncrement: onIncrement,\n onDecrement: onDecrement\n })));\n};\nexport default PassengerTypeCounter;","import PassengerTypeCounter from \"./PassengerTypeCounter\";\nexport default PassengerTypeCounter;","import Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport styled from \"../../utils/styled\";\nexport const PassengerSection = styled(Box)`\n border-bottom-color: ${theme.colors.palette.gray[500]};\n border-bottom-width: 1px;\n border-bottom-style: solid;\n`;\nexport const PassengerTypeCounterWrapper = styled(Box)`\n padding: ${theme.space.medium}px;\n`;\nexport const PassengerItem = styled(Box)`\n margin: 0 ${theme.space.medium}px;\n padding: ${theme.space.medium}px 0 ${theme.space.medium}px ${theme.space.medium}px;\n border-top-width: 1px;\n border-top-color: ${theme.colors.palette.gray[400]};\n border-top-style: solid;\n`;","import React, { useState } from \"react\";\nimport AnonymousPassenger from \"../AnonymousPassenger/AnonymousPassenger\";\nimport { DiscountCardsOverlay } from \"../DiscountCardsOverlay\";\nimport PassengerTypeCounter from \"../PassengerTypeCounter\";\nimport { PassengerItem, PassengerSection, PassengerTypeCounterWrapper } from \"./styles\";\nconst passengerTypes = ['adult', 'youth', 'senior'];\nconst AnonymousPassengerList = ({\n isDiscountCardsEnabled,\n allowEmptyPassengers,\n totalNumberOfPassengers,\n discountCardGroups,\n anonymousPassengers = [],\n invalidAges = [],\n onPassengerAdd,\n onPassengerRemove,\n onPassengerUpdate,\n onDiscountCardsModalClose,\n onDiscountCardsModalOpen\n}) => {\n const [discountCardsOverlayPassenger, setDiscountCardsOverlayPassenger] = useState();\n const onDiscountCardIconClick = selectedPassenger => {\n onDiscountCardsModalOpen?.();\n setDiscountCardsOverlayPassenger(selectedPassenger);\n };\n const onUpdatePassengerCards = discountCards => {\n onPassengerUpdate({\n ...discountCardsOverlayPassenger,\n selectedDiscountCards: discountCards\n });\n onDiscountCardsModalClose?.();\n setDiscountCardsOverlayPassenger(undefined);\n };\n return /*#__PURE__*/React.createElement(React.Fragment, null, passengerTypes.map(type => {\n const filteredPassengers = anonymousPassengers.filter(passenger => passenger.type === type);\n const onIncrement = () => onPassengerAdd(type);\n const onDecrement = () => onPassengerRemove(type);\n return /*#__PURE__*/React.createElement(PassengerSection, {\n key: type\n }, /*#__PURE__*/React.createElement(PassengerTypeCounterWrapper, null, /*#__PURE__*/React.createElement(PassengerTypeCounter, {\n passengerType: type,\n passengersCount: filteredPassengers.length,\n totalNumberOfPassengers: totalNumberOfPassengers,\n allowEmptyPassengers: allowEmptyPassengers,\n onIncrement: onIncrement,\n onDecrement: onDecrement\n })), filteredPassengers.map((passenger, index) => /*#__PURE__*/React.createElement(PassengerItem, {\n key: passenger.id\n }, /*#__PURE__*/React.createElement(AnonymousPassenger, {\n passengerNumber: index + 1,\n passenger: passenger,\n isDiscountCardsEnabled: isDiscountCardsEnabled,\n isAgeSelectVisible: type !== 'adult',\n isAgeInvalid: invalidAges.includes(passenger.id),\n onAgeChange: age => onPassengerUpdate({\n ...passenger,\n age\n }),\n onDiscountCardIconClick: () => onDiscountCardIconClick(passenger)\n }))));\n }), discountCardsOverlayPassenger !== undefined && /*#__PURE__*/React.createElement(DiscountCardsOverlay, {\n discountCardGroups: discountCardGroups,\n onUpdate: onUpdatePassengerCards,\n selectedCards: discountCardsOverlayPassenger.selectedDiscountCards\n }));\n};\nexport default AnonymousPassengerList;","import AnonymousPassengerList from \"./AnonymousPassengerList\";\nexport default AnonymousPassengerList;","import styled, { css } from \"styled-components\";\nimport theme from \"../style-values\";\n/* HACK: Colors not presented in palette */\nconst COLOR_DARK_GRAY = '#333';\nconst COLOR_LIGHT_GRAY = '#FAFAFA';\nconst TOGGLE_UNCHECKED = '.react-toggle-track';\nconst TOGGLE_CHECKED = '.react-toggle--checked .react-toggle-track';\nconst themes = {\n primary: css([\"\", \"{background-color:\", \";}\", \"{background-color:\", \";}\"], TOGGLE_UNCHECKED, theme.colors.palette.gray[500], TOGGLE_CHECKED, theme.colors.palette.mediumBlue[500]),\n alternate: css([\"\", \"{background-color:\", \";}\", \"{background-color:\", \";}\"], TOGGLE_UNCHECKED, COLOR_DARK_GRAY, TOGGLE_CHECKED, theme.colors.palette.seaGreen[500]),\n secondary: css([\"\", \"{background-color:\", \";}\", \"{background-color:\", \";}\"], TOGGLE_UNCHECKED, theme.colors.palette.deepBlue[300], TOGGLE_CHECKED, theme.colors.palette.seaGreen[600])\n};\nconst small = /*#__PURE__*/css([\".react-toggle-track{width:32px;height:18px;}.react-toggle-thumb{width:14px;height:14px;top:2px;}.react-toggle--checked .react-toggle-thumb{left:16px;}\"]);\nexport const Wrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1u499ex-0\"\n})([\".react-toggle{display:inline-block;position:relative;cursor:pointer;background-color:transparent;border:0;padding:0;-webkit-touch-callout:none;user-select:none;-webkit-tap-highlight-color:rgb(0,0,0,0);-webkit-tap-highlight-color:transparent;}.react-toggle-track{width:40px;height:24px;padding:0;border-radius:30px;transition:all 0.2s ease;}.react-toggle-screenreader-only{border:0;clip:rect(0 0 0 0);height:1px;margin:0;overflow:hidden;padding:0;position:absolute;width:1px;}.react-toggle-track-check{position:absolute;width:14px;height:10px;top:0;bottom:0;margin-top:auto;margin-bottom:auto;line-height:0;left:8px;opacity:0;transition:opacity 0.25s ease;& > svg{display:none;}}.react-toggle-track-x{position:absolute;width:10px;height:10px;top:0;bottom:0;margin-top:auto;margin-bottom:auto;line-height:0;right:10px;opacity:1;transition:opacity 0.25s ease;& > svg{display:none;}}.react-toggle-thumb{transition:all 0.5s cubic-bezier(0.23,1,0.32,1) 0ms;position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background-color:\", \";box-sizing:border-box;border:none;}.react-toggle--checked{& > .react-toggle-track-check{opacity:1;}& > .react-toggle-track-x{opacity:0;}& > .react-toggle-thumb{left:18px;}}.react-toggle--disabled{opacity:0.4;transition:opacity 0.25s;cursor:not-allowed;pointer-events:none;}\", \";\", \";\"], COLOR_LIGHT_GRAY, props => props.variant && themes[props.variant], props => props.small && small);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport ReactToggle from \"react-toggle\";\nimport { Wrapper } from \"./Toggle.styles\";\nconst Toggle = ({\n small = false,\n variant = 'primary',\n checked = false,\n disabled = false,\n onChange,\n 'data-e2e': dataE2E,\n ...rest\n}) => /*#__PURE__*/React.createElement(Wrapper, {\n variant: variant,\n small: small,\n \"data-component\": \"toggle\",\n \"data-e2e\": dataE2E\n}, /*#__PURE__*/React.createElement(ReactToggle, _extends({\n checked: checked,\n disabled: disabled,\n onChange: onChange\n}, rest)));\nexport default Toggle;","import Toggle from \"./Toggle\";\nexport default Toggle;","import { css } from \"styled-components\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const DiscountCardWrapperCss = /*#__PURE__*/css([\"display:flex;flex-direction:row;color:\", \";align-items:center;\"], theme.colors.palette.deepBlue[400]);\nexport const ToggleWrapperCss = /*#__PURE__*/css([\"flex-grow:1;text-align:right;\"]);\nexport const DescriptionCss = /*#__PURE__*/css([\"font-size:\", \";color:\", \";\"], theme.fontSizes.medium, theme.colors.palette.deepBlue[400]);\nexport const DescriptionWrapperCss = /*#__PURE__*/css([\"display:flex;flex-direction:row;align-items:center;gap:\", \"px;\"], theme.space.small);","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport { ParagraphRegular } from \"../../../../frontend-components/src/Typography/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport { DiscountCardWrapperCss, ToggleWrapperCss, DescriptionCss, DescriptionWrapperCss } from \"./DiscountCardToggle.styles.shared\";\nexport const DiscountCardWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p7g1lw-0\"\n})([\"\", \"\"], DiscountCardWrapperCss);\nexport const ToggleWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p7g1lw-1\"\n})([\"\", \" margin-top:\", \"px;\"], ToggleWrapperCss, theme.space.small);\nexport const Description = /*#__PURE__*/styled(ParagraphRegular).withConfig({\n componentId: \"sc-p7g1lw-2\"\n})([\"\", \"\"], DescriptionCss);\nexport const DescriptionWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-p7g1lw-3\"\n})([\"\", \"\"], DescriptionWrapperCss);","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport Tooltip from \"../../../../frontend-components/src/Tooltip/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport { DiscountCard as DiscountCardIcon } from \"../../../../frontend-components/src/Icons2/DiscountCard\";\nimport { InfoO as InfoOIcon } from \"../../../../frontend-components/src/Icons2/InfoO\";\nimport IconContainer from \"../../../../frontend-components/src/IconContainer/index\";\nimport { ParagraphRegular } from \"../../../../frontend-components/src/Typography/index\";\nimport { Description, DescriptionWrapper } from \"./DiscountCardToggle.styles\";\nexport const DiscountCardToggleShared = () => /*#__PURE__*/React.createElement(DescriptionWrapper, {\n \"data-e2e\": \"discountCardToggle\"\n}, /*#__PURE__*/React.createElement(IconContainer, {\n size: \"medium\",\n color: theme.colors.palette.deepBlue[400]\n}, /*#__PURE__*/React.createElement(DiscountCardIcon, null)), /*#__PURE__*/React.createElement(Description, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"searchbar.add_discount_card\"\n})), /*#__PURE__*/React.createElement(Tooltip, {\n overlay: /*#__PURE__*/React.createElement(ParagraphRegular, {\n inverted: true\n }, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"searchbar.discount_card.add_infobubble\"\n }))\n}, /*#__PURE__*/React.createElement(IconContainer, {\n size: \"small\",\n color: theme.colors.palette.deepBlue[300]\n}, /*#__PURE__*/React.createElement(InfoOIcon, null))));","import React from \"react\";\nimport Toggle from \"../../../../frontend-components/src/Toggle/index\";\nimport { DiscountCardWrapper, ToggleWrapper } from \"./DiscountCardToggle.styles\";\nimport { DiscountCardToggleShared } from \"./DiscountCardToggle.shared\";\nexport const DiscountCardToggle = ({\n toggled,\n disabled,\n onChange\n}) => /*#__PURE__*/React.createElement(DiscountCardWrapper, {\n \"data-e2e\": \"discountCardToggle\"\n}, /*#__PURE__*/React.createElement(DiscountCardToggleShared, null), /*#__PURE__*/React.createElement(ToggleWrapper, {\n onClick: onChange\n}, /*#__PURE__*/React.createElement(Toggle, {\n \"data-e2e\": \"discountCardToggleBtn\",\n testID: 'pcc_toggle_enableDiscountCard',\n onChange: onChange,\n variant: \"secondary\",\n checked: toggled,\n disabled: disabled\n})));","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const LoadingSkeleton = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-10zsq72-0\"\n})([\"border-radius:\", \";height:\", \";width:\", \";\"], theme.radii.small, ({\n height\n}) => height, ({\n width\n}) => width);\nexport const LoadingContainer = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-10zsq72-1\"\n})([\"flex-direction:row;padding:\", \"px;border-bottom:1px solid \", \";\"], theme.space.medium, theme.colors.palette.gray[300]);\nexport const LeftContainer = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-10zsq72-2\"\n})([\"flex:1;margin-left:\", \"px;\"], theme.space.small);\nexport const RightContainer = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-10zsq72-3\"\n})([\"flex:5;\"]);","import React from \"react\";\nimport LoadingBackground from \"../../../../frontend-components/src/LoadingBackground/index\";\nimport { LeftContainer, LoadingContainer, LoadingSkeleton, RightContainer } from \"./StoredPassengerLoading.styles\";\nexport const StoredPassengerLoadingItem = () => /*#__PURE__*/React.createElement(LoadingContainer, null, /*#__PURE__*/React.createElement(LeftContainer, null, /*#__PURE__*/React.createElement(LoadingSkeleton, {\n width: \"20px\",\n height: \"20px\"\n}, /*#__PURE__*/React.createElement(LoadingBackground, null))), /*#__PURE__*/React.createElement(RightContainer, null, /*#__PURE__*/React.createElement(LoadingSkeleton, {\n width: \"90%\",\n height: \"22px\"\n}, /*#__PURE__*/React.createElement(LoadingBackground, null))));\nexport const StoredPassengerLoading = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StoredPassengerLoadingItem, null), /*#__PURE__*/React.createElement(StoredPassengerLoadingItem, null));","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport Divider from \"../../../../frontend-components/src/Divider/index\";\nimport Text from \"../../../../frontend-components/src/Text/index\";\nimport Flex from \"../../../../frontend-components/src/Flex/index\";\nexport const ButtonWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-li7esf-0\"\n})([\"padding:0 \", \"px;\"], theme.space.medium);\nexport const DiscountCardToggleWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-li7esf-1\"\n})([\"padding:\", \"px;\"], theme.space.medium);\nexport const Separator = /*#__PURE__*/styled(Divider).withConfig({\n componentId: \"sc-li7esf-2\"\n})([\"margin:0;\"]);\nexport const AdditionalPassengersHeaderWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-li7esf-3\"\n})([\"background-color:\", \";padding:16px 16px 8px;\"], theme.colors.palette.gray[400]);\nexport const AdditionalPassengersText = /*#__PURE__*/styled(Text).withConfig({\n componentId: \"sc-li7esf-4\"\n})([\"font-size:\", \";font-weight:\", \";letter-spacing:1.2px;line-height:16px;text-transform:uppercase;color:\", \";\"], theme.fontSizes.small, theme.fontWeights.medium, theme.colors.palette.deepBlue[500]);\nexport const DisclaimersWrapper = /*#__PURE__*/styled(Flex).withConfig({\n componentId: \"sc-li7esf-5\"\n})([\"flex-direction:column;gap:\", \"px;margin:\", \"px \", \"px 0;\"], theme.space.medium, theme.space.medium, theme.space.medium);","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport Tips from \"../../../../frontend-components/src/Tips/index\";\nimport { Exclamation } from \"../../../../frontend-components/src/Icons2/Exclamation\";\nimport { DisclaimersWrapper } from \"./PassengerConfig.styles\";\nconst PassengersConfigWarnings = props => {\n const {\n isMaxPassengers,\n isOnlyChild,\n isNoPassengerSelected,\n showDBDiscountCardsDisclamer\n } = props;\n const tipMessageIds = [];\n if (isMaxPassengers) {\n tipMessageIds.push('max_passenger_limit.error_notification');\n }\n if (isOnlyChild) {\n tipMessageIds.push('srp.passengerConfig.childWarning');\n }\n if (isNoPassengerSelected) {\n tipMessageIds.push('passenger_config_components.select_at_least_one_passenger');\n }\n if (showDBDiscountCardsDisclamer) {\n tipMessageIds.push('passenger_config_components.different_db_discount_cards_disclaimer');\n }\n if (tipMessageIds.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(DisclaimersWrapper, null, tipMessageIds.length > 0 && /*#__PURE__*/React.createElement(Tips, {\n type: \"warning\",\n items: tipMessageIds.map(messageId => ({\n content: /*#__PURE__*/React.createElement(FormattedMessage, {\n id: messageId\n }),\n icon: /*#__PURE__*/React.createElement(Exclamation, null)\n }))\n }));\n};\nexport default PassengersConfigWarnings;","import flatten from \"lodash/flatten\";\nimport uniqBy from \"lodash/uniqBy\";\nexport const DB_PROVIDER_ID = 'deutscheBahnPst';\nexport const isMoreThanOneTypeOfDBCardApplied = passengers => uniqBy(flatten(passengers.map(passenger => passenger.selectedDiscountCards)).filter(discountCard => [DB_PROVIDER_ID].includes(discountCard.providerId)), 'id').length > 1;","import { defaults, groupBy, pick } from \"lodash\";\nimport { useEffect, useState } from \"react\";\nimport { isMoreThanOneTypeOfDBCardApplied } from \"../../shared/discountCardsRules\";\nfunction getGroupedPassengers(passengers, storedPassengers) {\n const allPassengers = passengers.concat(storedPassengers);\n const grouped = pick(groupBy(allPassengers, 'type'), 'adult', 'youth', 'senior');\n return defaults(grouped, {\n adult: [],\n youth: [],\n senior: []\n });\n}\nconst checkIfOnlyChild = ({\n adult,\n youth,\n senior\n}) => {\n return adult.length === 0 && senior.length === 0 && youth.length > 0 && youth.filter(({\n age\n }) => (age !== undefined ? age : Infinity) > 14).length === 0;\n};\nexport const usePassengerConfigWarnings = props => {\n const {\n selectedAnonymousPassengers,\n selectedStoredPassengers,\n allowMultipleDBDiscountCards,\n discountCardToggled,\n isLoading\n } = props;\n const [showDBDiscountCardsDisclamer, setShowDBDiscountCardsDisclamer] = useState(false);\n const groupedAllPassengers = getGroupedPassengers(selectedAnonymousPassengers, selectedStoredPassengers);\n useEffect(() => {\n if (allowMultipleDBDiscountCards || !discountCardToggled) return;\n setShowDBDiscountCardsDisclamer(false);\n if (discountCardToggled && isMoreThanOneTypeOfDBCardApplied(selectedAnonymousPassengers.concat(selectedStoredPassengers))) {\n setShowDBDiscountCardsDisclamer(true);\n }\n }, [discountCardToggled, selectedAnonymousPassengers, selectedStoredPassengers, allowMultipleDBDiscountCards]);\n if (isLoading) {\n return {\n isOnlyChild: false,\n showDBDiscountCardsDisclamer: false,\n isNoPassengerSelected: false\n };\n }\n return {\n isOnlyChild: checkIfOnlyChild(groupedAllPassengers),\n showDBDiscountCardsDisclamer,\n isNoPassengerSelected: selectedAnonymousPassengers.length + selectedStoredPassengers.length === 0\n };\n};","import React from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport Button from \"../../../../frontend-components/src/Button/index\";\nimport { ParagraphRegular } from \"../../../../frontend-components/src/Typography/index\";\nimport { StoredPassengersList } from \"../../components/StoredPassengersList\";\nimport AnonymousPassengerList from \"../../components/AnonymousPassengerList\";\nimport { DiscountCardToggle } from \"../../components/DiscountCardToggle/DiscountCardToggle\";\nimport { StoredPassengerLoading } from \"../../components/StoredPassengerLoading/StoredPassengerLoading\";\nimport { AdditionalPassengersHeaderWrapper, AdditionalPassengersText, ButtonWrapper, DiscountCardToggleWrapper, Separator } from \"./PassengerConfig.styles\";\nimport PassengersConfigWarnings from \"./PassengerConfigWarnings\";\nimport { usePassengerConfigWarnings } from \"./usePassengerConfigWarnings\";\nconst PassengerConfig = ({\n discountCardGroups,\n isDiscountCardToggled,\n isLoadingStoredPassengers,\n isMaxPassengers,\n isStoredPassengersListVisible,\n isAnonymousPassengerListVisible,\n onAddMorePassengersButtonClicked,\n onAnonymousPassengerAdd,\n onAnonymousPassengerRemove,\n onAnonymousPassengerUpdate,\n onDiscountCardToggled,\n onDiscountCardsModalClose,\n onDiscountCardsModalOpen,\n onStoredPassengerSelected,\n onStoredPassengerUpdate,\n selectedAnonymousPassengers,\n selectedStoredPassengers,\n selectedStoredPassengersInfo,\n storedPassengers,\n invalidAges,\n allowMultipleDBDiscountCards\n}) => {\n const {\n isOnlyChild,\n showDBDiscountCardsDisclamer,\n isNoPassengerSelected\n } = usePassengerConfigWarnings({\n allowMultipleDBDiscountCards,\n selectedAnonymousPassengers,\n selectedStoredPassengers: selectedStoredPassengersInfo,\n discountCardToggled: isDiscountCardToggled,\n isLoading: isLoadingStoredPassengers\n });\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PassengersConfigWarnings, {\n isMaxPassengers: isMaxPassengers,\n isOnlyChild: isOnlyChild,\n isNoPassengerSelected: isNoPassengerSelected,\n showDBDiscountCardsDisclamer: showDBDiscountCardsDisclamer\n }), isLoadingStoredPassengers ? /*#__PURE__*/React.createElement(StoredPassengerLoading, null) : /*#__PURE__*/React.createElement(StoredPassengersList, {\n discountCardGroups: discountCardGroups || [],\n discountCardsEnabled: isDiscountCardToggled,\n onPassengerToggle: onStoredPassengerSelected,\n onPassengerUpdate: onStoredPassengerUpdate,\n selectedPassengers: selectedStoredPassengers,\n storedPassengers: storedPassengers || [],\n onDiscountCardsModalClose: onDiscountCardsModalClose,\n onDiscountCardsModalOpen: onDiscountCardsModalOpen\n }), isStoredPassengersListVisible && !isAnonymousPassengerListVisible && /*#__PURE__*/React.createElement(Separator, null), isStoredPassengersListVisible && isAnonymousPassengerListVisible && /*#__PURE__*/React.createElement(AdditionalPassengersHeaderWrapper, null, /*#__PURE__*/React.createElement(AdditionalPassengersText, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"passenger_config_components.additional_passengers\"\n }))), isAnonymousPassengerListVisible && /*#__PURE__*/React.createElement(AnonymousPassengerList, {\n onPassengerAdd: onAnonymousPassengerAdd,\n onPassengerRemove: onAnonymousPassengerRemove,\n anonymousPassengers: selectedAnonymousPassengers,\n discountCardGroups: discountCardGroups || [],\n invalidAges: invalidAges,\n allowEmptyPassengers: isStoredPassengersListVisible,\n totalNumberOfPassengers: selectedAnonymousPassengers.length + selectedStoredPassengers.length,\n isDiscountCardsEnabled: isDiscountCardToggled,\n onPassengerUpdate: onAnonymousPassengerUpdate,\n onDiscountCardsModalClose: onDiscountCardsModalClose,\n onDiscountCardsModalOpen: onDiscountCardsModalOpen\n }), /*#__PURE__*/React.createElement(DiscountCardToggleWrapper, null, /*#__PURE__*/React.createElement(DiscountCardToggle, {\n toggled: isDiscountCardToggled,\n onChange: onDiscountCardToggled,\n disabled: false\n })), !isAnonymousPassengerListVisible && /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(Button, {\n variant: \"secondary\",\n onClick: onAddMorePassengersButtonClicked\n }, /*#__PURE__*/React.createElement(ParagraphRegular, null, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"passenger_config_components.add_more_passengers\"\n })))));\n};\nexport default PassengerConfig;","import PassengerConfig from \"./PassengerConfig\";\nexport default PassengerConfig;","import localforage from \"localforage\";\nconst persistentStorage = {\n getItem: localforage.getItem,\n setItem: (...args) => localforage.setItem(...args).then(() => true),\n removeItem: (...args) => localforage.removeItem(...args).then(() => true),\n clear: (...args) => localforage.clear(...args).then(() => true)\n};\nexport const platformStorages = {\n persistent: persistentStorage\n};","export const withErrorHandling = fn => (...args) => {\n try {\n return fn(...args);\n } catch (error) {\n console.error(`Something happened ${error}`);\n throw error;\n }\n};","import { withErrorHandling } from \"./helpers/error\";\nconst VERSION = 'version'; // holds the current version of the storage data\nconst INDEX = 'index'; // holds the reference list inside the storage\n\nconst DEFAULT_VERSION = '1.0.0';\nexport const createMultiStorage = (platformStorage, namespace, version) => {\n const currentVersion = version || DEFAULT_VERSION;\n const getTag = key => `${namespace}-${key}`;\n const getAllKeys = withErrorHandling(async () => {\n const storedKeys = await platformStorage.getItem(getTag(INDEX));\n if (!storedKeys) return [];\n return JSON.parse(storedKeys);\n });\n const set = withErrorHandling(async (key, obj) => {\n await platformStorage.setItem(getTag(VERSION), currentVersion);\n await platformStorage.setItem(getTag(key), JSON.stringify(obj));\n const keys = await getAllKeys();\n if (!keys.includes(key)) {\n keys.push(key);\n await platformStorage.setItem(getTag(INDEX), JSON.stringify(keys));\n }\n return true;\n });\n const get = withErrorHandling(async key => {\n const obj = await platformStorage.getItem(getTag(key));\n if (!obj) return null;\n return JSON.parse(obj);\n });\n const deleteItem = withErrorHandling(async key => {\n const keys = await getAllKeys();\n const index = keys.indexOf(key);\n if (index === -1) {\n throw new Error(`Key: ${key} does not exist inside the storage ...`);\n }\n await platformStorage.removeItem(getTag(key));\n keys.splice(index, 1);\n await platformStorage.setItem(getTag(INDEX), JSON.stringify(keys));\n return true;\n });\n return {\n set,\n get,\n delete: deleteItem,\n getAllKeys\n };\n};\nexport const createUniqueStorage = (platformStorage, namespace, version) => {\n const currentVersion = version || DEFAULT_VERSION;\n const set = withErrorHandling(async obj => {\n await platformStorage.setItem(`${namespace}-${VERSION}`, currentVersion);\n await platformStorage.setItem(namespace, JSON.stringify(obj));\n return true;\n });\n const get = withErrorHandling(async () => {\n const obj = await platformStorage.getItem(namespace);\n if (!obj) return null;\n return JSON.parse(obj);\n });\n const deleteItem = withErrorHandling(async () => {\n await platformStorage.removeItem(namespace);\n return true;\n });\n return {\n set,\n get,\n delete: deleteItem\n };\n};","import { platformStorages } from \"./platformStorages\";\nimport { createMultiStorage, createUniqueStorage } from \"./createStorage\";\nexport const passengerStorage = createMultiStorage(platformStorages.persistent, 'PASSENGER');\nexport const discountCardDefinitionStorage = createUniqueStorage(platformStorages.persistent, 'DISCOUNT_CARD_DEFINITION');\nexport const appStorage = createUniqueStorage(platformStorages.persistent, 'APP');","import { createLogger } from \"../../../fe-utils/src/logger/index\";\nimport getClientId from \"../../../fe-utils/src/getClientId/getClientId\";\nconst {\n logInfo,\n logWarning,\n logError,\n logException\n} = createLogger({\n logPackage: 'passenger-config-components',\n logVersion: 1,\n getExtraData: () => ({\n client_id: getClientId()\n })\n});\nexport { logInfo, logWarning, logError, logException };","import axios from \"../../../../fe-utils/src/axios/index\";\nimport { mapPassengerDiscountCards } from \"../mapDiscountCards\";\nconst headers = {\n 'X-Api-Version': 'v1',\n 'Content-Type': 'application/json'\n};\nexport const getPassengers = async (basePath = '', platform = '', apiToken) => {\n try {\n const passengersResponse = await axios.get(`${basePath}/passenger-service/users/me/passengers`, {\n headers: {\n ...headers,\n ...(apiToken && platform === 'android' && {\n Authorization: `Bearer ${apiToken}`\n })\n },\n withCredentials: true\n });\n return passengersResponse.data;\n } catch (err) {\n throw new Error('Failed to fetch stored passengers');\n }\n};\nexport const updatePassenger = async (passenger, basePath = '', accessToken = '') => {\n try {\n const updatedDiscountCards = mapPassengerDiscountCards(passenger.selectedDiscountCards);\n const updatedPassenger = await axios.patch(`${basePath}/passenger-service/users/me/passengers/${passenger.id}`, {\n discountCards: updatedDiscountCards\n }, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(accessToken && {\n Authorization: `Bearer ${accessToken}`\n })\n }\n });\n return updatedPassenger.data;\n } catch (err) {\n throw new Error('Update Unsuccessful');\n }\n};","import { useEffect, useRef, useState } from \"react\";\nimport { useIntl } from \"react-intl\";\nimport { passengerStorage } from \"../../../../frontend-storages/src/index\";\nimport { showToast } from \"../../../../frontend-components/src/Toast/index\";\nimport { platform } from \"../../platform/platform\";\nimport { mapStoredPassengerToSearchPassenger } from \"../../shared/mapPassengerDetails\";\nimport { logInfo } from \"../../logger/logger\";\nimport { getPassengers, updatePassenger } from \"../../shared/services/passenger-service\";\n\n/**\n * Custom hook for managing passenger configuration data.\n * @param basePath The base path for API calls.\n * @param userId The user ID for retrieving passenger data.\n * @param accessToken access token needed for fetching user passengers.\n * @returns An object containing stored passengers, loading state, and error state.\n */\nexport const useStoredPassengers = (basePath, accessToken, userId) => {\n const {\n formatMessage\n } = useIntl();\n const isRN = platform !== 'web';\n const isUserSignedIn = userId !== undefined;\n const isLoadPassengersFromStorageAttempted = useRef(false);\n const [storedPassengers, setStoredPassengers] = useState();\n const [isLoadingStoredPassengers, setIsLoadingStoredPassengers] = useState(isUserSignedIn ? true : false);\n const [errorLoadingStoredPassengers, setErrorLoadingStoredPassengers] = useState(false);\n const [updatingStoredPassengers, setUpdatingStoredPassengers] = useState(false);\n\n /**\n * useEffect to fetch stored passengers and save it in Async storage for apps.\n */\n useEffect(() => {\n // load stored passengers.\n if (!isUserSignedIn) {\n return;\n }\n const initData = async () => {\n try {\n setUpdatingStoredPassengers(false);\n setIsLoadingStoredPassengers(true);\n const fetchedPassengers = await getPassengers(basePath, platform, accessToken);\n if (fetchedPassengers !== undefined && fetchedPassengers.length > 0) {\n const mappedPassengers = fetchedPassengers.map(({\n id,\n discountCards,\n dateOfBirth,\n firstName,\n lastName\n }) => mapStoredPassengerToSearchPassenger({\n id,\n discountCards,\n dateOfBirth,\n firstName,\n lastName\n }));\n if (isRN) {\n passengerStorage.set(userId, fetchedPassengers);\n }\n setStoredPassengers(mappedPassengers);\n }\n } catch (err) {\n setErrorLoadingStoredPassengers(true);\n } finally {\n setIsLoadingStoredPassengers(false);\n }\n };\n initData();\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const onStoredPassengerUpdate = async passenger => {\n if (storedPassengers === undefined) return;\n try {\n setUpdatingStoredPassengers(true);\n // update stored passengers in local state.\n const updatedPassengers = storedPassengers.map(p => p.id === passenger.id ? passenger : p);\n setStoredPassengers(updatedPassengers);\n\n // update stored passengers in backend.\n await updatePassenger(passenger, basePath, accessToken);\n } catch (err) {\n throw new Error('Update unsuccessful');\n }\n };\n\n /**\n * Function to retrieve stored passengers from storage.\n */\n const getStoredPassengersFromStorage = async () => {\n if (!userId) {\n return;\n }\n const storedPassengersFromStorage = await passengerStorage.get(userId);\n if (storedPassengersFromStorage && storedPassengersFromStorage?.length > 0) {\n const mappedStoredPassengers = storedPassengersFromStorage.map(({\n id,\n discountCards,\n dateOfBirth,\n firstName,\n lastName\n }) => mapStoredPassengerToSearchPassenger({\n id,\n discountCards: discountCards,\n dateOfBirth,\n firstName,\n lastName\n }));\n setStoredPassengers(mappedStoredPassengers);\n logInfo({\n short_message: 'Fetch stored passengers: Fetched from storage.'\n });\n } else {\n // show error toast for apps.\n showToast({\n message: formatMessage({\n id: 'pcc.stored_passengers_fetch_error'\n }),\n type: 'error'\n });\n }\n setErrorLoadingStoredPassengers(false);\n };\n\n /**\n * Effect to handle fetching stored passengers from storage when API call fails.\n */\n useEffect(() => {\n if (errorLoadingStoredPassengers && !isLoadPassengersFromStorageAttempted.current) {\n if (isRN) {\n logInfo({\n short_message: 'Fetch stored passengers: API call failed, attempting storage fallback.'\n });\n getStoredPassengersFromStorage();\n isLoadPassengersFromStorageAttempted.current = true;\n } else {\n // show error toast for web.\n showToast({\n message: formatMessage({\n id: 'pcc.stored_passengers_fetch_error'\n }),\n type: 'error'\n });\n setErrorLoadingStoredPassengers(false);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [errorLoadingStoredPassengers]);\n return {\n isLoadingStoredPassengers: isLoadingStoredPassengers || errorLoadingStoredPassengers,\n storedPassengers,\n onStoredPassengerUpdate,\n updatingStoredPassengers\n };\n};","export const mapDiscountCardsDefinitions = (cardsDefintions, locale = 'en') => {\n const updatedLocale = locale.replace('-', '_');\n return cardsDefintions.map(cardDefinition => ({\n cards: cardDefinition.cards.map(card => ({\n id: card.id,\n description: card.descriptions[updatedLocale],\n providerId: cardDefinition.serviceProvider,\n providerName: cardDefinition.groupNames[updatedLocale] || ''\n })),\n groupName: cardDefinition.groupNames[updatedLocale] || '',\n infoUrl: cardDefinition.infoUrl || '',\n logoUrl: cardDefinition.logoUrl || '',\n multipleSelection: cardDefinition.multipleSelection || false,\n serviceProvider: cardDefinition.serviceProvider,\n toolTip: cardDefinition.toolTips[updatedLocale] || ''\n }));\n};\nexport const mapPassengerDiscountCards = discountCards => {\n return discountCards.map(card => ({\n code: card.id,\n provider: card.providerId\n }));\n};","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useIntl } from \"react-intl\";\nimport { appStorage, discountCardDefinitionStorage } from \"../../../../frontend-storages/src/index\";\nimport { useTracking } from \"../../../../tracking-provider/src/tracking/TrackingProvider\";\nimport { storedPassengerSelectionPassengerDeselect as storedPassengerSelectionPassengerDeselectEvent, storedPassengerSelectionPassengerSelect as storedPassengerSelectionPassengerSelectEvent, pccAddMorePassengersButtonClicked as pccAddMorePassengersButtonClickedEvent, pccDiscountCardsToggleClicked as pccDiscountCardsToggleClickedEvent } from \"../../../../tracking-provider/src/cms/lib/events/passenger-config-components/index\";\nimport { useDefaultRouteContext } from \"../../../../stores/DefaultRouteContextProvider/index\";\nimport { showToast } from \"../../../../frontend-components/src/Toast/index\";\nimport { platform } from \"../../platform/platform\";\nimport { mapDiscountCardsDefinitions } from \"../../shared/mapDiscountCards\";\nimport { mapPassengersDiscountCards } from \"../../shared/mapPassengerDetails\";\nimport { ageRanges, MAX_PASSENGERS } from \"../../config/passengersConfig\";\nimport { getDiscountCardDefinitions } from \"../../shared/services/discountCards-service\";\nimport { useStoredPassengers } from \"./useStoredPassengers\";\n\n/**\n * Custom hook for managing passenger configuration data.\n * @param userId The user ID for retrieving passenger data.\n * @param locale app locale.\n * @param onPassengersSelectionUpdate function to send updates in selected passengers to parent.\n * @param initialSelectedPassengers initial selected passengers list.\n * @returns An object containing stored passengers, loading state and manipluation function for selected passengers lists.\n */\nconst usePassengerConfig = (locale, onPassengersSelectionUpdate, initialSelectedPassengers, userId) => {\n const {\n formatMessage\n } = useIntl();\n const isUserSignedIn = userId !== undefined;\n const isRN = platform !== 'web';\n const initialPassengersRef = useRef(initialSelectedPassengers);\n const initialPassengers = initialPassengersRef.current;\n const {\n basePath,\n accessToken\n } = useDefaultRouteContext();\n const [isMaxPassengers, setIsMaxPassengers] = useState(false);\n const [selectedAnonymousPassengers, setSelectedAnonymousPassengers] = useState(initialPassengers);\n const [selectedStoredPassengers, setSelectedStoredPassengers] = useState([]);\n const [isAnonymousPassengerListVisible, setIsAnonymousPassengerListVisible] = useState(false);\n const [isDiscountCardToggled, setIsDiscountCardToggled] = useState(false);\n const [invalidAges, setInvalidAges] = useState([]);\n const [loadingDiscountCards, setLoadingDiscountCards] = useState(false);\n const {\n isLoadingStoredPassengers,\n onStoredPassengerUpdate,\n storedPassengers: storedPassengersFromServer,\n updatingStoredPassengers\n } = useStoredPassengers(basePath || '', accessToken || '', userId);\n const [storedPassengers, setStoredPassengers] = useState(storedPassengersFromServer);\n const isStoredPassengersListVisible = isUserSignedIn && (storedPassengers || []).length > 0;\n const [discountCardGroups, setDiscountCardGroups] = useState();\n const trackDeselectStoredPassenger = useTracking(storedPassengerSelectionPassengerDeselectEvent);\n const trackSelectStoredPassenger = useTracking(storedPassengerSelectionPassengerSelectEvent);\n const trackAddMorePassengersClick = useTracking(pccAddMorePassengersButtonClickedEvent);\n const trackDiscountCardsToggle = useTracking(pccDiscountCardsToggleClickedEvent);\n useEffect(() => {\n setStoredPassengers(discountCardGroups ? mapPassengersDiscountCards(storedPassengersFromServer, discountCardGroups) : storedPassengersFromServer);\n }, [storedPassengersFromServer, discountCardGroups]);\n const onAddMorePassengersButtonClicked = useCallback(() => {\n setIsAnonymousPassengerListVisible(true);\n trackAddMorePassengersClick({});\n }, [trackAddMorePassengersClick]);\n const checkAndPatchMaxPassengersExceeded = useCallback(() => {\n const isMaxPassengersReached = selectedAnonymousPassengers.length + selectedStoredPassengers.length === MAX_PASSENGERS;\n setIsMaxPassengers(isMaxPassengersReached);\n return isMaxPassengersReached;\n }, [selectedAnonymousPassengers, selectedStoredPassengers]);\n useEffect(() => {\n // If max passengers is exceeded, and a passenger is removed, reset the max passengers state.\n if (isMaxPassengers) {\n checkAndPatchMaxPassengersExceeded();\n }\n }, [isMaxPassengers, checkAndPatchMaxPassengersExceeded]);\n const fetchDiscountCardDefinitions = useCallback(async () => {\n try {\n const discountCardDefinitions = await getDiscountCardDefinitions(basePath);\n discountCardDefinitionStorage.set(discountCardDefinitions);\n return discountCardDefinitions;\n } catch (error) {\n if (isRN) {\n const storedDefinitions = await discountCardDefinitionStorage.get();\n if (!storedDefinitions) {\n throw new Error('Failed to fetch discount cards definitions');\n }\n return storedDefinitions;\n }\n // Throw error for web\n throw new Error('Failed to fetch discount cards definitions');\n }\n }, [basePath, isRN]);\n const getDiscountCardGroups = useCallback(async () => {\n setLoadingDiscountCards(true);\n const discountCardDefinitions = await fetchDiscountCardDefinitions();\n setLoadingDiscountCards(false);\n const mappedDiscountCardGroups = mapDiscountCardsDefinitions(discountCardDefinitions || [], locale);\n if (mappedDiscountCardGroups.length > 0) setDiscountCardGroups(mappedDiscountCardGroups);\n }, [fetchDiscountCardDefinitions, locale]);\n useEffect(() => {\n if (discountCardGroups === undefined) return;\n const updatedStoredPassengersDiscountCards = mapPassengersDiscountCards(storedPassengers, discountCardGroups);\n const updatedAnonymousPassengersDiscountCards = mapPassengersDiscountCards(selectedAnonymousPassengers, discountCardGroups);\n setStoredPassengers(updatedStoredPassengersDiscountCards);\n setSelectedAnonymousPassengers(updatedAnonymousPassengersDiscountCards);\n // Only run this effect when discount cards groups change (refetched from the server) to update stored passengers discount cards.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [discountCardGroups, isDiscountCardToggled]);\n const onDiscountCardToggled = async setToggleCallback => {\n try {\n // fetch discount cards groups\n if (discountCardGroups === undefined) await getDiscountCardGroups();\n if (typeof setToggleCallback === 'function') setToggleCallback(!isDiscountCardToggled);\n setIsDiscountCardToggled(!isDiscountCardToggled);\n trackDiscountCardsToggle({\n toggled: !isDiscountCardToggled\n });\n const appState = await appStorage.get();\n appStorage.set({\n ...appState,\n discountCardsEnabled: !isDiscountCardToggled\n });\n } catch (err) {\n // for native toggle callback\n if (typeof setToggleCallback === 'function') setToggleCallback(false);\n setIsDiscountCardToggled(false);\n showToast({\n message: formatMessage({\n id: 'pcc.disocunt_cards_fetch_error'\n }),\n type: 'error'\n });\n }\n };\n useEffect(() => {\n appStorage.get().then(async state => {\n if (!state) return;\n const discountCardsEnabled = state.discountCardsEnabled || initialPassengers.some(p => p.selectedDiscountCards.length > 0);\n if (discountCardsEnabled && discountCardGroups === undefined) await getDiscountCardGroups();\n setIsDiscountCardToggled(discountCardsEnabled);\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n const selectedStoredPassengersInfo = selectedStoredPassengers.map(id => (storedPassengers || []).find(p => p.id === id)).filter(p => p !== undefined);\n const isValidPassenger = passenger => !!storedPassengersFromServer && storedPassengersFromServer.some(p => p.id === passenger.passengerId);\n const performAutoMainPassengerSelectionLogic = async (initialSelectedAnonymousPassengers, initialSelectedStoredPassengers) => {\n const isAutoSelectMainPassengerPossible = isStoredPassengersListVisible && !initialSelectedStoredPassengers.length && storedPassengers?.length && initialSelectedPassengers.length;\n const appState = await appStorage.get();\n const isUserVisitedPassengerConfigPageBefore = appState?.userVisitedPassengerConfig;\n if (isAutoSelectMainPassengerPossible && !isUserVisitedPassengerConfigPageBefore) {\n const [mainPassenger] = storedPassengers;\n const matchingAnonPassengerIndex = initialSelectedAnonymousPassengers.findIndex(({\n type,\n selectedDiscountCards: discountCards\n }) => type === mainPassenger.type && !discountCards.length);\n if (matchingAnonPassengerIndex > -1) {\n // anonymousPassengers Mutation\n initialSelectedAnonymousPassengers.splice(matchingAnonPassengerIndex, 1);\n initialSelectedStoredPassengers.push(mainPassenger.id);\n }\n }\n await appStorage.set({\n ...appState,\n userVisitedPassengerConfig: true\n });\n };\n\n // initialize selected passengers list.\n useEffect(() => {\n // if stored passengers data got updated ( ex. Discount cards update),\n // don't initialize selected passengers again.\n // Also, don't initialize selected passengers if stored passengers are still loading.\n if (isLoadingStoredPassengers === true || updatingStoredPassengers) {\n return;\n }\n const initialSelectedAnonymousPassengers = [];\n const initialSelectedStoredPassengers = [];\n const initialInvalidAges = [];\n if (initialPassengers.length > 0) {\n initialPassengers.forEach(passenger => {\n if (isValidPassenger(passenger)) {\n // add to selected stored passengers\n initialSelectedStoredPassengers.push(passenger.passengerId);\n } else {\n // add to selected anonymous passengers\n const currentAnonymousPassengers = initialSelectedAnonymousPassengers.filter(p => p.type === passenger.type);\n const passengerId = `${passenger.type}-${currentAnonymousPassengers.length + 1}`;\n initialSelectedAnonymousPassengers.push({\n ...passenger,\n id: passengerId\n });\n // check if anonymous passenger has a valid age\n if (passenger.type !== 'adult' && passenger.age === undefined) initialInvalidAges.push(passengerId);\n setIsAnonymousPassengerListVisible(true);\n }\n });\n }\n performAutoMainPassengerSelectionLogic(initialSelectedAnonymousPassengers, initialSelectedStoredPassengers);\n setSelectedAnonymousPassengers(initialSelectedAnonymousPassengers);\n setSelectedStoredPassengers(initialSelectedStoredPassengers);\n setInvalidAges(initialInvalidAges);\n // Only run this effect when storedPassengersFromServer or initialSelectedPassengers change to initialize selected passengers.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isLoadingStoredPassengers, storedPassengersFromServer, initialPassengers]);\n const checkPassengersSelectionValidity = useCallback(passengers => {\n if (invalidAges.length > 0) return false;\n const inValidPassengers = passengers.filter(p => p.type !== 'adult' && p.age === undefined).map(p => p.id);\n if (inValidPassengers.length) {\n setInvalidAges(inValidPassengers);\n return false;\n }\n if (passengers.length === 0 || passengers.length > MAX_PASSENGERS) return false;\n return true;\n }, [invalidAges]);\n\n // update parent component with selected passengers whenever a change happens to selected anonymous or stored passengers.\n useEffect(() => {\n // don't update parent component while stored passengers or discount cards are still loading. ( usually happens on first load )\n if (isLoadingStoredPassengers || loadingDiscountCards) return;\n\n // don't include passengers discount cards if toggle is off.\n const updatedSelectedStoredPassengers = selectedStoredPassengersInfo.map(p => ({\n ...p,\n passengerId: p.id,\n selectedDiscountCards: isDiscountCardToggled ? p.selectedDiscountCards : []\n }));\n const updatedSelectedAnonymousPassengers = selectedAnonymousPassengers.map(p => ({\n ...p,\n selectedDiscountCards: isDiscountCardToggled ? p.selectedDiscountCards : []\n }));\n onPassengersSelectionUpdate([...updatedSelectedStoredPassengers, ...updatedSelectedAnonymousPassengers]);\n // Only run this effect when a passenger selection change happen or discount card toggle state change to update parent component.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedAnonymousPassengers, selectedStoredPassengers, isDiscountCardToggled, storedPassengers]);\n const onAnonymousPassengerAdd = useCallback(passengerType => {\n if (checkAndPatchMaxPassengersExceeded()) return;\n const age = passengerType === 'adult' ? ageRanges[passengerType].start : undefined;\n const currentAnonymousPassengers = selectedAnonymousPassengers.filter(p => p.type === passengerType);\n const passenger = {\n id: `${passengerType}-${currentAnonymousPassengers.length + 1}`,\n firstName: '',\n lastName: '',\n type: passengerType,\n age,\n selectedDiscountCards: []\n };\n setSelectedAnonymousPassengers([...selectedAnonymousPassengers, passenger]);\n }, [selectedAnonymousPassengers, checkAndPatchMaxPassengersExceeded]);\n const onAnonymousPassengerRemove = useCallback(passengerType => {\n const lastPassengerOfType = selectedAnonymousPassengers.slice().reverse().find(p => p.type === passengerType);\n if (lastPassengerOfType) {\n setSelectedAnonymousPassengers(selectedAnonymousPassengers.filter(p => p.id !== lastPassengerOfType.id));\n if (invalidAges.includes(lastPassengerOfType.id)) setInvalidAges(invalidAges.filter(id => id !== lastPassengerOfType.id));\n }\n }, [selectedAnonymousPassengers, invalidAges]);\n const onAnonymousPassengerUpdate = useCallback(passenger => {\n const updatedPassengers = selectedAnonymousPassengers.map(p => p.id === passenger.id ? passenger : p) || [];\n setSelectedAnonymousPassengers(updatedPassengers);\n if (passenger.type !== 'adult') {\n if (passenger.age === undefined && !invalidAges.includes(passenger.id)) {\n setInvalidAges([...invalidAges, passenger.id]);\n } else if (passenger.age !== undefined && invalidAges.includes(passenger.id)) {\n setInvalidAges(invalidAges.filter(id => id !== passenger.id));\n }\n }\n }, [selectedAnonymousPassengers, invalidAges]);\n const onStoredPassengerSelected = passengerId => {\n const isPassengerSelected = selectedStoredPassengers.some(id => {\n return id === passengerId;\n });\n const passengerIndex = storedPassengers?.findIndex(p => p.id === passengerId);\n if (isPassengerSelected) {\n setSelectedStoredPassengers(selectedStoredPassengers.filter(id => id !== passengerId));\n\n // track deselection\n trackDeselectStoredPassenger({\n index: String(passengerIndex)\n });\n } else {\n if (checkAndPatchMaxPassengersExceeded()) return;\n setSelectedStoredPassengers([...selectedStoredPassengers, passengerId]);\n\n // track selection\n trackSelectStoredPassenger({\n index: String(passengerIndex)\n });\n }\n };\n return {\n storedPassengers,\n isLoadingStoredPassengers,\n selectedAnonymousPassengers,\n selectedStoredPassengers,\n onAnonymousPassengerAdd,\n onAnonymousPassengerRemove,\n onAnonymousPassengerUpdate,\n onDiscountCardToggled,\n isDiscountCardToggled,\n isStoredPassengersListVisible,\n isAnonymousPassengerListVisible,\n discountCardGroups,\n invalidAges,\n onStoredPassengerUpdate,\n onStoredPassengerSelected,\n onAddMorePassengersButtonClicked,\n isMaxPassengers,\n selectedStoredPassengersInfo,\n checkPassengersSelectionValidity\n };\n};\nexport default usePassengerConfig;","import axios from \"../../../../fe-utils/src/axios/index\";\nimport { DEFINITIONS_ENDPOINT } from \"../../config/discountCardsConfig\";\nexport const getDiscountCardDefinitions = async (basePath = '') => {\n const url = `${basePath}/${DEFINITIONS_ENDPOINT}`;\n try {\n const definitionsPromise = await axios.get(url);\n const cardsDefinitions = definitionsPromise.data;\n return cardsDefinitions;\n } catch (error) {\n throw new Error('Failed to fetch discount cards definitions');\n }\n};","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nexport const ButtonWrapperShared = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-14i50ma-0\"\n})([\"position:absolute;bottom:0;width:100%;padding:16px;background:#fff;\", \";elevation:4;shadow-offset:{width:0px;height:2px;}shadow-radius:5px;shadow-opacity:0.2;shadow-color:\", \";\"], theme.shadows.footer, theme.colors.palette.deepBlue[500]);\nexport const Container = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-14i50ma-1\"\n})([\"background-color:\", \";flex:1;\"], theme.colors.white);","import styled from \"styled-components\";\nimport Box from \"../../../../frontend-components/src/Box/index\";\nimport theme from \"../../../../frontend-components/src/style-values/index\";\nimport { ButtonWrapperShared, Container } from \"./PassengerConfigComponent.styles.shared\";\nexport { ButtonWrapperShared as ButtonWrapper, Container };\nconst MODAL_FOOTER_HEIGHT = 80;\nconst MODAL_HEADER_HEIGHT = 57;\nexport const MobileOnly = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-e87ybk-0\"\n})([\"display:block;\", \"{\", \"}\"], theme.mediaQueries.tabletAndLarger, ({\n viewRenderedInModal\n}) => !viewRenderedInModal && 'display: none;');\nexport const PassengerConfigWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-e87ybk-1\"\n})([\"overflow-y:auto;flex:1;\"]);\nexport const PassengerConfigContainer = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-e87ybk-2\"\n})([\"padding-top:\", \"px;padding-bottom:\", \"px;overflow-y:auto;\", \"{\", \"}\"], MODAL_HEADER_HEIGHT, MODAL_FOOTER_HEIGHT, theme.mediaQueries.tabletAndLarger, ({\n viewRenderedInModal\n}) => !viewRenderedInModal && `\n height: auto;\n padding-top: 0;\n padding-bottom: 0;\n `);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { useCallback, useEffect } from \"react\";\nimport { FormattedMessage } from \"react-intl\";\nimport { SelectPassengerButton } from \"../../components/SelectPassengerButton/SelectPassengerButton\";\nimport { Header } from \"../../components/Header/Header\";\nimport PassengerConfig from \"../PassengerConfig\";\nimport { isDesktopScreenWidth, isTabletScreenWidth } from \"../../platform/platform\";\nimport usePassengerConfig from \"../PassengerConfig/usePassengerConfig\";\nimport { ButtonWrapper, Container, PassengerConfigContainer, MobileOnly } from \"./PassengerConfigComponent.styles\";\nconst PassengerConfigComponent = props => {\n const {\n initialPassengers,\n onUpdatePassengers,\n allowMultipleDBDiscountCards,\n locale,\n userId,\n onDiscountCardsModalClose,\n onDiscountCardsModalOpen,\n forceValidation,\n viewRenderedInModal = false\n } = props;\n const [updatedPassengers, setUpdatedPassengers] = React.useState([]);\n const onClose = () => {\n const shouldSkipPassengersUpdating = !checkPassengersSelectionValidity(updatedPassengers);\n onUpdatePassengers(updatedPassengers, shouldSkipPassengersUpdating);\n };\n const onPassengersSelectionUpdate = useCallback(passengers => {\n setUpdatedPassengers(passengers);\n // Update the passengers immediately with every change if\n // the screen width is Desktop or Tablet and component is not rendered in a modal.\n if ((isDesktopScreenWidth() || isTabletScreenWidth()) && !viewRenderedInModal) {\n onUpdatePassengers(passengers);\n }\n }, [onUpdatePassengers]);\n const {\n checkPassengersSelectionValidity,\n ...passengerConfigProps\n } = usePassengerConfig(locale, onPassengersSelectionUpdate, initialPassengers, userId);\n useEffect(() => {\n if (forceValidation) {\n checkPassengersSelectionValidity(updatedPassengers);\n }\n // This effect to be called only when parent component\n // needs to rerun/force validation of current selected passengers list.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [forceValidation]);\n const onFinish = () => {\n if (checkPassengersSelectionValidity(updatedPassengers)) {\n onUpdatePassengers(updatedPassengers);\n }\n };\n return /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(MobileOnly, {\n viewRenderedInModal: viewRenderedInModal\n }, /*#__PURE__*/React.createElement(Header, {\n onClose: onClose\n }, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: \"searchbar.passengers_label\"\n }))), /*#__PURE__*/React.createElement(PassengerConfigContainer, {\n viewRenderedInModal: viewRenderedInModal\n }, /*#__PURE__*/React.createElement(PassengerConfig, _extends({}, passengerConfigProps, {\n allowMultipleDBDiscountCards: allowMultipleDBDiscountCards,\n onDiscountCardsModalClose: onDiscountCardsModalClose,\n onDiscountCardsModalOpen: onDiscountCardsModalOpen\n }))), /*#__PURE__*/React.createElement(MobileOnly, {\n viewRenderedInModal: viewRenderedInModal\n }, /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(SelectPassengerButton, {\n dataE2E: \"confirmPassengersBtn\",\n onClick: onFinish,\n passengers: updatedPassengers\n }))));\n};\nexport default PassengerConfigComponent;","import PassengerConfigComponent from \"./PassengerConfigComponent\";\nexport default PassengerConfigComponent;","import React from \"react\";\nimport { useAuth } from \"../../../../auth-provider/src/components/AuthProvider/index\";\nimport PassengerConfigComponent from \"../../../../passenger-config-components/src/screens/PassengerConfigComponent/index\";\nconst PassengerConfig = props => {\n const {\n initialPassengers,\n onUpdatePassengers,\n locale,\n onDiscountCardsModalClose,\n onDiscountCardsModalOpen,\n forceValidation,\n viewRenderedInModal\n } = props;\n const {\n userDetails\n } = useAuth();\n return /*#__PURE__*/React.createElement(PassengerConfigComponent, {\n userId: userDetails?.userId,\n onUpdatePassengers: onUpdatePassengers,\n initialPassengers: initialPassengers,\n locale: locale,\n allowMultipleDBDiscountCards: true,\n onDiscountCardsModalClose: onDiscountCardsModalClose,\n onDiscountCardsModalOpen: onDiscountCardsModalOpen,\n forceValidation: forceValidation,\n viewRenderedInModal: viewRenderedInModal\n });\n};\nexport default PassengerConfig;","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { connect } from \"react-redux\";\nimport { mapSearchPassengersToFerretPassengers } from \"../../utils/passengersMapper\";\nimport { pccPassengersSelector, updatePassengers } from \"../../ducks/passengers.duck\";\nimport injectInstanceId from \"../injectInstanceId\";\nimport { setUIProperty } from \"../../ducks/ui.duck\";\nimport { passengerUI as reduxUiId } from \"../../ducks/ui.constants\";\nimport PassengerConfig from \"./PassengerConfig\";\nconst mapStateToProps = (state, props) => {\n const passengers = pccPassengersSelector(state, props);\n return {\n initialPassengers: passengers\n };\n};\nconst mapDispatchToProps = (dispatch, {\n instanceId\n}) => ({\n disableAgeErrorVisibility: () => dispatch(setUIProperty(instanceId)({\n reduxUiId,\n propertyName: 'ageErrorVisibility',\n value: false\n })),\n updatePassengers: passengers => dispatch(updatePassengers(instanceId)(passengers))\n});\nconst mergeProps = (stateProps, dispatchProps, ownProps) => {\n const {\n onUpdatePassengers: onUpdatePassengersOverride\n } = ownProps;\n const {\n disableAgeErrorVisibility,\n updatePassengers\n } = dispatchProps;\n const onUpdatePassengers = (passengers, shouldSkipPassengersUpdating) => {\n // for mobile web, if modal was closed, we don't update state\n if (shouldSkipPassengersUpdating) {\n onUpdatePassengersOverride?.();\n return;\n }\n updatePassengers(mapSearchPassengersToFerretPassengers(passengers));\n disableAgeErrorVisibility();\n onUpdatePassengersOverride?.();\n };\n const finalProps = {\n ...stateProps,\n ...ownProps,\n onUpdatePassengers\n };\n return finalProps;\n};\nexport default injectInstanceId()(connect(mapStateToProps, mapDispatchToProps, mergeProps)(PassengerConfig));","import PassengerConfig from \"./PassengerConfig.connector\";\nexport default PassengerConfig;","/* eslint-disable no-plusplus, no-bitwise */\nexport default function (s) {\n let hash = 0;\n if (!s || s.length === 0) {\n return hash;\n }\n for (let i = 0; i < s.length; i++) {\n const char = s.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash &= hash; // Convert to 32bit integer\n }\n\n return hash;\n}","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../../../postcss-loader/dist/cjs.js!../../../../../../../sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./CalendarDay.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../../../postcss-loader/dist/cjs.js!../../../../../../../sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./CalendarDay.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classNames from \"classnames/bind\";\nimport isSameDay from \"date-fns/is_same_day\";\nimport calendar from \"./Calendar.scss\";\nimport style from \"./CalendarDay.scss\";\nimport { isBrowser } from \"../../utils/isBrowser\";\nconst styles = {\n ...calendar,\n ...style\n};\nconst cx = classNames.bind(styles);\nconst CalendarDay = ({\n date,\n isUnavailable,\n isSelected,\n isFirstSelectedDate,\n isLastSelectedDate,\n isRoundTrip,\n isFirstCalendarRowDay,\n isLastCalendarRowDay,\n lastSelectedDate,\n firstSelectedDate,\n setDate,\n isWeekend,\n formattedPriceString,\n isCheap,\n showPriceData,\n pricesLoading\n}) => {\n // This is a work around to prevent calendar rendering on the server which was preventing css updated on client side\n if (!isBrowser()) {\n return null;\n }\n const day = date && date.getDate() || '';\n const isActive = isFirstSelectedDate || isLastSelectedDate;\n const sameDay = isSameDay(lastSelectedDate, firstSelectedDate);\n const classStates = {\n unavailableDay: isUnavailable,\n isWithinSelectionRange: isSelected && isRoundTrip,\n activeDay: isActive,\n firstSelectedDay: isFirstSelectedDate,\n lastSelectedDay: isLastSelectedDate,\n firstCalendarRowDay: isFirstCalendarRowDay,\n lastCalendarRowDay: isLastCalendarRowDay,\n hasPrice: showPriceData && !isUnavailable,\n sameDay,\n isCheap,\n isPriceLoading: pricesLoading\n };\n let dataCy;\n if (isFirstSelectedDate) {\n dataCy = 'firstSelectedDay';\n }\n if (isLastSelectedDate) {\n dataCy = 'lastSelectedDay';\n }\n return /*#__PURE__*/React.createElement(\"li\", {\n className: cx('calendarDay', {\n isUnavailable,\n ...classStates,\n weekend: isWeekend\n }),\n onClick: () => setDate(date),\n date: date,\n \"data-e2e\": \"calendarDay\",\n \"data-cy\": dataCy,\n \"data-disabled-cy\": isUnavailable && 'isUnavailable'\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: cx('selectedRange', {\n ...classStates\n })\n }), /*#__PURE__*/React.createElement(\"div\", {\n className: cx('dayLabel', {\n ...classStates\n })\n }, /*#__PURE__*/React.createElement(\"span\", null, day), /*#__PURE__*/React.createElement(\"span\", {\n className: cx('dayPrice', {\n ...classStates\n })\n }, formattedPriceString)));\n};\nCalendarDay.displayName = 'CalendarDay';\nCalendarDay.propTypes = {\n date: PropTypes.instanceOf(Date),\n isUnavailable: PropTypes.bool,\n isSelected: PropTypes.bool,\n isFirstSelectedDate: PropTypes.bool,\n isLastSelectedDate: PropTypes.bool,\n isRoundTrip: PropTypes.bool,\n isFirstCalendarRowDay: PropTypes.bool,\n isLastCalendarRowDay: PropTypes.bool,\n lastSelectedDate: PropTypes.instanceOf(Date),\n firstSelectedDate: PropTypes.instanceOf(Date),\n setDate: PropTypes.func,\n isWeekend: PropTypes.bool\n};\nexport default CalendarDay;","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport classNames from \"classnames/bind\";\nimport format from \"date-fns/format\";\nimport isSameDay from \"date-fns/is_same_day\";\nimport isBefore from \"date-fns/is_before\";\nimport isWithinRange from \"date-fns/is_within_range\";\nimport isFirstDayOfMonth from \"date-fns/is_first_day_of_month\";\nimport isLastDayOfMonth from \"date-fns/is_last_day_of_month\";\nimport { searchCalendarDateWithPriceClick } from \"../../../../tracking-provider/src/cms/lib/events/ferret/index\";\nimport { useTracking } from \"../../../../tracking-provider/src/tracking/TrackingProvider\";\nimport hash from \"../../utils/hash\";\nimport { today } from \"../../utils/calendar.utils\";\nimport CalendarDay from \"./CalendarDay\";\nimport calendar from \"./Calendar.scss\";\nconst styles = {\n ...calendar\n};\nconst cx = classNames.bind(styles);\nconst getDateRange = (date, first, last) => !last ? false : isSameDay(date, first) || isWithinRange(date, first, last);\nconst CalendarWeek = ({\n setDate,\n availableFrom,\n weeks,\n firstSelectedDate,\n lastSelectedDate,\n weekendDays,\n date,\n priceData,\n pricesLoading\n}) => {\n const trackDateWithPriceClick = useTracking(searchCalendarDateWithPriceClick);\n return weeks.map((week, weekIndex) => {\n return /*#__PURE__*/React.createElement(\"ul\", {\n className: cx('calendarRow'),\n \"data-e2e\": \"calendarWeek\",\n key: hash(`${weekIndex}-${date}`)\n }, week.map((weekDate, weekDateIndex) => {\n const isRoundTrip = !!firstSelectedDate && !!lastSelectedDate;\n const isSameDayRoundTrip = isRoundTrip && isSameDay(firstSelectedDate, lastSelectedDate);\n const isSelectedDay = getDateRange(weekDate, firstSelectedDate, lastSelectedDate) && !isSameDayRoundTrip;\n const priceDataDay = priceData?.[format(weekDate, 'YYYY-MM-DD')];\n const {\n priceInEuroCents,\n formattedPriceString,\n isCheap\n } = priceDataDay || {};\n return !weekDate ? /*#__PURE__*/React.createElement(\"li\", {\n className: styles.calendarDay,\n key: hash(`${weekDateIndex}-${date}`)\n }) : /*#__PURE__*/React.createElement(CalendarDay, {\n key: hash(`${weekDateIndex}-${date}`),\n date: weekDate,\n isUnavailable: isBefore(weekDate, today) && !isSameDay(weekDate, availableFrom),\n isSelected: isSelectedDay,\n isFirstSelectedDate: isSameDay(weekDate, firstSelectedDate),\n isLastSelectedDate: isSameDay(weekDate, lastSelectedDate),\n firstSelectedDate: firstSelectedDate,\n lastSelectedDate: lastSelectedDate,\n isRoundTrip: isRoundTrip,\n isFirstCalendarRowDay: weekDateIndex === 0 || isFirstDayOfMonth(weekDate),\n isLastCalendarRowDay: weekDateIndex === week.length - 1 || isLastDayOfMonth(weekDate),\n setDate: date => {\n if (priceDataDay) {\n trackDateWithPriceClick({\n cheap: isCheap,\n priceInEuroCents: priceInEuroCents || 0,\n unavailable: priceInEuroCents === 0\n });\n }\n setDate(date);\n },\n isWeekend: weekendDays?.indexOf(weekDateIndex) > -1,\n showPriceData: !!priceDataDay,\n formattedPriceString: formattedPriceString,\n isCheap: isCheap,\n pricesLoading: pricesLoading\n });\n }));\n });\n};\nCalendarWeek.displayName = 'CalendarWeek';\nCalendarWeek.propTypes = {\n setDate: PropTypes.func,\n date: PropTypes.instanceOf(Date),\n availableFrom: PropTypes.instanceOf(Date),\n weeks: PropTypes.arrayOf(PropTypes.arrayOf(PropTypes.instanceOf(Date))),\n firstSelectedDate: PropTypes.instanceOf(Date),\n lastSelectedDate: PropTypes.instanceOf(Date),\n weekendDays: PropTypes.arrayOf(PropTypes.number)\n};\nexport default CalendarWeek;","import React, { useEffect } from \"react\";\nimport { format } from \"date-fns\";\nimport { getCalendarForDate, getWeekdayLabelsByDomain } from \"../../utils/calendar.utils\";\nimport CalendarWeekdays from \"./CalendarWeekdays\";\nimport CalendarWeek from \"./CalendarWeek\";\nconst Calendar = ({\n date,\n setDate,\n availableFrom,\n firstSelectedDate,\n lastSelectedDate,\n hasSundayToMondayCalendar,\n priceData,\n pricesLoading,\n hideWeekdays\n}) => {\n const weeks = getCalendarForDate(date, hasSundayToMondayCalendar);\n const weekdayLabels = getWeekdayLabelsByDomain(hasSundayToMondayCalendar);\n const weekendDays = hasSundayToMondayCalendar ? [0, 6] : [5, 6];\n return [!hideWeekdays ? /*#__PURE__*/React.createElement(CalendarWeekdays, {\n key: \"CalendarWeekdays\",\n weekdays: weekdayLabels\n }) : null, /*#__PURE__*/React.createElement(CalendarWeek, {\n key: \"CalendarWeek\",\n date: date,\n setDate: setDate,\n availableFrom: availableFrom,\n weeks: weeks,\n firstSelectedDate: firstSelectedDate,\n lastSelectedDate: lastSelectedDate,\n weekendDays: weekendDays,\n priceData: priceData,\n pricesLoading: pricesLoading\n })];\n};\nCalendar.displayName = 'Calendar';\nexport default Calendar;","\n import API from \"!../../../../../../../style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../../../../style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../../../../style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../../../../style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../../../../style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../../../../style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../../../../css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../../../postcss-loader/dist/cjs.js!../../../../../../../sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./CalendarWeekdays.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../../../../css-loader/dist/cjs.js??ruleSet[1].rules[5].use[1]!../../../../../../../postcss-loader/dist/cjs.js!../../../../../../../sass-loader/dist/cjs.js??ruleSet[1].rules[5].use[3]!./CalendarWeekdays.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FormattedMessage } from \"react-intl\";\nimport classNames from \"classnames/bind\";\nimport calendar from \"./Calendar.scss\";\nimport style from \"./CalendarWeekdays.scss\";\nconst styles = {\n ...calendar,\n ...style\n};\nconst cx = classNames.bind(styles);\nconst CalendarWeekdays = ({\n weekdays,\n isMobile\n}) => /*#__PURE__*/React.createElement(\"div\", {\n className: cx(isMobile && 'mobileContainer')\n}, /*#__PURE__*/React.createElement(\"ul\", {\n className: cx('calendarRow')\n}, weekdays.map(weekday => /*#__PURE__*/React.createElement(\"li\", {\n className: cx('weekday', {\n weekend: weekday === 0 || weekday === 6\n }),\n key: `day-${weekday}`\n}, /*#__PURE__*/React.createElement(FormattedMessage, {\n id: `searchbar.day${weekday}`,\n defaultMessage: \"\"\n})))));\nCalendarWeekdays.displayName = 'CalendarWeekdays';\nCalendarWeekdays.propTypes = {\n weekdays: PropTypes.arrayOf(PropTypes.number),\n isMobile: PropTypes.bool\n};\nexport default CalendarWeekdays;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nexport default (() => WrappedComponent => {\n const Wrapper = (props, context) => /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {\n instanceId: context.instanceId\n }));\n Wrapper.contextTypes = {\n instanceId: PropTypes.string.isRequired\n };\n return Wrapper;\n});","import _cloneRegExp from \"./_cloneRegExp.js\";\nimport type from \"../type.js\";\n/**\n * Copies an object.\n *\n * @private\n * @param {*} value The value to be copied\n * @param {Array} refFrom Array containing the source references\n * @param {Array} refTo Array containing the copied source references\n * @param {Boolean} deep Whether or not to perform deep cloning.\n * @return {*} The copied value.\n */\n\nexport default function _clone(value, refFrom, refTo, deep) {\n var copy = function copy(copiedValue) {\n var len = refFrom.length;\n var idx = 0;\n\n while (idx < len) {\n if (value === refFrom[idx]) {\n return refTo[idx];\n }\n\n idx += 1;\n }\n\n refFrom[idx + 1] = value;\n refTo[idx + 1] = copiedValue;\n\n for (var key in value) {\n copiedValue[key] = deep ? _clone(value[key], refFrom, refTo, true) : value[key];\n }\n\n return copiedValue;\n };\n\n switch (type(value)) {\n case 'Object':\n return copy({});\n\n case 'Array':\n return copy([]);\n\n case 'Date':\n return new Date(value.valueOf());\n\n case 'RegExp':\n return _cloneRegExp(value);\n\n default:\n return value;\n }\n}","export default function _cloneRegExp(pattern) {\n return new RegExp(pattern.source, (pattern.global ? 'g' : '') + (pattern.ignoreCase ? 'i' : '') + (pattern.multiline ? 'm' : '') + (pattern.sticky ? 'y' : '') + (pattern.unicode ? 'u' : ''));\n}","import _curryN from \"./_curryN.js\";\nimport _has from \"./_has.js\";\nimport _xfBase from \"./_xfBase.js\";\n\nvar XReduceBy =\n/*#__PURE__*/\nfunction () {\n function XReduceBy(valueFn, valueAcc, keyFn, xf) {\n this.valueFn = valueFn;\n this.valueAcc = valueAcc;\n this.keyFn = keyFn;\n this.xf = xf;\n this.inputs = {};\n }\n\n XReduceBy.prototype['@@transducer/init'] = _xfBase.init;\n\n XReduceBy.prototype['@@transducer/result'] = function (result) {\n var key;\n\n for (key in this.inputs) {\n if (_has(key, this.inputs)) {\n result = this.xf['@@transducer/step'](result, this.inputs[key]);\n\n if (result['@@transducer/reduced']) {\n result = result['@@transducer/value'];\n break;\n }\n }\n }\n\n this.inputs = null;\n return this.xf['@@transducer/result'](result);\n };\n\n XReduceBy.prototype['@@transducer/step'] = function (result, input) {\n var key = this.keyFn(input);\n this.inputs[key] = this.inputs[key] || [key, this.valueAcc];\n this.inputs[key][1] = this.valueFn(this.inputs[key][1], input);\n return result;\n };\n\n return XReduceBy;\n}();\n\nvar _xreduceBy =\n/*#__PURE__*/\n_curryN(4, [], function _xreduceBy(valueFn, valueAcc, keyFn, xf) {\n return new XReduceBy(valueFn, valueAcc, keyFn, xf);\n});\n\nexport default _xreduceBy;","import reduceBy from \"./reduceBy.js\";\n/**\n * Given a function that generates a key, turns a list of objects into an\n * object indexing the objects by the given key. Note that if multiple\n * objects generate the same value for the indexing key only the last value\n * will be included in the generated object.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category List\n * @sig (a -> String) -> [{k: v}] -> {k: {k: v}}\n * @param {Function} fn Function :: a -> String\n * @param {Array} array The array of objects to index\n * @return {Object} An object indexing each array element by the given property.\n * @example\n *\n * const list = [{id: 'xyz', title: 'A'}, {id: 'abc', title: 'B'}];\n * R.indexBy(R.prop('id'), list);\n * //=> {abc: {id: 'abc', title: 'B'}, xyz: {id: 'xyz', title: 'A'}}\n */\n\nvar indexBy =\n/*#__PURE__*/\nreduceBy(function (acc, elem) {\n return elem;\n}, null);\nexport default indexBy;","import _clone from \"./internal/_clone.js\";\nimport _curryN from \"./internal/_curryN.js\";\nimport _dispatchable from \"./internal/_dispatchable.js\";\nimport _has from \"./internal/_has.js\";\nimport _reduce from \"./internal/_reduce.js\";\nimport _xreduceBy from \"./internal/_xreduceBy.js\";\n/**\n * Groups the elements of the list according to the result of calling\n * the String-returning function `keyFn` on each element and reduces the elements\n * of each group to a single value via the reducer function `valueFn`.\n *\n * This function is basically a more general [`groupBy`](#groupBy) function.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category List\n * @sig ((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}\n * @param {Function} valueFn The function that reduces the elements of each group to a single\n * value. Receives two values, accumulator for a particular group and the current element.\n * @param {*} acc The (initial) accumulator value for each group.\n * @param {Function} keyFn The function that maps the list's element into a key.\n * @param {Array} list The array to group.\n * @return {Object} An object with the output of `keyFn` for keys, mapped to the output of\n * `valueFn` for elements which produced that key when passed to `keyFn`.\n * @see R.groupBy, R.reduce\n * @example\n *\n * const groupNames = (acc, {name}) => acc.concat(name)\n * const toGrade = ({score}) =>\n * score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A'\n *\n * var students = [\n * {name: 'Abby', score: 83},\n * {name: 'Bart', score: 62},\n * {name: 'Curt', score: 88},\n * {name: 'Dora', score: 92},\n * ]\n *\n * reduceBy(groupNames, [], toGrade, students)\n * //=> {\"A\": [\"Dora\"], \"B\": [\"Abby\", \"Curt\"], \"F\": [\"Bart\"]}\n */\n\nvar reduceBy =\n/*#__PURE__*/\n_curryN(4, [],\n/*#__PURE__*/\n_dispatchable([], _xreduceBy, function reduceBy(valueFn, valueAcc, keyFn, list) {\n return _reduce(function (acc, elt) {\n var key = keyFn(elt);\n acc[key] = valueFn(_has(key, acc) ? acc[key] : _clone(valueAcc, [], [], false), elt);\n return acc;\n }, {}, list);\n}));\n\nexport default reduceBy;","var safeIsNaN = Number.isNaN ||\n function ponyfill(value) {\n return typeof value === 'number' && value !== value;\n };\nfunction isEqual(first, second) {\n if (first === second) {\n return true;\n }\n if (safeIsNaN(first) && safeIsNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (var i = 0; i < newInputs.length; i++) {\n if (!isEqual(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction memoizeOne(resultFn, isEqual) {\n if (isEqual === void 0) { isEqual = areInputsEqual; }\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n function memoized() {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n }\n return memoized;\n}\n\nexport default memoizeOne;\n","import axios from \"axios\";\nimport * as R from \"ramda\";\nimport memoizeOne from \"memoize-one\";\nimport { positionsSelector } from \"./position.duck\";\nimport { searchOptionsSelector } from \"./searchOptions.duck\";\nimport { passengersObjectSelector } from \"./passengers.duck\";\nimport { createReducer, createThunk, createSelector, createActionCreator } from \"../utils/reduxHelpers\";\nimport { discountUI } from \"./ui.constants\";\nimport { REBATE_API_URL } from \"../../config\";\nimport { passengerTypes } from \"./passengers.constants\";\nimport { initialDiscountCardsState } from \"./discountCards.utils\";\n// Actions\nconst FETCHING_CARDS = 'ferret/discountCards/FETCHING_CARDS';\nconst FETCH_ERROR = 'ferret/discountCards/FETCH_ERROR';\nconst CARDS_FETCHED = 'ferret/discountCards/CARDS_FETCHED';\nconst CLEAR_CARDS = 'ferret/discountCards/CLEAR_CARDS';\nconst DISCOUNT_CARDS_TOGGLE = 'ferret/discountCards/DISCOUNT_CARDS_TOGGLE';\nconst DC_TOGGLE_AFTER_SEARCH = 'ferret/discountCards/DC_TOGGLE_AFTER_SEARCH';\n\n// Action Creators\nconst fetchingCards = createActionCreator(payload => ({\n type: FETCHING_CARDS,\n payload\n}));\nconst cardsFetched = createActionCreator(payload => ({\n type: CARDS_FETCHED,\n payload\n}));\nconst fetchError = createActionCreator(payload => ({\n type: FETCH_ERROR,\n payload\n}));\nexport const clearCards = createActionCreator(() => ({\n type: CLEAR_CARDS,\n payload: null\n}));\nexport const discountCardsToggled = createActionCreator(payload => ({\n type: DISCOUNT_CARDS_TOGGLE,\n payload\n}));\nexport const discountCardsToggledOnSearch = createActionCreator(() => ({\n type: DC_TOGGLE_AFTER_SEARCH\n}));\n\n// Selectors (scoped due to instanceId from redux connect)\nexport const getCardSelector = createSelector((state, props) => {\n const {\n discountCards\n } = state;\n return {\n ...props,\n discountCards,\n type: discountUI\n };\n});\nexport const passengerListSelector = state => {\n return Object.values(state.passengers).filter(type => type && type.ages && type.ages.length).flatMap(passenger => passenger.ages);\n};\nexport const discountCardToggleSelector = state => {\n const {\n discountCards\n } = state;\n return discountCards.discountCardsToggle;\n};\nconst serialiseDiscountCards = (discountCards = [], passengerIndex, serializedCardsMinified) => discountCards.map(({\n provider,\n code\n}) => serializedCardsMinified ? `${provider}:${code}` : `${passengerIndex}:${provider}:${code}`);\nexport const serializedDiscountCardsFromPassenger = (passengerList, serializedCardsMinified) => passengerList.reduce((flattenedCards, passenger, passengerIndex) => [...flattenedCards, ...serialiseDiscountCards(passenger.discountCards, passengerIndex, serializedCardsMinified)], []).reduce((acc, serialisedCard, i) => ({\n ...acc,\n [`discountcards[${i}]`]: serialisedCard\n}), {});\nexport const discountCardsPerPassengerSelector = (state, serializedCardsMinified) => {\n const passengerList = passengerListSelector(state);\n return serializedDiscountCardsFromPassenger(passengerList, serializedCardsMinified);\n};\nexport const makeCardId = (code, provider) => `${code}-${provider}`;\nexport const cardLookUpSelector = memoizeOne(discountCards => {\n const flatCards = discountCards.availableCards.flatMap(({\n serviceProvider,\n cards\n }) => cards.map(card => ({\n ...card,\n serviceProvider\n })));\n return R.indexBy(({\n id,\n serviceProvider\n }) => makeCardId(id, serviceProvider), flatCards);\n});\n// Discount Card Thunk Helpers\nconst selectedPosition = ({\n positionId,\n type\n}) => ({\n id: positionId,\n type\n});\nconst selectedUserInfo = ({\n currency,\n domain,\n userId,\n locale\n}) => ({\n currency,\n domain,\n identifier: userId,\n locale\n});\nconst selectedPassenger = passengers => {\n const allAges = R.pipe(R.map(({\n ages,\n type\n }) => ages.map(age => ({\n ...age,\n type\n }))), R.values, R.flatten)(passengers);\n const mapped = allAges.map(({\n value,\n type\n }) => {\n const age = value || passengerTypes[type].age.default;\n return {\n age,\n passengerAge: {\n age,\n max: passengerTypes[type].age.max,\n min: passengerTypes[type].age.min\n }\n };\n }).filter(({\n age\n }) => typeof age === 'number');\n return mapped;\n};\nconst getParams = (arr, dept, userInfo, passengers, departureDate) => {\n const params = {\n departurePosition: selectedPosition(dept),\n arrivalPosition: selectedPosition(arr),\n travelModes: ['train', 'flight', 'bus'],\n passengers,\n userInfo: selectedUserInfo(userInfo),\n departureDate\n };\n return params;\n};\nconst noDiscountCardIds = ['-', 'none'];\nconst filterDiscountCardList = cardsAvailable => cardsAvailable.map(discountCard => ({\n ...discountCard,\n cards: discountCard.cards.filter(card => noDiscountCardIds.indexOf(card.id) < 0)\n}));\n\n// Thunks\nexport const getDiscountCards = createThunk(() => (dispatch, getState, instanceId) => {\n const state = getState();\n const {\n arrival,\n departure\n } = positionsSelector(state);\n const passengers = passengersObjectSelector(state);\n const userInfo = searchOptionsSelector(state);\n const currentArrival = arrival.selectedSuggestion;\n const currentDeparture = departure.selectedSuggestion;\n const departureDate = state.departureDate && state.departureDate.date;\n const passengerArray = selectedPassenger(passengers);\n if (!currentArrival || !currentDeparture || !currentArrival.positionId || !currentDeparture.positionId || !passengerArray.length) {\n return false;\n }\n const params = getParams(currentArrival, currentDeparture, userInfo, passengerArray, departureDate);\n if (!params) {\n dispatch(fetchError(instanceId)(true));\n return null;\n }\n dispatch(fetchingCards(instanceId)(true));\n axios({\n method: 'post',\n url: REBATE_API_URL,\n data: params,\n config: {\n Accept: 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n }).then(response => response.data).then(items => {\n const groups = filterDiscountCardList(items.groups);\n dispatch(cardsFetched(instanceId)(groups));\n }).catch(() => dispatch(fetchError(instanceId)(true)));\n});\n\n// Reducer\nconst reducer = createReducer('discountCards', (state = initialDiscountCardsState, action) => {\n const {\n type,\n payload\n } = action;\n switch (type) {\n case CARDS_FETCHED:\n return {\n ...state,\n availableCards: payload\n };\n case FETCHING_CARDS:\n return {\n ...state,\n fetchingCards: payload\n };\n case FETCH_ERROR:\n return {\n ...state,\n fetchFailed: payload\n };\n case CLEAR_CARDS:\n return {\n ...state,\n availableCards: []\n };\n case DISCOUNT_CARDS_TOGGLE:\n return {\n ...state,\n discountCardsToggle: payload.discountCardsToggle\n };\n case DC_TOGGLE_AFTER_SEARCH:\n return {\n ...state,\n discountCardsToggleState: state.discountCardsToggle\n };\n default:\n return state;\n }\n});\nexport default reducer;","// initial state\nexport const initialDiscountCardsState = {\n availableCards: [],\n fetchingCards: false,\n fetchFailed: false,\n discountCardsToggle: false,\n discountCardsToggleState: false\n};","export const INCREMENT_PASSENGER = 'ferret/passengers/INCREMENT_PASSENGER';\nexport const DECREMENT_PASSENGER = 'ferret/passengers/DECREMENT_PASSENGER';\nexport const passengerTypes = {\n adults: {\n key: 'adults',\n one: 'adult',\n many: 'adults',\n age: {\n min: 26,\n max: 57,\n default: 26\n }\n },\n youths: {\n key: 'youths',\n one: 'youth',\n many: 'youths',\n age: {\n min: 0,\n max: 25,\n default: null\n }\n },\n seniors: {\n key: 'seniors',\n one: 'senior',\n many: 'seniors',\n age: {\n min: 58,\n max: 199,\n default: null\n }\n }\n};","import axios from \"../../../../fe-utils/src/axios/index\";\nconst headers = {\n 'X-Api-Version': 'v1',\n 'Content-Type': 'application/json'\n};\nexport const getPassengers = async (basePath = '', apiToken) => {\n try {\n const response = await axios.get(`${basePath}/passenger-service/users/me/passengers`, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(apiToken && {\n Authorization: `Bearer ${apiToken}`\n })\n }\n });\n return response.data;\n } catch (error) {\n // Handle error\n throw new Error('Get Passengers Unsuccessful');\n }\n};\nexport const updatePassenger = async (values, basePath = '', accessToken, passengerId) => {\n try {\n const {\n id: _id,\n userId: _userId,\n ...valuesWithoutIds\n } = values;\n const response = await axios.put(`${basePath}/passenger-service/users/me/passengers/${passengerId}`, valuesWithoutIds, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(accessToken && {\n Authorization: `Bearer ${accessToken}`\n })\n }\n });\n return response.data;\n } catch (err) {\n throw new Error('Create Unsuccessful');\n }\n};\nexport const createPassenger = async (values, basePath = '', accessToken) => {\n try {\n const {\n id: _id,\n userId: _userId,\n ...valuesWithoutIds\n } = values;\n const response = await axios.post(`${basePath}/passenger-service/users/me/passengers`, valuesWithoutIds, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(accessToken && {\n Authorization: `Bearer ${accessToken}`\n })\n }\n });\n return response.data;\n } catch (err) {\n throw new Error('Create Unsuccessful');\n }\n};\nexport const deletePassenger = async (basePath = '', accessToken, passengerId) => {\n try {\n await axios.delete(`${basePath}/passenger-service/users/me/passengers/${passengerId}`, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(accessToken && {\n Authorization: `Bearer ${accessToken}`\n })\n }\n });\n } catch (err) {\n throw new Error('Delete Unsuccessful');\n }\n};\nexport const saveDiscountCards = async (discountCards, passengerId, basePath = '', apiToken) => {\n try {\n const response = await axios.patch(`${basePath}/passenger-service/users/me/passengers/${passengerId}`, {\n discountCards\n }, {\n withCredentials: true,\n headers: {\n ...headers,\n ...(apiToken && {\n Authorization: `Bearer ${apiToken}`\n })\n }\n });\n return response.data;\n } catch (err) {\n throw new Error('Save Unsuccessful');\n }\n};","import { passengerTypes } from \"./ducks/passengers.constants\";\nconst passengerAgesSelector = state => {\n const {\n passengers\n } = state;\n const passengerAges = Object.keys(passengers).reduce((acc, type) => {\n passengers[type].ages.forEach(({\n value,\n discountCards,\n passengerId\n }) => {\n const {\n age: {\n min,\n max\n }\n } = passengerTypes[type];\n acc.push({\n min,\n max,\n age: value,\n discountCards,\n passengerId\n });\n });\n return acc;\n }, []);\n return passengerAges;\n};\nexport const ferretStateToProps = ferretState => ({\n timestamp: Date.now(),\n formTarget: '_self',\n formAction: ferretState.search.action,\n currency: ferretState.searchOptions.currency,\n domain: ferretState.searchOptions.domain,\n locale: ferretState.searchOptions.locale,\n partnerId: ferretState.searchOptions.partnerId,\n travelMode: ferretState.searchOptions.travelMode,\n host: ferretState.searchOptions.host,\n departureDate: ferretState.departureDate.date,\n returnDate: ferretState.returnDate.date,\n adultsCount: ferretState.passengers.adults.count,\n passengerAges: passengerAgesSelector(ferretState),\n departurePosition: ferretState.departure.selectedSuggestion,\n arrivalPosition: ferretState.arrival.selectedSuggestion,\n discountCards: ferretState.discountCards,\n popularDestinationSuggestions: ferretState.arrival.selectedSuggestion.popularDestinationSuggestions,\n abTestParameters: ferretState.searchOptions.abTestParameters,\n srpQueryParams: ferretState.searchOptions.srpQueryParams,\n userId: ferretState.searchOptions.userId,\n departurePositionSelectedSuggestion: ferretState.departure.selectedSuggestion,\n departurePositionId: ferretState.departure.positionId,\n departurePositionSuggestions: ferretState.departure.suggestions,\n arrivalPositionSelectedSuggestion: ferretState.arrival.selectedSuggestion,\n arrivalPositionId: ferretState.arrival.positionId,\n arrivalPositionSuggestions: ferretState.arrival.suggestions,\n submitOnDateSelect: ferretState.searchOptions.submitOnDateSelect,\n useHierarchicalSuggestions: ferretState.searchOptions.useHierarchicalSuggestions,\n lpsPageType: ferretState.lpsPageType\n});","import { ferretStateToProps } from \"../ferretStateToProps\";\nexport const mapFerretStateToProps = ferretState => Object.keys(ferretState).reduce((accumulator, nextProperty) => ({\n ...accumulator,\n [nextProperty]: ferretStateToProps(ferretState[nextProperty])\n}), {});","import * as R from \"ramda\";\nimport { getPassengers } from \"../../../user-profile-components/src/shared/clients/passengerService\";\nimport { mapStoredPassengersToFerretPassengers } from \"../utils/passengersMapper\";\nimport { createActionCreator, createReducer, createSelector, createThunk } from \"../utils/reduxHelpers\";\nimport { saveToLocalStorage } from \"../utils\";\nimport { mapFerretStateToProps } from \"../utils/ferretStateMapper\";\nimport { passengerUI } from \"./ui.constants\";\nimport { cardLookUpSelector, makeCardId, discountCardToggleSelector, passengerListSelector } from \"./discountCards.duck\";\nimport { passengerTypes, INCREMENT_PASSENGER, DECREMENT_PASSENGER } from \"./passengers.constants\";\nimport { makeAgeEntry, emptyPassengersCount, initialPassengersState } from \"./passengers.utils\";\n\n// Actions\n\nconst PASSENGER_AGE_CHANGED = 'ferret/passengers/PASSENGER_AGE_CHANGED';\nconst PASSENGER_DISCOUNT_CARDS_CHANGED = 'ferret/passengers/UPDATE_PASSANGER_DISCOUNT_CARDS';\nconst UPDATE_PASSENGERS = 'ferret/passengers/UPDATE_PASSENGERS';\n\n// Action Creators\nexport const incrementPassenger = createActionCreator(passengerType => ({\n type: INCREMENT_PASSENGER,\n payload: passengerType\n}));\nexport const decrementPassenger = createActionCreator(passengerType => ({\n type: DECREMENT_PASSENGER,\n payload: passengerType\n}));\nexport const passengerAgeChanged = createActionCreator((type, id, value) => ({\n type: PASSENGER_AGE_CHANGED,\n payload: {\n type,\n id,\n value\n }\n}));\nexport const passengerDiscountCardsChanged = createActionCreator((type, id, discountCards) => ({\n type: PASSENGER_DISCOUNT_CARDS_CHANGED,\n payload: {\n type,\n id,\n discountCards\n }\n}));\nexport const updatePassengers = createActionCreator(passengers => ({\n type: UPDATE_PASSENGERS,\n payload: passengers\n}));\n\n// internal selectors\nexport const passengersObjectSelector = ({\n passengers\n}) => passengers;\n\n// Selectors\nexport const sumTotalPassenger = passengers => {\n const totalPassengers = Object.keys(passengers).reduce((prev, next) => prev + passengers[next].count, 0);\n return totalPassengers;\n};\n// Selector which will return the total number of Discount Cards\nconst sumTotalDiscountCards = passengers => Object.keys(passengers).reduce((prev, next) => prev + passengers[next].ages.reduce((acc, {\n discountCards\n}) => acc + discountCards.length, 0), 0);\nexport const editablePassengerAgesSelector = passengers => Object.keys(passengers).reduce((acc, type) => {\n if (passengerTypes[type].age.default !== null) {\n return acc;\n }\n return [...acc, ...passengers[type].ages.map(ageEntry => ({\n ...ageEntry,\n type\n }))];\n}, []);\nexport const passengersSelector = createSelector((state, props) => {\n const cardLookUp = cardLookUpSelector(state.discountCards);\n const isDiscountCardsToggled = discountCardToggleSelector(state);\n const passengers = R.map(({\n type,\n ages,\n ...restPassenger\n }) => ({\n ...restPassenger,\n type,\n ages: ages.map(({\n discountCards,\n ...restAge\n }) => ({\n ...restAge,\n type,\n discountCards\n }))\n }), passengersObjectSelector(state));\n const visiblePassengers = {\n [passengerTypes.adults.key]: passengers[passengerTypes.adults.key],\n [passengerTypes.youths.key]: passengers[passengerTypes.youths.key],\n [passengerTypes.seniors.key]: passengers[passengerTypes.seniors.key]\n };\n const onlyAdults = Object.keys(visiblePassengers).every(key => key === 'adults' || visiblePassengers[key].count === 0);\n return {\n ...props,\n passengerTypes,\n passengers: visiblePassengers,\n totalPassengers: sumTotalPassenger(visiblePassengers),\n totalDiscountCards: sumTotalDiscountCards(visiblePassengers),\n onlyAdults,\n editablePassengerAges: editablePassengerAgesSelector(visiblePassengers),\n type: passengerUI\n };\n});\nconst nextPassengerCount = (passenger, countChange) => ({\n ...passenger,\n count: passenger.count + countChange,\n ages: countChange > 0 ? [...passenger.ages, ...Array.from({\n length: countChange\n }).map(() => makeAgeEntry(passengerTypes[passenger.type].age.default))] : passenger.ages.slice(0, countChange)\n});\nexport const passengerCountsSelector = ({\n passengers: {\n adults,\n youths,\n seniors\n }\n}) => ({\n adults: adults.count,\n youths: youths.count,\n seniors: seniors.count\n});\nexport const passengerAgesSerializedSelector = state => {\n const {\n passengerAgesSerialized\n } = Object.keys(state.passengers).reduce((acc, type) => {\n state.passengers[type].ages.forEach(({\n value\n }) => {\n const {\n age: {\n min,\n max\n }\n } = passengerTypes[type];\n const serializedAge = `${min}:${max}:${passengerTypes[type].age.default ? '' : value}`;\n acc.passengerAgesSerialized[`passengerages[${acc.count++}]`] = serializedAge;\n });\n return acc;\n }, {\n passengerAgesSerialized: {},\n count: 0\n });\n return passengerAgesSerialized;\n};\nexport const passengerIdsSerializedSelector = state => {\n const passengerList = passengerListSelector(state);\n return passengerList.reduce((acc, passenger, index) => {\n if (passenger.passengerId) {\n acc[`passengerids[${index}]`] = passenger.passengerId;\n }\n return acc;\n }, {});\n};\nexport const pccPassengersSelector = (state, props) => {\n const allAges = R.pipe(R.map(({\n ages\n }) => ages), R.values, R.flatten)(passengersSelector(state, props).passengers);\n return allAges.map(({\n id,\n type,\n value,\n discountCards,\n passengerId\n }) => ({\n id,\n passengerId,\n type: passengerTypes[type].one,\n age: value,\n selectedDiscountCards: discountCards.map(({\n code,\n provider\n }) => ({\n id: code,\n providerId: provider\n }))\n }));\n};\nconst addPassenger = (passengers, passengerType) => {\n const passenger = passengers[passengerType];\n return nextPassengerCount(passenger, 1);\n};\nconst removePassenger = (passengers, passengerType) => {\n const passenger = passengers[passengerType];\n return nextPassengerCount(passenger, -1);\n};\nconst changePassengerAge = (passenger, id, value) => {\n const changedAgeEntryIdx = passenger.ages?.findIndex(ageEntry => ageEntry.id === id);\n return {\n ...passenger,\n ages: [...passenger.ages.slice(0, changedAgeEntryIdx), {\n ...passenger.ages[changedAgeEntryIdx],\n value\n }, ...passenger.ages.slice(changedAgeEntryIdx + 1)]\n };\n};\nconst changePassengerDiscountCards = (passenger, id, discountCards) => {\n const changedAgeEntryIdx = passenger.ages?.findIndex(ageEntry => ageEntry.id === id);\n return {\n ...passenger,\n ages: [...passenger.ages.slice(0, changedAgeEntryIdx), {\n ...passenger.ages[changedAgeEntryIdx],\n discountCards\n }, ...passenger.ages.slice(changedAgeEntryIdx + 1)]\n };\n};\nconst emptyPassengersState = {\n [passengerTypes.adults.key]: emptyPassengersCount(passengerTypes.adults.key),\n [passengerTypes.youths.key]: emptyPassengersCount(passengerTypes.youths.key),\n [passengerTypes.seniors.key]: emptyPassengersCount(passengerTypes.seniors.key)\n};\nconst buildPassengerState = (passengers, type, age) => ({\n [type]: {\n type,\n count: passengers[type].count + 1,\n ages: [...passengers[type].ages, makeAgeEntry(age)]\n }\n});\nexport const selectMainPassenger = createThunk(localStorageItemName => (dispatch, getState, instanceId) => {\n const ferretState = getState();\n if (!instanceId || !localStorageItemName) return;\n getPassengers().then(passengers => {\n if (!passengers.length) return;\n const ferretPassenger = mapStoredPassengersToFerretPassengers([passengers[0]]);\n dispatch(updatePassengers(instanceId)(ferretPassenger));\n saveToLocalStorage({\n localStorageItemName,\n value: mapFerretStateToProps({\n [instanceId]: {\n ...ferretState,\n passengers: ferretPassenger\n }\n })\n }, true);\n });\n});\n\n// Reducer\nconst reducer = createReducer('passengers', (state = initialPassengersState, action) => {\n const {\n type,\n payload\n } = action;\n switch (type) {\n case 'ferret/init/INIT_FERRET_STATE':\n {\n const {\n passengers\n } = payload;\n return {\n ...state,\n ...(passengers && passengers.reduce((acc, passenger) => ({\n ...acc,\n ...(passenger.type === 'adult' ? buildPassengerState(acc, passengerTypes.adults.key, passengerTypes.adults.age.default) : buildPassengerState(acc, passengerTypes.youths.key, passenger.age))\n }), emptyPassengersState))\n };\n }\n case INCREMENT_PASSENGER:\n return {\n ...state,\n [payload]: addPassenger(state, payload)\n };\n case DECREMENT_PASSENGER:\n return {\n ...state,\n [payload]: removePassenger(state, payload)\n };\n case PASSENGER_AGE_CHANGED:\n return {\n ...state,\n [payload.type]: changePassengerAge(state[payload.type], payload.id, payload.value)\n };\n case PASSENGER_DISCOUNT_CARDS_CHANGED:\n return {\n ...state,\n [payload.type]: changePassengerDiscountCards(state[payload.type], payload.id, payload.discountCards)\n };\n case UPDATE_PASSENGERS:\n return {\n ...state,\n ...payload\n };\n default:\n return state;\n }\n});\nexport default reducer;","import { nanoid } from \"nanoid/non-secure\";\nimport { passengerTypes } from \"./passengers.constants\";\nexport const emptyPassengersCount = type => ({\n type,\n count: 0,\n ages: []\n});\nexport const resolveTypeFromRange = (typeMin, typeMax) => {\n const matchType = Object.keys(passengerTypes).find(type => {\n const {\n min,\n max\n } = passengerTypes[type].age;\n return min <= typeMin && max >= typeMax;\n });\n const match = passengerTypes[matchType];\n return match ? match.key : passengerTypes.adults.key;\n};\nexport const makeAgeEntry = (value, discountCards = []) => ({\n id: nanoid(),\n value,\n discountCards\n});\n\n// initial state\nexport const initialPassengersState = {\n [passengerTypes.adults.key]: {\n type: passengerTypes.adults.key,\n count: 1,\n ages: [makeAgeEntry(passengerTypes.adults.age.default)]\n },\n [passengerTypes.youths.key]: emptyPassengersCount(passengerTypes.youths.key),\n [passengerTypes.seniors.key]: emptyPassengersCount(passengerTypes.seniors.key)\n};","export const reducerNames = {\n departure: 'departure',\n arrival: 'arrival'\n};\nconst ERROR = reducerName => `ferret/${reducerName}/ERROR`;\nexport const POSITIONS_SWAPPED = reducerName => `ferret/${reducerName}/POSITIONS_SWAPPED`;\nexport const SET_POSITION = reducerName => `ferret/${reducerName}/SET_POSITION`;\nexport const FETCH_SUGGESTIONS_SUCCESS = reducerName => `ferret/${reducerName}/FETCH_SUGGESTIONS_SUCCESS`;\nexport const DEPARTURE_POSITION_ERROR = ERROR(reducerNames.departure);\nexport const SET_ARRIVAL_POSITION = SET_POSITION(reducerNames.arrival);\nexport const SET_DEPARTURE_POSITION = SET_POSITION(reducerNames.departure);","import { get as httpGet } from \"axios\";\nimport * as R from \"ramda\";\nimport { getSuggesterApiUrl } from \"../../config\";\nimport { localeSelector, hostSelector } from \"./searchOptions.duck\";\nimport { findFirstNonEmptyArray, flattenHierarchicalSuggestions } from \"../utils/helpers\";\nimport { createReducer, createThunk, createSelector, createActionCreator } from \"../utils/reduxHelpers\";\nimport { getDiscountCards, clearCards } from \"./discountCards.duck\";\nimport { arrivalPositionUI, departurePositionUI } from \"./ui.constants\";\nimport { reducerNames, SET_POSITION, POSITIONS_SWAPPED, FETCH_SUGGESTIONS_SUCCESS } from \"./position.constants\";\nimport { initialPositionState } from \"./position.utils\";\n\n// ACTION TYPES\n\n// POSITIONS\nconst SET_SEARCH_TEXT = reducerName => `ferret/${reducerName}/SET_SEARCH_TEXT`;\nconst CLEAR_POSITION = reducerName => `ferret/${reducerName}/CLEAR_POSITION`;\nconst SET_STATE = reducerName => `ferret/${reducerName}/SET_STATE`;\nconst SHOW_ARRIVAL_AFTER_DEPARTURE_SELECTION = 'ferret/arrival/SHOW_ARRIVAL_AFTER_DEPARTURE_SELECTION';\n\n// SUGGESTIONS\nexport const FETCH_SUGGESTIONS_REQUEST = reducerName => `ferret/${reducerName}/FETCH_SUGGESTIONS_REQUEST`;\nexport const FETCH_SUGGESTIONS_FAILURE = reducerName => `ferret/${reducerName}/FETCH_SUGGESTIONS_FAILURE`;\nconst FETCH_POPULAR_DESTINATIONS_SUCCESS = 'ferret/arrival/FETCH_POPULAR_DESTINATIONS_SUCCESS';\n\n// ERRORS\nconst ERROR = reducerName => `ferret/${reducerName}/ERROR`;\nexport const ARRIVAL_POSITION_ERROR = ERROR(reducerNames.arrival);\nconst CLEAR_ERRORS = 'ferret/positions/CLEAR_ERRORS';\n\n// ACTION CREATORS\n\nconst setSearchText = createActionCreator((reducerName, searchText) => ({\n type: SET_SEARCH_TEXT(reducerName),\n payload: searchText\n}));\nexport const setPosition = createActionCreator((reducerName, payload, skipTracking) => ({\n type: SET_POSITION(reducerName),\n payload,\n skipTracking\n}));\nconst clearPosition = createActionCreator((reducerName, payload) => ({\n type: CLEAR_POSITION(reducerName),\n payload\n}));\nconst setState = createActionCreator((reducerName, state) => ({\n type: SET_STATE(reducerName),\n payload: state\n}));\nconst positionsSwapped = createActionCreator((reducerName, isSwapped) => ({\n type: POSITIONS_SWAPPED(reducerName),\n payload: isSwapped\n}));\nconst suggestionFetchRequest = createActionCreator(reducerName => ({\n type: FETCH_SUGGESTIONS_REQUEST(reducerName)\n}));\nconst suggestionFetchSuccess = createActionCreator((reducerName, suggestions) => ({\n type: FETCH_SUGGESTIONS_SUCCESS(reducerName),\n payload: suggestions\n}));\nconst suggestionFetchFailure = createActionCreator(reducerName => ({\n type: FETCH_SUGGESTIONS_FAILURE(reducerName)\n}));\nexport const clearValidationErrors = createActionCreator(() => ({\n type: CLEAR_ERRORS\n}));\nconst popularDestinationsFetchSuccess = createActionCreator(popularDestinations => ({\n type: FETCH_POPULAR_DESTINATIONS_SUCCESS,\n payload: popularDestinations\n}));\nexport const showArrivalAfterDepartureSelection = createActionCreator(showArrivalAfterDeparture => ({\n type: SHOW_ARRIVAL_AFTER_DEPARTURE_SELECTION,\n payload: showArrivalAfterDeparture\n}));\n\n// SELECTORS\n\nconst getSuggestionIds = suggestions => suggestions.map(suggestion => suggestion.positionId);\nexport const departurePositionSelector = createSelector((state, props) => {\n const {\n departure\n } = state;\n const {\n suggestions,\n dump\n } = departure;\n const suggestionIds = getSuggestionIds(suggestions);\n const {\n enabledSuggesterPositionTypes\n } = state.ui;\n const isFerry = enabledSuggesterPositionTypes.includes('ferry');\n const useHierarchicalSuggestions = true;\n return {\n ...props,\n ...departure,\n dump,\n suggestionIds,\n label: 'searchbar.departure_position_label',\n placeholder: isFerry ? 'ferret.placeholder.from_ferry' : 'ferret.placeholder.from',\n reducerName: reducerNames.departure,\n positionType: departurePositionUI,\n selectedSuggestionName: departure?.selectedSuggestion?.fullName || '',\n selectedSuggestionId: departure?.selectedSuggestion?.positionId || null,\n useHierarchicalSuggestions\n };\n});\n\n// internal + external selector\nexport const arrivalPositionSelector = createSelector((state, props = {}) => {\n const {\n arrival\n } = state;\n const {\n suggestions,\n popularDestinationSuggestions,\n isAvailableDestinations\n } = arrival;\n const isPopularDestinations = R.isEmpty(suggestions) && !R.isEmpty(popularDestinationSuggestions) && !isAvailableDestinations;\n const finalSuggestions = findFirstNonEmptyArray(suggestions, popularDestinationSuggestions);\n const suggestionIds = getSuggestionIds(finalSuggestions);\n const {\n enabledSuggesterPositionTypes\n } = state.ui;\n const isFerry = enabledSuggesterPositionTypes.includes('ferry');\n const useHierarchicalSuggestions = true;\n return {\n ...props,\n ...arrival,\n label: 'searchbar.arrival_position_label',\n placeholder: isFerry ? 'ferret.placeholder.from_ferry' : 'ferret.placeholder.from',\n reducerName: reducerNames.arrival,\n positionType: arrivalPositionUI,\n suggestions: finalSuggestions,\n suggestionIds,\n selectedSuggestionName: arrival?.selectedSuggestion?.fullName || '',\n selectedSuggestionId: arrival?.selectedSuggestion?.positionId || null,\n isPopularDestinations,\n isAvailableDestinations,\n useHierarchicalSuggestions\n };\n});\nexport const positionsSelector = state => {\n const {\n departure,\n arrival\n } = state;\n return {\n departure,\n arrival\n };\n};\nexport const swapperSelector = createSelector((state, rest) => {\n const {\n departure,\n arrival\n } = state;\n const departurePositionSet = !R.isEmpty(departure.selectedSuggestion);\n const arrivalPositionSet = !R.isEmpty(arrival.selectedSuggestion);\n const canSwap = rest.canSwap || departurePositionSet && arrivalPositionSet;\n return {\n ...rest,\n canSwap\n };\n});\n\n// internal selector\nexport const departurePositionIdSelector = state => {\n const {\n selectedSuggestion\n } = state.departure;\n return !selectedSuggestion ? null : selectedSuggestion.positionId;\n};\n\n// internal selector\nexport const arrivalPositionIdSelector = state => {\n const {\n selectedSuggestion\n } = state.arrival;\n return !selectedSuggestion ? null : selectedSuggestion.positionId;\n};\nconst getFerriesAvailablePositions = async (reducerName, locale, departureId, suggesterApiUrl) => {\n const dump = !(reducerName === 'arrival' && departureId) ? '/dump' : '/destination';\n const {\n data: suggestions\n } = await httpGet(`${suggesterApiUrl}/ferry${dump}`, {\n params: {\n ...{\n id: departureId\n },\n locale\n }\n });\n return suggestions;\n};\nconst getSuggestedPositions = async (reducerName, isFerry, locale, searchText, departureId, suggesterApiUrl, shouldUseHierarchicalSuggestion) => {\n const shouldSendDepId = !!(departureId && reducerName === 'arrival');\n const ferry = isFerry ? '/ferry' : '';\n const {\n data: suggestions\n } = await httpGet(`${suggesterApiUrl}${ferry}`, {\n params: {\n term: searchText,\n locale,\n hierarchical: shouldUseHierarchicalSuggestion,\n // departureId is sent as a part of STATION-1780(Suggester 3.0)\n ...(shouldSendDepId ? {\n departureId\n } : {})\n }\n });\n if (suggestions.length === 0 && isFerry) {\n const postions = await getFerriesAvailablePositions(reducerName, locale, departureId, suggesterApiUrl);\n return {\n dump: true,\n suggestions: postions\n };\n }\n return {\n dump: false,\n suggestions\n };\n};\n\n// Thunks, will need to call action creators with instanceId\nexport const fetchSuggestions = (reducerName, filterSelector) => createThunk(searchText => async (dispatch, getState, instanceId) => {\n dispatch(setSearchText(instanceId)(reducerName, searchText));\n const state = getState();\n const {\n enabledSuggesterPositionTypes\n } = state.ui;\n const isFerry = enabledSuggesterPositionTypes.includes('ferry');\n const locale = localeSelector(state);\n const shouldUseHierarchicalSuggestion = true;\n const minimumSearchTextLength = shouldUseHierarchicalSuggestion ? 1 : 2;\n const idToFilter = filterSelector(state);\n const host = hostSelector(state);\n const SUGGESTER_API_URL = getSuggesterApiUrl(host);\n if (searchText.length === 0 && isFerry) {\n dispatch(suggestionFetchRequest(instanceId)(reducerName));\n return getFerriesAvailablePositions(reducerName, locale, idToFilter, SUGGESTER_API_URL).then(suggestions => dispatch(suggestionFetchSuccess(instanceId)(reducerName, {\n dump: false,\n suggestions,\n searchText\n }))).catch(() => dispatch(suggestionFetchFailure(instanceId)(reducerName)));\n }\n if (searchText.length < minimumSearchTextLength) {\n return;\n }\n return getSuggestedPositions(reducerName, isFerry, locale, searchText, idToFilter, SUGGESTER_API_URL, shouldUseHierarchicalSuggestion).then(({\n suggestions,\n dump\n }) => {\n const mappedSuggestions = shouldUseHierarchicalSuggestion ? flattenHierarchicalSuggestions(suggestions) : suggestions;\n return dispatch(suggestionFetchSuccess(instanceId)(reducerName, {\n dump,\n suggestions: mappedSuggestions,\n searchText\n }));\n }).catch(() => dispatch(suggestionFetchFailure(instanceId)(reducerName)));\n});\nexport const setArrivalPositionWithIndex = createThunk((suggestionIndex, skipTracking = false, isPopularDestinations = false, trackDestinationSelectionFormSearchedSuggestionsListClick, trackDestinationSelectionFormPopularDestinationsListClick) => (dispatch, getState, instanceId) => {\n const state = getState();\n const {\n suggestions,\n searchText\n } = arrivalPositionSelector(state);\n const suggestion = suggestions[suggestionIndex];\n if (!suggestion) {\n return;\n }\n const locale = localeSelector(state);\n dispatch(setSearchText(instanceId)(reducerNames.arrival, ''));\n dispatch(setPosition(instanceId)(reducerNames.arrival, {\n ...suggestion,\n searchText,\n suggestionIndex,\n locale\n }, skipTracking));\n if (isPopularDestinations) {\n trackDestinationSelectionFormPopularDestinationsListClick?.({});\n } else {\n trackDestinationSelectionFormSearchedSuggestionsListClick?.({});\n }\n dispatch(getDiscountCards(instanceId)());\n dispatch(showArrivalAfterDepartureSelection(instanceId)(false));\n});\nexport const fetchAndSetPosition = createThunk((positionId, reducerName, enabledSuggesterPositionTypes = [], locale = 'en') => async (dispatch, getState, instanceId) => {\n try {\n const isFerry = enabledSuggesterPositionTypes.includes('ferry');\n const ferry = isFerry ? '/ferry' : '';\n const state = getState();\n const host = hostSelector(state);\n const SUGGESTER_API_URL = getSuggesterApiUrl(host);\n const {\n data\n } = await httpGet(`${SUGGESTER_API_URL}${ferry}/`, {\n params: {\n id: positionId,\n locale\n }\n });\n const suggestion = data[0];\n dispatch(setPosition(instanceId)(reducerName, suggestion));\n dispatch(getDiscountCards(instanceId)());\n } catch (error) {\n console.log(`Error when fetching and setting positions: ${error}`);\n }\n});\nexport const setDeparturePositionAndFetchPopularDestinations = createThunk((suggestionIndex, skipTracking = false, _isPopularDestinations = false, trackDepartureSelectionFormSearchedSuggestionsListClick) => async (dispatch, getState, instanceId) => {\n const state = getState();\n const {\n suggestions,\n searchText\n } = departurePositionSelector(state);\n const suggestion = suggestions[suggestionIndex];\n if (!suggestion) {\n return;\n }\n const locale = localeSelector(state);\n dispatch(setSearchText(instanceId)(reducerNames.departure, ''));\n dispatch(setPosition(instanceId)(reducerNames.departure, {\n ...suggestion,\n searchText,\n suggestionIndex,\n locale\n }, skipTracking));\n if (!skipTracking) {\n trackDepartureSelectionFormSearchedSuggestionsListClick?.({});\n }\n dispatch(getDiscountCards(instanceId)());\n const {\n positionId\n } = suggestion;\n const host = hostSelector(state);\n const SUGGESTER_API_URL = getSuggesterApiUrl(host);\n try {\n const {\n enabledSuggesterPositionTypes\n } = state.ui;\n const isFerry = enabledSuggesterPositionTypes.includes('ferry');\n const ferry = isFerry ? '/ferry' : '';\n const {\n data\n } = await httpGet(`${SUGGESTER_API_URL}${ferry}/destination`, {\n params: {\n id: positionId,\n locale\n }\n });\n dispatch(popularDestinationsFetchSuccess(instanceId)({\n isAvailableDestinations: isFerry,\n popularDestinationSuggestions: data\n }));\n const arrivalPositionId = arrivalPositionIdSelector(state);\n const showArrivalAfterDeparture = !arrivalPositionId || arrivalPositionId === suggestion.positionId;\n dispatch(showArrivalAfterDepartureSelection(instanceId)(showArrivalAfterDeparture));\n } catch (error) {\n console.log(`error:${error}`);\n }\n});\nexport const clearArrivalOrDeparturePosition = createThunk((departureOrArrival, props) => async (dispatch, getState, instanceId) => {\n dispatch(clearCards(instanceId)());\n // if arrival and departure are empty\n const departure = departurePositionSelector(getState(), props);\n const clearPopularDestination = !(departureOrArrival === reducerNames.arrival && departure.selectedSuggestionId !== null);\n departureOrArrival && dispatch(clearPosition(instanceId)(departureOrArrival, {\n clearPopularDestination\n }));\n});\nexport const fetchDepartureSuggestions = instanceId => fetchSuggestions(reducerNames.departure, arrivalPositionIdSelector)(instanceId);\nexport const fetchArrivalSuggestions = instanceId => fetchSuggestions(reducerNames.arrival, departurePositionIdSelector)(instanceId);\nexport const swapPositions = createThunk(() => (dispatch, getState, instanceId) => {\n const state = getState();\n const {\n departure,\n arrival\n } = state;\n try {\n if (arrival.selectedSuggestion.positionId && departure.selectedSuggestion.positionId) {\n departure.error = null;\n arrival.error = null;\n dispatch(clearValidationErrors(instanceId)());\n dispatch(setState(instanceId)(reducerNames.departure, arrival));\n dispatch(setState(instanceId)(reducerNames.arrival, departure));\n dispatch(positionsSwapped(instanceId)(reducerNames.departure, true));\n }\n } catch (error) {\n // fail silently\n }\n});\n\n// REDUCERS\n\nconst fullPositionName = payload => `${payload.displayName}${payload.code ? ` (${payload.code})` : ''}, ${payload.countryNameInUserLocale}`;\nconst positionReducer = (state = initialPositionState, action, reducerName) => {\n const {\n type,\n payload\n } = action;\n switch (type) {\n case FETCH_SUGGESTIONS_SUCCESS(reducerName):\n return {\n ...state,\n suggestions: payload.suggestions,\n dump: payload.dump\n };\n case SET_SEARCH_TEXT(reducerName):\n return {\n ...state,\n searchText: payload\n };\n case SET_POSITION(reducerName):\n return {\n ...state,\n fullPositionName: `${payload ? fullPositionName(payload) : ''}`,\n selectedSuggestion: payload\n };\n case CLEAR_POSITION(reducerName):\n {\n return {\n ...state,\n fullPositionName: null,\n searchText: null,\n selectedSuggestion: null,\n suggestions: [],\n ...(payload.clearPopularDestination ? {\n popularDestinationSuggestions: []\n } : {})\n };\n }\n case SET_STATE(reducerName):\n return {\n ...state,\n ...payload\n };\n case FETCH_POPULAR_DESTINATIONS_SUCCESS:\n return {\n ...state,\n ...payload\n };\n case ERROR(reducerName):\n return {\n ...state,\n error: payload\n };\n case CLEAR_ERRORS:\n return {\n ...state,\n error: null\n };\n case SHOW_ARRIVAL_AFTER_DEPARTURE_SELECTION:\n {\n return reducerName !== reducerNames.arrival ? state : {\n ...state,\n openArrivalAfterDeparture: payload\n };\n }\n default:\n return state;\n }\n};\nexport const departure = createReducer(reducerNames.departure, positionReducer);\nexport const arrival = createReducer(reducerNames.arrival, positionReducer);","// INITIAL STATE\n\nexport const initialPositionState = {\n searchText: '',\n fullPositionName: '',\n selectedSuggestion: {},\n suggestions: [],\n error: null,\n popularDestinationSuggestions: [],\n dump: false\n};","import { initialsearchOptionsState } from \"./searchOptions.utils\";\nimport { createActionCreator, createReducer, createThunk, createSelector } from \"../utils/reduxHelpers\";\n\n// ACTION TYPES\n\nconst SET_SEARCH_OPTIONS = 'ferret/searchButton/SET_SEARCH_OPTIONS';\n\n// ACTION CREATORS\n\nconst setOptions = createActionCreator(newOptions => ({\n type: SET_SEARCH_OPTIONS,\n payload: newOptions\n}));\n\n// SELECTORS\n\nexport const searchOptionsSelector = state => state.searchOptions;\nexport const submitOnDateSelectSelector = createSelector(\n// need to disable the eslint check because the `props` argument is used by `createSelector`\nstate => state.searchOptions.submitOnDateSelect // eslint-disable-line no-unused-vars\n);\n\nexport const currencySelector = createSelector(state => state.searchOptions.currency);\nexport const localeSelector = state => searchOptionsSelector(state).locale;\nexport const localeScopeSelector = createSelector(state => state.searchOptions.locale);\nexport const currentDomainSelector = ({\n searchOptions: {\n domain\n }\n}) => domain;\nexport const disableRecommendedTravelModeSelector = ({\n searchOptions: {\n disableRecommendedTravelMode\n }\n}) => disableRecommendedTravelMode;\nexport const hostSelector = state => state.searchOptions.host;\nexport const travelModeSelector = createSelector(state => state.searchOptions.travelMode);\n\n// THUNKS\n\nexport const setSearchOptions = createThunk(newOptions => (dispatch, getState, instanceId) => {\n dispatch(setOptions(instanceId)(newOptions));\n});\n\n// REDUCER\n\nconst reducer = createReducer('searchOptions', (state = initialsearchOptionsState, action) => {\n const {\n type,\n payload\n } = action;\n switch (type) {\n case SET_SEARCH_OPTIONS:\n return {\n ...state,\n ...payload\n };\n default:\n return state;\n }\n});\nexport default reducer;","import { DEFAULT_CURRENCY_CODE } from \"../../../fe-utils/src/Currency/index\";\nexport const initialsearchOptionsState = {\n userId: '0.bwfcbk4cn8p25anfsj71hbbj4i',\n currency: DEFAULT_CURRENCY_CODE,\n domain: 'com',\n locale: 'en',\n partnerId: '',\n travelMode: 'train',\n host: '',\n abTestParameters: [],\n srpQueryParams: '',\n disableRecommendedTravelMode: true,\n spa: false,\n submitOnDateSelect: false,\n useHierarchicalSuggestions: false\n};","// ui elements\nexport const departurePositionUI = 'departurePosition';\nexport const arrivalPositionUI = 'arrivalPosition';\nexport const departureDateUI = 'departureDate';\nexport const arrivalDateUI = 'arrivalDate';\nexport const passengerAndDiscountUI = 'passengerAndDiscount';\nexport const passengerUI = 'passengerUI';\nexport const discountUI = 'discountUI';\nexport const mobilePanelUI = 'mobilePanelUI';\nexport const navigationUI = 'navigationUI';\nexport const departureDateNavigationUI = 'departureDateNavigationUI';\nexport const returnDateNavigationUI = 'returnDateNavigationUI';\nexport const discountCardInputUI = 'discountCardInputUI';\nexport const monthCounterUI = 'monthCounterUI';","// reducer\nimport { createActionCreator, createReducer, createSelector } from \"../utils/reduxHelpers\";\nimport { initialUiInteractions } from \"./ui.utils\";\n\n// actions\nconst SET_UI_PROPERTY = 'ferret/ui/SET_UI_PROPERTY';\n\n// action creators\nexport const setUIProperty = createActionCreator(payload => ({\n type: SET_UI_PROPERTY,\n payload\n}));\n\n// selectors\nexport const uiInteractionsSelector = createSelector(({\n ui\n}, {\n reduxUiId\n}) => ({\n ...ui[reduxUiId]\n}));\nexport const passengerUISelector = createSelector(state => state.ui.passengerUI);\nexport const isFormSubmittingSelector = createSelector(state => state.ui.isFormSubmitting);\nexport const switchToFlightWhenMakesSenseSelector = createSelector(state => state.ui.switchToFlightWhenMakesSense);\n\n// reducer\nconst reducer = createReducer('ui', (state = initialUiInteractions, action) => {\n const {\n type,\n payload\n } = action;\n switch (type) {\n case SET_UI_PROPERTY:\n {\n const {\n propertyName,\n value,\n reduxUiId\n } = payload;\n return reduxUiId ? {\n ...state,\n [reduxUiId]: {\n ...state[reduxUiId],\n [propertyName]: value\n }\n } : {\n ...state,\n [propertyName]: value\n };\n }\n default:\n return state;\n }\n});\nexport default reducer;","import { today } from \"../utils/calendar.utils\";\nimport { departureDateUI, passengerAndDiscountUI, arrivalDateUI, arrivalPositionUI, departureDateNavigationUI, returnDateNavigationUI, departurePositionUI, discountCardInputUI, discountUI, mobilePanelUI, monthCounterUI, navigationUI, passengerUI } from \"./ui.constants\";\nexport const initialUiInteractions = {\n [departurePositionUI]: {\n hiddenPanelVisibility: false\n },\n [arrivalPositionUI]: {\n hiddenPanelVisibility: false\n },\n [departureDateUI]: {\n hiddenPanelVisibility: false\n },\n [arrivalDateUI]: {\n hiddenPanelVisibility: false\n },\n [passengerAndDiscountUI]: {\n hiddenPanelVisibility: false\n },\n [passengerUI]: {\n hiddenPanelVisibility: false,\n passengersErrorVisibility: false,\n ageErrorVisibility: false\n },\n [discountUI]: {\n hiddenPanelVisibility: false,\n modalOpen: false\n },\n [mobilePanelUI]: {\n makeFixed: false\n },\n [navigationUI]: {\n activeIndex: 0\n },\n [departureDateNavigationUI]: {\n selectedDate: today\n },\n [returnDateNavigationUI]: {\n selectedDate: today\n },\n [discountCardInputUI]: {\n activeList: null\n },\n [monthCounterUI]: {\n rangeToShow: [0, 1]\n },\n hidePassengerCopy: false,\n disableDiscountCards: false,\n switchToFlightWhenMakesSense: false,\n enabledSuggesterPositionTypes: ['city', 'train', 'bus', 'airport'],\n isFormSubmitting: false\n};","export default function _isNumber(x) {\n return Object.prototype.toString.call(x) === '[object Number]';\n}","import _curry2 from \"./internal/_curry2.js\";\nimport _isNumber from \"./internal/_isNumber.js\";\n/**\n * Returns a list of numbers from `from` (inclusive) to `to` (exclusive).\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> Number -> [Number]\n * @param {Number} from The first number in the list.\n * @param {Number} to One more than the last number in the list.\n * @return {Array} The list of numbers in the set `[a, b)`.\n * @example\n *\n * R.range(1, 5); //=> [1, 2, 3, 4]\n * R.range(50, 53); //=> [50, 51, 52]\n */\n\nvar range =\n/*#__PURE__*/\n_curry2(function range(from, to) {\n if (!(_isNumber(from) && _isNumber(to))) {\n throw new TypeError('Both arguments to range must be numbers');\n }\n\n var result = [];\n var n = from;\n\n while (n < to) {\n result.push(n);\n n += 1;\n }\n\n return result;\n});\n\nexport default range;","import * as R from \"ramda\";\nimport getISODay from \"date-fns/get_iso_day\";\nimport getDay from \"date-fns/get_day\";\nimport getYear from \"date-fns/get_year\";\nimport getMonth from \"date-fns/get_month\";\nimport getDaysInMonth from \"date-fns/get_days_in_month\";\nimport lastDayOfMonth from \"date-fns/last_day_of_month\";\nimport setDate from \"date-fns/set_date\";\nimport { chunk } from \"./helpers\";\nexport const today = new Date(new Date().setHours(0, 0, 0, 0));\n\n// 1 = Monday in phrase app keys\n// 0 = Sunday in phrase app keys\nconst mondayToSundayWeekdayLabels = [...R.range(1, 7), 0];\nconst sundayToSaturdayWeekdayLabels = R.range(0, 7);\nexport const getWeekdayLabelsByDomain = hasSundayToMondayCalendar => {\n if (hasSundayToMondayCalendar) {\n return sundayToSaturdayWeekdayLabels;\n }\n return mondayToSundayWeekdayLabels;\n};\nconst getEmptyDays = count => Array(count).fill(null);\nconst getDaysForDate = date => {\n const daysInCurrentMonth = getDaysInMonth(date);\n return R.range(1, daysInCurrentMonth + 1).map(day => new Date(getYear(date), getMonth(date), day));\n};\n\n/*\n returns an array of weeks,\n a week is an array of seven days,\n dates in the previous and next month are represented by a null\n\n getISODay gets the day of the ISO week, 7 is Sunday, 1 is Monday\n getDay gets the day of the week, 0 is Sunday, 6 is Saturday\n*/\n\nexport const getCalendarForDate = (date, hasSundayToMondayCalendar) => {\n const firstDayOfCurrentMonth = setDate(date, 1);\n const previousMonthEmptyDays = hasSundayToMondayCalendar ? getDay(firstDayOfCurrentMonth) : getISODay(firstDayOfCurrentMonth) - 1;\n const indexOfLastDayOfCurrentMonth = hasSundayToMondayCalendar ? getDay(lastDayOfMonth(date)) : getISODay(lastDayOfMonth(date));\n const numberOfDaysInWeek = hasSundayToMondayCalendar ? 6 : 7;\n const nextMonthEmptyDays = numberOfDaysInWeek - indexOfLastDayOfCurrentMonth;\n const calendarDays = [...getEmptyDays(previousMonthEmptyDays), ...getDaysForDate(date), ...getEmptyDays(nextMonthEmptyDays)];\n return chunk(calendarDays, 7);\n};","export const CURRENT_FERRET_PROPS_LOCAL_STORAGE_KEY = 'currentFerretProps';\nexport const findFirstNonEmptyArray = (...arrays) => arrays.find(array => array && array.length > 0) || [];\nexport const isLocalStorageEnabled = () => {\n try {\n const storageType = 'localStorage';\n const isSupported = storageType in window && window[storageType] !== null;\n if (!isSupported) {\n return false;\n }\n const key = `lsTest__${Math.round(Math.random() * 1e7)}`;\n const webStorage = window[storageType];\n webStorage.setItem(key, '');\n webStorage.removeItem(key);\n return true;\n } catch (e) {\n return false;\n }\n};\nexport const saveToLocalStorage = ({\n localStorageItemName,\n value\n}, shouldMerge = false) => {\n try {\n if (shouldMerge) {\n const oldValue = JSON.parse(window.localStorage.getItem(localStorageItemName));\n const valueString = JSON.stringify({\n ...oldValue,\n ...value\n });\n window.localStorage.removeItem(localStorageItemName);\n window.localStorage.setItem(localStorageItemName, valueString);\n } else {\n const valueString = JSON.stringify(value);\n window.localStorage.removeItem(localStorageItemName);\n window.localStorage.setItem(localStorageItemName, valueString);\n }\n } catch (err) {\n console.info(`Error setting Ferret to localStorage: ${err}. Emptying storage.`);\n }\n};\nexport const isMobile = () => {\n let check = false;\n if (navigator && /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent)) {\n check = true;\n }\n return check;\n};\nexport const getTranslatedPluralMessage = (translationKey, number, intl) => {\n const pluralValue = intl.formatPlural(number);\n const pluralKey = `${translationKey}.${pluralValue}`;\n\n // search-fe and lps treat pluralized keys different\n // lps flattens the object, search doesn't\n // The following block is for ferret in search-fe\n if (!intl.messages[pluralKey]) {\n const translationObject = intl.messages[translationKey];\n const translation = translationObject && translationObject[pluralValue];\n return translation ? `${number} ${translation}` : null;\n }\n const pluralTranslation = intl.messages[pluralKey];\n return pluralTranslation ? `${number} ${pluralTranslation}` : null;\n};\nexport const flattenHierarchicalSuggestions = suggestions => {\n if (!suggestions) {\n return [];\n }\n const res = suggestions.reduce((acc, suggestion) => {\n const childSuggestions = suggestion.children || [];\n const markedChildSuggestions = childSuggestions.map(s => ({\n ...s,\n isChildSuggestion: true,\n parentPositionId: suggestion.positionId\n }));\n return [...acc, suggestion, ...markedChildSuggestions];\n }, []);\n return res;\n};\nexport const chunk = (input, size) => input.reduce((arr, item, idx) => idx % size === 0 ? [...arr, [item]] : [...arr.slice(0, -1), [...arr.slice(-1)[0], item]], []);\nexport const isFunction = func => {\n if (func && typeof func === 'function') {\n return true;\n }\n return false;\n};","const isNode = () => typeof process !== 'undefined' && process.versions != null && process.versions.node != null;\n\n// We don't rely on checking window as weaver mocks Window object, wich lead us to confusion\n// In order to detect if this is a browser env we check if this is not a Node.\n// OLD VERSION: return typeof window !== 'undefined' && typeof window.document !== 'undefined'\nexport const isBrowser = () => !isNode();","import { nanoid } from \"nanoid/non-secure\";\nimport { mapStoredPassengerToSearchPassenger } from \"../../../passenger-config-components/src/shared/mapPassengerDetails\";\nimport { passengerTypes } from \"../ducks/passengers.constants\";\nexport const mapSearchPassengersToFerretPassengers = passengers => {\n const ferretPassengers = {\n adults: {\n type: passengerTypes.adults.key,\n count: 0,\n ages: []\n },\n youths: {\n type: passengerTypes.youths.key,\n count: 0,\n ages: []\n },\n seniors: {\n type: passengerTypes.seniors.key,\n count: 0,\n ages: []\n }\n };\n passengers.forEach(passenger => {\n const {\n type,\n age,\n selectedDiscountCards,\n passengerId\n } = passenger;\n ferretPassengers[`${type}s`].count += 1;\n ferretPassengers[`${type}s`].ages.push({\n id: nanoid(),\n value: age,\n discountCards: selectedDiscountCards.map(card => ({\n code: card.id,\n provider: card.providerId\n })),\n passengerId\n });\n });\n return ferretPassengers;\n};\nexport const mapStoredPassengersToFerretPassengers = storedPassengers => {\n return mapSearchPassengersToFerretPassengers(storedPassengers.map(storedPassenger => ({\n ...mapStoredPassengerToSearchPassenger({\n id: storedPassenger?.id ?? '',\n discountCards: storedPassenger?.discountCards,\n dateOfBirth: storedPassenger?.dateOfBirth,\n firstName: storedPassenger?.firstName,\n lastName: storedPassenger?.lastName\n }),\n passengerId: storedPassenger?.id\n })));\n};","export const instanceSelector = (instanceId, state) => state.ferret[instanceId];\nexport const nextState = ({\n state,\n instanceId,\n nextReducerState,\n reducerName\n}) => ({\n ...state,\n ferret: {\n ...state.ferret,\n [instanceId]: {\n ...state.ferret[instanceId],\n [reducerName]: nextReducerState\n }\n }\n});\nexport const createReducer = (reducerName, reducerFunction) => (state, action) => {\n const {\n instanceId\n } = action;\n const reducerState = instanceSelector(instanceId, state)[reducerName];\n const nextReducerState = reducerFunction(reducerState, action, reducerName);\n return nextState({\n state,\n reducerName,\n instanceId,\n nextReducerState\n });\n};\n\n// TODO: should we also wrap dispatch so thunks which dispatch don't have to\n// pass on instanceId, can do for dispatch of object, maybe not of function ?\nexport const createThunk = thunk => instanceId => (...args) => (dispatch, getState) => {\n const scopedGetState = () => instanceSelector(instanceId, getState());\n return thunk(...args)(dispatch, scopedGetState, instanceId);\n};\nexport const createActionCreator = action => instanceId => (...args) => {\n const actionResult = action(...args);\n return {\n ...actionResult,\n instanceId\n };\n};\nexport const mapDispatchToProps = actions => (dispatch, {\n instanceId\n}) => Object.keys(actions).reduce((accumulator, actionName) => {\n const action = actions[actionName];\n return {\n ...accumulator,\n [actionName]: (...args) => dispatch(action(instanceId)(...args))\n };\n}, {});\nexport const createSelector = selector => (state, props) => {\n // Calling selector with already scoped state\n if (!props) {\n return selector(state);\n }\n const {\n instanceId,\n ...rest\n } = props;\n if (!instanceId) {\n return selector(state, rest);\n }\n\n // Calling selector with non-scoped state (in connect)\n return selector(instanceSelector(instanceId, state), rest);\n};","import assign from 'object-assign';\nexport var merge = function merge(a, b) {\n var result = assign({}, a, b);\n\n for (var key in a) {\n var _assign;\n\n if (!a[key] || typeof b[key] !== 'object') continue;\n assign(result, (_assign = {}, _assign[key] = assign(a[key], b[key]), _assign));\n }\n\n return result;\n}; // sort object-value responsive styles\n\nvar sort = function sort(obj) {\n var next = {};\n Object.keys(obj).sort(function (a, b) {\n return a.localeCompare(b, undefined, {\n numeric: true,\n sensitivity: 'base'\n });\n }).forEach(function (key) {\n next[key] = obj[key];\n });\n return next;\n};\n\nvar defaults = {\n breakpoints: [40, 52, 64].map(function (n) {\n return n + 'em';\n })\n};\n\nvar createMediaQuery = function createMediaQuery(n) {\n return \"@media screen and (min-width: \" + n + \")\";\n};\n\nvar getValue = function getValue(n, scale) {\n return get(scale, n, n);\n};\n\nexport var get = function get(obj, key, def, p, undef) {\n key = key && key.split ? key.split('.') : [key];\n\n for (p = 0; p < key.length; p++) {\n obj = obj ? obj[key[p]] : undef;\n }\n\n return obj === undef ? def : obj;\n};\nexport var createParser = function createParser(config) {\n var cache = {};\n\n var parse = function parse(props) {\n var styles = {};\n var shouldSort = false;\n var isCacheDisabled = props.theme && props.theme.disableStyledSystemCache;\n\n for (var key in props) {\n if (!config[key]) continue;\n var sx = config[key];\n var raw = props[key];\n var scale = get(props.theme, sx.scale, sx.defaults);\n\n if (typeof raw === 'object') {\n cache.breakpoints = !isCacheDisabled && cache.breakpoints || get(props.theme, 'breakpoints', defaults.breakpoints);\n\n if (Array.isArray(raw)) {\n cache.media = !isCacheDisabled && cache.media || [null].concat(cache.breakpoints.map(createMediaQuery));\n styles = merge(styles, parseResponsiveStyle(cache.media, sx, scale, raw, props));\n continue;\n }\n\n if (raw !== null) {\n styles = merge(styles, parseResponsiveObject(cache.breakpoints, sx, scale, raw, props));\n shouldSort = true;\n }\n\n continue;\n }\n\n assign(styles, sx(raw, scale, props));\n } // sort object-based responsive styles\n\n\n if (shouldSort) {\n styles = sort(styles);\n }\n\n return styles;\n };\n\n parse.config = config;\n parse.propNames = Object.keys(config);\n parse.cache = cache;\n var keys = Object.keys(config).filter(function (k) {\n return k !== 'config';\n });\n\n if (keys.length > 1) {\n keys.forEach(function (key) {\n var _createParser;\n\n parse[key] = createParser((_createParser = {}, _createParser[key] = config[key], _createParser));\n });\n }\n\n return parse;\n};\n\nvar parseResponsiveStyle = function parseResponsiveStyle(mediaQueries, sx, scale, raw, _props) {\n var styles = {};\n raw.slice(0, mediaQueries.length).forEach(function (value, i) {\n var media = mediaQueries[i];\n var style = sx(value, scale, _props);\n\n if (!media) {\n assign(styles, style);\n } else {\n var _assign2;\n\n assign(styles, (_assign2 = {}, _assign2[media] = assign({}, styles[media], style), _assign2));\n }\n });\n return styles;\n};\n\nvar parseResponsiveObject = function parseResponsiveObject(breakpoints, sx, scale, raw, _props) {\n var styles = {};\n\n for (var key in raw) {\n var breakpoint = breakpoints[key];\n var value = raw[key];\n var style = sx(value, scale, _props);\n\n if (!breakpoint) {\n assign(styles, style);\n } else {\n var _assign3;\n\n var media = createMediaQuery(breakpoint);\n assign(styles, (_assign3 = {}, _assign3[media] = assign({}, styles[media], style), _assign3));\n }\n }\n\n return styles;\n};\n\nexport var createStyleFunction = function createStyleFunction(_ref) {\n var properties = _ref.properties,\n property = _ref.property,\n scale = _ref.scale,\n _ref$transform = _ref.transform,\n transform = _ref$transform === void 0 ? getValue : _ref$transform,\n defaultScale = _ref.defaultScale;\n properties = properties || [property];\n\n var sx = function sx(value, scale, _props) {\n var result = {};\n var n = transform(value, scale, _props);\n if (n === null) return;\n properties.forEach(function (prop) {\n result[prop] = n;\n });\n return result;\n };\n\n sx.scale = scale;\n sx.defaults = defaultScale;\n return sx;\n}; // new v5 API\n\nexport var system = function system(args) {\n if (args === void 0) {\n args = {};\n }\n\n var config = {};\n Object.keys(args).forEach(function (key) {\n var conf = args[key];\n\n if (conf === true) {\n // shortcut definition\n config[key] = createStyleFunction({\n property: key,\n scale: key\n });\n return;\n }\n\n if (typeof conf === 'function') {\n config[key] = conf;\n return;\n }\n\n config[key] = createStyleFunction(conf);\n });\n var parser = createParser(config);\n return parser;\n};\nexport var compose = function compose() {\n var config = {};\n\n for (var _len = arguments.length, parsers = new Array(_len), _key = 0; _key < _len; _key++) {\n parsers[_key] = arguments[_key];\n }\n\n parsers.forEach(function (parser) {\n if (!parser || !parser.config) return;\n assign(config, parser.config);\n });\n var parser = createParser(config);\n return parser;\n};\n","import { get, system, compose } from '@styled-system/core';\nvar defaults = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512]\n};\n\nvar isNumber = function isNumber(n) {\n return typeof n === 'number' && !isNaN(n);\n};\n\nvar getMargin = function getMargin(n, scale) {\n if (!isNumber(n)) {\n return get(scale, n, n);\n }\n\n var isNegative = n < 0;\n var absolute = Math.abs(n);\n var value = get(scale, absolute, absolute);\n\n if (!isNumber(value)) {\n return isNegative ? '-' + value : value;\n }\n\n return value * (isNegative ? -1 : 1);\n};\n\nvar configs = {};\nconfigs.margin = {\n margin: {\n property: 'margin',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginTop: {\n property: 'marginTop',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginRight: {\n property: 'marginRight',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginBottom: {\n property: 'marginBottom',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginLeft: {\n property: 'marginLeft',\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginX: {\n properties: ['marginLeft', 'marginRight'],\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n },\n marginY: {\n properties: ['marginTop', 'marginBottom'],\n scale: 'space',\n transform: getMargin,\n defaultScale: defaults.space\n }\n};\nconfigs.margin.m = configs.margin.margin;\nconfigs.margin.mt = configs.margin.marginTop;\nconfigs.margin.mr = configs.margin.marginRight;\nconfigs.margin.mb = configs.margin.marginBottom;\nconfigs.margin.ml = configs.margin.marginLeft;\nconfigs.margin.mx = configs.margin.marginX;\nconfigs.margin.my = configs.margin.marginY;\nconfigs.padding = {\n padding: {\n property: 'padding',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingTop: {\n property: 'paddingTop',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingRight: {\n property: 'paddingRight',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingBottom: {\n property: 'paddingBottom',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingLeft: {\n property: 'paddingLeft',\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingX: {\n properties: ['paddingLeft', 'paddingRight'],\n scale: 'space',\n defaultScale: defaults.space\n },\n paddingY: {\n properties: ['paddingTop', 'paddingBottom'],\n scale: 'space',\n defaultScale: defaults.space\n }\n};\nconfigs.padding.p = configs.padding.padding;\nconfigs.padding.pt = configs.padding.paddingTop;\nconfigs.padding.pr = configs.padding.paddingRight;\nconfigs.padding.pb = configs.padding.paddingBottom;\nconfigs.padding.pl = configs.padding.paddingLeft;\nconfigs.padding.px = configs.padding.paddingX;\nconfigs.padding.py = configs.padding.paddingY;\nexport var margin = system(configs.margin);\nexport var padding = system(configs.padding);\nexport var space = compose(margin, padding);\nexport default space;\n","import { system, get } from '@styled-system/core';\n\nvar isNumber = function isNumber(n) {\n return typeof n === 'number' && !isNaN(n);\n};\n\nvar getWidth = function getWidth(n, scale) {\n return get(scale, n, !isNumber(n) || n > 1 ? n : n * 100 + '%');\n};\n\nvar config = {\n width: {\n property: 'width',\n scale: 'sizes',\n transform: getWidth\n },\n height: {\n property: 'height',\n scale: 'sizes'\n },\n minWidth: {\n property: 'minWidth',\n scale: 'sizes'\n },\n minHeight: {\n property: 'minHeight',\n scale: 'sizes'\n },\n maxWidth: {\n property: 'maxWidth',\n scale: 'sizes'\n },\n maxHeight: {\n property: 'maxHeight',\n scale: 'sizes'\n },\n size: {\n properties: ['width', 'height'],\n scale: 'sizes'\n },\n overflow: true,\n overflowX: true,\n overflowY: true,\n display: true,\n verticalAlign: true\n};\nexport var layout = system(config);\nexport default layout;\n","import { system } from '@styled-system/core';\nvar defaults = {\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512]\n};\nvar config = {\n position: true,\n zIndex: {\n property: 'zIndex',\n scale: 'zIndices'\n },\n top: {\n property: 'top',\n scale: 'space',\n defaultScale: defaults.space\n },\n right: {\n property: 'right',\n scale: 'space',\n defaultScale: defaults.space\n },\n bottom: {\n property: 'bottom',\n scale: 'space',\n defaultScale: defaults.space\n },\n left: {\n property: 'left',\n scale: 'space',\n defaultScale: defaults.space\n }\n};\nexport var position = system(config);\nexport default position;\n","import { system } from '@styled-system/core';\nvar config = {\n alignItems: true,\n alignContent: true,\n justifyItems: true,\n justifyContent: true,\n flexWrap: true,\n flexDirection: true,\n // item\n flex: true,\n flexGrow: true,\n flexShrink: true,\n flexBasis: true,\n justifySelf: true,\n alignSelf: true,\n order: true\n};\nexport var flexbox = system(config);\nexport default flexbox;\n","import styled from \"styled-components\";\nimport { compose } from \"@styled-system/core\";\nimport { space } from \"@styled-system/space\";\nimport { layout } from \"@styled-system/layout\";\nimport { position } from \"@styled-system/position\";\nimport { flexbox } from \"@styled-system/flexbox\";\n\n// Only import types\n// eslint-disable-next-line import/no-unresolved\n\n/**\n * A generic container with responsive props to control whitespace, layout, positioning and colors.\n */\nexport const Block = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1wbvlzm-0\"\n})({\n boxSizing: 'border-box',\n minWidth: 0\n}, compose(space, layout, position, flexbox));\nBlock.displayName = 'Block';\nexport default Block;","import Block from \"./Block\";\nexport default Block;","export default 'div';","import Box from \"./Box\";\nexport default Box;","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nexport const sizes = {\n large: css([\"height:56px;\"]),\n medium: css([\"height:48px;\"]),\n small: css([\"height:40px;padding:0 \", \"px;\"], theme.space.medium),\n withSubline: css([\"height:65px;\"])\n};\nexport const fontSizes = {\n large: css([\"font-size:\", \";\"], theme.fontSizes.large),\n medium: css([\"font-size:\", \";\"], theme.fontSizes.medium),\n small: css([\"font-size:\", \";\"], theme.fontSizes.normal),\n withSubline: css([\"font-size:\", \";\"], theme.fontSizes.medium)\n};\nexport const SPINNER_VARIANTS = {\n primary: 'white',\n secondary: 'blue',\n secondaryDarkBackground: 'white',\n plain: 'gray',\n link: 'gray',\n danger: 'gray',\n facebook: 'white',\n google: 'gray',\n apple: 'white'\n};","import styled, { css } from \"styled-components\";\nimport theme from \"../style-values\";\nimport { sizes, fontSizes } from \"./Button.styles.shared\";\nconst variants = {\n primary: css([\"color:\", \";background-color:\", \";border:1px solid transparent;&:hover{background-color:\", \";}@media screen and (hover:none){&:hover{background-color:\", \";}}&:active{background-color:\", \";}&:disabled{background-color:\", \";&:hover,&:active{background-color:\", \";}}\"], theme.colors.white, props => props.isLoading ? theme.colors.buttonBackgroundLoading : theme.colors.buttonBackground, theme.colors.buttonBackgroundHover, theme.colors.buttonBackground, theme.colors.buttonBackgroundActive, theme.colors.buttonBackgroundDisabled, theme.colors.buttonBackgroundDisabled),\n secondary: css([\"color:\", \";background-color:transparent;border:1px solid \", \";&:hover{background-color:\", \";}&:disabled{opacity:0.5;&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.deepBlue[400], theme.colors.palette.deepBlue[200], theme.colors.palette.gray[300]),\n secondaryDarkBackground: css([\"color:\", \";background-color:transparent;border:1px solid \", \";&:hover{background-color:\", \";}&:disabled{color:\", \";border:1px solid \", \";&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.gray[300], theme.colors.palette.deepBlue[200], theme.colors.palette.deepBlue[400], theme.colors.palette.deepBlue[300], theme.colors.palette.deepBlue[300]),\n plain: css([\"color:\", \";background-color:transparent;&:disabled{opacity:0.5;&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.coral[500]),\n link: css([\"color:\", \";background-color:transparent;text-decoration:underline;&:disabled{opacity:0.5;&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.deepBlue[400]),\n danger: css([\"color:\", \";background-color:transparent;border:1px solid \", \";&:disabled{opacity:0.5;&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.red[500], theme.colors.palette.red[400]),\n facebook: css([\"background-color:\", \";color:\", \";&:hover,&:active{background-color:\", \";}@media screen and (hover:none){&:hover{background-color:\", \";}}&:disabled{opacity:0.5;&:hover,&:active{background-color:\", \";opacity:0.5;}}\"], theme.colors.brandColors.facebook, theme.colors.white, theme.colors.brandColors.facebookActive, theme.colors.brandColors.facebook, theme.colors.brandColors.facebook),\n google: css([\"color:\", \";background-color:transparent;border:1px solid \", \";&:hover,&:active{background-color:\", \";}@media screen and (hover:none){&:hover{background-color:transparent;}}&:disabled{opacity:0.5;&:hover,&:active{background-color:transparent;opacity:0.5;}}\"], theme.colors.palette.deepBlue[400], theme.colors.palette.deepBlue[200], theme.colors.palette.gray[300]),\n apple: css([\"background-color:\", \";color:\", \";&:hover,&:active{background-color:\", \";}@media screen and (hover:none){&:hover{background-color:\", \";}}&:disabled{opacity:0.5;&:hover,&:active{background-color:\", \";opacity:0.5;}}\"], theme.colors.brandColors.apple, theme.colors.white, theme.colors.brandColors.apple, theme.colors.brandColors.apple, theme.colors.brandColors.apple)\n};\nexport const ButtonBase = /*#__PURE__*/styled.button.withConfig({\n componentId: \"sc-1zrbee-0\"\n})([\"width:\", \";max-width:\", \";display:flex;text-align:center;line-height:\", \";padding:0 \", \"px;border:0;border-radius:\", \";cursor:pointer;font-family:\", \";font-weight:\", \";appearance:none;box-shadow:none;position:relative;overflow:hidden;z-index:2;align-items:center;justify-content:center;text-decoration:none;-webkit-font-smoothing:antialiased;transition:background-color 0.2s linear;pointer-events:\", \";&:disabled{cursor:not-allowed;}\", \";\", \";\", \";\"], props => props.autoWidth ? 'auto' : '100%', props => props.autoWidth ? '100%' : undefined, theme.lineHeights.normal, theme.space.medium, theme.radii.normal, theme.fonts.regular, theme.fontWeights.medium, props => props.isLoading ? 'none' : undefined, props => props.variant && variants[props.variant], props => props.size && sizes[props.size], props => props.size && fontSizes[props.size]);\nconst contentsLoadingStyles = /*#__PURE__*/css([\"display:flex;align-items:center;justify-content:center;\"]);\nexport const Contents = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1zrbee-1\"\n})([\"width:100%;z-index:1;position:relative;order:1;\", \";\"], props => props.isLoading && contentsLoadingStyles);\nexport const Subline = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1zrbee-2\"\n})([\"font-size:\", \";font-weight:\", \";\"], theme.fontSizes.small, theme.fontWeights.normal);\nexport const Icon = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1zrbee-3\"\n})([\"height:\", \"px;width:\", \"px;margin:0 \", \"px;order:\", \";\"], theme.iconSizes.small, theme.iconSizes.small, theme.space.tiny, props => props.iconPosition === 'left' ? 1 : 2);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport Spinner from \"../Spinner\";\nimport { ButtonBase, Contents, Subline, Icon } from \"./Button.styles\";\nimport { SPINNER_VARIANTS } from \"./Button.styles.shared\";\nconst getProps = props => {\n if (props.useAnchorTag && 'href' in props) {\n return {\n as: 'a',\n href: props.href\n };\n }\n if (props.useRouter && 'href' in props) {\n return {\n as: Link,\n to: props.href\n };\n }\n return {\n as: 'button'\n };\n};\nconst Button = ({\n useAnchorTag,\n useRouter,\n loading = false,\n variant = 'primary',\n size = 'medium',\n subline = null,\n autoWidth = false,\n type = 'button',\n children,\n icon,\n iconPosition,\n ...rest\n}) => {\n const {\n as,\n to,\n href\n } = getProps({\n useAnchorTag,\n useRouter,\n ...rest\n });\n return /*#__PURE__*/React.createElement(ButtonBase, _extends({\n as: as,\n to: to,\n href: href,\n isLoading: loading,\n autoWidth: autoWidth,\n variant: variant,\n size: size,\n type: type\n }, rest), !loading && icon && /*#__PURE__*/React.createElement(Icon, {\n iconPosition: iconPosition\n }, icon), /*#__PURE__*/React.createElement(Contents, {\n isLoading: loading\n }, loading ? /*#__PURE__*/React.createElement(Spinner, {\n variant: SPINNER_VARIANTS[variant]\n }) : children, !loading && subline && /*#__PURE__*/React.createElement(Subline, null, subline)));\n};\nexport default Button;","import styled, { css } from \"styled-components\";\nimport theme from \"../../style-values\";\nconst checkedCss = /*#__PURE__*/css([\"&::before{border-color:\", \";background:\", \";}&::after{border-color:\", \";transform:rotate(-48deg) scale(1);}&:active{&::before{background:\", \";}}\"], theme.colors.checkboxCheckedBorderColor, theme.colors.checkboxBackgroundColor, theme.colors.white, theme.colors.checkboxActiveBackground);\nconst disabledCss = /*#__PURE__*/css([\"&::before{border-color:\", \";background:\", \";}&\", \"::before{background:\", \";}&:active{&::before{background:\", \";}}\"], theme.colors.buttonDisabled, theme.colors.checkboxDisabledBackground, checkedCss, theme.colors.checkboxDisabledCheckedBackground, theme.colors.checkboxDisabledCheckedBackground);\nconst requiredCss = /*#__PURE__*/css([\"background-color:\", \";&::before{border-color:\", \";}\"], theme.colors.checkboxRequiredBackground, theme.colors.checkboxRequiredBorder);\nexport const CheckboxWrapper = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-1sn3ny5-0\"\n})([\"display:block;position:relative;\"]);\nexport const CheckboxControl = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-1sn3ny5-1\"\n})([\"display:block;margin:0;position:relative;width:24px;height:24px;border-radius:6px;pointer-events:none;&::before{box-sizing:border-box;display:block;content:'';width:100%;height:100%;border:2px solid \", \";border-radius:6px;background:inherit;transition:background 0.12s ease-in-out;}&::after{box-sizing:border-box;display:block;content:'';border:solid transparent;transform:rotate(-48deg) scale(0);position:absolute;transition:transform 0.12s ease-in-out,border-color 0.12s ease-in-out;width:15px;padding-top:5px;border-width:0 0 2px 2px;top:7px;left:5px;}input:active + &,input:focus-visible + &{&::before{background:#bfdaea;}}input:checked + &{\", \"}input:disabled + &{\", \"}input:required + &{\", \"}\"], theme.colors.checkboxBorderColor, checkedCss, disabledCss, requiredCss);\nexport const DefaultCheckbox = /*#__PURE__*/styled.input.withConfig({\n componentId: \"sc-1sn3ny5-2\"\n})([\"appearance:none;position:absolute;width:24px;height:24px;top:0;left:0;margin:0;opacity:0;&:enabled{cursor:pointer;}\"]);","import React from \"react\";\nimport { CheckboxWrapper, CheckboxControl, DefaultCheckbox } from \"./Checkbox.styles\";\nexport const Checkbox = ({\n checked,\n clickEventName = 'onChange',\n disabled,\n id,\n name,\n onChange,\n required = false,\n tabIndex,\n 'aria-label': ariaLabel,\n 'data-e2e': dataE2E\n}) => /*#__PURE__*/React.createElement(CheckboxWrapper, {\n \"data-component\": \"checkbox\"\n}, /*#__PURE__*/React.createElement(DefaultCheckbox, {\n type: \"checkbox\",\n \"data-e2e\": dataE2E,\n \"aria-label\": ariaLabel,\n id: id,\n tabIndex: tabIndex,\n name: name,\n checked: checked,\n disabled: disabled,\n required: !checked && required,\n [clickEventName]: onChange\n}), /*#__PURE__*/React.createElement(CheckboxControl, null));\nexport default Checkbox;","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { useState, useEffect, useRef } from \"react\";\nimport CheckBox from \"./Checkbox\";\nconst CheckboxWrapper = ({\n checked,\n stopPropagation,\n onChange,\n ...rest\n}) => {\n const [checkedFlag, setCheckedFlag] = useState(checked);\n const isComponentJustMounted = useRef(true);\n useEffect(() => {\n if (!isComponentJustMounted.current && typeof checked !== 'undefined') {\n setCheckedFlag(checked);\n }\n isComponentJustMounted.current = false;\n }, [checked]);\n const toggle = e => {\n if (stopPropagation) {\n e.stopPropagation();\n }\n if (rest.disabled) {\n return;\n }\n const val = !checkedFlag;\n onChange(val);\n setCheckedFlag(val);\n };\n return /*#__PURE__*/React.createElement(CheckBox, _extends({\n checked: checkedFlag,\n onChange: toggle\n }, rest));\n};\nexport default CheckboxWrapper;","import { css } from \"styled-components\";\nexport const ContainerCss = /*#__PURE__*/css([\"display:flex;align-items:center;flex-direction:\", \";\"], ({\n alignLeft\n}) => alignLeft ? 'row-reverse' : 'row');\nexport const CheckboxAlignTopCss = /*#__PURE__*/css([\"\", \"\"], ({\n alignTop\n}) => alignTop && `align-self: flex-start;`);\nexport const TitleCss = /*#__PURE__*/css([\"flex:1;\", \"\"], ({\n alignLeft\n}) => alignLeft && `margin-left: 10px;`);","import styled from \"styled-components\";\nimport { ContainerCss, CheckboxAlignTopCss, TitleCss } from \"./CheckboxWithTitle.styles.shared\";\nexport const Wrapper = /*#__PURE__*/styled.label.withConfig({\n componentId: \"sc-1ouovmv-0\"\n})([\"cursor:\", \";\", \"\"], props => props.disabled ? undefined : 'pointer', ContainerCss);\nexport const CheckboxContainer = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-1ouovmv-1\"\n})([\"\", \"\"], CheckboxAlignTopCss);\nexport const Title = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1ouovmv-2\"\n})([\"\", \"\"], TitleCss);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport CheckboxWrapper from \"../CheckboxComponent/CheckboxWrapper\";\nimport { CheckboxContainer, Title, Wrapper } from \"./CheckboxWithTitle.styles\";\nconst CheckboxWithTitle = ({\n align,\n children,\n disabled,\n clickEventName = 'onChange',\n checkboxAlign = 'center',\n ...rest\n}) => {\n const toggle = () => {\n if (!disabled) {\n rest.onChange(!rest.checked);\n }\n };\n return /*#__PURE__*/React.createElement(Wrapper, {\n alignLeft: align === 'left',\n disabled: disabled,\n [clickEventName]: toggle\n }, /*#__PURE__*/React.createElement(Title, {\n alignLeft: align === 'left'\n }, children), /*#__PURE__*/React.createElement(CheckboxContainer, {\n alignTop: checkboxAlign === 'top'\n }, /*#__PURE__*/React.createElement(CheckboxWrapper, _extends({\n stopPropagation: true,\n disabled: disabled\n }, rest))));\n};\nexport default CheckboxWithTitle;","import Checkbox from \"./CheckboxComponent/CheckboxWrapper\";\nexport default Checkbox;\nexport { default as CheckboxWithTitle } from \"./CheckboxWithTitle/CheckboxWithTitle\";","export const dividerDefaultProps = {\n dotted: false,\n darker: false,\n transparent: false\n};","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nimport Box from \"../Box\";\nimport { dividerDefaultProps } from \"./Divider.props\";\nconst Divider = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-1u8j31h-0\"\n})([\"height:0;border-width:0;border-radius:1px;border-top-width:\", \";border-style:\", \";border-top-color:\", \";margin:\", \"px 0;\"], props => props.transparent ? '0px' : '1px', props => props.dotted ? 'dotted' : 'solid', props => props.darker ? theme.colors.dividerDark : theme.colors.divider, theme.space.medium);\nDivider.defaultProps = dividerDefaultProps;\nexport default Divider;","import Divider from \"./Divider\";\nexport default Divider;","import styled from \"styled-components\";\nimport Block from \"../Block/Block\";\n/**\n * A responsive Flexbox container, based on the `Block` component but has\n * `display: flex` by default.\n */\nexport const Flex = /*#__PURE__*/styled(Block).withConfig({\n componentId: \"sc-1xrej87-0\"\n})({\n display: 'flex'\n});\nFlex.displayName = 'Flex';\nexport default Flex;","import Flex from \"./Flex\";\nexport default Flex;","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nconst getSize = index => ({\n size\n}) => {\n const key = Array.isArray(size) ? size[index] : size;\n return key ? theme.iconSizes[key] : undefined;\n};\n\n/**\n * Sets the icon size and color cross-platform.\n */\nexport const IconContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-ewnxdc-0\"\n})([\"display:flex;align-items:center;justify-content:center;height:\", \"px;width:\", \"px;color:\", \";line-height:1;vertical-align:middle;flex-shrink:0;\", \"{height:\", \"px;width:\", \"px;}\", \"{height:\", \"px;width:\", \"px;}\", \"{height:\", \"px;width:\", \"px;}svg{width:100%;height:100%;}\"], getSize(0), getSize(0), props => props.color || theme.colors.iconColor, theme.mediaQueries.mobileOnly, getSize(1), getSize(1), theme.mediaQueries.tabletAndLarger, getSize(2), getSize(2), theme.mediaQueries.desktop, getSize(3), getSize(3));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Back = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.634 12l7.043 7.043A1.115 1.115 0 1 1 15.1 20.62l-7.777-7.778A1.112 1.112 0 0 1 6.998 12c-.015-.303.093-.61.325-.842L15.1 3.38a1.115 1.115 0 0 1 1.577 1.577L9.634 12z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Card = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\"\n}, props), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2zm0 3v8a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V8a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1zm0 1h16v2H4V9z\",\n id: \"Card__a\"\n})), /*#__PURE__*/React.createElement(\"use\", {\n fill: \"currentColor\",\n xlinkHref: \"#Card__a\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Close = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\"\n}, props), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.192 11.778l5.657 5.657a1 1 0 0 1-1.414 1.414l-5.657-5.657-5.657 5.657a1 1 0 1 1-1.414-1.414l5.657-5.657-5.657-5.657a1 1 0 0 1 1.414-1.414l5.657 5.657 5.657-5.657a1 1 0 0 1 1.414 1.414l-5.657 5.657z\",\n id: \"Close__a\"\n})), /*#__PURE__*/React.createElement(\"use\", {\n fill: \"currentColor\",\n xlinkHref: \"#Close__a\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Dropdown = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 14.121l6.364-6.364a1 1 0 0 1 1.414 1.415l-7.07 7.07a.997.997 0 0 1-1.415 0l-7.071-7.07a1 1 0 1 1 1.414-1.415L12 14.121z\",\n fill: \"currentColor\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Exclamation = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n d: \"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10zm-11 2c0 1.333 2 1.333 2 0V7c0-1.333-2-1.333-2 0zm1 4c1.333 0 1.333-2 0-2s-1.333 2 0 2z\",\n clipRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Info = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-4a1 1 0 0 0 1-1v-7a1 1 0 0 0-2 0v7a1 1 0 0 0 1 1zm0-12a1 1 0 1 0 0 2 1 1 0 0 0 0-2z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Person = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"circle\", {\n cx: 12,\n cy: 7,\n r: 4,\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M20.963 20.402c.04.329-.23.598-.56.598H3.597c-.332 0-.6-.27-.561-.598C3.396 17.38 6.384 13 12 13s8.604 4.38 8.963 7.402z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Search = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\",\n xmlnsXlink: \"http://www.w3.org/1999/xlink\"\n}, props), /*#__PURE__*/React.createElement(\"defs\", null, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\",\n id: \"Search__a\"\n})), /*#__PURE__*/React.createElement(\"use\", {\n fill: \"currentColor\",\n xlinkHref: \"#Search__a\",\n fillRule: \"evenodd\"\n}));","import _extends from \"@babel/runtime/helpers/extends\";\nimport * as React from \"react\";\nexport const Tick = props => /*#__PURE__*/React.createElement(\"svg\", _extends({\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n d: \"M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10zm-4.409-3.814l-.01-.01-.01-.01a.604.604 0 0 0-.854.021L9.946 15.29a.31.31 0 0 1-.448 0l-2.444-2.577-.01-.011a.603.603 0 0 0-.853 0l-.009.009a.619.619 0 0 0-.009.865l3.102 3.234a.619.619 0 0 0 .893 0L17.6 9.051a.619.619 0 0 0-.009-.866z\",\n fill: \"currentColor\"\n}));","import styled from \"styled-components\";\nexport const toPixels = value => typeof value === 'string' ? value : `${value}px`;\nexport const ImageResized = /*#__PURE__*/styled.img.withConfig({\n componentId: \"sc-1gagufp-0\"\n})([\"\", \";\", \";\", \"\"], ({\n height\n}) => height && `height: ${toPixels(height)};`, ({\n width\n}) => width && `width: ${toPixels(width)};`, ({\n resizeMode\n}) => {\n const dimensions = `height: 100%; width: 100%;`;\n switch (resizeMode) {\n case 'cover':\n return `${dimensions} object-fit: cover`;\n case 'contain':\n return `${dimensions} object-fit: contain`;\n case 'stretch':\n return `${dimensions} object-fit: fill`;\n case 'repeat':\n return `${dimensions}`;\n // no equivalent for web\n case 'center':\n return `${dimensions} object-fit: contain`;\n default:\n return ``;\n }\n});","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport { ImageResized } from \"./Image.style\";\nconst Image = ({\n src,\n onError,\n height,\n width,\n alt,\n resizeMode,\n ...rest\n}) => /*#__PURE__*/React.createElement(ImageResized, _extends({\n src: src,\n height: height,\n width: width,\n onError: onError,\n alt: alt,\n resizeMode: resizeMode\n}, rest));\nexport default Image;","import Image from \"./Image\";\nexport default Image;","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nexport const getBorderRadiusStyles = option => {\n const radius = `${theme.radii.normal}`;\n const allSides = /*#__PURE__*/css([\"border-radius:\", \";\"], radius);\n const leftSides = /*#__PURE__*/css([\"border-top-left-radius:\", \";border-bottom-left-radius:\", \";\"], radius, radius);\n const rightSides = /*#__PURE__*/css([\"border-top-right-radius:\", \";border-bottom-right-radius:\", \";\"], radius, radius);\n switch (option) {\n case 'start':\n return leftSides;\n case 'end':\n return rightSides;\n case 'none':\n return css([\"border-radius:0;\"]);\n default:\n return allSides;\n }\n};","import styled, { css } from \"styled-components\";\nimport theme from \"../style-values\";\nimport { getBorderRadiusStyles } from \"./Input.styles.shared\";\nexport const InputContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-auaxqp-0\"\n})([\"position:relative;width:100%;\"]);\nexport const Icon = /*#__PURE__*/styled.span.withConfig({\n componentId: \"sc-auaxqp-1\"\n})([\"position:absolute;top:12px;height:24px;width:24px;display:flex;align-items:center;justify-content:center;\", \"\"], ({\n placement\n}) => placement === 'before' ? `left: ${theme.space.medium}px;` : `right: ${theme.space.medium}px;`);\nexport const InputBox = /*#__PURE__*/styled.input.withConfig({\n componentId: \"sc-auaxqp-2\"\n})(({\n iconBeforeInput,\n iconAfterInput,\n isInvalid,\n isDarkBackground,\n borderRadiusOption\n}) => [css([\"appearance:none;box-sizing:border-box;display:block;width:100%;color:\", \";background-color:\", \";\", \" border:1px solid transparent;height:48px;padding:0 16px;font-size:\", \";letter-spacing:0.3;line-height:24px;transition:all 300ms ease;text-overflow:ellipsis;&:active,&:focus{outline:none;box-shadow:none;border-color:\", \";}&:disabled{color:\", \";background-color:\", \";border-color:\", \";opacity:1;text-overflow:unset;}&::placeholder{color:\", \";}&[type='number']::-webkit-outer-spin-button,&[type='number']::-webkit-inner-spin-button{appearance:none;margin:0;}&[type='time']::-webkit-calendar-picker-indicator{background:none;display:none;}\"], theme.colors.bodyText, theme.colors.inputBackground, getBorderRadiusStyles(borderRadiusOption), theme.fontSizes.medium, theme.colors.disabledText, theme.colors.disabledText, theme.colors.inputBackgroundDisabled, theme.colors.divider, theme.colors.disabledText), iconBeforeInput && css([\"padding-left:48px;\"]), iconAfterInput && css([\"padding-right:48px;\"]), isInvalid && css([\"border-color:\", \";background-color:\", \";color:\", \";&:active,&:focus{border-color:\", \";color:\", \";}\"], theme.colors.inputBorderInvalid, theme.colors.inputBackgroundInvalid, theme.colors.bodyText, theme.colors.inputBorderInvalid, theme.colors.bodyText), isDarkBackground && css([\"background-color:\", \";&:active,&:focus{border-color:\", \";}\"], theme.colors.inputBackgroundDarkBackground, theme.colors.inputBorderColorDarkBackground)]);\nexport const GradientOverlay = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-auaxqp-3\"\n})([\"position:absolute;top:0;bottom:0;width:50px;background:linear-gradient(to left,#f1f2f6 0%,rgba(241,242,246,0) 100%);pointer-events:none;\", \" \", \"\"], ({\n withIconAfterInput\n}) => withIconAfterInput ? `right: ${theme.space.xxlarge}px;` : `right: 0;`, ({\n borderRadiusOption,\n withIconAfterInput\n}) => !withIconAfterInput && getBorderRadiusStyles(borderRadiusOption));","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { forwardRef, useState } from \"react\";\nimport theme from \"../style-values\";\nimport { InputBox, GradientOverlay, InputContainer, Icon } from \"./Input.styles\";\nconst Input = ({\n type = 'text',\n onChangeText,\n onChange,\n onPress,\n testID,\n accessibilityLabel,\n accessibilityLabelledBy,\n borderRadiusOption,\n disabled,\n iconBeforeInput,\n iconAfterInput,\n isInvalid,\n label,\n // children is RN only\n // eslint-disable-next-line\n children,\n useOverflowGradient,\n onFocus,\n onBlur,\n ...rest\n}, ref) => {\n const [isFocused, setIsFocused] = useState(false);\n const handleFocus = e => {\n setIsFocused(true);\n onFocus?.(e);\n };\n const handleBlur = e => {\n setIsFocused(false);\n onBlur?.(e);\n };\n return /*#__PURE__*/React.createElement(InputContainer, null, /*#__PURE__*/React.createElement(InputBox, _extends({\n onClick: onPress\n }, rest, {\n onFocus: handleFocus,\n onBlur: handleBlur,\n borderRadiusOption: borderRadiusOption,\n disabled: disabled,\n isInvalid: isInvalid,\n ref: ref,\n type: type,\n iconBeforeInput: iconBeforeInput,\n iconAfterInput: iconAfterInput,\n onChange: e => {\n onChangeText?.(e?.target?.value || '');\n onChange?.(e);\n },\n \"data-e2e\": testID,\n testID: testID,\n \"aria-label\": accessibilityLabel || (typeof label === 'string' ? label : undefined),\n \"aria-labelledby\": accessibilityLabelledBy\n })), !isFocused && !disabled && !isInvalid && useOverflowGradient && /*#__PURE__*/React.createElement(GradientOverlay, {\n borderRadiusOption: borderRadiusOption,\n withIconAfterInput: !!iconAfterInput\n }), iconBeforeInput && /*#__PURE__*/React.createElement(Icon, {\n style: {\n color: disabled ? theme.colors.disabledText : theme.colors.iconColor\n },\n placement: \"before\"\n }, iconBeforeInput), iconAfterInput && /*#__PURE__*/React.createElement(Icon, {\n style: {\n color: disabled ? theme.colors.disabledText : theme.colors.iconColor\n },\n placement: \"after\"\n }, iconAfterInput));\n};\nexport default /*#__PURE__*/forwardRef(Input);","import Input from \"./Input\";\nexport default Input;","import styled, { keyframes } from \"styled-components\";\nimport Box from \"../Box\";\nconst waveAnimation = /*#__PURE__*/keyframes([\"0%{background-position:0 0;}100%{background-position:-200% 0;}\"]);\nexport const LoadingBackgroundWrapper = /*#__PURE__*/styled(Box).withConfig({\n componentId: \"sc-vrtfgc-0\"\n})([\"height:100%;position:relative;background-size:200% 100%;animation-name:\", \";animation-duration:1.5s;animation-iteration-count:infinite;animation-timing-function:linear;animation-fill-mode:forwards;background-image:\", \";\"], waveAnimation, props => props.backgroundImage);","import React from \"react\";\nimport theme from \"../style-values\";\nimport { LoadingBackgroundWrapper } from \"./LoadingBackground.styles\";\nconst LoadingBackground = ({\n children,\n mainColor = theme.colors.palette.gray[400],\n waveColor = theme.colors.palette.gray[450]\n}) => {\n const backgroundImage = `linear-gradient(to right, ${mainColor} 8%, ${waveColor} 17%, ${mainColor} 31%)`;\n return /*#__PURE__*/React.createElement(LoadingBackgroundWrapper, {\n backgroundImage: backgroundImage\n }, children);\n};\nexport default LoadingBackground;","import LoadingBackground from \"./LoadingBackground\";\nexport default LoadingBackground;","import styled from \"styled-components\";\nimport theme from \"../../../style-values\";\nconst Overlay = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1qidt7g-0\"\n})([\"height:100%;width:100%;position:fixed;z-index:1500;left:0;top:0;background-color:\", \";overflow-x:hidden;\"], theme.colors.modalOverlay);\nexport default Overlay;","import styled, { css } from \"styled-components\";\nexport const TRANSITION_TIMEOUT = 200;\nconst transition = (...properties) => properties.map(property => `${property} ${TRANSITION_TIMEOUT}ms ease-in-out`).join(', ');\nconst enter = /*#__PURE__*/css([\"opacity:1;padding-top:0;height:100%;\"]);\nconst exit = /*#__PURE__*/css([\"opacity:0;padding-top:50px;height:calc(100vh + 50px);pointer-events:none;\"]);\nconst STATE_TRANSITION_MAP = {\n entering: enter,\n entered: enter,\n exiting: exit,\n exited: exit,\n unmounted: exit\n};\nexport const AnimateStyles = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-z3v386-0\"\n})([\"& > *{transition:\", \";\", \"}\"], transition('opacity', 'padding-top', 'height'), props => STATE_TRANSITION_MAP[props.state] || '');","import React from \"react\";\nimport Transition from \"react-transition-group/Transition\";\nimport { TRANSITION_TIMEOUT, AnimateStyles } from \"./Animate.styles\";\n\n// this is needed to work around the condition where styles are not applied fast\n// enough for the transition to happen on enter:\n// https://github.com/reactjs/react-transition-group/issues/159#issuecomment-322735285\nconst forceReflow = node => node.scrollTop;\nconst Animate = ({\n show,\n alwaysMounted = false,\n children,\n onDismiss\n}) => /*#__PURE__*/React.createElement(Transition, {\n in: show,\n timeout: TRANSITION_TIMEOUT,\n appear: true,\n mountOnEnter: !alwaysMounted,\n unmountOnExit: !alwaysMounted,\n onEnter: forceReflow,\n onExit: onDismiss\n}, state => /*#__PURE__*/React.createElement(AnimateStyles, {\n state: state\n}, children));\nexport default Animate;","import { useEffect } from \"react\";\nexport const useHotKey = (keyCode, onPress) => {\n useEffect(() => {\n if (!onPress) {\n return () => {};\n }\n const onKeyPress = event => {\n if (event.keyCode === keyCode) {\n onPress(event);\n event.preventDefault();\n }\n };\n document.addEventListener('keydown', onKeyPress);\n return () => {\n document.removeEventListener('keydown', onKeyPress);\n };\n }, [keyCode, onPress]);\n};\nexport const KEY_CODES = {\n ESC: 27\n};","import styled from \"styled-components\";\nimport theme from \"../../../style-values\";\nexport const StyledContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-reiw1m-0\"\n})([\"flex-grow:1;background-color:\", \";border-radius:8px;\", \" display:flex;flex-direction:column;max-width:100%;width:100%;height:auto;max-height:100%;position:relative;overflow:hidden;\"], theme.colors.white, theme.shadows.lifted);","import React from \"react\";\nimport { useOnClickOutside } from \"../../../helpers/useOnClickOutside\";\nimport { StyledContainer } from \"./Container.styles\";\nconst noop = () => {};\nexport const Container = ({\n children,\n onClickOutside\n}) => {\n const ref = useOnClickOutside(onClickOutside || noop);\n return /*#__PURE__*/React.createElement(StyledContainer, {\n id: \"largeModal\",\n role: \"dialog\",\n \"aria-labelledby\": \"header\",\n ref: ref\n }, children);\n};","import styled from \"styled-components\";\nexport const ContainerWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-lss2rs-0\"\n})([\"max-width:\", \";padding:30px;margin:0 auto;height:100%;display:flex;align-items:center;justify-content:center;\"], ({\n widthVariant\n}) => widthVariant === 'wide' ? '780px' : '607px');\nexport const FullScreenContainer = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-lss2rs-1\"\n})([\"width:100vw;height:100%;background:white;display:flex;flex-direction:column;\"]);","import React from \"react\";\nimport { useResponsive } from \"../../helpers/useResponsive\";\nimport { Container } from \"../components/Container/Container\";\nimport { ContainerWrapper, FullScreenContainer } from \"./ResponsiveContainer.styles\";\nconst FloatingContainer = props => {\n return /*#__PURE__*/React.createElement(ContainerWrapper, {\n widthVariant: props.widthVariant\n }, /*#__PURE__*/React.createElement(Container, props));\n};\nexport const ResponsiveContainer = props => {\n const viewport = useResponsive();\n const SelectedContainer = viewport === 'MOBILE' ? FullScreenContainer : FloatingContainer;\n return /*#__PURE__*/React.createElement(SelectedContainer, props);\n};","export const getHiddenContent = ({\n contentHeight,\n layoutHeight,\n scrollTop\n}) => {\n const topHidden = scrollTop > 0;\n const bottomHidden = layoutHeight !== contentHeight && scrollTop < contentHeight - layoutHeight;\n return {\n topHidden,\n bottomHidden\n };\n};","import styled from \"styled-components\";\nimport theme from \"../../../style-values\";\nconst Shadow = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-oitpue-0\"\n})([\"position:absolute;height:1px;width:100%;transition:box-shadow 0.15s;\", \";\"], props => props.visible ? theme.shadows.hiddenContent : '');\nexport const TopShadow = /*#__PURE__*/styled(Shadow).withConfig({\n componentId: \"sc-oitpue-1\"\n})([\"top:-1px;\"]);\nexport const BottomShadow = /*#__PURE__*/styled(Shadow).withConfig({\n componentId: \"sc-oitpue-2\"\n})([\"bottom:-1px;\"]);","import styled from \"styled-components\";\nimport theme from \"../../../style-values\";\nimport { containerPadding } from \"../../../style-values/spacing\";\nexport const Wrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-11x35ob-0\"\n})([\"position:relative;display:flex;flex-direction:column;overflow:hidden;flex-grow:1;background-color:\", \";\", \"{flex-grow:0;}\"], props => props.backgroundColor, theme.mediaQueries.tabletAndLarger);\nexport const Content = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-11x35ob-1\"\n})([\"flex-grow:1;overflow-y:auto;padding:\", \";\", \"{padding:\", \";}\"], props => props.fullWidth ? '0' : `0 ${containerPadding.mobile}`, theme.mediaQueries.tabletAndLarger, props => props.fullWidth ? '0' : `0 ${containerPadding.tabletAndLarger}`);","import React from \"react\";\nimport { useDOMHiddenContent } from \"./useHiddenContent/useDOMHiddenContent\";\nimport { TopShadow, BottomShadow } from \"./Shadow\";\nimport { Wrapper, Content } from \"./Body.styles\";\nconst Body = ({\n children,\n fullWidth = false,\n withScrollView = true,\n showBottomShadow = false,\n backgroundColor\n}) => {\n const [ref, topHidden, bottomHidden] = useDOMHiddenContent();\n return /*#__PURE__*/React.createElement(Wrapper, {\n backgroundColor: backgroundColor\n }, /*#__PURE__*/React.createElement(Content, {\n ref: ref,\n fullWidth: fullWidth,\n withScrollView: withScrollView\n }, children), /*#__PURE__*/React.createElement(TopShadow, {\n visible: topHidden\n }), /*#__PURE__*/React.createElement(BottomShadow, {\n visible: showBottomShadow || bottomHidden\n }));\n};\nexport default Body;","import { useRef, useState, useEffect } from \"react\";\nimport throttle from \"lodash/throttle\";\nimport { getHiddenContent } from \"./getHiddenContent\";\nexport const useDOMHiddenContent = () => {\n const ref = useRef(null);\n const [topHidden, setTopHidden] = useState(false);\n const [bottomHidden, setBottomHidden] = useState(false);\n const onScroll = throttle(() => {\n if (!ref.current) {\n return;\n }\n const {\n scrollHeight,\n clientHeight,\n scrollTop\n } = ref.current;\n const result = getHiddenContent({\n contentHeight: scrollHeight,\n layoutHeight: clientHeight,\n scrollTop\n });\n setTopHidden(result.topHidden);\n setBottomHidden(result.bottomHidden);\n }, 250);\n useEffect(() => {\n if (!ref.current) {\n return () => {};\n }\n ref.current.addEventListener('scroll', onScroll);\n onScroll();\n return () => {\n if (ref.current) {\n ref.current.removeEventListener('scroll', onScroll);\n }\n onScroll.cancel();\n };\n }, [ref.current]);\n return [ref, topHidden, bottomHidden];\n};","import React, { useCallback } from \"react\";\nimport Overlay from \"../components/Overlay/Overlay\";\nimport Animate from \"../components/Animate/Animate\";\nimport { useHotKey, KEY_CODES } from \"../../helpers/useHotKey\";\nimport { withPortal } from \"../../helpers/withPortal\";\nimport { useBodyLock } from \"../../helpers/useBodyLock\";\nimport { TRANSITION_TIMEOUT } from \"../components/Animate/Animate.styles\";\nimport { ResponsiveContainer } from \"./ResponsiveContainer\";\nimport Body from \"./Body/Body\";\nexport const LargeModal = ({\n children,\n header,\n footer,\n visible = false,\n alwaysMounted = false,\n widthVariant = 'default',\n onClose,\n fullWidth,\n showBottomShadow = false,\n backgroundColor,\n ...rest\n}) => {\n useHotKey(KEY_CODES.ESC, useCallback(() => visible && onClose?.(), [visible, onClose]));\n useBodyLock(visible, TRANSITION_TIMEOUT);\n return /*#__PURE__*/React.createElement(Animate, {\n show: visible,\n alwaysMounted: alwaysMounted\n }, /*#__PURE__*/React.createElement(Overlay, rest, /*#__PURE__*/React.createElement(ResponsiveContainer, {\n widthVariant: widthVariant,\n onClickOutside: onClose\n }, header && /*#__PURE__*/React.createElement(\"div\", {\n id: \"header\"\n }, /*#__PURE__*/React.cloneElement(header, {\n __onClose: onClose\n })), /*#__PURE__*/React.createElement(Body, {\n fullWidth: fullWidth,\n showBottomShadow: showBottomShadow,\n backgroundColor: backgroundColor\n }, children), footer)));\n};\nexport default withPortal(LargeModal);","import React, { useState, useEffect } from \"react\";\nimport ReactDOM from \"react-dom\";\nexport const withPortal = Component => {\n return props => {\n const [showChildren, setShowChildren] = useState(false);\n useEffect(() => {\n setShowChildren(true);\n }, []);\n if (!showChildren) {\n return null;\n }\n const instance = /*#__PURE__*/React.createElement(Component, props);\n return /*#__PURE__*/ReactDOM.createPortal(instance, document.body);\n };\n};","import { useEffect } from \"react\";\nexport function useBodyLock(locked, timeout) {\n useEffect(() => {\n let resetBodyOverflow = () => {};\n const documentBody = document.querySelector('body');\n // fixed position takes the header out of the content flow, its own padding must be applied\n const fixedHeader = Array.from(document.querySelectorAll('header')).find(el => getComputedStyle(el).getPropertyValue('position') === 'fixed');\n if (locked && documentBody) {\n // Capture initial value before locking.\n const initialBodyOverflow = documentBody.style.overflow;\n const initialPaddingRight = documentBody.style.paddingRight;\n const initialFixedHeaderPaddingRight = fixedHeader?.style.paddingRight;\n const scrollBarWidth = window.innerWidth - documentBody.clientWidth;\n resetBodyOverflow = documentBody.style.overflow === 'hidden' ? () => {} : () => {\n setTimeout(() => {\n documentBody.style.overflow = initialBodyOverflow;\n documentBody.style.paddingRight = initialPaddingRight;\n if (fixedHeader) {\n fixedHeader.style.paddingRight = initialFixedHeaderPaddingRight || '';\n }\n }, timeout);\n };\n documentBody.style.overflow = 'hidden';\n documentBody.style.paddingRight = `${scrollBarWidth}px`;\n if (fixedHeader) {\n fixedHeader.style.paddingRight = `${scrollBarWidth}px`;\n }\n } else {\n resetBodyOverflow();\n }\n return resetBodyOverflow;\n }, [locked, timeout]);\n}","import styled from \"styled-components\";\nimport { containerPadding } from \"../../../style-values/spacing\";\nimport theme from \"../../../style-values\";\nexport const Button = /*#__PURE__*/styled.button.withConfig({\n componentId: \"sc-7mkl8e-0\"\n})([\"border:none;font-size:0;line-height:0;background:none;cursor:pointer;padding:\", \";\", \"{padding:16px \", \";}&:focus{outline:none;background:#eee;}\"], containerPadding.mobile, theme.mediaQueries.tabletAndLarger, containerPadding.tabletAndLarger);\nexport const Icon = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-7mkl8e-1\"\n})([\"width:24px;height:24px;color:\", \";\"], theme.colors.palette.deepBlue[300]);","import React from \"react\";\nimport { Close } from \"../../../Icons2/Close\";\nimport { Button, Icon } from \"./CloseButton.styles\";\nconst CloseButton = ({\n onClick,\n testID = 'modal-close-button'\n}) => /*#__PURE__*/React.createElement(Button, {\n onClick: onClick,\n \"data-e2e\": testID,\n type: \"button\"\n}, \"Close\", /*#__PURE__*/React.createElement(Icon, null, /*#__PURE__*/React.createElement(Close, null)));\nexport default CloseButton;","import React from \"react\";\nimport styled from \"styled-components\";\nimport { HeaderLabel } from \"../../../Typography\";\nimport theme from \"../../../style-values\";\nimport { containerPadding } from \"../../../style-values/spacing\";\nexport const HeaderWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-evtxt7-0\"\n})([\"display:flex;\", \" border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:\", \";position:relative;\"], ({\n textPlacement\n}) => textPlacement === 'center' ? 'justify-content: center;' : '', theme.colors.divider);\nconst TextWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-evtxt7-1\"\n})([\"overflow:hidden;width:100%;text-align:\", \";padding:\", \";padding-right:0;& *{overflow:hidden;}\"], ({\n textPlacement\n}) => textPlacement === 'center' ? 'center' : 'unset', containerPadding.mobile);\nexport const HeaderText = ({\n children,\n headingElement,\n textPlacement\n}) => /*#__PURE__*/React.createElement(TextWrapper, {\n textPlacement: textPlacement\n}, /*#__PURE__*/React.createElement(HeaderLabel, {\n as: headingElement\n}, children));\nexport const CloseButtonWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-evtxt7-2\"\n})([\"display:flex;align-items:\", \";\"], ({\n textPlacement\n}) => textPlacement === 'center' ? 'center' : 'start');","import React from \"react\";\nimport CloseButton from \"../../components/CloseButton/CloseButton\";\nimport { HeaderWrapper, HeaderText, CloseButtonWrapper } from \"./Header.styles\";\nconst Header = ({\n children,\n headingElement = 'h5',\n textPlacement,\n __onClose\n}) => /*#__PURE__*/React.createElement(HeaderWrapper, {\n textPlacement: textPlacement\n}, /*#__PURE__*/React.createElement(HeaderText, {\n headingElement: headingElement,\n textPlacement: textPlacement\n}, children), /*#__PURE__*/React.createElement(CloseButtonWrapper, {\n textPlacement: textPlacement\n}, /*#__PURE__*/React.createElement(CloseButton, {\n onClick: __onClose\n})));\nexport default Header;","import styled from \"styled-components\";\nimport theme from \"../../../style-values\";\nimport { containerPadding } from \"../../../style-values/spacing\";\nexport const FooterCustom = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-1ua6wrf-0\"\n})([\"padding:12px \", \";\", \"{padding:16px \", \";}border-top:1px solid \", \";\"], containerPadding.mobile, theme.mediaQueries.tabletAndLarger, containerPadding.tabletAndLarger, theme.colors.divider);","import styled, { css } from \"styled-components\";\nimport theme from \"../../../style-values\";\nexport const SecondaryButtonWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-2610nr-0\"\n})([\"margin-right:\", \"px;flex-grow:1;flex-shrink:1;flex-basis:0;\"], theme.space.medium);\nexport const PrimaryButtonWrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-2610nr-1\"\n})([\"flex-grow:1;flex-shrink:1;flex-basis:0;\"]);\nexport const Wrapper = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-2610nr-2\"\n})([\"display:flex;\", \"\"], props => props.isOneChild ? css([\"justify-content:center;\", \"{\", \"{max-width:356px;}}\"], PrimaryButtonWrapper, theme.mediaQueries.tabletAndLarger) : '');","import React from \"react\";\nimport FooterCustom from \"./FooterCustom\";\nimport { Wrapper, PrimaryButtonWrapper, SecondaryButtonWrapper } from \"./Footer.styles\";\nconst overrideButtonProps = variant => ({\n size: 'medium',\n autoWidth: false,\n variant\n});\nconst Footer = ({\n primaryButton,\n secondaryButton\n}) => /*#__PURE__*/React.createElement(FooterCustom, null, /*#__PURE__*/React.createElement(Wrapper, {\n isOneChild: !secondaryButton\n}, secondaryButton && /*#__PURE__*/React.createElement(SecondaryButtonWrapper, null, /*#__PURE__*/React.cloneElement(secondaryButton, overrideButtonProps('secondary'))), /*#__PURE__*/React.createElement(PrimaryButtonWrapper, null, /*#__PURE__*/React.cloneElement(primaryButton, overrideButtonProps('primary')))));\nexport default Footer;","import LargeModal from \"./LargeModal\";\nimport Header from \"./Headers/Header\";\nimport Body from \"./Body/Body\";\nimport Footer from \"./Footers/Footer\";\nimport FooterCustom from \"./Footers/FooterCustom\";\nexport default LargeModal;\nexport { Header, Body, Footer, FooterCustom };","import styled, { css, keyframes } from \"styled-components\";\nimport theme from \"../style-values\";\nconst spin = /*#__PURE__*/keyframes([\"0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}\"]);\nexport const Spinner = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-gln3l1-0\"\n})(({\n size,\n variant\n}) => {\n const rules = [css([\"display:inline-block;border-radius:50%;border:0.15rem solid \", \";border-top-color:\", \";border-right-color:\", \";animation:\", \" 1s infinite cubic-bezier(0.5,0.1,0.4,0.9);width:\", \"px;height:\", \"px;\"], theme.colors.palette.gray[600], theme.colors.white, theme.colors.white, spin, size, size), variant === 'white' && css([\"border-color:rgba(255,255,255,0.2);border-top-color:\", \";border-right-color:\", \";\"], theme.colors.white, theme.colors.white), variant === 'gray' && css([\"border-color:\", \";border-top-color:\", \";border-right-color:\", \";\"], theme.colors.palette.deepBlue[100], theme.colors.spinnerGray, theme.colors.spinnerGray), variant === 'blue' && css([\"border-color:\", \";border-top-color:\", \";border-right-color:\", \";\"], theme.colors.palette.deepBlue[100], theme.colors.spinnerBlue, theme.colors.spinnerBlue), variant === 'coral' && css([\"border-color:\", \";border-top-color:\", \";border-right-color:\", \";\"], theme.colors.palette.coral[200], theme.colors.palette.coral[500], theme.colors.palette.coral[500])];\n if (process.env.NODE_ENV === 'test') {\n rules.push(css([\"animation:none;\"]));\n }\n return rules;\n});","import React from \"react\";\nimport { Spinner as StyledSpinner } from \"./Spinner.style\";\nconst Spinner = ({\n size = 24,\n variant = 'gray'\n}) => /*#__PURE__*/React.createElement(StyledSpinner, {\n size: size,\n variant: variant\n});\nexport default Spinner;","import Spinner from \"./Spinner\";\nexport default Spinner;","export default 'span';","import Text from \"./Text\";\nexport default Text;","import styled from \"styled-components\";\nimport { ParagraphRegular } from \"../Typography\";\nimport Block from \"../Block\";\nimport theme from \"../style-values\";\nimport { NotificationContainer, typeToColor, typeToBorderColor } from \"../style-values/notifications\";\nexport const Container = /*#__PURE__*/styled(NotificationContainer).withConfig({\n componentId: \"sc-1x5cim7-0\"\n})([\"padding:\", \"px;border-radius:\", \";\"], theme.space.small, theme.radii.normal);\nexport const Separator = /*#__PURE__*/styled(Block).withConfig({\n componentId: \"sc-1x5cim7-1\"\n})([\"border-top-style:solid;border-top-width:1px;margin-top:\", \"px;margin-bottom:\", \"px;border-color:\", \";\"], theme.space.medium, theme.space.medium, typeToBorderColor);\nexport const Body = /*#__PURE__*/styled(ParagraphRegular).withConfig({\n componentId: \"sc-1x5cim7-2\"\n})([\"color:\", \";\"], typeToColor);","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nimport IconContainerFC from \"../IconContainer\";\nimport { Container as SharedContainer } from \"./Tips.styles.shared\";\nexport { Separator, Body } from \"./Tips.styles.shared\";\nexport const Container = /*#__PURE__*/styled(SharedContainer).withConfig({\n componentId: \"sc-14weblm-0\"\n})([\"width:inherit;\"]);\nexport const IconContainer = /*#__PURE__*/styled(IconContainerFC).withConfig({\n componentId: \"sc-14weblm-1\"\n})([\"align-self:flex-start;margin-right:\", \"px;\"], theme.space.small);\nexport const Content = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-14weblm-2\"\n})([\"margin-top:1px;width:calc(100% - \", \"px);\"], ({\n showIcon\n}) => showIcon ? theme.space.large : 0);\nexport const Title = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-14weblm-3\"\n})([\"justify-self:flex-start;line-height:\", \";font-weight:\", \";font-size:\", \";\", \"{line-height:\", \";}\"], theme.lineHeights.normal, theme.fontWeights.bold, theme.fontSizes.medium, theme.mediaQueries.tabletAndLarger, theme.lineHeights.large);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { Fragment } from \"react\";\nimport Flex from \"../Flex\";\nimport { typeToColor } from \"../style-values/notifications\";\nimport { Container, IconContainer, Content, Title, Body, Separator } from \"./Tips.styles\";\nconst Tip = ({\n type,\n icon,\n content,\n title\n}) => {\n return /*#__PURE__*/React.createElement(Flex, {\n alignItems: \"center\",\n \"data-component\": \"tip\"\n }, icon && /*#__PURE__*/React.createElement(IconContainer, {\n key: \"icon\",\n size: ['small', null, null, 'medium'],\n color: typeToColor({\n type\n })\n }, icon), /*#__PURE__*/React.createElement(Content, {\n key: \"content\",\n showIcon: !!icon\n }, title && /*#__PURE__*/React.createElement(Title, {\n key: \"title\"\n }, title), /*#__PURE__*/React.createElement(Body, {\n as: \"div\",\n key: \"body\",\n type: type\n }, content)));\n};\nconst Tips = ({\n type,\n items\n}) => {\n if (type === 'tip') {\n console.warn('Tips: the `tip` type has been deprecated, use the `info` instead.');\n }\n const restrictedType = type === 'tip' ? 'info' : type;\n return /*#__PURE__*/React.createElement(Container, {\n type: restrictedType,\n \"data-component\": \"tips\"\n }, items.map((item, index) => /*#__PURE__*/React.createElement(Fragment, {\n key: `${restrictedType}-${index}`\n }, /*#__PURE__*/React.createElement(Tip, _extends({\n key: \"tip\",\n type: restrictedType\n }, item)), index !== items.length - 1 && /*#__PURE__*/React.createElement(Separator, {\n key: \"separator\",\n type: restrictedType\n }))));\n};\nexport default Tips;","import Tips from \"./Tips\";\nexport default Tips;","var x=e=>typeof e==\"function\",p=(e,t)=>x(e)?e(t):e;var E=(()=>{let e=0;return()=>(++e).toString()})(),X=(()=>{let e;return()=>{if(e===void 0&&typeof window<\"u\"){let t=matchMedia(\"(prefers-reduced-motion: reduce)\");e=!t||t.matches}return e}})();import{useEffect as R,useState as V}from\"react\";var I=20;var m=new Map,v=1e3,b=e=>{if(m.has(e))return;let t=setTimeout(()=>{m.delete(e),T({type:4,toastId:e})},v);m.set(e,t)},M=e=>{let t=m.get(e);t&&clearTimeout(t)},g=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,I)};case 1:return t.toast.id&&M(t.toast.id),{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case 2:let{toast:o}=t;return e.toasts.find(r=>r.id===o.id)?g(e,{type:1,toast:o}):g(e,{type:0,toast:o});case 3:let{toastId:n}=t;return n?b(n):e.toasts.forEach(r=>{b(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,visible:!1}:r)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let s=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(r=>({...r,pauseDuration:r.pauseDuration+s}))}}},f=[],S={toasts:[],pausedAt:void 0},T=e=>{S=g(S,e),f.forEach(t=>{t(S)})},U={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},O=(e={})=>{let[t,o]=V(S);R(()=>(f.push(o),()=>{let s=f.indexOf(o);s>-1&&f.splice(s,1)}),[t]);let n=t.toasts.map(s=>{var r,c;return{...e,...e[s.type],...s,duration:s.duration||((r=e[s.type])==null?void 0:r.duration)||(e==null?void 0:e.duration)||U[s.type],style:{...e.style,...(c=e[s.type])==null?void 0:c.style,...s.style}}});return{...t,toasts:n}};var w=(e,t=\"blank\",o)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:\"status\",\"aria-live\":\"polite\"},message:e,pauseDuration:0,...o,id:(o==null?void 0:o.id)||E()}),l=e=>(t,o)=>{let n=w(t,e,o);return T({type:2,toast:n}),n.id},a=(e,t)=>l(\"blank\")(e,t);a.error=l(\"error\");a.success=l(\"success\");a.loading=l(\"loading\");a.custom=l(\"custom\");a.dismiss=e=>{T({type:3,toastId:e})};a.remove=e=>T({type:4,toastId:e});a.promise=(e,t,o)=>{let n=a.loading(t.loading,{...o,...o==null?void 0:o.loading});return e.then(s=>(a.success(p(t.success,s),{id:n,...o,...o==null?void 0:o.success}),s)).catch(s=>{a.error(p(t.error,s),{id:n,...o,...o==null?void 0:o.error})}),e};import{useEffect as N,useCallback as h}from\"react\";var k=(e,t)=>{T({type:1,toast:{id:e,height:t}})},C=()=>{T({type:5,time:Date.now()})},H=e=>{let{toasts:t,pausedAt:o}=O(e);N(()=>{if(o)return;let r=Date.now(),c=t.map(i=>{if(i.duration===1/0)return;let d=(i.duration||0)+i.pauseDuration-(r-i.createdAt);if(d<0){i.visible&&a.dismiss(i.id);return}return setTimeout(()=>a.dismiss(i.id),d)});return()=>{c.forEach(i=>i&&clearTimeout(i))}},[t,o]);let n=h(()=>{o&&T({type:6,time:Date.now()})},[o]),s=h((r,c)=>{let{reverseOrder:i=!1,gutter:d=8,defaultPosition:P}=c||{},A=t.filter(u=>(u.position||P)===(r.position||P)&&u.height),_=A.findIndex(u=>u.id===r.id),D=A.filter((u,y)=>y<_&&u.visible).length;return A.filter(u=>u.visible).slice(...i?[D+1]:[0,D]).reduce((u,y)=>u+(y.height||0)+d,0)},[t]);return{toasts:t,handlers:{updateHeight:k,startPause:C,endPause:n,calculateOffset:s}}};var ie=a;export{ie as default,p as resolveValue,a as toast,H as useToaster,O as useToasterStore};\n//# sourceMappingURL=index.mjs.map","import styled, { keyframes } from \"styled-components\";\nimport Block from \"../Block\";\nimport theme from \"../style-values\";\nimport { NotificationContainer } from \"../style-values/notifications\";\nconst mobileEnter = /*#__PURE__*/keyframes({\n '0%': {\n opacity: 0,\n transform: 'translateY(-100%)'\n },\n '100%': {\n opacity: 1,\n transform: 'translateY(0)'\n }\n});\nconst desktopEnter = /*#__PURE__*/keyframes({\n '0%': {\n opacity: 0,\n transform: 'translateY(100%)'\n },\n '100%': {\n opacity: 1,\n transform: 'translateY(0)'\n }\n});\nconst leave = /*#__PURE__*/keyframes({\n '0%': {\n opacity: 1\n },\n '100%': {\n opacity: 0\n }\n});\nexport const Container = /*#__PURE__*/styled(Block).withConfig({\n componentId: \"sc-14szd7h-0\"\n})([\"pointer-events:none;\"]);\nexport const Notification = /*#__PURE__*/styled(NotificationContainer).withConfig({\n componentId: \"sc-14szd7h-1\"\n})([\"cursor:pointer;pointer-events:\", \";padding:\", \"px;border-radius:\", \";animation:\", \" 0.3s ease-out forwards;\", \"{animation-name:\", \";}\"], props => props.visible ? 'auto' : 'none', theme.space.medium, theme.radii.normal, props => props.visible ? mobileEnter : leave, theme.mediaQueries.desktop, props => props.visible ? desktopEnter : leave);","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport hotToast, { useToaster } from \"react-hot-toast/headless\";\nimport Block from \"../Block\";\nimport theme from \"../style-values\";\nimport { NotificationIcon } from \"../style-values/notifications\";\nimport { Container, Notification } from \"./Toast.styles\";\n// The react-hot-toast supports a limited and not extendable number of types.\n// We map our types to theirs as good as possible.\n// The only thing that the type affect is the time a toast stays on screen.\nconst ToastTypeToReactToastType = {\n info: 'blank',\n success: 'success',\n warning: 'custom',\n error: 'error'\n};\nconst ReactToastTypeToToastType = {\n blank: 'info',\n success: 'success',\n custom: 'warning',\n error: 'error',\n // Not supported\n loading: 'info'\n};\nexport function Toast() {\n const {\n toasts,\n handlers\n } = useToaster();\n const {\n startPause,\n endPause\n } = handlers;\n return /*#__PURE__*/React.createElement(React.Fragment, null, toasts.map((toast, index) => {\n const type = ReactToastTypeToToastType[toast.type];\n return /*#__PURE__*/React.createElement(Container, {\n key: toast.id,\n position: \"fixed\",\n left: 0,\n right: 0,\n top: [theme.space.small, null, null, 'auto'],\n bottom: ['auto', null, null, theme.space.medium],\n zIndex: 99999 - index,\n onMouseEnter: startPause,\n onMouseLeave: endPause\n }, /*#__PURE__*/React.createElement(Notification, _extends({\n type: type,\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n width: [343, null, null, 372],\n mx: \"auto\",\n visible: toast.visible\n // It doesn't make a lot of sense to make dismissal accessible since we don’t have\n // a visible close button and the toast will disappear after 5 seconds anyway,\n // so we only handle clicks but don't make the toast focusable\n ,\n onClick: () => hotToast.dismiss(toast.id)\n }, toast.ariaProps), /*#__PURE__*/React.createElement(NotificationIcon, {\n size: \"small\",\n type: type\n }), /*#__PURE__*/React.createElement(Block, {\n ml: \"small\"\n }, toast.message)));\n }));\n}\nexport const showToast = ({\n message,\n type\n}) => {\n hotToast(message, {\n // @ts-expect-error This works but missed in react-hot-toast types\n type: ToastTypeToReactToastType[type],\n duration: 5000\n });\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport styled from \"styled-components\";\nconst TouchableDiv = /*#__PURE__*/styled.div.withConfig({\n componentId: \"sc-xhlozm-0\"\n})([\"cursor:pointer;\", \";\"], ({\n disabled\n}) => disabled && `pointer-events: none;`);\nconst Touchable = ({\n onClick,\n children,\n ...props\n}) => /*#__PURE__*/React.createElement(TouchableDiv, _extends({\n role: \"button\",\n tabIndex: 0,\n onClick: props.disabled ? () => {} : onClick,\n onKeyDown: e => {\n ['Enter', ' '].includes(e.key) && onClick();\n }\n}, props), children);\nexport default Touchable;","import { css } from \"styled-components\";\nimport theme from \"../style-values\";\nconst inverted = /*#__PURE__*/css([\"\", \"\"], p => p.inverted && `color: ${theme.colors.white};`);\nconst color = /*#__PURE__*/css([\"\", \"\"], p => p.shade && `color: ${theme.colors.palette.deepBlue[p.shade]};`);\nexport const baseHeading = /*#__PURE__*/css([\"color:\", \";\", \";\", \";letter-spacing:0;margin:0;\"], theme.colors.heading, color, inverted);\nexport const baseParagraph = /*#__PURE__*/css([\"color:\", \";\", \";\", \";letter-spacing:0;margin:0;\"], theme.colors.bodyText, color, inverted);\nexport const baseLink = /*#__PURE__*/css([\"color:\", \";\", \";font-weight:\", \";font-size:14px;line-height:20px;\"], theme.colors.linkText, inverted, theme.fontWeights.normal);\nexport const h1 = /*#__PURE__*/css([\"font-size:30px;line-height:36px;\"]);\nexport const h2 = /*#__PURE__*/css([\"font-size:30px;line-height:36px;\"]);\nexport const h3 = /*#__PURE__*/css([\"font-size:26px;line-height:30px;\"]);\nexport const h4 = /*#__PURE__*/css([\"font-size:22px;line-height:24px;\"]);\nexport const h5 = /*#__PURE__*/css([\"font-size:18px;line-height:24px;\"]);\nexport const h6 = /*#__PURE__*/css([\"font-size:16px;line-height:20px;\"]);\nexport const paragraphLarge = /*#__PURE__*/css([\"font-size:18px;line-height:24px;\"]);\nexport const paragraphRegular = /*#__PURE__*/css([\"font-size:16px;line-height:20px;\"]);\nexport const paragraphSmall = /*#__PURE__*/css([\"font-size:14px;line-height:20px;\"]);\nexport const subHeadingRegular = /*#__PURE__*/css([\"color:\", \";\", \";font-weight:600;font-size:14px;line-height:20px;\"], theme.colors.subHeading, color);\nexport const subHeadingSmall = /*#__PURE__*/css([\"color:\", \";\", \";font-weight:500;font-size:12px;line-height:16px;\"], theme.colors.subHeading, color);\nexport const textLink = /*#__PURE__*/css([\"font-size:14px;line-height:20px;\"]);","import styled from \"styled-components\";\nimport theme from \"../style-values\";\nimport * as styles from \"./Typography.shared\";\nexport const H1 = /*#__PURE__*/styled.h1.withConfig({\n componentId: \"sc-g3hesy-0\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:56px;line-height:64px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h1, theme.mediaQueries.tabletAndLarger);\nexport const H2 = /*#__PURE__*/styled.h2.withConfig({\n componentId: \"sc-g3hesy-1\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:40px;line-height:48px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h2, theme.mediaQueries.tabletAndLarger);\nexport const H3 = /*#__PURE__*/styled.h3.withConfig({\n componentId: \"sc-g3hesy-2\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:32px;line-height:38px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h3, theme.mediaQueries.tabletAndLarger);\nexport const H4 = /*#__PURE__*/styled.h4.withConfig({\n componentId: \"sc-g3hesy-3\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:24px;line-height:32px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h4, theme.mediaQueries.tabletAndLarger);\nexport const H5 = /*#__PURE__*/styled.h5.withConfig({\n componentId: \"sc-g3hesy-4\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:20px;line-height:28px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h5, theme.mediaQueries.tabletAndLarger);\nexport const H6 = /*#__PURE__*/styled.h6.withConfig({\n componentId: \"sc-g3hesy-5\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{line-height:24px;}\"], styles.baseHeading, theme.fontWeights.bold, styles.h6, theme.mediaQueries.tabletAndLarger);\nexport const ParagraphLarge = /*#__PURE__*/styled.p.withConfig({\n componentId: \"sc-g3hesy-6\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{font-size:24px;line-height:34px;}\"], styles.baseParagraph, theme.fontWeights.normal, styles.paragraphLarge, theme.mediaQueries.tabletAndLarger);\nexport const ParagraphRegular = /*#__PURE__*/styled.p.withConfig({\n componentId: \"sc-g3hesy-7\"\n})([\"\", \" font-weight:\", \";\", \" \", \"{line-height:24px;}\"], styles.baseParagraph, theme.fontWeights.normal, styles.paragraphRegular, theme.mediaQueries.tabletAndLarger);\nexport const ParagraphSmall = /*#__PURE__*/styled.p.withConfig({\n componentId: \"sc-g3hesy-8\"\n})([\"\", \" font-weight:\", \";\", \"\"], styles.baseParagraph, theme.fontWeights.normal, styles.paragraphSmall);\nexport const SubHeadingRegular = /*#__PURE__*/styled.p.withConfig({\n componentId: \"sc-g3hesy-9\"\n})([\"\", \" font-weight:\", \";\", \" letter-spacing:0.1em;\", \"{font-size:16px;line-height:24px;}\"], styles.baseParagraph, theme.fontWeights.normal, styles.subHeadingRegular, theme.mediaQueries.tabletAndLarger);\nexport const SubHeadingSmall = /*#__PURE__*/styled.p.withConfig({\n componentId: \"sc-g3hesy-10\"\n})([\"\", \" font-weight:\", \";\", \" letter-spacing:0.1em;\"], styles.baseParagraph, theme.fontWeights.normal, styles.subHeadingSmall);\nexport const TextLink = /*#__PURE__*/styled.a.withConfig({\n componentId: \"sc-g3hesy-11\"\n})([\"\", \" \", \" \", \"{font-size:16px;line-height:24px;}\"], styles.baseLink, styles.textLink, theme.mediaQueries.tabletAndLarger);\nexport const HeaderLabel = /*#__PURE__*/styled.h5.withConfig({\n componentId: \"sc-g3hesy-12\"\n})([\"\", \" font-weight:\", \";\", \"\"], styles.baseHeading, theme.fontWeights.bold, styles.h5);","export const breakpoints = {\n MOBILE: 480,\n TABLET: 768,\n DESKTOP: 1024\n};","const PATH = '/gcs-proxy/omio-fc-assets/illustrations';\nconst NODE_ENV = process.env.NODE_ENV;\nconst DOMAIN = NODE_ENV === 'development' || NODE_ENV === 'test' ? '//omio.com' : '';\nexport const cdnLink = (name, ext) => {\n const isFlagIllustration = name.startsWith('flag-');\n if (isFlagIllustration) {\n const countryCode = name.split('-').pop();\n if (ext === 'svg') {\n return `https://assets.omio.design/flags/svg/${countryCode}~src.svg`;\n } else if (ext === 'png') {\n return `https://assets.omio.design/flags/png/${countryCode}~250x167.png`;\n }\n }\n return `${DOMAIN}${PATH}/${name}.${ext}`;\n};","import { useEffect, useRef } from \"react\";\n\n/*\n * This stack is used to make sure that only the last element using `onClickOutside` will actually trigger the event.\n * Example:\n * Mount Modal 1, then mount Modal 2 on top.\n * Expected behaviours:\n * - clicking in Modal 2 (i.e. outside of Modal 1) should not trigger the clickOutside of Modal 1\n * - clicking outside Modal 2 should only close Modal 2, leaving Modal 1 unaffected\n */\nconst refStack = [];\nexport const useOnClickOutside = handler => {\n const ref = useRef(null);\n useEffect(() => {\n if (!handler) {\n return () => {};\n }\n refStack.push(ref);\n const listener = event => {\n // Do nothing if clicking ref's element or descendent elements\n if (!ref.current || ref.current.contains(event.target)) {\n return;\n }\n if (refStack[refStack.length - 1] === ref) {\n handler();\n }\n };\n document.addEventListener('click', listener, true);\n document.addEventListener('touchstart', listener, true);\n return () => {\n refStack.pop();\n document.removeEventListener('click', listener, true);\n document.removeEventListener('touchstart', listener, true);\n };\n }, [ref, handler]);\n return ref;\n};","export const MOBILE = 'MOBILE';\nexport const TABLET = 'TABLET';\nexport const DESKTOP = 'DESKTOP';","import { useEffect, useState } from \"react\";\nimport debounce from \"lodash/debounce\";\nimport { DESKTOP, MOBILE, TABLET } from \"../types/Viewport\";\nconst getCurrentViewport = () => {\n if (typeof window === 'undefined') {\n return MOBILE;\n }\n if (window.innerWidth < 768) {\n return MOBILE;\n }\n if (window.innerWidth < 1024) {\n return TABLET;\n }\n return DESKTOP;\n};\nexport const useResponsive = () => {\n const [viewport, setViewport] = useState(getCurrentViewport());\n const onResize = debounce(() => {\n setViewport(getCurrentViewport());\n }, 50);\n useEffect(() => {\n window.addEventListener('resize', onResize);\n return () => {\n onResize.cancel();\n window.removeEventListener('resize', onResize);\n };\n }, []);\n return viewport;\n};","import { css } from \"styled-components\";\nimport castArray from \"lodash/castArray\";\nimport { transparentizeHex } from \"../transparentizeHex\";\nexport const buildShadowValue = ({\n radius,\n spread = 0,\n color,\n opacity,\n offset = {\n x: 0,\n y: 0\n }\n}) => `${offset.x}px ${offset.y}px ${radius}px ${spread}px ${transparentizeHex(opacity, color)}`;\nexport const buildShadow = shadow => css([\"box-shadow:\", \";\"], castArray(shadow).map(buildShadowValue).join(','));","import { transparentizeHex } from \"./transparentizeHex\";\nexport const palette = {\n coral: {\n 200: '#FEDADA',\n 300: '#FDB5B5',\n 400: '#FB8989',\n 500: '#FA6B6B'\n },\n red: {\n 100: '#FFF2F1',\n 200: '#FBB2AC',\n 300: '#F87368',\n 400: '#F53727',\n 500: '#DF1B0A'\n },\n orange: {\n 100: '#FFF7ED',\n 200: '#FCDFB6',\n 300: '#FACF91',\n 400: '#F9BF6D',\n 500: '#F7AF48',\n 600: '#D07E09',\n 700: '#B65700'\n },\n deepBlue: {\n 100: '#D4D8E3',\n 200: '#A1A9C3',\n 300: '#717FA4',\n 400: '#425486',\n 500: '#132968'\n },\n mediumBlue: {\n 100: '#F5F9FD',\n 200: '#BFD3EB',\n 300: '#9EBCE0',\n 400: '#7EA6D6',\n 500: '#5E90CC',\n 600: '#3366A2'\n },\n lightBlue: {\n 200: '#DEEBF9',\n 300: '#CDE2F5',\n 400: '#BDD8F2',\n 500: '#ACCEEF'\n },\n seaGreen: {\n 100: '#F3FFFC',\n 200: '#C4F4E7',\n 300: '#7CE7C9',\n 400: '#42DDB1',\n 500: '#24C89A',\n 600: '#1C9D79',\n 700: '#0F8463'\n },\n gray: {\n 100: '#FCFCFD',\n 300: '#F6F7F9',\n 400: '#F1F2F6',\n 450: '#E4E8EB',\n 500: '#DCDFE9',\n 600: '#A1A9C3'\n },\n purple: {\n 100: '#C1A6C5',\n 200: '#A67DAC',\n 300: '#885190',\n 400: '#760F85'\n }\n};\nexport const brandColors = {\n facebookActive: '#436bb2',\n facebook: '#4267B2',\n googleRedActive: '#f35744',\n googleRed: '#DC4E41',\n apple: '#000'\n};\nexport const commonColors = {\n white: '#fff',\n black: '#000'\n};\n\n// The values here should only be computed using the palette!\nexport const semanticColors = {\n heading: palette.deepBlue[500],\n interactiveIcon: palette.deepBlue[500],\n bodyText: palette.deepBlue[400],\n subHeading: palette.deepBlue[200],\n linkText: palette.coral[500],\n divider: palette.gray[500],\n dividerDark: palette.deepBlue[400],\n pillBackground: palette.lightBlue[300],\n pillExpandedBackground: palette.mediumBlue[500],\n shadowBase: palette.deepBlue[500],\n containerShadow: transparentizeHex(0.2, palette.deepBlue[500]),\n inputBorder: palette.gray[400],\n inputBorderInvalid: palette.red[500],\n inputBackgroundInvalid: palette.red[100],\n inputBackgroundDisabled: palette.gray[300],\n inputBackgroundDark: palette.gray[400],\n inputBackgroundDarkBackground: commonColors.white,\n inputBorderFocused: palette.deepBlue[200],\n inputBorderDisabled: palette.deepBlue[100],\n disabledText: palette.deepBlue[200],\n disabledHeading: palette.deepBlue[300],\n placeholderText: palette.deepBlue[300],\n placeholderTextDisabled: palette.deepBlue[200],\n placeholderTextFocused: palette.deepBlue[400],\n iconColor: palette.deepBlue[300],\n modalOverlay: 'rgba(18, 23, 38, 0.35)',\n // this special color is not part of the palette\n blackModalOverlay: 'rgba(0, 0, 0, 0.32)',\n // it's not part of the palette\n inputBackground: palette.gray[400],\n inputBorderColor: palette.deepBlue[200],\n inputBorderColorInvalid: palette.red[500],\n inputTextColorInvalid: palette.red[500],\n inputBorderColorDisabled: transparentizeHex(0.17, palette.deepBlue[500]),\n inputBorderColorDarkBackground: commonColors.white,\n inputPlaceholderText: palette.deepBlue[200],\n stepperButton: palette.deepBlue[400],\n stepperButtonText: palette.deepBlue[400],\n buttonBackground: palette.coral[500],\n buttonBackgroundLoading: palette.coral[400],\n buttonBackgroundHover: palette.coral[400],\n buttonBackgroundActive: palette.coral[400],\n buttonBackgroundDisabled: palette.coral[300],\n buttonDisabled: palette.gray[500],\n buttonLoader: palette.coral[500],\n discountedFair: palette.seaGreen[500],\n checkboxBackgroundColor: palette.mediumBlue[500],\n checkboxBorderColor: palette.mediumBlue[400],\n checkboxCheckedBorderColor: palette.mediumBlue[500],\n checkboxActiveBackground: palette.mediumBlue[600],\n checkboxDisabledBackground: palette.gray[300],\n checkboxDisabledCheckedBackground: palette.gray[500],\n checkboxRequiredBackground: palette.red[100],\n checkboxRequiredBorder: palette.red[300],\n spinnerGray: palette.deepBlue[200],\n spinnerBlue: palette.mediumBlue[500],\n sectionDivider: palette.gray[450],\n cardHeader: palette.mediumBlue[500],\n cardEdit: palette.coral[500],\n moon: palette.orange[600],\n radioButtonBorder: palette.mediumBlue[300],\n radioButtonDot: palette.mediumBlue[500],\n radioButtonLabel: palette.deepBlue[400],\n radioButtonDisabled: palette.gray[400],\n currencySwitcherRowSelectedLabel: palette.deepBlue[500],\n currencySwitcherRowBackgroundHover: palette.gray[400],\n currencySwitcherRowRight: palette.deepBlue[400],\n currencySwitcherRowSelectedIcon: palette.mediumBlue[500],\n currencySwitcherRowLabel: palette.deepBlue[400],\n errorText: palette.red[500],\n warningText: palette.orange[600],\n formLabel: palette.deepBlue[400],\n journeySegmentIconPin: palette.coral[500],\n journeySegmentTimelineCircle: palette.deepBlue[400],\n journeySegmentPosition: palette.deepBlue[400],\n journeySegmentPositionIsEdge: palette.deepBlue[500],\n journeySegmentIcon: palette.deepBlue[400],\n journeySegmentTimeline: palette.deepBlue[200],\n journeySegmentTime: palette.deepBlue[400],\n journeySegmentTimeIsEdge: palette.deepBlue[500],\n journeySegmentMoon: palette.orange[600],\n journeySegmentDuration: palette.deepBlue[200],\n journeySegmentInfoDetail: palette.deepBlue[200],\n journeySegmentIconSwitching: palette.gray[600],\n journeySegmentIconExclamation: palette.orange[500],\n chicletBorderColor: palette.gray[500],\n chicletHighlightTextBackgroundColor: palette.seaGreen[600],\n chicletHoverBackgroundColor: palette.gray[300],\n chicletActiveBorderColor: palette.mediumBlue[500],\n chicletActiveBackgroundColor: palette.lightBlue[200],\n chicletGroupArrowColor: palette.deepBlue[200],\n listItemRightSideContent: palette.mediumBlue[500],\n selectedLocaleIcon: palette.mediumBlue[500],\n defaultLocaleLabel: palette.deepBlue[400],\n selectedLocaleLabel: palette.deepBlue[500],\n flagLabel: palette.deepBlue[400],\n localeRowDesktop: palette.gray[400],\n sliderBackground: palette.gray[500],\n sliderThumb: palette.deepBlue[200],\n sliderTrack: palette.deepBlue[400],\n passwordLabelColor: palette.deepBlue[400],\n seatMapBackground: palette.gray[400],\n seatMapTotalPrice: palette.mediumBlue[500],\n tipDefaultBackground: palette.mediumBlue[100],\n tipDefaultBorderColor: palette.mediumBlue[500],\n tipDefaultColor: palette.mediumBlue[600],\n tipSuccessBackground: palette.seaGreen[100],\n tipSuccessBorderColor: palette.seaGreen[500],\n tipSuccessColor: palette.seaGreen[700],\n tipWarningBackground: palette.orange[100],\n tipWarningBorderColor: palette.orange[500],\n tipWarningColor: palette.orange[700],\n tipErrorBackground: palette.red[100],\n tipErrorBorderColor: palette.red[400],\n tipErrorColor: palette.red[500],\n tipNeutralBackground: palette.gray[400],\n tipNeutralBorderColor: palette.gray[400],\n tipNeutralColor: palette.deepBlue[300],\n mobileHeaderIcon: palette.deepBlue[200],\n autocompleteGroupBackground: palette.gray[400],\n autocompleteGroupText: palette.deepBlue[500]\n};","export const family = {\n regular: \"'GT Walsheim','Helvetica Neue',Helvetica,Arial,sans-serif\",\n medium: \"'GT Walsheim','Helvetica Neue',Helvetica,Arial,sans-serif\",\n bold: \"'GTWalsheim-Bold','Helvetica Neue',Helvetica,Arial,sans-serif\"\n};","export { family } from \"./fontFamily\";\nexport const weight = {\n normal: '400',\n medium: '500',\n semibold: '600',\n bold: 'bold'\n};\nexport const sizeValues = {\n tiny: 10,\n small: 12,\n normal: 14,\n medium: 16,\n large: 18,\n extraLarge: 20\n};\nexport const size = {\n tiny: `${sizeValues.tiny}px`,\n small: `${sizeValues.small}px`,\n normal: `${sizeValues.normal}px`,\n medium: `${sizeValues.medium}px`,\n large: `${sizeValues.large}px`,\n extraLarge: `${sizeValues.extraLarge}px`\n};\nexport const lineHeight = {\n small: '16px',\n normal: '20px',\n large: '24px'\n};\nexport const iconSize = {\n tiny: 16,\n small: 20,\n medium: 24\n};","import { breakpoints } from \"../helpers/breakpoints\";\nimport { palette, semanticColors, brandColors, commonColors } from \"./colors\";\nimport { spacing } from \"./spacing\";\nimport { family, size, weight, lineHeight, iconSize } from \"./font\";\nimport { container, hiddenContent, sticky } from \"./shadows\";\nimport { mediaQueries } from \"./mediaQueries\";\nimport { radii } from \"./borders\";\n\n// The shape follows Theme UI Specification\n// https://theme-ui.com/theme-spec/\n\nexport default {\n colors: {\n ...semanticColors,\n ...commonColors,\n palette,\n brandColors\n },\n space: {\n // Zero is always zero\n 0: 0,\n // String aliases ()\n base: spacing.base,\n tiny: spacing.tiny,\n small: spacing.small,\n smallmedium: spacing.smallmedium,\n medium: spacing.medium,\n large: spacing.large,\n xlarge: spacing.xlarge,\n xxlarge: spacing.xxlarge,\n xxxlarge: spacing.xxxlarge,\n huge: spacing.huge,\n xhuge: spacing.xhuge,\n // Negative string aliases ()\n '-base': -spacing.base,\n '-tiny': -spacing.tiny,\n '-small': -spacing.small,\n '-smallmedium': -spacing.smallmedium,\n '-medium': -spacing.medium,\n '-large': -spacing.large,\n '-xlarge': -spacing.xlarge,\n '-xxlarge': -spacing.xxlarge,\n '-xxxlarge': -spacing.xxxlarge,\n '-huge': -spacing.huge,\n '-xhuge': -spacing.xhuge\n },\n fonts: family,\n fontSizes: size,\n fontWeights: weight,\n lineHeights: lineHeight,\n iconSizes: iconSize,\n radii,\n shadows: {\n ...container,\n ...sticky,\n hiddenContent\n },\n sizes: {\n /* Maximum page width (including padding) */\n pageMaxWidth: 1180,\n /* Maximum page width (not including padding) */\n pageContentMaxWidth: 1148\n },\n breakpoints: [breakpoints.MOBILE, breakpoints.TABLET, breakpoints.DESKTOP].map(x => `${x}px`),\n mediaQueries\n};","import theme from \"./theme\";\nexport default theme;","export const radii = {\n small: '4px',\n normal: '8px',\n container: '10px',\n large: '16px',\n xlarge: '24px',\n xxlarge: '32px'\n};","import { breakpoints } from \"../helpers/breakpoints\";\nconst makeMediaRuleMinWidth = minWidth => `@media (min-width: ${minWidth}px)`;\nconst makeMediaRuleMaxWidth = maxWidth => `@media (max-width: ${maxWidth}px)`;\nexport const mediaQueries = {\n mobileOnly: makeMediaRuleMaxWidth(breakpoints.MOBILE),\n tabletAndLarger: makeMediaRuleMinWidth(breakpoints.TABLET),\n desktop: makeMediaRuleMinWidth(breakpoints.DESKTOP),\n hoverCapable: '@media (hover: hover)'\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from \"react\";\nimport styled from \"styled-components\";\nimport IconContainer from \"../IconContainer\";\nimport { Exclamation } from \"../Icons2/Exclamation\";\nimport { ExclamationTri } from \"../Icons2/ExclamationTri\";\nimport { Info } from \"../Icons2/Info\";\nimport { Tick } from \"../Icons2/Tick\";\nimport Block from \"../Block\";\nimport theme from \"./index\";\n\n// Shared styles for notifications, like Pill, Tips and Toast components\n\nexport const TypeToColor = {\n info: theme.colors.tipDefaultColor,\n success: theme.colors.tipSuccessColor,\n warning: theme.colors.tipWarningColor,\n error: theme.colors.tipErrorColor\n};\nexport const TypeToBackground = {\n info: theme.colors.tipDefaultBackground,\n success: theme.colors.tipSuccessBackground,\n warning: theme.colors.tipWarningBackground,\n error: theme.colors.tipErrorBackground\n};\nexport const TypeToBorderColor = {\n info: theme.colors.tipDefaultBorderColor,\n success: theme.colors.tipSuccessBorderColor,\n warning: theme.colors.tipWarningBorderColor,\n error: theme.colors.tipErrorBorderColor\n};\nexport const typeToColor = ({\n type\n}) => {\n return TypeToColor[type];\n};\nexport const typeToBackground = ({\n type\n}) => {\n return TypeToBackground[type];\n};\nexport const typeToBorderColor = ({\n type\n}) => {\n return TypeToBorderColor[type];\n};\n\n/**\n * Notification container. Doesn't specify padding and border radius, since they are different in\n * different components\n */\nexport const NotificationContainer = /*#__PURE__*/styled(Block).withConfig({\n componentId: \"sc-7dergx-0\"\n})([\"border-width:1px;border-style:solid;color:\", \";background:\", \";border-color:\", \";&& a{color:\", \";text-decoration:underline;}\"], typeToColor, typeToBackground, typeToBorderColor, typeToColor);\nexport const ToastTypeToIcon = {\n info: Info,\n success: Tick,\n warning: Exclamation,\n error: ExclamationTri\n};\n/**\n * Renders an icon for a given notification type\n */\nexport const NotificationIcon = ({\n type,\n ...rest\n}) => {\n const Icon = ToastTypeToIcon[type];\n return /*#__PURE__*/React.createElement(IconContainer, _extends({\n color: typeToColor({\n type\n })\n }, rest), /*#__PURE__*/React.createElement(Icon, null));\n};","import { semanticColors } from \"./colors\";\nimport { buildShadow } from \"./builders/buildShadow\";\nexport const shadowConfigs = {\n mobile: {\n radius: 2,\n opacity: 0.2,\n color: semanticColors.shadowBase,\n offset: {\n x: 0,\n y: 2\n }\n },\n default: {\n radius: 5,\n opacity: 0.2,\n color: semanticColors.shadowBase,\n offset: {\n x: 0,\n y: 2\n }\n },\n lifted: {\n radius: 16,\n opacity: 0.2,\n color: semanticColors.shadowBase,\n offset: {\n x: 0,\n y: 8\n }\n },\n header: {\n radius: 8,\n opacity: 0.1,\n color: semanticColors.shadowBase,\n offset: {\n x: 0,\n y: 4\n }\n },\n footer: {\n radius: 8,\n opacity: 0.1,\n color: semanticColors.shadowBase,\n offset: {\n x: 0,\n y: -4\n }\n }\n};\nexport const container = {\n mobile: buildShadow(shadowConfigs.mobile),\n default: buildShadow(shadowConfigs.default),\n lifted: buildShadow(shadowConfigs.lifted)\n};\nexport const sticky = {\n header: buildShadow(shadowConfigs.header),\n footer: buildShadow(shadowConfigs.footer)\n};\nexport const hiddenContent = buildShadow({\n radius: 4,\n color: semanticColors.interactiveIcon,\n opacity: 0.2,\n offset: {\n x: 0,\n y: 0\n }\n});","export const spacing = {\n base: 2,\n tiny: 4,\n small: 8,\n smallmedium: 12,\n medium: 16,\n large: 24,\n xlarge: 32,\n xxlarge: 40,\n xxxlarge: 56,\n huge: 64,\n xhuge: 72\n};\nexport const containerPadding = {\n mobile: `${spacing.medium}px`,\n tabletAndLarger: `${spacing.large}px`\n};\nexport const modalMargin = `${spacing.medium}px`;\nexport const borderRadiusForSelect = {\n pill: `${spacing.medium}px`,\n default: `${spacing.small}px`\n};","function hexToRgb(_hex) {\n let hex = _hex;\n\n // expand shorthand hexes to full length hexes, e.g. #123 => #112233\n if (hex.length === 4) {\n hex = `${hex[0]}${hex[1]}${hex[1]}${hex[2]}${hex[2]}${hex[3]}${hex[3]}`;\n }\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n}\nexport function transparentizeHex(amount, color) {\n if (color === 'transparent') {\n return color;\n }\n const parsedColor = hexToRgb(color);\n if (!parsedColor) {\n return color;\n }\n return `rgba(${parsedColor.r}, ${parsedColor.g}, ${parsedColor.b}, ${amount})`;\n}","export const GO_CLIENT_ID = '_go_client_id';\nexport const GO_EXP_COOKIE_V2 = '_omio_exp_v2';\nexport const COOKIE_MAX_AGE = '86400'; // 24h\nexport const MAX_COOKIE_SIZE = 3072; // 3KiB\nexport const CONTEXT_NAME = 'wasabi_context';\nexport const SCHEMA_URL = 'iglu:com.goeuro/wasabi_context/jsonschema/1-0-0';\nexport const BASE_ABPROXY_PATH_K8S = 'http://abproxy-flagr.abproxy-flagr:8080';\nexport const FORCE_ASSIGNMENT_URL_PARAM = 'force_assignment';\nexport const EXPERIMENTS_FETCH_TIMEOUT = 2000;","import { logWarning as logWarningSrc } from \"./logger\";\nexport const logWarning = message => {\n console.warn(message);\n logWarningSrc({\n message,\n short_message: message\n });\n};","import { getCookieValue } from \"./getCookieValue\";\nimport { logWarning } from \"./logWarning\";\nexport const checkCookieDuplicate = (documentCookie, name, context) => {\n const cookieValues = getCookieValue(documentCookie, name);\n const uniqueCookieValues = new Set(Array.from(cookieValues));\n if (uniqueCookieValues.size >= 2) {\n logWarning(`Cookie duplicates were found with different values. ` + `Name=${name}. Context=${context}. Values=${JSON.stringify(uniqueCookieValues)}`);\n }\n};","import { FORCE_ASSIGNMENT_URL_PARAM } from \"../../constants\";\nimport { parseAssignmentsString } from \"./parseAssignmentsString\";\n\n/**\n * Accepts search parameters, finds a parameter for forced assignments, parses it and returns an assignments list\n * @param {Record} params - assumed to be search parameters map\n * @returns {Assignments[]} an array of forced assignments. Returns empty if parameter does not exist\n */\nexport const parseForcedAssignments = params => {\n const forcedAssignmentsString = params[FORCE_ASSIGNMENT_URL_PARAM];\n return forcedAssignmentsString ? parseAssignmentsString(forcedAssignmentsString) : [];\n};","import { getBrowserUrlParams } from \"../utils/getBrowserUrlParams\";\nimport { logError } from \"../utils/logError\";\nimport { GO_EXP_COOKIE_V2 } from \"../constants\";\nimport { checkCookieDuplicate } from \"../utils/checkCookieDuplicate\";\nimport { parseExperimentsCookie } from \"./helpers/parseExperimentsCookie\";\nimport { calculateExperimentBucket } from \"./helpers/calculateExperimentBucket\";\nimport { parseForcedAssignments } from \"./helpers/parseForcedAssignments\";\n\n/**\n * Returns an experiment bucket for web\n * @param {string} experiment\n * @returns {string | null} bucket or null\n */\nexport const getExperimentBucket = experiment => {\n try {\n // There may be situations when there are duplicate cookies\n // with different values. The idea is to collect more information\n // about such cases and gradually reduce them.\n checkCookieDuplicate(document.cookie, GO_EXP_COOKIE_V2, 'getExperimentBucket');\n const assignments = parseExperimentsCookie(document.cookie);\n if (!assignments) {\n throw new Error(\"[experiments] - no active experiments. Have you run 'setupExperiments()' first?\");\n }\n const urlParams = getBrowserUrlParams();\n const forcedAssignments = parseForcedAssignments(urlParams);\n return calculateExperimentBucket(assignments, experiment, forcedAssignments);\n } catch (error) {\n if (logError) {\n logError('Failed to get experiment bucket', error);\n }\n return null;\n }\n};","/**\n * Parses URL search params and returns it as a dictionary object\n * @returns {Record}\n */\nexport const getBrowserUrlParams = () => {\n const params = new URLSearchParams(window.location.search);\n return Object.fromEntries(Array.from(params.entries()));\n};","/**\n * Calculate the actual bucket of the specified experiment considering forced assignments parameter.\n * @param {Assignments[]} assignments\n * @param {string} experiment\n * @param {Assignments[]} forcedAssignments\n * @returns {string | null}\n */\nexport const calculateExperimentBucket = (assignments, experiment, forcedAssignments) => {\n const findAssignmentPredicate = assignment => assignment.label === experiment;\n const forcedAssignment = forcedAssignments.find(findAssignmentPredicate);\n if (forcedAssignment) {\n return forcedAssignment.bucket;\n }\n const targetAssignment = assignments.find(findAssignmentPredicate);\n if (targetAssignment) {\n return targetAssignment.bucket;\n }\n return null;\n};","/**\n * Transforms assignments string from 'experiment:bucket,...' format to an array of Assignments.\n * @param {string} assignmentsString - string with experiments with buckets\n * @returns {Assignments[]}\n */\nexport const parseAssignmentsString = assignmentsString => {\n return assignmentsString.split(',').map(pair => {\n const [label, bucket] = pair.split(':');\n return {\n label,\n bucket\n };\n });\n};","/**\n * base64.ts\n *\n * Licensed under the BSD 3-Clause License.\n * http://opensource.org/licenses/BSD-3-Clause\n *\n * References:\n * http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.5';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasatob = typeof atob === 'function';\nconst _hasbtoa = typeof btoa === 'function';\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n let tab = {};\n a.forEach((c, i) => tab[c] = i);\n return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n ? Uint8Array.from.bind(Uint8Array)\n : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n // console.log('polyfilled');\n let u32, c0, c1, c2, asc = '';\n const pad = bin.length % 3;\n for (let i = 0; i < bin.length;) {\n if ((c0 = bin.charCodeAt(i++)) > 255 ||\n (c1 = bin.charCodeAt(i++)) > 255 ||\n (c2 = bin.charCodeAt(i++)) > 255)\n throw new TypeError('invalid character found');\n u32 = (c0 << 16) | (c1 << 8) | c2;\n asc += b64chs[u32 >> 18 & 63]\n + b64chs[u32 >> 12 & 63]\n + b64chs[u32 >> 6 & 63]\n + b64chs[u32 & 63];\n }\n return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = _hasbtoa ? (bin) => btoa(bin)\n : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n ? (u8a) => Buffer.from(u8a).toString('base64')\n : (u8a) => {\n // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n const maxargs = 0x1000;\n let strs = [];\n for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n }\n return _btoa(strs.join(''));\n };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n if (c.length < 2) {\n var cc = c.charCodeAt(0);\n return cc < 0x80 ? c\n : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n + _fromCC(0x80 | (cc & 0x3f)))\n : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n else {\n var cc = 0x10000\n + (c.charCodeAt(0) - 0xD800) * 0x400\n + (c.charCodeAt(1) - 0xDC00);\n return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n + _fromCC(0x80 | (cc & 0x3f)));\n }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n ? (s) => Buffer.from(s, 'utf8').toString('base64')\n : _TE\n ? (s) => _fromUint8Array(_TE.encode(s))\n : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n ? _mkUriSafe(_encode(src))\n : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n switch (cccc.length) {\n case 4:\n var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n | ((0x3f & cccc.charCodeAt(1)) << 12)\n | ((0x3f & cccc.charCodeAt(2)) << 6)\n | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n return (_fromCC((offset >>> 10) + 0xD800)\n + _fromCC((offset & 0x3FF) + 0xDC00));\n case 3:\n return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n | ((0x3f & cccc.charCodeAt(1)) << 6)\n | (0x3f & cccc.charCodeAt(2)));\n default:\n return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n | (0x3f & cccc.charCodeAt(1)));\n }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n // console.log('polyfilled');\n asc = asc.replace(/\\s+/g, '');\n if (!b64re.test(asc))\n throw new TypeError('malformed base64.');\n asc += '=='.slice(2 - (asc.length & 3));\n let u24, bin = '', r1, r2;\n for (let i = 0; i < asc.length;) {\n u24 = b64tab[asc.charAt(i++)] << 18\n | b64tab[asc.charAt(i++)] << 12\n | (r1 = b64tab[asc.charAt(i++)]) << 6\n | (r2 = b64tab[asc.charAt(i++)]);\n bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n }\n return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = _hasatob ? (asc) => atob(_tidyB64(asc))\n : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n ? (a) => Buffer.from(a, 'base64').toString('utf8')\n : _TD\n ? (a) => _TD.decode(_toUint8Array(a))\n : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string. Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n */\nconst isValid = (src) => {\n if (typeof src !== 'string')\n return false;\n const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n return {\n value: v, enumerable: false, writable: true, configurable: true\n };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n _add('fromBase64', function () { return decode(this); });\n _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n _add('toBase64URI', function () { return encode(this, true); });\n _add('toBase64URL', function () { return encode(this, true); });\n _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n _add('toBase64URI', function () { return fromUint8Array(this, true); });\n _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n extendString();\n extendUint8Array();\n};\nconst gBase64 = {\n version: version,\n VERSION: VERSION,\n atob: _atob,\n atobPolyfill: atobPolyfill,\n btoa: _btoa,\n btoaPolyfill: btoaPolyfill,\n fromBase64: decode,\n toBase64: encode,\n encode: encode,\n encodeURI: encodeURI,\n encodeURL: encodeURI,\n utob: utob,\n btou: btou,\n decode: decode,\n isValid: isValid,\n fromUint8Array: fromUint8Array,\n toUint8Array: toUint8Array,\n extendString: extendString,\n extendUint8Array: extendUint8Array,\n extendBuiltins: extendBuiltins,\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","import { decode } from \"js-base64\";\nimport { parseAssignmentsString } from \"./parseAssignmentsString\";\n/**\n * Decodes base64 experiments string into assignments array\n * @param {string} base64url\n * @returns {Assignments[]}\n */\nexport const decodeAssignments = base64url => {\n if (!base64url) {\n return [];\n }\n const assignmentsString = decode(base64url);\n return parseAssignmentsString(assignmentsString);\n};","import { GO_EXP_COOKIE_V2 } from \"../../constants\";\nimport { getCookieValue } from \"../../utils/getCookieValue\";\nimport { decodeAssignments } from \"./decodeAssignments\";\n/**\n * Extracts and parses an experiments cookie\n * @param {string} documentCookie\n * @returns {Assignments[] | null} assignments or null if cookie does not exist\n */\nexport const parseExperimentsCookie = documentCookie => {\n // if there're multiple cookie values, take the last\n const cookieValue = getCookieValue(documentCookie, GO_EXP_COOKIE_V2).slice(-1)[0];\n if (cookieValue) {\n return decodeAssignments(cookieValue);\n }\n return null;\n};","/**\n * Finds and returns values for the specified cookie.\n * Important: a cookie string can contain multiple values for the same key (if different cookie path was set)\n * @param {string} documentCookie - cookie string from a document object\n * @param {string} name - name of the target cookie\n * @returns {string[]} all matched cookies values\n */\nexport const getCookieValue = (documentCookie, name) => {\n const cookiesRaw = documentCookie.split('; ') || [];\n const result = [];\n for (const cookieRaw of cookiesRaw) {\n const parts = cookieRaw.split('=');\n if (parts.length) {\n const cookieName = parts[0];\n let cookieValue = decodeURIComponent(parts[1]);\n if (cookieValue.startsWith('\"') && cookieValue.endsWith('\"')) {\n cookieValue = cookieValue.slice(1, -1);\n }\n if (cookieName === name) {\n result.push(cookieValue);\n }\n }\n }\n return result;\n};","import { isError } from \"./isError\";\nimport { logError as logErrorSrc } from \"./logger\";\nexport const logError = (message, cause) => {\n if (isError(cause)) {\n console.error(new Error(`${message}. ${cause.message}`, {\n cause\n }));\n logErrorSrc({\n message,\n short_message: message,\n causeName: cause.name,\n causeMessage: cause.message,\n stack: cause.stack\n });\n } else {\n console.error(new Error(message));\n logErrorSrc({\n message,\n short_message: message,\n reason: `Unknown error: ${cause}`\n });\n }\n};","export const isError = error => error instanceof Error;","// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst noop = (...args) => {};\nconst logInfo = noop;\nconst logWarning = noop;\nconst logError = noop;\nconst logException = noop;\nexport { logInfo, logWarning, logError, logException };","import differenceInYears from \"date-fns/difference_in_years\";\nconst calculateAge = dateOfBirth => {\n return differenceInYears(Date.now(), dateOfBirth);\n};\nexport const getPassengerAge = dateOfBirth => {\n if (!dateOfBirth) return 26;\n return calculateAge(dateOfBirth);\n};\nexport const getPassengerTypeByAge = age => {\n if (age < 26) return 'youth';\n if (age >= 58) return 'senior';\n return 'adult';\n};\nexport const getPassengerType = dateOfBirth => {\n if (!dateOfBirth) return 'adult';\n const age = calculateAge(dateOfBirth);\n return getPassengerTypeByAge(age);\n};\nexport const mapStoredPassengerToSearchPassenger = ({\n id,\n discountCards,\n dateOfBirth,\n firstName,\n lastName\n}) => ({\n firstName: firstName ?? '',\n lastName: lastName ?? '',\n type: getPassengerType(dateOfBirth),\n id,\n passengerId: id,\n age: getPassengerAge(dateOfBirth),\n selectedDiscountCards: !discountCards ? [] :\n // Transform Stored discount cards details to Search format\n discountCards.map(({\n code,\n provider\n }) => ({\n id: code,\n providerId: provider,\n providerName: provider,\n description: provider\n }))\n});\nexport const mapPassengersDiscountCards = (passengers = [], discountCardsGroups = []) => {\n return passengers.map(passenger => {\n const discountCards = passenger.selectedDiscountCards?.map(card => {\n const group = discountCardsGroups.find(group => {\n return group.serviceProvider === card.providerId;\n });\n const discountCard = group?.cards.find(groupCard => {\n return groupCard.id === card.id && groupCard.providerId === card.providerId;\n });\n return discountCard;\n });\n return {\n ...passenger,\n selectedDiscountCards: discountCards?.filter(card => card !== undefined)\n };\n });\n};","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { createContext, useContext } from \"react\";\nconst DefaultRouteContext = /*#__PURE__*/createContext({\n url: '',\n locale: '',\n basePath: '',\n accessToken: '',\n adjustId: undefined,\n userData: null,\n clientId: ''\n});\nexport const useDefaultRouteContext = () => useContext(DefaultRouteContext);\nexport const DefaultRouteContextProvider = ({\n children,\n ...props\n}) => {\n return /*#__PURE__*/React.createElement(DefaultRouteContext.Provider, {\n value: props\n }, children);\n};\nexport const withDefaultRouteContext = Component => {\n const Extended = props => {\n const {\n accessToken,\n basePath,\n url,\n adjustId,\n clientId\n } = useDefaultRouteContext();\n return /*#__PURE__*/React.createElement(Component, _extends({\n basePath: basePath,\n url: url,\n accessToken: accessToken,\n adjustId: adjustId,\n clientId: clientId\n }, props));\n };\n Extended.displayName = `withDefaultRouteContext(${Component.displayName})`;\n return Extended;\n};","export class BaseTrackingContext {\n constructor(name, schema, properties) {\n this.name = name;\n this.schema = schema;\n this.properties = Object.freeze(properties);\n }\n buildContextObject() {\n return {\n schema: this.schema,\n data: this.properties\n };\n }\n setProperties(properties) {\n this.properties = properties;\n }\n}","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\n\n/* GlobalContextsMap type */\n\n/* Global contexts */\nexport const globalContexts = ['b2b_context', 'seo_landing_page_context', 'metadata', 'page_type_context', 'mobile_system_context', 'wasabi_context', 'subsession_context', 'system_versions_context', 'goeuro_tracking_ids_context'];","import { globalContexts } from \"./contexts/globalContexts\";\nexport class BaseTrackingEvent {\n hooks = new Map();\n hooksTimeout = 1000;\n constructor(name, schema, linkedContextsNames) {\n this.name = name;\n this.schema = schema;\n this.linkedContexts = new Set(linkedContextsNames);\n }\n listen(id, hook) {\n this.hooks.set(id, hook);\n }\n async send(properties, contexts, tracker) {\n const localContextsMap = contexts.reduce((acc, context) => {\n if (this.linkedContexts.has(context.name)) acc[context.name] = context;\n return acc;\n }, {});\n const foundGlobalContexts = contexts.reduce((acc, context) => {\n if (globalContexts.includes(context.name) && context.name !== 'wasabi_context') acc[context.name] = context;\n return acc;\n }, {});\n const localSnowplowContexts = Object.values(localContextsMap).map(context => context.buildContextObject());\n const foundGlobalSnowplowContexts = Object.values(foundGlobalContexts).map(context => context.buildContextObject());\n tracker.trackEvent({\n schema: this.schema,\n data: properties\n }, [...localSnowplowContexts, ...foundGlobalSnowplowContexts]);\n const delayPromise = new Promise(resolve => setTimeout(resolve, this.hooksTimeout));\n const hooksEntries = Array.from(this.hooks.entries());\n await Promise.race([delayPromise, Promise.all(hooksEntries.map(async ([id, hook]) => {\n try {\n await hook(properties, localContextsMap, foundGlobalContexts, tracker.wasabiContexts);\n } catch (error) {\n const message = error instanceof Error ? error.message : `${error}`;\n console.error(`There is an error while calling hook '${id}': ${message}`);\n }\n }))]);\n }\n}","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/edit-passenger-form-confirm-button_click/jsonschema/1-0-0';\nexport const editPassengerFormConfirmButtonClick = new BaseTrackingEvent('edit-passenger-form-confirm-button_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/edit-passenger-form_shown/jsonschema/1-0-0';\nexport const editPassengerFormShown = new BaseTrackingEvent('edit-passenger-form_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/stored-passenger-selection_passenger-cell_click/jsonschema/3-0-0';\nexport const storedPassengerSelectionPassengerCellClick = new BaseTrackingEvent('stored-passenger-selection_passenger-cell_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/stored-passenger-selection_passenger_deselect/jsonschema/1-0-0';\nexport const storedPassengerSelectionPassengerDeselect = new BaseTrackingEvent('stored-passenger-selection_passenger_deselect', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/stored-passenger-selection_passenger_select/jsonschema/1-0-0';\nexport const storedPassengerSelectionPassengerSelect = new BaseTrackingEvent('stored-passenger-selection_passenger_select', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/stored-passenger-selection_shown/jsonschema/3-0-0';\nexport const storedPassengerSelectionShown = new BaseTrackingEvent('stored-passenger-selection_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['search_parameters_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-bar-search-button-click/jsonschema/1-0-0';\nexport const searchBarSearchButtonClick = new BaseTrackingEvent('search-bar-search-button-click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_reverse-locations-button_click/jsonschema/1-0-0';\nexport const searchFormReverseLocationsButtonClick = new BaseTrackingEvent('search-form_reverse-locations-button_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar_close-button_click/jsonschema/1-0-0';\nexport const searchCalendarCloseButtonClick = new BaseTrackingEvent('search-calendar_close-button_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-prices_shown/jsonschema/4-0-0';\nexport const searchCalendarPricesShown = new BaseTrackingEvent('search-calendar-prices_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-error_shown/jsonschema/1-0-0';\nexport const searchErrorShown = new BaseTrackingEvent('search-error_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-prices_failed/jsonschema/4-0-0';\nexport const searchCalendarPricesFailed = new BaseTrackingEvent('search-calendar-prices_failed', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-date_with_price_click/jsonschema/4-0-1';\nexport const searchCalendarDateWithPriceClick = new BaseTrackingEvent('search-calendar-date_with_price_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/destination-selection-form_popular-destinations-list_click/jsonschema/1-0-0';\nexport const destinationSelectionFormPopularDestinationsListClick = new BaseTrackingEvent('destination-selection-form_popular-destinations-list_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/add-return-button_click/jsonschema/1-0-0';\nexport const addReturnButtonClick = new BaseTrackingEvent('add-return-button_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/add-return-button_shown/jsonschema/1-0-0';\nexport const addReturnButtonShown = new BaseTrackingEvent('add-return-button_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar_shown/jsonschema/1-0-0';\nexport const searchCalendarShown = new BaseTrackingEvent('search-calendar_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/destination-selection-form_searched-suggestions-list_click/jsonschema/1-0-0';\nexport const destinationSelectionFormSearchedSuggestionsListClick = new BaseTrackingEvent('destination-selection-form_searched-suggestions-list_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_dates-field_click/jsonschema/1-0-0';\nexport const searchFormDatesFieldClick = new BaseTrackingEvent('search-form_dates-field_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/destination-selection-form_searched-suggestions-list_shown/jsonschema/1-0-0';\nexport const destinationSelectionFormSearchedSuggestionsListShown = new BaseTrackingEvent('destination-selection-form_searched-suggestions-list_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_discount-cards-selector_click/jsonschema/1-0-0';\nexport const searchFormDiscountCardsSelectorClick = new BaseTrackingEvent('search-form_discount-cards-selector_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['search_result_summary_context', 'search_result_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/srp-first-result-cell-shown/jsonschema/1-0-0';\nexport const srpFirstResultCellShown = new BaseTrackingEvent('srp-first-result-cell-shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form-trip-mode-change/jsonschema/1-0-0';\nexport const searchFormTripModeChange = new BaseTrackingEvent('search-form-trip-mode-change', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_departure-field_click/jsonschema/1-0-0';\nexport const searchFormDepartureFieldClick = new BaseTrackingEvent('search-form_departure-field_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_passengers-selector_click/jsonschema/1-0-0';\nexport const searchFormPassengersSelectorClick = new BaseTrackingEvent('search-form_passengers-selector_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['search_result_summary_context', 'search_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/srp-error-message-unknown-click/jsonschema/1-0-0';\nexport const srpErrorMessageUnknownClick = new BaseTrackingEvent('srp-error-message-unknown-click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/departure-selection-form_searched-suggestions-list_click/jsonschema/1-0-0';\nexport const departureSelectionFormSearchedSuggestionsListClick = new BaseTrackingEvent('departure-selection-form_searched-suggestions-list_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar_confirm-button_shown/jsonschema/1-0-0';\nexport const searchCalendarConfirmButtonShown = new BaseTrackingEvent('search-calendar_confirm-button_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/departure-selection-form_searched-suggestions-list_shown/jsonschema/1-0-0';\nexport const departureSelectionFormSearchedSuggestionsListShown = new BaseTrackingEvent('departure-selection-form_searched-suggestions-list_shown', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-navigation_click/jsonschema/1-0-0';\nexport const searchCalendarNavigationClick = new BaseTrackingEvent('search-calendar-navigation_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-remove-return-button-click/jsonschema/1-0-0';\nexport const searchCalendarRemoveReturnButtonClick = new BaseTrackingEvent('search-calendar-remove-return-button-click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar_confirm-button_click/jsonschema/1-0-0';\nexport const searchCalendarConfirmButtonClick = new BaseTrackingEvent('search-calendar_confirm-button_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar-prices_eligible/jsonschema/4-0-0';\nexport const searchCalendarPricesEligible = new BaseTrackingEvent('search-calendar-prices_eligible', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-calendar_date_click/jsonschema/1-0-0';\nexport const searchCalendarDateClick = new BaseTrackingEvent('search-calendar_date_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = [];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/search-form_destination-field_click/jsonschema/1-0-0';\nexport const searchFormDestinationFieldClick = new BaseTrackingEvent('search-form_destination-field_click', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['latest_page_type_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/core-web-vitals_lcp_loaded/jsonschema/2-0-1';\nexport const coreWebVitalsLcpLoaded = new BaseTrackingEvent('core-web-vitals_lcp_loaded', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['latest_page_type_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/core-web-vitals_cls_loaded/jsonschema/2-0-1';\nexport const coreWebVitalsClsLoaded = new BaseTrackingEvent('core-web-vitals_cls_loaded', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['latest_page_type_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/core-web-vitals_inp_loaded/jsonschema/2-0-1';\nexport const coreWebVitalsInpLoaded = new BaseTrackingEvent('core-web-vitals_inp_loaded', schema, linkedContexts);","// This file is auto generated using CMS based event tracking.\n// Do not modify this file manually!\nimport { BaseTrackingEvent } from \"../../../BaseTrackingEvent\";\n\n/* Properties block */\n\n/* LinkedContextMap type */\n\n/* Linked contexts */\nconst linkedContexts = ['latest_page_type_context'];\n\n/* Event definition block */\nconst schema = 'iglu:com.goeuro/core-web-vitals_fid_loaded/jsonschema/2-0-1';\nexport const coreWebVitalsFidLoaded = new BaseTrackingEvent('core-web-vitals_fid_loaded', schema, linkedContexts);","import { coreWebVitalsClsLoaded, coreWebVitalsFidLoaded, coreWebVitalsInpLoaded, coreWebVitalsLcpLoaded } from \"../../../../cms/lib/events/core-web-vitals/index\";\nconst trackWebVitalMetric = tracker => properties => {\n const {\n value,\n attribution,\n name\n } = properties;\n switch (name.toLowerCase()) {\n case 'lcp':\n coreWebVitalsLcpLoaded.send({\n value,\n element: attribution.element\n }, [], tracker);\n break;\n case 'fid':\n coreWebVitalsFidLoaded.send({\n value,\n element: attribution.eventTarget\n }, [], tracker);\n break;\n case 'cls':\n coreWebVitalsClsLoaded.send({\n value,\n element: attribution.largestShiftTarget\n }, [], tracker);\n break;\n case 'inp':\n coreWebVitalsInpLoaded.send({\n value,\n element: attribution.eventTarget\n }, [], tracker);\n break;\n default:\n break;\n }\n};\nexport default trackWebVitalMetric;","import { TrackerNoop } from \"./TrackerNoop\";\nexport default new TrackerNoop();","export class TrackerNoop {\n wasabiContexts = [];\n trackPageView() {\n if (process.env.NODE_ENV !== 'test') {\n console.warn(`Attempt to trackPageView by noop tracker`);\n }\n }\n trackEvent() {\n if (process.env.NODE_ENV !== 'test') {\n console.warn(`Attempt to trackEvent by noop tracker`);\n }\n }\n setPageType() {\n if (process.env.NODE_ENV !== 'test') {\n console.warn(`Attempt to setPageType by noop tracker`);\n }\n }\n initializeWasabiContexts() {\n if (process.env.NODE_ENV !== 'test') {\n console.warn(`Attempt to initializeWasabiContexts by noop tracker`);\n }\n }\n}","/*!\n * Core functionality for Snowplow JavaScript trackers v3.24.6 (http://bit.ly/sp-js)\n * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { __spreadArray, __assign } from 'tslib';\nimport { v4 } from 'uuid';\n\nvar version$1 = \"3.24.6\";\n\n/*\n * Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io)\n * and Contributors (http://phpjs.org/authors)\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\n * of the Software, and to permit persons to whom the Software is furnished to do\n * so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n/**\n * Decodes a url safe Base 64 encoded string\n * @remarks See: {@link http://tools.ietf.org/html/rfc4648#page-7}\n * @param data - String to decode\n * @returns The decoded string\n */\nfunction base64urldecode(data) {\n if (!data) {\n return data;\n }\n var padding = 4 - (data.length % 4);\n switch (padding) {\n case 2:\n data += '==';\n break;\n case 3:\n data += '=';\n break;\n }\n var b64Data = data.replace(/-/g, '+').replace(/_/g, '/');\n return base64decode(b64Data);\n}\n/**\n * Encodes a string into a url safe Base 64 encoded string\n * @remarks See: {@link http://tools.ietf.org/html/rfc4648#page-7}\n * @param data - String to encode\n * @returns The url safe Base 64 string\n */\nfunction base64urlencode(data) {\n if (!data) {\n return data;\n }\n var enc = base64encode(data);\n return enc.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n}\nvar b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n/**\n * Encode string as base64.\n * Any type can be passed, but will be stringified\n *\n * @param data - string to encode\n * @returns base64-encoded string\n */\nfunction base64encode(data) {\n // discuss at: http://phpjs.org/functions/base64_encode/\n // original by: Tyler Akins (http://rumkin.com)\n // improved by: Bayron Guevara\n // improved by: Thunder.m\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // improved by: Rafał Kukawski (http://kukawski.pl)\n // bugfixed by: Pellentesque Malesuada\n // example 1: base64_encode('Kevin van Zonneveld');\n // returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='\n // example 2: base64_encode('a');\n // returns 2: 'YQ=='\n // example 3: base64_encode('✓ à la mode');\n // returns 3: '4pyTIMOgIGxhIG1vZGU='\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0;\n var tmp_arr = [];\n if (!data) {\n return data;\n }\n data = unescape(encodeURIComponent(data));\n do {\n // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = (o1 << 16) | (o2 << 8) | o3;\n h1 = (bits >> 18) & 0x3f;\n h2 = (bits >> 12) & 0x3f;\n h3 = (bits >> 6) & 0x3f;\n h4 = bits & 0x3f;\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n var enc = tmp_arr.join('');\n var r = data.length % 3;\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\n}\n/**\n * Decode base64 to string\n *\n * @param data - base64 to string\n * @returns decoded string\n */\nfunction base64decode(encodedData) {\n // discuss at: http://locutus.io/php/base64_decode/\n // original by: Tyler Akins (http://rumkin.com)\n // improved by: Thunder.m\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Kevin van Zonneveld (http://kvz.io)\n // input by: Aman Gupta\n // input by: Brett Zamir (http://brett-zamir.me)\n // bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)\n // bugfixed by: Pellentesque Malesuada\n // bugfixed by: Kevin van Zonneveld (http://kvz.io)\n // improved by: Indigo744\n // example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==')\n // returns 1: 'Kevin van Zonneveld'\n // example 2: base64_decode('YQ==')\n // returns 2: 'a'\n // example 3: base64_decode('4pyTIMOgIGxhIG1vZGU=')\n // returns 3: '✓ à la mode'\n // decodeUTF8string()\n // Internal function to decode properly UTF8 string\n // Adapted from Solution #1 at https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding\n var decodeUTF8string = function (str) {\n // Going backwards: from bytestream, to percent-encoding, to original string.\n return decodeURIComponent(str\n .split('')\n .map(function (c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n })\n .join(''));\n };\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = '';\n var tmpArr = [];\n if (!encodedData) {\n return encodedData;\n }\n encodedData += '';\n do {\n // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(encodedData.charAt(i++));\n h2 = b64.indexOf(encodedData.charAt(i++));\n h3 = b64.indexOf(encodedData.charAt(i++));\n h4 = b64.indexOf(encodedData.charAt(i++));\n bits = (h1 << 18) | (h2 << 12) | (h3 << 6) | h4;\n o1 = (bits >> 16) & 0xff;\n o2 = (bits >> 8) & 0xff;\n o3 = bits & 0xff;\n if (h3 === 64) {\n tmpArr[ac++] = String.fromCharCode(o1);\n }\n else if (h4 === 64) {\n tmpArr[ac++] = String.fromCharCode(o1, o2);\n }\n else {\n tmpArr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < encodedData.length);\n dec = tmpArr.join('');\n return decodeUTF8string(dec.replace(/\\0+$/, ''));\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nfunction payloadBuilder() {\n var dict = {}, allJson = [], jsonForProcessing = [], contextEntitiesForProcessing = [];\n var processor;\n var add = function (key, value) {\n if (value != null && value !== '') {\n // null also checks undefined\n dict[key] = value;\n }\n };\n var addDict = function (dict) {\n for (var key in dict) {\n if (Object.prototype.hasOwnProperty.call(dict, key)) {\n add(key, dict[key]);\n }\n }\n };\n var addJson = function (keyIfEncoded, keyIfNotEncoded, json) {\n if (json && isNonEmptyJson(json)) {\n var jsonWithKeys = { keyIfEncoded: keyIfEncoded, keyIfNotEncoded: keyIfNotEncoded, json: json };\n jsonForProcessing.push(jsonWithKeys);\n allJson.push(jsonWithKeys);\n }\n };\n var addContextEntity = function (entity) {\n contextEntitiesForProcessing.push(entity);\n };\n return {\n add: add,\n addDict: addDict,\n addJson: addJson,\n addContextEntity: addContextEntity,\n getPayload: function () { return dict; },\n getJson: function () { return allJson; },\n withJsonProcessor: function (jsonProcessor) {\n processor = jsonProcessor;\n },\n build: function () {\n processor === null || processor === void 0 ? void 0 : processor(this, jsonForProcessing, contextEntitiesForProcessing);\n return dict;\n }\n };\n}\n/**\n * A helper to build a Snowplow request from a set of name-value pairs, provided using the add methods.\n * Will base64 encode JSON, if desired, on build\n *\n * @returns The request builder, with add and build methods\n */\nfunction payloadJsonProcessor(encodeBase64) {\n return function (payloadBuilder, jsonForProcessing, contextEntitiesForProcessing) {\n var add = function (json, keyIfEncoded, keyIfNotEncoded) {\n var str = JSON.stringify(json);\n if (encodeBase64) {\n payloadBuilder.add(keyIfEncoded, base64urlencode(str));\n }\n else {\n payloadBuilder.add(keyIfNotEncoded, str);\n }\n };\n var getContextFromPayload = function () {\n var payload = payloadBuilder.getPayload();\n if (encodeBase64 ? payload.cx : payload.co) {\n return JSON.parse(encodeBase64 ? base64urldecode(payload.cx) : payload.co);\n }\n return undefined;\n };\n var combineContexts = function (originalContext, newContext) {\n var context = originalContext || getContextFromPayload();\n if (context) {\n context.data = context.data.concat(newContext.data);\n }\n else {\n context = newContext;\n }\n return context;\n };\n var context = undefined;\n for (var _i = 0, jsonForProcessing_1 = jsonForProcessing; _i < jsonForProcessing_1.length; _i++) {\n var json = jsonForProcessing_1[_i];\n if (json.keyIfEncoded === 'cx') {\n context = combineContexts(context, json.json);\n }\n else {\n add(json.json, json.keyIfEncoded, json.keyIfNotEncoded);\n }\n }\n jsonForProcessing.length = 0;\n if (contextEntitiesForProcessing.length) {\n var newContext = {\n schema: 'iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0',\n data: __spreadArray([], contextEntitiesForProcessing, true)\n };\n context = combineContexts(context, newContext);\n contextEntitiesForProcessing.length = 0;\n }\n if (context) {\n add(context, 'cx', 'co');\n }\n };\n}\n/**\n * Is property a non-empty JSON?\n * @param property - Checks if object is non-empty json\n */\nfunction isNonEmptyJson(property) {\n if (!isJson(property)) {\n return false;\n }\n for (var key in property) {\n if (Object.prototype.hasOwnProperty.call(property, key)) {\n return true;\n }\n }\n return false;\n}\n/**\n * Is property a JSON?\n * @param property - Checks if object is json\n */\nfunction isJson(property) {\n return (typeof property !== 'undefined' &&\n property !== null &&\n (property.constructor === {}.constructor || property.constructor === [].constructor));\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar label = 'Snowplow: ';\nvar LOG_LEVEL;\n(function (LOG_LEVEL) {\n LOG_LEVEL[LOG_LEVEL[\"none\"] = 0] = \"none\";\n LOG_LEVEL[LOG_LEVEL[\"error\"] = 1] = \"error\";\n LOG_LEVEL[LOG_LEVEL[\"warn\"] = 2] = \"warn\";\n LOG_LEVEL[LOG_LEVEL[\"debug\"] = 3] = \"debug\";\n LOG_LEVEL[LOG_LEVEL[\"info\"] = 4] = \"info\";\n})(LOG_LEVEL || (LOG_LEVEL = {}));\nvar LOG = logger();\nfunction logger(logLevel) {\n if (logLevel === void 0) { logLevel = LOG_LEVEL.warn; }\n function setLogLevel(level) {\n if (LOG_LEVEL[level]) {\n logLevel = level;\n }\n else {\n logLevel = LOG_LEVEL.warn;\n }\n }\n /**\n * Log errors, with or without error object\n */\n function error(message, error) {\n var extraParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraParams[_i - 2] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.error && typeof console !== 'undefined') {\n var logMsg = label + message + '\\n';\n if (error) {\n console.error.apply(console, __spreadArray([logMsg + '\\n', error], extraParams, false));\n }\n else {\n console.error.apply(console, __spreadArray([logMsg], extraParams, false));\n }\n }\n }\n /**\n * Log warnings, with or without error object\n */\n function warn(message, error) {\n var extraParams = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraParams[_i - 2] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.warn && typeof console !== 'undefined') {\n var logMsg = label + message;\n if (error) {\n console.warn.apply(console, __spreadArray([logMsg + '\\n', error], extraParams, false));\n }\n else {\n console.warn.apply(console, __spreadArray([logMsg], extraParams, false));\n }\n }\n }\n /**\n * Log debug messages\n */\n function debug(message) {\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.debug && typeof console !== 'undefined') {\n console.debug.apply(console, __spreadArray([label + message], extraParams, false));\n }\n }\n /**\n * Log info messages\n */\n function info(message) {\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n if (logLevel >= LOG_LEVEL.info && typeof console !== 'undefined') {\n console.info.apply(console, __spreadArray([label + message], extraParams, false));\n }\n }\n return { setLogLevel: setLogLevel, warn: warn, error: error, debug: debug, info: info };\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Contains helper functions to aid in the addition and removal of Global Contexts\n */\nfunction globalContexts() {\n var globalPrimitives = [];\n var conditionalProviders = [];\n /**\n * Returns all applicable global contexts for a specified event\n * @param event - The event to check for applicable global contexts for\n * @returns An array of contexts\n */\n var assembleAllContexts = function (event) {\n var eventSchema = getUsefulSchema(event);\n var eventType = getEventType(event);\n var contexts = [];\n var generatedPrimitives = generatePrimitives(globalPrimitives, event, eventType, eventSchema);\n contexts.push.apply(contexts, generatedPrimitives);\n var generatedConditionals = generateConditionals(conditionalProviders, event, eventType, eventSchema);\n contexts.push.apply(contexts, generatedConditionals);\n return contexts;\n };\n return {\n getGlobalPrimitives: function () {\n return globalPrimitives;\n },\n getConditionalProviders: function () {\n return conditionalProviders;\n },\n addGlobalContexts: function (contexts) {\n var acceptedConditionalContexts = [];\n var acceptedContextPrimitives = [];\n for (var _i = 0, contexts_1 = contexts; _i < contexts_1.length; _i++) {\n var context = contexts_1[_i];\n if (isConditionalContextProvider(context)) {\n acceptedConditionalContexts.push(context);\n }\n else if (isContextPrimitive(context)) {\n acceptedContextPrimitives.push(context);\n }\n }\n globalPrimitives = globalPrimitives.concat(acceptedContextPrimitives);\n conditionalProviders = conditionalProviders.concat(acceptedConditionalContexts);\n },\n clearGlobalContexts: function () {\n conditionalProviders = [];\n globalPrimitives = [];\n },\n removeGlobalContexts: function (contexts) {\n var _loop_1 = function (context) {\n if (isConditionalContextProvider(context)) {\n conditionalProviders = conditionalProviders.filter(function (item) { return !compareProvider(context, item); });\n }\n else if (isContextPrimitive(context)) {\n globalPrimitives = globalPrimitives.filter(function (item) { return !compareProvider(context, item); });\n }\n };\n for (var _i = 0, contexts_2 = contexts; _i < contexts_2.length; _i++) {\n var context = contexts_2[_i];\n _loop_1(context);\n }\n },\n getApplicableContexts: function (event) {\n return assembleAllContexts(event);\n }\n };\n}\nfunction pluginContexts(plugins) {\n /**\n * Add common contexts to every event\n *\n * @param array - additionalContexts List of user-defined contexts\n * @returns userContexts combined with commonContexts\n */\n return {\n addPluginContexts: function (additionalContexts) {\n var combinedContexts = additionalContexts ? __spreadArray([], additionalContexts, true) : [];\n plugins.forEach(function (plugin) {\n try {\n if (plugin.contexts) {\n combinedContexts.push.apply(combinedContexts, plugin.contexts());\n }\n }\n catch (ex) {\n LOG.error('Error adding plugin contexts', ex);\n }\n });\n return combinedContexts;\n }\n };\n}\n/**\n * Find dynamic context generating functions and return their results to be merged into the static contexts\n * Combine an array of unchanging contexts with the result of a context-creating function\n *\n * @param dynamicOrStaticContexts - Array of custom context Objects or custom context generating functions\n * @param Parameters - to pass to dynamic context callbacks\n * @returns An array of Self Describing JSON context\n */\nfunction resolveDynamicContext(dynamicOrStaticContexts) {\n var _a;\n var extraParams = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n extraParams[_i - 1] = arguments[_i];\n }\n return ((_a = dynamicOrStaticContexts === null || dynamicOrStaticContexts === void 0 ? void 0 : dynamicOrStaticContexts.map(function (context) {\n if (typeof context === 'function') {\n try {\n return context.apply(void 0, extraParams);\n }\n catch (e) {\n //TODO: provide warning\n return undefined;\n }\n }\n else {\n return context;\n }\n }).filter(Boolean)) !== null && _a !== void 0 ? _a : []);\n}\n/**\n * Slices a schema into its composite parts. Useful for ruleset filtering.\n * @param input - A schema string\n * @returns The vendor, schema name, major, minor and patch information of a schema string\n */\nfunction getSchemaParts(input) {\n var re = new RegExp('^iglu:([a-zA-Z0-9-_.]+)/([a-zA-Z0-9-_]+)/jsonschema/([1-9][0-9]*)-(0|[1-9][0-9]*)-(0|[1-9][0-9]*)$');\n var matches = re.exec(input);\n if (matches !== null)\n return matches.slice(1, 6);\n return undefined;\n}\n/**\n * Validates the vendor section of a schema string contains allowed wildcard values\n * @param parts - Array of parts from a schema string\n * @returns Whether the vendor validation parts are a valid combination\n */\nfunction validateVendorParts(parts) {\n if (parts[0] === '*' || parts[1] === '*') {\n return false; // no wildcard in first or second part\n }\n if (parts.slice(2).length > 0) {\n var asterisk = false;\n for (var _i = 0, _a = parts.slice(2); _i < _a.length; _i++) {\n var part = _a[_i];\n if (part === '*')\n // mark when we've found a wildcard\n asterisk = true;\n else if (asterisk)\n // invalid if alpha parts come after wildcard\n return false;\n }\n return true;\n }\n else if (parts.length == 2)\n return true;\n return false;\n}\n/**\n * Validates the vendor part of a schema string is valid for a rule set\n * @param input - Vendor part of a schema string\n * @returns Whether the vendor validation string is valid\n */\nfunction validateVendor(input) {\n var parts = input.split('.');\n if (parts && parts.length > 1)\n return validateVendorParts(parts);\n return false;\n}\n/**\n * Checks for validity of input and returns all the sections of a schema string that are used to match rules in a ruleset\n * @param input - A Schema string\n * @returns The sections of a schema string that are used to match rules in a ruleset\n */\nfunction getRuleParts(input) {\n var re = new RegExp('^iglu:((?:(?:[a-zA-Z0-9-_]+|\\\\*).)+(?:[a-zA-Z0-9-_]+|\\\\*))/([a-zA-Z0-9-_.]+|\\\\*)/jsonschema/([1-9][0-9]*|\\\\*)-(0|[1-9][0-9]*|\\\\*)-(0|[1-9][0-9]*|\\\\*)$');\n var matches = re.exec(input);\n if (matches !== null && validateVendor(matches[1]))\n return matches.slice(1, 6);\n return undefined;\n}\n/**\n * Ensures the rules specified in a schema string of a ruleset are valid\n * @param input - A Schema string\n * @returns if there rule is valid\n */\nfunction isValidRule(input) {\n var ruleParts = getRuleParts(input);\n if (ruleParts) {\n var vendor = ruleParts[0];\n return ruleParts.length === 5 && validateVendor(vendor);\n }\n return false;\n}\n/**\n * Check if a variable is an Array containing only strings\n * @param input - The variable to validate\n * @returns True if the input is an array containing only strings\n */\nfunction isStringArray(input) {\n return (Array.isArray(input) &&\n input.every(function (x) {\n return typeof x === 'string';\n }));\n}\n/**\n * Validates whether a rule set is an array of valid ruleset strings\n * @param input - The Array of rule set arguments\n * @returns True is the input is an array of valid rules\n */\nfunction isValidRuleSetArg(input) {\n if (isStringArray(input))\n return input.every(function (x) {\n return isValidRule(x);\n });\n else if (typeof input === 'string')\n return isValidRule(input);\n return false;\n}\n/**\n * Check if a variable is a valid, non-empty Self Describing JSON\n * @param input - The variable to validate\n * @returns True if a valid Self Describing JSON\n */\nfunction isSelfDescribingJson(input) {\n var sdj = input;\n if (isNonEmptyJson(sdj))\n if ('schema' in sdj && 'data' in sdj)\n return typeof sdj.schema === 'string' && typeof sdj.data === 'object';\n return false;\n}\n/**\n * Validates if the input object contains the expected properties of a ruleset\n * @param input - The object containing a rule set\n * @returns True if a valid rule set\n */\nfunction isRuleSet(input) {\n var ruleSet = input;\n var ruleCount = 0;\n if (input != null && typeof input === 'object' && !Array.isArray(input)) {\n if (Object.prototype.hasOwnProperty.call(ruleSet, 'accept')) {\n if (isValidRuleSetArg(ruleSet['accept'])) {\n ruleCount += 1;\n }\n else {\n return false;\n }\n }\n if (Object.prototype.hasOwnProperty.call(ruleSet, 'reject')) {\n if (isValidRuleSetArg(ruleSet['reject'])) {\n ruleCount += 1;\n }\n else {\n return false;\n }\n }\n // if either 'reject' or 'accept' or both exists,\n // we have a valid ruleset\n return ruleCount > 0 && ruleCount <= 2;\n }\n return false;\n}\n/**\n * Validates if the function can be a valid context generator function\n * @param input - The function to be validated\n */\nfunction isContextCallbackFunction(input) {\n return typeof input === 'function' && input.length <= 1;\n}\n/**\n * Validates if the function can be a valid context primitive function or self describing json\n * @param input - The function or orbject to be validated\n * @returns True if either a Context Generator or Self Describing JSON\n */\nfunction isContextPrimitive(input) {\n return isContextCallbackFunction(input) || isSelfDescribingJson(input);\n}\n/**\n * Validates if an array is a valid shape to be a Filter Provider\n * @param input - The Array of Context filter callbacks\n */\nfunction isFilterProvider(input) {\n if (Array.isArray(input)) {\n if (input.length === 2) {\n if (Array.isArray(input[1])) {\n return isContextCallbackFunction(input[0]) && input[1].every(isContextPrimitive);\n }\n return isContextCallbackFunction(input[0]) && isContextPrimitive(input[1]);\n }\n }\n return false;\n}\n/**\n * Validates if an array is a valid shape to be an array of rule sets\n * @param input - The Array of Rule Sets\n */\nfunction isRuleSetProvider(input) {\n if (Array.isArray(input) && input.length === 2) {\n if (!isRuleSet(input[0]))\n return false;\n if (Array.isArray(input[1]))\n return input[1].every(isContextPrimitive);\n return isContextPrimitive(input[1]);\n }\n return false;\n}\n/**\n * Checks if an input array is either a filter provider or a rule set provider\n * @param input - An array of filter providers or rule set providers\n * @returns Whether the array is a valid {@link ConditionalContextProvider}\n */\nfunction isConditionalContextProvider(input) {\n return isFilterProvider(input) || isRuleSetProvider(input);\n}\n/**\n * Checks if a given schema matches any rules within the provided rule set\n * @param ruleSet - The rule set containing rules to match schema against\n * @param schema - The schema to be matched against the rule set\n */\nfunction matchSchemaAgainstRuleSet(ruleSet, schema) {\n var rejectCount = 0;\n var acceptCount = 0;\n var acceptRules = ruleSet['accept'];\n if (Array.isArray(acceptRules)) {\n if (ruleSet.accept.some(function (rule) { return matchSchemaAgainstRule(rule, schema); })) {\n acceptCount++;\n }\n }\n else if (typeof acceptRules === 'string') {\n if (matchSchemaAgainstRule(acceptRules, schema)) {\n acceptCount++;\n }\n }\n var rejectRules = ruleSet['reject'];\n if (Array.isArray(rejectRules)) {\n if (ruleSet.reject.some(function (rule) { return matchSchemaAgainstRule(rule, schema); })) {\n rejectCount++;\n }\n }\n else if (typeof rejectRules === 'string') {\n if (matchSchemaAgainstRule(rejectRules, schema)) {\n rejectCount++;\n }\n }\n if (acceptCount > 0 && rejectCount === 0) {\n return true;\n }\n else if (acceptCount === 0 && rejectCount > 0) {\n return false;\n }\n return false;\n}\n/**\n * Checks if a given schema matches a specific rule from a rule set\n * @param rule - The rule to match schema against\n * @param schema - The schema to be matched against the rule\n */\nfunction matchSchemaAgainstRule(rule, schema) {\n if (!isValidRule(rule))\n return false;\n var ruleParts = getRuleParts(rule);\n var schemaParts = getSchemaParts(schema);\n if (ruleParts && schemaParts) {\n if (!matchVendor(ruleParts[0], schemaParts[0]))\n return false;\n for (var i = 1; i < 5; i++) {\n if (!matchPart(ruleParts[i], schemaParts[i]))\n return false;\n }\n return true; // if it hasn't failed, it passes\n }\n return false;\n}\nfunction matchVendor(rule, vendor) {\n // rule and vendor must have same number of elements\n var vendorParts = vendor.split('.');\n var ruleParts = rule.split('.');\n if (vendorParts && ruleParts) {\n if (vendorParts.length !== ruleParts.length)\n return false;\n for (var i = 0; i < ruleParts.length; i++) {\n if (!matchPart(vendorParts[i], ruleParts[i]))\n return false;\n }\n return true;\n }\n return false;\n}\nfunction matchPart(rule, schema) {\n // parts should be the string nested between slashes in the URI: /example/\n return (rule && schema && rule === '*') || rule === schema;\n}\n// Returns the \"useful\" schema, i.e. what would someone want to use to identify events.\n// For some events this is the 'e' property but for unstructured events, this is the\n// 'schema' from the 'ue_px' field.\nfunction getUsefulSchema(sb) {\n var eventJson = sb.getJson();\n for (var _i = 0, eventJson_1 = eventJson; _i < eventJson_1.length; _i++) {\n var json = eventJson_1[_i];\n if (json.keyIfEncoded === 'ue_px' && typeof json.json['data'] === 'object') {\n var schema = json.json['data']['schema'];\n if (typeof schema == 'string') {\n return schema;\n }\n }\n }\n return '';\n}\nfunction getEventType(payloadBuilder) {\n var eventType = payloadBuilder.getPayload()['e'];\n return typeof eventType === 'string' ? eventType : '';\n}\nfunction buildGenerator(generator, event, eventType, eventSchema) {\n var contextGeneratorResult = undefined;\n try {\n // try to evaluate context generator\n var args = {\n event: event.getPayload(),\n eventType: eventType,\n eventSchema: eventSchema\n };\n contextGeneratorResult = generator(args);\n // determine if the produced result is a valid SDJ\n if (Array.isArray(contextGeneratorResult) && contextGeneratorResult.every(isSelfDescribingJson)) {\n return contextGeneratorResult;\n }\n else if (isSelfDescribingJson(contextGeneratorResult)) {\n return contextGeneratorResult;\n }\n else {\n return undefined;\n }\n }\n catch (error) {\n contextGeneratorResult = undefined;\n }\n return contextGeneratorResult;\n}\nfunction normalizeToArray(input) {\n if (Array.isArray(input)) {\n return input;\n }\n return Array.of(input);\n}\nfunction generatePrimitives(contextPrimitives, event, eventType, eventSchema) {\n var _a;\n var normalizedInputs = normalizeToArray(contextPrimitives);\n var partialEvaluate = function (primitive) {\n var result = evaluatePrimitive(primitive, event, eventType, eventSchema);\n if (result && result.length !== 0) {\n return result;\n }\n return undefined;\n };\n var generatedContexts = normalizedInputs.map(partialEvaluate);\n return (_a = []).concat.apply(_a, generatedContexts.filter(function (c) { return c != null && c.filter(Boolean); }));\n}\nfunction evaluatePrimitive(contextPrimitive, event, eventType, eventSchema) {\n if (isSelfDescribingJson(contextPrimitive)) {\n return [contextPrimitive];\n }\n else if (isContextCallbackFunction(contextPrimitive)) {\n var generatorOutput = buildGenerator(contextPrimitive, event, eventType, eventSchema);\n if (isSelfDescribingJson(generatorOutput)) {\n return [generatorOutput];\n }\n else if (Array.isArray(generatorOutput)) {\n return generatorOutput;\n }\n }\n return undefined;\n}\nfunction evaluateProvider(provider, event, eventType, eventSchema) {\n if (isFilterProvider(provider)) {\n var filter = provider[0];\n var filterResult = false;\n try {\n var args = {\n event: event.getPayload(),\n eventType: eventType,\n eventSchema: eventSchema\n };\n filterResult = filter(args);\n }\n catch (error) {\n filterResult = false;\n }\n if (filterResult === true) {\n return generatePrimitives(provider[1], event, eventType, eventSchema);\n }\n }\n else if (isRuleSetProvider(provider)) {\n if (matchSchemaAgainstRuleSet(provider[0], eventSchema)) {\n return generatePrimitives(provider[1], event, eventType, eventSchema);\n }\n }\n return [];\n}\nfunction compareProviderPart(a, b) {\n if (typeof a === 'function')\n return a === b;\n return JSON.stringify(a) === JSON.stringify(b);\n}\nfunction compareProvider(a, b) {\n if (isConditionalContextProvider(a)) {\n if (!isConditionalContextProvider(b))\n return false;\n var ruleA = a[0], primitivesA = a[1];\n var ruleB = b[0], primitivesB_1 = b[1];\n if (!compareProviderPart(ruleA, ruleB))\n return false;\n if (Array.isArray(primitivesA)) {\n if (!Array.isArray(primitivesB_1))\n return false;\n if (primitivesA.length !== primitivesB_1.length)\n return false;\n return primitivesA.reduce(function (matches, a, i) { return matches && compareProviderPart(a, primitivesB_1[i]); }, true);\n }\n else {\n if (Array.isArray(primitivesB_1))\n return false;\n return compareProviderPart(primitivesA, primitivesB_1);\n }\n }\n else if (isContextPrimitive(a)) {\n if (!isContextPrimitive(b))\n return false;\n return compareProviderPart(a, b);\n }\n return false;\n}\nfunction generateConditionals(providers, event, eventType, eventSchema) {\n var _a;\n var normalizedInput = normalizeToArray(providers);\n var partialEvaluate = function (provider) {\n var result = evaluateProvider(provider, event, eventType, eventSchema);\n if (result && result.length !== 0) {\n return result;\n }\n return undefined;\n };\n var generatedContexts = normalizedInput.map(partialEvaluate);\n return (_a = []).concat.apply(_a, generatedContexts.filter(function (c) { return c != null && c.filter(Boolean); }));\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Transform optional/old-behavior number timestamp into`Timestamp` ADT\n *\n * @param timestamp - optional number or timestamp object\n * @returns correct timestamp object\n */\nfunction getTimestamp(timestamp) {\n if (timestamp == null) {\n return { type: 'dtm', value: new Date().getTime() };\n }\n else if (typeof timestamp === 'number') {\n return { type: 'dtm', value: timestamp };\n }\n else if (timestamp.type === 'ttm') {\n // We can return timestamp here, but this is safer fallback\n return { type: 'ttm', value: timestamp.value };\n }\n else {\n return { type: 'dtm', value: timestamp.value || new Date().getTime() };\n }\n}\n/**\n * Create a tracker core object\n *\n * @param base64 - Whether to base 64 encode contexts and self describing event JSONs\n * @param corePlugins - The core plugins to be processed with each event\n * @param callback - Function applied to every payload dictionary object\n * @returns Tracker core\n */\nfunction trackerCore(configuration) {\n if (configuration === void 0) { configuration = {}; }\n function newCore(base64, corePlugins, callback) {\n var pluginContextsHelper = pluginContexts(corePlugins), globalContextsHelper = globalContexts();\n var encodeBase64 = base64, payloadPairs = {}; // Dictionary of key-value pairs which get added to every payload, e.g. tracker version\n /**\n * Wraps an array of custom contexts in a self-describing JSON\n *\n * @param contexts - Array of custom context self-describing JSONs\n * @returns Outer JSON\n */\n function completeContexts(contexts) {\n if (contexts && contexts.length) {\n return {\n schema: 'iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-0',\n data: contexts\n };\n }\n return undefined;\n }\n /**\n * Adds all global contexts to a contexts array\n *\n * @param pb - PayloadData\n * @param contexts - Custom contexts relating to the event\n */\n function attachGlobalContexts(pb, contexts) {\n var applicableContexts = globalContextsHelper.getApplicableContexts(pb);\n var returnedContexts = [];\n if (contexts && contexts.length) {\n returnedContexts.push.apply(returnedContexts, contexts);\n }\n if (applicableContexts && applicableContexts.length) {\n returnedContexts.push.apply(returnedContexts, applicableContexts);\n }\n return returnedContexts;\n }\n /**\n * Gets called by every trackXXX method\n * Adds context and payloadPairs name-value pairs to the payload\n * Applies the callback to the built payload\n *\n * @param pb - Payload\n * @param context - Custom contexts relating to the event\n * @param timestamp - Timestamp of the event\n * @returns Payload after the callback is applied\n */\n function track(pb, context, timestamp) {\n pb.withJsonProcessor(payloadJsonProcessor(encodeBase64));\n pb.add('eid', v4());\n pb.addDict(payloadPairs);\n var tstamp = getTimestamp(timestamp);\n pb.add(tstamp.type, tstamp.value.toString());\n var allContexts = attachGlobalContexts(pb, pluginContextsHelper.addPluginContexts(context));\n var wrappedContexts = completeContexts(allContexts);\n if (wrappedContexts !== undefined) {\n pb.addJson('cx', 'co', wrappedContexts);\n }\n corePlugins.forEach(function (plugin) {\n try {\n if (plugin.beforeTrack) {\n plugin.beforeTrack(pb);\n }\n }\n catch (ex) {\n LOG.error('Plugin beforeTrack', ex);\n }\n });\n if (typeof callback === 'function') {\n callback(pb);\n }\n var finalPayload = pb.build();\n corePlugins.forEach(function (plugin) {\n try {\n if (plugin.afterTrack) {\n plugin.afterTrack(finalPayload);\n }\n }\n catch (ex) {\n LOG.error('Plugin afterTrack', ex);\n }\n });\n return finalPayload;\n }\n /**\n * Set a persistent key-value pair to be added to every payload\n *\n * @param key - Field name\n * @param value - Field value\n */\n function addPayloadPair(key, value) {\n payloadPairs[key] = value;\n }\n var core = {\n track: track,\n addPayloadPair: addPayloadPair,\n getBase64Encoding: function () {\n return encodeBase64;\n },\n setBase64Encoding: function (encode) {\n encodeBase64 = encode;\n },\n addPayloadDict: function (dict) {\n for (var key in dict) {\n if (Object.prototype.hasOwnProperty.call(dict, key)) {\n payloadPairs[key] = dict[key];\n }\n }\n },\n resetPayloadPairs: function (dict) {\n payloadPairs = isJson(dict) ? dict : {};\n },\n setTrackerVersion: function (version) {\n addPayloadPair('tv', version);\n },\n setTrackerNamespace: function (name) {\n addPayloadPair('tna', name);\n },\n setAppId: function (appId) {\n addPayloadPair('aid', appId);\n },\n setPlatform: function (value) {\n addPayloadPair('p', value);\n },\n setUserId: function (userId) {\n addPayloadPair('uid', userId);\n },\n setScreenResolution: function (width, height) {\n addPayloadPair('res', width + 'x' + height);\n },\n setViewport: function (width, height) {\n addPayloadPair('vp', width + 'x' + height);\n },\n setColorDepth: function (depth) {\n addPayloadPair('cd', depth);\n },\n setTimezone: function (timezone) {\n addPayloadPair('tz', timezone);\n },\n setLang: function (lang) {\n addPayloadPair('lang', lang);\n },\n setIpAddress: function (ip) {\n addPayloadPair('ip', ip);\n },\n setUseragent: function (useragent) {\n addPayloadPair('ua', useragent);\n },\n addGlobalContexts: function (contexts) {\n globalContextsHelper.addGlobalContexts(contexts);\n },\n clearGlobalContexts: function () {\n globalContextsHelper.clearGlobalContexts();\n },\n removeGlobalContexts: function (contexts) {\n globalContextsHelper.removeGlobalContexts(contexts);\n }\n };\n return core;\n }\n var base64 = configuration.base64, corePlugins = configuration.corePlugins, callback = configuration.callback, plugins = corePlugins !== null && corePlugins !== void 0 ? corePlugins : [], partialCore = newCore(base64 !== null && base64 !== void 0 ? base64 : true, plugins, callback), core = __assign(__assign({}, partialCore), { addPlugin: function (configuration) {\n var _a, _b;\n var plugin = configuration.plugin;\n plugins.push(plugin);\n (_a = plugin.logger) === null || _a === void 0 ? void 0 : _a.call(plugin, LOG);\n (_b = plugin.activateCorePlugin) === null || _b === void 0 ? void 0 : _b.call(plugin, core);\n } });\n plugins === null || plugins === void 0 ? void 0 : plugins.forEach(function (plugin) {\n var _a, _b;\n (_a = plugin.logger) === null || _a === void 0 ? void 0 : _a.call(plugin, LOG);\n (_b = plugin.activateCorePlugin) === null || _b === void 0 ? void 0 : _b.call(plugin, core);\n });\n return core;\n}\n/**\n * Build a self-describing event\n * A custom event type, allowing for an event to be tracked using your own custom schema\n * and a data object which conforms to the supplied schema\n *\n * @param event - Contains the properties and schema location for the event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildSelfDescribingEvent(event) {\n var _a = event.event, schema = _a.schema, data = _a.data, pb = payloadBuilder();\n var ueJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0',\n data: { schema: schema, data: data }\n };\n pb.add('e', 'ue');\n pb.addJson('ue_px', 'ue_pr', ueJson);\n return pb;\n}\n/**\n * Build a Page View Event\n * Represents a Page View, which is typically fired as soon as possible when a web page\n * is loaded within the users browser. Often also fired on \"virtual page views\" within\n * Single Page Applications (SPA).\n *\n * @param event - Contains the properties for the Page View event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildPageView(event) {\n var pageUrl = event.pageUrl, pageTitle = event.pageTitle, referrer = event.referrer, pb = payloadBuilder();\n pb.add('e', 'pv'); // 'pv' for Page View\n pb.add('url', pageUrl);\n pb.add('page', pageTitle);\n pb.add('refr', referrer);\n return pb;\n}\n/**\n * Build a Page Ping Event\n * Fires when activity tracking is enabled in the browser.\n * Tracks same information as the last tracked Page View and includes scroll\n * information from the current page view\n *\n * @param event - Contains the properties for the Page Ping event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildPagePing(event) {\n var pageUrl = event.pageUrl, pageTitle = event.pageTitle, referrer = event.referrer, minXOffset = event.minXOffset, maxXOffset = event.maxXOffset, minYOffset = event.minYOffset, maxYOffset = event.maxYOffset, pb = payloadBuilder();\n pb.add('e', 'pp'); // 'pp' for Page Ping\n pb.add('url', pageUrl);\n pb.add('page', pageTitle);\n pb.add('refr', referrer);\n if (minXOffset && !isNaN(Number(minXOffset)))\n pb.add('pp_mix', minXOffset.toString());\n if (maxXOffset && !isNaN(Number(maxXOffset)))\n pb.add('pp_max', maxXOffset.toString());\n if (minYOffset && !isNaN(Number(minYOffset)))\n pb.add('pp_miy', minYOffset.toString());\n if (maxYOffset && !isNaN(Number(maxYOffset)))\n pb.add('pp_may', maxYOffset.toString());\n return pb;\n}\n/**\n * Build a Structured Event\n * A classic style of event tracking, allows for easier movement between analytics\n * systems. A loosely typed event, creating a Self Describing event is preferred, but\n * useful for interoperability.\n *\n * @param event - Contains the properties for the Structured event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildStructEvent(event) {\n var category = event.category, action = event.action, label = event.label, property = event.property, value = event.value, pb = payloadBuilder();\n pb.add('e', 'se'); // 'se' for Structured Event\n pb.add('se_ca', category);\n pb.add('se_ac', action);\n pb.add('se_la', label);\n pb.add('se_pr', property);\n pb.add('se_va', value == null ? undefined : value.toString());\n return pb;\n}\n/**\n * Build an Ecommerce Transaction Event\n * Allows for tracking common ecommerce events, this event is usually used when\n * a consumer completes a transaction.\n *\n * @param event - Contains the properties for the Ecommerce Transactoion event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildEcommerceTransaction(event) {\n var orderId = event.orderId, total = event.total, affiliation = event.affiliation, tax = event.tax, shipping = event.shipping, city = event.city, state = event.state, country = event.country, currency = event.currency, pb = payloadBuilder();\n pb.add('e', 'tr'); // 'tr' for Transaction\n pb.add('tr_id', orderId);\n pb.add('tr_af', affiliation);\n pb.add('tr_tt', total);\n pb.add('tr_tx', tax);\n pb.add('tr_sh', shipping);\n pb.add('tr_ci', city);\n pb.add('tr_st', state);\n pb.add('tr_co', country);\n pb.add('tr_cu', currency);\n return pb;\n}\n/**\n * Build an Ecommerce Transaction Item Event\n * Related to the {@link buildEcommerceTransaction}\n * Each Ecommerce Transaction may contain one or more EcommerceTransactionItem events\n *\n * @param event - Contains the properties for the Ecommerce Transaction Item event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildEcommerceTransactionItem(event) {\n var orderId = event.orderId, sku = event.sku, price = event.price, name = event.name, category = event.category, quantity = event.quantity, currency = event.currency, pb = payloadBuilder();\n pb.add('e', 'ti'); // 'tr' for Transaction Item\n pb.add('ti_id', orderId);\n pb.add('ti_sk', sku);\n pb.add('ti_nm', name);\n pb.add('ti_ca', category);\n pb.add('ti_pr', price);\n pb.add('ti_qu', quantity);\n pb.add('ti_cu', currency);\n return pb;\n}\n/**\n * Build a Scren View Event\n * Similar to a Page View but less focused on typical web properties\n * Often used for mobile applications as the user is presented with\n * new views as they performance navigation events\n *\n * @param event - Contains the properties for the Screen View event. One or more properties must be included.\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildScreenView(event) {\n var name = event.name, id = event.id;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0',\n data: removeEmptyProperties({ name: name, id: id })\n }\n });\n}\n/**\n * Build a Link Click Event\n * Used when a user clicks on a link on a webpage, typically an anchor tag ``\n *\n * @param event - Contains the properties for the Link Click event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildLinkClick(event) {\n var targetUrl = event.targetUrl, elementId = event.elementId, elementClasses = event.elementClasses, elementTarget = event.elementTarget, elementContent = event.elementContent;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/link_click/jsonschema/1-0-1',\n data: removeEmptyProperties({ targetUrl: targetUrl, elementId: elementId, elementClasses: elementClasses, elementTarget: elementTarget, elementContent: elementContent })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Impression Event\n * Used to track an advertisement impression\n *\n * @remarks\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Impression event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildAdImpression(event) {\n var impressionId = event.impressionId, costModel = event.costModel, cost = event.cost, targetUrl = event.targetUrl, bannerId = event.bannerId, zoneId = event.zoneId, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_impression/jsonschema/1-0-0',\n data: removeEmptyProperties({\n impressionId: impressionId,\n costModel: costModel,\n cost: cost,\n targetUrl: targetUrl,\n bannerId: bannerId,\n zoneId: zoneId,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Click Event\n * Used to track an advertisement click\n *\n * @remarks\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Click event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildAdClick(event) {\n var targetUrl = event.targetUrl, clickId = event.clickId, costModel = event.costModel, cost = event.cost, bannerId = event.bannerId, zoneId = event.zoneId, impressionId = event.impressionId, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_click/jsonschema/1-0-0',\n data: removeEmptyProperties({\n targetUrl: targetUrl,\n clickId: clickId,\n costModel: costModel,\n cost: cost,\n bannerId: bannerId,\n zoneId: zoneId,\n impressionId: impressionId,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Ad Conversion Event\n * Used to track an advertisement click\n *\n * @remarks\n * If you provide the cost field, you must also provide one of 'cpa', 'cpc', and 'cpm' for the costModel field.\n *\n * @param event - Contains the properties for the Ad Conversion event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildAdConversion(event) {\n var conversionId = event.conversionId, costModel = event.costModel, cost = event.cost, category = event.category, action = event.action, property = event.property, initialValue = event.initialValue, advertiserId = event.advertiserId, campaignId = event.campaignId;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/ad_conversion/jsonschema/1-0-0',\n data: removeEmptyProperties({\n conversionId: conversionId,\n costModel: costModel,\n cost: cost,\n category: category,\n action: action,\n property: property,\n initialValue: initialValue,\n advertiserId: advertiserId,\n campaignId: campaignId\n })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Social Interaction Event\n * Social tracking will be used to track the way users interact\n * with Facebook, Twitter and Google + widgets\n * e.g. to capture “like this” or “tweet this” events.\n *\n * @param event - Contains the properties for the Social Interaction event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildSocialInteraction(event) {\n var action = event.action, network = event.network, target = event.target;\n var eventJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/social_interaction/jsonschema/1-0-0',\n data: removeEmptyProperties({ action: action, network: network, target: target })\n };\n return buildSelfDescribingEvent({ event: eventJson });\n}\n/**\n * Build a Add To Cart Event\n * For tracking users adding items from a cart\n * on an ecommerce site.\n *\n * @param event - Contains the properties for the Add To Cart event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildAddToCart(event) {\n var sku = event.sku, quantity = event.quantity, name = event.name, category = event.category, unitPrice = event.unitPrice, currency = event.currency;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/add_to_cart/jsonschema/1-0-0',\n data: removeEmptyProperties({\n sku: sku,\n quantity: quantity,\n name: name,\n category: category,\n unitPrice: unitPrice,\n currency: currency\n })\n }\n });\n}\n/**\n * Build a Remove From Cart Event\n * For tracking users removing items from a cart\n * on an ecommerce site.\n *\n * @param event - Contains the properties for the Remove From Cart event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildRemoveFromCart(event) {\n var sku = event.sku, quantity = event.quantity, name = event.name, category = event.category, unitPrice = event.unitPrice, currency = event.currency;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/remove_from_cart/jsonschema/1-0-0',\n data: removeEmptyProperties({\n sku: sku,\n quantity: quantity,\n name: name,\n category: category,\n unitPrice: unitPrice,\n currency: currency\n })\n }\n });\n}\n/**\n * Build a Form Focus or Change Form Event based on schema property\n * When a user focuses on a form element or when a user makes a\n * change to a form element.\n *\n * @param event - Contains the properties for the Form Focus or Change Form event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildFormFocusOrChange(event) {\n var event_schema = '';\n var schema = event.schema, formId = event.formId, elementId = event.elementId, nodeName = event.nodeName, elementClasses = event.elementClasses, value = event.value, type = event.type;\n var event_data = { formId: formId, elementId: elementId, nodeName: nodeName, elementClasses: elementClasses, value: value };\n if (schema === 'change_form') {\n event_schema = 'iglu:com.snowplowanalytics.snowplow/change_form/jsonschema/1-0-0';\n event_data.type = type;\n }\n else if (schema === 'focus_form') {\n event_schema = 'iglu:com.snowplowanalytics.snowplow/focus_form/jsonschema/1-0-0';\n event_data.elementType = type;\n }\n return buildSelfDescribingEvent({\n event: {\n schema: event_schema,\n data: removeEmptyProperties(event_data, { value: true })\n }\n });\n}\n/**\n * Build a Form Submission Event\n * Used to track when a user submits a form\n *\n * @param event - Contains the properties for the Form Submission event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildFormSubmission(event) {\n var formId = event.formId, formClasses = event.formClasses, elements = event.elements;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/submit_form/jsonschema/1-0-0',\n data: removeEmptyProperties({ formId: formId, formClasses: formClasses, elements: elements })\n }\n });\n}\n/**\n * Build a Site Search Event\n * Used when a user performs a search action on a page\n *\n * @param event - Contains the properties for the Site Search event\n * @returns PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track}\n */\nfunction buildSiteSearch(event) {\n var terms = event.terms, filters = event.filters, totalResults = event.totalResults, pageResults = event.pageResults;\n return buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/site_search/jsonschema/1-0-0',\n data: removeEmptyProperties({ terms: terms, filters: filters, totalResults: totalResults, pageResults: pageResults })\n }\n });\n}\n/**\n * Build a Consent Withdrawn Event\n * Used for tracking when a user withdraws their consent\n *\n * @param event - Contains the properties for the Consent Withdrawn event\n * @returns An object containing the PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track} and a 'consent_document' context\n */\nfunction buildConsentWithdrawn(event) {\n var all = event.all, id = event.id, version = event.version, name = event.name, description = event.description;\n var documentJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',\n data: removeEmptyProperties({ id: id, version: version, name: name, description: description })\n };\n return {\n event: buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_withdrawn/jsonschema/1-0-0',\n data: removeEmptyProperties({\n all: all\n })\n }\n }),\n context: [documentJson]\n };\n}\n/**\n * Build a Consent Granted Event\n * Used for tracking when a user grants their consent\n *\n * @param event - Contains the properties for the Consent Granted event\n * @returns An object containing the PayloadBuilder to be sent to {@link @snowplow/tracker-core#TrackerCore.track} and a 'consent_document' context\n */\nfunction buildConsentGranted(event) {\n var expiry = event.expiry, id = event.id, version = event.version, name = event.name, description = event.description;\n var documentJson = {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_document/jsonschema/1-0-0',\n data: removeEmptyProperties({ id: id, version: version, name: name, description: description })\n };\n return {\n event: buildSelfDescribingEvent({\n event: {\n schema: 'iglu:com.snowplowanalytics.snowplow/consent_granted/jsonschema/1-0-0',\n data: removeEmptyProperties({\n expiry: expiry\n })\n }\n }),\n context: [documentJson]\n };\n}\n/**\n * Returns a copy of a JSON with undefined and null properties removed\n *\n * @param event - JSON object to clean\n * @param exemptFields - Set of fields which should not be removed even if empty\n * @returns A cleaned copy of eventJson\n */\nfunction removeEmptyProperties(event, exemptFields) {\n if (exemptFields === void 0) { exemptFields = {}; }\n var ret = {};\n for (var k in event) {\n if (exemptFields[k] || (event[k] !== null && typeof event[k] !== 'undefined')) {\n ret[k] = event[k];\n }\n }\n return ret;\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar version = version$1;\n\nexport { LOG, LOG_LEVEL, buildAdClick, buildAdConversion, buildAdImpression, buildAddToCart, buildConsentGranted, buildConsentWithdrawn, buildEcommerceTransaction, buildEcommerceTransactionItem, buildFormFocusOrChange, buildFormSubmission, buildLinkClick, buildPagePing, buildPageView, buildRemoveFromCart, buildScreenView, buildSelfDescribingEvent, buildSiteSearch, buildSocialInteraction, buildStructEvent, getRuleParts, getSchemaParts, globalContexts, isConditionalContextProvider, isContextCallbackFunction, isContextPrimitive, isFilterProvider, isJson, isNonEmptyJson, isRuleSet, isRuleSetProvider, isSelfDescribingJson, isStringArray, isValidRule, isValidRuleSetArg, matchSchemaAgainstRule, matchSchemaAgainstRuleSet, payloadBuilder, payloadJsonProcessor, pluginContexts, removeEmptyProperties, resolveDynamicContext, trackerCore, validateVendor, validateVendorParts, version };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Core functionality for Snowplow Browser trackers v3.24.6 (http://bit.ly/sp-js)\n * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { LOG, trackerCore, buildPageView, buildPagePing } from '@snowplow/tracker-core';\nimport { __assign, __spreadArray } from 'tslib';\nimport hash from 'sha1';\nimport { v4 } from 'uuid';\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Attempt to get a value from localStorage\n *\n * @param string - key\n * @returns string The value obtained from localStorage, or\n * undefined if localStorage is inaccessible\n */\nfunction attemptGetLocalStorage(key) {\n try {\n var localStorageAlias = window.localStorage, exp = localStorageAlias.getItem(key + '.expires');\n if (exp === null || +exp > Date.now()) {\n return localStorageAlias.getItem(key);\n }\n else {\n localStorageAlias.removeItem(key);\n localStorageAlias.removeItem(key + '.expires');\n }\n return undefined;\n }\n catch (e) {\n return undefined;\n }\n}\n/**\n * Attempt to write a value to localStorage\n *\n * @param string - key\n * @param string - value\n * @param number - ttl Time to live in seconds, defaults to 2 years from Date.now()\n * @returns boolean Whether the operation succeeded\n */\nfunction attemptWriteLocalStorage(key, value, ttl) {\n if (ttl === void 0) { ttl = 63072000; }\n try {\n var localStorageAlias = window.localStorage, t = Date.now() + ttl * 1000;\n localStorageAlias.setItem(\"\".concat(key, \".expires\"), t.toString());\n localStorageAlias.setItem(key, value);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Attempt to delete a value from localStorage\n *\n * @param string - key\n * @returns boolean Whether the operation succeeded\n */\nfunction attemptDeleteLocalStorage(key) {\n try {\n var localStorageAlias = window.localStorage;\n localStorageAlias.removeItem(key);\n localStorageAlias.removeItem(key + '.expires');\n return true;\n }\n catch (e) {\n return false;\n }\n}\n/**\n * Attempt to get a value from sessionStorage\n *\n * @param string - key\n * @returns string The value obtained from sessionStorage, or\n * undefined if sessionStorage is inaccessible\n */\nfunction attemptGetSessionStorage(key) {\n try {\n return window.sessionStorage.getItem(key);\n }\n catch (e) {\n return undefined;\n }\n}\n/**\n * Attempt to write a value to sessionStorage\n *\n * @param string - key\n * @param string - value\n * @returns boolean Whether the operation succeeded\n */\nfunction attemptWriteSessionStorage(key, value) {\n try {\n window.sessionStorage.setItem(key, value);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n\nvar DEFAULT_CROSS_DOMAIN_LINKER_PARAMS = {\n sessionId: true,\n sourceId: true,\n sourcePlatform: false,\n userId: false,\n reason: false\n};\nfunction createCrossDomainParameterValue(isExtendedFormat, attributeConfiguration, attributeValues) {\n var _a;\n var crossDomainParameterValue;\n var timestamp = new Date().getTime();\n var config = __assign(__assign({}, DEFAULT_CROSS_DOMAIN_LINKER_PARAMS), attributeConfiguration);\n var domainUserId = attributeValues.domainUserId, userId = attributeValues.userId, sessionId = attributeValues.sessionId, sourceId = attributeValues.sourceId, sourcePlatform = attributeValues.sourcePlatform, event = attributeValues.event;\n var eventTarget = event.currentTarget;\n var reason = typeof config.reason === 'function' ? config.reason(event) : (_a = eventTarget === null || eventTarget === void 0 ? void 0 : eventTarget.textContent) === null || _a === void 0 ? void 0 : _a.trim();\n if (isExtendedFormat) {\n /* Index is used by Enrich, so it should not be changed. */\n crossDomainParameterValue = [\n domainUserId,\n timestamp,\n config.sessionId && sessionId,\n config.userId && urlSafeBase64Encode(userId || ''),\n config.sourceId && urlSafeBase64Encode(sourceId || ''),\n config.sourcePlatform && sourcePlatform,\n config.reason && urlSafeBase64Encode(reason || ''),\n ]\n .map(function (attribute) { return attribute || ''; })\n .join('.')\n // Remove trailing dots\n .replace(/([.]*$)/, '');\n }\n else {\n crossDomainParameterValue = attributeValues.domainUserId + '.' + timestamp;\n }\n return crossDomainParameterValue;\n}\n/**\n *\n * The url-safe variation emits - and _ instead of + and / characters. Also removes = sign padding.\n * @param {string} str The string to encode in a URL safe manner\n * @return {string}\n */\nfunction urlSafeBase64Encode(str) {\n return btoa(str).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/\\=+$/, '');\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Checks if an object is a string\n * @param str - The object to check\n */\nfunction isString(str) {\n if (str && typeof str.valueOf() === 'string') {\n return true;\n }\n return false;\n}\n/**\n * Checks if an object is an integer\n * @param int - The object to check\n */\nfunction isInteger(int) {\n return ((Number.isInteger && Number.isInteger(int)) || (typeof int === 'number' && isFinite(int) && Math.floor(int) === int));\n}\n/**\n * Checks if the input parameter is a function\n * @param func - The object to check\n */\nfunction isFunction(func) {\n if (func && typeof func === 'function') {\n return true;\n }\n return false;\n}\n/**\n * Cleans up the page title\n */\nfunction fixupTitle(title) {\n if (!isString(title)) {\n title = title.text || '';\n var tmp = document.getElementsByTagName('title');\n if (tmp && tmp[0] != null) {\n title = tmp[0].text;\n }\n }\n return title;\n}\n/**\n * Extract hostname from URL\n */\nfunction getHostName(url) {\n // scheme : // [username [: password] @] hostname [: port] [/ [path] [? query] [# fragment]]\n var e = new RegExp('^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)'), matches = e.exec(url);\n return matches ? matches[1] : url;\n}\n/**\n * Fix-up domain\n */\nfunction fixupDomain(domain) {\n var dl = domain.length;\n // remove trailing '.'\n if (domain.charAt(--dl) === '.') {\n domain = domain.slice(0, dl);\n }\n // remove leading '*'\n if (domain.slice(0, 2) === '*.') {\n domain = domain.slice(1);\n }\n return domain;\n}\n/**\n * Get page referrer. In the case of a single-page app,\n * if the URL changes without the page reloading, pass\n * in the old URL. It will be returned unless overriden\n * by a \"refer(r)er\" parameter in the querystring.\n *\n * @param string - oldLocation Optional.\n * @returns string The referrer\n */\nfunction getReferrer(oldLocation) {\n var windowAlias = window, fromQs = fromQuerystring('referrer', windowAlias.location.href) || fromQuerystring('referer', windowAlias.location.href);\n // Short-circuit\n if (fromQs) {\n return fromQs;\n }\n // In the case of a single-page app, return the old URL\n if (oldLocation) {\n return oldLocation;\n }\n try {\n if (windowAlias.top) {\n return windowAlias.top.document.referrer;\n }\n else if (windowAlias.parent) {\n return windowAlias.parent.document.referrer;\n }\n }\n catch (_a) { }\n return document.referrer;\n}\n/**\n * Cross-browser helper function to add event handler\n */\nfunction addEventListener(element, eventType, eventHandler, options) {\n if (element.addEventListener) {\n element.addEventListener(eventType, eventHandler, options);\n return true;\n }\n // IE Support\n if (element.attachEvent) {\n return element.attachEvent('on' + eventType, eventHandler);\n }\n element['on' + eventType] = eventHandler;\n}\n/**\n * Return value from name-value pair in querystring\n */\nfunction fromQuerystring(field, url) {\n var match = new RegExp('^[^#]*[?&]' + field + '=([^]*)').exec(url);\n if (!match) {\n return null;\n }\n return decodeURIComponent(match[1].replace(/\\+/g, ' '));\n}\n/**\n * Add a name-value pair to the querystring of a URL\n *\n * @param string - url URL to decorate\n * @param string - name Name of the querystring pair\n * @param string - value Value of the querystring pair\n */\nfunction decorateQuerystring(url, name, value) {\n var initialQsParams = name + '=' + value;\n var hashSplit = url.split('#');\n var qsSplit = hashSplit[0].split('?');\n var beforeQuerystring = qsSplit.shift();\n // Necessary because a querystring may contain multiple question marks\n var querystring = qsSplit.join('?');\n if (!querystring) {\n querystring = initialQsParams;\n }\n else {\n // Whether this is the first time the link has been decorated\n var initialDecoration = true;\n var qsFields = querystring.split('&');\n for (var i = 0; i < qsFields.length; i++) {\n if (qsFields[i].substr(0, name.length + 1) === name + '=') {\n initialDecoration = false;\n qsFields[i] = initialQsParams;\n querystring = qsFields.join('&');\n break;\n }\n }\n if (initialDecoration) {\n querystring = initialQsParams + '&' + querystring;\n }\n }\n hashSplit[0] = beforeQuerystring + '?' + querystring;\n return hashSplit.join('#');\n}\n/**\n * Finds the root domain\n */\nfunction findRootDomain(sameSite, secure) {\n var windowLocationHostnameAlias = window.location.hostname, cookiePrefix = '_sp_root_domain_test_', cookieName = cookiePrefix + new Date().getTime(), cookieValue = '_test_value_' + new Date().getTime();\n var locationParts = windowLocationHostnameAlias.split('.');\n for (var idx = locationParts.length - 2; idx >= 0; idx--) {\n var currentDomain = locationParts.slice(idx).join('.');\n cookie(cookieName, cookieValue, 0, '/', currentDomain, sameSite, secure);\n if (cookie(cookieName) === cookieValue) {\n // Clean up created cookie(s)\n deleteCookie(cookieName, currentDomain, sameSite, secure);\n var cookieNames = getCookiesWithPrefix(cookiePrefix);\n for (var i = 0; i < cookieNames.length; i++) {\n deleteCookie(cookieNames[i], currentDomain, sameSite, secure);\n }\n return currentDomain;\n }\n }\n // Cookies cannot be read\n return windowLocationHostnameAlias;\n}\n/**\n * Checks whether a value is present within an array\n *\n * @param val - The value to check for\n * @param array - The array to check within\n * @returns boolean Whether it exists\n */\nfunction isValueInArray(val, array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i] === val) {\n return true;\n }\n }\n return false;\n}\n/**\n * Deletes an arbitrary cookie by setting the expiration date to the past\n *\n * @param cookieName - The name of the cookie to delete\n * @param domainName - The domain the cookie is in\n */\nfunction deleteCookie(cookieName, domainName, sameSite, secure) {\n cookie(cookieName, '', -1, '/', domainName, sameSite, secure);\n}\n/**\n * Fetches the name of all cookies beginning with a certain prefix\n *\n * @param cookiePrefix - The prefix to check for\n * @returns array The cookies that begin with the prefix\n */\nfunction getCookiesWithPrefix(cookiePrefix) {\n var cookies = document.cookie.split('; ');\n var cookieNames = [];\n for (var i = 0; i < cookies.length; i++) {\n if (cookies[i].substring(0, cookiePrefix.length) === cookiePrefix) {\n cookieNames.push(cookies[i]);\n }\n }\n return cookieNames;\n}\n/**\n * Get and set the cookies associated with the current document in browser\n * This implementation always returns a string, returns the cookie value if only name is specified\n *\n * @param name - The cookie name (required)\n * @param value - The cookie value\n * @param ttl - The cookie Time To Live (seconds)\n * @param path - The cookies path\n * @param domain - The cookies domain\n * @param samesite - The cookies samesite attribute\n * @param secure - Boolean to specify if cookie should be secure\n * @returns string The cookies value\n */\nfunction cookie(name, value, ttl, path, domain, samesite, secure) {\n if (arguments.length > 1) {\n return (document.cookie =\n name +\n '=' +\n encodeURIComponent(value !== null && value !== void 0 ? value : '') +\n (ttl ? '; Expires=' + new Date(+new Date() + ttl * 1000).toUTCString() : '') +\n (path ? '; Path=' + path : '') +\n (domain ? '; Domain=' + domain : '') +\n (samesite ? '; SameSite=' + samesite : '') +\n (secure ? '; Secure' : ''));\n }\n return decodeURIComponent((('; ' + document.cookie).split('; ' + name + '=')[1] || '').split(';')[0]);\n}\n/**\n * Parses an object and returns either the\n * integer or undefined.\n *\n * @param obj - The object to parse\n * @returns the result of the parse operation\n */\nfunction parseAndValidateInt(obj) {\n var result = parseInt(obj);\n return isNaN(result) ? undefined : result;\n}\n/**\n * Parses an object and returns either the\n * number or undefined.\n *\n * @param obj - The object to parse\n * @returns the result of the parse operation\n */\nfunction parseAndValidateFloat(obj) {\n var result = parseFloat(obj);\n return isNaN(result) ? undefined : result;\n}\n/**\n * Convert a criterion object to a filter function\n *\n * @param object - criterion Either {allowlist: [array of allowable strings]}\n * or {denylist: [array of allowable strings]}\n * or {filter: function (elt) {return whether to track the element}\n * @param boolean - byClass Whether to allowlist/denylist based on an element's classes (for forms)\n * or name attribute (for fields)\n */\nfunction getFilterByClass(criterion) {\n // If the criterion argument is not an object, add listeners to all elements\n if (criterion == null || typeof criterion !== 'object' || Array.isArray(criterion)) {\n return function () {\n return true;\n };\n }\n var inclusive = Object.prototype.hasOwnProperty.call(criterion, 'allowlist');\n var specifiedClassesSet = getSpecifiedClassesSet(criterion);\n return getFilter(criterion, function (elt) {\n return checkClass(elt, specifiedClassesSet) === inclusive;\n });\n}\n/**\n * Convert a criterion object to a filter function\n *\n * @param object - criterion Either {allowlist: [array of allowable strings]}\n * or {denylist: [array of allowable strings]}\n * or {filter: function (elt) {return whether to track the element}\n */\nfunction getFilterByName(criterion) {\n // If the criterion argument is not an object, add listeners to all elements\n if (criterion == null || typeof criterion !== 'object' || Array.isArray(criterion)) {\n return function () {\n return true;\n };\n }\n var inclusive = criterion.hasOwnProperty('allowlist');\n var specifiedClassesSet = getSpecifiedClassesSet(criterion);\n return getFilter(criterion, function (elt) {\n return elt.name in specifiedClassesSet === inclusive;\n });\n}\n/**\n * List the classes of a DOM element without using elt.classList (for compatibility with IE 9)\n */\nfunction getCssClasses(elt) {\n return elt.className.match(/\\S+/g) || [];\n}\n/**\n * Check whether an element has at least one class from a given list\n */\nfunction checkClass(elt, classList) {\n var classes = getCssClasses(elt);\n for (var _i = 0, classes_1 = classes; _i < classes_1.length; _i++) {\n var className = classes_1[_i];\n if (classList[className]) {\n return true;\n }\n }\n return false;\n}\nfunction getFilter(criterion, fallbackFilter) {\n if (criterion.hasOwnProperty('filter') && criterion.filter) {\n return criterion.filter;\n }\n return fallbackFilter;\n}\nfunction getSpecifiedClassesSet(criterion) {\n // Convert the array of classes to an object of the form {class1: true, class2: true, ...}\n var specifiedClassesSet = {};\n var specifiedClasses = criterion.allowlist || criterion.denylist;\n if (specifiedClasses) {\n if (!Array.isArray(specifiedClasses)) {\n specifiedClasses = [specifiedClasses];\n }\n for (var i = 0; i < specifiedClasses.length; i++) {\n specifiedClassesSet[specifiedClasses[i]] = true;\n }\n }\n return specifiedClassesSet;\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/*\n * Checks whether sessionStorage is available, in a way that\n * does not throw a SecurityError in Firefox if \"always ask\"\n * is enabled for cookies (https://github.com/snowplow/snowplow/issues/163).\n */\nfunction hasSessionStorage() {\n try {\n return !!window.sessionStorage;\n }\n catch (e) {\n return true; // SecurityError when referencing it means it exists\n }\n}\n/*\n * Checks whether localStorage is available, in a way that\n * does not throw a SecurityError in Firefox if \"always ask\"\n * is enabled for cookies (https://github.com/snowplow/snowplow/issues/163).\n */\nfunction hasLocalStorage() {\n try {\n return !!window.localStorage;\n }\n catch (e) {\n return true; // SecurityError when referencing it means it exists\n }\n}\n/*\n * Checks whether localStorage is accessible\n * sets and removes an item to handle private IOS5 browsing\n * (http://git.io/jFB2Xw)\n */\nfunction localStorageAccessible() {\n var mod = 'modernizr';\n if (!hasLocalStorage()) {\n return false;\n }\n try {\n var ls = window.localStorage;\n ls.setItem(mod, mod);\n ls.removeItem(mod);\n return true;\n }\n catch (e) {\n return false;\n }\n}\n\nvar WEB_PAGE_SCHEMA = 'iglu:com.snowplowanalytics.snowplow/web_page/jsonschema/1-0-0';\nvar BROWSER_CONTEXT_SCHEMA = 'iglu:com.snowplowanalytics.snowplow/browser_context/jsonschema/2-0-0';\nvar CLIENT_SESSION_SCHEMA = 'iglu:com.snowplowanalytics.snowplow/client_session/jsonschema/1-0-2';\nvar PAYLOAD_DATA_SCHEMA = 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4';\n\n/**\n * Object handling sending events to a collector.\n * Instantiated once per tracker instance.\n *\n * @param id - The Snowplow function name (used to generate the localStorage key)\n * @param sharedSate - Stores reference to the outbound queue so it can unload the page when all queues are empty\n * @param useLocalStorage - Whether to use localStorage at all\n * @param eventMethod - if null will use 'beacon' otherwise can be set to 'post', 'get', or 'beacon' to force.\n * @param postPath - The path where events are to be posted\n * @param bufferSize - How many events to batch in localStorage before sending them all\n * @param maxPostBytes - Maximum combined size in bytes of the event JSONs in a POST request\n * @param maxGetBytes - Maximum size in bytes of the complete event URL string in a GET request. 0 for no limit.\n * @param useStm - Whether to add timestamp to events\n * @param maxLocalStorageQueueSize - Maximum number of queued events we will attempt to store in local storage\n * @param connectionTimeout - Defines how long to wait before aborting the request\n * @param anonymousTracking - Defines whether to set the SP-Anonymous header for anonymous tracking on GET and POST\n * @param customHeaders - Allows custom headers to be defined and passed on XMLHttpRequest requests\n * @param withCredentials - Sets the value of the withCredentials flag on XMLHttpRequest (GET and POST) requests\n * @param retryStatusCodes – Failure HTTP response status codes from Collector for which sending events should be retried (they can override the `dontRetryStatusCodes`)\n * @param dontRetryStatusCodes – Failure HTTP response status codes from Collector for which sending events should not be retried\n * @param idService - Id service full URL. This URL will be added to the queue and will be called using a GET method.\n * @param retryFailedRequests - Whether to retry failed requests - Takes precedent over `retryStatusCodes` and `dontRetryStatusCodes`\n * @param onRequestSuccess - Function called when a request succeeds\n * @param onRequestFailure - Function called when a request does not succeed\n * @returns object OutQueueManager instance\n */\nfunction OutQueueManager(id, sharedSate, useLocalStorage, eventMethod, postPath, bufferSize, maxPostBytes, maxGetBytes, useStm, maxLocalStorageQueueSize, connectionTimeout, anonymousTracking, customHeaders, withCredentials, retryStatusCodes, dontRetryStatusCodes, idService, retryFailedRequests, onRequestSuccess, onRequestFailure) {\n if (retryFailedRequests === void 0) { retryFailedRequests = true; }\n var executingQueue = false, configCollectorUrl, outQueue = [], idServiceCalled = false;\n //Force to lower case if its a string\n eventMethod = typeof eventMethod === 'string' ? eventMethod.toLowerCase() : eventMethod;\n // Use the Beacon API if eventMethod is set true, 'true', or 'beacon'.\n var isBeaconRequested = eventMethod === true || eventMethod === 'beacon' || eventMethod === 'true', \n // Fall back to POST or GET for browsers which don't support Beacon API\n isBeaconAvailable = Boolean(isBeaconRequested &&\n window.navigator &&\n typeof window.navigator.sendBeacon === 'function' &&\n !hasWebKitBeaconBug(window.navigator.userAgent)), useBeacon = isBeaconAvailable && isBeaconRequested, \n // Use GET if specified\n isGetRequested = eventMethod === 'get', \n // Don't use XhrHttpRequest for browsers which don't support CORS XMLHttpRequests (e.g. IE <= 9)\n useXhr = Boolean(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), \n // Use POST if specified\n usePost = !isGetRequested && useXhr && (eventMethod === 'post' || isBeaconRequested), \n // Resolve all options and capabilities and decide path\n path = usePost ? postPath : '/i', \n // Different queue names for GET and POST since they are stored differently\n queueName = \"snowplowOutQueue_\".concat(id, \"_\").concat(usePost ? 'post2' : 'get');\n // Ensure we don't set headers when beacon is the requested eventMethod as we might fallback to POST\n // and end up sending them in older browsers which don't support beacon leading to inconsistencies\n if (isBeaconRequested)\n customHeaders = {};\n // Get buffer size or set 1 if unable to buffer\n bufferSize = (useLocalStorage && localStorageAccessible() && usePost && bufferSize) || 1;\n if (useLocalStorage) {\n // Catch any JSON parse errors or localStorage that might be thrown\n try {\n var localStorageQueue = window.localStorage.getItem(queueName);\n outQueue = localStorageQueue ? JSON.parse(localStorageQueue) : [];\n }\n catch (e) { }\n }\n // Initialize to and empty array if we didn't get anything out of localStorage\n if (!Array.isArray(outQueue)) {\n outQueue = [];\n }\n // Used by pageUnloadGuard\n sharedSate.outQueues.push(outQueue);\n if (useXhr && bufferSize > 1) {\n sharedSate.bufferFlushers.push(function (sync) {\n if (!executingQueue) {\n executeQueue(sync);\n }\n });\n }\n /*\n * Convert a dictionary to a querystring\n * The context field is the last in the querystring\n */\n function getQuerystring(request) {\n var querystring = '?', lowPriorityKeys = { co: true, cx: true }, firstPair = true;\n for (var key in request) {\n if (request.hasOwnProperty(key) && !lowPriorityKeys.hasOwnProperty(key)) {\n if (!firstPair) {\n querystring += '&';\n }\n else {\n firstPair = false;\n }\n querystring += encodeURIComponent(key) + '=' + encodeURIComponent(request[key]);\n }\n }\n for (var contextKey in lowPriorityKeys) {\n if (request.hasOwnProperty(contextKey) && lowPriorityKeys.hasOwnProperty(contextKey)) {\n querystring += '&' + contextKey + '=' + encodeURIComponent(request[contextKey]);\n }\n }\n return querystring;\n }\n /*\n * Convert numeric fields to strings to match payload_data schema\n */\n function getBody(request) {\n var cleanedRequest = Object.keys(request)\n .map(function (k) { return [k, request[k]]; })\n .reduce(function (acc, _a) {\n var key = _a[0], value = _a[1];\n acc[key] = value.toString();\n return acc;\n }, {});\n return {\n evt: cleanedRequest,\n bytes: getUTF8Length(JSON.stringify(cleanedRequest))\n };\n }\n /**\n * Count the number of bytes a string will occupy when UTF-8 encoded\n * Taken from http://stackoverflow.com/questions/2848462/count-bytes-in-textarea-using-javascript/\n *\n * @param string - s\n * @returns number Length of s in bytes when UTF-8 encoded\n */\n function getUTF8Length(s) {\n var len = 0;\n for (var i = 0; i < s.length; i++) {\n var code = s.charCodeAt(i);\n if (code <= 0x7f) {\n len += 1;\n }\n else if (code <= 0x7ff) {\n len += 2;\n }\n else if (code >= 0xd800 && code <= 0xdfff) {\n // Surrogate pair: These take 4 bytes in UTF-8 and 2 chars in UCS-2\n // (Assume next char is the other [valid] half and just skip it)\n len += 4;\n i++;\n }\n else if (code < 0xffff) {\n len += 3;\n }\n else {\n len += 4;\n }\n }\n return len;\n }\n var postable = function (queue) {\n return typeof queue[0] === 'object' && 'evt' in queue[0];\n };\n /**\n * Send event as POST request right away without going to queue. Used when the request surpasses maxGetBytes or maxPostBytes\n * @param body POST request body\n * @param configCollectorUrl full collector URL with path\n */\n function sendPostRequestWithoutQueueing(body, configCollectorUrl) {\n var xhr = initializeXMLHttpRequest(configCollectorUrl, true, false);\n var batch = attachStmToEvent([body.evt]);\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (isSuccessfulRequest(xhr.status)) {\n onRequestSuccess === null || onRequestSuccess === void 0 ? void 0 : onRequestSuccess(batch);\n }\n else {\n onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure({\n status: xhr.status,\n message: xhr.statusText,\n events: batch,\n willRetry: false\n });\n }\n }\n };\n xhr.send(encloseInPayloadDataEnvelope(batch));\n }\n function removeEventsFromQueue(numberToSend) {\n for (var deleteCount = 0; deleteCount < numberToSend; deleteCount++) {\n outQueue.shift();\n }\n if (useLocalStorage) {\n attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n }\n function setXhrCallbacks(xhr, numberToSend, batch) {\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n clearTimeout(xhrTimeout);\n if (isSuccessfulRequest(xhr.status)) {\n removeEventsFromQueue(numberToSend);\n onRequestSuccess === null || onRequestSuccess === void 0 ? void 0 : onRequestSuccess(batch);\n executeQueue();\n }\n else {\n var willRetry = shouldRetryForStatusCode(xhr.status);\n if (!willRetry) {\n LOG.error(\"Status \".concat(xhr.status, \", will not retry.\"));\n removeEventsFromQueue(numberToSend);\n }\n onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure({\n status: xhr.status,\n message: xhr.statusText,\n events: batch,\n willRetry: willRetry\n });\n executingQueue = false;\n }\n }\n };\n // Time out POST requests after connectionTimeout\n var xhrTimeout = setTimeout(function () {\n xhr.abort();\n if (!retryFailedRequests) {\n removeEventsFromQueue(numberToSend);\n }\n onRequestFailure === null || onRequestFailure === void 0 ? void 0 : onRequestFailure({\n status: 0,\n message: 'timeout',\n events: batch,\n willRetry: retryFailedRequests\n });\n executingQueue = false;\n }, connectionTimeout);\n }\n /*\n * Queue for submission to the collector and start processing queue\n */\n function enqueueRequest(request, url) {\n configCollectorUrl = url + path;\n var eventTooBigWarning = function (bytes, maxBytes) {\n return LOG.warn('Event (' + bytes + 'B) too big, max is ' + maxBytes);\n };\n if (usePost) {\n var body = getBody(request);\n if (body.bytes >= maxPostBytes) {\n eventTooBigWarning(body.bytes, maxPostBytes);\n sendPostRequestWithoutQueueing(body, configCollectorUrl);\n return;\n }\n else {\n outQueue.push(body);\n }\n }\n else {\n var querystring = getQuerystring(request);\n if (maxGetBytes > 0) {\n var requestUrl = createGetUrl(querystring);\n var bytes = getUTF8Length(requestUrl);\n if (bytes >= maxGetBytes) {\n eventTooBigWarning(bytes, maxGetBytes);\n if (useXhr) {\n var body = getBody(request);\n var postUrl = url + postPath;\n sendPostRequestWithoutQueueing(body, postUrl);\n }\n return;\n }\n }\n outQueue.push(querystring);\n }\n var savedToLocalStorage = false;\n if (useLocalStorage) {\n savedToLocalStorage = attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n // If we're not processing the queue, we'll start.\n if (!executingQueue && (!savedToLocalStorage || outQueue.length >= bufferSize)) {\n executeQueue();\n }\n }\n /*\n * Run through the queue of requests, sending them one at a time.\n * Stops processing when we run out of queued requests, or we get an error.\n */\n function executeQueue(sync) {\n if (sync === void 0) { sync = false; }\n // Failsafe in case there is some way for a bad value like \"null\" to end up in the outQueue\n while (outQueue.length && typeof outQueue[0] !== 'string' && typeof outQueue[0] !== 'object') {\n outQueue.shift();\n }\n if (!outQueue.length) {\n executingQueue = false;\n return;\n }\n // Let's check that we have a URL\n if (!isString(configCollectorUrl)) {\n throw 'No collector configured';\n }\n executingQueue = true;\n if (idService && !idServiceCalled) {\n var xhr_1 = initializeXMLHttpRequest(idService, false, sync);\n idServiceCalled = true;\n xhr_1.timeout = connectionTimeout;\n xhr_1.onreadystatechange = function () {\n if (xhr_1.readyState === 4) {\n executeQueue();\n }\n };\n xhr_1.send();\n return;\n }\n if (useXhr) {\n // Keep track of number of events to delete from queue\n var chooseHowManyToSend = function (queue) {\n var numberToSend = 0, byteCount = 0;\n while (numberToSend < queue.length) {\n byteCount += queue[numberToSend].bytes;\n if (byteCount >= maxPostBytes) {\n break;\n }\n else {\n numberToSend += 1;\n }\n }\n return numberToSend;\n };\n var url = void 0, xhr = void 0, numberToSend = void 0;\n if (postable(outQueue)) {\n url = configCollectorUrl;\n xhr = initializeXMLHttpRequest(url, true, sync);\n numberToSend = chooseHowManyToSend(outQueue);\n }\n else {\n url = createGetUrl(outQueue[0]);\n xhr = initializeXMLHttpRequest(url, false, sync);\n numberToSend = 1;\n }\n if (!postable(outQueue)) {\n // If not postable then it's a GET so just send it\n setXhrCallbacks(xhr, numberToSend, [url]);\n xhr.send();\n }\n else {\n var batch = outQueue.slice(0, numberToSend);\n if (batch.length > 0) {\n var beaconStatus = false;\n var eventBatch = batch.map(function (x) {\n return x.evt;\n });\n if (useBeacon) {\n var blob = new Blob([encloseInPayloadDataEnvelope(attachStmToEvent(eventBatch))], {\n type: 'application/json'\n });\n try {\n beaconStatus = window.navigator.sendBeacon(url, blob);\n }\n catch (error) {\n beaconStatus = false;\n }\n }\n // When beaconStatus is true, we can't _guarantee_ that it was successful (beacon queues asynchronously)\n // but the browser has taken it out of our hands, so we want to flush the queue assuming it will do its job\n if (beaconStatus === true) {\n removeEventsFromQueue(numberToSend);\n onRequestSuccess === null || onRequestSuccess === void 0 ? void 0 : onRequestSuccess(batch);\n executeQueue();\n }\n else {\n var batch_1 = attachStmToEvent(eventBatch);\n setXhrCallbacks(xhr, numberToSend, batch_1);\n xhr.send(encloseInPayloadDataEnvelope(batch_1));\n }\n }\n }\n }\n else if (!anonymousTracking && !postable(outQueue)) {\n // We can't send with this technique if anonymous tracking is on as we can't attach the header\n var image = new Image(1, 1), loading_1 = true;\n image.onload = function () {\n if (!loading_1)\n return;\n loading_1 = false;\n outQueue.shift();\n if (useLocalStorage) {\n attemptWriteLocalStorage(queueName, JSON.stringify(outQueue.slice(0, maxLocalStorageQueueSize)));\n }\n executeQueue();\n };\n image.onerror = function () {\n if (!loading_1)\n return;\n loading_1 = false;\n executingQueue = false;\n };\n image.src = createGetUrl(outQueue[0]);\n setTimeout(function () {\n if (loading_1 && executingQueue) {\n loading_1 = false;\n executeQueue();\n }\n }, connectionTimeout);\n }\n else {\n executingQueue = false;\n }\n }\n /**\n * Determines whether a request was successful, based on its status code\n * Anything in the 2xx range is considered successful\n *\n * @param statusCode The status code of the request\n * @returns Whether the request was successful\n */\n function isSuccessfulRequest(statusCode) {\n return statusCode >= 200 && statusCode < 300;\n }\n function shouldRetryForStatusCode(statusCode) {\n // success, don't retry\n if (isSuccessfulRequest(statusCode)) {\n return false;\n }\n if (!retryFailedRequests) {\n return false;\n }\n // retry if status code among custom user-supplied retry codes\n if (retryStatusCodes.includes(statusCode)) {\n return true;\n }\n // retry if status code *not* among the don't retry codes\n return !dontRetryStatusCodes.includes(statusCode);\n }\n /**\n * Open an XMLHttpRequest for a given endpoint with the correct credentials and header\n *\n * @param string - url The destination URL\n * @returns object The XMLHttpRequest\n */\n function initializeXMLHttpRequest(url, post, sync) {\n var xhr = new XMLHttpRequest();\n if (post) {\n xhr.open('POST', url, !sync);\n xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n }\n else {\n xhr.open('GET', url, !sync);\n }\n xhr.withCredentials = withCredentials;\n if (anonymousTracking) {\n xhr.setRequestHeader('SP-Anonymous', '*');\n }\n for (var header in customHeaders) {\n if (Object.prototype.hasOwnProperty.call(customHeaders, header)) {\n xhr.setRequestHeader(header, customHeaders[header]);\n }\n }\n return xhr;\n }\n /**\n * Enclose an array of events in a self-describing payload_data JSON string\n *\n * @param array - events Batch of events\n * @returns string payload_data self-describing JSON\n */\n function encloseInPayloadDataEnvelope(events) {\n return JSON.stringify({\n schema: PAYLOAD_DATA_SCHEMA,\n data: events\n });\n }\n /**\n * Attaches the STM field to outbound POST events.\n *\n * @param events - the events to attach the STM to\n */\n function attachStmToEvent(events) {\n var stm = new Date().getTime().toString();\n for (var i = 0; i < events.length; i++) {\n events[i]['stm'] = stm;\n }\n return events;\n }\n /**\n * Creates the full URL for sending the GET request. Will append `stm` if enabled\n *\n * @param nextRequest - the query string of the next request\n */\n function createGetUrl(nextRequest) {\n if (useStm) {\n return configCollectorUrl + nextRequest.replace('?', '?stm=' + new Date().getTime() + '&');\n }\n return configCollectorUrl + nextRequest;\n }\n return {\n enqueueRequest: enqueueRequest,\n executeQueue: function () {\n if (!executingQueue) {\n executeQueue();\n }\n },\n setUseLocalStorage: function (localStorage) {\n useLocalStorage = localStorage;\n },\n setAnonymousTracking: function (anonymous) {\n anonymousTracking = anonymous;\n },\n setCollectorUrl: function (url) {\n configCollectorUrl = url + path;\n },\n setBufferSize: function (newBufferSize) {\n bufferSize = newBufferSize;\n }\n };\n function hasWebKitBeaconBug(useragent) {\n return (isIosVersionLessThanOrEqualTo(13, useragent) ||\n (isMacosxVersionLessThanOrEqualTo(10, 15, useragent) && isSafari(useragent)));\n function isIosVersionLessThanOrEqualTo(major, useragent) {\n var match = useragent.match('(iP.+; CPU .*OS (d+)[_d]*.*) AppleWebKit/');\n if (match && match.length) {\n return parseInt(match[0]) <= major;\n }\n return false;\n }\n function isMacosxVersionLessThanOrEqualTo(major, minor, useragent) {\n var match = useragent.match('(Macintosh;.*Mac OS X (d+)_(d+)[_d]*.*) AppleWebKit/');\n if (match && match.length) {\n return parseInt(match[0]) <= major || (parseInt(match[0]) === major && parseInt(match[1]) <= minor);\n }\n return false;\n }\n function isSafari(useragent) {\n return useragent.match('Version/.* Safari/') && !isChromiumBased(useragent);\n }\n function isChromiumBased(useragent) {\n return useragent.match('Chrom(e|ium)');\n }\n }\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/*\n * Extract parameter from URL\n */\nfunction getParameter(url, name) {\n // scheme : // [username [: password] @] hostname [: port] [/ [path] [? query] [# fragment]]\n var e = new RegExp('^(?:https?|ftp)(?::/*(?:[^?]+))([?][^#]+)'), matches = e.exec(url);\n if (matches && (matches === null || matches === void 0 ? void 0 : matches.length) > 1) {\n return fromQuerystring(name, matches[1]);\n }\n return null;\n}\n/*\n * Fix-up URL when page rendered from search engine cache or translated page.\n */\nfunction fixupUrl(hostName, href, referrer) {\n var _a;\n if (hostName === 'translate.googleusercontent.com') {\n // Google\n if (referrer === '') {\n referrer = href;\n }\n href = (_a = getParameter(href, 'u')) !== null && _a !== void 0 ? _a : '';\n hostName = getHostName(href);\n }\n else if (hostName === 'cc.bingj.com' || // Bing & Yahoo\n hostName === 'webcache.googleusercontent.com' // Google\n ) {\n href = document.links[0].href;\n hostName = getHostName(href);\n }\n return [hostName, href, referrer];\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Indices of cookie values\n */\nvar cookieDisabledIndex = 0, domainUserIdIndex = 1, createTsIndex = 2, visitCountIndex = 3, nowTsIndex = 4, lastVisitTsIndex = 5, sessionIdIndex = 6, previousSessionIdIndex = 7, firstEventIdIndex = 8, firstEventTsInMsIndex = 9, eventIndexIndex = 10;\nfunction emptyIdCookie() {\n var idCookie = ['1', '', 0, 0, 0, undefined, '', '', '', undefined, 0];\n return idCookie;\n}\n/**\n * Parses the cookie values from its string representation.\n *\n * @param id Cookie value as string\n * @param domainUserId Domain user ID to be used in case of empty cookie string\n * @returns Parsed ID cookie tuple\n */\nfunction parseIdCookie(id, domainUserId, memorizedSessionId, memorizedVisitCount) {\n var now = new Date(), nowTs = Math.round(now.getTime() / 1000), tmpContainer;\n if (id) {\n tmpContainer = id.split('.');\n // cookies enabled\n tmpContainer.unshift('0');\n }\n else {\n tmpContainer = [\n // cookies disabled\n '1',\n // Domain user ID\n domainUserId,\n // Creation timestamp - seconds since Unix epoch\n nowTs,\n // visitCount - 0 = no previous visit\n memorizedVisitCount,\n // Current visit timestamp\n nowTs,\n // Last visit timestamp - blank meaning no previous visit\n '',\n // Session ID\n memorizedSessionId,\n ];\n }\n if (!tmpContainer[sessionIdIndex] || tmpContainer[sessionIdIndex] === 'undefined') {\n // session id\n tmpContainer[sessionIdIndex] = v4();\n }\n if (!tmpContainer[previousSessionIdIndex] || tmpContainer[previousSessionIdIndex] === 'undefined') {\n // previous session id\n tmpContainer[previousSessionIdIndex] = '';\n }\n if (!tmpContainer[firstEventIdIndex] || tmpContainer[firstEventIdIndex] === 'undefined') {\n // firstEventId - blank meaning no previous event\n tmpContainer[firstEventIdIndex] = '';\n }\n if (!tmpContainer[firstEventTsInMsIndex] || tmpContainer[firstEventTsInMsIndex] === 'undefined') {\n // firstEventTs - blank meaning no previous event\n tmpContainer[firstEventTsInMsIndex] = '';\n }\n if (!tmpContainer[eventIndexIndex] || tmpContainer[eventIndexIndex] === 'undefined') {\n // eventIndex – 0 = no previous event\n tmpContainer[eventIndexIndex] = 0;\n }\n var parseIntOr = function (value, defaultValue) {\n var parsed = parseInt(value);\n return isNaN(parsed) ? defaultValue : parsed;\n };\n var parseIntOrUndefined = function (value) { return (value ? parseIntOr(value, undefined) : undefined); };\n var parsed = [\n tmpContainer[cookieDisabledIndex],\n tmpContainer[domainUserIdIndex],\n parseIntOr(tmpContainer[createTsIndex], nowTs),\n parseIntOr(tmpContainer[visitCountIndex], memorizedVisitCount),\n parseIntOr(tmpContainer[nowTsIndex], nowTs),\n parseIntOrUndefined(tmpContainer[lastVisitTsIndex]),\n tmpContainer[sessionIdIndex],\n tmpContainer[previousSessionIdIndex],\n tmpContainer[firstEventIdIndex],\n parseIntOrUndefined(tmpContainer[firstEventTsInMsIndex]),\n parseIntOr(tmpContainer[eventIndexIndex], 0),\n ];\n return parsed;\n}\n/**\n * Initializes the domain user ID if not already present in the cookie. Sets an empty string if anonymous tracking.\n *\n * @param idCookie Parsed cookie\n * @param configAnonymousTracking Whether anonymous tracking is enabled\n * @returns Domain user ID\n */\nfunction initializeDomainUserId(idCookie, configAnonymousTracking) {\n var domainUserId;\n if (idCookie[domainUserIdIndex]) {\n domainUserId = idCookie[domainUserIdIndex];\n }\n else if (!configAnonymousTracking) {\n domainUserId = v4();\n idCookie[domainUserIdIndex] = domainUserId;\n }\n else {\n domainUserId = '';\n idCookie[domainUserIdIndex] = domainUserId;\n }\n return domainUserId;\n}\n/**\n * Starts a new session with a new ID.\n * Sets the previous session, last visit timestamp, and increments visit count if cookies enabled.\n * First event references are reset and will be updated in `updateFirstEventInIdCookie`.\n *\n * @param idCookie Parsed cookie\n * @param options.configStateStorageStrategy Cookie storage strategy\n * @param options.configAnonymousTracking If anonymous tracking is enabled\n * @param options.memorizedVisitCount Visit count to be used if cookies not enabled\n * @param options.onSessionUpdateCallback Session callback triggered on every session update\n * @returns New session ID\n */\nfunction startNewIdCookieSession(idCookie, options) {\n if (options === void 0) { options = { memorizedVisitCount: 1 }; }\n var memorizedVisitCount = options.memorizedVisitCount;\n // If cookies are enabled, base visit count and session ID on the cookies\n if (cookiesEnabledInIdCookie(idCookie)) {\n // Store the previous session ID\n idCookie[previousSessionIdIndex] = idCookie[sessionIdIndex];\n // Set lastVisitTs to currentVisitTs\n idCookie[lastVisitTsIndex] = idCookie[nowTsIndex];\n // Increment the session ID\n idCookie[visitCountIndex]++;\n }\n else {\n idCookie[visitCountIndex] = memorizedVisitCount;\n }\n // Create a new sessionId\n var sessionId = v4();\n idCookie[sessionIdIndex] = sessionId;\n // Reset event index and first event references\n idCookie[eventIndexIndex] = 0;\n idCookie[firstEventIdIndex] = '';\n idCookie[firstEventTsInMsIndex] = undefined;\n return sessionId;\n}\n/**\n * Update now timestamp in cookie.\n *\n * @param idCookie Parsed cookie\n */\nfunction updateNowTsInIdCookie(idCookie) {\n idCookie[nowTsIndex] = Math.round(new Date().getTime() / 1000);\n}\n/**\n * Updates the first event references according to the event payload if first event in session.\n *\n * @param idCookie Parsed cookie\n * @param payloadBuilder Event payload builder\n */\nfunction updateFirstEventInIdCookie(idCookie, payloadBuilder) {\n // Update first event references if new session or not present\n if (idCookie[eventIndexIndex] === 0) {\n var payload = payloadBuilder.build();\n idCookie[firstEventIdIndex] = payload['eid'];\n var ts = (payload['dtm'] || payload['ttm']);\n idCookie[firstEventTsInMsIndex] = ts ? parseInt(ts) : undefined;\n }\n}\n/**\n * Increments event index counter.\n *\n * @param idCookie Parsed cookie\n */\nfunction incrementEventIndexInIdCookie(idCookie) {\n idCookie[eventIndexIndex] += 1;\n}\n/**\n * Serializes parsed cookie to string representation.\n *\n * @param idCookie Parsed cookie\n * @returns String cookie value\n */\nfunction serializeIdCookie(idCookie, configAnonymousTracking) {\n var anonymizedIdCookie = __spreadArray([], idCookie, true);\n if (configAnonymousTracking) {\n anonymizedIdCookie[domainUserIdIndex] = '';\n anonymizedIdCookie[previousSessionIdIndex] = '';\n }\n anonymizedIdCookie.shift();\n return anonymizedIdCookie.join('.');\n}\n/**\n * Transforms the parsed cookie into a client session context entity.\n *\n * @param idCookie Parsed cookie\n * @param configStateStorageStrategy Cookie storage strategy\n * @param configAnonymousTracking If anonymous tracking is enabled\n * @returns Client session context entity\n */\nfunction clientSessionFromIdCookie(idCookie, configStateStorageStrategy, configAnonymousTracking) {\n var firstEventTsInMs = idCookie[firstEventTsInMsIndex];\n var clientSession = {\n userId: configAnonymousTracking\n ? '00000000-0000-0000-0000-000000000000' // TODO: use uuid.NIL when we upgrade to uuid v8.3\n : idCookie[domainUserIdIndex],\n sessionId: idCookie[sessionIdIndex],\n eventIndex: idCookie[eventIndexIndex],\n sessionIndex: idCookie[visitCountIndex],\n previousSessionId: configAnonymousTracking ? null : idCookie[previousSessionIdIndex] || null,\n storageMechanism: configStateStorageStrategy == 'localStorage' ? 'LOCAL_STORAGE' : 'COOKIE_1',\n firstEventId: idCookie[firstEventIdIndex] || null,\n firstEventTimestamp: firstEventTsInMs ? new Date(firstEventTsInMs).toISOString() : null\n };\n return clientSession;\n}\nfunction sessionIdFromIdCookie(idCookie) {\n return idCookie[sessionIdIndex];\n}\nfunction domainUserIdFromIdCookie(idCookie) {\n return idCookie[domainUserIdIndex];\n}\nfunction visitCountFromIdCookie(idCookie) {\n return idCookie[visitCountIndex];\n}\nfunction cookiesEnabledInIdCookie(idCookie) {\n return idCookie[cookieDisabledIndex] === '0';\n}\nfunction eventIndexFromIdCookie(idCookie) {\n return idCookie[eventIndexIndex];\n}\n\nfunction useResizeObserver() {\n return 'ResizeObserver' in window;\n}\nvar resizeObserverInitialized = false;\nfunction initializeResizeObserver() {\n if (resizeObserverInitialized) {\n return;\n }\n if (!document || !document.body || !document.documentElement) {\n return;\n }\n resizeObserverInitialized = true;\n var resizeObserver = new ResizeObserver(function (entries) {\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var entry = entries_1[_i];\n if (entry.target === document.body || entry.target === document.documentElement) {\n cachedProperties = readBrowserProperties();\n }\n }\n });\n resizeObserver.observe(document.body);\n resizeObserver.observe(document.documentElement);\n}\nvar cachedProperties;\n/* Separator used for dimension values e.g. widthxheight */\nvar DIMENSION_SEPARATOR = 'x';\n/**\n * Gets various browser properties (that are expensive to read!)\n * - Will use a \"ResizeObserver\" approach in modern browsers to update cached properties only on change\n * - Will fallback to a direct read approach without cache in old browsers\n *\n * @returns BrowserProperties\n */\nfunction getBrowserProperties() {\n if (!useResizeObserver()) {\n return readBrowserProperties();\n }\n if (!cachedProperties) {\n cachedProperties = readBrowserProperties();\n }\n initializeResizeObserver();\n return cachedProperties;\n}\n/**\n * Reads the browser properties - expensive call!\n *\n * @returns BrowserProperties\n */\nfunction readBrowserProperties() {\n return {\n viewport: floorDimensionFields(detectViewport()),\n documentSize: floorDimensionFields(detectDocumentSize()),\n resolution: floorDimensionFields(detectScreenResolution()),\n colorDepth: screen.colorDepth,\n devicePixelRatio: window.devicePixelRatio,\n cookiesEnabled: window.navigator.cookieEnabled,\n online: window.navigator.onLine,\n browserLanguage: window.navigator.language || window.navigator.userLanguage,\n documentLanguage: document.documentElement.lang,\n webdriver: window.navigator.webdriver,\n deviceMemory: window.navigator.deviceMemory,\n hardwareConcurrency: window.navigator.hardwareConcurrency\n };\n}\n/**\n * Gets the current viewport.\n *\n * Code based on:\n * - http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n * - http://responsejs.com/labs/dimensions/\n */\nfunction detectViewport() {\n var width, height;\n if ('innerWidth' in window) {\n width = window['innerWidth'];\n height = window['innerHeight'];\n }\n else {\n var e = document.documentElement || document.body;\n width = e['clientWidth'];\n height = e['clientHeight'];\n }\n return Math.max(0, width) + DIMENSION_SEPARATOR + Math.max(0, height);\n}\n/**\n * Gets the dimensions of the current\n * document.\n *\n * Code based on:\n * - http://andylangton.co.uk/articles/javascript/get-viewport-size-javascript/\n */\nfunction detectDocumentSize() {\n var de = document.documentElement, // Alias\n be = document.body, \n // document.body may not have rendered, so check whether be.offsetHeight is null\n bodyHeight = be ? Math.max(be.offsetHeight, be.scrollHeight) : 0;\n var w = Math.max(de.clientWidth, de.offsetWidth, de.scrollWidth);\n var h = Math.max(de.clientHeight, de.offsetHeight, de.scrollHeight, bodyHeight);\n return isNaN(w) || isNaN(h) ? '' : w + DIMENSION_SEPARATOR + h;\n}\nfunction detectScreenResolution() {\n return screen.width + DIMENSION_SEPARATOR + screen.height;\n}\nfunction floorDimensionFields(field) {\n return (field &&\n field\n .split(DIMENSION_SEPARATOR)\n .map(function (dimension) { return Math.floor(Number(dimension)); })\n .join(DIMENSION_SEPARATOR));\n}\n\n/**\n * The Snowplow Tracker\n *\n * @param trackerId - The unique identifier of the tracker\n * @param namespace - The namespace of the tracker object\n * @param version - The current version of the JavaScript Tracker\n * @param endpoint - The collector endpoint to send events to, with or without protocol\n * @param sharedState - An object containing state which is shared across tracker instances\n * @param trackerConfiguration - Dictionary of configuration options\n */\nfunction Tracker(trackerId, namespace, version, endpoint, sharedState, trackerConfiguration) {\n if (trackerConfiguration === void 0) { trackerConfiguration = {}; }\n var browserPlugins = [];\n var newTracker = function (trackerId, namespace, version, endpoint, state, trackerConfiguration) {\n /************************************************************\n * Private members\n ************************************************************/\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;\n //use POST if eventMethod isn't present on the newTrackerConfiguration\n trackerConfiguration.eventMethod = (_a = trackerConfiguration.eventMethod) !== null && _a !== void 0 ? _a : 'post';\n var getStateStorageStrategy = function (config) { var _a; return (_a = config.stateStorageStrategy) !== null && _a !== void 0 ? _a : 'cookieAndLocalStorage'; }, getAnonymousSessionTracking = function (config) {\n var _a, _b;\n if (typeof config.anonymousTracking === 'boolean') {\n return false;\n }\n return (_b = ((_a = config.anonymousTracking) === null || _a === void 0 ? void 0 : _a.withSessionTracking) === true) !== null && _b !== void 0 ? _b : false;\n }, getAnonymousServerTracking = function (config) {\n var _a, _b;\n if (typeof config.anonymousTracking === 'boolean') {\n return false;\n }\n return (_b = ((_a = config.anonymousTracking) === null || _a === void 0 ? void 0 : _a.withServerAnonymisation) === true) !== null && _b !== void 0 ? _b : false;\n }, getAnonymousTracking = function (config) { return !!config.anonymousTracking; }, isBrowserContextAvailable = (_c = (_b = trackerConfiguration === null || trackerConfiguration === void 0 ? void 0 : trackerConfiguration.contexts) === null || _b === void 0 ? void 0 : _b.browser) !== null && _c !== void 0 ? _c : false, isWebPageContextAvailable = (_e = (_d = trackerConfiguration === null || trackerConfiguration === void 0 ? void 0 : trackerConfiguration.contexts) === null || _d === void 0 ? void 0 : _d.webPage) !== null && _e !== void 0 ? _e : true, getExtendedCrossDomainTrackingConfiguration = function (crossDomainTrackingConfig) {\n if (typeof crossDomainTrackingConfig === 'boolean') {\n return { useExtendedCrossDomainLinker: crossDomainTrackingConfig };\n }\n return {\n useExtendedCrossDomainLinker: true,\n collectCrossDomainAttributes: crossDomainTrackingConfig\n };\n };\n // Get all injected plugins\n browserPlugins.push(getBrowserDataPlugin());\n /* When including the Web Page context, we add the relevant internal plugins */\n if (isWebPageContextAvailable) {\n browserPlugins.push(getWebPagePlugin());\n }\n if (isBrowserContextAvailable) {\n browserPlugins.push(getBrowserContextPlugin());\n }\n browserPlugins.push.apply(browserPlugins, ((_f = trackerConfiguration.plugins) !== null && _f !== void 0 ? _f : []));\n var // Tracker core\n core = trackerCore({\n base64: trackerConfiguration.encodeBase64,\n corePlugins: browserPlugins,\n callback: sendRequest\n }), \n // Aliases\n documentCharset = document.characterSet || document.charset, \n // Current URL and Referrer URL\n locationArray = fixupUrl(window.location.hostname, window.location.href, getReferrer()), domainAlias = fixupDomain(locationArray[0]), locationHrefAlias = locationArray[1], configReferrerUrl = locationArray[2], customReferrer, \n // Platform defaults to web for this tracker\n configPlatform = (_g = trackerConfiguration.platform) !== null && _g !== void 0 ? _g : 'web', \n // Snowplow collector URL\n configCollectorUrl = asCollectorUrl(endpoint), \n // Custom path for post requests (to get around adblockers)\n configPostPath = (_h = trackerConfiguration.postPath) !== null && _h !== void 0 ? _h : '/com.snowplowanalytics.snowplow/tp2', \n // Site ID\n configTrackerSiteId = (_j = trackerConfiguration.appId) !== null && _j !== void 0 ? _j : '', \n // Document URL\n configCustomUrl, \n // Document title\n lastDocumentTitle = document.title, \n // Custom title\n lastConfigTitle, \n // Indicates that the lastConfigTitle was set from a trackPageView call\n // Custom title configured this way has a shorter lifespan than when set using setDocumentTitle.\n // It only lasts until the next trackPageView call.\n lastConfigTitleFromTrackPageView = false, \n // Controls whether activity tracking page ping event timers are reset on page view events\n resetActivityTrackingOnPageView = (_k = trackerConfiguration.resetActivityTrackingOnPageView) !== null && _k !== void 0 ? _k : true, \n // Disallow hash tags in URL. TODO: Should this be set to true by default?\n configDiscardHashTag, \n // Disallow brace in URL.\n configDiscardBrace, \n // First-party cookie name prefix\n configCookieNamePrefix = (_l = trackerConfiguration.cookieName) !== null && _l !== void 0 ? _l : '_sp_', \n // First-party cookie domain\n // User agent defaults to origin hostname\n configCookieDomain = (_m = trackerConfiguration.cookieDomain) !== null && _m !== void 0 ? _m : undefined, \n // First-party cookie path\n // Default is user agent defined.\n configCookiePath = '/', \n // First-party cookie samesite attribute\n configCookieSameSite = (_o = trackerConfiguration.cookieSameSite) !== null && _o !== void 0 ? _o : 'None', \n // First-party cookie secure attribute\n configCookieSecure = (_p = trackerConfiguration.cookieSecure) !== null && _p !== void 0 ? _p : true, \n // Do Not Track browser feature\n dnt = window.navigator.doNotTrack || window.navigator.msDoNotTrack || window.doNotTrack, \n // Do Not Track\n configDoNotTrack = typeof trackerConfiguration.respectDoNotTrack !== 'undefined'\n ? trackerConfiguration.respectDoNotTrack && (dnt === 'yes' || dnt === '1')\n : false, \n // Opt out of cookie tracking\n configOptOutCookie, \n // Life of the visitor cookie (in seconds)\n configVisitorCookieTimeout = (_q = trackerConfiguration.cookieLifetime) !== null && _q !== void 0 ? _q : 63072000, // 2 years\n // Life of the session cookie (in seconds)\n configSessionCookieTimeout = (_r = trackerConfiguration.sessionCookieTimeout) !== null && _r !== void 0 ? _r : 1800, // 30 minutes\n // Allows tracking user session (using cookies or local storage), can only be used with anonymousTracking\n configAnonymousSessionTracking = getAnonymousSessionTracking(trackerConfiguration), \n // Will send a header to server to prevent returning cookie and capturing IP\n configAnonymousServerTracking = getAnonymousServerTracking(trackerConfiguration), \n // Sets tracker to work in anonymous mode without accessing client storage\n configAnonymousTracking = getAnonymousTracking(trackerConfiguration), \n // Strategy defining how to store the state: cookie, localStorage, cookieAndLocalStorage or none\n configStateStorageStrategy = getStateStorageStrategy(trackerConfiguration), \n // Last activity timestamp\n lastActivityTime, \n // The last time an event was fired on the page - used to invalidate session if cookies are disabled\n lastEventTime = new Date().getTime(), \n // How are we scrolling?\n minXOffset, maxXOffset, minYOffset, maxYOffset, \n // Domain hash value\n domainHash, \n // Domain unique user ID\n domainUserId, \n // ID for the current session\n memorizedSessionId, \n // Index for the current session - kept in memory in case cookies are disabled\n memorizedVisitCount = 1, \n // Business-defined unique user ID\n businessUserId, \n // Manager for local storage queue\n outQueue = OutQueueManager(trackerId, state, configStateStorageStrategy == 'localStorage' || configStateStorageStrategy == 'cookieAndLocalStorage', trackerConfiguration.eventMethod, configPostPath, (_s = trackerConfiguration.bufferSize) !== null && _s !== void 0 ? _s : 1, (_t = trackerConfiguration.maxPostBytes) !== null && _t !== void 0 ? _t : 40000, (_u = trackerConfiguration.maxGetBytes) !== null && _u !== void 0 ? _u : 0, (_v = trackerConfiguration.useStm) !== null && _v !== void 0 ? _v : true, (_w = trackerConfiguration.maxLocalStorageQueueSize) !== null && _w !== void 0 ? _w : 1000, (_x = trackerConfiguration.connectionTimeout) !== null && _x !== void 0 ? _x : 5000, configAnonymousServerTracking, (_y = trackerConfiguration.customHeaders) !== null && _y !== void 0 ? _y : {}, (_z = trackerConfiguration.withCredentials) !== null && _z !== void 0 ? _z : true, (_0 = trackerConfiguration.retryStatusCodes) !== null && _0 !== void 0 ? _0 : [], ((_1 = trackerConfiguration.dontRetryStatusCodes) !== null && _1 !== void 0 ? _1 : []).concat([400, 401, 403, 410, 422]), trackerConfiguration.idService, trackerConfiguration.retryFailedRequests, trackerConfiguration.onRequestSuccess, trackerConfiguration.onRequestFailure), \n // Whether pageViewId should be regenerated after each trackPageView. Affect web_page context\n preservePageViewId = false, \n // Whether pageViewId should be kept the same until the page URL changes. Affects web_page context\n preservePageViewIdForUrl = (_2 = trackerConfiguration.preservePageViewIdForUrl) !== null && _2 !== void 0 ? _2 : false, \n // The pageViewId of the last page view event or undefined if no page view tracked yet. Used to determine if pageViewId should be regenerated for a new page view.\n lastSentPageViewId = undefined, \n // Activity tracking config for callback and page ping variants\n activityTrackingConfig = {\n enabled: false,\n installed: false,\n configurations: {}\n }, configSessionContext = (_4 = (_3 = trackerConfiguration.contexts) === null || _3 === void 0 ? void 0 : _3.session) !== null && _4 !== void 0 ? _4 : false, toOptoutByCookie, onSessionUpdateCallback = trackerConfiguration.onSessionUpdateCallback, manualSessionUpdateCalled = false, _5 = getExtendedCrossDomainTrackingConfiguration(trackerConfiguration.useExtendedCrossDomainLinker || false), useExtendedCrossDomainLinker = _5.useExtendedCrossDomainLinker, collectCrossDomainAttributes = _5.collectCrossDomainAttributes;\n if (trackerConfiguration.hasOwnProperty('discoverRootDomain') && trackerConfiguration.discoverRootDomain) {\n configCookieDomain = findRootDomain(configCookieSameSite, configCookieSecure);\n }\n var _6 = getBrowserProperties(), browserLanguage = _6.browserLanguage, resolution = _6.resolution, colorDepth = _6.colorDepth, cookiesEnabled = _6.cookiesEnabled;\n // Set up unchanging name-value pairs\n core.setTrackerVersion(version);\n core.setTrackerNamespace(namespace);\n core.setAppId(configTrackerSiteId);\n core.setPlatform(configPlatform);\n core.addPayloadPair('cookie', cookiesEnabled ? '1' : '0');\n core.addPayloadPair('cs', documentCharset);\n core.addPayloadPair('lang', browserLanguage);\n core.addPayloadPair('res', resolution);\n core.addPayloadPair('cd', colorDepth);\n /*\n * Initialize tracker\n */\n updateDomainHash();\n initializeIdsAndCookies();\n if (trackerConfiguration.crossDomainLinker) {\n decorateLinks(trackerConfiguration.crossDomainLinker);\n }\n /**\n * Recalculate the domain, URL, and referrer\n */\n function refreshUrl() {\n locationArray = fixupUrl(window.location.hostname, window.location.href, getReferrer());\n // If this is a single-page app and the page URL has changed, then:\n // - if the new URL's querystring contains a \"refer(r)er\" parameter, use it as the referrer\n // - otherwise use the old URL as the referer\n if (locationArray[1] !== locationHrefAlias) {\n configReferrerUrl = getReferrer(locationHrefAlias);\n }\n domainAlias = fixupDomain(locationArray[0]);\n locationHrefAlias = locationArray[1];\n }\n /**\n * Create link handler to decorate the querystring of a link (onClick/onMouseDown)\n *\n * @param event - e The event targeting the link\n */\n function addLinkDecorationHandler(extended) {\n var CROSS_DOMAIN_PARAMETER_NAME = '_sp';\n return function (evt) {\n var elt = evt.currentTarget;\n var crossDomainParameterValue = createCrossDomainParameterValue(extended, collectCrossDomainAttributes, {\n domainUserId: domainUserId,\n userId: businessUserId || undefined,\n sessionId: memorizedSessionId,\n sourceId: configTrackerSiteId,\n sourcePlatform: configPlatform,\n event: evt\n });\n if (elt === null || elt === void 0 ? void 0 : elt.href) {\n elt.href = decorateQuerystring(elt.href, CROSS_DOMAIN_PARAMETER_NAME, crossDomainParameterValue);\n }\n };\n }\n /**\n * Enable querystring decoration for links passing a filter\n * Whenever such a link is clicked on or navigated to via the keyboard,\n * add \"_sp={{duid}}.{{timestamp}}\" to its querystring\n *\n * @param crossDomainLinker - Function used to determine which links to decorate\n */\n function decorateLinks(crossDomainLinker) {\n var crossDomainLinkHandler = addLinkDecorationHandler(useExtendedCrossDomainLinker);\n for (var i = 0; i < document.links.length; i++) {\n var elt = document.links[i];\n if (!elt.spDecorationEnabled && crossDomainLinker(elt)) {\n elt.addEventListener('click', crossDomainLinkHandler, true);\n elt.addEventListener('mousedown', crossDomainLinkHandler, true);\n // Don't add event listeners more than once\n elt.spDecorationEnabled = true;\n }\n }\n }\n /*\n * Removes hash tag from the URL\n *\n * URLs are purified before being recorded in the cookie,\n * or before being sent as GET parameters\n */\n function purify(url) {\n var targetPattern;\n if (configDiscardHashTag) {\n targetPattern = new RegExp('#.*');\n url = url.replace(targetPattern, '');\n }\n if (configDiscardBrace) {\n targetPattern = new RegExp('[{}]', 'g');\n url = url.replace(targetPattern, '');\n }\n return url;\n }\n /*\n * Extract scheme/protocol from URL\n */\n function getProtocolScheme(url) {\n var e = new RegExp('^([a-z]+):'), matches = e.exec(url);\n return matches ? matches[1] : null;\n }\n /*\n * Resolve relative reference\n *\n * Note: not as described in rfc3986 section 5.2\n */\n function resolveRelativeReference(baseUrl, url) {\n var protocol = getProtocolScheme(url), i;\n if (protocol) {\n return url;\n }\n if (url.slice(0, 1) === '/') {\n return getProtocolScheme(baseUrl) + '://' + getHostName(baseUrl) + url;\n }\n baseUrl = purify(baseUrl);\n if ((i = baseUrl.indexOf('?')) >= 0) {\n baseUrl = baseUrl.slice(0, i);\n }\n if ((i = baseUrl.lastIndexOf('/')) !== baseUrl.length - 1) {\n baseUrl = baseUrl.slice(0, i + 1);\n }\n return baseUrl + url;\n }\n /*\n * Send request\n */\n function sendRequest(request) {\n if (!(configDoNotTrack || toOptoutByCookie)) {\n outQueue.enqueueRequest(request.build(), configCollectorUrl);\n }\n }\n /*\n * Get cookie name with prefix and domain hash\n */\n function getSnowplowCookieName(baseName) {\n return configCookieNamePrefix + baseName + '.' + domainHash;\n }\n /*\n * Cookie getter.\n */\n function getSnowplowCookieValue(cookieName) {\n var fullName = getSnowplowCookieName(cookieName);\n if (configStateStorageStrategy == 'localStorage') {\n return attemptGetLocalStorage(fullName);\n }\n else if (configStateStorageStrategy == 'cookie' || configStateStorageStrategy == 'cookieAndLocalStorage') {\n return cookie(fullName);\n }\n return undefined;\n }\n /*\n * Update domain hash\n */\n function updateDomainHash() {\n refreshUrl();\n domainHash = hash((configCookieDomain || domainAlias) + (configCookiePath || '/')).slice(0, 4); // 4 hexits = 16 bits\n }\n /*\n * Process all \"activity\" events.\n * For performance, this function must have low overhead.\n */\n function activityHandler() {\n var now = new Date();\n lastActivityTime = now.getTime();\n }\n /*\n * Process all \"scroll\" events.\n */\n function scrollHandler() {\n updateMaxScrolls();\n activityHandler();\n }\n /*\n * Returns [pageXOffset, pageYOffset]\n */\n function getPageOffsets() {\n var documentElement = document.documentElement;\n if (documentElement) {\n return [documentElement.scrollLeft || window.pageXOffset, documentElement.scrollTop || window.pageYOffset];\n }\n return [0, 0];\n }\n /*\n * Quick initialization/reset of max scroll levels\n */\n function resetMaxScrolls() {\n var offsets = getPageOffsets();\n var x = offsets[0];\n minXOffset = x;\n maxXOffset = x;\n var y = offsets[1];\n minYOffset = y;\n maxYOffset = y;\n }\n /*\n * Check the max scroll levels, updating as necessary\n */\n function updateMaxScrolls() {\n var offsets = getPageOffsets();\n var x = offsets[0];\n if (x < minXOffset) {\n minXOffset = x;\n }\n else if (x > maxXOffset) {\n maxXOffset = x;\n }\n var y = offsets[1];\n if (y < minYOffset) {\n minYOffset = y;\n }\n else if (y > maxYOffset) {\n maxYOffset = y;\n }\n }\n /*\n * Prevents offsets from being decimal or NaN\n * See https://github.com/snowplow/snowplow-javascript-tracker/issues/324\n */\n function cleanOffset(offset) {\n return Math.round(offset);\n }\n /**\n * Sets or renews the session cookie.\n * Responsible for calling the `onSessionUpdateCallback` callback.\n * @returns {boolean} If the value persisted in cookies or LocalStorage\n */\n function setSessionCookie() {\n var cookieName = getSnowplowCookieName('ses');\n var cookieValue = '*';\n return persistValue(cookieName, cookieValue, configSessionCookieTimeout);\n }\n /**\n * @mutates idCookie\n * @param {ParsedIdCookie} idCookie\n * @returns {boolean} If the value persisted in cookies or LocalStorage\n */\n function setDomainUserIdCookie(idCookie) {\n var cookieName = getSnowplowCookieName('id');\n var cookieValue = serializeIdCookie(idCookie, configAnonymousTracking);\n return persistValue(cookieName, cookieValue, configVisitorCookieTimeout);\n }\n /**\n * no-op if anonymousTracking enabled, will still set cookies if anonymousSessionTracking is enabled\n * Sets a cookie based on the storage strategy:\n * - if 'localStorage': attempts to write to local storage\n * - if 'cookie' or 'cookieAndLocalStorage': writes to cookies\n * - otherwise: no-op\n * @param {string} name Name/key of the value to persist\n * @param {string} value\n * @param {number} timeout Used as the expiration date for cookies or as a TTL to be checked on LocalStorage\n * @returns {boolean} If the operation was successful or not\n */\n function persistValue(name, value, timeout) {\n if (configAnonymousTracking && !configAnonymousSessionTracking) {\n return false;\n }\n if (configStateStorageStrategy == 'localStorage') {\n return attemptWriteLocalStorage(name, value, timeout);\n }\n else if (configStateStorageStrategy == 'cookie' || configStateStorageStrategy == 'cookieAndLocalStorage') {\n cookie(name, value, timeout, configCookiePath, configCookieDomain, configCookieSameSite, configCookieSecure);\n return document.cookie.indexOf(\"\".concat(name, \"=\")) !== -1 ? true : false;\n }\n return false;\n }\n /**\n * Clears all cookie and local storage for id and ses values\n */\n function clearUserDataAndCookies(configuration) {\n var idname = getSnowplowCookieName('id');\n var sesname = getSnowplowCookieName('ses');\n attemptDeleteLocalStorage(idname);\n attemptDeleteLocalStorage(sesname);\n deleteCookie(idname, configCookieDomain, configCookieSameSite, configCookieSecure);\n deleteCookie(sesname, configCookieDomain, configCookieSameSite, configCookieSecure);\n if (!(configuration === null || configuration === void 0 ? void 0 : configuration.preserveSession)) {\n memorizedSessionId = v4();\n memorizedVisitCount = 1;\n }\n if (!(configuration === null || configuration === void 0 ? void 0 : configuration.preserveUser)) {\n domainUserId = configAnonymousTracking ? '' : v4();\n businessUserId = null;\n }\n }\n /**\n * Toggle Anonymous Tracking\n */\n function toggleAnonymousTracking(configuration) {\n if (configuration && configuration.stateStorageStrategy) {\n trackerConfiguration.stateStorageStrategy = configuration.stateStorageStrategy;\n configStateStorageStrategy = getStateStorageStrategy(trackerConfiguration);\n }\n configAnonymousTracking = getAnonymousTracking(trackerConfiguration);\n configAnonymousSessionTracking = getAnonymousSessionTracking(trackerConfiguration);\n configAnonymousServerTracking = getAnonymousServerTracking(trackerConfiguration);\n outQueue.setUseLocalStorage(configStateStorageStrategy == 'localStorage' || configStateStorageStrategy == 'cookieAndLocalStorage');\n outQueue.setAnonymousTracking(configAnonymousServerTracking);\n }\n /*\n * Load the domain user ID and the session ID\n * Set the cookies (if cookies are enabled)\n */\n function initializeIdsAndCookies() {\n if (configAnonymousTracking && !configAnonymousSessionTracking) {\n return;\n }\n var sesCookieSet = configStateStorageStrategy != 'none' && !!getSnowplowCookieValue('ses');\n var idCookie = loadDomainUserIdCookie();\n domainUserId = initializeDomainUserId(idCookie, configAnonymousTracking);\n if (!sesCookieSet) {\n memorizedSessionId = startNewIdCookieSession(idCookie);\n }\n else {\n memorizedSessionId = sessionIdFromIdCookie(idCookie);\n }\n memorizedVisitCount = visitCountFromIdCookie(idCookie);\n if (configStateStorageStrategy != 'none') {\n setSessionCookie();\n // Update currentVisitTs\n updateNowTsInIdCookie(idCookie);\n setDomainUserIdCookie(idCookie);\n }\n }\n /*\n * Load visitor ID cookie\n */\n function loadDomainUserIdCookie() {\n if (configStateStorageStrategy == 'none') {\n return emptyIdCookie();\n }\n var id = getSnowplowCookieValue('id') || undefined;\n return parseIdCookie(id, domainUserId, memorizedSessionId, memorizedVisitCount);\n }\n /**\n * Adds the protocol in front of our collector URL\n *\n * @param string - collectorUrl The collector URL with or without protocol\n * @returns string collectorUrl The tracker URL with protocol\n */\n function asCollectorUrl(collectorUrl) {\n if (collectorUrl.indexOf('http') === 0) {\n return collectorUrl;\n }\n return ('https:' === document.location.protocol ? 'https' : 'http') + '://' + collectorUrl;\n }\n /**\n * Initialize new `pageViewId` if it shouldn't be preserved.\n * Should be called when `trackPageView` is invoked\n */\n function resetPageView() {\n if (!preservePageViewId || state.pageViewId == null) {\n state.pageViewId = v4();\n state.pageViewUrl = configCustomUrl || locationHrefAlias;\n }\n }\n /**\n * Safe function to get `pageViewId`.\n * Generates it if it wasn't initialized by other tracker\n */\n function getPageViewId() {\n if (shouldGenerateNewPageViewId()) {\n state.pageViewId = v4();\n state.pageViewUrl = configCustomUrl || locationHrefAlias;\n }\n return state.pageViewId;\n }\n function shouldGenerateNewPageViewId() {\n // If pageViewId is not initialized, generate it\n if (state.pageViewId == null) {\n return true;\n }\n // If pageViewId should be preserved regardless of the URL, don't generate a new one\n if (preservePageViewId || !preservePageViewIdForUrl) {\n return false;\n }\n // If doesn't have previous URL in state, generate a new pageViewId\n if (state.pageViewUrl === undefined) {\n return true;\n }\n var current = configCustomUrl || locationHrefAlias;\n // If full preserve is enabled, compare the full URL\n if (preservePageViewIdForUrl === true || preservePageViewIdForUrl == 'full' || !('URL' in window)) {\n return state.pageViewUrl != current;\n }\n var currentUrl = new URL(current);\n var previousUrl = new URL(state.pageViewUrl);\n // If pathname preserve is enabled, compare the pathname\n if (preservePageViewIdForUrl == 'pathname') {\n return currentUrl.pathname != previousUrl.pathname;\n }\n // If pathname and search preserve is enabled, compare the pathname and search\n if (preservePageViewIdForUrl == 'pathnameAndSearch') {\n return currentUrl.pathname != previousUrl.pathname || currentUrl.search != previousUrl.search;\n }\n return false;\n }\n /**\n * Safe function to get `tabId`.\n * Generates it if it is not yet initialized. Shared between trackers.\n */\n function getTabId() {\n if (configStateStorageStrategy === 'none' || configAnonymousTracking || !isWebPageContextAvailable) {\n return null;\n }\n var SESSION_STORAGE_TAB_ID = '_sp_tab_id';\n var tabId = attemptGetSessionStorage(SESSION_STORAGE_TAB_ID);\n if (!tabId) {\n attemptWriteSessionStorage(SESSION_STORAGE_TAB_ID, v4());\n tabId = attemptGetSessionStorage(SESSION_STORAGE_TAB_ID);\n }\n return tabId || null;\n }\n /**\n * Put together a web page context with a unique UUID for the page view\n *\n * @returns web_page context\n */\n function getWebPagePlugin() {\n return {\n contexts: function () {\n return [\n {\n schema: WEB_PAGE_SCHEMA,\n data: {\n id: getPageViewId()\n }\n },\n ];\n }\n };\n }\n function getBrowserContextPlugin() {\n return {\n contexts: function () {\n return [\n {\n schema: BROWSER_CONTEXT_SCHEMA,\n data: __assign(__assign({}, getBrowserProperties()), { tabId: getTabId() })\n },\n ];\n }\n };\n }\n /*\n * Attaches common web fields to every request (resolution, url, referrer, etc.)\n * Also sets the required cookies.\n */\n function getBrowserDataPlugin() {\n var anonymizeOr = function (value) { return (configAnonymousTracking ? null : value); };\n var anonymizeSessionOr = function (value) {\n return configAnonymousSessionTracking ? value : anonymizeOr(value);\n };\n return {\n beforeTrack: function (payloadBuilder) {\n var existingSession = getSnowplowCookieValue('ses'), idCookie = loadDomainUserIdCookie();\n var isFirstEventInSession = eventIndexFromIdCookie(idCookie) === 0;\n if (configOptOutCookie) {\n toOptoutByCookie = !!cookie(configOptOutCookie);\n }\n else {\n toOptoutByCookie = false;\n }\n if (configDoNotTrack || toOptoutByCookie) {\n clearUserDataAndCookies();\n return;\n }\n // If cookies are enabled, base visit count and session ID on the cookies\n if (cookiesEnabledInIdCookie(idCookie)) {\n // New session?\n if (!existingSession && configStateStorageStrategy != 'none') {\n memorizedSessionId = startNewIdCookieSession(idCookie);\n }\n else {\n memorizedSessionId = sessionIdFromIdCookie(idCookie);\n }\n memorizedVisitCount = visitCountFromIdCookie(idCookie);\n }\n else if (new Date().getTime() - lastEventTime > configSessionCookieTimeout * 1000) {\n memorizedVisitCount++;\n memorizedSessionId = startNewIdCookieSession(idCookie, {\n memorizedVisitCount: memorizedVisitCount\n });\n }\n // Update cookie\n updateNowTsInIdCookie(idCookie);\n updateFirstEventInIdCookie(idCookie, payloadBuilder);\n incrementEventIndexInIdCookie(idCookie);\n var _a = getBrowserProperties(), viewport = _a.viewport, documentSize = _a.documentSize;\n payloadBuilder.add('vp', viewport);\n payloadBuilder.add('ds', documentSize);\n payloadBuilder.add('vid', anonymizeSessionOr(memorizedVisitCount));\n payloadBuilder.add('sid', anonymizeSessionOr(memorizedSessionId));\n payloadBuilder.add('duid', anonymizeOr(domainUserIdFromIdCookie(idCookie))); // Always load from cookie as this is better etiquette than in-memory values\n payloadBuilder.add('uid', anonymizeOr(businessUserId));\n refreshUrl();\n payloadBuilder.add('refr', purify(customReferrer || configReferrerUrl));\n // Add the page URL last as it may take us over the IE limit (and we don't always need it)\n payloadBuilder.add('url', purify(configCustomUrl || locationHrefAlias));\n var clientSession = clientSessionFromIdCookie(idCookie, configStateStorageStrategy, configAnonymousTracking);\n if (configSessionContext && (!configAnonymousTracking || configAnonymousSessionTracking)) {\n addSessionContextToPayload(payloadBuilder, clientSession);\n }\n // Update cookies\n if (configStateStorageStrategy != 'none') {\n setDomainUserIdCookie(idCookie);\n var sessionIdentifierPersisted = setSessionCookie();\n if ((!existingSession || isFirstEventInSession) &&\n sessionIdentifierPersisted &&\n onSessionUpdateCallback &&\n !manualSessionUpdateCalled) {\n onSessionUpdateCallback(clientSession);\n manualSessionUpdateCalled = false;\n }\n }\n lastEventTime = new Date().getTime();\n }\n };\n }\n function addSessionContextToPayload(payloadBuilder, clientSession) {\n var sessionContext = {\n schema: CLIENT_SESSION_SCHEMA,\n data: clientSession\n };\n payloadBuilder.addContextEntity(sessionContext);\n }\n /**\n * Expires current session and starts a new session.\n */\n function newSession() {\n // If cookies are enabled, base visit count and session ID on the cookies\n var idCookie = loadDomainUserIdCookie();\n // When cookies are enabled\n if (cookiesEnabledInIdCookie(idCookie)) {\n // When cookie/local storage is enabled - make a new session\n if (configStateStorageStrategy != 'none') {\n memorizedSessionId = startNewIdCookieSession(idCookie);\n }\n else {\n memorizedSessionId = sessionIdFromIdCookie(idCookie);\n }\n memorizedVisitCount = visitCountFromIdCookie(idCookie);\n }\n else {\n memorizedVisitCount++;\n memorizedSessionId = startNewIdCookieSession(idCookie, {\n memorizedVisitCount: memorizedVisitCount\n });\n }\n updateNowTsInIdCookie(idCookie);\n // Update cookies\n if (configStateStorageStrategy != 'none') {\n var clientSession = clientSessionFromIdCookie(idCookie, configStateStorageStrategy, configAnonymousTracking);\n setDomainUserIdCookie(idCookie);\n var sessionIdentifierPersisted = setSessionCookie();\n if (sessionIdentifierPersisted && onSessionUpdateCallback) {\n manualSessionUpdateCalled = true;\n onSessionUpdateCallback(clientSession);\n }\n }\n lastEventTime = new Date().getTime();\n }\n /**\n * Combine an array of unchanging contexts with the result of a context-creating function\n *\n * @param staticContexts - Array of custom contexts\n * @param contextCallback - Function returning an array of contexts\n */\n function finalizeContexts(staticContexts, contextCallback) {\n return (staticContexts || []).concat(contextCallback ? contextCallback() : []);\n }\n function logPageView(_a) {\n var title = _a.title, context = _a.context, timestamp = _a.timestamp, contextCallback = _a.contextCallback;\n refreshUrl();\n if (lastSentPageViewId && lastSentPageViewId == getPageViewId()) {\n // Do not reset pageViewId if a page view was not tracked yet or a different page view ID was used (in order to support multiple trackers with shared state)\n resetPageView();\n }\n lastSentPageViewId = getPageViewId();\n // So we know what document.title was at the time of trackPageView\n lastDocumentTitle = document.title;\n if (title) {\n lastConfigTitle = title;\n lastConfigTitleFromTrackPageView = true;\n }\n else if (lastConfigTitleFromTrackPageView) {\n lastConfigTitle = null;\n }\n // Fixup page title\n var pageTitle = fixupTitle(lastConfigTitle || lastDocumentTitle);\n // Log page view\n core.track(buildPageView({\n pageUrl: purify(configCustomUrl || locationHrefAlias),\n pageTitle: pageTitle,\n referrer: purify(customReferrer || configReferrerUrl)\n }), finalizeContexts(context, contextCallback), timestamp);\n // Send ping (to log that user has stayed on page)\n var now = new Date();\n var installingActivityTracking = false;\n if (activityTrackingConfig.enabled && !activityTrackingConfig.installed) {\n activityTrackingConfig.installed = true;\n installingActivityTracking = true;\n // Add mousewheel event handler, detect passive event listeners for performance\n var detectPassiveEvents_1 = {\n update: function update() {\n if (typeof window !== 'undefined' && typeof window.addEventListener === 'function') {\n var passive_1 = false;\n var options = Object.defineProperty({}, 'passive', {\n get: function get() {\n passive_1 = true;\n },\n set: function set() { }\n });\n // note: have to set and remove a no-op listener instead of null\n // (which was used previously), because Edge v15 throws an error\n // when providing a null callback.\n // https://github.com/rafrex/detect-passive-events/pull/3\n var noop = function noop() { };\n window.addEventListener('testPassiveEventSupport', noop, options);\n window.removeEventListener('testPassiveEventSupport', noop, options);\n detectPassiveEvents_1.hasSupport = passive_1;\n }\n }\n };\n detectPassiveEvents_1.update();\n // Detect available wheel event\n var wheelEvent = 'onwheel' in document.createElement('div')\n ? 'wheel' // Modern browsers support \"wheel\"\n : document.onmousewheel !== undefined\n ? 'mousewheel' // Webkit and IE support at least \"mousewheel\"\n : 'DOMMouseScroll'; // let's assume that remaining browsers are older Firefox\n if (Object.prototype.hasOwnProperty.call(detectPassiveEvents_1, 'hasSupport')) {\n addEventListener(document, wheelEvent, activityHandler, { passive: true });\n }\n else {\n addEventListener(document, wheelEvent, activityHandler);\n }\n // Capture our initial scroll points\n resetMaxScrolls();\n // Add event handlers; cross-browser compatibility here varies significantly\n // @see http://quirksmode.org/dom/events\n var documentHandlers = [\n 'click',\n 'mouseup',\n 'mousedown',\n 'mousemove',\n 'keypress',\n 'keydown',\n 'keyup',\n 'touchend',\n 'touchstart',\n ];\n var windowHandlers = ['resize', 'focus', 'blur'];\n var listener = function (_, handler) {\n if (handler === void 0) { handler = activityHandler; }\n return function (ev) {\n return addEventListener(document, ev, handler);\n };\n };\n documentHandlers.forEach(listener(document));\n windowHandlers.forEach(listener(window));\n listener(window, scrollHandler)('scroll');\n }\n if (activityTrackingConfig.enabled && (resetActivityTrackingOnPageView || installingActivityTracking)) {\n // Periodic check for activity.\n lastActivityTime = now.getTime();\n var key = void 0;\n for (key in activityTrackingConfig.configurations) {\n var config = activityTrackingConfig.configurations[key];\n if (config) {\n //Clear page ping heartbeat on new page view\n window.clearInterval(config.activityInterval);\n scheduleActivityInterval(config, context, contextCallback);\n }\n }\n }\n }\n function scheduleActivityInterval(config, context, contextCallback) {\n var executePagePing = function (cb, context) {\n refreshUrl();\n cb({ context: context, pageViewId: getPageViewId(), minXOffset: minXOffset, minYOffset: minYOffset, maxXOffset: maxXOffset, maxYOffset: maxYOffset });\n resetMaxScrolls();\n };\n var timeout = function () {\n var now = new Date();\n // There was activity during the heart beat period;\n // on average, this is going to overstate the visitDuration by configHeartBeatTimer/2\n if (lastActivityTime + config.configMinimumVisitLength > now.getTime()) {\n executePagePing(config.callback, finalizeContexts(context, contextCallback));\n }\n config.activityInterval = window.setInterval(heartbeat, config.configHeartBeatTimer);\n };\n var heartbeat = function () {\n var now = new Date();\n // There was activity during the heart beat period;\n // on average, this is going to overstate the visitDuration by configHeartBeatTimer/2\n if (lastActivityTime + config.configHeartBeatTimer > now.getTime()) {\n executePagePing(config.callback, finalizeContexts(context, contextCallback));\n }\n };\n if (config.configMinimumVisitLength === 0) {\n config.activityInterval = window.setInterval(heartbeat, config.configHeartBeatTimer);\n }\n else {\n config.activityInterval = window.setTimeout(timeout, config.configMinimumVisitLength);\n }\n }\n /**\n * Configure the activity tracking and ensures integer values for min visit and heartbeat\n */\n function configureActivityTracking(configuration) {\n var minimumVisitLength = configuration.minimumVisitLength, heartbeatDelay = configuration.heartbeatDelay, callback = configuration.callback;\n if (isInteger(minimumVisitLength) && isInteger(heartbeatDelay)) {\n return {\n configMinimumVisitLength: minimumVisitLength * 1000,\n configHeartBeatTimer: heartbeatDelay * 1000,\n callback: callback\n };\n }\n LOG.error('Activity tracking minimumVisitLength & heartbeatDelay must be integers');\n return undefined;\n }\n /**\n * Log that a user is still viewing a given page by sending a page ping.\n * Not part of the public API - only called from logPageView() above.\n */\n function logPagePing(_a) {\n var context = _a.context, minXOffset = _a.minXOffset, minYOffset = _a.minYOffset, maxXOffset = _a.maxXOffset, maxYOffset = _a.maxYOffset;\n var newDocumentTitle = document.title;\n if (newDocumentTitle !== lastDocumentTitle) {\n lastDocumentTitle = newDocumentTitle;\n lastConfigTitle = undefined;\n }\n core.track(buildPagePing({\n pageUrl: purify(configCustomUrl || locationHrefAlias),\n pageTitle: fixupTitle(lastConfigTitle || lastDocumentTitle),\n referrer: purify(customReferrer || configReferrerUrl),\n minXOffset: cleanOffset(minXOffset),\n maxXOffset: cleanOffset(maxXOffset),\n minYOffset: cleanOffset(minYOffset),\n maxYOffset: cleanOffset(maxYOffset)\n }), context);\n }\n function disableActivityTrackingAction(actionKey) {\n var callbackConfiguration = activityTrackingConfig.configurations[actionKey];\n if ((callbackConfiguration === null || callbackConfiguration === void 0 ? void 0 : callbackConfiguration.configMinimumVisitLength) === 0) {\n window.clearTimeout(callbackConfiguration === null || callbackConfiguration === void 0 ? void 0 : callbackConfiguration.activityInterval);\n }\n else {\n window.clearInterval(callbackConfiguration === null || callbackConfiguration === void 0 ? void 0 : callbackConfiguration.activityInterval);\n }\n activityTrackingConfig.configurations[actionKey] = undefined;\n }\n var apiMethods = {\n getDomainSessionIndex: function () {\n return memorizedVisitCount;\n },\n getPageViewId: getPageViewId,\n getTabId: getTabId,\n newSession: newSession,\n getCookieName: function (basename) {\n return getSnowplowCookieName(basename);\n },\n getUserId: function () {\n return businessUserId;\n },\n getDomainUserId: function () {\n return loadDomainUserIdCookie()[1];\n },\n getDomainUserInfo: function () {\n return loadDomainUserIdCookie();\n },\n setReferrerUrl: function (url) {\n customReferrer = url;\n },\n setCustomUrl: function (url) {\n refreshUrl();\n configCustomUrl = resolveRelativeReference(locationHrefAlias, url);\n },\n setDocumentTitle: function (title) {\n // So we know what document.title was at the time of trackPageView\n lastDocumentTitle = document.title;\n lastConfigTitle = title;\n lastConfigTitleFromTrackPageView = false;\n },\n discardHashTag: function (enableFilter) {\n configDiscardHashTag = enableFilter;\n },\n discardBrace: function (enableFilter) {\n configDiscardBrace = enableFilter;\n },\n setCookiePath: function (path) {\n configCookiePath = path;\n updateDomainHash();\n },\n setVisitorCookieTimeout: function (timeout) {\n configVisitorCookieTimeout = timeout;\n },\n crossDomainLinker: function (crossDomainLinkerCriterion) {\n decorateLinks(crossDomainLinkerCriterion);\n },\n enableActivityTracking: function (configuration) {\n if (!activityTrackingConfig.configurations.pagePing) {\n activityTrackingConfig.enabled = true;\n activityTrackingConfig.configurations.pagePing = configureActivityTracking(__assign(__assign({}, configuration), { callback: logPagePing }));\n }\n },\n enableActivityTrackingCallback: function (configuration) {\n if (!activityTrackingConfig.configurations.callback) {\n activityTrackingConfig.enabled = true;\n activityTrackingConfig.configurations.callback = configureActivityTracking(configuration);\n }\n },\n disableActivityTracking: function () {\n disableActivityTrackingAction('pagePing');\n },\n disableActivityTrackingCallback: function () {\n disableActivityTrackingAction('callback');\n },\n updatePageActivity: function () {\n activityHandler();\n },\n setOptOutCookie: function (name) {\n configOptOutCookie = name;\n },\n setUserId: function (userId) {\n businessUserId = userId;\n },\n setUserIdFromLocation: function (querystringField) {\n refreshUrl();\n businessUserId = fromQuerystring(querystringField, locationHrefAlias);\n },\n setUserIdFromReferrer: function (querystringField) {\n refreshUrl();\n businessUserId = fromQuerystring(querystringField, configReferrerUrl);\n },\n setUserIdFromCookie: function (cookieName) {\n businessUserId = cookie(cookieName);\n },\n setCollectorUrl: function (collectorUrl) {\n configCollectorUrl = asCollectorUrl(collectorUrl);\n outQueue.setCollectorUrl(configCollectorUrl);\n },\n setBufferSize: function (newBufferSize) {\n outQueue.setBufferSize(newBufferSize);\n },\n flushBuffer: function (configuration) {\n if (configuration === void 0) { configuration = {}; }\n outQueue.executeQueue();\n if (configuration.newBufferSize) {\n outQueue.setBufferSize(configuration.newBufferSize);\n }\n },\n trackPageView: function (event) {\n if (event === void 0) { event = {}; }\n logPageView(event);\n },\n preservePageViewId: function () {\n preservePageViewId = true;\n },\n preservePageViewIdForUrl: function (preserve) {\n preservePageViewIdForUrl = preserve;\n },\n disableAnonymousTracking: function (configuration) {\n trackerConfiguration.anonymousTracking = false;\n toggleAnonymousTracking(configuration);\n initializeIdsAndCookies();\n outQueue.executeQueue(); // There might be some events in the queue we've been unable to send in anonymous mode\n },\n enableAnonymousTracking: function (configuration) {\n var _a;\n trackerConfiguration.anonymousTracking = (_a = (configuration && (configuration === null || configuration === void 0 ? void 0 : configuration.options))) !== null && _a !== void 0 ? _a : true;\n toggleAnonymousTracking(configuration);\n // Reset the page view, if not tracking the session, so can't stitch user into new events on the page view id\n if (!configAnonymousSessionTracking) {\n resetPageView();\n }\n },\n clearUserData: clearUserDataAndCookies\n };\n return __assign(__assign({}, apiMethods), { id: trackerId, namespace: namespace, core: core, sharedState: state });\n };\n // Initialise the tracker\n var partialTracker = newTracker(trackerId, namespace, version, endpoint, sharedState, trackerConfiguration), tracker = __assign(__assign({}, partialTracker), { addPlugin: function (configuration) {\n var _a, _b;\n tracker.core.addPlugin(configuration);\n (_b = (_a = configuration.plugin).activateBrowserPlugin) === null || _b === void 0 ? void 0 : _b.call(_a, tracker);\n } });\n // Initialise each plugin with the tracker\n browserPlugins.forEach(function (p) {\n var _a;\n (_a = p.activateBrowserPlugin) === null || _a === void 0 ? void 0 : _a.call(p, tracker);\n });\n return tracker;\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar namedTrackers = {};\n/**\n * Dispatch function to all specified trackers\n *\n * @param trackers - An optional list of trackers to send the event to, or will send to all trackers\n * @param fn - The function which will run against each tracker\n */\nfunction dispatchToTrackers(trackers, fn) {\n try {\n getTrackers(trackers !== null && trackers !== void 0 ? trackers : allTrackerNames()).forEach(fn);\n }\n catch (ex) {\n LOG.error('Function failed', ex);\n }\n}\n/**\n * Dispatch function to all specified trackers from the supplied collection\n *\n * @param trackers - An optional list of trackers to send the event to, or will send to all trackers\n * @param trackerCollection - The collection which the trackers will be selected from\n * @param fn - The function which will run against each tracker\n */\nfunction dispatchToTrackersInCollection(trackers, trackerCollection, fn) {\n try {\n getTrackersFromCollection(trackers !== null && trackers !== void 0 ? trackers : Object.keys(trackerCollection), trackerCollection).forEach(fn);\n }\n catch (ex) {\n LOG.error('Function failed', ex);\n }\n}\n/**\n * Checks if a tracker has been created for a particular identifier\n * @param trackerId - The unique identifier of the tracker\n */\nfunction trackerExists(trackerId) {\n return namedTrackers.hasOwnProperty(trackerId);\n}\n/**\n * Creates a Tracker and adds it to the internal collection\n * @param trackerId - The unique identifier of the tracker\n * @param namespace - The namespace of the tracker, tracked with each event as `tna`\n * @param version - The current version of the tracker library\n * @param endpoint - The endpoint to send events to\n * @param sharedState - The instance of shared state to use for this tracker\n * @param configuration - The configuration to use for this tracker instance\n */\nfunction addTracker(trackerId, namespace, version, endpoint, sharedState, configuration) {\n if (!namedTrackers.hasOwnProperty(trackerId)) {\n namedTrackers[trackerId] = Tracker(trackerId, namespace, version, endpoint, sharedState, configuration);\n return namedTrackers[trackerId];\n }\n return null;\n}\n/**\n * Gets a single instance of the internal tracker object\n * @param trackerId - The unique identifier of the tracker\n * @returns The tracker instance, or null if not found\n */\nfunction getTracker(trackerId) {\n if (namedTrackers.hasOwnProperty(trackerId)) {\n return namedTrackers[trackerId];\n }\n LOG.warn(trackerId + ' not configured');\n return null;\n}\n/**\n * Gets an array of tracker instances based on the list of identifiers\n * @param trackerIds - An array of unique identifiers of the trackers\n * @returns The tracker instances, or empty list if none found\n */\nfunction getTrackers(trackerIds) {\n return getTrackersFromCollection(trackerIds, namedTrackers);\n}\n/**\n * Gets all the trackers as a object, keyed by their unique identifiers\n */\nfunction allTrackers() {\n return namedTrackers;\n}\n/**\n * Returns all the unique tracker identifiers\n */\nfunction allTrackerNames() {\n return Object.keys(namedTrackers);\n}\nfunction getTrackersFromCollection(trackerIds, trackerCollection) {\n var trackers = [];\n for (var _i = 0, trackerIds_1 = trackerIds; _i < trackerIds_1.length; _i++) {\n var id = trackerIds_1[_i];\n if (trackerCollection.hasOwnProperty(id)) {\n trackers.push(trackerCollection[id]);\n }\n else {\n LOG.warn(id + ' not configured');\n }\n }\n return trackers;\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * A set of variables which are shared among all initialised trackers\n */\nvar SharedState = /** @class */ (function () {\n function SharedState() {\n /* List of request queues - one per Tracker instance */\n this.outQueues = [];\n this.bufferFlushers = [];\n /* DOM Ready */\n this.hasLoaded = false;\n this.registeredOnLoadHandlers = [];\n }\n return SharedState;\n}());\nfunction createSharedState() {\n var sharedState = new SharedState(), documentAlias = document, windowAlias = window;\n /*\n * Handle page visibility event\n * Works everywhere except IE9\n */\n function visibilityChangeHandler() {\n if (documentAlias.visibilityState == 'hidden') {\n // Flush all POST queues\n sharedState.bufferFlushers.forEach(function (flusher) {\n flusher(false);\n });\n }\n }\n function flushBuffers() {\n // Flush all POST queues\n sharedState.bufferFlushers.forEach(function (flusher) {\n flusher(false);\n });\n }\n /*\n * Handler for onload event\n */\n function loadHandler() {\n var i;\n if (!sharedState.hasLoaded) {\n sharedState.hasLoaded = true;\n for (i = 0; i < sharedState.registeredOnLoadHandlers.length; i++) {\n sharedState.registeredOnLoadHandlers[i]();\n }\n }\n return true;\n }\n /*\n * Add onload or DOM ready handler\n */\n function addReadyListener() {\n if (documentAlias.addEventListener) {\n documentAlias.addEventListener('DOMContentLoaded', function ready() {\n documentAlias.removeEventListener('DOMContentLoaded', ready, false);\n loadHandler();\n });\n }\n else if (documentAlias.attachEvent) {\n documentAlias.attachEvent('onreadystatechange', function ready() {\n if (documentAlias.readyState === 'complete') {\n documentAlias.detachEvent('onreadystatechange', ready);\n loadHandler();\n }\n });\n }\n // fallback\n addEventListener(windowAlias, 'load', loadHandler, false);\n }\n /************************************************************\n * Constructor\n ************************************************************/\n // initialize the Snowplow singleton\n if (documentAlias.visibilityState) {\n // Flush for mobile and modern browsers\n addEventListener(documentAlias, 'visibilitychange', visibilityChangeHandler, false);\n }\n // Last attempt at flushing in beforeunload\n addEventListener(windowAlias, 'beforeunload', flushBuffers, false);\n if (document.readyState === 'loading') {\n addReadyListener();\n }\n else {\n loadHandler();\n }\n return sharedState;\n}\n\nexport { SharedState, addEventListener, addTracker, allTrackerNames, allTrackers, attemptDeleteLocalStorage, attemptGetLocalStorage, attemptGetSessionStorage, attemptWriteLocalStorage, attemptWriteSessionStorage, cookie, createCrossDomainParameterValue, createSharedState, decorateQuerystring, deleteCookie, dispatchToTrackers, dispatchToTrackersInCollection, findRootDomain, fixupDomain, fixupTitle, fixupUrl, fromQuerystring, getCookiesWithPrefix, getCssClasses, getFilterByClass, getFilterByName, getHostName, getReferrer, getTracker, getTrackers, hasLocalStorage, hasSessionStorage, isFunction, isInteger, isString, isValueInArray, localStorageAccessible, parseAndValidateFloat, parseAndValidateInt, trackerExists, urlSafeBase64Encode };\n//# sourceMappingURL=index.module.js.map\n","/*!\n * Browser tracker for Snowplow v3.24.6 (http://bit.ly/sp-js)\n * Copyright 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * Licensed under BSD-3-Clause\n */\n\nimport { dispatchToTrackers, createSharedState, addTracker } from '@snowplow/browser-tracker-core';\nimport { buildStructEvent, buildSelfDescribingEvent, version } from '@snowplow/tracker-core';\nexport { version } from '@snowplow/tracker-core';\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n/**\n * Expires current session and starts a new session.\n *\n * @param trackers - The tracker identifiers which will have their session refreshed\n */\nfunction newSession(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.newSession();\n });\n}\n/**\n * Override referrer\n *\n * @param url - Custom Referrer which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setReferrerUrl(url, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setReferrerUrl(url);\n });\n}\n/**\n * Override url\n *\n * @param url - Custom URL which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCustomUrl(url, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCustomUrl(url);\n });\n}\n/**\n * Override document.title\n *\n * @param title - Document title which will be used as override\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setDocumentTitle(title, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setDocumentTitle(title);\n });\n}\n/**\n * Strip hash tag (or anchor) from URL\n *\n * @param enable - Whether to enable stripping of hash\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction discardHashTag(enable, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.discardHashTag(enable);\n });\n}\n/**\n * Strip braces from URL\n *\n * @param enable - Whther to enable stripping of braces\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction discardBrace(enable, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.discardBrace(enable);\n });\n}\n/**\n * Set first-party cookie path\n *\n * @param path - The path which will be used when setting cookies\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCookiePath(path, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCookiePath(path);\n });\n}\n/**\n * Set visitor cookie timeout (in seconds)\n *\n * @param timeout - The timeout until cookies will expire\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setVisitorCookieTimeout(timeout, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setVisitorCookieTimeout(timeout);\n });\n}\n/**\n * Enable querystring decoration for links passing a filter\n *\n * @param crossDomainLinker - Function used to determine which links to decorate\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction crossDomainLinker(crossDomainLinkerCriterion, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.crossDomainLinker(crossDomainLinkerCriterion);\n });\n}\n/**\n * Enables page activity tracking (sends page pings to the Collector regularly).\n *\n * @param configuration - The activity tracking configuration\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction enableActivityTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableActivityTracking(configuration);\n });\n}\n/**\n * Enables page activity tracking (replaces collector ping with callback).\n *\n * @param configuration - The activity tracking callback configuration\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction enableActivityTrackingCallback(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableActivityTrackingCallback(configuration);\n });\n}\n/**\n * Disables page activity tracking.\n *\n * @param trackers - The tracker identifiers the activity tracking will be disabled.\n */\nfunction disableActivityTracking(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.disableActivityTracking();\n });\n}\n/**\n * Disables page activity tracking callback.\n *\n * @param trackers - The tracker identifiers the activity tracking callback will be disabled.\n */\nfunction disableActivityTrackingCallback(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.disableActivityTrackingCallback();\n });\n}\n/**\n * Triggers the activityHandler manually to allow external user defined activity. i.e. While watching a video\n *\n * @param trackers - The tracker identifiers which will be updated\n */\nfunction updatePageActivity(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.updatePageActivity();\n });\n}\n/**\n * Sets the opt out cookie.\n *\n * @param name - of the opt out cookie\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setOptOutCookie(name, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setOptOutCookie(name);\n });\n}\n/**\n * Set the business-defined user ID for this user.\n *\n * @param userId - The business-defined user ID\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserId(userId, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserId(userId);\n });\n}\n/**\n * Set the business-defined user ID for this user using the location querystring.\n *\n * @param querystringField - Name of a querystring name-value pair\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromLocation(querystringField, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromLocation(querystringField);\n });\n}\n/**\n * Set the business-defined user ID for this user using the referrer querystring.\n *\n * @param querystringField - Name of a querystring name-value pair\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromReferrer(querystringField, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromReferrer(querystringField);\n });\n}\n/**\n * Set the business-defined user ID for this user to the value of a cookie.\n *\n * @param cookieName - Name of the cookie whose value will be assigned to businessUserId\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setUserIdFromCookie(cookieName, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setUserIdFromCookie(cookieName);\n });\n}\n/**\n * Specify the Snowplow collector URL. Specific http or https to force it\n * or leave it off to match the website protocol.\n *\n * @param collectorUrl - The collector URL, with or without protocol\n * @param trackers - The tracker identifiers which will be configured\n */\nfunction setCollectorUrl(collectorUrl, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setCollectorUrl(collectorUrl);\n });\n}\n/**\n * Set the buffer size\n * Can be useful if you want to stop batching requests to ensure events start\n * sending closer to event creation\n *\n * @param newBufferSize - The value with which to update the bufferSize to\n * @param trackers - The tracker identifiers which will be flushed\n */\nfunction setBufferSize(newBufferSize, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.setBufferSize(newBufferSize);\n });\n}\n/**\n * Send all events in the outQueue\n * Only need to use this when sending events with a bufferSize of at least 2\n *\n * @param configuration - The configuration to use following flushing the buffer\n * @param trackers - The tracker identifiers which will be flushed\n */\nfunction flushBuffer(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.flushBuffer(configuration);\n });\n}\n/**\n * Track a visit to a web page\n *\n * @param event - The Page View Event properties\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackPageView(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.trackPageView(event);\n });\n}\n/**\n * Track a structured event\n * A classic style of event tracking, allows for easier movement between analytics\n * systems. A loosely typed event, creating a Self Describing event is preferred, but\n * useful for interoperability.\n *\n * @param event - The Structured Event properties\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackStructEvent(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.track(buildStructEvent(event), event.context, event.timestamp);\n });\n}\n/**\n * Track a self-describing event happening on this page.\n * A custom event type, allowing for an event to be tracked using your own custom schema\n * and a data object which conforms to the supplied schema\n *\n * @param event - The event information\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction trackSelfDescribingEvent(event, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.track(buildSelfDescribingEvent({ event: event.event }), event.context, event.timestamp);\n });\n}\n/**\n * All provided contexts will be sent with every event\n *\n * @param contexts - An array of contexts or conditional contexts\n * @param trackers - The tracker identifiers which the global contexts will be added to\n */\nfunction addGlobalContexts(contexts, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.addGlobalContexts(contexts);\n });\n}\n/**\n * All provided contexts will no longer be sent with every event\n *\n * @param contexts - An array of contexts or conditional contexts\n * @param trackers - The tracker identifiers which the global contexts will be remove from\n */\nfunction removeGlobalContexts(contexts, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.removeGlobalContexts(contexts);\n });\n}\n/**\n * Clear all global contexts that are sent with events\n *\n * @param trackers - The tracker identifiers which the global contexts will be cleared from\n */\nfunction clearGlobalContexts(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.core.clearGlobalContexts();\n });\n}\n/**\n * Stop regenerating `pageViewId` (available from `web_page` context)\n *\n * @param trackers - The tracker identifiers which the event will preserve their Page View Ids\n */\nfunction preservePageViewId(trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.preservePageViewId();\n });\n}\n/**\n * Disables anonymous tracking if active (ie. tracker initialized with `anonymousTracking`)\n * For stateStorageStrategy override, uses supplied value first,\n * falls back to one defined in initial config, otherwise uses cookieAndLocalStorage.\n *\n * @param configuration - The configuration for disabling anonymous tracking\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction disableAnonymousTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.disableAnonymousTracking(configuration);\n });\n}\n/**\n * Enables anonymous tracking (ie. tracker initialized without `anonymousTracking`)\n *\n * @param configuration - The configuration for enabling anonymous tracking\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction enableAnonymousTracking(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.enableAnonymousTracking(configuration);\n });\n}\n/**\n * Clears all cookies and local storage containing user and session identifiers\n *\n * @param trackers - The tracker identifiers which the event will be sent to\n */\nfunction clearUserData(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.clearUserData(configuration);\n });\n}\n/**\n * Add a plugin into the plugin collection after trackers have already been initialised\n *\n * @param configuration - The plugin to add\n * @param trackers - The tracker identifiers which the plugin will be added to\n */\nfunction addPlugin(configuration, trackers) {\n dispatchToTrackers(trackers, function (t) {\n t.addPlugin(configuration);\n });\n}\n\n/*\n * Copyright (c) 2022 Snowplow Analytics Ltd, 2010 Anthon Pang\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of the copyright holder nor the names of its\n * contributors may be used to endorse or promote products derived from\n * this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\nvar state = typeof window !== 'undefined' ? createSharedState() : undefined;\n/**\n * Initialise a new tracker\n *\n * @param trackerId - The tracker id - also known as tracker namespace\n * @param endpoint - Collector endpoint in the form collector.mysite.com\n * @param configuration - The initialisation options of the tracker\n */\nfunction newTracker(trackerId, endpoint, configuration) {\n if (configuration === void 0) { configuration = {}; }\n if (state) {\n return addTracker(trackerId, trackerId, \"js-\".concat(version), endpoint, state, configuration);\n }\n else {\n return undefined;\n }\n}\n\nexport { addGlobalContexts, addPlugin, clearGlobalContexts, clearUserData, crossDomainLinker, disableActivityTracking, disableActivityTrackingCallback, disableAnonymousTracking, discardBrace, discardHashTag, enableActivityTracking, enableActivityTrackingCallback, enableAnonymousTracking, flushBuffer, newSession, newTracker, preservePageViewId, removeGlobalContexts, setBufferSize, setCollectorUrl, setCookiePath, setCustomUrl, setDocumentTitle, setOptOutCookie, setReferrerUrl, setUserId, setUserIdFromCookie, setUserIdFromLocation, setUserIdFromReferrer, setVisitorCookieTimeout, trackPageView, trackSelfDescribingEvent, trackStructEvent, updatePageActivity };\n//# sourceMappingURL=index.module.js.map\n","import { getEnvironment, Environment } from \"../../../../fe-utils/src/environment/index\";\nimport { getPlatform, Platform } from \"../../../../fe-utils/src/platform/index\";\nconst prodCollectorUrl = 'https://rtcollector.goeuro.com';\nconst qaCollectorUrl = 'https://www.omio.com.qa.goeuro.ninja/snowplow-collector';\nconst getCollectorUrl = () => {\n const environment = getEnvironment();\n const isTestDomain = typeof window !== 'undefined' && (window.location?.hostname || '').endsWith('omio.ro');\n if (environment === Environment.PROD && isTestDomain && window.location.origin) {\n return `${window.location.origin}/snowplow-collector`;\n }\n if (environment === Environment.QA || environment === Environment.DEV) {\n // For local web development, we should point to the origin \"localhost:3000/snowplow-collector\"\n // so it can be handled by the api proxy\n if (environment === Environment.DEV && getPlatform() === Platform.Web) {\n return typeof window !== 'undefined' ? `${window.location.origin}/snowplow-collector` : qaCollectorUrl;\n }\n return qaCollectorUrl;\n }\n return prodCollectorUrl;\n};\nconst config = {\n trackerName: 'omio-tracker',\n collectorUri: getCollectorUrl(),\n nativeOptions: {\n trackerConfig: {\n appId: 'omio',\n devicePlatform: 'app',\n screenViewAutotracking: true,\n lifecycleAutotracking: true,\n base64Encoding: false,\n isPersistentSession: false\n }\n },\n webOptions: {\n appId: 'omio-web',\n // TODO temporary appId. Change to \"omio\" when remove itly tracker\n maxLocalStorageQueueSize: 100,\n contexts: {\n webPage: true,\n session: true\n }\n }\n};\nexport default config;","import { addGlobalContexts, enableActivityTracking, newTracker, setUserId, trackPageView, trackSelfDescribingEvent } from \"@snowplow/browser-tracker\";\nimport getClientId from \"../../../../fe-utils/src/getClientId/getClientId\";\nimport config from \"./TrackerConfig\";\nexport const TRACKING_INSTANCE_KEY = 'webtracker';\nexport class TrackerWeb {\n hasWasabiContexts = false;\n wasabiContexts = [];\n addons = {};\n constructor() {\n newTracker(config.trackerName, config.collectorUri, config.webOptions);\n enableActivityTracking({\n minimumVisitLength: 30,\n heartbeatDelay: 60\n });\n }\n setupUserId() {\n setUserId(getClientId());\n }\n trackPageView() {\n trackPageView(undefined, [config.trackerName]);\n }\n trackEvent(event, contexts) {\n try {\n trackSelfDescribingEvent({\n event,\n context: contexts\n }, [config.trackerName]);\n } catch (e) {\n console.error('Error tracking event', e);\n }\n }\n addAddon(name, func) {\n this.addons[name] = func(this);\n }\n initializeWasabiContexts(wasabiContexts) {\n if (this.hasWasabiContexts) {\n console.error('[Experiments] Wasabi contexts were already initialized! It should happen only once on app startup. Returning without editing the wasabi contexts...');\n return;\n }\n addGlobalContexts(wasabiContexts);\n this.hasWasabiContexts = true;\n this.wasabiContexts = wasabiContexts;\n }\n}","import trackWebVitalMetric from \"./addons/ui-platform/coreWebVitals\";\nimport trackerNoop from \"./noopTracker\";\nimport { TrackerWeb, TRACKING_INSTANCE_KEY } from \"./TrackerWeb\";\nconst canUseWindow = !!(typeof window !== 'undefined');\nconst createTracker = () => {\n // disabling tracking for google safeframes\n if (!canUseWindow || (window.location?.hostname || '').includes('googlesyndication.com')) {\n return trackerNoop;\n }\n // making the tracker available across the whole browser window, so other repos that run on top of monorepo can share same tracker\n const tracker = window[TRACKING_INSTANCE_KEY] ?? new TrackerWeb();\n tracker.setupUserId();\n if (!window[TRACKING_INSTANCE_KEY]) window[TRACKING_INSTANCE_KEY] = tracker;\n if (typeof window[TRACKING_INSTANCE_KEY]?.addAddon === 'function') {\n // [DEPRECATED] THIS ADDON IS BEING CALLED FROM A GTM SCRIPT CALLED \"[Site Speed] Snowplow Core Web Vitals\"\n window[TRACKING_INSTANCE_KEY].addAddon('trackWebVitalMetric', trackWebVitalMetric);\n } else {\n console.warn('[Tracking-provider] Warning! Tracker Addons unavailable, consider updating the code that initializes TrackerWeb');\n }\n return tracker;\n};\nexport default createTracker();","export const mergeContexts = (parentContexts, newContexts) => {\n const filteredContexts = parentContexts.filter(existingContext => newContexts.find(newContext => newContext.name === existingContext.name) === undefined);\n return [...filteredContexts, ...newContexts.filter(context => !!context.name)];\n};","import React, { useContext } from \"react\";\nimport { isEqual } from \"lodash\";\nimport { getPlatform, Platform } from \"../../../fe-utils/src/platform/index\";\nimport { BaseTrackingContext } from \"../cms/lib/BaseTrackingContext\";\nimport { mergeContexts } from \"../utils/mergeContexts\";\nconst buildWebViewContexts = () => {\n const jsonContexts = window?.ReactNativeWebView?.storeContexts ?? [];\n return jsonContexts.map(context => new BaseTrackingContext(context.name, context.schema, context.properties));\n};\nexport let storedTrackingContexts = getPlatform() === Platform.WebView ? buildWebViewContexts() : [];\nconst webViewPushContextsCall = contexts => {\n window.ReactNativeWebView?.postMessage(JSON.stringify({\n action: 'pushContexts',\n contexts\n }));\n};\nexport const pushContexts = newContexts => {\n const contextsToAdd = newContexts.filter(newContext => {\n const existingContext = storedTrackingContexts.find(({\n name\n }) => name === newContext.name);\n return !isEqual(existingContext, newContext);\n });\n if (!contextsToAdd.length) return;\n const updatedContexts = mergeContexts(storedTrackingContexts, contextsToAdd);\n storedTrackingContexts = updatedContexts;\n};\nexport const TrackingContextStoreContext = /*#__PURE__*/React.createContext({\n isInitialized: false\n});\nexport const TrackingContextsStore = ({\n children\n}) => /*#__PURE__*/React.createElement(TrackingContextStoreContext.Provider, {\n value: {\n isInitialized: true\n }\n}, children);\nexport const usePushContexts = () => {\n const {\n isInitialized\n } = useContext(TrackingContextStoreContext);\n if (!isInitialized) return () => {};\n return contexts => {\n if (getPlatform() === Platform.WebView) webViewPushContextsCall(contexts);\n pushContexts(contexts);\n };\n};","import React, { useCallback, useContext, useMemo, useRef } from \"react\";\nimport tracker from \"./PoC/webTracker\";\nimport { mergeContexts } from \"../utils/mergeContexts\";\nimport { storedTrackingContexts } from \"./TrackingContextsStore\";\nexport const TrackingContext = /*#__PURE__*/React.createContext({\n contexts: []\n});\nexport const TrackingProvider = ({\n contexts: newContexts,\n children\n}) => {\n const {\n contexts: parentContexts\n } = useContext(TrackingContext);\n const contexts = useMemo(() => {\n if (!newContexts?.length) return {\n contexts: parentContexts\n };\n return {\n contexts: mergeContexts(parentContexts, newContexts)\n };\n }, [newContexts, parentContexts]);\n return /*#__PURE__*/React.createElement(TrackingContext.Provider, {\n value: contexts\n }, children);\n};\nexport const useTracking = event => {\n const {\n contexts: localContexts\n } = useContext(TrackingContext);\n const contexts = mergeContexts(storedTrackingContexts, localContexts);\n const contextRef = useRef(contexts);\n contextRef.current = contexts;\n const eventRef = useRef(event);\n eventRef.current = event;\n return useCallback((properties, frames) => {\n const eventProperties = typeof properties === 'function' ? properties() : properties;\n const framesArray = Object.values(frames ?? {});\n const contextsAndFrames = framesArray?.length ? mergeContexts(contextRef.current, framesArray) : contextRef.current;\n eventRef.current.send(eventProperties, contextsAndFrames, tracker);\n }, []);\n};\nexport const useIsContextAvailable = contextName => {\n const {\n contexts: localContexts\n } = useContext(TrackingContext);\n const contexts = mergeContexts(storedTrackingContexts, localContexts);\n const isContextAvailable = useMemo(() => contexts.some(({\n name\n }) => name === contextName), [contextName, contexts]);\n return isContextAvailable;\n};\nexport const useGetContexts = () => {\n const {\n contexts\n } = useContext(TrackingContext);\n return () => mergeContexts(storedTrackingContexts, contexts);\n};","export let Env = /*#__PURE__*/function (Env) {\n Env[\"DEV\"] = \"dev\";\n Env[\"QA\"] = \"qa\";\n Env[\"PROD\"] = \"prod\";\n return Env;\n}({});","import { Env } from \"./types\";\nexport const getEnv = () => {\n try {\n const {\n hostname\n } = window.location;\n const isQA = hostname.indexOf('.ninja') > -1;\n const isProd = !isQA && (hostname.indexOf('goeuro.') > -1 || hostname.indexOf('omio.') > -1);\n if (isQA) return Env.QA;\n if (isProd) return Env.PROD;\n return Env.DEV;\n } catch (e) {\n return Env.DEV;\n }\n};","import axios from \"../../../../fe-utils/src/axios/index\";\nimport { platform } from \"../platform\";\nimport { getEnv, Env } from \"../env\";\nexport const sendData = (loggerClient, loggerUrl) => data => {\n if (getEnv() === Env.DEV) {\n console.log('Logger:', data);\n return;\n }\n const payload = {\n log_level: data.level,\n client: loggerClient,\n // there was some issue with using `message`, sometimes those items don't appear,\n // or there is some \"Conflicting field\" error there,\n // `short_message` is an arbitrary prop name, there is no req for it to be exactly that name,\n // but other repos use `short_message`\n short_message: data.message,\n platform,\n ...(data.payload ? {\n extra: data.payload\n } : null)\n };\n const navigatorObj = navigator;\n const connection = navigatorObj.connection || navigatorObj.mozConnection || navigatorObj.webkitConnection;\n if (connection) {\n if (connection.type) {\n payload.connection_Type_s = connection.type;\n }\n if (connection.effectiveType) {\n payload.connection_EffectiveType_s = connection.effectiveType;\n }\n }\n if (platform !== 'RN') {\n payload.url = window.location.href;\n payload.facility = getEnv();\n }\n axios.post(loggerUrl, payload, {\n headers: {\n 'Content-Type': 'application/json'\n }\n }).catch(error => {\n console.warn('Logger error', error);\n });\n};","var map = {\n\t\"./bg\": [\n\t\t15300,\n\t\t15300\n\t],\n\t\"./bg.json\": [\n\t\t15300,\n\t\t15300\n\t],\n\t\"./ca\": [\n\t\t88601,\n\t\t88601\n\t],\n\t\"./ca.json\": [\n\t\t88601,\n\t\t88601\n\t],\n\t\"./cs\": [\n\t\t93370,\n\t\t93370\n\t],\n\t\"./cs.json\": [\n\t\t93370,\n\t\t93370\n\t],\n\t\"./da\": [\n\t\t6216,\n\t\t6216\n\t],\n\t\"./da.json\": [\n\t\t6216,\n\t\t6216\n\t],\n\t\"./de\": [\n\t\t84666,\n\t\t84666\n\t],\n\t\"./de.json\": [\n\t\t84666,\n\t\t84666\n\t],\n\t\"./el\": [\n\t\t21545,\n\t\t21545\n\t],\n\t\"./el.json\": [\n\t\t21545,\n\t\t21545\n\t],\n\t\"./en\": [\n\t\t62572,\n\t\t62572\n\t],\n\t\"./en-GB\": [\n\t\t51282,\n\t\t51282\n\t],\n\t\"./en-GB.json\": [\n\t\t51282,\n\t\t51282\n\t],\n\t\"./en-US\": [\n\t\t94998,\n\t\t94998\n\t],\n\t\"./en-US.json\": [\n\t\t94998,\n\t\t94998\n\t],\n\t\"./en.json\": [\n\t\t62572,\n\t\t62572\n\t],\n\t\"./es\": [\n\t\t9785,\n\t\t9785\n\t],\n\t\"./es.json\": [\n\t\t9785,\n\t\t9785\n\t],\n\t\"./fi\": [\n\t\t54433,\n\t\t54433\n\t],\n\t\"./fi.json\": [\n\t\t54433,\n\t\t54433\n\t],\n\t\"./fr\": [\n\t\t71460,\n\t\t71460\n\t],\n\t\"./fr.json\": [\n\t\t71460,\n\t\t71460\n\t],\n\t\"./hr\": [\n\t\t58514,\n\t\t58514\n\t],\n\t\"./hr.json\": [\n\t\t58514,\n\t\t58514\n\t],\n\t\"./hu\": [\n\t\t45102,\n\t\t45102\n\t],\n\t\"./hu.json\": [\n\t\t45102,\n\t\t45102\n\t],\n\t\"./id\": [\n\t\t37198,\n\t\t37198\n\t],\n\t\"./id.json\": [\n\t\t37198,\n\t\t37198\n\t],\n\t\"./it\": [\n\t\t58512,\n\t\t58512\n\t],\n\t\"./it.json\": [\n\t\t58512,\n\t\t58512\n\t],\n\t\"./ja\": [\n\t\t66310,\n\t\t66310\n\t],\n\t\"./ja.json\": [\n\t\t66310,\n\t\t66310\n\t],\n\t\"./km\": [\n\t\t99916,\n\t\t99916\n\t],\n\t\"./km.json\": [\n\t\t99916,\n\t\t99916\n\t],\n\t\"./ko\": [\n\t\t19843,\n\t\t19843\n\t],\n\t\"./ko.json\": [\n\t\t19843,\n\t\t19843\n\t],\n\t\"./ms\": [\n\t\t13305,\n\t\t13305\n\t],\n\t\"./ms.json\": [\n\t\t13305,\n\t\t13305\n\t],\n\t\"./nb\": [\n\t\t94614,\n\t\t94614\n\t],\n\t\"./nb.json\": [\n\t\t94614,\n\t\t94614\n\t],\n\t\"./nl\": [\n\t\t90801,\n\t\t90801\n\t],\n\t\"./nl.json\": [\n\t\t90801,\n\t\t90801\n\t],\n\t\"./pl\": [\n\t\t76801,\n\t\t76801\n\t],\n\t\"./pl.json\": [\n\t\t76801,\n\t\t76801\n\t],\n\t\"./pt\": [\n\t\t60518,\n\t\t60518\n\t],\n\t\"./pt-BR\": [\n\t\t94705,\n\t\t94705\n\t],\n\t\"./pt-BR.json\": [\n\t\t94705,\n\t\t94705\n\t],\n\t\"./pt.json\": [\n\t\t60518,\n\t\t60518\n\t],\n\t\"./ro\": [\n\t\t29599,\n\t\t29599\n\t],\n\t\"./ro.json\": [\n\t\t29599,\n\t\t29599\n\t],\n\t\"./ru\": [\n\t\t20433,\n\t\t20433\n\t],\n\t\"./ru.json\": [\n\t\t20433,\n\t\t20433\n\t],\n\t\"./sv\": [\n\t\t46448,\n\t\t46448\n\t],\n\t\"./sv.json\": [\n\t\t46448,\n\t\t46448\n\t],\n\t\"./th\": [\n\t\t21180,\n\t\t21180\n\t],\n\t\"./th.json\": [\n\t\t21180,\n\t\t21180\n\t],\n\t\"./tr\": [\n\t\t4229,\n\t\t4229\n\t],\n\t\"./tr.json\": [\n\t\t4229,\n\t\t4229\n\t],\n\t\"./uk\": [\n\t\t34151,\n\t\t34151\n\t],\n\t\"./uk.json\": [\n\t\t34151,\n\t\t34151\n\t],\n\t\"./vi\": [\n\t\t85333,\n\t\t85333\n\t],\n\t\"./vi.json\": [\n\t\t85333,\n\t\t85333\n\t],\n\t\"./zh\": [\n\t\t31706,\n\t\t31706\n\t],\n\t\"./zh-TW\": [\n\t\t34632,\n\t\t34632\n\t],\n\t\"./zh-TW.json\": [\n\t\t34632,\n\t\t34632\n\t],\n\t\"./zh.json\": [\n\t\t31706,\n\t\t31706\n\t]\n};\nfunction webpackAsyncContext(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\treturn Promise.resolve().then(function() {\n\t\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\t\te.code = 'MODULE_NOT_FOUND';\n\t\t\tthrow e;\n\t\t});\n\t}\n\n\tvar ids = map[req], id = ids[0];\n\treturn __webpack_require__.e(ids[1]).then(function() {\n\t\treturn __webpack_require__.t(id, 3 | 16);\n\t});\n}\nwebpackAsyncContext.keys = function() { return Object.keys(map); };\nwebpackAsyncContext.id = 51485;\nmodule.exports = webpackAsyncContext;","module.exports = require('./lib/axios');","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar cookies = require('./../helpers/cookies');\nvar buildURL = require('./../helpers/buildURL');\nvar buildFullPath = require('../core/buildFullPath');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n if (\n (utils.isBlob(requestData) || utils.isFile(requestData)) &&\n requestData.type\n ) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = unescape(encodeURIComponent(config.auth.password)) || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n var fullPath = buildFullPath(config.baseURL, config.url);\n request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';\n if (config.timeoutErrorMessage) {\n timeoutErrorMessage = config.timeoutErrorMessage;\n }\n reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(config.withCredentials)) {\n request.withCredentials = !!config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (!requestData) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n // Set config.method\n if (config.method) {\n config.method = config.method.toLowerCase();\n } else if (this.defaults.method) {\n config.method = this.defaults.method.toLowerCase();\n } else {\n config.method = 'get';\n }\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","'use strict';\n\nvar isAbsoluteURL = require('../helpers/isAbsoluteURL');\nvar combineURLs = require('../helpers/combineURLs');\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n * @returns {string} The combined full path\n */\nmodule.exports = function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n};\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n","'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n var valueFromConfig2Keys = ['url', 'method', 'data'];\n var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy', 'params'];\n var defaultToConfig2Keys = [\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'timeoutMessage', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'decompress',\n 'maxContentLength', 'maxBodyLength', 'maxRedirects', 'transport', 'httpAgent',\n 'httpsAgent', 'cancelToken', 'socketPath', 'responseEncoding'\n ];\n var directMergeKeys = ['validateStatus'];\n\n function getMergedValue(target, source) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge(target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n function mergeDeepProperties(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n }\n\n utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n }\n });\n\n utils.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);\n\n utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {\n if (!utils.isUndefined(config2[prop])) {\n config[prop] = getMergedValue(undefined, config2[prop]);\n } else if (!utils.isUndefined(config1[prop])) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n utils.forEach(directMergeKeys, function merge(prop) {\n if (prop in config2) {\n config[prop] = getMergedValue(config1[prop], config2[prop]);\n } else if (prop in config1) {\n config[prop] = getMergedValue(undefined, config1[prop]);\n }\n });\n\n var axiosKeys = valueFromConfig2Keys\n .concat(mergeDeepPropertiesKeys)\n .concat(defaultToConfig2Keys)\n .concat(directMergeKeys);\n\n var otherKeys = Object\n .keys(config1)\n .concat(Object.keys(config2))\n .filter(function filterAxiosKeys(key) {\n return axiosKeys.indexOf(key) === -1;\n });\n\n utils.forEach(otherKeys, mergeDeepProperties);\n\n return config;\n};\n","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","'use strict';\n\nvar bind = require('./helpers/bind');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {Object} val The value to test\n * @return {boolean} True if value is a plain Object, otherwise false\n */\nfunction isPlainObject(val) {\n if (toString.call(val) !== '[object Object]') {\n return false;\n }\n\n var prototype = Object.getPrototypeOf(val);\n return prototype === null || prototype === Object.prototype;\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (isPlainObject(result[key]) && isPlainObject(val)) {\n result[key] = merge(result[key], val);\n } else if (isPlainObject(val)) {\n result[key] = merge({}, val);\n } else if (isArray(val)) {\n result[key] = val.slice();\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n * @return {string} content value without BOM\n */\nfunction stripBOM(content) {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim,\n stripBOM: stripBOM\n};\n","export const translate = ({ id, intl, ...rest }) => {\n if (typeof id !== 'string' || !id) return '';\n\n /**\n * No curly brackets -> the string is not a key, just return it.\n */\n if (!id.includes('{') && !id.includes('}')) {\n return id;\n }\n\n const regex = /{([^}]+)}/g;\n\n /**\n * someString.matchAll(/regex/) extracts all the translation keys from that string.\n *\n * For the string `whitelabel {searchbar.month0} omio {ferret.placeholder.to} aaa {FOOTER.PRIVACY} bbb`,\n * the match result will be an array of arrays with the following structure:\n *\n * [\n * [\"{searchbar.month0}\", \"searchbar.month0\"],\n * [\"{FOOTER.PRIVACY}\", \"FOOTER.PRIVACY\"],\n * [\"{ferret.placeholder.to}\", \"ferret.placeholder.to\"]\n * ]\n *\n * Each internal array has two elements: the key surrounded by curly brackets (used for search & replace)\n * and the same key without them (the actual value).\n *\n *\n * matchAll() function returns an iterator and thus need to be converted into array\n */\n return [...id.matchAll(regex)].reduce(\n (acc, [curlyTemplate, actualValue]) =>\n acc.replace(\n curlyTemplate,\n // setting defaultMessage to one whitespace to avoid splashing\n // when you first see the translation key for a fraction of second\n intl.formatMessage({ id: actualValue, defaultMessage: ' ', ...rest })\n ),\n id\n );\n};\n","export const updateSearchQuery = (key, value) => {\n const searchParams = new URLSearchParams(window.location.search);\n\n // if there were no query params before - don't add them, except `locale`\n // locale is important for determing in which language send emails from user-profile\n if (key !== 'locale' && !searchParams.has(key)) return;\n\n // if we started with a link to a specific locale like doggio.space?locale=cs¤cy=CZK, then we need to update the query\n searchParams.set(key, value);\n\n const newRelativePathQuery = `${\n window.location.pathname\n }?${searchParams.toString()}`;\n history.replaceState(null, '', newRelativePathQuery);\n};\n\nexport const withField = (variable, fieldName) => {\n window.localStorage.setItem(fieldName, variable);\n updateSearchQuery(fieldName, variable);\n};\n\nexport const prepareLinkTo = (to, locale) => {\n return `${to}?locale=${locale}`;\n};\n\n/**\n * Validates query parameter and returns fallback if the value is not allowed.\n * @param input The value of the parameter provided by the user.\n * @param collection The set with all the possible values of the parameter.\n * @param fallback Value to return if the parameter is invalid.\n * @returns {string} Input or fallback.\n */\nexport const validateParam = (input, collection, fallback) => {\n if (\n input &&\n !collection.map(c => c.toLowerCase()).includes(input.toLowerCase())\n )\n return fallback;\n\n return input;\n};\n","'use strict'\n\nmodule.exports = bail\n\nfunction bail(err) {\n if (err) {\n throw err\n }\n}\n","var charenc = {\n // UTF-8 encoding\n utf8: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));\n }\n },\n\n // Binary encoding\n bin: {\n // Convert a string to a byte array\n stringToBytes: function(str) {\n for (var bytes = [], i = 0; i < str.length; i++)\n bytes.push(str.charCodeAt(i) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a string\n bytesToString: function(bytes) {\n for (var str = [], i = 0; i < bytes.length; i++)\n str.push(String.fromCharCode(bytes[i]));\n return str.join('');\n }\n }\n};\n\nmodule.exports = charenc;\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(this && this[arg] || arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(this, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(this && this[key] || key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","'use strict'\n\nmodule.exports = collapse\n\n// `collapse(' \\t\\nbar \\nbaz\\t') // ' bar baz '`\nfunction collapse(value) {\n return String(value).replace(/\\s+/g, ' ')\n}\n","(function() {\n var base64map\n = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\n crypt = {\n // Bit-wise rotation left\n rotl: function(n, b) {\n return (n << b) | (n >>> (32 - b));\n },\n\n // Bit-wise rotation right\n rotr: function(n, b) {\n return (n << (32 - b)) | (n >>> b);\n },\n\n // Swap big-endian to little-endian and vice versa\n endian: function(n) {\n // If number given, swap endian\n if (n.constructor == Number) {\n return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;\n }\n\n // Else, assume array and swap all items\n for (var i = 0; i < n.length; i++)\n n[i] = crypt.endian(n[i]);\n return n;\n },\n\n // Generate an array of any length of random bytes\n randomBytes: function(n) {\n for (var bytes = []; n > 0; n--)\n bytes.push(Math.floor(Math.random() * 256));\n return bytes;\n },\n\n // Convert a byte array to big-endian 32-bit words\n bytesToWords: function(bytes) {\n for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)\n words[b >>> 5] |= bytes[i] << (24 - b % 32);\n return words;\n },\n\n // Convert big-endian 32-bit words to a byte array\n wordsToBytes: function(words) {\n for (var bytes = [], b = 0; b < words.length * 32; b += 8)\n bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);\n return bytes;\n },\n\n // Convert a byte array to a hex string\n bytesToHex: function(bytes) {\n for (var hex = [], i = 0; i < bytes.length; i++) {\n hex.push((bytes[i] >>> 4).toString(16));\n hex.push((bytes[i] & 0xF).toString(16));\n }\n return hex.join('');\n },\n\n // Convert a hex string to a byte array\n hexToBytes: function(hex) {\n for (var bytes = [], c = 0; c < hex.length; c += 2)\n bytes.push(parseInt(hex.substr(c, 2), 16));\n return bytes;\n },\n\n // Convert a byte array to a base-64 string\n bytesToBase64: function(bytes) {\n for (var base64 = [], i = 0; i < bytes.length; i += 3) {\n var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];\n for (var j = 0; j < 4; j++)\n if (i * 8 + j * 6 <= bytes.length * 8)\n base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));\n else\n base64.push('=');\n }\n return base64.join('');\n },\n\n // Convert a base-64 string to a byte array\n base64ToBytes: function(base64) {\n // Remove non-base-64 characters\n base64 = base64.replace(/[^A-Z0-9+\\/]/ig, '');\n\n for (var bytes = [], i = 0, imod4 = 0; i < base64.length;\n imod4 = ++i % 4) {\n if (imod4 == 0) continue;\n bytes.push(((base64map.indexOf(base64.charAt(i - 1))\n & (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))\n | (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));\n }\n return bytes;\n }\n };\n\n module.exports = crypt;\n})();\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_components__cMKBQ{width:16px;height:24px;background:linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #f1f2f6 100%)}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/InputOverflowMask.scss\"],\"names\":[],\"mappings\":\"AAEA,8BACE,UAAA,CACA,WAAA,CACA,0EAAA\",\"sourcesContent\":[\".mask{width:16px;height:24px;background:linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, #f1f2f6 100%)}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"mask\": \"whitelabel_components__cMKBQ\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_PassengersDropdown__iiJKj{position:relative;min-width:100%}.whitelabel_PassengersDropdown__v4EcL{min-width:288px}.whitelabel_PassengersDropdown__vNhB0{display:flex;justify-content:flex-end;align-items:center}.whitelabel_PassengersDropdown__JoCZB{position:absolute;bottom:0;width:100%;white-space:nowrap}.whitelabel_PassengersDropdown__ksaOw{margin-right:4px}@media screen and (min-width: 768px)and (max-width: calc(1024px - 1px)){.whitelabel_PassengersDropdown__zgf3c{display:none}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/PassengersDropdown/PassengersDropdown.scss\"],\"names\":[],\"mappings\":\"AAEA,sCACE,iBAAA,CACA,cAAA,CAGF,sCACE,eAAA,CAGF,sCACE,YAAA,CACA,wBAAA,CACA,kBAAA,CAGF,sCACE,iBAAA,CACA,QAAA,CACA,UAAA,CACA,kBAAA,CAGF,sCACE,gBAAA,CAIA,wEADF,sCAEI,YAAA,CAAA\",\"sourcesContent\":[\".wrapper{position:relative;min-width:100%}.content{min-width:288px}.buttons{display:flex;justify-content:flex-end;align-items:center}.errorContainer{position:absolute;bottom:0;width:100%;white-space:nowrap}.personIcon{margin-right:4px}@media screen and (min-width: 768px)and (max-width: calc(1024px - 1px)){.dcInfo{display:none}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"wrapper\": \"whitelabel_PassengersDropdown__iiJKj\",\n\t\"content\": \"whitelabel_PassengersDropdown__v4EcL\",\n\t\"buttons\": \"whitelabel_PassengersDropdown__vNhB0\",\n\t\"errorContainer\": \"whitelabel_PassengersDropdown__JoCZB\",\n\t\"personIcon\": \"whitelabel_PassengersDropdown__ksaOw\",\n\t\"dcInfo\": \"whitelabel_PassengersDropdown__zgf3c\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_PassengersSlider__IiIXD{display:flex;flex-direction:row}.whitelabel_PassengersSlider__avWsy{position:relative}.whitelabel_PassengersSlider__YdhK2{position:absolute;bottom:-46px;right:0;white-space:nowrap}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/PassengersSlider/PassengersSlider.scss\"],\"names\":[],\"mappings\":\"AAAA,oCACE,YAAA,CACA,kBAAA,CAGF,oCACE,iBAAA,CAGF,oCACE,iBAAA,CACA,YAAA,CACA,OAAA,CACA,kBAAA\",\"sourcesContent\":[\".iconWrapper{display:flex;flex-direction:row}.wrapper{position:relative}.error{position:absolute;bottom:-46px;right:0;white-space:nowrap}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"iconWrapper\": \"whitelabel_PassengersSlider__IiIXD\",\n\t\"wrapper\": \"whitelabel_PassengersSlider__avWsy\",\n\t\"error\": \"whitelabel_PassengersSlider__YdhK2\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_SearchButton__Ew3Qw{width:100%;position:relative;order:1}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_SearchButton__Ew3Qw.whitelabel_SearchButton__ymnoE{display:none}}.whitelabel_SearchButton__cHTvL{display:none}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_SearchButton__cHTvL.whitelabel_SearchButton__WVVu6{display:flex}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/SearchButton/SearchButton.scss\"],\"names\":[],\"mappings\":\"AAEA,gCACE,UAAA,CACA,iBAAA,CACA,OAAA,CAGE,4DADF,+DAEI,YAAA,CAAA,CAIN,gCACE,YAAA,CAGE,4DADF,+DAEI,YAAA,CAAA\",\"sourcesContent\":[\".contents{width:100%;position:relative;order:1}@media screen and (min-width: 768px)and (max-width: 1023px){.contents.hideLabel{display:none}}.iconSearch{display:none}@media screen and (min-width: 768px)and (max-width: 1023px){.iconSearch.showIcon{display:flex}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"contents\": \"whitelabel_SearchButton__Ew3Qw\",\n\t\"hideLabel\": \"whitelabel_SearchButton__ymnoE\",\n\t\"iconSearch\": \"whitelabel_SearchButton__cHTvL\",\n\t\"showIcon\": \"whitelabel_SearchButton__WVVu6\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_SlideDownTransition__knhPv{position:absolute;bottom:0;left:0;transform:translateY(calc(100% + 6px));z-index:2}.whitelabel_SlideDownTransition__zqJ9b{opacity:0;transform:translateY(calc(100% - 10px));transition:all .15s cubic-bezier(0.3, 0, 0.4, 1)}.whitelabel_SlideDownTransition__XWvUb{opacity:1;transform:translateY(calc(100% + 6px))}.whitelabel_SlideDownTransition__NgDk0{opacity:1;transform:translateY(calc(100% + 6px));transition:all .15s cubic-bezier(0.6, 0, 0.7, 1)}.whitelabel_SlideDownTransition__i7CFj{transform:translateY(calc(100% - 10px));opacity:0}@media screen and (min-width: 768px){.whitelabel_SlideDownTransition__knhPv{right:0;left:auto}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/SlideDownTransition/SlideDownTransition.scss\"],\"names\":[],\"mappings\":\"AAEA,uCACE,iBAAA,CACA,QAAA,CACA,MAAA,CACA,sCAAA,CACA,SAAA,CAGF,uCACE,SAAA,CACA,uCAAA,CACA,gDAAA,CAGF,uCACE,SAAA,CACA,sCAAA,CAGF,uCACE,SAAA,CACA,sCAAA,CACA,gDAAA,CAGF,uCACE,uCAAA,CACA,SAAA,CAGF,qCACE,uCACE,OAAA,CACA,SAAA,CAAA\",\"sourcesContent\":[\".content{position:absolute;bottom:0;left:0;transform:translateY(calc(100% + 6px));z-index:2}.enter{opacity:0;transform:translateY(calc(100% - 10px));transition:all .15s cubic-bezier(0.3, 0, 0.4, 1)}.enterActive{opacity:1;transform:translateY(calc(100% + 6px))}.exit{opacity:1;transform:translateY(calc(100% + 6px));transition:all .15s cubic-bezier(0.6, 0, 0.7, 1)}.exitActive{transform:translateY(calc(100% - 10px));opacity:0}@media screen and (min-width: 768px){.content{right:0;left:auto}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"content\": \"whitelabel_SlideDownTransition__knhPv\",\n\t\"enter\": \"whitelabel_SlideDownTransition__zqJ9b\",\n\t\"enterActive\": \"whitelabel_SlideDownTransition__XWvUb\",\n\t\"exit\": \"whitelabel_SlideDownTransition__NgDk0\",\n\t\"exitActive\": \"whitelabel_SlideDownTransition__i7CFj\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_SuggestionList__k0cF_{align-items:center;background:#fff;cursor:pointer;display:flex;min-height:64px;padding:12px 16px;width:100%}@media screen and (min-width: 1024px){.whitelabel_SuggestionList__k0cF_{min-height:52px}.whitelabel_SuggestionList__k0cF_.whitelabel_SuggestionList__P6mOY{min-height:44px}}.whitelabel_SuggestionList__k0cF_.whitelabel_SuggestionList__Aa41I{background:#f9f9fa}.whitelabel_SuggestionList__Z3Lj_,.whitelabel_SuggestionList__xCI3g{display:flex}.whitelabel_SuggestionList__EFpnF{margin:0 4px}.whitelabel_SuggestionList__Z3Lj_>.whitelabel_SuggestionList__pQXDK,.whitelabel_SuggestionList__xCI3g .whitelabel_SuggestionList__mCbk5{color:#717fa4}.whitelabel_SuggestionList__xCI3g>.whitelabel_SuggestionList__mCbk5{margin-left:6px}.whitelabel_SuggestionList__RVZvO{color:#425486;width:24px;height:24px;margin-right:12px;flex-shrink:0}.whitelabel_SuggestionList__RVZvO.whitelabel_SuggestionList__P6mOY{width:20px;height:20px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/SuggestionList/Suggestion.scss\"],\"names\":[],\"mappings\":\"AAEA,kCACE,kBAAA,CACA,eAAA,CACA,cAAA,CACA,YAAA,CACA,eAAA,CACA,iBAAA,CACA,UAAA,CAEA,sCATF,kCAUI,eAAA,CAEA,mEACE,eAAA,CAAA,CAKN,mEACE,kBAAA,CAGF,oEAEE,YAAA,CAGF,kCACE,YAAA,CAGF,wIAEE,aAAA,CAGF,oEACE,eAAA,CAGF,kCACE,aAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,aAAA,CAGF,mEACE,UAAA,CACA,WAAA\",\"sourcesContent\":[\".container{align-items:center;background:#fff;cursor:pointer;display:flex;min-height:64px;padding:12px 16px;width:100%}@media screen and (min-width: 1024px){.container{min-height:52px}.container.isSubSuggestion{min-height:44px}}.container.isActive{background:#f9f9fa}.labelWrapper,.headlineWrapper{display:flex}.labelSpacer{margin:0 4px}.labelWrapper>.label,.headlineWrapper .secondaryHeadline{color:#717fa4}.headlineWrapper>.secondaryHeadline{margin-left:6px}.iconWrapper{color:#425486;width:24px;height:24px;margin-right:12px;flex-shrink:0}.iconWrapper.isSubSuggestion{width:20px;height:20px}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"whitelabel_SuggestionList__k0cF_\",\n\t\"isSubSuggestion\": \"whitelabel_SuggestionList__P6mOY\",\n\t\"isActive\": \"whitelabel_SuggestionList__Aa41I\",\n\t\"labelWrapper\": \"whitelabel_SuggestionList__Z3Lj_\",\n\t\"headlineWrapper\": \"whitelabel_SuggestionList__xCI3g\",\n\t\"labelSpacer\": \"whitelabel_SuggestionList__EFpnF\",\n\t\"label\": \"whitelabel_SuggestionList__pQXDK\",\n\t\"secondaryHeadline\": \"whitelabel_SuggestionList__mCbk5\",\n\t\"iconWrapper\": \"whitelabel_SuggestionList__RVZvO\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_SuggestionList__h8k3L{width:100%}.whitelabel_SuggestionList__h8k3L>div{padding-left:48px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/SuggestionList/SuggestionList.scss\"],\"names\":[],\"mappings\":\"AAAA,kCACE,UAAA,CAGF,sCACE,iBAAA\",\"sourcesContent\":[\".subSuggestionWrapper{width:100%}.subSuggestionWrapper>div{padding-left:48px}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"subSuggestionWrapper\": \"whitelabel_SuggestionList__h8k3L\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_calendar__oesaw{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_calendar__tG8DH{float:right}.whitelabel_calendar___eu5y{display:flex;flex-wrap:wrap}.whitelabel_calendar__Nvmau{width:100%}.whitelabel_calendar__OxVbh{display:flex;align-items:center;justify-content:space-between}.whitelabel_calendar__wtAmh{padding:15px;min-width:250px}.whitelabel_calendar__UCG2I{position:relative}.whitelabel_calendar__yHLqd{position:absolute}.whitelabel_calendar__oesaw{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_calendar__tG8DH{float:right}.whitelabel_calendar___eu5y{display:flex;flex-wrap:wrap}.whitelabel_calendar__Nvmau{width:100%}.whitelabel_calendar__OxVbh{display:flex;align-items:center;justify-content:space-between}.whitelabel_calendar__wtAmh{padding:15px;min-width:250px}.whitelabel_calendar__UCG2I{position:relative}.whitelabel_calendar__yHLqd{position:absolute}.whitelabel_calendar__ko7qr{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.whitelabel_calendar__ko7qr .whitelabel_calendar__zRYZb{padding:0 8px}.whitelabel_calendar__ko7qr:focus{outline:none}.whitelabel_calendar__ko7qr:hover{cursor:pointer}.whitelabel_calendar__GQjXI{cursor:pointer;width:20px;height:20px}.whitelabel_calendar__oyGlQ{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.whitelabel_calendar__WuRhe{font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.whitelabel_calendar__WuRhe.whitelabel_calendar__XBf8L{border-right:1px solid #ccc}.whitelabel_calendar__CqbnZ{background:#fff}.whitelabel_calendar__aUnXJ{}.whitelabel_calendar__aUnXJ>:first-child{border-radius:8px 0 0 8px}.whitelabel_calendar__aUnXJ>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.whitelabel_calendar__xqEgK{flex-direction:column;padding:5px;height:28px}.whitelabel_calendar__lTtG6 svg{cursor:pointer}.whitelabel_calendar__B8aoa svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.whitelabel_calendar__ko7qr{height:40px}.whitelabel_calendar__xqEgK{height:28px}}@media screen and (min-width: 1024px){.whitelabel_calendar__ko7qr{border-radius:0}.whitelabel_calendar__ko7qr.whitelabel_calendar__rW2u1{margin:0 2px 0 0}.whitelabel_calendar__ko7qr.whitelabel_calendar__rW2u1 .whitelabel_calendar__zRYZb{padding:0 4px}}@media screen and (max-width: 1023px){.whitelabel_calendar__oyGlQ.whitelabel_calendar__ItWZi{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_calendar__ko7qr.whitelabel_calendar___16Gq{border-radius:0}.whitelabel_calendar__ko7qr.whitelabel_calendar___16Gq.whitelabel_calendar__rW2u1{margin:0 2px 0 0}.whitelabel_calendar__ko7qr.whitelabel_calendar___16Gq.whitelabel_calendar__rW2u1 .whitelabel_calendar__zRYZb{padding:0 4px}}.whitelabel_calendar__dKyGa{display:flex;margin:0;padding:0;height:100%;max-height:48px}.whitelabel_calendar__Q_v_o{box-sizing:border-box;color:#425486;cursor:pointer;list-style:none;position:relative;width:100%;z-index:0;font-size:16px;height:100%;max-height:48px;line-height:24px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.whitelabel_calendar__Q_v_o.whitelabel_calendar__jRWPx{pointer-events:none}.whitelabel_calendar__Q_v_o.whitelabel_calendar__XrCQu{font-weight:bold}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/buttons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/calendar/Calendar.scss\"],\"names\":[],\"mappings\":\"AAUA,4BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,4BACE,WAAA,CAGF,4BACE,YAAA,CACA,cAAA,CAGF,4BACE,UAAA,CAGF,4BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,4BAEE,YAAA,CACA,eAAA,CAGF,4BACE,iBAAA,CAGF,4BACE,iBAAA,CDxBF,4BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,4BACE,WAAA,CAGF,4BACE,YAAA,CACA,cAAA,CAGF,4BACE,UAAA,CAGF,4BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,4BAEE,YAAA,CACA,eAAA,CAGF,4BACE,iBAAA,CAGF,4BACE,iBAAA,CC5BF,4BFmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CEpBA,YAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CACA,WDZY,CCaZ,iBDda,CCeb,eAAA,CACA,QAAA,CACA,wDACE,aAAA,CAEF,kCACE,YAAA,CAEF,kCACE,cAAA,CAGJ,4BACE,cAAA,CACA,UAAA,CACA,WAAA,CAEF,4BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,4BFTE,cA1Bc,CA2Bd,eA9BiB,CA+BjB,iBAAA,CACA,mBAAA,CESA,wBCnCU,CDoCV,UAAA,CACA,MAAA,CAEA,uDACE,2BAAA,CAIJ,4BAEE,eAAA,CAGF,4BACE,CACA,yCACE,yBAAA,CAEF,wCACE,yBAAA,CACA,6BAAA,CAIJ,4BAEE,qBAAA,CACA,WAAA,CACA,WArEkB,CAyElB,gCACE,cAAA,CAIF,gCACE,cAAA,CACA,kBCjFG,CDqFP,qCACE,4BACE,WAAA,CAGF,4BACE,WA1FgB,CAAA,CA8FpB,sCACE,4BACE,eAAA,CACA,uDACE,gBAAA,CACA,mFACE,aAAA,CAAA,CAMR,sCAEI,uDACE,SAAA,CAAA,CAKN,4DAEI,uDACE,eAAA,CACA,kFACE,gBAAA,CACA,8GACE,aAAA,CAAA,CExHV,4BACE,YAAA,CACA,QAAA,CACA,SAAA,CACA,WAAA,CACA,eAAA,CAGF,4BAEE,qBAAA,CACA,aDEiB,CCDjB,cAAA,CACA,eAAA,CACA,iBAAA,CACA,UAAA,CACA,SAAA,CACA,cAAA,CACA,WAAA,CACA,eAAA,CACA,gBAAA,CACA,cAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CAEA,uDACE,mBAAA,CAGF,uDACE,gBAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\"@import 'colors';\\n@import 'typography';\\n@import 'layout';\\n@import 'mediaQueries';\\n$smallButtonHeight: 28px;\\n\\n.button {\\n @include defaultInputFontStyle();\\n display: flex;\\n position: relative;\\n align-items: center;\\n flex-wrap: wrap;\\n justify-content: flex-start;\\n height: $inputHeight;\\n border-radius: $borderRadius;\\n background: white;\\n margin: 0;\\n .icon-wrap {\\n padding: 0 8px;\\n }\\n &:focus {\\n outline: none;\\n }\\n &:hover {\\n cursor: pointer;\\n }\\n}\\n.close-icon-wrap {\\n cursor: pointer;\\n width: 20px;\\n height: 20px;\\n}\\n.close-icon-container {\\n position: absolute;\\n top: 0;\\n right: 4px;\\n display: flex;\\n height: 100%;\\n align-items: center;\\n}\\n\\n.button-gray {\\n composes: button;\\n @include smallFont();\\n background-color: $lightgray;\\n width: 100%;\\n flex: 1;\\n\\n &.divider {\\n border-right: 1px solid $midgray;\\n }\\n}\\n\\n.button-white {\\n composes: button;\\n background: white;\\n}\\n\\n.button-dual {\\n composes: button;\\n & > :first-child {\\n border-radius: $borderRadius 0 0 $borderRadius;\\n }\\n & > :last-child {\\n border-radius: 0 $borderRadius $borderRadius 0;\\n border-left: 1px $lightgray solid;\\n }\\n}\\n\\n.button-small {\\n composes: button;\\n flex-direction: column;\\n padding: 5px;\\n height: $smallButtonHeight;\\n}\\n\\n.plus {\\n svg {\\n cursor: pointer;\\n }\\n}\\n.minus {\\n svg {\\n cursor: pointer;\\n background: $blue;\\n }\\n}\\n\\n@media screen and (min-width: 500px) {\\n .button {\\n height: 40px;\\n }\\n\\n .button-small {\\n height: $smallButtonHeight;\\n }\\n}\\n\\n@media screen and (min-width: $desktopMin) {\\n .button {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n}\\n\\n@media screen and (max-width: calc($desktopMin - 1px)) {\\n .close-icon-container {\\n &.isSrp {\\n right: 8px;\\n }\\n }\\n}\\n\\n@media screen and (min-width: $tabletMin) and (max-width: calc($desktopMin - 1px)) {\\n .button {\\n &.isLps {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n }\\n}\\n\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.button{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.button .icon-wrap{padding:0 8px}.button:focus{outline:none}.button:hover{cursor:pointer}.close-icon-wrap{cursor:pointer;width:20px;height:20px}.close-icon-container{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.button-gray{composes:button;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.button-gray.divider{border-right:1px solid #ccc}.button-white{composes:button;background:#fff}.button-dual{composes:button}.button-dual>:first-child{border-radius:8px 0 0 8px}.button-dual>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.button-small{composes:button;flex-direction:column;padding:5px;height:28px}.plus svg{cursor:pointer}.minus svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.button{height:40px}.button-small{height:28px}}@media screen and (min-width: 1024px){.button{border-radius:0}.button.isDesktop{margin:0 2px 0 0}.button.isDesktop .icon-wrap{padding:0 4px}}@media screen and (max-width: 1023px){.close-icon-container.isSrp{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.button.isLps{border-radius:0}.button.isLps.isDesktop{margin:0 2px 0 0}.button.isLps.isDesktop .icon-wrap{padding:0 4px}}.calendarRow{display:flex;margin:0;padding:0;height:100%;max-height:48px}.calendarDay{composes:defaultFont;box-sizing:border-box;color:#425486;cursor:pointer;list-style:none;position:relative;width:100%;z-index:0;font-size:16px;height:100%;max-height:48px;line-height:24px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.calendarDay.isUnavailable{pointer-events:none}.calendarDay.weekend{font-weight:bold}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_calendar__oesaw\",\n\t\"floatRight\": \"whitelabel_calendar__tG8DH\",\n\t\"flexWrap\": \"whitelabel_calendar___eu5y\",\n\t\"fullWidth\": \"whitelabel_calendar__Nvmau\",\n\t\"flexCenter\": \"whitelabel_calendar__OxVbh\",\n\t\"centeredHeader\": \"whitelabel_calendar__wtAmh whitelabel_calendar__OxVbh whitelabel_calendar__OxVbh\",\n\t\"relative\": \"whitelabel_calendar__UCG2I\",\n\t\"absolute\": \"whitelabel_calendar__yHLqd\",\n\t\"button\": \"whitelabel_calendar__ko7qr\",\n\t\"icon-wrap\": \"whitelabel_calendar__zRYZb\",\n\t\"close-icon-wrap\": \"whitelabel_calendar__GQjXI\",\n\t\"close-icon-container\": \"whitelabel_calendar__oyGlQ\",\n\t\"button-gray\": \"whitelabel_calendar__WuRhe whitelabel_calendar__ko7qr\",\n\t\"divider\": \"whitelabel_calendar__XBf8L\",\n\t\"button-white\": \"whitelabel_calendar__CqbnZ whitelabel_calendar__ko7qr\",\n\t\"button-dual\": \"whitelabel_calendar__aUnXJ whitelabel_calendar__ko7qr\",\n\t\"button-small\": \"whitelabel_calendar__xqEgK whitelabel_calendar__ko7qr\",\n\t\"plus\": \"whitelabel_calendar__lTtG6\",\n\t\"minus\": \"whitelabel_calendar__B8aoa\",\n\t\"isDesktop\": \"whitelabel_calendar__rW2u1\",\n\t\"isSrp\": \"whitelabel_calendar__ItWZi\",\n\t\"isLps\": \"whitelabel_calendar___16Gq\",\n\t\"calendarRow\": \"whitelabel_calendar__dKyGa\",\n\t\"calendarDay\": \"whitelabel_calendar__Q_v_o whitelabel_calendar__oesaw\",\n\t\"isUnavailable\": \"whitelabel_calendar__jRWPx\",\n\t\"weekend\": \"whitelabel_calendar__XrCQu\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_calendar__Qrcbz{box-sizing:border-box;position:absolute;right:0;bottom:0;left:0;top:2px;height:calc(100% - 2px);width:100%;z-index:-1;pointer-events:none}.whitelabel_calendar__Qrcbz.whitelabel_calendar__vSTDe{background-color:#deebf9;padding:2px 0}.whitelabel_calendar__Qrcbz.whitelabel_calendar__vnLCv{left:50%;width:50%}.whitelabel_calendar__Qrcbz.whitelabel_calendar__qpO1i{right:50%;width:50%}.whitelabel_calendar__Qrcbz.whitelabel_calendar__Gdneg{border-top-left-radius:8px;border-bottom-left-radius:8px}.whitelabel_calendar__Qrcbz.whitelabel_calendar__LyaCB{border-top-right-radius:8px;border-bottom-right-radius:8px}.whitelabel_calendar__WJEOJ{box-sizing:content-box;margin:0 auto;border-radius:50%;border:2px solid rgba(0,0,0,0);z-index:2;display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#132968;width:90%;height:90%;max-width:44px;max-height:44px;aspect-ratio:1;line-height:20px}.whitelabel_calendar__WJEOJ.whitelabel_calendar__v7tkK{color:#fff;background-color:#425486;border:2px solid #425486}.whitelabel_calendar__WJEOJ.whitelabel_calendar__NOVB7{color:#a1a9c3}.whitelabel_calendar__WJEOJ.whitelabel_calendar__vSTDe:not(.whitelabel_calendar__v7tkK){border:2px solid rgba(0,0,0,0)}.whitelabel_calendar__WJEOJ:hover:not(.whitelabel_calendar__NOVB7):not(.whitelabel_calendar__v7tkK){background-color:rgba(0,0,0,0);border:2px solid #132968;color:#132968}.whitelabel_calendar__WJEOJ.whitelabel_calendar__rydsX:before{content:\\\" \\\";position:absolute;border:2px solid #fff;border-radius:50%;z-index:1;height:90%;width:90%;inset:0;margin:5%}.whitelabel_calendar__WJEOJ .whitelabel_calendar__zuHm7{font-size:12px;line-height:14px;position:relative;display:none}.whitelabel_calendar__WJEOJ.whitelabel_calendar__UKy5y .whitelabel_calendar__zuHm7,.whitelabel_calendar__WJEOJ.whitelabel_calendar__ey6mU .whitelabel_calendar__zuHm7{display:block}.whitelabel_calendar__WJEOJ.whitelabel_calendar__ey6mU .whitelabel_calendar__zuHm7{color:rgba(0,0,0,0);width:60%;border-radius:4px;background:linear-gradient(270deg, rgba(161, 169, 195, 0.5) 0%, rgba(161, 169, 195, 0.2) 100%);background-size:200% 200%;height:12px;animation:whitelabel_calendar__vtCIP 2s ease infinite}@media(prefers-reduced-motion: reduce){.whitelabel_calendar__WJEOJ.whitelabel_calendar__ey6mU .whitelabel_calendar__zuHm7{animation:none}}.whitelabel_calendar__WJEOJ:not(.whitelabel_calendar__v7tkK,.whitelabel_calendar__ey6mU) .whitelabel_calendar__zuHm7{color:#a1a9c3}.whitelabel_calendar__WJEOJ:not(.whitelabel_calendar__v7tkK,.whitelabel_calendar__ey6mU) .whitelabel_calendar__zuHm7.whitelabel_calendar__SQ4ZA{color:#0f8463;font-weight:500}@keyframes whitelabel_calendar__vtCIP{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/calendar/CalendarDay.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,4BACE,qBAAA,CACA,iBAAA,CACA,OAAA,CACA,QAAA,CACA,MAAA,CACA,OAAA,CACA,uBAAA,CACA,UAAA,CACA,UAAA,CACA,mBAAA,CAEA,uDACE,wBCgBW,CDfX,aAAA,CAGF,uDACE,QAAA,CACA,SAAA,CAGF,uDACE,SAAA,CACA,SAAA,CAGF,uDACE,0BAAA,CACA,6BAAA,CAGF,uDACE,2BAAA,CACA,8BAAA,CAIJ,4BACE,sBAAA,CACA,aAAA,CACA,iBAAA,CACA,8BAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,oBAAA,CACA,sBAAA,CACA,kBAAA,CACA,aClCiB,CDmCjB,SAAA,CACA,UAAA,CACA,cAAA,CACA,eAAA,CACA,cAAA,CACA,gBAAA,CAEA,uDACE,UAAA,CACA,wBC3Ce,CD4Cf,wBAAA,CAGF,uDACE,aC9Ce,CDiDjB,wFACE,8BAAA,CAGF,oGACE,8BAAA,CACA,wBAAA,CACA,aC3De,CD+Df,8DACE,WAAA,CACA,iBAAA,CACA,qBAAA,CACA,iBAAA,CACA,SAAA,CACA,UAAA,CACA,SAAA,CACA,OAAA,CACA,SAAA,CAIJ,wDACE,cAAA,CACA,gBAAA,CACA,iBAAA,CACA,YAAA,CAKA,sKACE,aAAA,CAIJ,mFACE,mBAAA,CACA,SAAA,CACA,iBAAA,CACA,8FAAA,CACA,yBAAA,CACA,WAAA,CACA,qDAAA,CAGF,uCACE,mFACE,cAAA,CAAA,CAIJ,qHACE,aCxGe,CD0Gf,gJACE,aClGa,CDmGb,eAAA,CAKN,sCACE,GACE,0BAAA,CAEF,IACE,4BAAA,CAEF,KACE,0BAAA,CAAA\",\"sourcesContent\":[\".selectedRange{box-sizing:border-box;position:absolute;right:0;bottom:0;left:0;top:2px;height:calc(100% - 2px);width:100%;z-index:-1;pointer-events:none}.selectedRange.isWithinSelectionRange{background-color:#deebf9;padding:2px 0}.selectedRange.firstSelectedDay{left:50%;width:50%}.selectedRange.lastSelectedDay{right:50%;width:50%}.selectedRange.firstCalendarRowDay{border-top-left-radius:8px;border-bottom-left-radius:8px}.selectedRange.lastCalendarRowDay{border-top-right-radius:8px;border-bottom-right-radius:8px}.dayLabel{box-sizing:content-box;margin:0 auto;border-radius:50%;border:2px solid rgba(0,0,0,0);z-index:2;display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:center;color:#132968;width:90%;height:90%;max-width:44px;max-height:44px;aspect-ratio:1;line-height:20px}.dayLabel.activeDay{color:#fff;background-color:#425486;border:2px solid #425486}.dayLabel.unavailableDay{color:#a1a9c3}.dayLabel.isWithinSelectionRange:not(.activeDay){border:2px solid rgba(0,0,0,0)}.dayLabel:hover:not(.unavailableDay):not(.activeDay){background-color:rgba(0,0,0,0);border:2px solid #132968;color:#132968}.dayLabel.sameDay:before{content:\\\" \\\";position:absolute;border:2px solid #fff;border-radius:50%;z-index:1;height:90%;width:90%;inset:0;margin:5%}.dayLabel .dayPrice{font-size:12px;line-height:14px;position:relative;display:none}.dayLabel.hasPrice .dayPrice,.dayLabel.isPriceLoading .dayPrice{display:block}.dayLabel.isPriceLoading .dayPrice{color:rgba(0,0,0,0);width:60%;border-radius:4px;background:linear-gradient(270deg, rgba(161, 169, 195, 0.5) 0%, rgba(161, 169, 195, 0.2) 100%);background-size:200% 200%;height:12px;animation:price-loading 2s ease infinite}@media(prefers-reduced-motion: reduce){.dayLabel.isPriceLoading .dayPrice{animation:none}}.dayLabel:not(.activeDay,.isPriceLoading) .dayPrice{color:#a1a9c3}.dayLabel:not(.activeDay,.isPriceLoading) .dayPrice.isCheap{color:#0f8463;font-weight:500}@keyframes price-loading{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"selectedRange\": \"whitelabel_calendar__Qrcbz\",\n\t\"isWithinSelectionRange\": \"whitelabel_calendar__vSTDe\",\n\t\"firstSelectedDay\": \"whitelabel_calendar__vnLCv\",\n\t\"lastSelectedDay\": \"whitelabel_calendar__qpO1i\",\n\t\"firstCalendarRowDay\": \"whitelabel_calendar__Gdneg\",\n\t\"lastCalendarRowDay\": \"whitelabel_calendar__LyaCB\",\n\t\"dayLabel\": \"whitelabel_calendar__WJEOJ\",\n\t\"activeDay\": \"whitelabel_calendar__v7tkK\",\n\t\"unavailableDay\": \"whitelabel_calendar__NOVB7\",\n\t\"sameDay\": \"whitelabel_calendar__rydsX\",\n\t\"dayPrice\": \"whitelabel_calendar__zuHm7\",\n\t\"hasPrice\": \"whitelabel_calendar__UKy5y\",\n\t\"isPriceLoading\": \"whitelabel_calendar__ey6mU\",\n\t\"price-loading\": \"whitelabel_calendar__vtCIP\",\n\t\"isCheap\": \"whitelabel_calendar__SQ4ZA\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_calendar__Bsihd{height:48px;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.whitelabel_calendar__zHmQt{justify-content:center}.whitelabel_calendar__IVkAf{height:20px;color:#132968;font-size:16px;font-weight:bold;line-height:20px;text-align:center}.whitelabel_calendar__uzr49{position:absolute;left:var(--calendar-horizontal-padding);right:var(--calendar-horizontal-padding)}.whitelabel_calendar__YcICN{display:flex;justify-content:center;cursor:pointer;padding:15px 5px}.whitelabel_calendar__YcICN.whitelabel_calendar__RFFI5{transform:rotate(90deg);align-items:flex-end}.whitelabel_calendar__YcICN.whitelabel_calendar__bbltk{transform:rotate(-90deg);align-items:flex-end}.whitelabel_calendar__YcICN>svg{width:16px;height:16px;color:#132968}.whitelabel_calendar__YcICN.whitelabel_calendar__x9St7{cursor:auto}.whitelabel_calendar__YcICN.whitelabel_calendar__JzTHM{opacity:1;pointer-events:none}.whitelabel_calendar__YcICN.whitelabel_calendar__JzTHM>svg{color:#a1a9c3}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/calendar/CalendarNavigation.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,4BACE,WAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,6BAAA,CAGF,4BACE,sBAAA,CAGF,4BACE,WAAA,CACA,aCCiB,CAAA,cAAA,CDCjB,gBAAA,CACA,gBAAA,CACA,iBAAA,CAGF,4BACE,iBAAA,CACA,uCAAA,CACA,wCAAA,CAGF,4BACE,YAAA,CACA,sBAAA,CACA,cAAA,CACA,gBAAA,CAEA,uDACE,uBAAA,CACA,oBAAA,CAGF,uDACE,wBAAA,CACA,oBAAA,CAGF,gCACE,UAAA,CACA,WAAA,CACA,aC/Be,CDkCjB,uDACE,WAAA,CAGF,uDACE,SAAA,CACA,mBAAA,CACA,2DACE,aCvCa\",\"sourcesContent\":[\".container{height:48px;display:flex;flex-direction:row;align-items:center;justify-content:space-between}.title-container{justify-content:center}.title{height:20px;color:#132968;font-size:16px;font-weight:bold;line-height:20px;text-align:center}.navIcons-container{position:absolute;left:var(--calendar-horizontal-padding);right:var(--calendar-horizontal-padding)}.navIcon{display:flex;justify-content:center;cursor:pointer;padding:15px 5px}.navIcon.left{transform:rotate(90deg);align-items:flex-end}.navIcon.right{transform:rotate(-90deg);align-items:flex-end}.navIcon>svg{width:16px;height:16px;color:#132968}.navIcon.blank{cursor:auto}.navIcon.disabled{opacity:1;pointer-events:none}.navIcon.disabled>svg{color:#a1a9c3}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"whitelabel_calendar__Bsihd\",\n\t\"title-container\": \"whitelabel_calendar__zHmQt\",\n\t\"title\": \"whitelabel_calendar__IVkAf\",\n\t\"navIcons-container\": \"whitelabel_calendar__uzr49\",\n\t\"navIcon\": \"whitelabel_calendar__YcICN\",\n\t\"left\": \"whitelabel_calendar__RFFI5\",\n\t\"right\": \"whitelabel_calendar__bbltk\",\n\t\"blank\": \"whitelabel_calendar__x9St7\",\n\t\"disabled\": \"whitelabel_calendar__JzTHM\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_calendar__nK3Zg{width:100%;font-weight:500;text-align:center;text-transform:uppercase;display:flex;justify-content:center;height:48px;color:#717fa4;font-size:14px;margin-bottom:4px;align-items:center;border-bottom:1px solid #dcdfe9}.whitelabel_calendar__nK3Zg.whitelabel_calendar__PYLfW{font-weight:bold}.whitelabel_calendar__PXwzv{width:100%;min-width:224px;max-width:512px;padding:0 16px 0 16px}.whitelabel_calendar__PXwzv .whitelabel_calendar__nK3Zg{border-bottom:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/calendar/CalendarWeekdays.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,4BACE,UAAA,CACA,eAAA,CACA,iBAAA,CACA,wBAAA,CACA,YAAA,CACA,sBAAA,CACA,WAAA,CACA,aCSiB,CDRjB,cAAA,CACA,iBAAA,CACA,kBAAA,CACA,+BAAA,CAEA,uDACE,gBAAA,CAIJ,4BACE,UAAA,CACA,eAAA,CACA,eAAA,CACA,qBAAA,CAEA,wDACE,kBAAA\",\"sourcesContent\":[\".weekday{width:100%;font-weight:500;text-align:center;text-transform:uppercase;display:flex;justify-content:center;height:48px;color:#717fa4;font-size:14px;margin-bottom:4px;align-items:center;border-bottom:1px solid #dcdfe9}.weekday.weekend{font-weight:bold}.mobileContainer{width:100%;min-width:224px;max-width:512px;padding:0 16px 0 16px}.mobileContainer .weekday{border-bottom:none}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"weekday\": \"whitelabel_calendar__nK3Zg\",\n\t\"weekend\": \"whitelabel_calendar__PYLfW\",\n\t\"mobileContainer\": \"whitelabel_calendar__PXwzv\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_calendar__Fl0EU{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_calendar__NdSHM{float:right}.whitelabel_calendar__G2I2H{display:flex;flex-wrap:wrap}.whitelabel_calendar__u8ohE{width:100%}.whitelabel_calendar__BQHtO{display:flex;align-items:center;justify-content:space-between}.whitelabel_calendar__qjFs2{padding:15px;min-width:250px}.whitelabel_calendar__kHopo{position:relative}.whitelabel_calendar__L2wc3{position:absolute}.whitelabel_calendar__Fl0EU{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_calendar__NdSHM{float:right}.whitelabel_calendar__G2I2H{display:flex;flex-wrap:wrap}.whitelabel_calendar__u8ohE{width:100%}.whitelabel_calendar__BQHtO{display:flex;align-items:center;justify-content:space-between}.whitelabel_calendar__qjFs2{padding:15px;min-width:250px}.whitelabel_calendar__kHopo{position:relative}.whitelabel_calendar__L2wc3{position:absolute}.whitelabel_calendar__S5GMT{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.whitelabel_calendar__S5GMT .whitelabel_calendar__Ioapw{padding:0 8px}.whitelabel_calendar__S5GMT:focus{outline:none}.whitelabel_calendar__S5GMT:hover{cursor:pointer}.whitelabel_calendar__AjBXn{cursor:pointer;width:20px;height:20px}.whitelabel_calendar__bbarC{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.whitelabel_calendar__EPy9K{font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.whitelabel_calendar__EPy9K.whitelabel_calendar__vvkJi{border-right:1px solid #ccc}.whitelabel_calendar__cixeO{background:#fff}.whitelabel_calendar__wSkqe{}.whitelabel_calendar__wSkqe>:first-child{border-radius:8px 0 0 8px}.whitelabel_calendar__wSkqe>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.whitelabel_calendar___5oQJ{flex-direction:column;padding:5px;height:28px}.whitelabel_calendar__XevrK svg{cursor:pointer}.whitelabel_calendar__N08ub svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.whitelabel_calendar__S5GMT{height:40px}.whitelabel_calendar___5oQJ{height:28px}}@media screen and (min-width: 1024px){.whitelabel_calendar__S5GMT{border-radius:0}.whitelabel_calendar__S5GMT.whitelabel_calendar__fzT7Z{margin:0 2px 0 0}.whitelabel_calendar__S5GMT.whitelabel_calendar__fzT7Z .whitelabel_calendar__Ioapw{padding:0 4px}}@media screen and (max-width: 1023px){.whitelabel_calendar__bbarC.whitelabel_calendar__nzCNE{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_calendar__S5GMT.whitelabel_calendar__v36OV{border-radius:0}.whitelabel_calendar__S5GMT.whitelabel_calendar__v36OV.whitelabel_calendar__fzT7Z{margin:0 2px 0 0}.whitelabel_calendar__S5GMT.whitelabel_calendar__v36OV.whitelabel_calendar__fzT7Z .whitelabel_calendar__Ioapw{padding:0 4px}}.whitelabel_calendar__AzLIw{text-align:center;font-size:13px;padding:5px;border-top:#f2f2f2}.whitelabel_calendar__b12Wm{padding:0 5px;margin:0;display:flex}.whitelabel_calendar__L3vAe{box-sizing:border-box;list-style:none;font-size:13px;text-align:center;font-weight:400;display:block;width:100%;padding:0 4px;min-width:35px;height:35px;line-height:35px;color:#000;cursor:pointer}.whitelabel_calendar__E1nXe{font-size:10px;color:#999;text-transform:uppercase}.whitelabel_calendar__GKMrB{border-radius:50%;width:35px;margin:0 auto;transition:background .13s ease-in}.whitelabel_calendar__GKMrB:hover{background:#f2f2f2}.whitelabel_calendar__X7w6u{color:#999;pointer-events:none;cursor:default}.whitelabel_calendar__x9KRt{color:#333;background-color:#f2f2f2;position:relative}.whitelabel_calendar__x9KRt:hover{cursor:pointer}.whitelabel_calendar__fA70g{background:#fff}.whitelabel_calendar__ruSY6{background:linear-gradient(90deg, white 0%, #f2f2f2 100%)}.whitelabel_calendar__RZ9iQ{background:linear-gradient(90deg, #f2f2f2 0%, white 100%)}.whitelabel_calendar__vUbT_ .whitelabel_calendar__GKMrB{color:#fff;background-color:#f7a600}.whitelabel_calendar__Uy81U{max-width:calc(100% - 44px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.whitelabel_calendar__rBplg{color:#a1a9c3}@media screen and (min-width: 768px){.whitelabel_calendar__bC0Pt{max-width:calc(100% - 14px);text-overflow:unset}.whitelabel_calendar__Zn96e{max-width:calc(100% - 30px);text-overflow:unset}}.whitelabel_calendar__tcS0p{--calendar-width: 336px;--calendar-gap: 32px;--calendar-horizontal-padding: 32px;--calendars-max-width: 768px;position:absolute;left:50%;transform:translateX(-50%);max-width:var(--calendars-max-width);margin-top:4px;padding:16px var(--calendar-horizontal-padding);border-radius:8px;box-shadow:0 8px 16px 0 rgba(51,51,51,.2);background-color:#fff;z-index:100;user-select:none;display:flex;flex-direction:column;overflow:hidden}.whitelabel_calendar__KqBYR{min-width:var(--calendar-width);--shiftLeftBy: calc(var(--calendar-width) + var(--calendar-gap));transform:translateX(calc(-1 * var(--shiftLeftBy)));max-height:384px}.whitelabel_calendar__KqBYR:not(:first-child){margin-left:var(--calendar-gap)}.whitelabel_calendar__KqBYR:nth-child(1),.whitelabel_calendar__KqBYR:nth-child(4){max-height:288px}.whitelabel_calendar__tcS0p.whitelabel_calendar__oL2L9 .whitelabel_calendar__KqBYR{transition:all var(--transition-duration) ease-out}.whitelabel_calendar__tcS0p.whitelabel_calendar__rqLmM .whitelabel_calendar__KqBYR{transform:translateX(0)}.whitelabel_calendar__tcS0p.whitelabel_calendar__rqLmM .whitelabel_calendar__KqBYR:nth-child(3){max-height:288px}.whitelabel_calendar__tcS0p.whitelabel_calendar__rqLmM .whitelabel_calendar__KqBYR:nth-child(1){max-height:384px}.whitelabel_calendar__tcS0p.whitelabel_calendar__HRJpo .whitelabel_calendar__KqBYR{transform:translateX(calc(-2 * var(--shiftLeftBy)))}.whitelabel_calendar__tcS0p.whitelabel_calendar__HRJpo .whitelabel_calendar__KqBYR:nth-child(2){max-height:288px}.whitelabel_calendar__tcS0p.whitelabel_calendar__HRJpo .whitelabel_calendar__KqBYR:nth-child(4){max-height:384px}@media screen and (max-width: 768px){.whitelabel_calendar__tcS0p{left:0;transform:none}.whitelabel_calendar__tcS0p.whitelabel_calendar__pb6WP{left:auto;right:0}}@media screen and (max-width: 800px){.whitelabel_calendar__tcS0p{--calendars-max-width: calc(var(--calendar-width) + var(--calendar-horizontal-padding) * 2)}.whitelabel_calendar__tcS0p .whitelabel_calendar__KqBYR:nth-child(3){max-height:288px}.whitelabel_calendar__tcS0p.whitelabel_calendar__HRJpo .whitelabel_calendar__KqBYR:nth-child(3){max-height:384px}.whitelabel_calendar__tcS0p.whitelabel_calendar__HRJpo .whitelabel_calendar__KqBYR:nth-child(4){max-height:288px}.whitelabel_calendar__tcS0p.whitelabel_calendar__rqLmM .whitelabel_calendar__KqBYR:nth-child(2){max-height:288px}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/buttons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/calendar.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/calendar/DesktopCalendar.scss\"],\"names\":[],\"mappings\":\"AAUA,4BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,4BACE,WAAA,CAGF,4BACE,YAAA,CACA,cAAA,CAGF,4BACE,UAAA,CAGF,4BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,4BAEE,YAAA,CACA,eAAA,CAGF,4BACE,iBAAA,CAGF,4BACE,iBAAA,CDxBF,4BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,4BACE,WAAA,CAGF,4BACE,YAAA,CACA,cAAA,CAGF,4BACE,UAAA,CAGF,4BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,4BAEE,YAAA,CACA,eAAA,CAGF,4BACE,iBAAA,CAGF,4BACE,iBAAA,CC5BF,4BFmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CEpBA,YAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CACA,WDZY,CCaZ,iBDda,CCeb,eAAA,CACA,QAAA,CACA,wDACE,aAAA,CAEF,kCACE,YAAA,CAEF,kCACE,cAAA,CAGJ,4BACE,cAAA,CACA,UAAA,CACA,WAAA,CAEF,4BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,4BFTE,cA1Bc,CA2Bd,eA9BiB,CA+BjB,iBAAA,CACA,mBAAA,CESA,wBCnCU,CDoCV,UAAA,CACA,MAAA,CAEA,uDACE,2BAAA,CAIJ,4BAEE,eAAA,CAGF,4BACE,CACA,yCACE,yBAAA,CAEF,wCACE,yBAAA,CACA,6BAAA,CAIJ,4BAEE,qBAAA,CACA,WAAA,CACA,WArEkB,CAyElB,gCACE,cAAA,CAIF,gCACE,cAAA,CACA,kBCjFG,CDqFP,qCACE,4BACE,WAAA,CAGF,4BACE,WA1FgB,CAAA,CA8FpB,sCACE,4BACE,eAAA,CACA,uDACE,gBAAA,CACA,mFACE,aAAA,CAAA,CAMR,sCAEI,uDACE,SAAA,CAAA,CAKN,4DAEI,uDACE,eAAA,CACA,kFACE,gBAAA,CACA,8GACE,aAAA,CAAA,CEnHV,4BACE,iBAAA,CACA,cALY,CAMZ,WAAA,CACA,kBDLU,CCQZ,4BACE,aAAA,CACA,QAAA,CACA,YAAA,CAGF,4BAEE,qBAAA,CACA,eAAA,CACA,cApBY,CAqBZ,iBAAA,CACA,eAAA,CACA,aAAA,CACA,UAAA,CACA,aAAA,CACA,cA3BQ,CA4BR,WA5BQ,CA6BR,gBA7BQ,CA8BR,UAAA,CACA,cAAA,CAGF,4BACE,cAjCgB,CAmChB,UDhCK,CCiCL,wBAAA,CAGF,4BACE,iBAAA,CACA,UA3CQ,CA4CR,aAAA,CACA,kCAAA,CACA,kCACE,kBD5CQ,CCgDZ,4BACE,UD/CK,CCgDL,mBAAA,CACA,cAAA,CAGF,4BACE,UDnDM,CCoDN,wBDxDU,CCyDV,iBAAA,CACA,kCACE,cAAA,CAIJ,4BACE,eAAA,CAGF,4BACE,yDAAA,CAGF,4BACE,yDAAA,CAIA,wDACE,UAAA,CACA,wBDjFK,CCqFT,4BACE,2BAAA,CACA,eAAA,CACA,kBAAA,CACA,sBAAA,CAGF,4BACE,aD/EiB,CCkFnB,qCACE,4BACE,2BAAA,CACA,mBAAA,CAEF,4BACE,2BAAA,CACA,mBAAA,CAAA,CClGJ,4BACE,uBAAA,CACA,oBAAA,CACA,mCAAA,CACA,4BAAA,CACA,iBAAA,CACA,QAAA,CACA,0BAAA,CACA,oCAAA,CACA,cAAA,CACA,+CAAA,CACA,iBAAA,CACA,yCAAA,CACA,qBFhBM,CEiBN,WAAA,CACA,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,eAAA,CAGF,4BACE,+BAAA,CACA,gEAAA,CACA,mDAAA,CACA,gBA3BuB,CA6BvB,8CACE,+BAAA,CAMJ,kFAEE,gBAvCwB,CA2CxB,mFACE,kDAAA,CAGF,mFACE,uBAAA,CACA,gGACE,gBAlDoB,CAqDtB,gGACE,gBArDmB,CAyDvB,mFACE,mDAAA,CAEA,gGACE,gBA9DoB,CAiEtB,gGACE,gBAjEmB,CAsEzB,qCACE,4BACE,MAAA,CACA,cAAA,CAEA,uDACE,SAAA,CACA,OAAA,CAAA,CAKN,qCACE,4BACE,2FAAA,CAEA,qEACE,gBAxFoB,CA6FlB,gGACE,gBA7Fe,CAgGjB,gGACE,gBAlGgB,CAuGlB,gGACE,gBAxGgB,CAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\"@import 'colors';\\n@import 'typography';\\n@import 'layout';\\n@import 'mediaQueries';\\n$smallButtonHeight: 28px;\\n\\n.button {\\n @include defaultInputFontStyle();\\n display: flex;\\n position: relative;\\n align-items: center;\\n flex-wrap: wrap;\\n justify-content: flex-start;\\n height: $inputHeight;\\n border-radius: $borderRadius;\\n background: white;\\n margin: 0;\\n .icon-wrap {\\n padding: 0 8px;\\n }\\n &:focus {\\n outline: none;\\n }\\n &:hover {\\n cursor: pointer;\\n }\\n}\\n.close-icon-wrap {\\n cursor: pointer;\\n width: 20px;\\n height: 20px;\\n}\\n.close-icon-container {\\n position: absolute;\\n top: 0;\\n right: 4px;\\n display: flex;\\n height: 100%;\\n align-items: center;\\n}\\n\\n.button-gray {\\n composes: button;\\n @include smallFont();\\n background-color: $lightgray;\\n width: 100%;\\n flex: 1;\\n\\n &.divider {\\n border-right: 1px solid $midgray;\\n }\\n}\\n\\n.button-white {\\n composes: button;\\n background: white;\\n}\\n\\n.button-dual {\\n composes: button;\\n & > :first-child {\\n border-radius: $borderRadius 0 0 $borderRadius;\\n }\\n & > :last-child {\\n border-radius: 0 $borderRadius $borderRadius 0;\\n border-left: 1px $lightgray solid;\\n }\\n}\\n\\n.button-small {\\n composes: button;\\n flex-direction: column;\\n padding: 5px;\\n height: $smallButtonHeight;\\n}\\n\\n.plus {\\n svg {\\n cursor: pointer;\\n }\\n}\\n.minus {\\n svg {\\n cursor: pointer;\\n background: $blue;\\n }\\n}\\n\\n@media screen and (min-width: 500px) {\\n .button {\\n height: 40px;\\n }\\n\\n .button-small {\\n height: $smallButtonHeight;\\n }\\n}\\n\\n@media screen and (min-width: $desktopMin) {\\n .button {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n}\\n\\n@media screen and (max-width: calc($desktopMin - 1px)) {\\n .close-icon-container {\\n &.isSrp {\\n right: 8px;\\n }\\n }\\n}\\n\\n@media screen and (min-width: $tabletMin) and (max-width: calc($desktopMin - 1px)) {\\n .button {\\n &.isLps {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n }\\n}\\n\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\",\"@import 'colors';\\n@import 'typography';\\n@import 'layout';\\n@import 'buttons';\\n@import 'mediaQueries';\\n\\n$daySize: 35px;\\n$dayFontSize: 13px;\\n$weekdayFontSize: 10px;\\n\\n.monthName {\\n text-align: center;\\n font-size: $dayFontSize;\\n padding: 5px;\\n border-top: $lightgray;\\n}\\n\\n.calendarRow {\\n padding: 0 5px;\\n margin: 0;\\n display: flex;\\n}\\n\\n.day {\\n composes: defaultFont;\\n box-sizing: border-box;\\n list-style: none;\\n font-size: $dayFontSize;\\n text-align: center;\\n font-weight: 400;\\n display: block;\\n width: 100%;\\n padding: 0 4px;\\n min-width: $daySize;\\n height: $daySize;\\n line-height: $daySize;\\n color: black;\\n cursor: pointer;\\n}\\n\\n.weekday {\\n font-size: $weekdayFontSize;\\n composes: day;\\n color: $gray;\\n text-transform: uppercase;\\n}\\n\\n.dayLabel {\\n border-radius: 50%;\\n width: $daySize;\\n margin: 0 auto;\\n transition: background 0.13s ease-in;\\n &:hover {\\n background: $lightgray;\\n }\\n}\\n\\n.unavailableDay {\\n color: $gray;\\n pointer-events: none;\\n cursor: default;\\n}\\n\\n.isWithinSelectionRange {\\n color: $black;\\n background-color: $lightgray;\\n position: relative;\\n &:hover {\\n cursor: pointer;\\n }\\n}\\n\\n.firstSelectedDay {\\n background: white;\\n}\\n\\n.firstSelectRoundTrip {\\n background: linear-gradient(90deg, white 0%, $lightgray 100%);\\n}\\n\\n.lastSelectedDay {\\n background: linear-gradient(90deg, $lightgray 0%, white 100%);\\n}\\n\\n.activeDay {\\n .dayLabel {\\n color: white;\\n background-color: $orange;\\n }\\n}\\n\\n.text-wrap {\\n max-width: calc(100% - 44px);\\n overflow: hidden;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n}\\n\\n.addReturnColor {\\n color: $primaryDeepBlue4;\\n}\\n\\n@media screen and (min-width: $tabletMin) {\\n .textWrapSmall {\\n max-width: calc(100% - 14px);\\n text-overflow: unset;\\n }\\n .textWrapReturn {\\n max-width: calc(100% - 30px);\\n text-overflow: unset;\\n }\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.button{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.button .icon-wrap{padding:0 8px}.button:focus{outline:none}.button:hover{cursor:pointer}.close-icon-wrap{cursor:pointer;width:20px;height:20px}.close-icon-container{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.button-gray{composes:button;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.button-gray.divider{border-right:1px solid #ccc}.button-white{composes:button;background:#fff}.button-dual{composes:button}.button-dual>:first-child{border-radius:8px 0 0 8px}.button-dual>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.button-small{composes:button;flex-direction:column;padding:5px;height:28px}.plus svg{cursor:pointer}.minus svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.button{height:40px}.button-small{height:28px}}@media screen and (min-width: 1024px){.button{border-radius:0}.button.isDesktop{margin:0 2px 0 0}.button.isDesktop .icon-wrap{padding:0 4px}}@media screen and (max-width: 1023px){.close-icon-container.isSrp{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.button.isLps{border-radius:0}.button.isLps.isDesktop{margin:0 2px 0 0}.button.isLps.isDesktop .icon-wrap{padding:0 4px}}.monthName{text-align:center;font-size:13px;padding:5px;border-top:#f2f2f2}.calendarRow{padding:0 5px;margin:0;display:flex}.day{composes:defaultFont;box-sizing:border-box;list-style:none;font-size:13px;text-align:center;font-weight:400;display:block;width:100%;padding:0 4px;min-width:35px;height:35px;line-height:35px;color:#000;cursor:pointer}.weekday{font-size:10px;composes:day;color:#999;text-transform:uppercase}.dayLabel{border-radius:50%;width:35px;margin:0 auto;transition:background .13s ease-in}.dayLabel:hover{background:#f2f2f2}.unavailableDay{color:#999;pointer-events:none;cursor:default}.isWithinSelectionRange{color:#333;background-color:#f2f2f2;position:relative}.isWithinSelectionRange:hover{cursor:pointer}.firstSelectedDay{background:#fff}.firstSelectRoundTrip{background:linear-gradient(90deg, white 0%, #f2f2f2 100%)}.lastSelectedDay{background:linear-gradient(90deg, #f2f2f2 0%, white 100%)}.activeDay .dayLabel{color:#fff;background-color:#f7a600}.text-wrap{max-width:calc(100% - 44px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.addReturnColor{color:#a1a9c3}@media screen and (min-width: 768px){.textWrapSmall{max-width:calc(100% - 14px);text-overflow:unset}.textWrapReturn{max-width:calc(100% - 30px);text-overflow:unset}}.container{--calendar-width: 336px;--calendar-gap: 32px;--calendar-horizontal-padding: 32px;--calendars-max-width: 768px;position:absolute;left:50%;transform:translateX(-50%);max-width:var(--calendars-max-width);margin-top:4px;padding:16px var(--calendar-horizontal-padding);border-radius:8px;box-shadow:0 8px 16px 0 rgba(51,51,51,.2);background-color:#fff;z-index:100;user-select:none;display:flex;flex-direction:column;overflow:hidden}.calendar{min-width:var(--calendar-width);--shiftLeftBy: calc(var(--calendar-width) + var(--calendar-gap));transform:translateX(calc(-1 * var(--shiftLeftBy)));max-height:384px}.calendar:not(:first-child){margin-left:var(--calendar-gap)}.calendar:nth-child(1),.calendar:nth-child(4){max-height:288px}.container.animate .calendar{transition:all var(--transition-duration) ease-out}.container.animate-decrement .calendar{transform:translateX(0)}.container.animate-decrement .calendar:nth-child(3){max-height:288px}.container.animate-decrement .calendar:nth-child(1){max-height:384px}.container.animate-increment .calendar{transform:translateX(calc(-2 * var(--shiftLeftBy)))}.container.animate-increment .calendar:nth-child(2){max-height:288px}.container.animate-increment .calendar:nth-child(4){max-height:384px}@media screen and (max-width: 768px){.container{left:0;transform:none}.container.return{left:auto;right:0}}@media screen and (max-width: 800px){.container{--calendars-max-width: calc(var(--calendar-width) + var(--calendar-horizontal-padding) * 2)}.container .calendar:nth-child(3){max-height:288px}.container.animate-increment .calendar:nth-child(3){max-height:384px}.container.animate-increment .calendar:nth-child(4){max-height:288px}.container.animate-decrement .calendar:nth-child(2){max-height:288px}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_calendar__Fl0EU\",\n\t\"floatRight\": \"whitelabel_calendar__NdSHM\",\n\t\"flexWrap\": \"whitelabel_calendar__G2I2H\",\n\t\"fullWidth\": \"whitelabel_calendar__u8ohE\",\n\t\"flexCenter\": \"whitelabel_calendar__BQHtO\",\n\t\"centeredHeader\": \"whitelabel_calendar__qjFs2 whitelabel_calendar__BQHtO whitelabel_calendar__BQHtO\",\n\t\"relative\": \"whitelabel_calendar__kHopo\",\n\t\"absolute\": \"whitelabel_calendar__L2wc3\",\n\t\"button\": \"whitelabel_calendar__S5GMT\",\n\t\"icon-wrap\": \"whitelabel_calendar__Ioapw\",\n\t\"close-icon-wrap\": \"whitelabel_calendar__AjBXn\",\n\t\"close-icon-container\": \"whitelabel_calendar__bbarC\",\n\t\"button-gray\": \"whitelabel_calendar__EPy9K whitelabel_calendar__S5GMT\",\n\t\"divider\": \"whitelabel_calendar__vvkJi\",\n\t\"button-white\": \"whitelabel_calendar__cixeO whitelabel_calendar__S5GMT\",\n\t\"button-dual\": \"whitelabel_calendar__wSkqe whitelabel_calendar__S5GMT\",\n\t\"button-small\": \"whitelabel_calendar___5oQJ whitelabel_calendar__S5GMT\",\n\t\"plus\": \"whitelabel_calendar__XevrK\",\n\t\"minus\": \"whitelabel_calendar__N08ub\",\n\t\"isDesktop\": \"whitelabel_calendar__fzT7Z\",\n\t\"isSrp\": \"whitelabel_calendar__nzCNE\",\n\t\"isLps\": \"whitelabel_calendar__v36OV\",\n\t\"monthName\": \"whitelabel_calendar__AzLIw\",\n\t\"calendarRow\": \"whitelabel_calendar__b12Wm\",\n\t\"day\": \"whitelabel_calendar__L3vAe whitelabel_calendar__Fl0EU\",\n\t\"weekday\": \"whitelabel_calendar__E1nXe whitelabel_calendar__L3vAe whitelabel_calendar__Fl0EU\",\n\t\"dayLabel\": \"whitelabel_calendar__GKMrB\",\n\t\"unavailableDay\": \"whitelabel_calendar__X7w6u\",\n\t\"isWithinSelectionRange\": \"whitelabel_calendar__x9KRt\",\n\t\"firstSelectedDay\": \"whitelabel_calendar__fA70g\",\n\t\"firstSelectRoundTrip\": \"whitelabel_calendar__ruSY6\",\n\t\"lastSelectedDay\": \"whitelabel_calendar__RZ9iQ\",\n\t\"activeDay\": \"whitelabel_calendar__vUbT_\",\n\t\"text-wrap\": \"whitelabel_calendar__Uy81U\",\n\t\"addReturnColor\": \"whitelabel_calendar__rBplg\",\n\t\"textWrapSmall\": \"whitelabel_calendar__bC0Pt\",\n\t\"textWrapReturn\": \"whitelabel_calendar__Zn96e\",\n\t\"container\": \"whitelabel_calendar__tcS0p\",\n\t\"calendar\": \"whitelabel_calendar__KqBYR\",\n\t\"animate\": \"whitelabel_calendar__oL2L9\",\n\t\"animate-decrement\": \"whitelabel_calendar__rqLmM\",\n\t\"animate-increment\": \"whitelabel_calendar__HRJpo\",\n\t\"return\": \"whitelabel_calendar__pb6WP\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"*{box-sizing:border-box}.whitelabel_desktop__rGh8Q{background-color:#fff;border-radius:8px;padding:0 4px}.whitelabel_desktop__rGh8Q.whitelabel_desktop__vQYnJ{padding:8px 16px;max-width:1136px}@media screen and (min-width: 1024px){.whitelabel_desktop__rGh8Q.whitelabel_desktop__vQYnJ{padding-left:24px;padding-right:24px}}.whitelabel_desktop__IE5qD{display:flex}.whitelabel_desktop__R2TtG{display:flex;min-width:0}.whitelabel_desktop__R2TtG>*{min-width:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/desktop/Layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAIA,EACE,qBAAA,CAGF,2BACE,qBCDM,CDEN,iBAAA,CACA,aAAA,CAEA,qDACE,gBAAA,CACA,gBAAA,CAIJ,sCAEI,qDACE,iBAAA,CACA,kBAAA,CAAA,CAKN,2BACE,YAAA,CAGF,2BACE,YAAA,CACA,WAAA,CAEA,6BACE,WAAA\",\"sourcesContent\":[\"*{box-sizing:border-box}.container{background-color:#fff;border-radius:8px;padding:0 4px}.container.isLps{padding:8px 16px;max-width:1136px}@media screen and (min-width: 1024px){.container.isLps{padding-left:24px;padding-right:24px}}.secondaryElementsContainer{display:flex}.calendarInputs{display:flex;min-width:0}.calendarInputs>*{min-width:0}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"whitelabel_desktop__rGh8Q\",\n\t\"isLps\": \"whitelabel_desktop__vQYnJ\",\n\t\"secondaryElementsContainer\": \"whitelabel_desktop__IE5qD\",\n\t\"calendarInputs\": \"whitelabel_desktop__R2TtG\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_desktop__K3MXr{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.whitelabel_desktop__AB2pi{padding:4px;border-radius:8px;background-color:#fff}.whitelabel_desktop__Dx_4X{display:flex;min-width:0}.whitelabel_desktop__Dx_4X>*{min-width:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/desktop/LayoutSlim.scss\"],\"names\":[],\"mappings\":\"AAUA,2BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCXF,EACE,qBAAA,CAGF,2BACE,WAAA,CACA,iBAAA,CACA,qBAAA,CAGF,2BACE,YAAA,CACA,WAAA,CACA,6BACE,WAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.container{padding:4px;border-radius:8px;background-color:#fff}.calendarInputs{display:flex;min-width:0}.calendarInputs>*{min-width:0}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_desktop__K3MXr\",\n\t\"container\": \"whitelabel_desktop__AB2pi\",\n\t\"calendarInputs\": \"whitelabel_desktop__Dx_4X\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_dropdown__AULd6{display:flex;align-items:center;width:100%;cursor:pointer;user-select:none;background:rgba(0,0,0,0);margin:0;padding:0;border:none;outline:none;overflow:hidden;text-overflow:ellipsis}.whitelabel_dropdown__AULd6.whitelabel_dropdown__YxuK_{height:48px;background-color:#f1f2f6;border-radius:8px;padding:0 10px;transition:border .15s ease;border:1px solid #fff}.whitelabel_dropdown__AULd6.whitelabel_dropdown__YxuK_:focus,.whitelabel_dropdown__AULd6.whitelabel_dropdown__YxuK_:hover{border:1px solid #a1a9c3}.whitelabel_dropdown__dCSR_{height:24px;width:24px;padding:2px;display:flex;flex-direction:column;align-content:center;justify-content:center;transition:all .15s ease-in-out}.whitelabel_dropdown__dCSR_>svg{color:#fff}.whitelabel_dropdown__J3ru8{height:24px;margin:0;color:#132968;font-size:14px;font-weight:500;line-height:24px;white-space:nowrap;overflow:hidden;display:flex}.whitelabel_dropdown__J3ru8.whitelabel_dropdown__YxuK_{font-size:16px;font-weight:normal;color:#132968}.whitelabel_dropdown__g5R1l{height:24px;margin:0 0 0 8px;display:flex;align-items:center}.whitelabel_dropdown__g5R1l>.whitelabel_dropdown__JMCZ5{width:12px;color:#a1a9c3}.whitelabel_dropdown__g5R1l .whitelabel_dropdown__ca3LE{position:absolute;left:-16px}.whitelabel_dropdown__g5R1l .whitelabel_dropdown__JMCZ5>svg{transition:transform .15s ease-in-out;will-change:transform}.whitelabel_dropdown__g5R1l.whitelabel_dropdown__pxY07 .whitelabel_dropdown__JMCZ5>svg{transform:scaleY(-1)}.whitelabel_dropdown__g5R1l.whitelabel_dropdown__YxuK_{position:absolute;right:10px;top:13px;background-color:#f1f2f6}.whitelabel_dropdown__g5R1l.whitelabel_dropdown__YxuK_>.whitelabel_dropdown__JMCZ5{color:#a1a9c3;margin-bottom:4px}@media screen and (min-width: 768px){.whitelabel_dropdown__J3ru8{margin:0 0 0 8px;margin:0}.whitelabel_dropdown__AULd6.whitelabel_dropdown__YxuK_{border-radius:0 8px 8px 0;border:1px solid #f1f2f6}.whitelabel_dropdown__AULd6.whitelabel_dropdown__YxuK_:hover{border:1px solid #a1a9c3;outline:none}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/dropdown/DropdownButton.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAGA,4BACE,YAAA,CACA,kBAAA,CACA,UAAA,CACA,cAAA,CACA,gBAAA,CACA,wBAAA,CACA,QAAA,CACA,SAAA,CACA,WAAA,CACA,YAAA,CACA,eAAA,CACA,sBAAA,CAEA,uDACE,WAAA,CACA,wBCQW,CDPX,iBAAA,CACA,cAAA,CACA,2BAAA,CACA,qBAAA,CACA,0HAEE,wBAAA,CAKN,4BACE,WAAA,CACA,UAAA,CACA,WAAA,CACA,YAAA,CACA,qBAAA,CACA,oBAAA,CACA,sBAAA,CACA,+BAAA,CAEA,gCACE,UAAA,CAIJ,4BACE,WAAA,CACA,QAAA,CACA,aChCiB,CDiCjB,cAAA,CACA,eAAA,CACA,gBAAA,CACA,kBAAA,CACA,eAAA,CAOA,YAAA,CALA,uDACE,cAAA,CACA,kBAAA,CACA,aC1Ce,CD+CnB,4BACE,WAAA,CACA,gBAAA,CACA,YAAA,CACA,kBAAA,CAEA,wDACE,UAAA,CACA,aCpDe,CDuDjB,wDACE,iBAAA,CACA,UAAA,CAGF,4DACE,qCAAA,CACA,qBAAA,CAIA,uFACE,oBAAA,CAIJ,uDACE,iBAAA,CACA,UAAA,CACA,QAAA,CACA,wBCpEW,CDsEX,mFACE,aC9Ea,CD+Eb,iBAAA,CAKN,qCACE,4BACE,gBAAA,CACA,QAAA,CAGA,uDACE,yBAAA,CACA,wBAAA,CACA,6DACE,wBAAA,CACA,YAAA,CAAA\",\"sourcesContent\":[\".head{display:flex;align-items:center;width:100%;cursor:pointer;user-select:none;background:rgba(0,0,0,0);margin:0;padding:0;border:none;outline:none;overflow:hidden;text-overflow:ellipsis}.head.button{height:48px;background-color:#f1f2f6;border-radius:8px;padding:0 10px;transition:border .15s ease;border:1px solid #fff}.head.button:focus,.head.button:hover{border:1px solid #a1a9c3}.icon{height:24px;width:24px;padding:2px;display:flex;flex-direction:column;align-content:center;justify-content:center;transition:all .15s ease-in-out}.icon>svg{color:#fff}.label{height:24px;margin:0;color:#132968;font-size:14px;font-weight:500;line-height:24px;white-space:nowrap;overflow:hidden;display:flex}.label.button{font-size:16px;font-weight:normal;color:#132968}.indicator{height:24px;margin:0 0 0 8px;display:flex;align-items:center}.indicator>.chevronWrapper{width:12px;color:#a1a9c3}.indicator .maskWrapper{position:absolute;left:-16px}.indicator .chevronWrapper>svg{transition:transform .15s ease-in-out;will-change:transform}.indicator.open .chevronWrapper>svg{transform:scaleY(-1)}.indicator.button{position:absolute;right:10px;top:13px;background-color:#f1f2f6}.indicator.button>.chevronWrapper{color:#a1a9c3;margin-bottom:4px}@media screen and (min-width: 768px){.label{margin:0 0 0 8px;margin:0}.head.button{border-radius:0 8px 8px 0;border:1px solid #f1f2f6}.head.button:hover{border:1px solid #a1a9c3;outline:none}}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"head\": \"whitelabel_dropdown__AULd6\",\n\t\"button\": \"whitelabel_dropdown__YxuK_\",\n\t\"icon\": \"whitelabel_dropdown__dCSR_\",\n\t\"label\": \"whitelabel_dropdown__J3ru8\",\n\t\"indicator\": \"whitelabel_dropdown__g5R1l\",\n\t\"chevronWrapper\": \"whitelabel_dropdown__JMCZ5\",\n\t\"maskWrapper\": \"whitelabel_dropdown__ca3LE\",\n\t\"open\": \"whitelabel_dropdown__pxY07\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_fc-button__OXxfe{width:100%;display:flex;text-align:center;line-height:20px;padding:0 16px;border:0;border-radius:8px;cursor:pointer;font-family:\\\"GT Walsheim\\\",\\\"Open Sans\\\",\\\"Helvetica-Neue\\\",\\\"Helvetica\\\",\\\"Arial\\\",sans-serif;font-weight:500;appearance:none;box-shadow:none;position:relative;overflow:hidden;align-items:center;justify-content:center;text-decoration:none;-webkit-font-smoothing:antialiased;transition:background-color .2s linear;height:48px;font-size:16px;color:#fff;background-color:#fa6b6b}.whitelabel_fc-button__OXxfe:disabled{cursor:not-allowed}.whitelabel_fc-button__OXxfe:hover{background-color:#fb8989}@media screen and (hover: none){.whitelabel_fc-button__OXxfe:hover{background-color:#fa6b6b}}.whitelabel_fc-button__OXxfe:active{background-color:#fb8989}.whitelabel_fc-button__OXxfe:disabled{background-color:#fdb5b5}.whitelabel_fc-button__OXxfe:disabled:hover,.whitelabel_fc-button__OXxfe:disabled:active{background-color:#fdb5b5}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/fc-button/styles.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAKA,6BACE,UAAA,CACA,YAAA,CACA,iBAAA,CACA,gBAAA,CACA,cAAA,CACA,QAAA,CACA,iBAAA,CACA,cAAA,CACA,qFAAA,CACA,eAAA,CACA,eAAA,CACA,eAAA,CACA,iBAAA,CACA,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,oBAAA,CACA,kCAAA,CACA,sCAAA,CACA,WAAA,CACA,cAAA,CAMA,UCxBM,CDyBN,wBCVc,CDKd,sCACE,kBAAA,CAMF,mCACE,wBAjCU,CAoCZ,gCACE,mCACE,wBClBU,CAAA,CDsBd,oCACE,wBA3CU,CA8CZ,sCACE,wBAhDS,CAkDT,yFAEE,wBApDO\",\"sourcesContent\":[\".button{width:100%;display:flex;text-align:center;line-height:20px;padding:0 16px;border:0;border-radius:8px;cursor:pointer;font-family:\\\"GT Walsheim\\\",\\\"Open Sans\\\",\\\"Helvetica-Neue\\\",\\\"Helvetica\\\",\\\"Arial\\\",sans-serif;font-weight:500;appearance:none;box-shadow:none;position:relative;overflow:hidden;align-items:center;justify-content:center;text-decoration:none;-webkit-font-smoothing:antialiased;transition:background-color .2s linear;height:48px;font-size:16px;color:#fff;background-color:#fa6b6b}.button:disabled{cursor:not-allowed}.button:hover{background-color:#fb8989}@media screen and (hover: none){.button:hover{background-color:#fa6b6b}}.button:active{background-color:#fb8989}.button:disabled{background-color:#fdb5b5}.button:disabled:hover,.button:disabled:active{background-color:#fdb5b5}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"button\": \"whitelabel_fc-button__OXxfe\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_ferretMobileSidebarPanel__QmTJ3{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;height:100%;max-height:100vh;margin:0 !important;z-index:100000;user-select:none;display:flex;flex-direction:column;transition:transform .15s ease-in;transform:translateX(100vw);will-change:transform}.whitelabel_ferretMobileSidebarPanel__QmTJ3.whitelabel_ferretMobileSidebarPanel__v9vTN{left:0;transform:translateX(0)}.whitelabel_ferretMobileSidebarPanel__QmTJ3.whitelabel_ferretMobileSidebarPanel__v9vTN .whitelabel_ferretMobileSidebarPanel__l1tXN{box-shadow:0 4px 8px 0 rgba(51,51,51,.1)}.whitelabel_ferretMobileSidebarPanel__l1tXN{position:relative;width:100%;height:56px;box-sizing:border-box;margin:0;background-color:#fff;color:#666;text-decoration:none;z-index:1;display:flex;flex-direction:column;align-items:center;box-shadow:0 4px 8px 0 rgba(51,51,51,0)}.whitelabel_ferretMobileSidebarPanel__l1tXN.whitelabel_ferretMobileSidebarPanel__TqpcM{height:96px}.whitelabel_ferretMobileSidebarPanel__teCAj{box-sizing:border-box;height:100%;width:56px;z-index:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.whitelabel_ferretMobileSidebarPanel__teCAj>svg{color:#717fa4}.whitelabel_ferretMobileSidebarPanel__JMfGl{position:relative;box-sizing:border-box;height:100%;width:100%;color:#132968;font-size:18px;font-weight:bold;display:flex;flex-direction:row;align-items:center;justify-content:center}.whitelabel_ferretMobileSidebarPanel__ctpNv{box-sizing:border-box;height:100%;width:56px;min-width:56px;max-width:56px}.whitelabel_ferretMobileSidebarPanel__P11Jw{position:relative;width:100%;height:calc(100vh - 56px);overflow:scroll;-webkit-overflow-scrolling:touch;background-color:#fff;opacity:1}.whitelabel_ferretMobileSidebarPanel__P11Jw>div{min-width:100%}.whitelabel_ferretMobileSidebarPanel__g7k8A{position:fixed;left:0;right:0;bottom:0;padding:12px;background-color:#fff;color:#666;text-decoration:none;box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.1),0 -2px 6px 0 rgba(51,51,51,.1);z-index:1;display:flex;flex-direction:column;row-gap:8px;align-items:center;justify-content:center;transform:translateY(100%);transition:transform .3s ease;will-change:transform}.whitelabel_ferretMobileSidebarPanel__g7k8A.whitelabel_ferretMobileSidebarPanel__v9vTN{transform:translateY(0)}.whitelabel_ferretMobileSidebarPanel__uWmaz{width:100%;height:100%;border-radius:8px;border:1px solid #fa6b6b;background-color:#fa6b6b;outline:none;cursor:pointer;color:#fff;font-size:16px;font-weight:500;line-height:24px;text-align:center;padding:7px 20px}.whitelabel_ferretMobileSidebarPanel__uWmaz:hover,.whitelabel_ferretMobileSidebarPanel__uWmaz:focus{background-color:#fa6b6b}.whitelabel_ferretMobileSidebarPanel__h7L01{display:flex;width:100%;height:48px}.whitelabel_ferretMobileSidebarPanel__PhQh2{display:flex;width:100%;flex-direction:row}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/ferretMobileSidebarPanel/FerretMobileSidebarPanel.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAMA,4CACE,cAAA,CACA,KAAA,CACA,OAAA,CACA,QAAA,CACA,MAAA,CACA,WAAA,CACA,WAAA,CACA,gBAAA,CACA,mBAAA,CACA,cAAA,CAEA,gBAAA,CACA,YAAA,CACA,qBAAA,CACA,iCAAA,CACA,2BAAA,CACA,qBAAA,CAEA,uFACE,MAAA,CACA,uBAAA,CACA,mIACE,wCAAA,CAKN,4CACE,iBAAA,CACA,UAAA,CACA,WAnCa,CAuCb,qBAAA,CACA,QAAA,CACA,qBCnCM,CDoCN,UChCS,CDiCT,oBAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,uCAAA,CAZA,uFACE,WApCgB,CAkDpB,4CACE,qBAAA,CACA,WAAA,CACA,UApDY,CAqDZ,SAAA,CACA,cAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CAEA,gDACE,aC7Ce,CDiDnB,4CACE,iBAAA,CACA,qBAAA,CACA,WAAA,CACA,UAAA,CACA,aCxDiB,CDyDjB,cAAA,CACA,gBAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,sBAAA,CAGF,4CACE,qBAAA,CACA,WAAA,CACA,UAjFY,CAkFZ,cAlFY,CAmFZ,cAnFY,CAsFd,4CACE,iBAAA,CACA,UAAA,CACA,yBAAA,CACA,eAAA,CACA,gCAAA,CACA,qBCxFM,CDyFN,SAAA,CAEA,gDACE,cAAA,CAIJ,4CACE,cAAA,CACA,MAAA,CACA,OAAA,CACA,QAAA,CACA,YAAA,CACA,qBCtGM,CDuGN,UCnGS,CDoGT,oBAAA,CACA,yEAAA,CACA,SAAA,CACA,YAAA,CACA,qBAAA,CACA,WAAA,CACA,kBAAA,CACA,sBAAA,CACA,0BAAA,CACA,6BAAA,CACA,qBAAA,CAEA,uFACE,uBAAA,CAIJ,4CACE,UAAA,CACA,WAAA,CACA,iBAAA,CACA,wBAAA,CACA,wBC/Gc,CDgHd,YAAA,CACA,cAAA,CACA,UCjIM,CDkIN,cAAA,CACA,eAAA,CACA,gBAAA,CACA,iBAAA,CACA,gBAAA,CAEA,oGAEE,wBC3HY,CD+HhB,4CACE,YAAA,CACA,UAAA,CACA,WAAA,CAGF,4CACE,YAAA,CACA,UAAA,CACA,kBAAA\",\"sourcesContent\":[\".container{position:fixed;top:0;right:0;bottom:0;left:0;width:100vw;height:100%;max-height:100vh;margin:0 !important;z-index:100000;user-select:none;display:flex;flex-direction:column;transition:transform .15s ease-in;transform:translateX(100vw);will-change:transform}.container.visible{left:0;transform:translateX(0)}.container.visible .header{box-shadow:0 4px 8px 0 rgba(51,51,51,.1)}.header{position:relative;width:100%;height:56px;box-sizing:border-box;margin:0;background-color:#fff;color:#666;text-decoration:none;z-index:1;display:flex;flex-direction:column;align-items:center;box-shadow:0 4px 8px 0 rgba(51,51,51,0)}.header.largeHeaderHeight{height:96px}.backButton{box-sizing:border-box;height:100%;width:56px;z-index:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.backButton>svg{color:#717fa4}.titleLabel{position:relative;box-sizing:border-box;height:100%;width:100%;color:#132968;font-size:18px;font-weight:bold;display:flex;flex-direction:row;align-items:center;justify-content:center}.button{box-sizing:border-box;height:100%;width:56px;min-width:56px;max-width:56px}.content{position:relative;width:100%;height:calc(100vh - 56px);overflow:scroll;-webkit-overflow-scrolling:touch;background-color:#fff;opacity:1}.content>div{min-width:100%}.footer{position:fixed;left:0;right:0;bottom:0;padding:12px;background-color:#fff;color:#666;text-decoration:none;box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.1),0 -2px 6px 0 rgba(51,51,51,.1);z-index:1;display:flex;flex-direction:column;row-gap:8px;align-items:center;justify-content:center;transform:translateY(100%);transition:transform .3s ease;will-change:transform}.footer.visible{transform:translateY(0)}.confirmButton{width:100%;height:100%;border-radius:8px;border:1px solid #fa6b6b;background-color:#fa6b6b;outline:none;cursor:pointer;color:#fff;font-size:16px;font-weight:500;line-height:24px;text-align:center;padding:7px 20px}.confirmButton:hover,.confirmButton:focus{background-color:#fa6b6b}.headerTopRow{display:flex;width:100%;height:48px}.headerMoreControls{display:flex;width:100%;flex-direction:row}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"whitelabel_ferretMobileSidebarPanel__QmTJ3\",\n\t\"visible\": \"whitelabel_ferretMobileSidebarPanel__v9vTN\",\n\t\"header\": \"whitelabel_ferretMobileSidebarPanel__l1tXN\",\n\t\"largeHeaderHeight\": \"whitelabel_ferretMobileSidebarPanel__TqpcM\",\n\t\"backButton\": \"whitelabel_ferretMobileSidebarPanel__teCAj\",\n\t\"titleLabel\": \"whitelabel_ferretMobileSidebarPanel__JMfGl\",\n\t\"button\": \"whitelabel_ferretMobileSidebarPanel__ctpNv\",\n\t\"content\": \"whitelabel_ferretMobileSidebarPanel__P11Jw\",\n\t\"footer\": \"whitelabel_ferretMobileSidebarPanel__g7k8A\",\n\t\"confirmButton\": \"whitelabel_ferretMobileSidebarPanel__uWmaz\",\n\t\"headerTopRow\": \"whitelabel_ferretMobileSidebarPanel__h7L01\",\n\t\"headerMoreControls\": \"whitelabel_ferretMobileSidebarPanel__PhQh2\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_mobile__Ucohj{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.whitelabel_mobile__lWWuB{max-width:1136px;padding:16px;border-radius:8px;background-color:#fff}.whitelabel_mobile__V9VqK{display:flex;justify-content:space-between;align-items:center;min-height:24px;margin-bottom:8px;margin-top:4px}.whitelabel_mobile__ySJkV{display:flex}.whitelabel_mobile__Yqbwq{display:flex;width:100%}.whitelabel_mobile__ykZwa{overflow:hidden}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/mobile/Layout.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCXF,EACE,qBAAA,CAGF,0BACE,gBAAA,CACA,YAAA,CACA,iBAAA,CACA,qBAAA,CAGF,0BACE,YAAA,CACA,6BAAA,CACA,kBAAA,CACA,eAAA,CACA,iBAAA,CACA,cAAA,CAGF,0BACE,YAAA,CAGF,0BACE,YAAA,CACA,UAAA,CAGF,0BACE,eAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.container{max-width:1136px;padding:16px;border-radius:8px;background-color:#fff}.top{display:flex;justify-content:space-between;align-items:center;min-height:24px;margin-bottom:8px;margin-top:4px}.topRight{display:flex}.calendarInputs{display:flex;width:100%}.passengersInput{overflow:hidden}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_mobile__Ucohj\",\n\t\"container\": \"whitelabel_mobile__lWWuB\",\n\t\"top\": \"whitelabel_mobile__V9VqK\",\n\t\"topRight\": \"whitelabel_mobile__ySJkV\",\n\t\"calendarInputs\": \"whitelabel_mobile__Yqbwq\",\n\t\"passengersInput\": \"whitelabel_mobile__ykZwa\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"body.noScroll{left:0;right:0;position:relative;height:100vh;overflow:hidden}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/shared/ui/WithBodyScrollBlock.scss\"],\"names\":[],\"mappings\":\"AACE,cACE,MAAA,CACA,OAAA,CACA,iBAAA,CACA,YAAA,CACA,eAAA\",\"sourcesContent\":[\":global body.noScroll{left:0;right:0;position:relative;height:100vh;overflow:hidden}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_suggestions__v3GXu{width:100%;padding:0 24px;list-style:none;cursor:pointer}.whitelabel_suggestions__v3GXu.whitelabel_suggestions__t7KB2{background-color:#f9f9fa}.whitelabel_suggestions__qCh3W{min-height:56px;padding:16px 0;display:flex;align-items:flex-start;justify-content:flex-start;border-bottom:1px solid #e9e9e9}.whitelabel_suggestions__Ss7gz{height:24px;color:#425486;font-size:16px;line-height:24px}.whitelabel_suggestions__RJtMY{height:24px;color:#a1a9c3;font-size:16px;line-height:24px}.whitelabel_suggestions__gukSq{flex-shrink:0}.whitelabel_suggestions__gukSq svg{width:24px;height:24px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/suggestions/Suggestion.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,+BACE,UAAA,CACA,cAAA,CACA,eAAA,CACA,cAAA,CAEA,6DACE,wBAAA,CAIJ,+BACE,eAAA,CACA,cAAA,CACA,YAAA,CACA,sBAAA,CACA,0BAAA,CAEA,+BAAA,CAGF,+BACE,WAAA,CACA,aCPiB,CDQjB,cAAA,CACA,gBAAA,CAGF,+BACE,WAAA,CACA,aCZiB,CDajB,cAAA,CACA,gBAAA,CAGF,+BACE,aAAA,CAEA,mCACE,UAAA,CACA,WAAA\",\"sourcesContent\":[\".itemContainer{width:100%;padding:0 24px;list-style:none;cursor:pointer}.itemContainer.isActive{background-color:#f9f9fa}.item{min-height:56px;padding:16px 0;display:flex;align-items:flex-start;justify-content:flex-start;border-bottom:1px solid #e9e9e9}.city{height:24px;color:#425486;font-size:16px;line-height:24px}.country{height:24px;color:#a1a9c3;font-size:16px;line-height:24px}.iconWrap{flex-shrink:0}.iconWrap svg{width:24px;height:24px}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"itemContainer\": \"whitelabel_suggestions__v3GXu\",\n\t\"isActive\": \"whitelabel_suggestions__t7KB2\",\n\t\"item\": \"whitelabel_suggestions__qCh3W\",\n\t\"city\": \"whitelabel_suggestions__Ss7gz\",\n\t\"country\": \"whitelabel_suggestions__RJtMY\",\n\t\"iconWrap\": \"whitelabel_suggestions__gukSq\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_suggestions__q9VeN{width:100%;overflow:hidden;background-color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;user-select:none;min-width:320px}.whitelabel_suggestions__fhXTG{display:flex;background:#fff8eb;color:#f7a600;font-size:12px;width:100%;line-height:17px;vertical-align:middle;padding:17px 24px}.whitelabel_suggestions__fhXTG .whitelabel_suggestions__uvMTH{order:1;align-items:center;justify-content:center;display:flex}.whitelabel_suggestions__fhXTG .whitelabel_suggestions__uvMTH .whitelabel_suggestions__bSZeN{width:24px;height:24px}.whitelabel_suggestions__fhXTG .whitelabel_suggestions__XX2l9{order:2;padding-left:18px;padding-right:10px}.whitelabel_suggestions__h3qNe{width:100%;background-color:#f1f2f6;padding:8px 24px;height:40px}.whitelabel_suggestions__h3qNe>span{color:#a1a9c3;font-size:12px;font-weight:500;letter-spacing:1.2px;line-height:16px;text-transform:uppercase}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/components/suggestions/Suggestions.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,+BACE,UAAA,CACA,eAAA,CACA,qBAAA,CACA,YAAA,CACA,qBAAA,CACA,kBAAA,CACA,sBAAA,CACA,gBAAA,CACA,eAAA,CAGF,+BACE,YAAA,CACA,kBAAA,CACA,aAAA,CACA,cAAA,CACA,UAAA,CACA,gBAAA,CACA,qBAAA,CACA,iBAAA,CACA,8DACE,OAAA,CACA,kBAAA,CACA,sBAAA,CACA,YAAA,CACA,6FACE,UAAA,CACA,WAAA,CAGJ,8DACE,OAAA,CACA,iBAAA,CACA,kBAAA,CAIJ,+BACE,UAAA,CACA,wBCfa,CDgBb,gBAAA,CACA,WAAA,CAEA,oCACE,aC3Be,CD4Bf,cAAA,CACA,eAAA,CACA,oBAAA,CACA,gBAAA,CACA,wBAAA\",\"sourcesContent\":[\".container{width:100%;overflow:hidden;background-color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;user-select:none;min-width:320px}.warningTitle{display:flex;background:#fff8eb;color:#f7a600;font-size:12px;width:100%;line-height:17px;vertical-align:middle;padding:17px 24px}.warningTitle .warningTitleIcon{order:1;align-items:center;justify-content:center;display:flex}.warningTitle .warningTitleIcon .warningTitleIconInner{width:24px;height:24px}.warningTitle .warningTitleText{order:2;padding-left:18px;padding-right:10px}.popularDestinationsTitle{width:100%;background-color:#f1f2f6;padding:8px 24px;height:40px}.popularDestinationsTitle>span{color:#a1a9c3;font-size:12px;font-weight:500;letter-spacing:1.2px;line-height:16px;text-transform:uppercase}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"container\": \"whitelabel_suggestions__q9VeN\",\n\t\"warningTitle\": \"whitelabel_suggestions__fhXTG\",\n\t\"warningTitleIcon\": \"whitelabel_suggestions__uvMTH\",\n\t\"warningTitleIconInner\": \"whitelabel_suggestions__bSZeN\",\n\t\"warningTitleText\": \"whitelabel_suggestions__XX2l9\",\n\t\"popularDestinationsTitle\": \"whitelabel_suggestions__h3qNe\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__qUsp0{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__C3xf2{float:right}.whitelabel_styles__Efnqt{display:flex;flex-wrap:wrap}.whitelabel_styles__XwMUJ{width:100%}.whitelabel_styles__aZT2X{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__bfEDB{padding:15px;min-width:250px}.whitelabel_styles__j7zhD{position:relative}.whitelabel_styles__vqIGi{position:absolute}.whitelabel_styles__Na3QE{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.whitelabel_styles__Na3QE .whitelabel_styles__pCqky{padding:0 8px}.whitelabel_styles__Na3QE:focus{outline:none}.whitelabel_styles__Na3QE:hover{cursor:pointer}.whitelabel_styles__PG_np{cursor:pointer;width:20px;height:20px}.whitelabel_styles__e3NXw{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.whitelabel_styles__rhAGH{font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.whitelabel_styles__rhAGH.whitelabel_styles__XqLqP{border-right:1px solid #ccc}.whitelabel_styles__Q7fLP{background:#fff}.whitelabel_styles__I_4gr{}.whitelabel_styles__I_4gr>:first-child{border-radius:8px 0 0 8px}.whitelabel_styles__I_4gr>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.whitelabel_styles__eyPRR{flex-direction:column;padding:5px;height:28px}.whitelabel_styles__hok3u svg{cursor:pointer}.whitelabel_styles__Z9gUS svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.whitelabel_styles__Na3QE{height:40px}.whitelabel_styles__eyPRR{height:28px}}@media screen and (min-width: 1024px){.whitelabel_styles__Na3QE{border-radius:0}.whitelabel_styles__Na3QE.whitelabel_styles__YZplv{margin:0 2px 0 0}.whitelabel_styles__Na3QE.whitelabel_styles__YZplv .whitelabel_styles__pCqky{padding:0 4px}}@media screen and (max-width: 1023px){.whitelabel_styles__e3NXw.whitelabel_styles__hgIxz{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_styles__Na3QE.whitelabel_styles__ys6FL{border-radius:0}.whitelabel_styles__Na3QE.whitelabel_styles__ys6FL.whitelabel_styles__YZplv{margin:0 2px 0 0}.whitelabel_styles__Na3QE.whitelabel_styles__ys6FL.whitelabel_styles__YZplv .whitelabel_styles__pCqky{padding:0 4px}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/buttons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CC5BF,0BFmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CEpBA,YAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CACA,WDZY,CCaZ,iBDda,CCeb,eAAA,CACA,QAAA,CACA,oDACE,aAAA,CAEF,gCACE,YAAA,CAEF,gCACE,cAAA,CAGJ,0BACE,cAAA,CACA,UAAA,CACA,WAAA,CAEF,0BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,0BFTE,cA1Bc,CA2Bd,eA9BiB,CA+BjB,iBAAA,CACA,mBAAA,CESA,wBCnCU,CDoCV,UAAA,CACA,MAAA,CAEA,mDACE,2BAAA,CAIJ,0BAEE,eAAA,CAGF,0BACE,CACA,uCACE,yBAAA,CAEF,sCACE,yBAAA,CACA,6BAAA,CAIJ,0BAEE,qBAAA,CACA,WAAA,CACA,WArEkB,CAyElB,8BACE,cAAA,CAIF,8BACE,cAAA,CACA,kBCjFG,CDqFP,qCACE,0BACE,WAAA,CAGF,0BACE,WA1FgB,CAAA,CA8FpB,sCACE,0BACE,eAAA,CACA,mDACE,gBAAA,CACA,6EACE,aAAA,CAAA,CAMR,sCAEI,mDACE,SAAA,CAAA,CAKN,4DAEI,mDACE,eAAA,CACA,4EACE,gBAAA,CACA,sGACE,aAAA,CAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.button{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.button .icon-wrap{padding:0 8px}.button:focus{outline:none}.button:hover{cursor:pointer}.close-icon-wrap{cursor:pointer;width:20px;height:20px}.close-icon-container{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.button-gray{composes:button;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.button-gray.divider{border-right:1px solid #ccc}.button-white{composes:button;background:#fff}.button-dual{composes:button}.button-dual>:first-child{border-radius:8px 0 0 8px}.button-dual>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.button-small{composes:button;flex-direction:column;padding:5px;height:28px}.plus svg{cursor:pointer}.minus svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.button{height:40px}.button-small{height:28px}}@media screen and (min-width: 1024px){.button{border-radius:0}.button.isDesktop{margin:0 2px 0 0}.button.isDesktop .icon-wrap{padding:0 4px}}@media screen and (max-width: 1023px){.close-icon-container.isSrp{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.button.isLps{border-radius:0}.button.isLps.isDesktop{margin:0 2px 0 0}.button.isLps.isDesktop .icon-wrap{padding:0 4px}}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_styles__qUsp0\",\n\t\"floatRight\": \"whitelabel_styles__C3xf2\",\n\t\"flexWrap\": \"whitelabel_styles__Efnqt\",\n\t\"fullWidth\": \"whitelabel_styles__XwMUJ\",\n\t\"flexCenter\": \"whitelabel_styles__aZT2X\",\n\t\"centeredHeader\": \"whitelabel_styles__bfEDB whitelabel_styles__aZT2X\",\n\t\"relative\": \"whitelabel_styles__j7zhD\",\n\t\"absolute\": \"whitelabel_styles__vqIGi\",\n\t\"button\": \"whitelabel_styles__Na3QE\",\n\t\"icon-wrap\": \"whitelabel_styles__pCqky\",\n\t\"close-icon-wrap\": \"whitelabel_styles__PG_np\",\n\t\"close-icon-container\": \"whitelabel_styles__e3NXw\",\n\t\"button-gray\": \"whitelabel_styles__rhAGH whitelabel_styles__Na3QE\",\n\t\"divider\": \"whitelabel_styles__XqLqP\",\n\t\"button-white\": \"whitelabel_styles__Q7fLP whitelabel_styles__Na3QE\",\n\t\"button-dual\": \"whitelabel_styles__I_4gr whitelabel_styles__Na3QE\",\n\t\"button-small\": \"whitelabel_styles__eyPRR whitelabel_styles__Na3QE\",\n\t\"plus\": \"whitelabel_styles__hok3u\",\n\t\"minus\": \"whitelabel_styles__Z9gUS\",\n\t\"isDesktop\": \"whitelabel_styles__YZplv\",\n\t\"isSrp\": \"whitelabel_styles__hgIxz\",\n\t\"isLps\": \"whitelabel_styles__ys6FL\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__bZD9z{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__IPIYE{float:right}.whitelabel_styles___Q7Dy{display:flex;flex-wrap:wrap}.whitelabel_styles__wqcG2{width:100%}.whitelabel_styles__ytqzY{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__ikdqR{padding:15px;min-width:250px}.whitelabel_styles__APzKW{position:relative}.whitelabel_styles__QmXN2{position:absolute}.whitelabel_styles__bZD9z{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__IPIYE{float:right}.whitelabel_styles___Q7Dy{display:flex;flex-wrap:wrap}.whitelabel_styles__wqcG2{width:100%}.whitelabel_styles__ytqzY{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__ikdqR{padding:15px;min-width:250px}.whitelabel_styles__APzKW{position:relative}.whitelabel_styles__QmXN2{position:absolute}.whitelabel_styles__v1nXb{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.whitelabel_styles__v1nXb .whitelabel_styles__O1Fqe{padding:0 8px}.whitelabel_styles__v1nXb:focus{outline:none}.whitelabel_styles__v1nXb:hover{cursor:pointer}.whitelabel_styles__L1CnU{cursor:pointer;width:20px;height:20px}.whitelabel_styles__lzh3c{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.whitelabel_styles__fxLpC{font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.whitelabel_styles__fxLpC.whitelabel_styles__e7Wn0{border-right:1px solid #ccc}.whitelabel_styles__Sdshb{background:#fff}.whitelabel_styles__juhPP{}.whitelabel_styles__juhPP>:first-child{border-radius:8px 0 0 8px}.whitelabel_styles__juhPP>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.whitelabel_styles__I257N{flex-direction:column;padding:5px;height:28px}.whitelabel_styles__eWdpU svg{cursor:pointer}.whitelabel_styles__P8Nsg svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.whitelabel_styles__v1nXb{height:40px}.whitelabel_styles__I257N{height:28px}}@media screen and (min-width: 1024px){.whitelabel_styles__v1nXb{border-radius:0}.whitelabel_styles__v1nXb.whitelabel_styles___SrYA{margin:0 2px 0 0}.whitelabel_styles__v1nXb.whitelabel_styles___SrYA .whitelabel_styles__O1Fqe{padding:0 4px}}@media screen and (max-width: 1023px){.whitelabel_styles__lzh3c.whitelabel_styles__H_TRw{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_styles__v1nXb.whitelabel_styles__EepTY{border-radius:0}.whitelabel_styles__v1nXb.whitelabel_styles__EepTY.whitelabel_styles___SrYA{margin:0 2px 0 0}.whitelabel_styles__v1nXb.whitelabel_styles__EepTY.whitelabel_styles___SrYA .whitelabel_styles__O1Fqe{padding:0 4px}}.whitelabel_styles__qc36v{text-align:center;font-size:13px;padding:5px;border-top:#f2f2f2}.whitelabel_styles__e2ksh{padding:0 5px;margin:0;display:flex}.whitelabel_styles__v3UQu{box-sizing:border-box;list-style:none;font-size:13px;text-align:center;font-weight:400;display:block;width:100%;padding:0 4px;min-width:35px;height:35px;line-height:35px;color:#000;cursor:pointer}.whitelabel_styles__KfVj3{font-size:10px;color:#999;text-transform:uppercase}.whitelabel_styles__Y9HtH{border-radius:50%;width:35px;margin:0 auto;transition:background .13s ease-in}.whitelabel_styles__Y9HtH:hover{background:#f2f2f2}.whitelabel_styles__F6dKj{color:#999;pointer-events:none;cursor:default}.whitelabel_styles__UldoH{color:#333;background-color:#f2f2f2;position:relative}.whitelabel_styles__UldoH:hover{cursor:pointer}.whitelabel_styles__ZroUl{background:#fff}.whitelabel_styles__F0INe{background:linear-gradient(90deg, white 0%, #f2f2f2 100%)}.whitelabel_styles__kOYII{background:linear-gradient(90deg, #f2f2f2 0%, white 100%)}.whitelabel_styles__YNokI .whitelabel_styles__Y9HtH{color:#fff;background-color:#f7a600}.whitelabel_styles__pbhCw{max-width:calc(100% - 44px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.whitelabel_styles__qLtIN{color:#a1a9c3}@media screen and (min-width: 768px){.whitelabel_styles__UyhnG{max-width:calc(100% - 14px);text-overflow:unset}.whitelabel_styles__p775G{max-width:calc(100% - 30px);text-overflow:unset}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/buttons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/calendar.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CDxBF,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CC5BF,0BFmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CEpBA,YAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CACA,WDZY,CCaZ,iBDda,CCeb,eAAA,CACA,QAAA,CACA,oDACE,aAAA,CAEF,gCACE,YAAA,CAEF,gCACE,cAAA,CAGJ,0BACE,cAAA,CACA,UAAA,CACA,WAAA,CAEF,0BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,0BFTE,cA1Bc,CA2Bd,eA9BiB,CA+BjB,iBAAA,CACA,mBAAA,CESA,wBCnCU,CDoCV,UAAA,CACA,MAAA,CAEA,mDACE,2BAAA,CAIJ,0BAEE,eAAA,CAGF,0BACE,CACA,uCACE,yBAAA,CAEF,sCACE,yBAAA,CACA,6BAAA,CAIJ,0BAEE,qBAAA,CACA,WAAA,CACA,WArEkB,CAyElB,8BACE,cAAA,CAIF,8BACE,cAAA,CACA,kBCjFG,CDqFP,qCACE,0BACE,WAAA,CAGF,0BACE,WA1FgB,CAAA,CA8FpB,sCACE,0BACE,eAAA,CACA,mDACE,gBAAA,CACA,6EACE,aAAA,CAAA,CAMR,sCAEI,mDACE,SAAA,CAAA,CAKN,4DAEI,mDACE,eAAA,CACA,4EACE,gBAAA,CACA,sGACE,aAAA,CAAA,CEnHV,0BACE,iBAAA,CACA,cALY,CAMZ,WAAA,CACA,kBDLU,CCQZ,0BACE,aAAA,CACA,QAAA,CACA,YAAA,CAGF,0BAEE,qBAAA,CACA,eAAA,CACA,cApBY,CAqBZ,iBAAA,CACA,eAAA,CACA,aAAA,CACA,UAAA,CACA,aAAA,CACA,cA3BQ,CA4BR,WA5BQ,CA6BR,gBA7BQ,CA8BR,UAAA,CACA,cAAA,CAGF,0BACE,cAjCgB,CAmChB,UDhCK,CCiCL,wBAAA,CAGF,0BACE,iBAAA,CACA,UA3CQ,CA4CR,aAAA,CACA,kCAAA,CACA,gCACE,kBD5CQ,CCgDZ,0BACE,UD/CK,CCgDL,mBAAA,CACA,cAAA,CAGF,0BACE,UDnDM,CCoDN,wBDxDU,CCyDV,iBAAA,CACA,gCACE,cAAA,CAIJ,0BACE,eAAA,CAGF,0BACE,yDAAA,CAGF,0BACE,yDAAA,CAIA,oDACE,UAAA,CACA,wBDjFK,CCqFT,0BACE,2BAAA,CACA,eAAA,CACA,kBAAA,CACA,sBAAA,CAGF,0BACE,aD/EiB,CCkFnB,qCACE,0BACE,2BAAA,CACA,mBAAA,CAEF,0BACE,2BAAA,CACA,mBAAA,CAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\"@import 'colors';\\n@import 'typography';\\n@import 'layout';\\n@import 'mediaQueries';\\n$smallButtonHeight: 28px;\\n\\n.button {\\n @include defaultInputFontStyle();\\n display: flex;\\n position: relative;\\n align-items: center;\\n flex-wrap: wrap;\\n justify-content: flex-start;\\n height: $inputHeight;\\n border-radius: $borderRadius;\\n background: white;\\n margin: 0;\\n .icon-wrap {\\n padding: 0 8px;\\n }\\n &:focus {\\n outline: none;\\n }\\n &:hover {\\n cursor: pointer;\\n }\\n}\\n.close-icon-wrap {\\n cursor: pointer;\\n width: 20px;\\n height: 20px;\\n}\\n.close-icon-container {\\n position: absolute;\\n top: 0;\\n right: 4px;\\n display: flex;\\n height: 100%;\\n align-items: center;\\n}\\n\\n.button-gray {\\n composes: button;\\n @include smallFont();\\n background-color: $lightgray;\\n width: 100%;\\n flex: 1;\\n\\n &.divider {\\n border-right: 1px solid $midgray;\\n }\\n}\\n\\n.button-white {\\n composes: button;\\n background: white;\\n}\\n\\n.button-dual {\\n composes: button;\\n & > :first-child {\\n border-radius: $borderRadius 0 0 $borderRadius;\\n }\\n & > :last-child {\\n border-radius: 0 $borderRadius $borderRadius 0;\\n border-left: 1px $lightgray solid;\\n }\\n}\\n\\n.button-small {\\n composes: button;\\n flex-direction: column;\\n padding: 5px;\\n height: $smallButtonHeight;\\n}\\n\\n.plus {\\n svg {\\n cursor: pointer;\\n }\\n}\\n.minus {\\n svg {\\n cursor: pointer;\\n background: $blue;\\n }\\n}\\n\\n@media screen and (min-width: 500px) {\\n .button {\\n height: 40px;\\n }\\n\\n .button-small {\\n height: $smallButtonHeight;\\n }\\n}\\n\\n@media screen and (min-width: $desktopMin) {\\n .button {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n}\\n\\n@media screen and (max-width: calc($desktopMin - 1px)) {\\n .close-icon-container {\\n &.isSrp {\\n right: 8px;\\n }\\n }\\n}\\n\\n@media screen and (min-width: $tabletMin) and (max-width: calc($desktopMin - 1px)) {\\n .button {\\n &.isLps {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n }\\n}\\n\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.button{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.button .icon-wrap{padding:0 8px}.button:focus{outline:none}.button:hover{cursor:pointer}.close-icon-wrap{cursor:pointer;width:20px;height:20px}.close-icon-container{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.button-gray{composes:button;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.button-gray.divider{border-right:1px solid #ccc}.button-white{composes:button;background:#fff}.button-dual{composes:button}.button-dual>:first-child{border-radius:8px 0 0 8px}.button-dual>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.button-small{composes:button;flex-direction:column;padding:5px;height:28px}.plus svg{cursor:pointer}.minus svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.button{height:40px}.button-small{height:28px}}@media screen and (min-width: 1024px){.button{border-radius:0}.button.isDesktop{margin:0 2px 0 0}.button.isDesktop .icon-wrap{padding:0 4px}}@media screen and (max-width: 1023px){.close-icon-container.isSrp{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.button.isLps{border-radius:0}.button.isLps.isDesktop{margin:0 2px 0 0}.button.isLps.isDesktop .icon-wrap{padding:0 4px}}.monthName{text-align:center;font-size:13px;padding:5px;border-top:#f2f2f2}.calendarRow{padding:0 5px;margin:0;display:flex}.day{composes:defaultFont;box-sizing:border-box;list-style:none;font-size:13px;text-align:center;font-weight:400;display:block;width:100%;padding:0 4px;min-width:35px;height:35px;line-height:35px;color:#000;cursor:pointer}.weekday{font-size:10px;composes:day;color:#999;text-transform:uppercase}.dayLabel{border-radius:50%;width:35px;margin:0 auto;transition:background .13s ease-in}.dayLabel:hover{background:#f2f2f2}.unavailableDay{color:#999;pointer-events:none;cursor:default}.isWithinSelectionRange{color:#333;background-color:#f2f2f2;position:relative}.isWithinSelectionRange:hover{cursor:pointer}.firstSelectedDay{background:#fff}.firstSelectRoundTrip{background:linear-gradient(90deg, white 0%, #f2f2f2 100%)}.lastSelectedDay{background:linear-gradient(90deg, #f2f2f2 0%, white 100%)}.activeDay .dayLabel{color:#fff;background-color:#f7a600}.text-wrap{max-width:calc(100% - 44px);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.addReturnColor{color:#a1a9c3}@media screen and (min-width: 768px){.textWrapSmall{max-width:calc(100% - 14px);text-overflow:unset}.textWrapReturn{max-width:calc(100% - 30px);text-overflow:unset}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_styles__bZD9z\",\n\t\"floatRight\": \"whitelabel_styles__IPIYE\",\n\t\"flexWrap\": \"whitelabel_styles___Q7Dy\",\n\t\"fullWidth\": \"whitelabel_styles__wqcG2\",\n\t\"flexCenter\": \"whitelabel_styles__ytqzY\",\n\t\"centeredHeader\": \"whitelabel_styles__ikdqR whitelabel_styles__ytqzY whitelabel_styles__ytqzY\",\n\t\"relative\": \"whitelabel_styles__APzKW\",\n\t\"absolute\": \"whitelabel_styles__QmXN2\",\n\t\"button\": \"whitelabel_styles__v1nXb\",\n\t\"icon-wrap\": \"whitelabel_styles__O1Fqe\",\n\t\"close-icon-wrap\": \"whitelabel_styles__L1CnU\",\n\t\"close-icon-container\": \"whitelabel_styles__lzh3c\",\n\t\"button-gray\": \"whitelabel_styles__fxLpC whitelabel_styles__v1nXb\",\n\t\"divider\": \"whitelabel_styles__e7Wn0\",\n\t\"button-white\": \"whitelabel_styles__Sdshb whitelabel_styles__v1nXb\",\n\t\"button-dual\": \"whitelabel_styles__juhPP whitelabel_styles__v1nXb\",\n\t\"button-small\": \"whitelabel_styles__I257N whitelabel_styles__v1nXb\",\n\t\"plus\": \"whitelabel_styles__eWdpU\",\n\t\"minus\": \"whitelabel_styles__P8Nsg\",\n\t\"isDesktop\": \"whitelabel_styles___SrYA\",\n\t\"isSrp\": \"whitelabel_styles__H_TRw\",\n\t\"isLps\": \"whitelabel_styles__EepTY\",\n\t\"monthName\": \"whitelabel_styles__qc36v\",\n\t\"calendarRow\": \"whitelabel_styles__e2ksh\",\n\t\"day\": \"whitelabel_styles__v3UQu whitelabel_styles__bZD9z\",\n\t\"weekday\": \"whitelabel_styles__KfVj3 whitelabel_styles__v3UQu whitelabel_styles__bZD9z\",\n\t\"dayLabel\": \"whitelabel_styles__Y9HtH\",\n\t\"unavailableDay\": \"whitelabel_styles__F6dKj\",\n\t\"isWithinSelectionRange\": \"whitelabel_styles__UldoH\",\n\t\"firstSelectedDay\": \"whitelabel_styles__ZroUl\",\n\t\"firstSelectRoundTrip\": \"whitelabel_styles__F0INe\",\n\t\"lastSelectedDay\": \"whitelabel_styles__kOYII\",\n\t\"activeDay\": \"whitelabel_styles__YNokI\",\n\t\"text-wrap\": \"whitelabel_styles__pbhCw\",\n\t\"addReturnColor\": \"whitelabel_styles__qLtIN\",\n\t\"textWrapSmall\": \"whitelabel_styles__UyhnG\",\n\t\"textWrapReturn\": \"whitelabel_styles__p775G\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__hRypz{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__UlmwM{float:right}.whitelabel_styles__Pvuu9{display:flex;flex-wrap:wrap}.whitelabel_styles__e8WLK{width:100%}.whitelabel_styles__l_ewq{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__aLL7U{padding:15px;min-width:250px}.whitelabel_styles__FX_kI{position:relative}.whitelabel_styles__bb6dl{position:absolute}.whitelabel_styles__hRypz{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__UlmwM{float:right}.whitelabel_styles__Pvuu9{display:flex;flex-wrap:wrap}.whitelabel_styles__e8WLK{width:100%}.whitelabel_styles__l_ewq{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__aLL7U{padding:15px;min-width:250px}.whitelabel_styles__FX_kI{position:relative}.whitelabel_styles__bb6dl{position:absolute}.whitelabel_styles__ixVOy{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.whitelabel_styles__ixVOy .whitelabel_styles__s7R4N{padding:0 8px}.whitelabel_styles__ixVOy:focus{outline:none}.whitelabel_styles__ixVOy:hover{cursor:pointer}.whitelabel_styles__T2vVI{cursor:pointer;width:20px;height:20px}.whitelabel_styles__d9Vud{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.whitelabel_styles__fCbYG{font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.whitelabel_styles__fCbYG.whitelabel_styles__AygbZ{border-right:1px solid #ccc}.whitelabel_styles__PAbM6{background:#fff}.whitelabel_styles__wD0rm{}.whitelabel_styles__wD0rm>:first-child{border-radius:8px 0 0 8px}.whitelabel_styles__wD0rm>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.whitelabel_styles__lbXOn{flex-direction:column;padding:5px;height:28px}.whitelabel_styles__PPevJ svg{cursor:pointer}.whitelabel_styles__ex0Mz svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.whitelabel_styles__ixVOy{height:40px}.whitelabel_styles__lbXOn{height:28px}}@media screen and (min-width: 1024px){.whitelabel_styles__ixVOy{border-radius:0}.whitelabel_styles__ixVOy.whitelabel_styles__T5hL9{margin:0 2px 0 0}.whitelabel_styles__ixVOy.whitelabel_styles__T5hL9 .whitelabel_styles__s7R4N{padding:0 4px}}@media screen and (max-width: 1023px){.whitelabel_styles__d9Vud.whitelabel_styles__unpsz{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_styles__ixVOy.whitelabel_styles__q7ATQ{border-radius:0}.whitelabel_styles__ixVOy.whitelabel_styles__q7ATQ.whitelabel_styles__T5hL9{margin:0 2px 0 0}.whitelabel_styles__ixVOy.whitelabel_styles__q7ATQ.whitelabel_styles__T5hL9 .whitelabel_styles__s7R4N{padding:0 4px}}.whitelabel_styles__nhxtD{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;position:relative;height:48px;border:1px solid #fff;border-radius:8px;font-size:16px;cursor:pointer;transition:border .15s ease;color:#132968;background-color:#f1f2f6;box-shadow:none;display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start}.whitelabel_styles__nhxtD:focus,.whitelabel_styles__jS9ZN{outline:none;border:1px solid #a1a9c3 !important;z-index:1}.whitelabel_styles__Xh2Ot{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;position:relative;height:48px;border:1px solid #f1f2f6;font-size:16px;letter-spacing:.3px;cursor:pointer;transition:border .15s ease;color:#132968;background-color:#f1f2f6;box-shadow:none;display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start}.whitelabel_styles__Xh2Ot.whitelabel_styles__FX9D9{flex:1;border-radius:8px 0 0 8px}.whitelabel_styles__Xh2Ot.whitelabel_styles__SVQUB{flex:1;border-radius:0 8px 8px 0;padding:0 0 0 20px;position:relative}.whitelabel_styles__Xh2Ot.whitelabel_styles__SVQUB::before{position:absolute;left:-1px;top:50%;margin-top:-12px;content:\\\"\\\";height:24px;width:1px;background-color:#ccc}.whitelabel_styles__Xh2Ot.whitelabel_styles__SVQUB>div:first-child{padding:0}.whitelabel_styles__Xh2Ot:focus{border:1px solid #a1a9c3}.whitelabel_styles__Xh2Ot:focus.whitelabel_styles__SVQUB::before{display:none}@media screen and (min-width: 1024px){.whitelabel_styles__Xh2Ot.whitelabel_styles__FX9D9{flex:1}.whitelabel_styles__Xh2Ot.whitelabel_styles__SVQUB{flex:1;margin-left:-1px}.whitelabel_styles__Xh2Ot.whitelabel_styles__TGAPZ{border-top-right-radius:8px;border-bottom-right-radius:8px}.whitelabel_styles__Xh2Ot:focus,.whitelabel_styles__Xh2Ot:hover{border:1px solid #a1a9c3}.whitelabel_styles__Xh2Ot:focus.whitelabel_styles__SVQUB::before,.whitelabel_styles__Xh2Ot:hover.whitelabel_styles__SVQUB::before{display:none}.whitelabel_styles__Xh2Ot:focus.whitelabel_styles__FX9D9,.whitelabel_styles__Xh2Ot:hover.whitelabel_styles__FX9D9{z-index:1}}.whitelabel_styles__tYMNM{color:#5e90cc;line-height:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/buttons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/calendarInputs.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CDxBF,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CC5BF,0BFmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CEpBA,YAAA,CACA,iBAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CACA,WDZY,CCaZ,iBDda,CCeb,eAAA,CACA,QAAA,CACA,oDACE,aAAA,CAEF,gCACE,YAAA,CAEF,gCACE,cAAA,CAGJ,0BACE,cAAA,CACA,UAAA,CACA,WAAA,CAEF,0BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,0BFTE,cA1Bc,CA2Bd,eA9BiB,CA+BjB,iBAAA,CACA,mBAAA,CESA,wBCnCU,CDoCV,UAAA,CACA,MAAA,CAEA,mDACE,2BAAA,CAIJ,0BAEE,eAAA,CAGF,0BACE,CACA,uCACE,yBAAA,CAEF,sCACE,yBAAA,CACA,6BAAA,CAIJ,0BAEE,qBAAA,CACA,WAAA,CACA,WArEkB,CAyElB,8BACE,cAAA,CAIF,8BACE,cAAA,CACA,kBCjFG,CDqFP,qCACE,0BACE,WAAA,CAGF,0BACE,WA1FgB,CAAA,CA8FpB,sCACE,0BACE,eAAA,CACA,mDACE,gBAAA,CACA,6EACE,aAAA,CAAA,CAMR,sCAEI,mDACE,SAAA,CAAA,CAKN,4DAEI,mDACE,eAAA,CACA,4EACE,gBAAA,CACA,sGACE,aAAA,CAAA,CEvHV,0BJmBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CInBA,iBAAA,CACA,WAAA,CACA,qBAAA,CACA,iBHZa,CGab,cAAA,CACA,cAAA,CACA,2BAAA,CACA,aDCiB,CAAA,wBAUJ,CCTb,eAAA,CAEA,YAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CAEA,0DAEE,YAAA,CACA,mCAAA,CACA,SAAA,CAIJ,0BJRE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CISA,iBAAA,CACA,WAAA,CACA,wBAAA,CACA,cAAA,CACA,mBAAA,CACA,cAAA,CACA,2BAAA,CACA,aD3BiB,CC4BjB,wBDlBa,CCmBb,eAAA,CAEA,YAAA,CACA,kBAAA,CACA,cAAA,CACA,0BAAA,CAEA,mDACE,MAAA,CACA,yBAAA,CAGF,mDACE,MAAA,CACA,yBAAA,CACA,kBAAA,CACA,iBAAA,CAEA,2DACE,iBAAA,CACA,SAAA,CACA,OAAA,CACA,gBAAA,CACA,UAAA,CACA,WAAA,CACA,SAAA,CACA,qBD9DI,CCiEN,mEACE,SAAA,CAIJ,gCACE,wBAAA,CAGE,iEACE,YAAA,CAMR,sCAEI,mDACE,MAAA,CAGF,mDACE,MAAA,CACA,gBAAA,CAGF,mDACE,2BHvGS,CGwGT,8BHxGS,CG2GX,gEAEE,wBAAA,CAGE,kIACE,YAAA,CAIJ,kHACE,SAAA,CAAA,CAMR,0BACE,aDxGqB,CCyGrB,aAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\"@import 'colors';\\n@import 'typography';\\n@import 'layout';\\n@import 'mediaQueries';\\n$smallButtonHeight: 28px;\\n\\n.button {\\n @include defaultInputFontStyle();\\n display: flex;\\n position: relative;\\n align-items: center;\\n flex-wrap: wrap;\\n justify-content: flex-start;\\n height: $inputHeight;\\n border-radius: $borderRadius;\\n background: white;\\n margin: 0;\\n .icon-wrap {\\n padding: 0 8px;\\n }\\n &:focus {\\n outline: none;\\n }\\n &:hover {\\n cursor: pointer;\\n }\\n}\\n.close-icon-wrap {\\n cursor: pointer;\\n width: 20px;\\n height: 20px;\\n}\\n.close-icon-container {\\n position: absolute;\\n top: 0;\\n right: 4px;\\n display: flex;\\n height: 100%;\\n align-items: center;\\n}\\n\\n.button-gray {\\n composes: button;\\n @include smallFont();\\n background-color: $lightgray;\\n width: 100%;\\n flex: 1;\\n\\n &.divider {\\n border-right: 1px solid $midgray;\\n }\\n}\\n\\n.button-white {\\n composes: button;\\n background: white;\\n}\\n\\n.button-dual {\\n composes: button;\\n & > :first-child {\\n border-radius: $borderRadius 0 0 $borderRadius;\\n }\\n & > :last-child {\\n border-radius: 0 $borderRadius $borderRadius 0;\\n border-left: 1px $lightgray solid;\\n }\\n}\\n\\n.button-small {\\n composes: button;\\n flex-direction: column;\\n padding: 5px;\\n height: $smallButtonHeight;\\n}\\n\\n.plus {\\n svg {\\n cursor: pointer;\\n }\\n}\\n.minus {\\n svg {\\n cursor: pointer;\\n background: $blue;\\n }\\n}\\n\\n@media screen and (min-width: 500px) {\\n .button {\\n height: 40px;\\n }\\n\\n .button-small {\\n height: $smallButtonHeight;\\n }\\n}\\n\\n@media screen and (min-width: $desktopMin) {\\n .button {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n}\\n\\n@media screen and (max-width: calc($desktopMin - 1px)) {\\n .close-icon-container {\\n &.isSrp {\\n right: 8px;\\n }\\n }\\n}\\n\\n@media screen and (min-width: $tabletMin) and (max-width: calc($desktopMin - 1px)) {\\n .button {\\n &.isLps {\\n border-radius: 0;\\n &.isDesktop {\\n margin: 0 2px 0 0;\\n .icon-wrap {\\n padding: 0 4px;\\n }\\n }\\n }\\n }\\n}\\n\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.button{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;display:flex;position:relative;align-items:center;flex-wrap:wrap;justify-content:flex-start;height:48px;border-radius:8px;background:#fff;margin:0}.button .icon-wrap{padding:0 8px}.button:focus{outline:none}.button:hover{cursor:pointer}.close-icon-wrap{cursor:pointer;width:20px;height:20px}.close-icon-container{position:absolute;top:0;right:4px;display:flex;height:100%;align-items:center}.button-gray{composes:button;font-size:12px;font-weight:400;font-style:normal;font-stretch:normal;background-color:#f2f2f2;width:100%;flex:1}.button-gray.divider{border-right:1px solid #ccc}.button-white{composes:button;background:#fff}.button-dual{composes:button}.button-dual>:first-child{border-radius:8px 0 0 8px}.button-dual>:last-child{border-radius:0 8px 8px 0;border-left:1px #f2f2f2 solid}.button-small{composes:button;flex-direction:column;padding:5px;height:28px}.plus svg{cursor:pointer}.minus svg{cursor:pointer;background:#2a84b7}@media screen and (min-width: 500px){.button{height:40px}.button-small{height:28px}}@media screen and (min-width: 1024px){.button{border-radius:0}.button.isDesktop{margin:0 2px 0 0}.button.isDesktop .icon-wrap{padding:0 4px}}@media screen and (max-width: 1023px){.close-icon-container.isSrp{right:8px}}@media screen and (min-width: 768px)and (max-width: 1023px){.button.isLps{border-radius:0}.button.isLps.isDesktop{margin:0 2px 0 0}.button.isLps.isDesktop .icon-wrap{padding:0 4px}}.calendarButton{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;position:relative;height:48px;border:1px solid #fff;border-radius:8px;font-size:16px;cursor:pointer;transition:border .15s ease;color:#132968;background-color:#f1f2f6;box-shadow:none;display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start}.calendarButton:focus,.calendarButtonActive{outline:none;border:1px solid #a1a9c3 !important;z-index:1}.dualCalendar{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;composes:button;position:relative;height:48px;border:1px solid #f1f2f6;font-size:16px;letter-spacing:.3px;cursor:pointer;transition:border .15s ease;color:#132968;background-color:#f1f2f6;box-shadow:none;display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-start}.dualCalendar.departureDate{flex:1;border-radius:8px 0 0 8px}.dualCalendar.returnDate{flex:1;border-radius:0 8px 8px 0;padding:0 0 0 20px;position:relative}.dualCalendar.returnDate::before{position:absolute;left:-1px;top:50%;margin-top:-12px;content:\\\"\\\";height:24px;width:1px;background-color:#ccc}.dualCalendar.returnDate>div:first-child{padding:0}.dualCalendar:focus{border:1px solid #a1a9c3}.dualCalendar:focus.returnDate::before{display:none}@media screen and (min-width: 1024px){.dualCalendar.departureDate{flex:1}.dualCalendar.returnDate{flex:1;margin-left:-1px}.dualCalendar.lastInput{border-top-right-radius:8px;border-bottom-right-radius:8px}.dualCalendar:focus,.dualCalendar:hover{border:1px solid #a1a9c3}.dualCalendar:focus.returnDate::before,.dualCalendar:hover.returnDate::before{display:none}.dualCalendar:focus.departureDate,.dualCalendar:hover.departureDate{z-index:1}}.crossIcon{color:#5e90cc;line-height:0}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_styles__hRypz\",\n\t\"floatRight\": \"whitelabel_styles__UlmwM\",\n\t\"flexWrap\": \"whitelabel_styles__Pvuu9\",\n\t\"fullWidth\": \"whitelabel_styles__e8WLK\",\n\t\"flexCenter\": \"whitelabel_styles__l_ewq\",\n\t\"centeredHeader\": \"whitelabel_styles__aLL7U whitelabel_styles__l_ewq whitelabel_styles__l_ewq\",\n\t\"relative\": \"whitelabel_styles__FX_kI\",\n\t\"absolute\": \"whitelabel_styles__bb6dl\",\n\t\"button\": \"whitelabel_styles__ixVOy\",\n\t\"icon-wrap\": \"whitelabel_styles__s7R4N\",\n\t\"close-icon-wrap\": \"whitelabel_styles__T2vVI\",\n\t\"close-icon-container\": \"whitelabel_styles__d9Vud\",\n\t\"button-gray\": \"whitelabel_styles__fCbYG whitelabel_styles__ixVOy\",\n\t\"divider\": \"whitelabel_styles__AygbZ\",\n\t\"button-white\": \"whitelabel_styles__PAbM6 whitelabel_styles__ixVOy\",\n\t\"button-dual\": \"whitelabel_styles__wD0rm whitelabel_styles__ixVOy\",\n\t\"button-small\": \"whitelabel_styles__lbXOn whitelabel_styles__ixVOy\",\n\t\"plus\": \"whitelabel_styles__PPevJ\",\n\t\"minus\": \"whitelabel_styles__ex0Mz\",\n\t\"isDesktop\": \"whitelabel_styles__T5hL9\",\n\t\"isSrp\": \"whitelabel_styles__unpsz\",\n\t\"isLps\": \"whitelabel_styles__q7ATQ\",\n\t\"calendarButton\": \"whitelabel_styles__nhxtD\",\n\t\"calendarButtonActive\": \"whitelabel_styles__jS9ZN\",\n\t\"dualCalendar\": \"whitelabel_styles__Xh2Ot whitelabel_styles__ixVOy\",\n\t\"departureDate\": \"whitelabel_styles__FX9D9\",\n\t\"returnDate\": \"whitelabel_styles__SVQUB\",\n\t\"lastInput\": \"whitelabel_styles__TGAPZ\",\n\t\"crossIcon\": \"whitelabel_styles__tYMNM\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__K0hZS{background-color:#fff;border:none;border-radius:4px;box-shadow:0 1px 4px 0 rgba(0,0,0,.2);margin-top:5px;overflow:auto;position:absolute;z-index:100;max-width:320px}.whitelabel_styles__K0hZS.whitelabel_styles__X4cCE{max-width:100%}.whitelabel_styles__K0hZS:focus{outline:none}.whitelabel_styles__K0hZS.whitelabel_styles__hh2_v{min-width:100%}.whitelabel_styles__K0hZS.whitelabel_styles__yFgoz{min-width:260px}.whitelabel_styles__K0hZS.whitelabel_styles__RmzgU{min-width:424px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/floatingPanel.scss\"],\"names\":[],\"mappings\":\"AAAA,0BACE,qBAAA,CACA,WAAA,CACA,iBAAA,CACA,qCAAA,CACA,cAAA,CACA,aAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CAEA,mDACE,cAAA,CAGF,gCACE,YAAA,CAGF,mDACE,cAAA,CAGF,mDACE,eAAA,CAGF,mDACE,eAAA\",\"sourcesContent\":[\".floatingPanel{background-color:#fff;border:none;border-radius:4px;box-shadow:0 1px 4px 0 rgba(0,0,0,.2);margin-top:5px;overflow:auto;position:absolute;z-index:100;max-width:320px}.floatingPanel.fluid{max-width:100%}.floatingPanel:focus{outline:none}.floatingPanel.fullWidth{min-width:100%}.floatingPanel.minWidth{min-width:260px}.floatingPanel.suggesterTestMinWidth{min-width:424px}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"floatingPanel\": \"whitelabel_styles__K0hZS\",\n\t\"fluid\": \"whitelabel_styles__X4cCE\",\n\t\"fullWidth\": \"whitelabel_styles__hh2_v\",\n\t\"minWidth\": \"whitelabel_styles__yFgoz\",\n\t\"suggesterTestMinWidth\": \"whitelabel_styles__RmzgU\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles___enwW{flex-direction:column;display:block}.whitelabel_styles__BhS_C{margin:4px 0;display:flex;flex-wrap:wrap;justify-content:center;flex-direction:row;min-width:0;transition:all .3 ease}.whitelabel_styles__BhS_C>*{flex:1;margin:0 8px;align-items:center}.whitelabel_styles__BhS_C.whitelabel_styles__Msiae>*{margin:0 4px}.whitelabel_styles__BhS_C.whitelabel_styles__GpoYt>*{margin:0 1px}.whitelabel_styles__BhS_C.whitelabel_styles__Y5iIu>*{margin:0 4px 0 0}@media only screen and (max-width: 767px){.whitelabel_styles__BhS_C.whitelabel_styles__Y5iIu>*{margin:0 4px 0 -1px}.whitelabel_styles__BhS_C.whitelabel_styles__Hmvqs>*{margin:8px 0 0 0}}@media screen and (min-width: 768px)and (max-width: 1023px){.whitelabel_styles__BhS_C.whitelabel_styles__dhNdZ{flex-grow:1}.whitelabel_styles__BhS_C.whitelabel_styles__nNHne{flex-grow:2}.whitelabel_styles__BhS_C.whitelabel_styles__Rk8bL{flex-grow:2.5}.whitelabel_styles__BhS_C.whitelabel_styles__VULdj{flex-grow:3}.whitelabel_styles__BhS_C.whitelabel_styles__opzOX.whitelabel_styles__Hmvqs>*{margin:8px 0 0 0}.whitelabel_styles__BhS_C.whitelabel_styles__Z098L .whitelabel_styles__BhS_C.whitelabel_styles__At9Hm.whitelabel_styles__Hmvqs>*{margin:0 0 0 8px}.whitelabel_styles__BhS_C.whitelabel_styles__Z098L.whitelabel_styles__GyRMB.whitelabel_styles__Hmvqs>*{margin:0}}@media screen and (min-width: 1024px){.whitelabel_styles__BhS_C.whitelabel_styles__ALBdx{flex-grow:1}.whitelabel_styles__BhS_C.whitelabel_styles__vipv_{flex-grow:2}.whitelabel_styles__BhS_C.whitelabel_styles__cgejs{flex-grow:2.5}.whitelabel_styles__BhS_C.whitelabel_styles__ENcJz{flex-grow:3}.whitelabel_styles__BhS_C.whitelabel_styles__At9Hm.whitelabel_styles__Hmvqs>*{margin:0 0 0 16px}.whitelabel_styles__BhS_C.whitelabel_styles__Z098L.whitelabel_styles__GyRMB.whitelabel_styles__Hmvqs>*{margin:0}}.whitelabel_styles__xjQsb{width:100%;display:inline-block;flex:1;flex-wrap:wrap;transition:all .3 ease}.whitelabel_styles__xjQsb>*{flex:1}@media screen and (min-width: 768px){.whitelabel_styles__BhS_C.whitelabel_styles__Z098L{margin:8px 0}.whitelabel_styles__BhS_C.whitelabel_styles__GpoYt>*{margin:0 1px}.whitelabel_styles__xjQsb{display:flex}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/grid.scss\"],\"names\":[],\"mappings\":\"AAEA,0BACE,qBAAA,CACA,aAAA,CAGF,0BACE,YAAA,CACA,YAAA,CACA,cAAA,CACA,sBAAA,CACA,kBAAA,CACA,WAAA,CAEA,sBAAA,CAEA,4BACE,MAAA,CACA,YAAA,CACA,kBAAA,CAIA,qDACE,YAAA,CAIF,qDACE,YAAA,CAIF,qDACE,gBAAA,CAGJ,0CAEI,qDACE,mBAAA,CAIF,qDACE,gBAAA,CAAA,CAIN,4DACE,mDACE,WAAA,CAEF,mDACE,WAAA,CAEF,mDACE,aAAA,CAEF,mDACE,WAAA,CAIE,8EACE,gBAAA,CAMF,iIACE,gBAAA,CAOA,uGACE,QAAA,CAAA,CAMV,sCACE,mDACE,WAAA,CAEF,mDACE,WAAA,CAEF,mDACE,aAAA,CAEF,mDACE,WAAA,CAIE,8EACE,iBAAA,CAOA,uGACE,QAAA,CAAA,CAQZ,0BACE,UAAA,CAEA,oBAAA,CACA,MAAA,CACA,cAAA,CAEA,sBAAA,CAEA,4BACE,MAAA,CAIJ,qCAEI,mDACE,YAAA,CAGA,qDACE,YAAA,CAKN,0BACE,YAAA,CAAA\",\"sourcesContent\":[\".divider{flex-direction:column;display:block}.column{margin:4px 0;display:flex;flex-wrap:wrap;justify-content:center;flex-direction:row;min-width:0;transition:all .3 ease}.column>*{flex:1;margin:0 8px;align-items:center}.column.slim>*{margin:0 4px}.column.extraHorizontalMargin>*{margin:0 1px}.column.passengersDropdown>*{margin:0 4px 0 0}@media only screen and (max-width: 767px){.column.passengersDropdown>*{margin:0 4px 0 -1px}.column.searchButton>*{margin:8px 0 0 0}}@media screen and (min-width: 768px)and (max-width: 1023px){.column.tabFlexGrow1{flex-grow:1}.column.tabFlexGrow2{flex-grow:2}.column.tabFlexGrow2_5{flex-grow:2.5}.column.tabFlexGrow3{flex-grow:3}.column.isSrp.searchButton>*{margin:8px 0 0 0}.column.isLps .column.isDesktop.searchButton>*{margin:0 0 0 8px}.column.isLps.isMobile.searchButton>*{margin:0}}@media screen and (min-width: 1024px){.column.desktopFlexGrow1{flex-grow:1}.column.desktopFlexGrow2{flex-grow:2}.column.desktopFlexGrow2_5{flex-grow:2.5}.column.desktopFlexGrow3{flex-grow:3}.column.isDesktop.searchButton>*{margin:0 0 0 16px}.column.isLps.isMobile.searchButton>*{margin:0}}.row{width:100%;display:inline-block;flex:1;flex-wrap:wrap;transition:all .3 ease}.row>*{flex:1}@media screen and (min-width: 768px){.column.isLps{margin:8px 0}.column.extraHorizontalMargin>*{margin:0 1px}.row{display:flex}}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"divider\": \"whitelabel_styles___enwW\",\n\t\"column\": \"whitelabel_styles__BhS_C\",\n\t\"slim\": \"whitelabel_styles__Msiae\",\n\t\"extraHorizontalMargin\": \"whitelabel_styles__GpoYt\",\n\t\"passengersDropdown\": \"whitelabel_styles__Y5iIu\",\n\t\"searchButton\": \"whitelabel_styles__Hmvqs\",\n\t\"tabFlexGrow1\": \"whitelabel_styles__dhNdZ\",\n\t\"tabFlexGrow2\": \"whitelabel_styles__nNHne\",\n\t\"tabFlexGrow2_5\": \"whitelabel_styles__Rk8bL\",\n\t\"tabFlexGrow3\": \"whitelabel_styles__VULdj\",\n\t\"isSrp\": \"whitelabel_styles__opzOX\",\n\t\"isLps\": \"whitelabel_styles__Z098L\",\n\t\"isDesktop\": \"whitelabel_styles__At9Hm\",\n\t\"isMobile\": \"whitelabel_styles__GyRMB\",\n\t\"desktopFlexGrow1\": \"whitelabel_styles__ALBdx\",\n\t\"desktopFlexGrow2\": \"whitelabel_styles__vipv_\",\n\t\"desktopFlexGrow2_5\": \"whitelabel_styles__cgejs\",\n\t\"desktopFlexGrow3\": \"whitelabel_styles__ENcJz\",\n\t\"row\": \"whitelabel_styles__xjQsb\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__tueDE{border:5px solid rgba(0,0,0,0);cursor:pointer}.whitelabel_styles__tueDE.whitelabel_styles__E1QGa{pointer-events:none}.whitelabel_styles__tueDE.whitelabel_styles__AaYps{border-right-color:#69abd8}.whitelabel_styles__tueDE.whitelabel_styles__AaYps.whitelabel_styles__E1QGa{border-right-color:#f2f2f2}.whitelabel_styles__tueDE.whitelabel_styles__wdJZ_{border-left-color:#69abd8}.whitelabel_styles__d5ZqT svg{cursor:default;user-select:none}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/icons.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AACA,0BACE,8BAAA,CACA,cAAA,CACA,mDACE,mBAAA,CAEF,mDACE,0BCNO,CDOP,4EACE,0BCDM,CDIV,mDACE,yBCZO,CDiBT,8BACE,cAAA,CACA,gBAAA\",\"sourcesContent\":[\".arrow{border:5px solid rgba(0,0,0,0);cursor:pointer}.arrow.disabled{pointer-events:none}.arrow.left-arrow{border-right-color:#69abd8}.arrow.left-arrow.disabled{border-right-color:#f2f2f2}.arrow.right-arrow{border-left-color:#69abd8}.noUserSelect svg{cursor:default;user-select:none}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"arrow\": \"whitelabel_styles__tueDE\",\n\t\"disabled\": \"whitelabel_styles__E1QGa\",\n\t\"left-arrow\": \"whitelabel_styles__AaYps\",\n\t\"right-arrow\": \"whitelabel_styles__wdJZ_\",\n\t\"noUserSelect\": \"whitelabel_styles__d5ZqT\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__bzsoT{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.whitelabel_styles__lTnpY{float:right}.whitelabel_styles__OD69T{display:flex;flex-wrap:wrap}.whitelabel_styles__kUWc7{width:100%}.whitelabel_styles__HMTDq{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__yRZxU{padding:15px;min-width:250px}.whitelabel_styles__NQpt3{position:relative}.whitelabel_styles__jMi_x{position:absolute}.whitelabel_styles__ymWP9{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;box-sizing:border-box;height:48px;width:100%;padding:0 12px;border:1px solid #f1f2f6;border-radius:8px;font-size:16px;text-align:left;letter-spacing:.3px;appearance:none;background-color:#f1f2f6;box-shadow:none;caret-color:#a1a9c3;color:#132968;transition:border .15s ease}.whitelabel_styles__ymWP9::placeholder{text-transform:capitalize;color:#a1a9c3;opacity:1}.whitelabel_styles__ymWP9:focus,.whitelabel_styles__ymWP9:hover{border:1px solid #a1a9c3;outline:none}.whitelabel_styles__ymWP9.whitelabel_styles__ySG8L{padding-left:40px}.whitelabel_styles__ymWP9.whitelabel_styles__HJxj3::placeholder{color:#a1a9c3}.whitelabel_styles__ymWP9.whitelabel_styles__jnET8::placeholder{opacity:0}.whitelabel_styles__ymWP9.whitelabel_styles__z2TUD{user-select:none}input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none !important;pointer-events:none;position:absolute;right:0}.whitelabel_styles__Cpixu{position:absolute;top:12px;left:8px;height:24px;width:24px;pointer-events:none;background-color:#f1f2f6}.whitelabel_styles__Cpixu>div{color:#a1a9c3 !important}.whitelabel_styles__Jz0H4{position:absolute;top:0;right:8px;display:flex;height:100%;align-items:center}.whitelabel_styles__E637_{padding:2px;cursor:pointer;transform:rotate(90deg);background-color:#f1f2f6}.whitelabel_styles__ID2V8{font-size:15px;color:#333}.whitelabel_styles__JrA6L{font-size:13px;color:#999}@media screen and (min-width: 1024px){.whitelabel_styles__ymWP9{height:48px}.whitelabel_styles__ymWP9.whitelabel_styles__XQTZz.whitelabel_styles__pj3nL{border-radius:0}.whitelabel_styles__ymWP9.whitelabel_styles__AIMhO{border-radius:0}.whitelabel_styles__ymWP9.whitelabel_styles__PRz3U{border-top-left-radius:8px;border-bottom-left-radius:8px}.whitelabel_styles__ID2V8,.whitelabel_styles__JrA6L{font-size:14px}.whitelabel_styles__E637_{transform:rotate(0deg)}}@media screen and (min-width: 768px){.whitelabel_styles__ymWP9{height:48px}.whitelabel_styles__ymWP9.whitelabel_styles__XQTZz.whitelabel_styles__pj3nL{border-radius:0}.whitelabel_styles__ymWP9.whitelabel_styles__XQTZz.whitelabel_styles__PRz3U{border-top-left-radius:8px;border-bottom-left-radius:8px}.whitelabel_styles__E637_{transform:rotate(0deg)}}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/inputs.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCVF,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CC7BF,0BFoBE,cAlBe,CAmBf,eAvBiB,CAwBjB,iBAAA,CACA,mBAAA,CErBA,qBAAA,CACA,WDPY,CCQZ,UAAA,CACA,cAAA,CACA,wBAAA,CACA,iBDZa,CCab,cAAA,CACA,eAAA,CACA,mBAAA,CACA,eAAA,CACA,wBCUa,CDTb,eAAA,CACA,mBCCiB,CAAA,aAHA,CDKjB,2BAAA,CAEA,uCACE,yBAAA,CACA,aCNe,CDOf,SAAA,CAGF,gEAEE,wBAAA,CACA,YAAA,CAGF,mDACE,iBAAA,CAGF,gEACE,aCrBe,CDwBjB,gEACE,SAAA,CAGF,mDACE,gBAAA,CAIJ,yCACE,iBAAA,CACA,uBAAA,CACA,mBAAA,CACA,iBAAA,CACA,OAAA,CAGF,0BACE,iBAAA,CACA,QAAA,CACA,QAAA,CACA,WAAA,CACA,UAAA,CACA,mBAAA,CACA,wBCzCa,CD2Cb,8BACE,wBAAA,CAIJ,0BACE,iBAAA,CACA,KAAA,CACA,SAAA,CACA,YAAA,CACA,WAAA,CACA,kBAAA,CAGF,0BACE,WAAA,CACA,cAAA,CACA,uBAAA,CACA,wBC7Da,CDgEf,0BACE,cAAA,CACA,UChFM,CDmFR,0BACE,cAAA,CACA,UCvFK,CD0FP,sCACE,0BACE,WAAA,CAEE,4EACE,eAAA,CAGJ,mDACE,eAAA,CAGF,mDACE,0BDlHS,CCmHT,6BDnHS,CCuHb,oDAEE,cAAA,CAGF,0BACE,sBAAA,CAAA,CAIJ,qCACE,0BACE,WAAA,CAEE,4EACE,eAAA,CAGF,4EACE,0BD1IO,CC2IP,6BD3IO,CC+Ib,0BACE,sBAAA,CAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}.floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.goInput{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal;box-sizing:border-box;height:48px;width:100%;padding:0 12px;border:1px solid #f1f2f6;border-radius:8px;font-size:16px;text-align:left;letter-spacing:.3px;appearance:none;background-color:#f1f2f6;box-shadow:none;caret-color:#a1a9c3;color:#132968;transition:border .15s ease}.goInput::placeholder{text-transform:capitalize;color:#a1a9c3;opacity:1}.goInput:focus,.goInput:hover{border:1px solid #a1a9c3;outline:none}.goInput.padLeftIcon{padding-left:40px}.goInput.valueSet::placeholder{color:#a1a9c3}.goInput.focused::placeholder{opacity:0}.goInput.caretDisabled{user-select:none}input::-webkit-contacts-auto-fill-button{visibility:hidden;display:none !important;pointer-events:none;position:absolute;right:0}.locationIconContainer{position:absolute;top:12px;left:8px;height:24px;width:24px;pointer-events:none;background-color:#f1f2f6}.locationIconContainer>div{color:#a1a9c3 !important}.swapperContainer{position:absolute;top:0;right:8px;display:flex;height:100%;align-items:center}.swapperIcon{padding:2px;cursor:pointer;transform:rotate(90deg);background-color:#f1f2f6}.city{font-size:15px;color:#333}.country{font-size:13px;color:#999}@media screen and (min-width: 1024px){.goInput{height:48px}.goInput.isLps.isDesktop{border-radius:0}.goInput.isSrp{border-radius:0}.goInput.departureLeftBorder{border-top-left-radius:8px;border-bottom-left-radius:8px}.city,.country{font-size:14px}.swapperIcon{transform:rotate(0deg)}}@media screen and (min-width: 768px){.goInput{height:48px}.goInput.isLps.isDesktop{border-radius:0}.goInput.isLps.departureLeftBorder{border-top-left-radius:8px;border-bottom-left-radius:8px}.swapperIcon{transform:rotate(0deg)}}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_styles__bzsoT\",\n\t\"floatRight\": \"whitelabel_styles__lTnpY\",\n\t\"flexWrap\": \"whitelabel_styles__OD69T\",\n\t\"fullWidth\": \"whitelabel_styles__kUWc7\",\n\t\"flexCenter\": \"whitelabel_styles__HMTDq\",\n\t\"centeredHeader\": \"whitelabel_styles__yRZxU whitelabel_styles__HMTDq\",\n\t\"relative\": \"whitelabel_styles__NQpt3\",\n\t\"absolute\": \"whitelabel_styles__jMi_x\",\n\t\"goInput\": \"whitelabel_styles__ymWP9\",\n\t\"padLeftIcon\": \"whitelabel_styles__ySG8L\",\n\t\"valueSet\": \"whitelabel_styles__HJxj3\",\n\t\"focused\": \"whitelabel_styles__jnET8\",\n\t\"caretDisabled\": \"whitelabel_styles__z2TUD\",\n\t\"locationIconContainer\": \"whitelabel_styles__Cpixu\",\n\t\"swapperContainer\": \"whitelabel_styles__Jz0H4\",\n\t\"swapperIcon\": \"whitelabel_styles__E637_\",\n\t\"city\": \"whitelabel_styles__ID2V8\",\n\t\"country\": \"whitelabel_styles__JrA6L\",\n\t\"isLps\": \"whitelabel_styles__XQTZz\",\n\t\"isDesktop\": \"whitelabel_styles__pj3nL\",\n\t\"isSrp\": \"whitelabel_styles__AIMhO\",\n\t\"departureLeftBorder\": \"whitelabel_styles__PRz3U\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__MCVLD{float:right}.whitelabel_styles__WHZuB{display:flex;flex-wrap:wrap}.whitelabel_styles__OZjc0{width:100%}.whitelabel_styles__oHZfH{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__ylw_d{padding:15px;min-width:250px}.whitelabel_styles__PtaA8{position:relative}.whitelabel_styles__cFKR_{position:absolute}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\"],\"names\":[],\"mappings\":\"AAIA,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA\",\"sourcesContent\":[\".floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"floatRight\": \"whitelabel_styles__MCVLD\",\n\t\"flexWrap\": \"whitelabel_styles__WHZuB\",\n\t\"fullWidth\": \"whitelabel_styles__OZjc0\",\n\t\"flexCenter\": \"whitelabel_styles__oHZfH\",\n\t\"centeredHeader\": \"whitelabel_styles__ylw_d whitelabel_styles__oHZfH\",\n\t\"relative\": \"whitelabel_styles__PtaA8\",\n\t\"absolute\": \"whitelabel_styles__cFKR_\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__he1uq{width:100%}.whitelabel_styles__he1uq input{border:none;background:#fff;border-radius:0;padding-left:0px}.whitelabel_styles__he1uq input:hover,.whitelabel_styles__he1uq input:focus{border:none}.whitelabel_styles__vMeM5,.whitelabel_styles__vMeM5>body{overflow:hidden;position:relative;height:100%}.whitelabel_styles__H95_a{position:fixed;border-radius:0;margin:0;width:100vw;right:0;left:0;top:0;height:100vh;overflow:hidden;background-color:#fff;z-index:99999999;pointer-events:none;transition:transform .2s linear;transform:translateX(100vw);margin:0}.whitelabel_styles__H95_a.whitelabel_styles__yC8qj{pointer-events:all;transform:translateX(0);margin:0}.whitelabel_styles__H95_a.whitelabel_styles__yC8qj .whitelabel_styles__s90aK{left:0}.whitelabel_styles__s90aK{display:flex;background-color:#2a84b7;width:100%;position:absolute;left:0;top:0;right:0;height:60px;color:#fff;z-index:999999991;transition:left .15s ease-in}.whitelabel_styles__s90aK.whitelabel_styles__GXcsd{position:fixed}.whitelabel_styles__L1kg7{background:#fff;position:relative;width:100%;height:100vh;padding-top:60px;overflow:auto;-webkit-overflow-scrolling:touch}.whitelabel_styles__FlfA7{padding:22.5px 5px 0 15px}.whitelabel_styles__VK5FL{text-align:center;width:calc(100vw - 30px);text-indent:-30px}.whitelabel_styles__VK5FL .whitelabel_styles__hZoXi{padding:10px 20px 0 0;width:100%}.whitelabel_styles__VK5FL .whitelabel_styles__hZoXi input{float:left;border-radius:3px;height:40px}.whitelabel_styles__dIPJE{padding:18px 0;width:100%;display:block;position:absolute;text-align:center;left:0;top:0;pointer-events:none}.whitelabel_styles__sJ4iE{text-align:center;line-height:60px}.whitelabel_styles__sJ4iE .whitelabel_styles__psqWx{position:absolute;right:15px;top:0}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/mobilePanel.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAEA,0BACE,UAAA,CACA,gCACE,WAAA,CACA,eAAA,CACA,eAAA,CACA,gBAAA,CAEA,4EAEE,WAAA,CAMJ,yDAEE,eAAA,CACA,iBAAA,CACA,WAAA,CAIJ,0BACE,cAAA,CACA,eAAA,CACA,QAAA,CACA,WAAA,CACA,OAAA,CACA,MAAA,CACA,KAAA,CACA,YAAA,CACA,eAAA,CACA,qBAAA,CACA,gBAAA,CACA,mBAAA,CACA,+BAAA,CACA,2BAAA,CACA,QAAA,CAEA,mDACE,kBAAA,CACA,uBAAA,CACA,QAAA,CACA,6EACE,MAAA,CAKN,0BACE,YAAA,CACA,wBCpDK,CDqDL,UAAA,CACA,iBAAA,CACA,MAAA,CACA,KAAA,CACA,OAAA,CACA,WAAA,CACA,UAAA,CACA,iBAAA,CACA,4BAAA,CACA,mDACE,cAAA,CAIJ,0BACE,eC/DM,CDgEN,iBAAA,CACA,UAAA,CACA,YAAA,CACA,gBAAA,CACA,aAAA,CACA,gCAAA,CAGF,0BACE,yBAAA,CAGF,0BACE,iBAAA,CACA,wBAAA,CACA,iBAAA,CACA,oDACE,qBAAA,CACA,UAAA,CACA,0DACE,UAAA,CACA,iBAAA,CACA,WAAA,CAKN,0BACE,cAAA,CACA,UAAA,CACA,aAAA,CACA,iBAAA,CACA,iBAAA,CACA,MAAA,CACA,KAAA,CACA,mBAAA,CAGF,0BACE,iBAAA,CACA,gBAAA,CACA,oDACE,iBAAA,CACA,UAAA,CACA,KAAA\",\"sourcesContent\":[\".openPanelInput{width:100%}.openPanelInput input{border:none;background:#fff;border-radius:0;padding-left:0px}.openPanelInput input:hover,.openPanelInput input:focus{border:none}.isShowingPanel,.isShowingPanel>body{overflow:hidden;position:relative;height:100%}.mobilePanel{position:fixed;border-radius:0;margin:0;width:100vw;right:0;left:0;top:0;height:100vh;overflow:hidden;background-color:#fff;z-index:99999999;pointer-events:none;transition:transform .2s linear;transform:translateX(100vw);margin:0}.mobilePanel.isPanelShowing{pointer-events:all;transform:translateX(0);margin:0}.mobilePanel.isPanelShowing .mobileTopPanel{left:0}.mobileTopPanel{display:flex;background-color:#2a84b7;width:100%;position:absolute;left:0;top:0;right:0;height:60px;color:#fff;z-index:999999991;transition:left .15s ease-in}.mobileTopPanel.makeFixed{position:fixed}.mobilePanelContent{background:#fff;position:relative;width:100%;height:100vh;padding-top:60px;overflow:auto;-webkit-overflow-scrolling:touch}.backIcon{padding:22.5px 5px 0 15px}.topPanelContent{text-align:center;width:calc(100vw - 30px);text-indent:-30px}.topPanelContent .inputWrap{padding:10px 20px 0 0;width:100%}.topPanelContent .inputWrap input{float:left;border-radius:3px;height:40px}.topPanelText{padding:18px 0;width:100%;display:block;position:absolute;text-align:center;left:0;top:0;pointer-events:none}.topPanelTitle{text-align:center;line-height:60px}.topPanelTitle .topPanelDone{position:absolute;right:15px;top:0}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"openPanelInput\": \"whitelabel_styles__he1uq\",\n\t\"isShowingPanel\": \"whitelabel_styles__vMeM5\",\n\t\"mobilePanel\": \"whitelabel_styles__H95_a\",\n\t\"isPanelShowing\": \"whitelabel_styles__yC8qj\",\n\t\"mobileTopPanel\": \"whitelabel_styles__s90aK\",\n\t\"makeFixed\": \"whitelabel_styles__GXcsd\",\n\t\"mobilePanelContent\": \"whitelabel_styles__L1kg7\",\n\t\"backIcon\": \"whitelabel_styles__FlfA7\",\n\t\"topPanelContent\": \"whitelabel_styles__VK5FL\",\n\t\"inputWrap\": \"whitelabel_styles__hZoXi\",\n\t\"topPanelText\": \"whitelabel_styles__dIPJE\",\n\t\"topPanelTitle\": \"whitelabel_styles__sJ4iE\",\n\t\"topPanelDone\": \"whitelabel_styles__psqWx\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__e51zC{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.whitelabel_styles__Mk8u_{border:none;-webkit-font-smoothing:antialiased;width:100%;display:flex;flex-direction:column;justify-content:center}.whitelabel_styles__Mk8u_ *{box-sizing:border-box;font-family:\\\"GT Walsheim\\\",\\\"Open Sans\\\",\\\"Helvetica-Neue\\\",\\\"Helvetica\\\",\\\"Arial\\\",sans-serif}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/typography.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/theme.scss\"],\"names\":[],\"mappings\":\"AAUA,0BACE,cAJe,CAKf,eATiB,CAUjB,iBAAA,CACA,mBAAA,CCXF,EACE,qBAAA,CAGF,0BACE,WAAA,CACA,kCAAA,CACA,UAAA,CACA,YAAA,CACA,qBAAA,CACA,sBAAA,CAEA,4BACE,qBAAA,CACA,qFAAA\",\"sourcesContent\":[\"$fontFamily: 'Open Sans', 'Helvetica-Neue', 'Helvetica', 'Arial', 'sans-serif';\\n\\n$fontWeightLight: 300;\\n$fontWeightNormal: 400;\\n$fontWeightBold: 600;\\n\\n$fontSizeSmall: 12px;\\n$fontSizeMedium: 14px;\\n$fontSizeLarge: 16px;\\n\\n.defaultFont {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultFont() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin defaultInputFontStyle() {\\n font-size: $fontSizeMedium;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\\n@mixin smallFont() {\\n font-size: $fontSizeSmall;\\n font-weight: $fontWeightNormal;\\n font-style: normal;\\n font-stretch: normal;\\n}\\n\",\".defaultFont{font-size:14px;font-weight:400;font-style:normal;font-stretch:normal}*{box-sizing:border-box}.defaultSearchbar{border:none;-webkit-font-smoothing:antialiased;width:100%;display:flex;flex-direction:column;justify-content:center}.defaultSearchbar *{box-sizing:border-box;font-family:\\\"GT Walsheim\\\",\\\"Open Sans\\\",\\\"Helvetica-Neue\\\",\\\"Helvetica\\\",\\\"Arial\\\",sans-serif}\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"defaultFont\": \"whitelabel_styles__e51zC\",\n\t\"defaultSearchbar\": \"whitelabel_styles__Mk8u_\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../../../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../../../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".whitelabel_styles__JgJlA{float:right}.whitelabel_styles__ZJeST{display:flex;flex-wrap:wrap}.whitelabel_styles__ZE1mb{width:100%}.whitelabel_styles__GTCMR{display:flex;align-items:center;justify-content:space-between}.whitelabel_styles__trdQp{padding:15px;min-width:250px}.whitelabel_styles__sQkt9{position:relative}.whitelabel_styles__YL_m1{position:absolute}.whitelabel_styles__ZJeST{display:flex}.whitelabel_styles__ZE1mb{width:100%}.whitelabel_styles__sQkt9{display:relative}.whitelabel_styles__WH1Z8:after{content:\\\" \\\";display:table;clear:both}@media screen and (min-width: 1024px){.whitelabel_styles__Lt_0V{border:1px #eaeaea solid;border-width:0 1px}div[data-variation-name=variation-V6] .whitelabel_styles__Lt_0V{border:none}div[data-variation-name=variation-V6] input[name=return],div[data-variation-name=variation-V6] input[name=discountCards]{border-left:1px #ccc solid}div[data-variation-name=variation-V7] .whitelabel_styles__Lt_0V{border:none}div[data-variation-name=variation-V7] input[name=return],div[data-variation-name=variation-V7] input[name=discountCards]{border-left:none}}.whitelabel_styles__afeT7{width:100%;display:flex;justify-content:center}.whitelabel_styles__XXXjC{position:absolute;margin-top:-5px;display:flex;align-items:center;justify-content:center;padding:10px;border-radius:4px;box-shadow:0 4px 4px 0 rgba(51,51,51,.2),0 2px 4px 0 rgba(0,0,0,.5);background-color:#425486;color:#fff;font-size:13px;z-index:3}@media screen and (max-width: 768px){.whitelabel_styles__XXXjC{max-width:75%}}.whitelabel_styles__UsyhT{content:\\\"\\\";position:absolute;top:-20px;width:0;border:10px solid rgba(0,0,0,0);border-bottom-color:#425486}.whitelabel_styles__iFs1E{display:flex;width:10rem;align-items:center;justify-content:center;white-space:normal}.whitelabel_styles__RsBSV{width:288px;position:absolute;top:128px;z-index:1}.whitelabel_styles__RsBSV div{background:#fdf1f3}.whitelabel_styles__RsBSV span{color:#eb5264}.whitelabel_styles__RsBSV span span{font-weight:bold}@media screen and (min-width: 720px){.whitelabel_styles__RsBSV{top:64px}}.whitelabel_styles__y7ZHT{position:relative;padding:10px;border-radius:4px;box-shadow:0 4px 4px 0 rgba(51,51,51,.2),0 2px 4px 0 rgba(0,0,0,.5);background-color:#425486;color:#fff;font-size:13px;z-index:3;pointer-events:none}.whitelabel_styles__y7ZHT::after{content:\\\"\\\";position:absolute;top:-20px;right:18px;width:0;border:10px solid rgba(0,0,0,0);border-bottom-color:#425486}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/layout.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/common.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/tooltips.scss\",\"webpack://./node_modules/@goeuro/app/client/ferret/src/styles/colors.scss\"],\"names\":[],\"mappings\":\"AAIA,0BACE,WAAA,CAGF,0BACE,YAAA,CACA,cAAA,CAGF,0BACE,UAAA,CAGF,0BACE,YAAA,CACA,kBAAA,CACA,6BAAA,CAGF,0BAEE,YAAA,CACA,eAAA,CAGF,0BACE,iBAAA,CAGF,0BACE,iBAAA,CC7BF,0BACE,YAAA,CAGF,0BACE,UAAA,CAEF,0BACE,gBAAA,CAGF,gCACE,WAAA,CACA,aAAA,CACA,UAAA,CAGF,sCACE,0BACE,wBAAA,CACA,kBAAA,CAIA,gEACE,WAAA,CAEF,yHAEE,0BAAA,CAMF,gEACE,WAAA,CAEF,yHAEE,gBAAA,CAAA,CCxCN,0BACE,UAAA,CACA,YAAA,CACA,sBAAA,CAGF,0BACE,iBAAA,CACA,eAAA,CACA,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,YAAA,CACA,iBAAA,CACA,mEAAA,CACA,wBCFiB,CDGjB,UCbM,CDcN,cAAA,CACA,SAAA,CACA,qCAbF,0BAcI,aAAA,CAAA,CAIJ,0BACE,UAAA,CACA,iBAAA,CACA,SAAA,CACA,OAAA,CACA,+BAAA,CACA,2BCjBiB,CDoBnB,0BACE,YAAA,CACA,WAAA,CACA,kBAAA,CACA,sBAAA,CACA,kBAAA,CAGF,0BACE,WAAA,CACA,iBAAA,CACA,SAAA,CACA,SAAA,CAEA,8BACE,kBCpDW,CDuDb,+BACE,aCzDM,CD4DR,oCACE,gBAAA,CAIJ,qCACE,0BACE,QAAA,CAAA,CAGJ,0BACE,iBAAA,CACA,YAAA,CACA,iBAAA,CACA,mEAAA,CACA,wBCzDiB,CD0DjB,UCpEM,CDqEN,cAAA,CACA,SAAA,CACA,mBAAA,CACA,iCACE,UAAA,CACA,iBAAA,CACA,SAAA,CACA,UAAA,CACA,OAAA,CACA,+BAAA,CACA,2BCrEe\",\"sourcesContent\":[\"$borderRadius: 8px;\\n$inputHeight: 48px;\\n$mobileScreenMax: 720px;\\n\\n.floatRight {\\n float: right;\\n}\\n\\n.flexWrap {\\n display: flex;\\n flex-wrap: wrap;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n\\n.flexCenter {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n}\\n\\n.centeredHeader {\\n composes: flexCenter;\\n padding: 15px;\\n min-width: 250px;\\n}\\n\\n.relative {\\n position: relative;\\n}\\n\\n.absolute {\\n position: absolute;\\n}\\n\",\"$baseUnit: 8px;\\n$baseFontSize: 14px;\\n$mobileMax: 500px;\\n$desktopMin: 1024px;\\n\\n.flexWrap {\\n display: flex;\\n}\\n\\n.fullWidth {\\n width: 100%;\\n}\\n.relative {\\n display: relative;\\n}\\n\\n.clearfix:after {\\n content: ' ';\\n display: table;\\n clear: both;\\n}\\n\\n@media screen and (min-width: $desktopMin) {\\n .dividers {\\n border: 1px #eaeaea solid;\\n border-width: 0 1px;\\n }\\n div[data-variation-name='variation-V6'] {\\n //TODO: remove after test SI-5876\\n .dividers {\\n border: none;\\n }\\n input[name='return'],\\n input[name='discountCards'] {\\n border-left: 1px #ccc solid;\\n }\\n }\\n\\n div[data-variation-name='variation-V7'] {\\n //TODO: remove after test SI-5061\\n .dividers {\\n border: none;\\n }\\n input[name='return'],\\n input[name='discountCards'] {\\n border-left: none;\\n }\\n }\\n}\\n\",\".floatRight{float:right}.flexWrap{display:flex;flex-wrap:wrap}.fullWidth{width:100%}.flexCenter{display:flex;align-items:center;justify-content:space-between}.centeredHeader{composes:flexCenter;padding:15px;min-width:250px}.relative{position:relative}.absolute{position:absolute}.flexWrap{display:flex}.fullWidth{width:100%}.relative{display:relative}.clearfix:after{content:\\\" \\\";display:table;clear:both}@media screen and (min-width: 1024px){.dividers{border:1px #eaeaea solid;border-width:0 1px}div[data-variation-name=variation-V6] .dividers{border:none}div[data-variation-name=variation-V6] input[name=return],div[data-variation-name=variation-V6] input[name=discountCards]{border-left:1px #ccc solid}div[data-variation-name=variation-V7] .dividers{border:none}div[data-variation-name=variation-V7] input[name=return],div[data-variation-name=variation-V7] input[name=discountCards]{border-left:none}}.errorToolTipContainer{width:100%;display:flex;justify-content:center}.errorToolTipCaption{position:absolute;margin-top:-5px;display:flex;align-items:center;justify-content:center;padding:10px;border-radius:4px;box-shadow:0 4px 4px 0 rgba(51,51,51,.2),0 2px 4px 0 rgba(0,0,0,.5);background-color:#425486;color:#fff;font-size:13px;z-index:3}@media screen and (max-width: 768px){.errorToolTipCaption{max-width:75%}}.errorToolTipCaptionMark{content:\\\"\\\";position:absolute;top:-20px;width:0;border:10px solid rgba(0,0,0,0);border-bottom-color:#425486}.errorToolTipText{display:flex;width:10rem;align-items:center;justify-content:center;white-space:normal}.errorToolTipWrapper{width:288px;position:absolute;top:128px;z-index:1}.errorToolTipWrapper div{background:#fdf1f3}.errorToolTipWrapper span{color:#eb5264}.errorToolTipWrapper span span{font-weight:bold}@media screen and (min-width: 720px){.errorToolTipWrapper{top:64px}}.shifted{position:relative;padding:10px;border-radius:4px;box-shadow:0 4px 4px 0 rgba(51,51,51,.2),0 2px 4px 0 rgba(0,0,0,.5);background-color:#425486;color:#fff;font-size:13px;z-index:3;pointer-events:none}.shifted::after{content:\\\"\\\";position:absolute;top:-20px;right:18px;width:0;border:10px solid rgba(0,0,0,0);border-bottom-color:#425486}\",\"$warning: #eb5264;\\n$warningLight: #fdf1f3;\\n$paleblue: #69abd8;\\n$blue: #2a84b7;\\n$darkblue: #266a90;\\n$lightorange: #fef2d9;\\n$orange: #f7a600;\\n$orangeActive: #f79b00;\\n$white: #fff;\\n$lightgray: #f2f2f2;\\n$midgray: #ccc;\\n$gray: #999;\\n$darkgray: #666;\\n$black: #333;\\n$shadow: rgba(0, 0, 0, 0.1);\\n\\n// Rebrand colors\\n$primaryDeepBlue1: #132968;\\n$primaryDeepBlue2: #425486;\\n$primaryDeepBlue3: #717fa4;\\n$primaryDeepBlue4: #a1a9c3;\\n$secondaryMediumBlue1: #5e90cc;\\n$secondaryMediumBlue3: #9ebce0;\\n$primaryCoral1: #fa6b6b;\\n$greyDark1: #e9ebf2;\\n$colorGray100: #fcfcfd;\\n$colorGray300: #f6f7f9;\\n$colorGray400: #f1f2f6;\\n$colorGray500: #dcdfe9;\\n$colorSeaGreen700: #0f8463;\\n\\n$lightBlue200: #deebf9;\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"floatRight\": \"whitelabel_styles__JgJlA\",\n\t\"flexWrap\": \"whitelabel_styles__ZJeST\",\n\t\"fullWidth\": \"whitelabel_styles__ZE1mb\",\n\t\"flexCenter\": \"whitelabel_styles__GTCMR\",\n\t\"centeredHeader\": \"whitelabel_styles__trdQp whitelabel_styles__GTCMR\",\n\t\"relative\": \"whitelabel_styles__sQkt9\",\n\t\"absolute\": \"whitelabel_styles__YL_m1\",\n\t\"clearfix\": \"whitelabel_styles__WH1Z8\",\n\t\"dividers\": \"whitelabel_styles__Lt_0V\",\n\t\"errorToolTipContainer\": \"whitelabel_styles__afeT7\",\n\t\"errorToolTipCaption\": \"whitelabel_styles__XXXjC\",\n\t\"errorToolTipCaptionMark\": \"whitelabel_styles__UsyhT\",\n\t\"errorToolTipText\": \"whitelabel_styles__iFs1E\",\n\t\"errorToolTipWrapper\": \"whitelabel_styles__RsBSV\",\n\t\"shifted\": \"whitelabel_styles__y7ZHT\"\n};\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n\n content += cssWithMappingToString(item);\n\n if (needLayer) {\n content += \"}\";\n }\n\n if (item[2]) {\n content += \"}\";\n }\n\n if (item[4]) {\n content += \"}\";\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n\n\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot || \"\").concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join(\"\\n\");\n }\n\n return [content].join(\"\\n\");\n};","var MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * Google Chrome as of 67.0.3396.87 introduced timezones with offset that includes seconds.\n * They usually appear for dates that denote time before the timezones were introduced\n * (e.g. for 'Europe/Prague' timezone the offset is GMT+00:57:44 before 1 October 1891\n * and GMT+01:00:00 after that date)\n *\n * Date#getTimezoneOffset returns the offset in minutes and would return 57 for the example above,\n * which would lead to incorrect calculations.\n *\n * This function returns the timezone offset in milliseconds that takes seconds in account.\n */\nmodule.exports = function getTimezoneOffsetInMilliseconds (dirtyDate) {\n var date = new Date(dirtyDate.getTime())\n var baseTimezoneOffset = date.getTimezoneOffset()\n date.setSeconds(0, 0)\n var millisecondsPartOfTimezoneOffset = date.getTime() % MILLISECONDS_IN_MINUTE\n\n return baseTimezoneOffset * MILLISECONDS_IN_MINUTE + millisecondsPartOfTimezoneOffset\n}\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Add the specified number of days to the given date.\n *\n * @description\n * Add the specified number of days to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be added\n * @returns {Date} the new date with the days added\n *\n * @example\n * // Add 10 days to 1 September 2014:\n * var result = addDays(new Date(2014, 8, 1), 10)\n * //=> Thu Sep 11 2014 00:00:00\n */\nfunction addDays (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n date.setDate(date.getDate() + amount)\n return date\n}\n\nmodule.exports = addDays\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\nvar MILLISECONDS_IN_HOUR = 3600000\n\n/**\n * @category Hour Helpers\n * @summary Add the specified number of hours to the given date.\n *\n * @description\n * Add the specified number of hours to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be added\n * @returns {Date} the new date with the hours added\n *\n * @example\n * // Add 2 hours to 10 July 2014 23:00:00:\n * var result = addHours(new Date(2014, 6, 10, 23, 0), 2)\n * //=> Fri Jul 11 2014 01:00:00\n */\nfunction addHours (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR)\n}\n\nmodule.exports = addHours\n","var getISOYear = require('../get_iso_year/index.js')\nvar setISOYear = require('../set_iso_year/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Add the specified number of ISO week-numbering years to the given date.\n *\n * @description\n * Add the specified number of ISO week-numbering years to the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be added\n * @returns {Date} the new date with the ISO week-numbering years added\n *\n * @example\n * // Add 5 ISO week-numbering years to 2 July 2010:\n * var result = addISOYears(new Date(2010, 6, 2), 5)\n * //=> Fri Jun 26 2015 00:00:00\n */\nfunction addISOYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return setISOYear(dirtyDate, getISOYear(dirtyDate) + amount)\n}\n\nmodule.exports = addISOYears\n","var parse = require('../parse/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added\n * @returns {Date} the new date with the milliseconds added\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * var result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\nfunction addMilliseconds (dirtyDate, dirtyAmount) {\n var timestamp = parse(dirtyDate).getTime()\n var amount = Number(dirtyAmount)\n return new Date(timestamp + amount)\n}\n\nmodule.exports = addMilliseconds\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * @category Minute Helpers\n * @summary Add the specified number of minutes to the given date.\n *\n * @description\n * Add the specified number of minutes to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be added\n * @returns {Date} the new date with the minutes added\n *\n * @example\n * // Add 30 minutes to 10 July 2014 12:00:00:\n * var result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 12:30:00\n */\nfunction addMinutes (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE)\n}\n\nmodule.exports = addMinutes\n","var parse = require('../parse/index.js')\nvar getDaysInMonth = require('../get_days_in_month/index.js')\n\n/**\n * @category Month Helpers\n * @summary Add the specified number of months to the given date.\n *\n * @description\n * Add the specified number of months to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be added\n * @returns {Date} the new date with the months added\n *\n * @example\n * // Add 5 months to 1 September 2014:\n * var result = addMonths(new Date(2014, 8, 1), 5)\n * //=> Sun Feb 01 2015 00:00:00\n */\nfunction addMonths (dirtyDate, dirtyAmount) {\n var date = parse(dirtyDate)\n var amount = Number(dirtyAmount)\n var desiredMonth = date.getMonth() + amount\n var dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(date.getFullYear(), desiredMonth, 1)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(desiredMonth, Math.min(daysInMonth, date.getDate()))\n return date\n}\n\nmodule.exports = addMonths\n","var addMonths = require('../add_months/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Add the specified number of year quarters to the given date.\n *\n * @description\n * Add the specified number of year quarters to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be added\n * @returns {Date} the new date with the quarters added\n *\n * @example\n * // Add 1 quarter to 1 September 2014:\n * var result = addQuarters(new Date(2014, 8, 1), 1)\n * //=> Mon Dec 01 2014 00:00:00\n */\nfunction addQuarters (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n var months = amount * 3\n return addMonths(dirtyDate, months)\n}\n\nmodule.exports = addQuarters\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\n/**\n * @category Second Helpers\n * @summary Add the specified number of seconds to the given date.\n *\n * @description\n * Add the specified number of seconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be added\n * @returns {Date} the new date with the seconds added\n *\n * @example\n * // Add 30 seconds to 10 July 2014 12:45:00:\n * var result = addSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:45:30\n */\nfunction addSeconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, amount * 1000)\n}\n\nmodule.exports = addSeconds\n","var addDays = require('../add_days/index.js')\n\n/**\n * @category Week Helpers\n * @summary Add the specified number of weeks to the given date.\n *\n * @description\n * Add the specified number of week to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be added\n * @returns {Date} the new date with the weeks added\n *\n * @example\n * // Add 4 weeks to 1 September 2014:\n * var result = addWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Sep 29 2014 00:00:00\n */\nfunction addWeeks (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n var days = amount * 7\n return addDays(dirtyDate, days)\n}\n\nmodule.exports = addWeeks\n","var addMonths = require('../add_months/index.js')\n\n/**\n * @category Year Helpers\n * @summary Add the specified number of years to the given date.\n *\n * @description\n * Add the specified number of years to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be added\n * @returns {Date} the new date with the years added\n *\n * @example\n * // Add 5 years to 1 September 2014:\n * var result = addYears(new Date(2014, 8, 1), 5)\n * //=> Sun Sep 01 2019 00:00:00\n */\nfunction addYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMonths(dirtyDate, amount * 12)\n}\n\nmodule.exports = addYears\n","var parse = require('../parse/index.js')\n\n/**\n * @category Range Helpers\n * @summary Is the given date range overlapping with another date range?\n *\n * @description\n * Is the given date range overlapping with another date range?\n *\n * @param {Date|String|Number} initialRangeStartDate - the start of the initial range\n * @param {Date|String|Number} initialRangeEndDate - the end of the initial range\n * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with\n * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with\n * @returns {Boolean} whether the date ranges are overlapping\n * @throws {Error} startDate of a date range cannot be after its endDate\n *\n * @example\n * // For overlapping date ranges:\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n * //=> true\n *\n * @example\n * // For non-overlapping date ranges:\n * areRangesOverlapping(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22)\n * )\n * //=> false\n */\nfunction areRangesOverlapping (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) {\n var initialStartTime = parse(dirtyInitialRangeStartDate).getTime()\n var initialEndTime = parse(dirtyInitialRangeEndDate).getTime()\n var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime()\n var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime()\n\n if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n return initialStartTime < comparedEndTime && comparedStartTime < initialEndTime\n}\n\nmodule.exports = areRangesOverlapping\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Return an index of the closest date from the array comparing to the given date.\n *\n * @description\n * Return an index of the closest date from the array comparing to the given date.\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date[]|String[]|Number[]} datesArray - the array to search\n * @returns {Number} an index of the date closest to the given date\n * @throws {TypeError} the second argument must be an instance of Array\n *\n * @example\n * // Which date is closer to 6 September 2015?\n * var dateToCompare = new Date(2015, 8, 6)\n * var datesArray = [\n * new Date(2015, 0, 1),\n * new Date(2016, 0, 1),\n * new Date(2017, 0, 1)\n * ]\n * var result = closestIndexTo(dateToCompare, datesArray)\n * //=> 1\n */\nfunction closestIndexTo (dirtyDateToCompare, dirtyDatesArray) {\n if (!(dirtyDatesArray instanceof Array)) {\n throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array')\n }\n\n var dateToCompare = parse(dirtyDateToCompare)\n var timeToCompare = dateToCompare.getTime()\n\n var result\n var minDistance\n\n dirtyDatesArray.forEach(function (dirtyDate, index) {\n var currentDate = parse(dirtyDate)\n var distance = Math.abs(timeToCompare - currentDate.getTime())\n if (result === undefined || distance < minDistance) {\n result = index\n minDistance = distance\n }\n })\n\n return result\n}\n\nmodule.exports = closestIndexTo\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Return a date from the array closest to the given date.\n *\n * @description\n * Return a date from the array closest to the given date.\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date[]|String[]|Number[]} datesArray - the array to search\n * @returns {Date} the date from the array closest to the given date\n * @throws {TypeError} the second argument must be an instance of Array\n *\n * @example\n * // Which date is closer to 6 September 2015: 1 January 2000 or 1 January 2030?\n * var dateToCompare = new Date(2015, 8, 6)\n * var result = closestTo(dateToCompare, [\n * new Date(2000, 0, 1),\n * new Date(2030, 0, 1)\n * ])\n * //=> Tue Jan 01 2030 00:00:00\n */\nfunction closestTo (dirtyDateToCompare, dirtyDatesArray) {\n if (!(dirtyDatesArray instanceof Array)) {\n throw new TypeError(toString.call(dirtyDatesArray) + ' is not an instance of Array')\n }\n\n var dateToCompare = parse(dirtyDateToCompare)\n var timeToCompare = dateToCompare.getTime()\n\n var result\n var minDistance\n\n dirtyDatesArray.forEach(function (dirtyDate) {\n var currentDate = parse(dirtyDate)\n var distance = Math.abs(timeToCompare - currentDate.getTime())\n if (result === undefined || distance < minDistance) {\n result = currentDate\n minDistance = distance\n }\n })\n\n return result\n}\n\nmodule.exports = closestTo\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Compare the two dates and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return 1 if the first date is after the second,\n * -1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989:\n * var result = compareAsc(\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * )\n * //=> -1\n *\n * @example\n * // Sort the array of dates:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareAsc)\n * //=> [\n * // Wed Feb 11 1987 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Sun Jul 02 1995 00:00:00\n * // ]\n */\nfunction compareAsc (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var timeLeft = dateLeft.getTime()\n var dateRight = parse(dirtyDateRight)\n var timeRight = dateRight.getTime()\n\n if (timeLeft < timeRight) {\n return -1\n } else if (timeLeft > timeRight) {\n return 1\n } else {\n return 0\n }\n}\n\nmodule.exports = compareAsc\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Compare the two dates reverse chronologically and return -1, 0 or 1.\n *\n * @description\n * Compare the two dates and return -1 if the first date is after the second,\n * 1 if the first date is before the second or 0 if dates are equal.\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Number} the result of the comparison\n *\n * @example\n * // Compare 11 February 1987 and 10 July 1989 reverse chronologically:\n * var result = compareDesc(\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * )\n * //=> 1\n *\n * @example\n * // Sort the array of dates in reverse chronological order:\n * var result = [\n * new Date(1995, 6, 2),\n * new Date(1987, 1, 11),\n * new Date(1989, 6, 10)\n * ].sort(compareDesc)\n * //=> [\n * // Sun Jul 02 1995 00:00:00,\n * // Mon Jul 10 1989 00:00:00,\n * // Wed Feb 11 1987 00:00:00\n * // ]\n */\nfunction compareDesc (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var timeLeft = dateLeft.getTime()\n var dateRight = parse(dirtyDateRight)\n var timeRight = dateRight.getTime()\n\n if (timeLeft > timeRight) {\n return -1\n } else if (timeLeft < timeRight) {\n return 1\n } else {\n return 0\n }\n}\n\nmodule.exports = compareDesc\n","var startOfDay = require('../start_of_day/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_DAY = 86400000\n\n/**\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n */\nfunction differenceInCalendarDays (dirtyDateLeft, dirtyDateRight) {\n var startOfDayLeft = startOfDay(dirtyDateLeft)\n var startOfDayRight = startOfDay(dirtyDateRight)\n\n var timestampLeft = startOfDayLeft.getTime() -\n startOfDayLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfDayRight.getTime() -\n startOfDayRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY)\n}\n\nmodule.exports = differenceInCalendarDays\n","var startOfISOWeek = require('../start_of_iso_week/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week Helpers\n * @summary Get the number of calendar ISO weeks between the given dates.\n *\n * @description\n * Get the number of calendar ISO weeks between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO weeks\n *\n * @example\n * // How many calendar ISO weeks are between 6 July 2014 and 21 July 2014?\n * var result = differenceInCalendarISOWeeks(\n * new Date(2014, 6, 21),\n * new Date(2014, 6, 6)\n * )\n * //=> 3\n */\nfunction differenceInCalendarISOWeeks (dirtyDateLeft, dirtyDateRight) {\n var startOfISOWeekLeft = startOfISOWeek(dirtyDateLeft)\n var startOfISOWeekRight = startOfISOWeek(dirtyDateRight)\n\n var timestampLeft = startOfISOWeekLeft.getTime() -\n startOfISOWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfISOWeekRight.getTime() -\n startOfISOWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = differenceInCalendarISOWeeks\n","var getISOYear = require('../get_iso_year/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of calendar ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of calendar ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar ISO week-numbering years\n *\n * @example\n * // How many calendar ISO week-numbering years are 1 January 2010 and 1 January 2012?\n * var result = differenceInCalendarISOYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 2\n */\nfunction differenceInCalendarISOYears (dirtyDateLeft, dirtyDateRight) {\n return getISOYear(dirtyDateLeft) - getISOYear(dirtyDateRight)\n}\n\nmodule.exports = differenceInCalendarISOYears\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Get the number of calendar months between the given dates.\n *\n * @description\n * Get the number of calendar months between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar months\n *\n * @example\n * // How many calendar months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInCalendarMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 8\n */\nfunction differenceInCalendarMonths (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()\n var monthDiff = dateLeft.getMonth() - dateRight.getMonth()\n\n return yearDiff * 12 + monthDiff\n}\n\nmodule.exports = differenceInCalendarMonths\n","var getQuarter = require('../get_quarter/index.js')\nvar parse = require('../parse/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Get the number of calendar quarters between the given dates.\n *\n * @description\n * Get the number of calendar quarters between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar quarters\n *\n * @example\n * // How many calendar quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInCalendarQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 3\n */\nfunction differenceInCalendarQuarters (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear()\n var quarterDiff = getQuarter(dateLeft) - getQuarter(dateRight)\n\n return yearDiff * 4 + quarterDiff\n}\n\nmodule.exports = differenceInCalendarQuarters\n","var startOfWeek = require('../start_of_week/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category Week Helpers\n * @summary Get the number of calendar weeks between the given dates.\n *\n * @description\n * Get the number of calendar weeks between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Number} the number of calendar weeks\n *\n * @example\n * // How many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 3\n *\n * @example\n * // If the week starts on Monday,\n * // how many calendar weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInCalendarWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5),\n * {weekStartsOn: 1}\n * )\n * //=> 2\n */\nfunction differenceInCalendarWeeks (dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n var startOfWeekLeft = startOfWeek(dirtyDateLeft, dirtyOptions)\n var startOfWeekRight = startOfWeek(dirtyDateRight, dirtyOptions)\n\n var timestampLeft = startOfWeekLeft.getTime() -\n startOfWeekLeft.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n var timestampRight = startOfWeekRight.getTime() -\n startOfWeekRight.getTimezoneOffset() * MILLISECONDS_IN_MINUTE\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = differenceInCalendarWeeks\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nfunction differenceInCalendarYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n return dateLeft.getFullYear() - dateRight.getFullYear()\n}\n\nmodule.exports = differenceInCalendarYears\n","var parse = require('../parse/index.js')\nvar differenceInCalendarDays = require('../difference_in_calendar_days/index.js')\nvar compareAsc = require('../compare_asc/index.js')\n\n/**\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full days between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full days\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * var result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n */\nfunction differenceInDays (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight))\n dateLeft.setDate(dateLeft.getDate() - sign * difference)\n\n // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastDayNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastDayNotFull)\n}\n\nmodule.exports = differenceInDays\n","var differenceInMilliseconds = require('../difference_in_milliseconds/index.js')\n\nvar MILLISECONDS_IN_HOUR = 3600000\n\n/**\n * @category Hour Helpers\n * @summary Get the number of hours between the given dates.\n *\n * @description\n * Get the number of hours between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of hours\n *\n * @example\n * // How many hours are between 2 July 2014 06:50:00 and 2 July 2014 19:00:00?\n * var result = differenceInHours(\n * new Date(2014, 6, 2, 19, 0),\n * new Date(2014, 6, 2, 6, 50)\n * )\n * //=> 12\n */\nfunction differenceInHours (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_HOUR\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInHours\n","var parse = require('../parse/index.js')\nvar differenceInCalendarISOYears = require('../difference_in_calendar_iso_years/index.js')\nvar compareAsc = require('../compare_asc/index.js')\nvar subISOYears = require('../sub_iso_years/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of full ISO week-numbering years between the given dates.\n *\n * @description\n * Get the number of full ISO week-numbering years between the given dates.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full ISO week-numbering years\n *\n * @example\n * // How many full ISO week-numbering years are between 1 January 2010 and 1 January 2012?\n * var result = differenceInISOYears(\n * new Date(2012, 0, 1),\n * new Date(2010, 0, 1)\n * )\n * //=> 1\n */\nfunction differenceInISOYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarISOYears(dateLeft, dateRight))\n dateLeft = subISOYears(dateLeft, sign * difference)\n\n // Math.abs(diff in full ISO years - diff in calendar ISO years) === 1\n // if last calendar ISO year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastISOYearNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastISOYearNotFull)\n}\n\nmodule.exports = differenceInISOYears\n","var parse = require('../parse/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Get the number of milliseconds between the given dates.\n *\n * @description\n * Get the number of milliseconds between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of milliseconds\n *\n * @example\n * // How many milliseconds are between\n * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n * var result = differenceInMilliseconds(\n * new Date(2014, 6, 2, 12, 30, 21, 700),\n * new Date(2014, 6, 2, 12, 30, 20, 600)\n * )\n * //=> 1100\n */\nfunction differenceInMilliseconds (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getTime() - dateRight.getTime()\n}\n\nmodule.exports = differenceInMilliseconds\n","var differenceInMilliseconds = require('../difference_in_milliseconds/index.js')\n\nvar MILLISECONDS_IN_MINUTE = 60000\n\n/**\n * @category Minute Helpers\n * @summary Get the number of minutes between the given dates.\n *\n * @description\n * Get the number of minutes between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of minutes\n *\n * @example\n * // How many minutes are between 2 July 2014 12:07:59 and 2 July 2014 12:20:00?\n * var result = differenceInMinutes(\n * new Date(2014, 6, 2, 12, 20, 0),\n * new Date(2014, 6, 2, 12, 7, 59)\n * )\n * //=> 12\n */\nfunction differenceInMinutes (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / MILLISECONDS_IN_MINUTE\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInMinutes\n","var parse = require('../parse/index.js')\nvar differenceInCalendarMonths = require('../difference_in_calendar_months/index.js')\nvar compareAsc = require('../compare_asc/index.js')\n\n/**\n * @category Month Helpers\n * @summary Get the number of full months between the given dates.\n *\n * @description\n * Get the number of full months between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full months\n *\n * @example\n * // How many full months are between 31 January 2014 and 1 September 2014?\n * var result = differenceInMonths(\n * new Date(2014, 8, 1),\n * new Date(2014, 0, 31)\n * )\n * //=> 7\n */\nfunction differenceInMonths (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight))\n dateLeft.setMonth(dateLeft.getMonth() - sign * difference)\n\n // Math.abs(diff in full months - diff in calendar months) === 1 if last calendar month is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastMonthNotFull)\n}\n\nmodule.exports = differenceInMonths\n","var differenceInMonths = require('../difference_in_months/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Get the number of full quarters between the given dates.\n *\n * @description\n * Get the number of full quarters between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full quarters\n *\n * @example\n * // How many full quarters are between 31 December 2013 and 2 July 2014?\n * var result = differenceInQuarters(\n * new Date(2014, 6, 2),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\nfunction differenceInQuarters (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMonths(dirtyDateLeft, dirtyDateRight) / 3\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInQuarters\n","var differenceInMilliseconds = require('../difference_in_milliseconds/index.js')\n\n/**\n * @category Second Helpers\n * @summary Get the number of seconds between the given dates.\n *\n * @description\n * Get the number of seconds between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of seconds\n *\n * @example\n * // How many seconds are between\n * // 2 July 2014 12:30:07.999 and 2 July 2014 12:30:20.000?\n * var result = differenceInSeconds(\n * new Date(2014, 6, 2, 12, 30, 20, 0),\n * new Date(2014, 6, 2, 12, 30, 7, 999)\n * )\n * //=> 12\n */\nfunction differenceInSeconds (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInMilliseconds(dirtyDateLeft, dirtyDateRight) / 1000\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInSeconds\n","var differenceInDays = require('../difference_in_days/index.js')\n\n/**\n * @category Week Helpers\n * @summary Get the number of full weeks between the given dates.\n *\n * @description\n * Get the number of full weeks between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full weeks\n *\n * @example\n * // How many full weeks are between 5 July 2014 and 20 July 2014?\n * var result = differenceInWeeks(\n * new Date(2014, 6, 20),\n * new Date(2014, 6, 5)\n * )\n * //=> 2\n */\nfunction differenceInWeeks (dirtyDateLeft, dirtyDateRight) {\n var diff = differenceInDays(dirtyDateLeft, dirtyDateRight) / 7\n return diff > 0 ? Math.floor(diff) : Math.ceil(diff)\n}\n\nmodule.exports = differenceInWeeks\n","var parse = require('../parse/index.js')\nvar differenceInCalendarYears = require('../difference_in_calendar_years/index.js')\nvar compareAsc = require('../compare_asc/index.js')\n\n/**\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * @param {Date|String|Number} dateLeft - the later date\n * @param {Date|String|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * var result = differenceInYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 1\n */\nfunction differenceInYears (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n\n var sign = compareAsc(dateLeft, dateRight)\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight))\n dateLeft.setFullYear(dateLeft.getFullYear() - sign * difference)\n\n // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign\n return sign * (difference - isLastYearNotFull)\n}\n\nmodule.exports = differenceInYears\n","var compareDesc = require('../compare_desc/index.js')\nvar parse = require('../parse/index.js')\nvar differenceInSeconds = require('../difference_in_seconds/index.js')\nvar differenceInMonths = require('../difference_in_months/index.js')\nvar enLocale = require('../locale/en/index.js')\n\nvar MINUTES_IN_DAY = 1440\nvar MINUTES_IN_ALMOST_TWO_DAYS = 2520\nvar MINUTES_IN_MONTH = 43200\nvar MINUTES_IN_TWO_MONTHS = 86400\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words.\n *\n * | Distance between dates | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance between dates | Result |\n * |------------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date|String|Number} date - the other date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = distanceInWords(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 1)\n * )\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00, including seconds?\n * var result = distanceInWords(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = distanceInWords(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'about 1 year ago'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWords(\n * new Date(2016, 7, 1),\n * new Date(2015, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nfunction distanceInWords (dirtyDateToCompare, dirtyDate, dirtyOptions) {\n var options = dirtyOptions || {}\n\n var comparison = compareDesc(dirtyDateToCompare, dirtyDate)\n\n var locale = options.locale\n var localize = enLocale.distanceInWords.localize\n if (locale && locale.distanceInWords && locale.distanceInWords.localize) {\n localize = locale.distanceInWords.localize\n }\n\n var localizeOptions = {\n addSuffix: Boolean(options.addSuffix),\n comparison: comparison\n }\n\n var dateLeft, dateRight\n if (comparison > 0) {\n dateLeft = parse(dirtyDateToCompare)\n dateRight = parse(dirtyDate)\n } else {\n dateLeft = parse(dirtyDate)\n dateRight = parse(dirtyDateToCompare)\n }\n\n var seconds = differenceInSeconds(dateRight, dateLeft)\n var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset()\n var minutes = Math.round(seconds / 60) - offset\n var months\n\n // 0 up to 2 mins\n if (minutes < 2) {\n if (options.includeSeconds) {\n if (seconds < 5) {\n return localize('lessThanXSeconds', 5, localizeOptions)\n } else if (seconds < 10) {\n return localize('lessThanXSeconds', 10, localizeOptions)\n } else if (seconds < 20) {\n return localize('lessThanXSeconds', 20, localizeOptions)\n } else if (seconds < 40) {\n return localize('halfAMinute', null, localizeOptions)\n } else if (seconds < 60) {\n return localize('lessThanXMinutes', 1, localizeOptions)\n } else {\n return localize('xMinutes', 1, localizeOptions)\n }\n } else {\n if (minutes === 0) {\n return localize('lessThanXMinutes', 1, localizeOptions)\n } else {\n return localize('xMinutes', minutes, localizeOptions)\n }\n }\n\n // 2 mins up to 0.75 hrs\n } else if (minutes < 45) {\n return localize('xMinutes', minutes, localizeOptions)\n\n // 0.75 hrs up to 1.5 hrs\n } else if (minutes < 90) {\n return localize('aboutXHours', 1, localizeOptions)\n\n // 1.5 hrs up to 24 hrs\n } else if (minutes < MINUTES_IN_DAY) {\n var hours = Math.round(minutes / 60)\n return localize('aboutXHours', hours, localizeOptions)\n\n // 1 day up to 1.75 days\n } else if (minutes < MINUTES_IN_ALMOST_TWO_DAYS) {\n return localize('xDays', 1, localizeOptions)\n\n // 1.75 days up to 30 days\n } else if (minutes < MINUTES_IN_MONTH) {\n var days = Math.round(minutes / MINUTES_IN_DAY)\n return localize('xDays', days, localizeOptions)\n\n // 1 month up to 2 months\n } else if (minutes < MINUTES_IN_TWO_MONTHS) {\n months = Math.round(minutes / MINUTES_IN_MONTH)\n return localize('aboutXMonths', months, localizeOptions)\n }\n\n months = differenceInMonths(dateRight, dateLeft)\n\n // 2 months up to 12 months\n if (months < 12) {\n var nearestMonth = Math.round(minutes / MINUTES_IN_MONTH)\n return localize('xMonths', nearestMonth, localizeOptions)\n\n // 1 year up to max Date\n } else {\n var monthsSinceStartOfYear = months % 12\n var years = Math.floor(months / 12)\n\n // N years up to 1 years 3 months\n if (monthsSinceStartOfYear < 3) {\n return localize('aboutXYears', years, localizeOptions)\n\n // N years 3 months up to N years 9 months\n } else if (monthsSinceStartOfYear < 9) {\n return localize('overXYears', years, localizeOptions)\n\n // N years 9 months up to N year 12 months\n } else {\n return localize('almostXYears', years + 1, localizeOptions)\n }\n }\n}\n\nmodule.exports = distanceInWords\n","var compareDesc = require('../compare_desc/index.js')\nvar parse = require('../parse/index.js')\nvar differenceInSeconds = require('../difference_in_seconds/index.js')\nvar enLocale = require('../locale/en/index.js')\n\nvar MINUTES_IN_DAY = 1440\nvar MINUTES_IN_MONTH = 43200\nvar MINUTES_IN_YEAR = 525600\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given dates in words.\n *\n * @description\n * Return the distance between the given dates in words, using strict units.\n * This is like `distanceInWords`, but does not use helpers like 'almost', 'over',\n * 'less than' and the like.\n *\n * | Distance between dates | Result |\n * |------------------------|---------------------|\n * | 0 ... 59 secs | [0..59] seconds |\n * | 1 ... 59 mins | [1..59] minutes |\n * | 1 ... 23 hrs | [1..23] hours |\n * | 1 ... 29 days | [1..29] days |\n * | 1 ... 11 months | [1..11] months |\n * | 1 ... N years | [1..N] years |\n *\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @param {Date|String|Number} date - the other date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.addSuffix=false] - result indicates if the second date is earlier or later than the first\n * @param {'s'|'m'|'h'|'d'|'M'|'Y'} [options.unit] - if specified, will force a unit\n * @param {'floor'|'ceil'|'round'} [options.partialMethod='floor'] - which way to round partial units\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // What is the distance between 2 July 2014 and 1 January 2015?\n * var result = distanceInWordsStrict(\n * new Date(2014, 6, 2),\n * new Date(2015, 0, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // What is the distance between 1 January 2015 00:00:15\n * // and 1 January 2015 00:00:00?\n * var result = distanceInWordsStrict(\n * new Date(2015, 0, 1, 0, 0, 15),\n * new Date(2015, 0, 1, 0, 0, 0),\n * )\n * //=> '15 seconds'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, with a suffix?\n * var result = distanceInWordsStrict(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {addSuffix: true}\n * )\n * //=> '1 year ago'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 1 January 2015, in minutes?\n * var result = distanceInWordsStrict(\n * new Date(2016, 0, 1),\n * new Date(2015, 0, 1),\n * {unit: 'm'}\n * )\n * //=> '525600 minutes'\n *\n * @example\n * // What is the distance from 1 January 2016\n * // to 28 January 2015, in months, rounded up?\n * var result = distanceInWordsStrict(\n * new Date(2015, 0, 28),\n * new Date(2015, 0, 1),\n * {unit: 'M', partialMethod: 'ceil'}\n * )\n * //=> '1 month'\n *\n * @example\n * // What is the distance between 1 August 2016 and 1 January 2015 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWordsStrict(\n * new Date(2016, 7, 1),\n * new Date(2015, 0, 1),\n * {locale: eoLocale}\n * )\n * //=> '1 jaro'\n */\nfunction distanceInWordsStrict (dirtyDateToCompare, dirtyDate, dirtyOptions) {\n var options = dirtyOptions || {}\n\n var comparison = compareDesc(dirtyDateToCompare, dirtyDate)\n\n var locale = options.locale\n var localize = enLocale.distanceInWords.localize\n if (locale && locale.distanceInWords && locale.distanceInWords.localize) {\n localize = locale.distanceInWords.localize\n }\n\n var localizeOptions = {\n addSuffix: Boolean(options.addSuffix),\n comparison: comparison\n }\n\n var dateLeft, dateRight\n if (comparison > 0) {\n dateLeft = parse(dirtyDateToCompare)\n dateRight = parse(dirtyDate)\n } else {\n dateLeft = parse(dirtyDate)\n dateRight = parse(dirtyDateToCompare)\n }\n\n var unit\n var mathPartial = Math[options.partialMethod ? String(options.partialMethod) : 'floor']\n var seconds = differenceInSeconds(dateRight, dateLeft)\n var offset = dateRight.getTimezoneOffset() - dateLeft.getTimezoneOffset()\n var minutes = mathPartial(seconds / 60) - offset\n var hours, days, months, years\n\n if (options.unit) {\n unit = String(options.unit)\n } else {\n if (minutes < 1) {\n unit = 's'\n } else if (minutes < 60) {\n unit = 'm'\n } else if (minutes < MINUTES_IN_DAY) {\n unit = 'h'\n } else if (minutes < MINUTES_IN_MONTH) {\n unit = 'd'\n } else if (minutes < MINUTES_IN_YEAR) {\n unit = 'M'\n } else {\n unit = 'Y'\n }\n }\n\n // 0 up to 60 seconds\n if (unit === 's') {\n return localize('xSeconds', seconds, localizeOptions)\n\n // 1 up to 60 mins\n } else if (unit === 'm') {\n return localize('xMinutes', minutes, localizeOptions)\n\n // 1 up to 24 hours\n } else if (unit === 'h') {\n hours = mathPartial(minutes / 60)\n return localize('xHours', hours, localizeOptions)\n\n // 1 up to 30 days\n } else if (unit === 'd') {\n days = mathPartial(minutes / MINUTES_IN_DAY)\n return localize('xDays', days, localizeOptions)\n\n // 1 up to 12 months\n } else if (unit === 'M') {\n months = mathPartial(minutes / MINUTES_IN_MONTH)\n return localize('xMonths', months, localizeOptions)\n\n // 1 year up to max Date\n } else if (unit === 'Y') {\n years = mathPartial(minutes / MINUTES_IN_YEAR)\n return localize('xYears', years, localizeOptions)\n }\n\n throw new Error('Unknown unit: ' + unit)\n}\n\nmodule.exports = distanceInWordsStrict\n","var distanceInWords = require('../distance_in_words/index.js')\n\n/**\n * @category Common Helpers\n * @summary Return the distance between the given date and now in words.\n *\n * @description\n * Return the distance between the given date and now in words.\n *\n * | Distance to now | Result |\n * |-------------------------------------------------------------------|---------------------|\n * | 0 ... 30 secs | less than a minute |\n * | 30 secs ... 1 min 30 secs | 1 minute |\n * | 1 min 30 secs ... 44 mins 30 secs | [2..44] minutes |\n * | 44 mins ... 30 secs ... 89 mins 30 secs | about 1 hour |\n * | 89 mins 30 secs ... 23 hrs 59 mins 30 secs | about [2..24] hours |\n * | 23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs | 1 day |\n * | 41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs | [2..30] days |\n * | 29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs | about 1 month |\n * | 44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs | about 2 months |\n * | 59 days 23 hrs 59 mins 30 secs ... 1 yr | [2..12] months |\n * | 1 yr ... 1 yr 3 months | about 1 year |\n * | 1 yr 3 months ... 1 yr 9 month s | over 1 year |\n * | 1 yr 9 months ... 2 yrs | almost 2 years |\n * | N yrs ... N yrs 3 months | about N years |\n * | N yrs 3 months ... N yrs 9 months | over N years |\n * | N yrs 9 months ... N+1 yrs | almost N+1 years |\n *\n * With `options.includeSeconds == true`:\n * | Distance to now | Result |\n * |---------------------|----------------------|\n * | 0 secs ... 5 secs | less than 5 seconds |\n * | 5 secs ... 10 secs | less than 10 seconds |\n * | 10 secs ... 20 secs | less than 20 seconds |\n * | 20 secs ... 40 secs | half a minute |\n * | 40 secs ... 60 secs | less than a minute |\n * | 60 secs ... 90 secs | 1 minute |\n *\n * @param {Date|String|Number} date - the given date\n * @param {Object} [options] - the object with options\n * @param {Boolean} [options.includeSeconds=false] - distances less than a minute are more detailed\n * @param {Boolean} [options.addSuffix=false] - result specifies if the second date is earlier or later than the first\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the distance in words\n *\n * @example\n * // If today is 1 January 2015, what is the distance to 2 July 2014?\n * var result = distanceInWordsToNow(\n * new Date(2014, 6, 2)\n * )\n * //=> '6 months'\n *\n * @example\n * // If now is 1 January 2015 00:00:00,\n * // what is the distance to 1 January 2015 00:00:15, including seconds?\n * var result = distanceInWordsToNow(\n * new Date(2015, 0, 1, 0, 0, 15),\n * {includeSeconds: true}\n * )\n * //=> 'less than 20 seconds'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 January 2016, with a suffix?\n * var result = distanceInWordsToNow(\n * new Date(2016, 0, 1),\n * {addSuffix: true}\n * )\n * //=> 'in about 1 year'\n *\n * @example\n * // If today is 1 January 2015,\n * // what is the distance to 1 August 2016 in Esperanto?\n * var eoLocale = require('date-fns/locale/eo')\n * var result = distanceInWordsToNow(\n * new Date(2016, 7, 1),\n * {locale: eoLocale}\n * )\n * //=> 'pli ol 1 jaro'\n */\nfunction distanceInWordsToNow (dirtyDate, dirtyOptions) {\n return distanceInWords(Date.now(), dirtyDate, dirtyOptions)\n}\n\nmodule.exports = distanceInWordsToNow\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Return the array of dates within the specified range.\n *\n * @description\n * Return the array of dates within the specified range.\n *\n * @param {Date|String|Number} startDate - the first date\n * @param {Date|String|Number} endDate - the last date\n * @param {Number} [step=1] - the step between each day\n * @returns {Date[]} the array with starts of days from the day of startDate to the day of endDate\n * @throws {Error} startDate cannot be after endDate\n *\n * @example\n * // Each day between 6 October 2014 and 10 October 2014:\n * var result = eachDay(\n * new Date(2014, 9, 6),\n * new Date(2014, 9, 10)\n * )\n * //=> [\n * // Mon Oct 06 2014 00:00:00,\n * // Tue Oct 07 2014 00:00:00,\n * // Wed Oct 08 2014 00:00:00,\n * // Thu Oct 09 2014 00:00:00,\n * // Fri Oct 10 2014 00:00:00\n * // ]\n */\nfunction eachDay (dirtyStartDate, dirtyEndDate, dirtyStep) {\n var startDate = parse(dirtyStartDate)\n var endDate = parse(dirtyEndDate)\n var step = dirtyStep !== undefined ? dirtyStep : 1\n\n var endTime = endDate.getTime()\n\n if (startDate.getTime() > endTime) {\n throw new Error('The first date cannot be after the second date')\n }\n\n var dates = []\n\n var currentDate = startDate\n currentDate.setHours(0, 0, 0, 0)\n\n while (currentDate.getTime() <= endTime) {\n dates.push(parse(currentDate))\n currentDate.setDate(currentDate.getDate() + step)\n }\n\n return dates\n}\n\nmodule.exports = eachDay\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Return the end of a day for the given date.\n *\n * @description\n * Return the end of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a day\n *\n * @example\n * // The end of a day for 2 September 2014 11:55:00:\n * var result = endOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 23:59:59.999\n */\nfunction endOfDay (dirtyDate) {\n var date = parse(dirtyDate)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfDay\n","var parse = require('../parse/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Return the end of an hour for the given date.\n *\n * @description\n * Return the end of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an hour\n *\n * @example\n * // The end of an hour for 2 September 2014 11:55:00:\n * var result = endOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:59:59.999\n */\nfunction endOfHour (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMinutes(59, 59, 999)\n return date\n}\n\nmodule.exports = endOfHour\n","var endOfWeek = require('../end_of_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Return the end of an ISO week for the given date.\n *\n * @description\n * Return the end of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week\n *\n * @example\n * // The end of an ISO week for 2 September 2014 11:55:00:\n * var result = endOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nfunction endOfISOWeek (dirtyDate) {\n return endOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = endOfISOWeek\n","var getISOYear = require('../get_iso_year/index.js')\nvar startOfISOWeek = require('../start_of_iso_week/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the end of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the end of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n *\n * @example\n * // The end of an ISO week-numbering year for 2 July 2005:\n * var result = endOfISOYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 23:59:59.999\n */\nfunction endOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuaryOfNextYear = new Date(0)\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuaryOfNextYear)\n date.setMilliseconds(date.getMilliseconds() - 1)\n return date\n}\n\nmodule.exports = endOfISOYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Return the end of a minute for the given date.\n *\n * @description\n * Return the end of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a minute\n *\n * @example\n * // The end of a minute for 1 December 2014 22:15:45.400:\n * var result = endOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:59.999\n */\nfunction endOfMinute (dirtyDate) {\n var date = parse(dirtyDate)\n date.setSeconds(59, 999)\n return date\n}\n\nmodule.exports = endOfMinute\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Return the end of a month for the given date.\n *\n * @description\n * Return the end of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a month\n *\n * @example\n * // The end of a month for 2 September 2014 11:55:00:\n * var result = endOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nfunction endOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n date.setFullYear(date.getFullYear(), month + 1, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfMonth\n","var parse = require('../parse/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Return the end of a year quarter for the given date.\n *\n * @description\n * Return the end of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a quarter\n *\n * @example\n * // The end of a quarter for 2 September 2014 11:55:00:\n * var result = endOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 23:59:59.999\n */\nfunction endOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3 + 3\n date.setMonth(month, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfQuarter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Second Helpers\n * @summary Return the end of a second for the given date.\n *\n * @description\n * Return the end of a second for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a second\n *\n * @example\n * // The end of a second for 1 December 2014 22:15:45.400:\n * var result = endOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.999\n */\nfunction endOfSecond (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMilliseconds(999)\n return date\n}\n\nmodule.exports = endOfSecond\n","var endOfDay = require('../end_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Return the end of today.\n *\n * @description\n * Return the end of today.\n *\n * @returns {Date} the end of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfToday()\n * //=> Mon Oct 6 2014 23:59:59.999\n */\nfunction endOfToday () {\n return endOfDay(new Date())\n}\n\nmodule.exports = endOfToday\n","/**\n * @category Day Helpers\n * @summary Return the end of tomorrow.\n *\n * @description\n * Return the end of tomorrow.\n *\n * @returns {Date} the end of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfTomorrow()\n * //=> Tue Oct 7 2014 23:59:59.999\n */\nfunction endOfTomorrow () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day + 1)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfTomorrow\n","var parse = require('../parse/index.js')\n\n/**\n * @category Week Helpers\n * @summary Return the end of a week for the given date.\n *\n * @description\n * Return the end of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the end of a week\n *\n * @example\n * // The end of a week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 23:59:59.999\n *\n * @example\n * // If the week starts on Monday, the end of the week for 2 September 2014 11:55:00:\n * var result = endOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 23:59:59.999\n */\nfunction endOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)\n\n date.setDate(date.getDate() + diff)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfWeek\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Return the end of a year for the given date.\n *\n * @description\n * Return the end of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of a year\n *\n * @example\n * // The end of a year for 2 September 2014 11:55:00:\n * var result = endOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 23:59:59.999\n */\nfunction endOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n date.setFullYear(year + 1, 0, 0)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfYear\n","/**\n * @category Day Helpers\n * @summary Return the end of yesterday.\n *\n * @description\n * Return the end of yesterday.\n *\n * @returns {Date} the end of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = endOfYesterday()\n * //=> Sun Oct 5 2014 23:59:59.999\n */\nfunction endOfYesterday () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day - 1)\n date.setHours(23, 59, 59, 999)\n return date\n}\n\nmodule.exports = endOfYesterday\n","var getDayOfYear = require('../get_day_of_year/index.js')\nvar getISOWeek = require('../get_iso_week/index.js')\nvar getISOYear = require('../get_iso_year/index.js')\nvar parse = require('../parse/index.js')\nvar isValid = require('../is_valid/index.js')\nvar enLocale = require('../locale/en/index.js')\n\n/**\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format.\n *\n * Accepted tokens:\n * | Unit | Token | Result examples |\n * |-------------------------|-------|----------------------------------|\n * | Month | M | 1, 2, ..., 12 |\n * | | Mo | 1st, 2nd, ..., 12th |\n * | | MM | 01, 02, ..., 12 |\n * | | MMM | Jan, Feb, ..., Dec |\n * | | MMMM | January, February, ..., December |\n * | Quarter | Q | 1, 2, 3, 4 |\n * | | Qo | 1st, 2nd, 3rd, 4th |\n * | Day of month | D | 1, 2, ..., 31 |\n * | | Do | 1st, 2nd, ..., 31st |\n * | | DD | 01, 02, ..., 31 |\n * | Day of year | DDD | 1, 2, ..., 366 |\n * | | DDDo | 1st, 2nd, ..., 366th |\n * | | DDDD | 001, 002, ..., 366 |\n * | Day of week | d | 0, 1, ..., 6 |\n * | | do | 0th, 1st, ..., 6th |\n * | | dd | Su, Mo, ..., Sa |\n * | | ddd | Sun, Mon, ..., Sat |\n * | | dddd | Sunday, Monday, ..., Saturday |\n * | Day of ISO week | E | 1, 2, ..., 7 |\n * | ISO week | W | 1, 2, ..., 53 |\n * | | Wo | 1st, 2nd, ..., 53rd |\n * | | WW | 01, 02, ..., 53 |\n * | Year | YY | 00, 01, ..., 99 |\n * | | YYYY | 1900, 1901, ..., 2099 |\n * | ISO week-numbering year | GG | 00, 01, ..., 99 |\n * | | GGGG | 1900, 1901, ..., 2099 |\n * | AM/PM | A | AM, PM |\n * | | a | am, pm |\n * | | aa | a.m., p.m. |\n * | Hour | H | 0, 1, ... 23 |\n * | | HH | 00, 01, ... 23 |\n * | | h | 1, 2, ..., 12 |\n * | | hh | 01, 02, ..., 12 |\n * | Minute | m | 0, 1, ..., 59 |\n * | | mm | 00, 01, ..., 59 |\n * | Second | s | 0, 1, ..., 59 |\n * | | ss | 00, 01, ..., 59 |\n * | 1/10 of second | S | 0, 1, ..., 9 |\n * | 1/100 of second | SS | 00, 01, ..., 99 |\n * | Millisecond | SSS | 000, 001, ..., 999 |\n * | Timezone | Z | -01:00, +00:00, ... +12:00 |\n * | | ZZ | -0100, +0000, ..., +1200 |\n * | Seconds timestamp | X | 512969520 |\n * | Milliseconds timestamp | x | 512969520900 |\n *\n * The characters wrapped in square brackets are escaped.\n *\n * The result may vary by locale.\n *\n * @param {Date|String|Number} date - the original date\n * @param {String} [format='YYYY-MM-DDTHH:mm:ss.SSSZ'] - the string of tokens\n * @param {Object} [options] - the object with options\n * @param {Object} [options.locale=enLocale] - the locale object\n * @returns {String} the formatted date string\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(\n * new Date(2014, 1, 11),\n * 'MM/DD/YYYY'\n * )\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * var eoLocale = require('date-fns/locale/eo')\n * var result = format(\n * new Date(2014, 6, 2),\n * 'Do [de] MMMM YYYY',\n * {locale: eoLocale}\n * )\n * //=> '2-a de julio 2014'\n */\nfunction format (dirtyDate, dirtyFormatStr, dirtyOptions) {\n var formatStr = dirtyFormatStr ? String(dirtyFormatStr) : 'YYYY-MM-DDTHH:mm:ss.SSSZ'\n var options = dirtyOptions || {}\n\n var locale = options.locale\n var localeFormatters = enLocale.format.formatters\n var formattingTokensRegExp = enLocale.format.formattingTokensRegExp\n if (locale && locale.format && locale.format.formatters) {\n localeFormatters = locale.format.formatters\n\n if (locale.format.formattingTokensRegExp) {\n formattingTokensRegExp = locale.format.formattingTokensRegExp\n }\n }\n\n var date = parse(dirtyDate)\n\n if (!isValid(date)) {\n return 'Invalid Date'\n }\n\n var formatFn = buildFormatFn(formatStr, localeFormatters, formattingTokensRegExp)\n\n return formatFn(date)\n}\n\nvar formatters = {\n // Month: 1, 2, ..., 12\n 'M': function (date) {\n return date.getMonth() + 1\n },\n\n // Month: 01, 02, ..., 12\n 'MM': function (date) {\n return addLeadingZeros(date.getMonth() + 1, 2)\n },\n\n // Quarter: 1, 2, 3, 4\n 'Q': function (date) {\n return Math.ceil((date.getMonth() + 1) / 3)\n },\n\n // Day of month: 1, 2, ..., 31\n 'D': function (date) {\n return date.getDate()\n },\n\n // Day of month: 01, 02, ..., 31\n 'DD': function (date) {\n return addLeadingZeros(date.getDate(), 2)\n },\n\n // Day of year: 1, 2, ..., 366\n 'DDD': function (date) {\n return getDayOfYear(date)\n },\n\n // Day of year: 001, 002, ..., 366\n 'DDDD': function (date) {\n return addLeadingZeros(getDayOfYear(date), 3)\n },\n\n // Day of week: 0, 1, ..., 6\n 'd': function (date) {\n return date.getDay()\n },\n\n // Day of ISO week: 1, 2, ..., 7\n 'E': function (date) {\n return date.getDay() || 7\n },\n\n // ISO week: 1, 2, ..., 53\n 'W': function (date) {\n return getISOWeek(date)\n },\n\n // ISO week: 01, 02, ..., 53\n 'WW': function (date) {\n return addLeadingZeros(getISOWeek(date), 2)\n },\n\n // Year: 00, 01, ..., 99\n 'YY': function (date) {\n return addLeadingZeros(date.getFullYear(), 4).substr(2)\n },\n\n // Year: 1900, 1901, ..., 2099\n 'YYYY': function (date) {\n return addLeadingZeros(date.getFullYear(), 4)\n },\n\n // ISO week-numbering year: 00, 01, ..., 99\n 'GG': function (date) {\n return String(getISOYear(date)).substr(2)\n },\n\n // ISO week-numbering year: 1900, 1901, ..., 2099\n 'GGGG': function (date) {\n return getISOYear(date)\n },\n\n // Hour: 0, 1, ... 23\n 'H': function (date) {\n return date.getHours()\n },\n\n // Hour: 00, 01, ..., 23\n 'HH': function (date) {\n return addLeadingZeros(date.getHours(), 2)\n },\n\n // Hour: 1, 2, ..., 12\n 'h': function (date) {\n var hours = date.getHours()\n if (hours === 0) {\n return 12\n } else if (hours > 12) {\n return hours % 12\n } else {\n return hours\n }\n },\n\n // Hour: 01, 02, ..., 12\n 'hh': function (date) {\n return addLeadingZeros(formatters['h'](date), 2)\n },\n\n // Minute: 0, 1, ..., 59\n 'm': function (date) {\n return date.getMinutes()\n },\n\n // Minute: 00, 01, ..., 59\n 'mm': function (date) {\n return addLeadingZeros(date.getMinutes(), 2)\n },\n\n // Second: 0, 1, ..., 59\n 's': function (date) {\n return date.getSeconds()\n },\n\n // Second: 00, 01, ..., 59\n 'ss': function (date) {\n return addLeadingZeros(date.getSeconds(), 2)\n },\n\n // 1/10 of second: 0, 1, ..., 9\n 'S': function (date) {\n return Math.floor(date.getMilliseconds() / 100)\n },\n\n // 1/100 of second: 00, 01, ..., 99\n 'SS': function (date) {\n return addLeadingZeros(Math.floor(date.getMilliseconds() / 10), 2)\n },\n\n // Millisecond: 000, 001, ..., 999\n 'SSS': function (date) {\n return addLeadingZeros(date.getMilliseconds(), 3)\n },\n\n // Timezone: -01:00, +00:00, ... +12:00\n 'Z': function (date) {\n return formatTimezone(date.getTimezoneOffset(), ':')\n },\n\n // Timezone: -0100, +0000, ... +1200\n 'ZZ': function (date) {\n return formatTimezone(date.getTimezoneOffset())\n },\n\n // Seconds timestamp: 512969520\n 'X': function (date) {\n return Math.floor(date.getTime() / 1000)\n },\n\n // Milliseconds timestamp: 512969520900\n 'x': function (date) {\n return date.getTime()\n }\n}\n\nfunction buildFormatFn (formatStr, localeFormatters, formattingTokensRegExp) {\n var array = formatStr.match(formattingTokensRegExp)\n var length = array.length\n\n var i\n var formatter\n for (i = 0; i < length; i++) {\n formatter = localeFormatters[array[i]] || formatters[array[i]]\n if (formatter) {\n array[i] = formatter\n } else {\n array[i] = removeFormattingTokens(array[i])\n }\n }\n\n return function (date) {\n var output = ''\n for (var i = 0; i < length; i++) {\n if (array[i] instanceof Function) {\n output += array[i](date, formatters)\n } else {\n output += array[i]\n }\n }\n return output\n }\n}\n\nfunction removeFormattingTokens (input) {\n if (input.match(/\\[[\\s\\S]/)) {\n return input.replace(/^\\[|]$/g, '')\n }\n return input.replace(/\\\\/g, '')\n}\n\nfunction formatTimezone (offset, delimeter) {\n delimeter = delimeter || ''\n var sign = offset > 0 ? '-' : '+'\n var absOffset = Math.abs(offset)\n var hours = Math.floor(absOffset / 60)\n var minutes = absOffset % 60\n return sign + addLeadingZeros(hours, 2) + delimeter + addLeadingZeros(minutes, 2)\n}\n\nfunction addLeadingZeros (number, targetLength) {\n var output = Math.abs(number).toString()\n while (output.length < targetLength) {\n output = '0' + output\n }\n return output\n}\n\nmodule.exports = format\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Get the day of the month of the given date.\n *\n * @description\n * Get the day of the month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of month\n *\n * @example\n * // Which day of the month is 29 February 2012?\n * var result = getDate(new Date(2012, 1, 29))\n * //=> 29\n */\nfunction getDate (dirtyDate) {\n var date = parse(dirtyDate)\n var dayOfMonth = date.getDate()\n return dayOfMonth\n}\n\nmodule.exports = getDate\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Get the day of the week of the given date.\n *\n * @description\n * Get the day of the week of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of week\n *\n * @example\n * // Which day of the week is 29 February 2012?\n * var result = getDay(new Date(2012, 1, 29))\n * //=> 3\n */\nfunction getDay (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n return day\n}\n\nmodule.exports = getDay\n","var parse = require('../parse/index.js')\nvar startOfYear = require('../start_of_year/index.js')\nvar differenceInCalendarDays = require('../difference_in_calendar_days/index.js')\n\n/**\n * @category Day Helpers\n * @summary Get the day of the year of the given date.\n *\n * @description\n * Get the day of the year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of year\n *\n * @example\n * // Which day of the year is 2 July 2014?\n * var result = getDayOfYear(new Date(2014, 6, 2))\n * //=> 183\n */\nfunction getDayOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var diff = differenceInCalendarDays(date, startOfYear(date))\n var dayOfYear = diff + 1\n return dayOfYear\n}\n\nmodule.exports = getDayOfYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of days in a month\n *\n * @example\n * // How many days are in February 2000?\n * var result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\nfunction getDaysInMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n var monthIndex = date.getMonth()\n var lastDayOfMonth = new Date(0)\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0)\n lastDayOfMonth.setHours(0, 0, 0, 0)\n return lastDayOfMonth.getDate()\n}\n\nmodule.exports = getDaysInMonth\n","var isLeapYear = require('../is_leap_year/index.js')\n\n/**\n * @category Year Helpers\n * @summary Get the number of days in a year of the given date.\n *\n * @description\n * Get the number of days in a year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of days in a year\n *\n * @example\n * // How many days are in 2012?\n * var result = getDaysInYear(new Date(2012, 0, 1))\n * //=> 366\n */\nfunction getDaysInYear (dirtyDate) {\n return isLeapYear(dirtyDate) ? 366 : 365\n}\n\nmodule.exports = getDaysInYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Get the hours of the given date.\n *\n * @description\n * Get the hours of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the hours\n *\n * @example\n * // Get the hours of 29 February 2012 11:45:00:\n * var result = getHours(new Date(2012, 1, 29, 11, 45))\n * //=> 11\n */\nfunction getHours (dirtyDate) {\n var date = parse(dirtyDate)\n var hours = date.getHours()\n return hours\n}\n\nmodule.exports = getHours\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Get the day of the ISO week of the given date.\n *\n * @description\n * Get the day of the ISO week of the given date,\n * which is 7 for Sunday, 1 for Monday etc.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the day of ISO week\n *\n * @example\n * // Which day of the ISO week is 26 February 2012?\n * var result = getISODay(new Date(2012, 1, 26))\n * //=> 7\n */\nfunction getISODay (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n\n if (day === 0) {\n day = 7\n }\n\n return day\n}\n\nmodule.exports = getISODay\n","var parse = require('../parse/index.js')\nvar startOfISOWeek = require('../start_of_iso_week/index.js')\nvar startOfISOYear = require('../start_of_iso_year/index.js')\n\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week Helpers\n * @summary Get the ISO week of the given date.\n *\n * @description\n * Get the ISO week of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the ISO week\n *\n * @example\n * // Which week of the ISO-week numbering year is 2 January 2005?\n * var result = getISOWeek(new Date(2005, 0, 2))\n * //=> 53\n */\nfunction getISOWeek (dirtyDate) {\n var date = parse(dirtyDate)\n var diff = startOfISOWeek(date).getTime() - startOfISOYear(date).getTime()\n\n // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1\n}\n\nmodule.exports = getISOWeek\n","var startOfISOYear = require('../start_of_iso_year/index.js')\nvar addWeeks = require('../add_weeks/index.js')\n\nvar MILLISECONDS_IN_WEEK = 604800000\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * @description\n * Get the number of weeks in an ISO week-numbering year of the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the number of ISO weeks in a year\n *\n * @example\n * // How many weeks are in ISO week-numbering year 2015?\n * var result = getISOWeeksInYear(new Date(2015, 1, 11))\n * //=> 53\n */\nfunction getISOWeeksInYear (dirtyDate) {\n var thisYear = startOfISOYear(dirtyDate)\n var nextYear = startOfISOYear(addWeeks(thisYear, 60))\n var diff = nextYear.valueOf() - thisYear.valueOf()\n // Round the number of weeks to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n return Math.round(diff / MILLISECONDS_IN_WEEK)\n}\n\nmodule.exports = getISOWeeksInYear\n","var parse = require('../parse/index.js')\nvar startOfISOWeek = require('../start_of_iso_week/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Get the ISO week-numbering year of the given date.\n *\n * @description\n * Get the ISO week-numbering year of the given date,\n * which always starts 3 days before the year's first Thursday.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the ISO week-numbering year\n *\n * @example\n * // Which ISO-week numbering year is 2 January 2005?\n * var result = getISOYear(new Date(2005, 0, 2))\n * //=> 2004\n */\nfunction getISOYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n\n var fourthOfJanuaryOfNextYear = new Date(0)\n fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4)\n fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0)\n var startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear)\n\n var fourthOfJanuaryOfThisYear = new Date(0)\n fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4)\n fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0)\n var startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear)\n\n if (date.getTime() >= startOfNextYear.getTime()) {\n return year + 1\n } else if (date.getTime() >= startOfThisYear.getTime()) {\n return year\n } else {\n return year - 1\n }\n}\n\nmodule.exports = getISOYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Get the milliseconds of the given date.\n *\n * @description\n * Get the milliseconds of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the milliseconds\n *\n * @example\n * // Get the milliseconds of 29 February 2012 11:45:05.123:\n * var result = getMilliseconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 123\n */\nfunction getMilliseconds (dirtyDate) {\n var date = parse(dirtyDate)\n var milliseconds = date.getMilliseconds()\n return milliseconds\n}\n\nmodule.exports = getMilliseconds\n","var parse = require('../parse/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Get the minutes of the given date.\n *\n * @description\n * Get the minutes of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the minutes\n *\n * @example\n * // Get the minutes of 29 February 2012 11:45:05:\n * var result = getMinutes(new Date(2012, 1, 29, 11, 45, 5))\n * //=> 45\n */\nfunction getMinutes (dirtyDate) {\n var date = parse(dirtyDate)\n var minutes = date.getMinutes()\n return minutes\n}\n\nmodule.exports = getMinutes\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Get the month of the given date.\n *\n * @description\n * Get the month of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the month\n *\n * @example\n * // Which month is 29 February 2012?\n * var result = getMonth(new Date(2012, 1, 29))\n * //=> 1\n */\nfunction getMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n return month\n}\n\nmodule.exports = getMonth\n","var parse = require('../parse/index.js')\n\nvar MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000\n\n/**\n * @category Range Helpers\n * @summary Get the number of days that overlap in two date ranges\n *\n * @description\n * Get the number of days that overlap in two date ranges\n *\n * @param {Date|String|Number} initialRangeStartDate - the start of the initial range\n * @param {Date|String|Number} initialRangeEndDate - the end of the initial range\n * @param {Date|String|Number} comparedRangeStartDate - the start of the range to compare it with\n * @param {Date|String|Number} comparedRangeEndDate - the end of the range to compare it with\n * @returns {Number} the number of days that overlap in two date ranges\n * @throws {Error} startDate of a date range cannot be after its endDate\n *\n * @example\n * // For overlapping date ranges adds 1 for each started overlapping day:\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 17), new Date(2014, 0, 21)\n * )\n * //=> 3\n *\n * @example\n * // For non-overlapping date ranges returns 0:\n * getOverlappingDaysInRanges(\n * new Date(2014, 0, 10), new Date(2014, 0, 20), new Date(2014, 0, 21), new Date(2014, 0, 22)\n * )\n * //=> 0\n */\nfunction getOverlappingDaysInRanges (dirtyInitialRangeStartDate, dirtyInitialRangeEndDate, dirtyComparedRangeStartDate, dirtyComparedRangeEndDate) {\n var initialStartTime = parse(dirtyInitialRangeStartDate).getTime()\n var initialEndTime = parse(dirtyInitialRangeEndDate).getTime()\n var comparedStartTime = parse(dirtyComparedRangeStartDate).getTime()\n var comparedEndTime = parse(dirtyComparedRangeEndDate).getTime()\n\n if (initialStartTime > initialEndTime || comparedStartTime > comparedEndTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n var isOverlapping = initialStartTime < comparedEndTime && comparedStartTime < initialEndTime\n\n if (!isOverlapping) {\n return 0\n }\n\n var overlapStartDate = comparedStartTime < initialStartTime\n ? initialStartTime\n : comparedStartTime\n\n var overlapEndDate = comparedEndTime > initialEndTime\n ? initialEndTime\n : comparedEndTime\n\n var differenceInMs = overlapEndDate - overlapStartDate\n\n return Math.ceil(differenceInMs / MILLISECONDS_IN_DAY)\n}\n\nmodule.exports = getOverlappingDaysInRanges\n","var parse = require('../parse/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Get the year quarter of the given date.\n *\n * @description\n * Get the year quarter of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the quarter\n *\n * @example\n * // Which quarter is 2 July 2014?\n * var result = getQuarter(new Date(2014, 6, 2))\n * //=> 3\n */\nfunction getQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var quarter = Math.floor(date.getMonth() / 3) + 1\n return quarter\n}\n\nmodule.exports = getQuarter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Second Helpers\n * @summary Get the seconds of the given date.\n *\n * @description\n * Get the seconds of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the seconds\n *\n * @example\n * // Get the seconds of 29 February 2012 11:45:05.123:\n * var result = getSeconds(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 5\n */\nfunction getSeconds (dirtyDate) {\n var date = parse(dirtyDate)\n var seconds = date.getSeconds()\n return seconds\n}\n\nmodule.exports = getSeconds\n","var parse = require('../parse/index.js')\n\n/**\n * @category Timestamp Helpers\n * @summary Get the milliseconds timestamp of the given date.\n *\n * @description\n * Get the milliseconds timestamp of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the timestamp\n *\n * @example\n * // Get the timestamp of 29 February 2012 11:45:05.123:\n * var result = getTime(new Date(2012, 1, 29, 11, 45, 5, 123))\n * //=> 1330515905123\n */\nfunction getTime (dirtyDate) {\n var date = parse(dirtyDate)\n var timestamp = date.getTime()\n return timestamp\n}\n\nmodule.exports = getTime\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Get the year of the given date.\n *\n * @description\n * Get the year of the given date.\n *\n * @param {Date|String|Number} date - the given date\n * @returns {Number} the year\n *\n * @example\n * // Which year is 2 July 2014?\n * var result = getYear(new Date(2014, 6, 2))\n * //=> 2014\n */\nfunction getYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n return year\n}\n\nmodule.exports = getYear\n","module.exports = {\n addDays: require('./add_days/index.js'),\n addHours: require('./add_hours/index.js'),\n addISOYears: require('./add_iso_years/index.js'),\n addMilliseconds: require('./add_milliseconds/index.js'),\n addMinutes: require('./add_minutes/index.js'),\n addMonths: require('./add_months/index.js'),\n addQuarters: require('./add_quarters/index.js'),\n addSeconds: require('./add_seconds/index.js'),\n addWeeks: require('./add_weeks/index.js'),\n addYears: require('./add_years/index.js'),\n areRangesOverlapping: require('./are_ranges_overlapping/index.js'),\n closestIndexTo: require('./closest_index_to/index.js'),\n closestTo: require('./closest_to/index.js'),\n compareAsc: require('./compare_asc/index.js'),\n compareDesc: require('./compare_desc/index.js'),\n differenceInCalendarDays: require('./difference_in_calendar_days/index.js'),\n differenceInCalendarISOWeeks: require('./difference_in_calendar_iso_weeks/index.js'),\n differenceInCalendarISOYears: require('./difference_in_calendar_iso_years/index.js'),\n differenceInCalendarMonths: require('./difference_in_calendar_months/index.js'),\n differenceInCalendarQuarters: require('./difference_in_calendar_quarters/index.js'),\n differenceInCalendarWeeks: require('./difference_in_calendar_weeks/index.js'),\n differenceInCalendarYears: require('./difference_in_calendar_years/index.js'),\n differenceInDays: require('./difference_in_days/index.js'),\n differenceInHours: require('./difference_in_hours/index.js'),\n differenceInISOYears: require('./difference_in_iso_years/index.js'),\n differenceInMilliseconds: require('./difference_in_milliseconds/index.js'),\n differenceInMinutes: require('./difference_in_minutes/index.js'),\n differenceInMonths: require('./difference_in_months/index.js'),\n differenceInQuarters: require('./difference_in_quarters/index.js'),\n differenceInSeconds: require('./difference_in_seconds/index.js'),\n differenceInWeeks: require('./difference_in_weeks/index.js'),\n differenceInYears: require('./difference_in_years/index.js'),\n distanceInWords: require('./distance_in_words/index.js'),\n distanceInWordsStrict: require('./distance_in_words_strict/index.js'),\n distanceInWordsToNow: require('./distance_in_words_to_now/index.js'),\n eachDay: require('./each_day/index.js'),\n endOfDay: require('./end_of_day/index.js'),\n endOfHour: require('./end_of_hour/index.js'),\n endOfISOWeek: require('./end_of_iso_week/index.js'),\n endOfISOYear: require('./end_of_iso_year/index.js'),\n endOfMinute: require('./end_of_minute/index.js'),\n endOfMonth: require('./end_of_month/index.js'),\n endOfQuarter: require('./end_of_quarter/index.js'),\n endOfSecond: require('./end_of_second/index.js'),\n endOfToday: require('./end_of_today/index.js'),\n endOfTomorrow: require('./end_of_tomorrow/index.js'),\n endOfWeek: require('./end_of_week/index.js'),\n endOfYear: require('./end_of_year/index.js'),\n endOfYesterday: require('./end_of_yesterday/index.js'),\n format: require('./format/index.js'),\n getDate: require('./get_date/index.js'),\n getDay: require('./get_day/index.js'),\n getDayOfYear: require('./get_day_of_year/index.js'),\n getDaysInMonth: require('./get_days_in_month/index.js'),\n getDaysInYear: require('./get_days_in_year/index.js'),\n getHours: require('./get_hours/index.js'),\n getISODay: require('./get_iso_day/index.js'),\n getISOWeek: require('./get_iso_week/index.js'),\n getISOWeeksInYear: require('./get_iso_weeks_in_year/index.js'),\n getISOYear: require('./get_iso_year/index.js'),\n getMilliseconds: require('./get_milliseconds/index.js'),\n getMinutes: require('./get_minutes/index.js'),\n getMonth: require('./get_month/index.js'),\n getOverlappingDaysInRanges: require('./get_overlapping_days_in_ranges/index.js'),\n getQuarter: require('./get_quarter/index.js'),\n getSeconds: require('./get_seconds/index.js'),\n getTime: require('./get_time/index.js'),\n getYear: require('./get_year/index.js'),\n isAfter: require('./is_after/index.js'),\n isBefore: require('./is_before/index.js'),\n isDate: require('./is_date/index.js'),\n isEqual: require('./is_equal/index.js'),\n isFirstDayOfMonth: require('./is_first_day_of_month/index.js'),\n isFriday: require('./is_friday/index.js'),\n isFuture: require('./is_future/index.js'),\n isLastDayOfMonth: require('./is_last_day_of_month/index.js'),\n isLeapYear: require('./is_leap_year/index.js'),\n isMonday: require('./is_monday/index.js'),\n isPast: require('./is_past/index.js'),\n isSameDay: require('./is_same_day/index.js'),\n isSameHour: require('./is_same_hour/index.js'),\n isSameISOWeek: require('./is_same_iso_week/index.js'),\n isSameISOYear: require('./is_same_iso_year/index.js'),\n isSameMinute: require('./is_same_minute/index.js'),\n isSameMonth: require('./is_same_month/index.js'),\n isSameQuarter: require('./is_same_quarter/index.js'),\n isSameSecond: require('./is_same_second/index.js'),\n isSameWeek: require('./is_same_week/index.js'),\n isSameYear: require('./is_same_year/index.js'),\n isSaturday: require('./is_saturday/index.js'),\n isSunday: require('./is_sunday/index.js'),\n isThisHour: require('./is_this_hour/index.js'),\n isThisISOWeek: require('./is_this_iso_week/index.js'),\n isThisISOYear: require('./is_this_iso_year/index.js'),\n isThisMinute: require('./is_this_minute/index.js'),\n isThisMonth: require('./is_this_month/index.js'),\n isThisQuarter: require('./is_this_quarter/index.js'),\n isThisSecond: require('./is_this_second/index.js'),\n isThisWeek: require('./is_this_week/index.js'),\n isThisYear: require('./is_this_year/index.js'),\n isThursday: require('./is_thursday/index.js'),\n isToday: require('./is_today/index.js'),\n isTomorrow: require('./is_tomorrow/index.js'),\n isTuesday: require('./is_tuesday/index.js'),\n isValid: require('./is_valid/index.js'),\n isWednesday: require('./is_wednesday/index.js'),\n isWeekend: require('./is_weekend/index.js'),\n isWithinRange: require('./is_within_range/index.js'),\n isYesterday: require('./is_yesterday/index.js'),\n lastDayOfISOWeek: require('./last_day_of_iso_week/index.js'),\n lastDayOfISOYear: require('./last_day_of_iso_year/index.js'),\n lastDayOfMonth: require('./last_day_of_month/index.js'),\n lastDayOfQuarter: require('./last_day_of_quarter/index.js'),\n lastDayOfWeek: require('./last_day_of_week/index.js'),\n lastDayOfYear: require('./last_day_of_year/index.js'),\n max: require('./max/index.js'),\n min: require('./min/index.js'),\n parse: require('./parse/index.js'),\n setDate: require('./set_date/index.js'),\n setDay: require('./set_day/index.js'),\n setDayOfYear: require('./set_day_of_year/index.js'),\n setHours: require('./set_hours/index.js'),\n setISODay: require('./set_iso_day/index.js'),\n setISOWeek: require('./set_iso_week/index.js'),\n setISOYear: require('./set_iso_year/index.js'),\n setMilliseconds: require('./set_milliseconds/index.js'),\n setMinutes: require('./set_minutes/index.js'),\n setMonth: require('./set_month/index.js'),\n setQuarter: require('./set_quarter/index.js'),\n setSeconds: require('./set_seconds/index.js'),\n setYear: require('./set_year/index.js'),\n startOfDay: require('./start_of_day/index.js'),\n startOfHour: require('./start_of_hour/index.js'),\n startOfISOWeek: require('./start_of_iso_week/index.js'),\n startOfISOYear: require('./start_of_iso_year/index.js'),\n startOfMinute: require('./start_of_minute/index.js'),\n startOfMonth: require('./start_of_month/index.js'),\n startOfQuarter: require('./start_of_quarter/index.js'),\n startOfSecond: require('./start_of_second/index.js'),\n startOfToday: require('./start_of_today/index.js'),\n startOfTomorrow: require('./start_of_tomorrow/index.js'),\n startOfWeek: require('./start_of_week/index.js'),\n startOfYear: require('./start_of_year/index.js'),\n startOfYesterday: require('./start_of_yesterday/index.js'),\n subDays: require('./sub_days/index.js'),\n subHours: require('./sub_hours/index.js'),\n subISOYears: require('./sub_iso_years/index.js'),\n subMilliseconds: require('./sub_milliseconds/index.js'),\n subMinutes: require('./sub_minutes/index.js'),\n subMonths: require('./sub_months/index.js'),\n subQuarters: require('./sub_quarters/index.js'),\n subSeconds: require('./sub_seconds/index.js'),\n subWeeks: require('./sub_weeks/index.js'),\n subYears: require('./sub_years/index.js')\n}\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Is the first date after the second one?\n *\n * @description\n * Is the first date after the second one?\n *\n * @param {Date|String|Number} date - the date that should be after the other one to return true\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is after the second date\n *\n * @example\n * // Is 10 July 1989 after 11 February 1987?\n * var result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> true\n */\nfunction isAfter (dirtyDate, dirtyDateToCompare) {\n var date = parse(dirtyDate)\n var dateToCompare = parse(dirtyDateToCompare)\n return date.getTime() > dateToCompare.getTime()\n}\n\nmodule.exports = isAfter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Is the first date before the second one?\n *\n * @description\n * Is the first date before the second one?\n *\n * @param {Date|String|Number} date - the date that should be before the other one to return true\n * @param {Date|String|Number} dateToCompare - the date to compare with\n * @returns {Boolean} the first date is before the second date\n *\n * @example\n * // Is 10 July 1989 before 11 February 1987?\n * var result = isBefore(new Date(1989, 6, 10), new Date(1987, 1, 11))\n * //=> false\n */\nfunction isBefore (dirtyDate, dirtyDateToCompare) {\n var date = parse(dirtyDate)\n var dateToCompare = parse(dirtyDateToCompare)\n return date.getTime() < dateToCompare.getTime()\n}\n\nmodule.exports = isBefore\n","/**\n * @category Common Helpers\n * @summary Is the given argument an instance of Date?\n *\n * @description\n * Is the given argument an instance of Date?\n *\n * @param {*} argument - the argument to check\n * @returns {Boolean} the given argument is an instance of Date\n *\n * @example\n * // Is 'mayonnaise' a Date?\n * var result = isDate('mayonnaise')\n * //=> false\n */\nfunction isDate (argument) {\n return argument instanceof Date\n}\n\nmodule.exports = isDate\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Are the given dates equal?\n *\n * @description\n * Are the given dates equal?\n *\n * @param {Date|String|Number} dateLeft - the first date to compare\n * @param {Date|String|Number} dateRight - the second date to compare\n * @returns {Boolean} the dates are equal\n *\n * @example\n * // Are 2 July 2014 06:30:45.000 and 2 July 2014 06:30:45.500 equal?\n * var result = isEqual(\n * new Date(2014, 6, 2, 6, 30, 45, 0)\n * new Date(2014, 6, 2, 6, 30, 45, 500)\n * )\n * //=> false\n */\nfunction isEqual (dirtyLeftDate, dirtyRightDate) {\n var dateLeft = parse(dirtyLeftDate)\n var dateRight = parse(dirtyRightDate)\n return dateLeft.getTime() === dateRight.getTime()\n}\n\nmodule.exports = isEqual\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Is the given date the first day of a month?\n *\n * @description\n * Is the given date the first day of a month?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is the first day of a month\n *\n * @example\n * // Is 1 September 2014 the first day of a month?\n * var result = isFirstDayOfMonth(new Date(2014, 8, 1))\n * //=> true\n */\nfunction isFirstDayOfMonth (dirtyDate) {\n return parse(dirtyDate).getDate() === 1\n}\n\nmodule.exports = isFirstDayOfMonth\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Friday?\n *\n * @description\n * Is the given date Friday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Friday\n *\n * @example\n * // Is 26 September 2014 Friday?\n * var result = isFriday(new Date(2014, 8, 26))\n * //=> true\n */\nfunction isFriday (dirtyDate) {\n return parse(dirtyDate).getDay() === 5\n}\n\nmodule.exports = isFriday\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Is the given date in the future?\n *\n * @description\n * Is the given date in the future?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the future\n *\n * @example\n * // If today is 6 October 2014, is 31 December 2014 in the future?\n * var result = isFuture(new Date(2014, 11, 31))\n * //=> true\n */\nfunction isFuture (dirtyDate) {\n return parse(dirtyDate).getTime() > new Date().getTime()\n}\n\nmodule.exports = isFuture\n","var parse = require('../parse/index.js')\nvar endOfDay = require('../end_of_day/index.js')\nvar endOfMonth = require('../end_of_month/index.js')\n\n/**\n * @category Month Helpers\n * @summary Is the given date the last day of a month?\n *\n * @description\n * Is the given date the last day of a month?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is the last day of a month\n *\n * @example\n * // Is 28 February 2014 the last day of a month?\n * var result = isLastDayOfMonth(new Date(2014, 1, 28))\n * //=> true\n */\nfunction isLastDayOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n return endOfDay(date).getTime() === endOfMonth(date).getTime()\n}\n\nmodule.exports = isLastDayOfMonth\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Is the given date in the leap year?\n *\n * @description\n * Is the given date in the leap year?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the leap year\n *\n * @example\n * // Is 1 September 2012 in the leap year?\n * var result = isLeapYear(new Date(2012, 8, 1))\n * //=> true\n */\nfunction isLeapYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0\n}\n\nmodule.exports = isLeapYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Monday?\n *\n * @description\n * Is the given date Monday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Monday\n *\n * @example\n * // Is 22 September 2014 Monday?\n * var result = isMonday(new Date(2014, 8, 22))\n * //=> true\n */\nfunction isMonday (dirtyDate) {\n return parse(dirtyDate).getDay() === 1\n}\n\nmodule.exports = isMonday\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Is the given date in the past?\n *\n * @description\n * Is the given date in the past?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in the past\n *\n * @example\n * // If today is 6 October 2014, is 2 July 2014 in the past?\n * var result = isPast(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isPast (dirtyDate) {\n return parse(dirtyDate).getTime() < new Date().getTime()\n}\n\nmodule.exports = isPast\n","var startOfDay = require('../start_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Are the given dates in the same day?\n *\n * @description\n * Are the given dates in the same day?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same day\n *\n * @example\n * // Are 4 September 06:00:00 and 4 September 18:00:00 in the same day?\n * var result = isSameDay(\n * new Date(2014, 8, 4, 6, 0),\n * new Date(2014, 8, 4, 18, 0)\n * )\n * //=> true\n */\nfunction isSameDay (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfDay = startOfDay(dirtyDateLeft)\n var dateRightStartOfDay = startOfDay(dirtyDateRight)\n\n return dateLeftStartOfDay.getTime() === dateRightStartOfDay.getTime()\n}\n\nmodule.exports = isSameDay\n","var startOfHour = require('../start_of_hour/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Are the given dates in the same hour?\n *\n * @description\n * Are the given dates in the same hour?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same hour\n *\n * @example\n * // Are 4 September 2014 06:00:00 and 4 September 06:30:00 in the same hour?\n * var result = isSameHour(\n * new Date(2014, 8, 4, 6, 0),\n * new Date(2014, 8, 4, 6, 30)\n * )\n * //=> true\n */\nfunction isSameHour (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfHour = startOfHour(dirtyDateLeft)\n var dateRightStartOfHour = startOfHour(dirtyDateRight)\n\n return dateLeftStartOfHour.getTime() === dateRightStartOfHour.getTime()\n}\n\nmodule.exports = isSameHour\n","var isSameWeek = require('../is_same_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Are the given dates in the same ISO week?\n *\n * @description\n * Are the given dates in the same ISO week?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week\n *\n * @example\n * // Are 1 September 2014 and 7 September 2014 in the same ISO week?\n * var result = isSameISOWeek(\n * new Date(2014, 8, 1),\n * new Date(2014, 8, 7)\n * )\n * //=> true\n */\nfunction isSameISOWeek (dirtyDateLeft, dirtyDateRight) {\n return isSameWeek(dirtyDateLeft, dirtyDateRight, {weekStartsOn: 1})\n}\n\nmodule.exports = isSameISOWeek\n","var startOfISOYear = require('../start_of_iso_year/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Are the given dates in the same ISO week-numbering year?\n *\n * @description\n * Are the given dates in the same ISO week-numbering year?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same ISO week-numbering year\n *\n * @example\n * // Are 29 December 2003 and 2 January 2005 in the same ISO week-numbering year?\n * var result = isSameISOYear(\n * new Date(2003, 11, 29),\n * new Date(2005, 0, 2)\n * )\n * //=> true\n */\nfunction isSameISOYear (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfYear = startOfISOYear(dirtyDateLeft)\n var dateRightStartOfYear = startOfISOYear(dirtyDateRight)\n\n return dateLeftStartOfYear.getTime() === dateRightStartOfYear.getTime()\n}\n\nmodule.exports = isSameISOYear\n","var startOfMinute = require('../start_of_minute/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Are the given dates in the same minute?\n *\n * @description\n * Are the given dates in the same minute?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same minute\n *\n * @example\n * // Are 4 September 2014 06:30:00 and 4 September 2014 06:30:15\n * // in the same minute?\n * var result = isSameMinute(\n * new Date(2014, 8, 4, 6, 30),\n * new Date(2014, 8, 4, 6, 30, 15)\n * )\n * //=> true\n */\nfunction isSameMinute (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfMinute = startOfMinute(dirtyDateLeft)\n var dateRightStartOfMinute = startOfMinute(dirtyDateRight)\n\n return dateLeftStartOfMinute.getTime() === dateRightStartOfMinute.getTime()\n}\n\nmodule.exports = isSameMinute\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Are the given dates in the same month?\n *\n * @description\n * Are the given dates in the same month?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same month\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same month?\n * var result = isSameMonth(\n * new Date(2014, 8, 2),\n * new Date(2014, 8, 25)\n * )\n * //=> true\n */\nfunction isSameMonth (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getFullYear() === dateRight.getFullYear() &&\n dateLeft.getMonth() === dateRight.getMonth()\n}\n\nmodule.exports = isSameMonth\n","var startOfQuarter = require('../start_of_quarter/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Are the given dates in the same year quarter?\n *\n * @description\n * Are the given dates in the same year quarter?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same quarter\n *\n * @example\n * // Are 1 January 2014 and 8 March 2014 in the same quarter?\n * var result = isSameQuarter(\n * new Date(2014, 0, 1),\n * new Date(2014, 2, 8)\n * )\n * //=> true\n */\nfunction isSameQuarter (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfQuarter = startOfQuarter(dirtyDateLeft)\n var dateRightStartOfQuarter = startOfQuarter(dirtyDateRight)\n\n return dateLeftStartOfQuarter.getTime() === dateRightStartOfQuarter.getTime()\n}\n\nmodule.exports = isSameQuarter\n","var startOfSecond = require('../start_of_second/index.js')\n\n/**\n * @category Second Helpers\n * @summary Are the given dates in the same second?\n *\n * @description\n * Are the given dates in the same second?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same second\n *\n * @example\n * // Are 4 September 2014 06:30:15.000 and 4 September 2014 06:30.15.500\n * // in the same second?\n * var result = isSameSecond(\n * new Date(2014, 8, 4, 6, 30, 15),\n * new Date(2014, 8, 4, 6, 30, 15, 500)\n * )\n * //=> true\n */\nfunction isSameSecond (dirtyDateLeft, dirtyDateRight) {\n var dateLeftStartOfSecond = startOfSecond(dirtyDateLeft)\n var dateRightStartOfSecond = startOfSecond(dirtyDateRight)\n\n return dateLeftStartOfSecond.getTime() === dateRightStartOfSecond.getTime()\n}\n\nmodule.exports = isSameSecond\n","var startOfWeek = require('../start_of_week/index.js')\n\n/**\n * @category Week Helpers\n * @summary Are the given dates in the same week?\n *\n * @description\n * Are the given dates in the same week?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the dates are in the same week\n *\n * @example\n * // Are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(\n * new Date(2014, 7, 31),\n * new Date(2014, 8, 4)\n * )\n * //=> true\n *\n * @example\n * // If week starts with Monday,\n * // are 31 August 2014 and 4 September 2014 in the same week?\n * var result = isSameWeek(\n * new Date(2014, 7, 31),\n * new Date(2014, 8, 4),\n * {weekStartsOn: 1}\n * )\n * //=> false\n */\nfunction isSameWeek (dirtyDateLeft, dirtyDateRight, dirtyOptions) {\n var dateLeftStartOfWeek = startOfWeek(dirtyDateLeft, dirtyOptions)\n var dateRightStartOfWeek = startOfWeek(dirtyDateRight, dirtyOptions)\n\n return dateLeftStartOfWeek.getTime() === dateRightStartOfWeek.getTime()\n}\n\nmodule.exports = isSameWeek\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Are the given dates in the same year?\n *\n * @description\n * Are the given dates in the same year?\n *\n * @param {Date|String|Number} dateLeft - the first date to check\n * @param {Date|String|Number} dateRight - the second date to check\n * @returns {Boolean} the dates are in the same year\n *\n * @example\n * // Are 2 September 2014 and 25 September 2014 in the same year?\n * var result = isSameYear(\n * new Date(2014, 8, 2),\n * new Date(2014, 8, 25)\n * )\n * //=> true\n */\nfunction isSameYear (dirtyDateLeft, dirtyDateRight) {\n var dateLeft = parse(dirtyDateLeft)\n var dateRight = parse(dirtyDateRight)\n return dateLeft.getFullYear() === dateRight.getFullYear()\n}\n\nmodule.exports = isSameYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Saturday?\n *\n * @description\n * Is the given date Saturday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Saturday\n *\n * @example\n * // Is 27 September 2014 Saturday?\n * var result = isSaturday(new Date(2014, 8, 27))\n * //=> true\n */\nfunction isSaturday (dirtyDate) {\n return parse(dirtyDate).getDay() === 6\n}\n\nmodule.exports = isSaturday\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Sunday?\n *\n * @description\n * Is the given date Sunday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Sunday\n *\n * @example\n * // Is 21 September 2014 Sunday?\n * var result = isSunday(new Date(2014, 8, 21))\n * //=> true\n */\nfunction isSunday (dirtyDate) {\n return parse(dirtyDate).getDay() === 0\n}\n\nmodule.exports = isSunday\n","var isSameHour = require('../is_same_hour/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Is the given date in the same hour as the current date?\n *\n * @description\n * Is the given date in the same hour as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this hour\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:00:00 in this hour?\n * var result = isThisHour(new Date(2014, 8, 25, 18))\n * //=> true\n */\nfunction isThisHour (dirtyDate) {\n return isSameHour(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisHour\n","var isSameISOWeek = require('../is_same_iso_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Is the given date in the same ISO week as the current date?\n *\n * @description\n * Is the given date in the same ISO week as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week\n *\n * @example\n * // If today is 25 September 2014, is 22 September 2014 in this ISO week?\n * var result = isThisISOWeek(new Date(2014, 8, 22))\n * //=> true\n */\nfunction isThisISOWeek (dirtyDate) {\n return isSameISOWeek(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisISOWeek\n","var isSameISOYear = require('../is_same_iso_year/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Is the given date in the same ISO week-numbering year as the current date?\n *\n * @description\n * Is the given date in the same ISO week-numbering year as the current date?\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this ISO week-numbering year\n *\n * @example\n * // If today is 25 September 2014,\n * // is 30 December 2013 in this ISO week-numbering year?\n * var result = isThisISOYear(new Date(2013, 11, 30))\n * //=> true\n */\nfunction isThisISOYear (dirtyDate) {\n return isSameISOYear(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisISOYear\n","var isSameMinute = require('../is_same_minute/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Is the given date in the same minute as the current date?\n *\n * @description\n * Is the given date in the same minute as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this minute\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:00 in this minute?\n * var result = isThisMinute(new Date(2014, 8, 25, 18, 30))\n * //=> true\n */\nfunction isThisMinute (dirtyDate) {\n return isSameMinute(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisMinute\n","var isSameMonth = require('../is_same_month/index.js')\n\n/**\n * @category Month Helpers\n * @summary Is the given date in the same month as the current date?\n *\n * @description\n * Is the given date in the same month as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this month\n *\n * @example\n * // If today is 25 September 2014, is 15 September 2014 in this month?\n * var result = isThisMonth(new Date(2014, 8, 15))\n * //=> true\n */\nfunction isThisMonth (dirtyDate) {\n return isSameMonth(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisMonth\n","var isSameQuarter = require('../is_same_quarter/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Is the given date in the same quarter as the current date?\n *\n * @description\n * Is the given date in the same quarter as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this quarter\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this quarter?\n * var result = isThisQuarter(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isThisQuarter (dirtyDate) {\n return isSameQuarter(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisQuarter\n","var isSameSecond = require('../is_same_second/index.js')\n\n/**\n * @category Second Helpers\n * @summary Is the given date in the same second as the current date?\n *\n * @description\n * Is the given date in the same second as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this second\n *\n * @example\n * // If now is 25 September 2014 18:30:15.500,\n * // is 25 September 2014 18:30:15.000 in this second?\n * var result = isThisSecond(new Date(2014, 8, 25, 18, 30, 15))\n * //=> true\n */\nfunction isThisSecond (dirtyDate) {\n return isSameSecond(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisSecond\n","var isSameWeek = require('../is_same_week/index.js')\n\n/**\n * @category Week Helpers\n * @summary Is the given date in the same week as the current date?\n *\n * @description\n * Is the given date in the same week as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Boolean} the date is in this week\n *\n * @example\n * // If today is 25 September 2014, is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21))\n * //=> true\n *\n * @example\n * // If today is 25 September 2014 and week starts with Monday\n * // is 21 September 2014 in this week?\n * var result = isThisWeek(new Date(2014, 8, 21), {weekStartsOn: 1})\n * //=> false\n */\nfunction isThisWeek (dirtyDate, dirtyOptions) {\n return isSameWeek(new Date(), dirtyDate, dirtyOptions)\n}\n\nmodule.exports = isThisWeek\n","var isSameYear = require('../is_same_year/index.js')\n\n/**\n * @category Year Helpers\n * @summary Is the given date in the same year as the current date?\n *\n * @description\n * Is the given date in the same year as the current date?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is in this year\n *\n * @example\n * // If today is 25 September 2014, is 2 July 2014 in this year?\n * var result = isThisYear(new Date(2014, 6, 2))\n * //=> true\n */\nfunction isThisYear (dirtyDate) {\n return isSameYear(new Date(), dirtyDate)\n}\n\nmodule.exports = isThisYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Thursday?\n *\n * @description\n * Is the given date Thursday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Thursday\n *\n * @example\n * // Is 25 September 2014 Thursday?\n * var result = isThursday(new Date(2014, 8, 25))\n * //=> true\n */\nfunction isThursday (dirtyDate) {\n return parse(dirtyDate).getDay() === 4\n}\n\nmodule.exports = isThursday\n","var startOfDay = require('../start_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Is the given date today?\n *\n * @description\n * Is the given date today?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is today\n *\n * @example\n * // If today is 6 October 2014, is 6 October 14:00:00 today?\n * var result = isToday(new Date(2014, 9, 6, 14, 0))\n * //=> true\n */\nfunction isToday (dirtyDate) {\n return startOfDay(dirtyDate).getTime() === startOfDay(new Date()).getTime()\n}\n\nmodule.exports = isToday\n","var startOfDay = require('../start_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Is the given date tomorrow?\n *\n * @description\n * Is the given date tomorrow?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is tomorrow\n *\n * @example\n * // If today is 6 October 2014, is 7 October 14:00:00 tomorrow?\n * var result = isTomorrow(new Date(2014, 9, 7, 14, 0))\n * //=> true\n */\nfunction isTomorrow (dirtyDate) {\n var tomorrow = new Date()\n tomorrow.setDate(tomorrow.getDate() + 1)\n return startOfDay(dirtyDate).getTime() === startOfDay(tomorrow).getTime()\n}\n\nmodule.exports = isTomorrow\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Tuesday?\n *\n * @description\n * Is the given date Tuesday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Tuesday\n *\n * @example\n * // Is 23 September 2014 Tuesday?\n * var result = isTuesday(new Date(2014, 8, 23))\n * //=> true\n */\nfunction isTuesday (dirtyDate) {\n return parse(dirtyDate).getDay() === 2\n}\n\nmodule.exports = isTuesday\n","var isDate = require('../is_date/index.js')\n\n/**\n * @category Common Helpers\n * @summary Is the given date valid?\n *\n * @description\n * Returns false if argument is Invalid Date and true otherwise.\n * Invalid Date is a Date, whose time value is NaN.\n *\n * Time value of Date: http://es5.github.io/#x15.9.1.1\n *\n * @param {Date} date - the date to check\n * @returns {Boolean} the date is valid\n * @throws {TypeError} argument must be an instance of Date\n *\n * @example\n * // For the valid date:\n * var result = isValid(new Date(2014, 1, 31))\n * //=> true\n *\n * @example\n * // For the invalid date:\n * var result = isValid(new Date(''))\n * //=> false\n */\nfunction isValid (dirtyDate) {\n if (isDate(dirtyDate)) {\n return !isNaN(dirtyDate)\n } else {\n throw new TypeError(toString.call(dirtyDate) + ' is not an instance of Date')\n }\n}\n\nmodule.exports = isValid\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Is the given date Wednesday?\n *\n * @description\n * Is the given date Wednesday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is Wednesday\n *\n * @example\n * // Is 24 September 2014 Wednesday?\n * var result = isWednesday(new Date(2014, 8, 24))\n * //=> true\n */\nfunction isWednesday (dirtyDate) {\n return parse(dirtyDate).getDay() === 3\n}\n\nmodule.exports = isWednesday\n","var parse = require('../parse/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Does the given date fall on a weekend?\n *\n * @description\n * Does the given date fall on a weekend?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date falls on a weekend\n *\n * @example\n * // Does 5 October 2014 fall on a weekend?\n * var result = isWeekend(new Date(2014, 9, 5))\n * //=> true\n */\nfunction isWeekend (dirtyDate) {\n var date = parse(dirtyDate)\n var day = date.getDay()\n return day === 0 || day === 6\n}\n\nmodule.exports = isWeekend\n","var parse = require('../parse/index.js')\n\n/**\n * @category Range Helpers\n * @summary Is the given date within the range?\n *\n * @description\n * Is the given date within the range?\n *\n * @param {Date|String|Number} date - the date to check\n * @param {Date|String|Number} startDate - the start of range\n * @param {Date|String|Number} endDate - the end of range\n * @returns {Boolean} the date is within the range\n * @throws {Error} startDate cannot be after endDate\n *\n * @example\n * // For the date within the range:\n * isWithinRange(\n * new Date(2014, 0, 3), new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n * //=> true\n *\n * @example\n * // For the date outside of the range:\n * isWithinRange(\n * new Date(2014, 0, 10), new Date(2014, 0, 1), new Date(2014, 0, 7)\n * )\n * //=> false\n */\nfunction isWithinRange (dirtyDate, dirtyStartDate, dirtyEndDate) {\n var time = parse(dirtyDate).getTime()\n var startTime = parse(dirtyStartDate).getTime()\n var endTime = parse(dirtyEndDate).getTime()\n\n if (startTime > endTime) {\n throw new Error('The start of the range cannot be after the end of the range')\n }\n\n return time >= startTime && time <= endTime\n}\n\nmodule.exports = isWithinRange\n","var startOfDay = require('../start_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Is the given date yesterday?\n *\n * @description\n * Is the given date yesterday?\n *\n * @param {Date|String|Number} date - the date to check\n * @returns {Boolean} the date is yesterday\n *\n * @example\n * // If today is 6 October 2014, is 5 October 14:00:00 yesterday?\n * var result = isYesterday(new Date(2014, 9, 5, 14, 0))\n * //=> true\n */\nfunction isYesterday (dirtyDate) {\n var yesterday = new Date()\n yesterday.setDate(yesterday.getDate() - 1)\n return startOfDay(dirtyDate).getTime() === startOfDay(yesterday).getTime()\n}\n\nmodule.exports = isYesterday\n","var lastDayOfWeek = require('../last_day_of_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Return the last day of an ISO week for the given date.\n *\n * @description\n * Return the last day of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of an ISO week\n *\n * @example\n * // The last day of an ISO week for 2 September 2014 11:55:00:\n * var result = lastDayOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction lastDayOfISOWeek (dirtyDate) {\n return lastDayOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = lastDayOfISOWeek\n","var getISOYear = require('../get_iso_year/index.js')\nvar startOfISOWeek = require('../start_of_iso_week/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the last day of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the last day of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the end of an ISO week-numbering year\n *\n * @example\n * // The last day of an ISO week-numbering year for 2 July 2005:\n * var result = lastDayOfISOYear(new Date(2005, 6, 2))\n * //=> Sun Jan 01 2006 00:00:00\n */\nfunction lastDayOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(year + 1, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuary)\n date.setDate(date.getDate() - 1)\n return date\n}\n\nmodule.exports = lastDayOfISOYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Return the last day of a month for the given date.\n *\n * @description\n * Return the last day of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a month\n *\n * @example\n * // The last day of a month for 2 September 2014 11:55:00:\n * var result = lastDayOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction lastDayOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n var month = date.getMonth()\n date.setFullYear(date.getFullYear(), month + 1, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfMonth\n","var parse = require('../parse/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Return the last day of a year quarter for the given date.\n *\n * @description\n * Return the last day of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a quarter\n *\n * @example\n * // The last day of a quarter for 2 September 2014 11:55:00:\n * var result = lastDayOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction lastDayOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3 + 3\n date.setMonth(month, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfQuarter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Week Helpers\n * @summary Return the last day of a week for the given date.\n *\n * @description\n * Return the last day of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the last day of a week\n *\n * @example\n * // The last day of a week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sat Sep 06 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the last day of the week for 2 September 2014 11:55:00:\n * var result = lastDayOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction lastDayOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn)\n\n date.setHours(0, 0, 0, 0)\n date.setDate(date.getDate() + diff)\n return date\n}\n\nmodule.exports = lastDayOfWeek\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Return the last day of a year for the given date.\n *\n * @description\n * Return the last day of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the last day of a year\n *\n * @example\n * // The last day of a year for 2 September 2014 11:55:00:\n * var result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Dec 31 2014 00:00:00\n */\nfunction lastDayOfYear (dirtyDate) {\n var date = parse(dirtyDate)\n var year = date.getFullYear()\n date.setFullYear(year + 1, 0, 0)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = lastDayOfYear\n","var commonFormatterKeys = [\n 'M', 'MM', 'Q', 'D', 'DD', 'DDD', 'DDDD', 'd',\n 'E', 'W', 'WW', 'YY', 'YYYY', 'GG', 'GGGG',\n 'H', 'HH', 'h', 'hh', 'm', 'mm',\n 's', 'ss', 'S', 'SS', 'SSS',\n 'Z', 'ZZ', 'X', 'x'\n]\n\nfunction buildFormattingTokensRegExp (formatters) {\n var formatterKeys = []\n for (var key in formatters) {\n if (formatters.hasOwnProperty(key)) {\n formatterKeys.push(key)\n }\n }\n\n var formattingTokens = commonFormatterKeys\n .concat(formatterKeys)\n .sort()\n .reverse()\n var formattingTokensRegExp = new RegExp(\n '(\\\\[[^\\\\[]*\\\\])|(\\\\\\\\)?' + '(' + formattingTokens.join('|') + '|.)', 'g'\n )\n\n return formattingTokensRegExp\n}\n\nmodule.exports = buildFormattingTokensRegExp\n","function buildDistanceInWordsLocale () {\n var distanceInWordsLocale = {\n lessThanXSeconds: {\n one: 'less than a second',\n other: 'less than {{count}} seconds'\n },\n\n xSeconds: {\n one: '1 second',\n other: '{{count}} seconds'\n },\n\n halfAMinute: 'half a minute',\n\n lessThanXMinutes: {\n one: 'less than a minute',\n other: 'less than {{count}} minutes'\n },\n\n xMinutes: {\n one: '1 minute',\n other: '{{count}} minutes'\n },\n\n aboutXHours: {\n one: 'about 1 hour',\n other: 'about {{count}} hours'\n },\n\n xHours: {\n one: '1 hour',\n other: '{{count}} hours'\n },\n\n xDays: {\n one: '1 day',\n other: '{{count}} days'\n },\n\n aboutXMonths: {\n one: 'about 1 month',\n other: 'about {{count}} months'\n },\n\n xMonths: {\n one: '1 month',\n other: '{{count}} months'\n },\n\n aboutXYears: {\n one: 'about 1 year',\n other: 'about {{count}} years'\n },\n\n xYears: {\n one: '1 year',\n other: '{{count}} years'\n },\n\n overXYears: {\n one: 'over 1 year',\n other: 'over {{count}} years'\n },\n\n almostXYears: {\n one: 'almost 1 year',\n other: 'almost {{count}} years'\n }\n }\n\n function localize (token, count, options) {\n options = options || {}\n\n var result\n if (typeof distanceInWordsLocale[token] === 'string') {\n result = distanceInWordsLocale[token]\n } else if (count === 1) {\n result = distanceInWordsLocale[token].one\n } else {\n result = distanceInWordsLocale[token].other.replace('{{count}}', count)\n }\n\n if (options.addSuffix) {\n if (options.comparison > 0) {\n return 'in ' + result\n } else {\n return result + ' ago'\n }\n }\n\n return result\n }\n\n return {\n localize: localize\n }\n}\n\nmodule.exports = buildDistanceInWordsLocale\n","var buildFormattingTokensRegExp = require('../../_lib/build_formatting_tokens_reg_exp/index.js')\n\nfunction buildFormatLocale () {\n // Note: in English, the names of days of the week and months are capitalized.\n // If you are making a new locale based on this one, check if the same is true for the language you're working on.\n // Generally, formatted dates should look like they are in the middle of a sentence,\n // e.g. in Spanish language the weekdays and months should be in the lowercase.\n var months3char = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n var monthsFull = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']\n var weekdays2char = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']\n var weekdays3char = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']\n var weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']\n var meridiemUppercase = ['AM', 'PM']\n var meridiemLowercase = ['am', 'pm']\n var meridiemFull = ['a.m.', 'p.m.']\n\n var formatters = {\n // Month: Jan, Feb, ..., Dec\n 'MMM': function (date) {\n return months3char[date.getMonth()]\n },\n\n // Month: January, February, ..., December\n 'MMMM': function (date) {\n return monthsFull[date.getMonth()]\n },\n\n // Day of week: Su, Mo, ..., Sa\n 'dd': function (date) {\n return weekdays2char[date.getDay()]\n },\n\n // Day of week: Sun, Mon, ..., Sat\n 'ddd': function (date) {\n return weekdays3char[date.getDay()]\n },\n\n // Day of week: Sunday, Monday, ..., Saturday\n 'dddd': function (date) {\n return weekdaysFull[date.getDay()]\n },\n\n // AM, PM\n 'A': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemUppercase[1] : meridiemUppercase[0]\n },\n\n // am, pm\n 'a': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemLowercase[1] : meridiemLowercase[0]\n },\n\n // a.m., p.m.\n 'aa': function (date) {\n return (date.getHours() / 12) >= 1 ? meridiemFull[1] : meridiemFull[0]\n }\n }\n\n // Generate ordinal version of formatters: M -> Mo, D -> Do, etc.\n var ordinalFormatters = ['M', 'D', 'DDD', 'd', 'Q', 'W']\n ordinalFormatters.forEach(function (formatterToken) {\n formatters[formatterToken + 'o'] = function (date, formatters) {\n return ordinal(formatters[formatterToken](date))\n }\n })\n\n return {\n formatters: formatters,\n formattingTokensRegExp: buildFormattingTokensRegExp(formatters)\n }\n}\n\nfunction ordinal (number) {\n var rem100 = number % 100\n if (rem100 > 20 || rem100 < 10) {\n switch (rem100 % 10) {\n case 1:\n return number + 'st'\n case 2:\n return number + 'nd'\n case 3:\n return number + 'rd'\n }\n }\n return number + 'th'\n}\n\nmodule.exports = buildFormatLocale\n","var buildDistanceInWordsLocale = require('./build_distance_in_words_locale/index.js')\nvar buildFormatLocale = require('./build_format_locale/index.js')\n\n/**\n * @category Locales\n * @summary English locale.\n */\nmodule.exports = {\n distanceInWords: buildDistanceInWordsLocale(),\n format: buildFormatLocale()\n}\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Return the latest of the given dates.\n *\n * @description\n * Return the latest of the given dates.\n *\n * @param {...(Date|String|Number)} dates - the dates to compare\n * @returns {Date} the latest of the dates\n *\n * @example\n * // Which of these dates is the latest?\n * var result = max(\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * )\n * //=> Sun Jul 02 1995 00:00:00\n */\nfunction max () {\n var dirtyDates = Array.prototype.slice.call(arguments)\n var dates = dirtyDates.map(function (dirtyDate) {\n return parse(dirtyDate)\n })\n var latestTimestamp = Math.max.apply(null, dates)\n return new Date(latestTimestamp)\n}\n\nmodule.exports = max\n","var parse = require('../parse/index.js')\n\n/**\n * @category Common Helpers\n * @summary Return the earliest of the given dates.\n *\n * @description\n * Return the earliest of the given dates.\n *\n * @param {...(Date|String|Number)} dates - the dates to compare\n * @returns {Date} the earliest of the dates\n *\n * @example\n * // Which of these dates is the earliest?\n * var result = min(\n * new Date(1989, 6, 10),\n * new Date(1987, 1, 11),\n * new Date(1995, 6, 2),\n * new Date(1990, 0, 1)\n * )\n * //=> Wed Feb 11 1987 00:00:00\n */\nfunction min () {\n var dirtyDates = Array.prototype.slice.call(arguments)\n var dates = dirtyDates.map(function (dirtyDate) {\n return parse(dirtyDate)\n })\n var earliestTimestamp = Math.min.apply(null, dates)\n return new Date(earliestTimestamp)\n}\n\nmodule.exports = min\n","var getTimezoneOffsetInMilliseconds = require('../_lib/getTimezoneOffsetInMilliseconds/index.js')\nvar isDate = require('../is_date/index.js')\n\nvar MILLISECONDS_IN_HOUR = 3600000\nvar MILLISECONDS_IN_MINUTE = 60000\nvar DEFAULT_ADDITIONAL_DIGITS = 2\n\nvar parseTokenDateTimeDelimeter = /[T ]/\nvar parseTokenPlainTime = /:/\n\n// year tokens\nvar parseTokenYY = /^(\\d{2})$/\nvar parseTokensYYY = [\n /^([+-]\\d{2})$/, // 0 additional digits\n /^([+-]\\d{3})$/, // 1 additional digit\n /^([+-]\\d{4})$/ // 2 additional digits\n]\n\nvar parseTokenYYYY = /^(\\d{4})/\nvar parseTokensYYYYY = [\n /^([+-]\\d{4})/, // 0 additional digits\n /^([+-]\\d{5})/, // 1 additional digit\n /^([+-]\\d{6})/ // 2 additional digits\n]\n\n// date tokens\nvar parseTokenMM = /^-(\\d{2})$/\nvar parseTokenDDD = /^-?(\\d{3})$/\nvar parseTokenMMDD = /^-?(\\d{2})-?(\\d{2})$/\nvar parseTokenWww = /^-?W(\\d{2})$/\nvar parseTokenWwwD = /^-?W(\\d{2})-?(\\d{1})$/\n\n// time tokens\nvar parseTokenHH = /^(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMM = /^(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\nvar parseTokenHHMMSS = /^(\\d{2}):?(\\d{2}):?(\\d{2}([.,]\\d*)?)$/\n\n// timezone tokens\nvar parseTokenTimezone = /([Z+-].*)$/\nvar parseTokenTimezoneZ = /^(Z)$/\nvar parseTokenTimezoneHH = /^([+-])(\\d{2})$/\nvar parseTokenTimezoneHHMM = /^([+-])(\\d{2}):?(\\d{2})$/\n\n/**\n * @category Common Helpers\n * @summary Convert the given argument to an instance of Date.\n *\n * @description\n * Convert the given argument to an instance of Date.\n *\n * If the argument is an instance of Date, the function returns its clone.\n *\n * If the argument is a number, it is treated as a timestamp.\n *\n * If an argument is a string, the function tries to parse it.\n * Function accepts complete ISO 8601 formats as well as partial implementations.\n * ISO 8601: http://en.wikipedia.org/wiki/ISO_8601\n *\n * If all above fails, the function passes the given argument to Date constructor.\n *\n * @param {Date|String|Number} argument - the value to convert\n * @param {Object} [options] - the object with options\n * @param {0 | 1 | 2} [options.additionalDigits=2] - the additional number of digits in the extended year format\n * @returns {Date} the parsed date in the local time zone\n *\n * @example\n * // Convert string '2014-02-11T11:30:30' to date:\n * var result = parse('2014-02-11T11:30:30')\n * //=> Tue Feb 11 2014 11:30:30\n *\n * @example\n * // Parse string '+02014101',\n * // if the additional number of digits in the extended year format is 1:\n * var result = parse('+02014101', {additionalDigits: 1})\n * //=> Fri Apr 11 2014 00:00:00\n */\nfunction parse (argument, dirtyOptions) {\n if (isDate(argument)) {\n // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n return new Date(argument.getTime())\n } else if (typeof argument !== 'string') {\n return new Date(argument)\n }\n\n var options = dirtyOptions || {}\n var additionalDigits = options.additionalDigits\n if (additionalDigits == null) {\n additionalDigits = DEFAULT_ADDITIONAL_DIGITS\n } else {\n additionalDigits = Number(additionalDigits)\n }\n\n var dateStrings = splitDateString(argument)\n\n var parseYearResult = parseYear(dateStrings.date, additionalDigits)\n var year = parseYearResult.year\n var restDateString = parseYearResult.restDateString\n\n var date = parseDate(restDateString, year)\n\n if (date) {\n var timestamp = date.getTime()\n var time = 0\n var offset\n\n if (dateStrings.time) {\n time = parseTime(dateStrings.time)\n }\n\n if (dateStrings.timezone) {\n offset = parseTimezone(dateStrings.timezone) * MILLISECONDS_IN_MINUTE\n } else {\n var fullTime = timestamp + time\n var fullTimeDate = new Date(fullTime)\n\n offset = getTimezoneOffsetInMilliseconds(fullTimeDate)\n\n // Adjust time when it's coming from DST\n var fullTimeDateNextDay = new Date(fullTime)\n fullTimeDateNextDay.setDate(fullTimeDate.getDate() + 1)\n var offsetDiff =\n getTimezoneOffsetInMilliseconds(fullTimeDateNextDay) -\n getTimezoneOffsetInMilliseconds(fullTimeDate)\n if (offsetDiff > 0) {\n offset += offsetDiff\n }\n }\n\n return new Date(timestamp + time + offset)\n } else {\n return new Date(argument)\n }\n}\n\nfunction splitDateString (dateString) {\n var dateStrings = {}\n var array = dateString.split(parseTokenDateTimeDelimeter)\n var timeString\n\n if (parseTokenPlainTime.test(array[0])) {\n dateStrings.date = null\n timeString = array[0]\n } else {\n dateStrings.date = array[0]\n timeString = array[1]\n }\n\n if (timeString) {\n var token = parseTokenTimezone.exec(timeString)\n if (token) {\n dateStrings.time = timeString.replace(token[1], '')\n dateStrings.timezone = token[1]\n } else {\n dateStrings.time = timeString\n }\n }\n\n return dateStrings\n}\n\nfunction parseYear (dateString, additionalDigits) {\n var parseTokenYYY = parseTokensYYY[additionalDigits]\n var parseTokenYYYYY = parseTokensYYYYY[additionalDigits]\n\n var token\n\n // YYYY or ±YYYYY\n token = parseTokenYYYY.exec(dateString) || parseTokenYYYYY.exec(dateString)\n if (token) {\n var yearString = token[1]\n return {\n year: parseInt(yearString, 10),\n restDateString: dateString.slice(yearString.length)\n }\n }\n\n // YY or ±YYY\n token = parseTokenYY.exec(dateString) || parseTokenYYY.exec(dateString)\n if (token) {\n var centuryString = token[1]\n return {\n year: parseInt(centuryString, 10) * 100,\n restDateString: dateString.slice(centuryString.length)\n }\n }\n\n // Invalid ISO-formatted year\n return {\n year: null\n }\n}\n\nfunction parseDate (dateString, year) {\n // Invalid ISO-formatted year\n if (year === null) {\n return null\n }\n\n var token\n var date\n var month\n var week\n\n // YYYY\n if (dateString.length === 0) {\n date = new Date(0)\n date.setUTCFullYear(year)\n return date\n }\n\n // YYYY-MM\n token = parseTokenMM.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n date.setUTCFullYear(year, month)\n return date\n }\n\n // YYYY-DDD or YYYYDDD\n token = parseTokenDDD.exec(dateString)\n if (token) {\n date = new Date(0)\n var dayOfYear = parseInt(token[1], 10)\n date.setUTCFullYear(year, 0, dayOfYear)\n return date\n }\n\n // YYYY-MM-DD or YYYYMMDD\n token = parseTokenMMDD.exec(dateString)\n if (token) {\n date = new Date(0)\n month = parseInt(token[1], 10) - 1\n var day = parseInt(token[2], 10)\n date.setUTCFullYear(year, month, day)\n return date\n }\n\n // YYYY-Www or YYYYWww\n token = parseTokenWww.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n return dayOfISOYear(year, week)\n }\n\n // YYYY-Www-D or YYYYWwwD\n token = parseTokenWwwD.exec(dateString)\n if (token) {\n week = parseInt(token[1], 10) - 1\n var dayOfWeek = parseInt(token[2], 10) - 1\n return dayOfISOYear(year, week, dayOfWeek)\n }\n\n // Invalid ISO-formatted date\n return null\n}\n\nfunction parseTime (timeString) {\n var token\n var hours\n var minutes\n\n // hh\n token = parseTokenHH.exec(timeString)\n if (token) {\n hours = parseFloat(token[1].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR\n }\n\n // hh:mm or hhmm\n token = parseTokenHHMM.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseFloat(token[2].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE\n }\n\n // hh:mm:ss or hhmmss\n token = parseTokenHHMMSS.exec(timeString)\n if (token) {\n hours = parseInt(token[1], 10)\n minutes = parseInt(token[2], 10)\n var seconds = parseFloat(token[3].replace(',', '.'))\n return (hours % 24) * MILLISECONDS_IN_HOUR +\n minutes * MILLISECONDS_IN_MINUTE +\n seconds * 1000\n }\n\n // Invalid ISO-formatted time\n return null\n}\n\nfunction parseTimezone (timezoneString) {\n var token\n var absoluteOffset\n\n // Z\n token = parseTokenTimezoneZ.exec(timezoneString)\n if (token) {\n return 0\n }\n\n // ±hh\n token = parseTokenTimezoneHH.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n // ±hh:mm or ±hhmm\n token = parseTokenTimezoneHHMM.exec(timezoneString)\n if (token) {\n absoluteOffset = parseInt(token[2], 10) * 60 + parseInt(token[3], 10)\n return (token[1] === '+') ? -absoluteOffset : absoluteOffset\n }\n\n return 0\n}\n\nfunction dayOfISOYear (isoYear, week, day) {\n week = week || 0\n day = day || 0\n var date = new Date(0)\n date.setUTCFullYear(isoYear, 0, 4)\n var fourthOfJanuaryDay = date.getUTCDay() || 7\n var diff = week * 7 + day + 1 - fourthOfJanuaryDay\n date.setUTCDate(date.getUTCDate() + diff)\n return date\n}\n\nmodule.exports = parse\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Set the day of the month to the given date.\n *\n * @description\n * Set the day of the month to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} dayOfMonth - the day of the month of the new date\n * @returns {Date} the new date with the day of the month setted\n *\n * @example\n * // Set the 30th day of the month to 1 September 2014:\n * var result = setDate(new Date(2014, 8, 1), 30)\n * //=> Tue Sep 30 2014 00:00:00\n */\nfunction setDate (dirtyDate, dirtyDayOfMonth) {\n var date = parse(dirtyDate)\n var dayOfMonth = Number(dirtyDayOfMonth)\n date.setDate(dayOfMonth)\n return date\n}\n\nmodule.exports = setDate\n","var parse = require('../parse/index.js')\nvar addDays = require('../add_days/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Set the day of the week to the given date.\n *\n * @description\n * Set the day of the week to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} day - the day of the week of the new date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the new date with the day of the week setted\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0)\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If week starts with Monday, set Sunday to 1 September 2014:\n * var result = setDay(new Date(2014, 8, 1), 0, {weekStartsOn: 1})\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setDay (dirtyDate, dirtyDay, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n var date = parse(dirtyDate)\n var day = Number(dirtyDay)\n var currentDay = date.getDay()\n\n var remainder = day % 7\n var dayIndex = (remainder + 7) % 7\n\n var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay\n return addDays(date, diff)\n}\n\nmodule.exports = setDay\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Set the day of the year to the given date.\n *\n * @description\n * Set the day of the year to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} dayOfYear - the day of the year of the new date\n * @returns {Date} the new date with the day of the year setted\n *\n * @example\n * // Set the 2nd day of the year to 2 July 2014:\n * var result = setDayOfYear(new Date(2014, 6, 2), 2)\n * //=> Thu Jan 02 2014 00:00:00\n */\nfunction setDayOfYear (dirtyDate, dirtyDayOfYear) {\n var date = parse(dirtyDate)\n var dayOfYear = Number(dirtyDayOfYear)\n date.setMonth(0)\n date.setDate(dayOfYear)\n return date\n}\n\nmodule.exports = setDayOfYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Set the hours to the given date.\n *\n * @description\n * Set the hours to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} hours - the hours of the new date\n * @returns {Date} the new date with the hours setted\n *\n * @example\n * // Set 4 hours to 1 September 2014 11:30:00:\n * var result = setHours(new Date(2014, 8, 1, 11, 30), 4)\n * //=> Mon Sep 01 2014 04:30:00\n */\nfunction setHours (dirtyDate, dirtyHours) {\n var date = parse(dirtyDate)\n var hours = Number(dirtyHours)\n date.setHours(hours)\n return date\n}\n\nmodule.exports = setHours\n","var parse = require('../parse/index.js')\nvar addDays = require('../add_days/index.js')\nvar getISODay = require('../get_iso_day/index.js')\n\n/**\n * @category Weekday Helpers\n * @summary Set the day of the ISO week to the given date.\n *\n * @description\n * Set the day of the ISO week to the given date.\n * ISO week starts with Monday.\n * 7 is the index of Sunday, 1 is the index of Monday etc.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} day - the day of the ISO week of the new date\n * @returns {Date} the new date with the day of the ISO week setted\n *\n * @example\n * // Set Sunday to 1 September 2014:\n * var result = setISODay(new Date(2014, 8, 1), 7)\n * //=> Sun Sep 07 2014 00:00:00\n */\nfunction setISODay (dirtyDate, dirtyDay) {\n var date = parse(dirtyDate)\n var day = Number(dirtyDay)\n var currentDay = getISODay(date)\n var diff = day - currentDay\n return addDays(date, diff)\n}\n\nmodule.exports = setISODay\n","var parse = require('../parse/index.js')\nvar getISOWeek = require('../get_iso_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Set the ISO week to the given date.\n *\n * @description\n * Set the ISO week to the given date, saving the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} isoWeek - the ISO week of the new date\n * @returns {Date} the new date with the ISO week setted\n *\n * @example\n * // Set the 53rd ISO week to 7 August 2004:\n * var result = setISOWeek(new Date(2004, 7, 7), 53)\n * //=> Sat Jan 01 2005 00:00:00\n */\nfunction setISOWeek (dirtyDate, dirtyISOWeek) {\n var date = parse(dirtyDate)\n var isoWeek = Number(dirtyISOWeek)\n var diff = getISOWeek(date) - isoWeek\n date.setDate(date.getDate() - diff * 7)\n return date\n}\n\nmodule.exports = setISOWeek\n","var parse = require('../parse/index.js')\nvar startOfISOYear = require('../start_of_iso_year/index.js')\nvar differenceInCalendarDays = require('../difference_in_calendar_days/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Set the ISO week-numbering year to the given date.\n *\n * @description\n * Set the ISO week-numbering year to the given date,\n * saving the week number and the weekday number.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} isoYear - the ISO week-numbering year of the new date\n * @returns {Date} the new date with the ISO week-numbering year setted\n *\n * @example\n * // Set ISO week-numbering year 2007 to 29 December 2008:\n * var result = setISOYear(new Date(2008, 11, 29), 2007)\n * //=> Mon Jan 01 2007 00:00:00\n */\nfunction setISOYear (dirtyDate, dirtyISOYear) {\n var date = parse(dirtyDate)\n var isoYear = Number(dirtyISOYear)\n var diff = differenceInCalendarDays(date, startOfISOYear(date))\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(isoYear, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n date = startOfISOYear(fourthOfJanuary)\n date.setDate(date.getDate() + diff)\n return date\n}\n\nmodule.exports = setISOYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Set the milliseconds to the given date.\n *\n * @description\n * Set the milliseconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} milliseconds - the milliseconds of the new date\n * @returns {Date} the new date with the milliseconds setted\n *\n * @example\n * // Set 300 milliseconds to 1 September 2014 11:30:40.500:\n * var result = setMilliseconds(new Date(2014, 8, 1, 11, 30, 40, 500), 300)\n * //=> Mon Sep 01 2014 11:30:40.300\n */\nfunction setMilliseconds (dirtyDate, dirtyMilliseconds) {\n var date = parse(dirtyDate)\n var milliseconds = Number(dirtyMilliseconds)\n date.setMilliseconds(milliseconds)\n return date\n}\n\nmodule.exports = setMilliseconds\n","var parse = require('../parse/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Set the minutes to the given date.\n *\n * @description\n * Set the minutes to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} minutes - the minutes of the new date\n * @returns {Date} the new date with the minutes setted\n *\n * @example\n * // Set 45 minutes to 1 September 2014 11:30:40:\n * var result = setMinutes(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:45:40\n */\nfunction setMinutes (dirtyDate, dirtyMinutes) {\n var date = parse(dirtyDate)\n var minutes = Number(dirtyMinutes)\n date.setMinutes(minutes)\n return date\n}\n\nmodule.exports = setMinutes\n","var parse = require('../parse/index.js')\nvar getDaysInMonth = require('../get_days_in_month/index.js')\n\n/**\n * @category Month Helpers\n * @summary Set the month to the given date.\n *\n * @description\n * Set the month to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} month - the month of the new date\n * @returns {Date} the new date with the month setted\n *\n * @example\n * // Set February to 1 September 2014:\n * var result = setMonth(new Date(2014, 8, 1), 1)\n * //=> Sat Feb 01 2014 00:00:00\n */\nfunction setMonth (dirtyDate, dirtyMonth) {\n var date = parse(dirtyDate)\n var month = Number(dirtyMonth)\n var year = date.getFullYear()\n var day = date.getDate()\n\n var dateWithDesiredMonth = new Date(0)\n dateWithDesiredMonth.setFullYear(year, month, 15)\n dateWithDesiredMonth.setHours(0, 0, 0, 0)\n var daysInMonth = getDaysInMonth(dateWithDesiredMonth)\n // Set the last day of the new month\n // if the original date was the last day of the longer month\n date.setMonth(month, Math.min(day, daysInMonth))\n return date\n}\n\nmodule.exports = setMonth\n","var parse = require('../parse/index.js')\nvar setMonth = require('../set_month/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Set the year quarter to the given date.\n *\n * @description\n * Set the year quarter to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} quarter - the quarter of the new date\n * @returns {Date} the new date with the quarter setted\n *\n * @example\n * // Set the 2nd quarter to 2 July 2014:\n * var result = setQuarter(new Date(2014, 6, 2), 2)\n * //=> Wed Apr 02 2014 00:00:00\n */\nfunction setQuarter (dirtyDate, dirtyQuarter) {\n var date = parse(dirtyDate)\n var quarter = Number(dirtyQuarter)\n var oldQuarter = Math.floor(date.getMonth() / 3) + 1\n var diff = quarter - oldQuarter\n return setMonth(date, date.getMonth() + diff * 3)\n}\n\nmodule.exports = setQuarter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Second Helpers\n * @summary Set the seconds to the given date.\n *\n * @description\n * Set the seconds to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} seconds - the seconds of the new date\n * @returns {Date} the new date with the seconds setted\n *\n * @example\n * // Set 45 seconds to 1 September 2014 11:30:40:\n * var result = setSeconds(new Date(2014, 8, 1, 11, 30, 40), 45)\n * //=> Mon Sep 01 2014 11:30:45\n */\nfunction setSeconds (dirtyDate, dirtySeconds) {\n var date = parse(dirtyDate)\n var seconds = Number(dirtySeconds)\n date.setSeconds(seconds)\n return date\n}\n\nmodule.exports = setSeconds\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} year - the year of the new date\n * @returns {Date} the new date with the year setted\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * var result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nfunction setYear (dirtyDate, dirtyYear) {\n var date = parse(dirtyDate)\n var year = Number(dirtyYear)\n date.setFullYear(year)\n return date\n}\n\nmodule.exports = setYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Day Helpers\n * @summary Return the start of a day for the given date.\n *\n * @description\n * Return the start of a day for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a day\n *\n * @example\n * // The start of a day for 2 September 2014 11:55:00:\n * var result = startOfDay(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Sep 02 2014 00:00:00\n */\nfunction startOfDay (dirtyDate) {\n var date = parse(dirtyDate)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfDay\n","var parse = require('../parse/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Return the start of an hour for the given date.\n *\n * @description\n * Return the start of an hour for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an hour\n *\n * @example\n * // The start of an hour for 2 September 2014 11:55:00:\n * var result = startOfHour(new Date(2014, 8, 2, 11, 55))\n * //=> Tue Sep 02 2014 11:00:00\n */\nfunction startOfHour (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMinutes(0, 0, 0)\n return date\n}\n\nmodule.exports = startOfHour\n","var startOfWeek = require('../start_of_week/index.js')\n\n/**\n * @category ISO Week Helpers\n * @summary Return the start of an ISO week for the given date.\n *\n * @description\n * Return the start of an ISO week for the given date.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an ISO week\n *\n * @example\n * // The start of an ISO week for 2 September 2014 11:55:00:\n * var result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfISOWeek (dirtyDate) {\n return startOfWeek(dirtyDate, {weekStartsOn: 1})\n}\n\nmodule.exports = startOfISOWeek\n","var getISOYear = require('../get_iso_year/index.js')\nvar startOfISOWeek = require('../start_of_iso_week/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Return the start of an ISO week-numbering year for the given date.\n *\n * @description\n * Return the start of an ISO week-numbering year,\n * which always starts 3 days before the year's first Thursday.\n * The result will be in the local timezone.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of an ISO year\n *\n * @example\n * // The start of an ISO week-numbering year for 2 July 2005:\n * var result = startOfISOYear(new Date(2005, 6, 2))\n * //=> Mon Jan 03 2005 00:00:00\n */\nfunction startOfISOYear (dirtyDate) {\n var year = getISOYear(dirtyDate)\n var fourthOfJanuary = new Date(0)\n fourthOfJanuary.setFullYear(year, 0, 4)\n fourthOfJanuary.setHours(0, 0, 0, 0)\n var date = startOfISOWeek(fourthOfJanuary)\n return date\n}\n\nmodule.exports = startOfISOYear\n","var parse = require('../parse/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Return the start of a minute for the given date.\n *\n * @description\n * Return the start of a minute for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a minute\n *\n * @example\n * // The start of a minute for 1 December 2014 22:15:45.400:\n * var result = startOfMinute(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:00\n */\nfunction startOfMinute (dirtyDate) {\n var date = parse(dirtyDate)\n date.setSeconds(0, 0)\n return date\n}\n\nmodule.exports = startOfMinute\n","var parse = require('../parse/index.js')\n\n/**\n * @category Month Helpers\n * @summary Return the start of a month for the given date.\n *\n * @description\n * Return the start of a month for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a month\n *\n * @example\n * // The start of a month for 2 September 2014 11:55:00:\n * var result = startOfMonth(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfMonth (dirtyDate) {\n var date = parse(dirtyDate)\n date.setDate(1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfMonth\n","var parse = require('../parse/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Return the start of a year quarter for the given date.\n *\n * @description\n * Return the start of a year quarter for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a quarter\n *\n * @example\n * // The start of a quarter for 2 September 2014 11:55:00:\n * var result = startOfQuarter(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Tue Jul 01 2014 00:00:00\n */\nfunction startOfQuarter (dirtyDate) {\n var date = parse(dirtyDate)\n var currentMonth = date.getMonth()\n var month = currentMonth - currentMonth % 3\n date.setMonth(month, 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfQuarter\n","var parse = require('../parse/index.js')\n\n/**\n * @category Second Helpers\n * @summary Return the start of a second for the given date.\n *\n * @description\n * Return the start of a second for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a second\n *\n * @example\n * // The start of a second for 1 December 2014 22:15:45.400:\n * var result = startOfSecond(new Date(2014, 11, 1, 22, 15, 45, 400))\n * //=> Mon Dec 01 2014 22:15:45.000\n */\nfunction startOfSecond (dirtyDate) {\n var date = parse(dirtyDate)\n date.setMilliseconds(0)\n return date\n}\n\nmodule.exports = startOfSecond\n","var startOfDay = require('../start_of_day/index.js')\n\n/**\n * @category Day Helpers\n * @summary Return the start of today.\n *\n * @description\n * Return the start of today.\n *\n * @returns {Date} the start of today\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfToday()\n * //=> Mon Oct 6 2014 00:00:00\n */\nfunction startOfToday () {\n return startOfDay(new Date())\n}\n\nmodule.exports = startOfToday\n","/**\n * @category Day Helpers\n * @summary Return the start of tomorrow.\n *\n * @description\n * Return the start of tomorrow.\n *\n * @returns {Date} the start of tomorrow\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfTomorrow()\n * //=> Tue Oct 7 2014 00:00:00\n */\nfunction startOfTomorrow () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day + 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfTomorrow\n","var parse = require('../parse/index.js')\n\n/**\n * @category Week Helpers\n * @summary Return the start of a week for the given date.\n *\n * @description\n * Return the start of a week for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @param {Object} [options] - the object with options\n * @param {Number} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @returns {Date} the start of a week\n *\n * @example\n * // The start of a week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0))\n * //=> Sun Aug 31 2014 00:00:00\n *\n * @example\n * // If the week starts on Monday, the start of the week for 2 September 2014 11:55:00:\n * var result = startOfWeek(new Date(2014, 8, 2, 11, 55, 0), {weekStartsOn: 1})\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction startOfWeek (dirtyDate, dirtyOptions) {\n var weekStartsOn = dirtyOptions ? (Number(dirtyOptions.weekStartsOn) || 0) : 0\n\n var date = parse(dirtyDate)\n var day = date.getDay()\n var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn\n\n date.setDate(date.getDate() - diff)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfWeek\n","var parse = require('../parse/index.js')\n\n/**\n * @category Year Helpers\n * @summary Return the start of a year for the given date.\n *\n * @description\n * Return the start of a year for the given date.\n * The result will be in the local timezone.\n *\n * @param {Date|String|Number} date - the original date\n * @returns {Date} the start of a year\n *\n * @example\n * // The start of a year for 2 September 2014 11:55:00:\n * var result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))\n * //=> Wed Jan 01 2014 00:00:00\n */\nfunction startOfYear (dirtyDate) {\n var cleanDate = parse(dirtyDate)\n var date = new Date(0)\n date.setFullYear(cleanDate.getFullYear(), 0, 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfYear\n","/**\n * @category Day Helpers\n * @summary Return the start of yesterday.\n *\n * @description\n * Return the start of yesterday.\n *\n * @returns {Date} the start of yesterday\n *\n * @example\n * // If today is 6 October 2014:\n * var result = startOfYesterday()\n * //=> Sun Oct 5 2014 00:00:00\n */\nfunction startOfYesterday () {\n var now = new Date()\n var year = now.getFullYear()\n var month = now.getMonth()\n var day = now.getDate()\n\n var date = new Date(0)\n date.setFullYear(year, month, day - 1)\n date.setHours(0, 0, 0, 0)\n return date\n}\n\nmodule.exports = startOfYesterday\n","var addDays = require('../add_days/index.js')\n\n/**\n * @category Day Helpers\n * @summary Subtract the specified number of days from the given date.\n *\n * @description\n * Subtract the specified number of days from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of days to be subtracted\n * @returns {Date} the new date with the days subtracted\n *\n * @example\n * // Subtract 10 days from 1 September 2014:\n * var result = subDays(new Date(2014, 8, 1), 10)\n * //=> Fri Aug 22 2014 00:00:00\n */\nfunction subDays (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addDays(dirtyDate, -amount)\n}\n\nmodule.exports = subDays\n","var addHours = require('../add_hours/index.js')\n\n/**\n * @category Hour Helpers\n * @summary Subtract the specified number of hours from the given date.\n *\n * @description\n * Subtract the specified number of hours from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of hours to be subtracted\n * @returns {Date} the new date with the hours subtracted\n *\n * @example\n * // Subtract 2 hours from 11 July 2014 01:00:00:\n * var result = subHours(new Date(2014, 6, 11, 1, 0), 2)\n * //=> Thu Jul 10 2014 23:00:00\n */\nfunction subHours (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addHours(dirtyDate, -amount)\n}\n\nmodule.exports = subHours\n","var addISOYears = require('../add_iso_years/index.js')\n\n/**\n * @category ISO Week-Numbering Year Helpers\n * @summary Subtract the specified number of ISO week-numbering years from the given date.\n *\n * @description\n * Subtract the specified number of ISO week-numbering years from the given date.\n *\n * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of ISO week-numbering years to be subtracted\n * @returns {Date} the new date with the ISO week-numbering years subtracted\n *\n * @example\n * // Subtract 5 ISO week-numbering years from 1 September 2014:\n * var result = subISOYears(new Date(2014, 8, 1), 5)\n * //=> Mon Aug 31 2009 00:00:00\n */\nfunction subISOYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addISOYears(dirtyDate, -amount)\n}\n\nmodule.exports = subISOYears\n","var addMilliseconds = require('../add_milliseconds/index.js')\n\n/**\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted\n * @returns {Date} the new date with the milliseconds subtracted\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * var result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\nfunction subMilliseconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMilliseconds(dirtyDate, -amount)\n}\n\nmodule.exports = subMilliseconds\n","var addMinutes = require('../add_minutes/index.js')\n\n/**\n * @category Minute Helpers\n * @summary Subtract the specified number of minutes from the given date.\n *\n * @description\n * Subtract the specified number of minutes from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of minutes to be subtracted\n * @returns {Date} the new date with the mintues subtracted\n *\n * @example\n * // Subtract 30 minutes from 10 July 2014 12:00:00:\n * var result = subMinutes(new Date(2014, 6, 10, 12, 0), 30)\n * //=> Thu Jul 10 2014 11:30:00\n */\nfunction subMinutes (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMinutes(dirtyDate, -amount)\n}\n\nmodule.exports = subMinutes\n","var addMonths = require('../add_months/index.js')\n\n/**\n * @category Month Helpers\n * @summary Subtract the specified number of months from the given date.\n *\n * @description\n * Subtract the specified number of months from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of months to be subtracted\n * @returns {Date} the new date with the months subtracted\n *\n * @example\n * // Subtract 5 months from 1 February 2015:\n * var result = subMonths(new Date(2015, 1, 1), 5)\n * //=> Mon Sep 01 2014 00:00:00\n */\nfunction subMonths (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addMonths(dirtyDate, -amount)\n}\n\nmodule.exports = subMonths\n","var addQuarters = require('../add_quarters/index.js')\n\n/**\n * @category Quarter Helpers\n * @summary Subtract the specified number of year quarters from the given date.\n *\n * @description\n * Subtract the specified number of year quarters from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of quarters to be subtracted\n * @returns {Date} the new date with the quarters subtracted\n *\n * @example\n * // Subtract 3 quarters from 1 September 2014:\n * var result = subQuarters(new Date(2014, 8, 1), 3)\n * //=> Sun Dec 01 2013 00:00:00\n */\nfunction subQuarters (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addQuarters(dirtyDate, -amount)\n}\n\nmodule.exports = subQuarters\n","var addSeconds = require('../add_seconds/index.js')\n\n/**\n * @category Second Helpers\n * @summary Subtract the specified number of seconds from the given date.\n *\n * @description\n * Subtract the specified number of seconds from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of seconds to be subtracted\n * @returns {Date} the new date with the seconds subtracted\n *\n * @example\n * // Subtract 30 seconds from 10 July 2014 12:45:00:\n * var result = subSeconds(new Date(2014, 6, 10, 12, 45, 0), 30)\n * //=> Thu Jul 10 2014 12:44:30\n */\nfunction subSeconds (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addSeconds(dirtyDate, -amount)\n}\n\nmodule.exports = subSeconds\n","var addWeeks = require('../add_weeks/index.js')\n\n/**\n * @category Week Helpers\n * @summary Subtract the specified number of weeks from the given date.\n *\n * @description\n * Subtract the specified number of weeks from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of weeks to be subtracted\n * @returns {Date} the new date with the weeks subtracted\n *\n * @example\n * // Subtract 4 weeks from 1 September 2014:\n * var result = subWeeks(new Date(2014, 8, 1), 4)\n * //=> Mon Aug 04 2014 00:00:00\n */\nfunction subWeeks (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addWeeks(dirtyDate, -amount)\n}\n\nmodule.exports = subWeeks\n","var addYears = require('../add_years/index.js')\n\n/**\n * @category Year Helpers\n * @summary Subtract the specified number of years from the given date.\n *\n * @description\n * Subtract the specified number of years from the given date.\n *\n * @param {Date|String|Number} date - the date to be changed\n * @param {Number} amount - the amount of years to be subtracted\n * @returns {Date} the new date with the years subtracted\n *\n * @example\n * // Subtract 5 years from 1 September 2014:\n * var result = subYears(new Date(2014, 8, 1), 5)\n * //=> Tue Sep 01 2009 00:00:00\n */\nfunction subYears (dirtyDate, dirtyAmount) {\n var amount = Number(dirtyAmount)\n return addYears(dirtyDate, -amount)\n}\n\nmodule.exports = subYears\n","'use strict';\n\nvar isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction getMergeFunction(key, options) {\n\tif (!options.customMerge) {\n\t\treturn deepmerge\n\t}\n\tvar customMerge = options.customMerge(key);\n\treturn typeof customMerge === 'function' ? customMerge : deepmerge\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n\treturn Object.getOwnPropertySymbols\n\t\t? Object.getOwnPropertySymbols(target).filter(function(symbol) {\n\t\t\treturn target.propertyIsEnumerable(symbol)\n\t\t})\n\t\t: []\n}\n\nfunction getKeys(target) {\n\treturn Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))\n}\n\nfunction propertyIsOnObject(object, property) {\n\ttry {\n\t\treturn property in object\n\t} catch(_) {\n\t\treturn false\n\t}\n}\n\n// Protects from prototype poisoning and unexpected merging up the prototype chain.\nfunction propertyIsUnsafe(target, key) {\n\treturn propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n\t\t&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n\t\t\t&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tgetKeys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tgetKeys(source).forEach(function(key) {\n\t\tif (propertyIsUnsafe(target, key)) {\n\t\t\treturn\n\t\t}\n\n\t\tif (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n\t\t\tdestination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\t// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n\t// implementations can use it. The caller may not replace it.\n\toptions.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nmodule.exports = deepmerge_1;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport resolvePathname from 'resolve-pathname';\nimport valueEqual from 'value-equal';\nimport warning from 'tiny-warning';\nimport invariant from 'tiny-invariant';\n\nfunction addLeadingSlash(path) {\n return path.charAt(0) === '/' ? path : '/' + path;\n}\nfunction stripLeadingSlash(path) {\n return path.charAt(0) === '/' ? path.substr(1) : path;\n}\nfunction hasBasename(path, prefix) {\n return path.toLowerCase().indexOf(prefix.toLowerCase()) === 0 && '/?#'.indexOf(path.charAt(prefix.length)) !== -1;\n}\nfunction stripBasename(path, prefix) {\n return hasBasename(path, prefix) ? path.substr(prefix.length) : path;\n}\nfunction stripTrailingSlash(path) {\n return path.charAt(path.length - 1) === '/' ? path.slice(0, -1) : path;\n}\nfunction parsePath(path) {\n var pathname = path || '/';\n var search = '';\n var hash = '';\n var hashIndex = pathname.indexOf('#');\n\n if (hashIndex !== -1) {\n hash = pathname.substr(hashIndex);\n pathname = pathname.substr(0, hashIndex);\n }\n\n var searchIndex = pathname.indexOf('?');\n\n if (searchIndex !== -1) {\n search = pathname.substr(searchIndex);\n pathname = pathname.substr(0, searchIndex);\n }\n\n return {\n pathname: pathname,\n search: search === '?' ? '' : search,\n hash: hash === '#' ? '' : hash\n };\n}\nfunction createPath(location) {\n var pathname = location.pathname,\n search = location.search,\n hash = location.hash;\n var path = pathname || '/';\n if (search && search !== '?') path += search.charAt(0) === '?' ? search : \"?\" + search;\n if (hash && hash !== '#') path += hash.charAt(0) === '#' ? hash : \"#\" + hash;\n return path;\n}\n\nfunction createLocation(path, state, key, currentLocation) {\n var location;\n\n if (typeof path === 'string') {\n // Two-arg form: push(path, state)\n location = parsePath(path);\n location.state = state;\n } else {\n // One-arg form: push(location)\n location = _extends({}, path);\n if (location.pathname === undefined) location.pathname = '';\n\n if (location.search) {\n if (location.search.charAt(0) !== '?') location.search = '?' + location.search;\n } else {\n location.search = '';\n }\n\n if (location.hash) {\n if (location.hash.charAt(0) !== '#') location.hash = '#' + location.hash;\n } else {\n location.hash = '';\n }\n\n if (state !== undefined && location.state === undefined) location.state = state;\n }\n\n try {\n location.pathname = decodeURI(location.pathname);\n } catch (e) {\n if (e instanceof URIError) {\n throw new URIError('Pathname \"' + location.pathname + '\" could not be decoded. ' + 'This is likely caused by an invalid percent-encoding.');\n } else {\n throw e;\n }\n }\n\n if (key) location.key = key;\n\n if (currentLocation) {\n // Resolve incomplete/relative pathname relative to current location.\n if (!location.pathname) {\n location.pathname = currentLocation.pathname;\n } else if (location.pathname.charAt(0) !== '/') {\n location.pathname = resolvePathname(location.pathname, currentLocation.pathname);\n }\n } else {\n // When there is no prior location and pathname is empty, set it to /\n if (!location.pathname) {\n location.pathname = '/';\n }\n }\n\n return location;\n}\nfunction locationsAreEqual(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash && a.key === b.key && valueEqual(a.state, b.state);\n}\n\nfunction createTransitionManager() {\n var prompt = null;\n\n function setPrompt(nextPrompt) {\n process.env.NODE_ENV !== \"production\" ? warning(prompt == null, 'A history supports only one prompt at a time') : void 0;\n prompt = nextPrompt;\n return function () {\n if (prompt === nextPrompt) prompt = null;\n };\n }\n\n function confirmTransitionTo(location, action, getUserConfirmation, callback) {\n // TODO: If another transition starts while we're still confirming\n // the previous one, we may end up in a weird state. Figure out the\n // best way to handle this.\n if (prompt != null) {\n var result = typeof prompt === 'function' ? prompt(location, action) : prompt;\n\n if (typeof result === 'string') {\n if (typeof getUserConfirmation === 'function') {\n getUserConfirmation(result, callback);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message') : void 0;\n callback(true);\n }\n } else {\n // Return false from a transition hook to cancel the transition.\n callback(result !== false);\n }\n } else {\n callback(true);\n }\n }\n\n var listeners = [];\n\n function appendListener(fn) {\n var isActive = true;\n\n function listener() {\n if (isActive) fn.apply(void 0, arguments);\n }\n\n listeners.push(listener);\n return function () {\n isActive = false;\n listeners = listeners.filter(function (item) {\n return item !== listener;\n });\n };\n }\n\n function notifyListeners() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n listeners.forEach(function (listener) {\n return listener.apply(void 0, args);\n });\n }\n\n return {\n setPrompt: setPrompt,\n confirmTransitionTo: confirmTransitionTo,\n appendListener: appendListener,\n notifyListeners: notifyListeners\n };\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nfunction getConfirmation(message, callback) {\n callback(window.confirm(message)); // eslint-disable-line no-alert\n}\n/**\n * Returns true if the HTML5 history API is supported. Taken from Modernizr.\n *\n * https://github.com/Modernizr/Modernizr/blob/master/LICENSE\n * https://github.com/Modernizr/Modernizr/blob/master/feature-detects/history.js\n * changed to avoid false negatives for Windows Phones: https://github.com/reactjs/react-router/issues/586\n */\n\nfunction supportsHistory() {\n var ua = window.navigator.userAgent;\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false;\n return window.history && 'pushState' in window.history;\n}\n/**\n * Returns true if browser fires popstate on hash change.\n * IE10 and IE11 do not.\n */\n\nfunction supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n}\n/**\n * Returns false if using go(n) with hash history causes a full page reload.\n */\n\nfunction supportsGoWithoutReloadUsingHash() {\n return window.navigator.userAgent.indexOf('Firefox') === -1;\n}\n/**\n * Returns true if a given popstate event is an extraneous WebKit event.\n * Accounts for the fact that Chrome on iOS fires real popstate events\n * containing undefined state when pressing the back button.\n */\n\nfunction isExtraneousPopstateEvent(event) {\n return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}\n\nvar PopStateEvent = 'popstate';\nvar HashChangeEvent = 'hashchange';\n\nfunction getHistoryState() {\n try {\n return window.history.state || {};\n } catch (e) {\n // IE 11 sometimes throws when accessing window.history.state\n // See https://github.com/ReactTraining/history/pull/289\n return {};\n }\n}\n/**\n * Creates a history object that uses the HTML5 history API including\n * pushState, replaceState, and the popstate event.\n */\n\n\nfunction createBrowserHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Browser history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canUseHistory = supportsHistory();\n var needsHashChangeListener = !supportsPopStateOnHashChange();\n var _props = props,\n _props$forceRefresh = _props.forceRefresh,\n forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n\n function getDOMLocation(historyState) {\n var _ref = historyState || {},\n key = _ref.key,\n state = _ref.state;\n\n var _window$location = window.location,\n pathname = _window$location.pathname,\n search = _window$location.search,\n hash = _window$location.hash;\n var path = pathname + search + hash;\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path, state, key);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function handlePopState(event) {\n // Ignore extraneous popstate events in WebKit.\n if (isExtraneousPopstateEvent(event)) return;\n handlePop(getDOMLocation(event.state));\n }\n\n function handleHashChange() {\n handlePop(getDOMLocation(getHistoryState()));\n }\n\n var forceNextPop = false;\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of keys we've seen in sessionStorage.\n // Instead, we just default to 0 for keys we don't know.\n\n var toIndex = allKeys.indexOf(toLocation.key);\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allKeys.indexOf(fromLocation.key);\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n }\n\n var initialLocation = getDOMLocation(getHistoryState());\n var allKeys = [initialLocation.key]; // Public interface\n\n function createHref(location) {\n return basename + createPath(location);\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.pushState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.href = href;\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n var nextKeys = allKeys.slice(0, prevIndex + 1);\n nextKeys.push(location.key);\n allKeys = nextKeys;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history') : void 0;\n window.location.href = href;\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var href = createHref(location);\n var key = location.key,\n state = location.state;\n\n if (canUseHistory) {\n globalHistory.replaceState({\n key: key,\n state: state\n }, null, href);\n\n if (forceRefresh) {\n window.location.replace(href);\n } else {\n var prevIndex = allKeys.indexOf(history.location.key);\n if (prevIndex !== -1) allKeys[prevIndex] = location.key;\n setState({\n action: action,\n location: location\n });\n }\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history') : void 0;\n window.location.replace(href);\n }\n });\n }\n\n function go(n) {\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(PopStateEvent, handlePopState);\n if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nvar HashChangeEvent$1 = 'hashchange';\nvar HashPathCoders = {\n hashbang: {\n encodePath: function encodePath(path) {\n return path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path);\n },\n decodePath: function decodePath(path) {\n return path.charAt(0) === '!' ? path.substr(1) : path;\n }\n },\n noslash: {\n encodePath: stripLeadingSlash,\n decodePath: addLeadingSlash\n },\n slash: {\n encodePath: addLeadingSlash,\n decodePath: addLeadingSlash\n }\n};\n\nfunction stripHash(url) {\n var hashIndex = url.indexOf('#');\n return hashIndex === -1 ? url : url.slice(0, hashIndex);\n}\n\nfunction getHashPath() {\n // We can't use window.location.hash here because it's not\n // consistent across browsers - Firefox will pre-decode it!\n var href = window.location.href;\n var hashIndex = href.indexOf('#');\n return hashIndex === -1 ? '' : href.substring(hashIndex + 1);\n}\n\nfunction pushHashPath(path) {\n window.location.hash = path;\n}\n\nfunction replaceHashPath(path) {\n window.location.replace(stripHash(window.location.href) + '#' + path);\n}\n\nfunction createHashHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n !canUseDOM ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Hash history needs a DOM') : invariant(false) : void 0;\n var globalHistory = window.history;\n var canGoWithoutReload = supportsGoWithoutReloadUsingHash();\n var _props = props,\n _props$getUserConfirm = _props.getUserConfirmation,\n getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm,\n _props$hashType = _props.hashType,\n hashType = _props$hashType === void 0 ? 'slash' : _props$hashType;\n var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';\n var _HashPathCoders$hashT = HashPathCoders[hashType],\n encodePath = _HashPathCoders$hashT.encodePath,\n decodePath = _HashPathCoders$hashT.decodePath;\n\n function getDOMLocation() {\n var path = decodePath(getHashPath());\n process.env.NODE_ENV !== \"production\" ? warning(!basename || hasBasename(path, basename), 'You are attempting to use a basename on a page whose URL path does not begin ' + 'with the basename. Expected path \"' + path + '\" to begin with \"' + basename + '\".') : void 0;\n if (basename) path = stripBasename(path, basename);\n return createLocation(path);\n }\n\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = globalHistory.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n var forceNextPop = false;\n var ignorePath = null;\n\n function locationsAreEqual$$1(a, b) {\n return a.pathname === b.pathname && a.search === b.search && a.hash === b.hash;\n }\n\n function handleHashChange() {\n var path = getHashPath();\n var encodedPath = encodePath(path);\n\n if (path !== encodedPath) {\n // Ensure we always have a properly-encoded hash.\n replaceHashPath(encodedPath);\n } else {\n var location = getDOMLocation();\n var prevLocation = history.location;\n if (!forceNextPop && locationsAreEqual$$1(prevLocation, location)) return; // A hashchange doesn't always == location change.\n\n if (ignorePath === createPath(location)) return; // Ignore this change; we already setState in push/replace.\n\n ignorePath = null;\n handlePop(location);\n }\n }\n\n function handlePop(location) {\n if (forceNextPop) {\n forceNextPop = false;\n setState();\n } else {\n var action = 'POP';\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location\n });\n } else {\n revertPop(location);\n }\n });\n }\n }\n\n function revertPop(fromLocation) {\n var toLocation = history.location; // TODO: We could probably make this more reliable by\n // keeping a list of paths we've seen in sessionStorage.\n // Instead, we just default to 0 for paths we don't know.\n\n var toIndex = allPaths.lastIndexOf(createPath(toLocation));\n if (toIndex === -1) toIndex = 0;\n var fromIndex = allPaths.lastIndexOf(createPath(fromLocation));\n if (fromIndex === -1) fromIndex = 0;\n var delta = toIndex - fromIndex;\n\n if (delta) {\n forceNextPop = true;\n go(delta);\n }\n } // Ensure the hash is encoded properly before doing anything else.\n\n\n var path = getHashPath();\n var encodedPath = encodePath(path);\n if (path !== encodedPath) replaceHashPath(encodedPath);\n var initialLocation = getDOMLocation();\n var allPaths = [createPath(initialLocation)]; // Public interface\n\n function createHref(location) {\n var baseTag = document.querySelector('base');\n var href = '';\n\n if (baseTag && baseTag.getAttribute('href')) {\n href = stripHash(window.location.href);\n }\n\n return href + '#' + encodePath(basename + createPath(location));\n }\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot push state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a PUSH, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n pushHashPath(encodedPath);\n var prevIndex = allPaths.lastIndexOf(createPath(history.location));\n var nextPaths = allPaths.slice(0, prevIndex + 1);\n nextPaths.push(path);\n allPaths = nextPaths;\n setState({\n action: action,\n location: location\n });\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack') : void 0;\n setState();\n }\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(state === undefined, 'Hash history cannot replace state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, undefined, undefined, history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var path = createPath(location);\n var encodedPath = encodePath(basename + path);\n var hashChanged = getHashPath() !== encodedPath;\n\n if (hashChanged) {\n // We cannot tell if a hashchange was caused by a REPLACE, so we'd\n // rather setState here and ignore the hashchange. The caveat here\n // is that other hash histories in the page will consider it a POP.\n ignorePath = path;\n replaceHashPath(encodedPath);\n }\n\n var prevIndex = allPaths.indexOf(createPath(history.location));\n if (prevIndex !== -1) allPaths[prevIndex] = path;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n process.env.NODE_ENV !== \"production\" ? warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser') : void 0;\n globalHistory.go(n);\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n var listenerCount = 0;\n\n function checkDOMListeners(delta) {\n listenerCount += delta;\n\n if (listenerCount === 1 && delta === 1) {\n window.addEventListener(HashChangeEvent$1, handleHashChange);\n } else if (listenerCount === 0) {\n window.removeEventListener(HashChangeEvent$1, handleHashChange);\n }\n }\n\n var isBlocked = false;\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n var unblock = transitionManager.setPrompt(prompt);\n\n if (!isBlocked) {\n checkDOMListeners(1);\n isBlocked = true;\n }\n\n return function () {\n if (isBlocked) {\n isBlocked = false;\n checkDOMListeners(-1);\n }\n\n return unblock();\n };\n }\n\n function listen(listener) {\n var unlisten = transitionManager.appendListener(listener);\n checkDOMListeners(1);\n return function () {\n checkDOMListeners(-1);\n unlisten();\n };\n }\n\n var history = {\n length: globalHistory.length,\n action: 'POP',\n location: initialLocation,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n block: block,\n listen: listen\n };\n return history;\n}\n\nfunction clamp(n, lowerBound, upperBound) {\n return Math.min(Math.max(n, lowerBound), upperBound);\n}\n/**\n * Creates a history object that stores locations in memory.\n */\n\n\nfunction createMemoryHistory(props) {\n if (props === void 0) {\n props = {};\n }\n\n var _props = props,\n getUserConfirmation = _props.getUserConfirmation,\n _props$initialEntries = _props.initialEntries,\n initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries,\n _props$initialIndex = _props.initialIndex,\n initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex,\n _props$keyLength = _props.keyLength,\n keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength;\n var transitionManager = createTransitionManager();\n\n function setState(nextState) {\n _extends(history, nextState);\n\n history.length = history.entries.length;\n transitionManager.notifyListeners(history.location, history.action);\n }\n\n function createKey() {\n return Math.random().toString(36).substr(2, keyLength);\n }\n\n var index = clamp(initialIndex, 0, initialEntries.length - 1);\n var entries = initialEntries.map(function (entry) {\n return typeof entry === 'string' ? createLocation(entry, undefined, createKey()) : createLocation(entry, undefined, entry.key || createKey());\n }); // Public interface\n\n var createHref = createPath;\n\n function push(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'PUSH';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n var prevIndex = history.index;\n var nextIndex = prevIndex + 1;\n var nextEntries = history.entries.slice(0);\n\n if (nextEntries.length > nextIndex) {\n nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location);\n } else {\n nextEntries.push(location);\n }\n\n setState({\n action: action,\n location: location,\n index: nextIndex,\n entries: nextEntries\n });\n });\n }\n\n function replace(path, state) {\n process.env.NODE_ENV !== \"production\" ? warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' + 'argument is a location-like object that already has state; it is ignored') : void 0;\n var action = 'REPLACE';\n var location = createLocation(path, state, createKey(), history.location);\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (!ok) return;\n history.entries[history.index] = location;\n setState({\n action: action,\n location: location\n });\n });\n }\n\n function go(n) {\n var nextIndex = clamp(history.index + n, 0, history.entries.length - 1);\n var action = 'POP';\n var location = history.entries[nextIndex];\n transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) {\n if (ok) {\n setState({\n action: action,\n location: location,\n index: nextIndex\n });\n } else {\n // Mimic the behavior of DOM histories by\n // causing a render after a cancelled POP.\n setState();\n }\n });\n }\n\n function goBack() {\n go(-1);\n }\n\n function goForward() {\n go(1);\n }\n\n function canGo(n) {\n var nextIndex = history.index + n;\n return nextIndex >= 0 && nextIndex < history.entries.length;\n }\n\n function block(prompt) {\n if (prompt === void 0) {\n prompt = false;\n }\n\n return transitionManager.setPrompt(prompt);\n }\n\n function listen(listener) {\n return transitionManager.appendListener(listener);\n }\n\n var history = {\n length: entries.length,\n action: 'POP',\n location: entries[index],\n index: index,\n entries: entries,\n createHref: createHref,\n push: push,\n replace: replace,\n go: go,\n goBack: goBack,\n goForward: goForward,\n canGo: canGo,\n block: block,\n listen: listen\n };\n return history;\n}\n\nexport { createBrowserHistory, createHashHistory, createMemoryHistory, createLocation, locationsAreEqual, parsePath, createPath };\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { parse, } from '@formatjs/icu-messageformat-parser';\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n var _this = this;\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n var _a = opts || {}, formatters = _a.formatters, parseOpts = __rest(_a, [\"formatters\"]);\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTimeElement, isTagElement, } from '@formatjs/icu-messageformat-parser';\nimport { MissingValueError, InvalidValueError, ErrorCode, FormatError, InvalidValueTypeError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","'use strict'\n\nmodule.exports = alphabetical\n\n// Check if the given character code, or the character code at the first\n// character, is alphabetical.\nfunction alphabetical(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 && code <= 122) /* a-z */ ||\n (code >= 65 && code <= 90) /* A-Z */\n )\n}\n","'use strict'\n\nvar alphabetical = require('is-alphabetical')\nvar decimal = require('is-decimal')\n\nmodule.exports = alphanumerical\n\n// Check if the given character code, or the character code at the first\n// character, is alphanumerical.\nfunction alphanumerical(character) {\n return alphabetical(character) || decimal(character)\n}\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n","'use strict'\n\nmodule.exports = decimal\n\n// Check if the given character code, or the character code at the first\n// character, is decimal.\nfunction decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}\n","'use strict'\n\nmodule.exports = hexadecimal\n\n// Check if the given character code, or the character code at the first\n// character, is hexadecimal.\nfunction hexadecimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return (\n (code >= 97 /* a */ && code <= 102) /* z */ ||\n (code >= 65 /* A */ && code <= 70) /* Z */ ||\n (code >= 48 /* A */ && code <= 57) /* Z */\n )\n}\n","'use strict';\nvar toString = Object.prototype.toString;\n\nmodule.exports = function (x) {\n\tvar prototype;\n\treturn toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));\n};\n","'use strict'\n\nmodule.exports = whitespace\n\nvar fromCode = String.fromCharCode\nvar re = /\\s/\n\n// Check if the given character code, or the character code at the first\n// character, is a whitespace character.\nfunction whitespace(character) {\n return re.test(\n typeof character === 'number' ? fromCode(character) : character.charAt(0)\n )\n}\n","'use strict'\n\nmodule.exports = wordCharacter\n\nvar fromCode = String.fromCharCode\nvar re = /\\w/\n\n// Check if the given character code, or the character code at the first\n// character, is a word character.\nfunction wordCharacter(character) {\n return re.test(\n typeof character === 'number' ? fromCode(character) : character.charAt(0)\n )\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\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\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\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/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\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 objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\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 = value.replace(reTrim, '');\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 = debounce;\n","var isArray = require('./isArray');\n\n/**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\nfunction castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n}\n\nmodule.exports = castArray;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(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 `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\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 eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\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","/**\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","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","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","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 baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\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 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 SetCache = require('./_SetCache'),\n arrayIncludes = require('./_arrayIncludes'),\n arrayIncludesWith = require('./_arrayIncludesWith'),\n cacheHas = require('./_cacheHas'),\n createSet = require('./_createSet'),\n setToArray = require('./_setToArray');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\nfunction baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n}\n\nmodule.exports = baseUniq;\n","var baseIndexOf = require('./_baseIndexOf');\n\n/**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n}\n\nmodule.exports = arrayIncludes;\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {\n // No operation performed.\n}\n\nmodule.exports = noop;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array 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 `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\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","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\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 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","/** 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 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","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\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","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var isArray = require('./isArray');\n\n/**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\nfunction castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n}\n\nmodule.exports = castArray;\n","var isObject = require('./isObject'),\n now = require('./now'),\n toNumber = require('./toNumber');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nmodule.exports = debounce;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\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 baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\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","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\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","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\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 baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\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 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","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\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 as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var 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 /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var 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 match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee 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 all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(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 false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\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 */\n function 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\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\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 */\n function 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\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 */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\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 * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\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 */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\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 */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\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 */\n function 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\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\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 */\n function 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\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\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 */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\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 */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\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 */\n function 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\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\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 */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\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 */\n function 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\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\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 */\n function 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\n /**\n * A specialized version of `_.lastIndexOf` 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 */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\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 */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\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 */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\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 */\n function 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 /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function 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 /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\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 */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\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 */\n function 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\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 */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\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 */\n function 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\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(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 /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\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 */\n function 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\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 */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\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 */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\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 */\n function 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\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(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 /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\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 */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\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 */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\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 */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\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 */\n function 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\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\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 */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\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 */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\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 */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\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 */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\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 */\n function stackHas(key) {\n return this.__data__.has(key);\n }\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 */\n function 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\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\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 */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\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 */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\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 */\n function 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\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\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 */\n function 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\n /**\n * The base implementation of `_.forEach` 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|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` 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|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` 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 {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\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 */\n function 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\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\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 */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` 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 */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\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 */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` 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 */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\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 */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\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 shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\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 */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\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 */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\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 */\n function 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\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 */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\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 */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\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 */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\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 */\n function 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\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 */\n function 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\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 */\n function baseLt(value, other) {\n return value < other;\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\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 */\n function 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(getIteratee()));\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\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 */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\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 */\n function 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\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 */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\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 */\n function 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\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\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 */\n var 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\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\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 */\n function 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\n /**\n * The base implementation of `_.some` 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 {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\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 */\n function 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\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\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 */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\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 values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\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 */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\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 */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\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 */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\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 */\n function 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\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 */\n function 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\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\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 */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\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 */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function 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\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\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 */\n function 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\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name 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 * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` 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 */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\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 */\n function 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\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 */\n function 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\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue 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 {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\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 * @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 */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\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 */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\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 */\n function 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\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\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 */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array 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 `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\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 */\n function 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\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 */\n function 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\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\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 */\n function 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\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\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 */\n function 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\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\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 */\n function 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\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\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 */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\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 */\n function 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\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 */\n function 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\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\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 */\n function 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\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 */\n function 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\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 */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\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 */\n function 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\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 */\n function 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\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 */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\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 */\n function 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\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 */\n function 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\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 */\n function 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\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 */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\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 */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\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 */\n function 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\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\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 */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\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 */\n var 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\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\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 */\n function 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\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 */\n function 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\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\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 */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\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 */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\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]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\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 */\n function 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`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\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 * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\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 or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` 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 an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\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 buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\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 */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\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 */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` 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 weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` 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 weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\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 * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\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 or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\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 */\n function 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\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 */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\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 */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '