} userOptions\n */\n function configure(userOptions) {\n if (userOptions.useBR) {\n deprecated(\"10.3.0\", \"'useBR' will be removed entirely in v11.0\");\n deprecated(\"10.3.0\", \"Please see https://github.com/highlightjs/highlight.js/issues/2559\");\n }\n options = inherit$1(options, userOptions);\n }\n\n /**\n * Highlights to all blocks on a page\n *\n * @type {Function & {called?: boolean}}\n */\n // TODO: remove v12, deprecated\n const initHighlighting = () => {\n if (initHighlighting.called) return;\n initHighlighting.called = true;\n\n deprecated(\"10.6.0\", \"initHighlighting() is deprecated. Use highlightAll() instead.\");\n\n const blocks = document.querySelectorAll('pre code');\n blocks.forEach(highlightElement);\n };\n\n // Higlights all when DOMContentLoaded fires\n // TODO: remove v12, deprecated\n function initHighlightingOnLoad() {\n deprecated(\"10.6.0\", \"initHighlightingOnLoad() is deprecated. Use highlightAll() instead.\");\n wantsHighlight = true;\n }\n\n let wantsHighlight = false;\n\n /**\n * auto-highlights all pre>code elements on the page\n */\n function highlightAll() {\n // if we are called too early in the loading process\n if (document.readyState === \"loading\") {\n wantsHighlight = true;\n return;\n }\n\n const blocks = document.querySelectorAll('pre code');\n blocks.forEach(highlightElement);\n }\n\n function boot() {\n // if a highlight was requested before DOM was loaded, do now\n if (wantsHighlight) highlightAll();\n }\n\n // make sure we are in the browser environment\n if (typeof window !== 'undefined' && window.addEventListener) {\n window.addEventListener('DOMContentLoaded', boot, false);\n }\n\n /**\n * Register a language grammar module\n *\n * @param {string} languageName\n * @param {LanguageFn} languageDefinition\n */\n function registerLanguage(languageName, languageDefinition) {\n let lang = null;\n try {\n lang = languageDefinition(hljs);\n } catch (error$1) {\n error(\"Language definition for '{}' could not be registered.\".replace(\"{}\", languageName));\n // hard or soft error\n if (!SAFE_MODE) { throw error$1; } else { error(error$1); }\n // languages that have serious errors are replaced with essentially a\n // \"plaintext\" stand-in so that the code blocks will still get normal\n // css classes applied to them - and one bad language won't break the\n // entire highlighter\n lang = PLAINTEXT_LANGUAGE;\n }\n // give it a temporary name if it doesn't have one in the meta-data\n if (!lang.name) lang.name = languageName;\n languages[languageName] = lang;\n lang.rawDefinition = languageDefinition.bind(null, hljs);\n\n if (lang.aliases) {\n registerAliases(lang.aliases, { languageName });\n }\n }\n\n /**\n * Remove a language grammar module\n *\n * @param {string} languageName\n */\n function unregisterLanguage(languageName) {\n delete languages[languageName];\n for (const alias of Object.keys(aliases)) {\n if (aliases[alias] === languageName) {\n delete aliases[alias];\n }\n }\n }\n\n /**\n * @returns {string[]} List of language internal names\n */\n function listLanguages() {\n return Object.keys(languages);\n }\n\n /**\n intended usage: When one language truly requires another\n\n Unlike `getLanguage`, this will throw when the requested language\n is not available.\n\n @param {string} name - name of the language to fetch/require\n @returns {Language | never}\n */\n function requireLanguage(name) {\n deprecated(\"10.4.0\", \"requireLanguage will be removed entirely in v11.\");\n deprecated(\"10.4.0\", \"Please see https://github.com/highlightjs/highlight.js/pull/2844\");\n\n const lang = getLanguage(name);\n if (lang) { return lang; }\n\n const err = new Error('The \\'{}\\' language is required, but not loaded.'.replace('{}', name));\n throw err;\n }\n\n /**\n * @param {string} name - name of the language to retrieve\n * @returns {Language | undefined}\n */\n function getLanguage(name) {\n name = (name || '').toLowerCase();\n return languages[name] || languages[aliases[name]];\n }\n\n /**\n *\n * @param {string|string[]} aliasList - single alias or list of aliases\n * @param {{languageName: string}} opts\n */\n function registerAliases(aliasList, { languageName }) {\n if (typeof aliasList === 'string') {\n aliasList = [aliasList];\n }\n aliasList.forEach(alias => { aliases[alias.toLowerCase()] = languageName; });\n }\n\n /**\n * Determines if a given language has auto-detection enabled\n * @param {string} name - name of the language\n */\n function autoDetection(name) {\n const lang = getLanguage(name);\n return lang && !lang.disableAutodetect;\n }\n\n /**\n * Upgrades the old highlightBlock plugins to the new\n * highlightElement API\n * @param {HLJSPlugin} plugin\n */\n function upgradePluginAPI(plugin) {\n // TODO: remove with v12\n if (plugin[\"before:highlightBlock\"] && !plugin[\"before:highlightElement\"]) {\n plugin[\"before:highlightElement\"] = (data) => {\n plugin[\"before:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n if (plugin[\"after:highlightBlock\"] && !plugin[\"after:highlightElement\"]) {\n plugin[\"after:highlightElement\"] = (data) => {\n plugin[\"after:highlightBlock\"](\n Object.assign({ block: data.el }, data)\n );\n };\n }\n }\n\n /**\n * @param {HLJSPlugin} plugin\n */\n function addPlugin(plugin) {\n upgradePluginAPI(plugin);\n plugins.push(plugin);\n }\n\n /**\n *\n * @param {PluginEvent} event\n * @param {any} args\n */\n function fire(event, args) {\n const cb = event;\n plugins.forEach(function(plugin) {\n if (plugin[cb]) {\n plugin[cb](args);\n }\n });\n }\n\n /**\n Note: fixMarkup is deprecated and will be removed entirely in v11\n\n @param {string} arg\n @returns {string}\n */\n function deprecateFixMarkup(arg) {\n deprecated(\"10.2.0\", \"fixMarkup will be removed entirely in v11.0\");\n deprecated(\"10.2.0\", \"Please see https://github.com/highlightjs/highlight.js/issues/2534\");\n\n return fixMarkup(arg);\n }\n\n /**\n *\n * @param {HighlightedHTMLElement} el\n */\n function deprecateHighlightBlock(el) {\n deprecated(\"10.7.0\", \"highlightBlock will be removed entirely in v12.0\");\n deprecated(\"10.7.0\", \"Please use highlightElement now.\");\n\n return highlightElement(el);\n }\n\n /* Interface definition */\n Object.assign(hljs, {\n highlight,\n highlightAuto,\n highlightAll,\n fixMarkup: deprecateFixMarkup,\n highlightElement,\n // TODO: Remove with v12 API\n highlightBlock: deprecateHighlightBlock,\n configure,\n initHighlighting,\n initHighlightingOnLoad,\n registerLanguage,\n unregisterLanguage,\n listLanguages,\n getLanguage,\n registerAliases,\n requireLanguage,\n autoDetection,\n inherit: inherit$1,\n addPlugin,\n // plugins for frameworks\n vuePlugin: BuildVuePlugin(hljs).VuePlugin\n });\n\n hljs.debugMode = function() { SAFE_MODE = false; };\n hljs.safeMode = function() { SAFE_MODE = true; };\n hljs.versionString = version;\n\n for (const key in MODES) {\n // @ts-ignore\n if (typeof MODES[key] === \"object\") {\n // @ts-ignore\n deepFreezeEs6(MODES[key]);\n }\n }\n\n // merge all the modes/regexs into our main object\n Object.assign(hljs, MODES);\n\n // built-in plugins, likely to be moved out of core in the future\n hljs.addPlugin(brPlugin); // slated to be removed in v11\n hljs.addPlugin(mergeHTMLPlugin);\n hljs.addPlugin(tabReplacePlugin);\n return hljs;\n};\n\n// export an \"instance\" of the highlighter\nvar highlight = HLJS({});\n\nmodule.exports = highlight;\n","export { default as ParseError } from '../es6/ParseError'\r\n// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.\r\nexport { default as parsePhoneNumberWithError, default as parsePhoneNumber } from '../es6/parsePhoneNumber'\r\n\r\n// `parsePhoneNumberFromString()` named export is now considered legacy:\r\n// it has been promoted to a default export due to being too verbose.\r\nexport { default as default, default as parsePhoneNumberFromString } from '../es6/parsePhoneNumberFromString'\r\n\r\nexport { default as isValidPhoneNumber } from '../es6/isValidPhoneNumber'\r\nexport { default as isPossiblePhoneNumber } from '../es6/isPossiblePhoneNumber'\r\n\r\n// Deprecated.\r\nexport { default as findNumbers } from '../es6/findNumbers'\r\n// Deprecated.\r\nexport { default as searchNumbers } from '../es6/searchNumbers'\r\n\r\nexport { default as findPhoneNumbersInText } from '../es6/findPhoneNumbersInText'\r\nexport { default as searchPhoneNumbersInText } from '../es6/searchPhoneNumbersInText'\r\nexport { default as PhoneNumberMatcher } from '../es6/PhoneNumberMatcher'\r\n\r\nexport { default as AsYouType } from '../es6/AsYouType'\r\nexport { DIGIT_PLACEHOLDER } from '../es6/AsYouTypeFormatter'\r\n\r\nexport { default as getCountries } from '../es6/getCountries'\r\nexport { default as Metadata, isSupportedCountry, getCountryCallingCode, getExtPrefix } from '../es6/metadata'\r\n\r\nexport { default as getExampleNumber } from '../es6/getExampleNumber'\r\n\r\nexport { default as formatIncompletePhoneNumber } from '../es6/formatIncompletePhoneNumber'\r\nexport { default as parseIncompletePhoneNumber, parsePhoneNumberCharacter } from '../es6/parseIncompletePhoneNumber'\r\nexport { default as parseDigits } from '../es6/helpers/parseDigits'\r\n\r\nexport { parseRFC3966, formatRFC3966 } from '../es6/helpers/RFC3966'\r\n","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport Metadata from './metadata';\nimport PhoneNumber from './PhoneNumber';\nimport AsYouTypeState from './AsYouTypeState';\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter';\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar AsYouType =\n/*#__PURE__*/\nfunction () {\n /**\r\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n * @param {Object} metadata\r\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n\n this.metadata = new Metadata(metadata);\n\n var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),\n _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),\n defaultCountry = _this$getCountryAndCa2[0],\n defaultCallingCode = _this$getCountryAndCa2[1];\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n\n _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode; // Turns out `null` also has type \"object\". Weird.\n\n if (optionsOrDefaultCountry) {\n if (_typeof(optionsOrDefaultCountry) === 'object') {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\n\n if (defaultCallingCode) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n defaultCountry = '001';\n }\n }\n }\n\n return [defaultCountry, defaultCallingCode];\n }\n /**\r\n * Inputs \"next\" phone number characters.\r\n * @param {string} text\r\n * @return {string} Formatted phone number characters that have been input so far.\r\n */\n\n }, {\n key: \"input\",\n value: function input(text) {\n var _this$parser$input = this.parser.input(text, this.state),\n digits = _this$parser$input.digits,\n justLeadingPlus = _this$parser$input.justLeadingPlus;\n\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.\n\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n\n var formattedNationalNumber;\n\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\n\n if (formattedNationalNumber === undefined) {\n // See if another national (significant) number could be re-extracted.\n if (this.parser.reExtractNationalSignificantNumber(this.state)) {\n this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number.\n\n var nationalDigits = this.state.getNationalDigits();\n\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n\n this.state = new AsYouTypeState({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included the `.country` property of an `AsYouType` instance.\n // Since that property (along with the others) have been moved to\n // `this.state`, `this.country` property is emulated for compatibility\n // with the old versions.\n _this.country = country;\n },\n onCallingCodeChange: function onCallingCodeChange(country, callingCode) {\n _this.metadata.selectNumberingPlan(country, callingCode);\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n\n _this.parser.reset(_this.metadata.numberingPlan);\n }\n });\n this.formatter = new AsYouTypeFormatter({\n state: this.state,\n metadata: this.metadata\n });\n this.parser = new AsYouTypeParser({\n defaultCountry: this.defaultCountry,\n defaultCallingCode: this.defaultCallingCode,\n metadata: this.metadata,\n state: this.state,\n onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {\n _this.determineTheCountryIfNeeded();\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset(this.defaultCountry, this.defaultCallingCode);\n this.formattedOutput = '';\n return this;\n }\n /**\r\n * Returns `true` if the phone number is being input in international format.\r\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n /**\r\n * Returns the \"country calling code\" part of the phone number.\r\n * Returns `undefined` if the number is not being input in international format.\r\n * Returns \"country calling code\" for \"non-geographic\" phone numbering plans too.\r\n * @return {string} [callingCode]\r\n */\n\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n return this.state.callingCode;\n } // A legacy alias.\n\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * Returns `undefined` if no phone number has been input yet.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var _this$state = this.state,\n digits = _this$state.digits,\n country = _this$state.country; // If no digits have been input yet,\n // then `this.country` is the `defaultCountry`.\n // Won't return the `defaultCountry` in such case.\n\n if (!digits) {\n return;\n }\n\n var countryCode = country;\n /* istanbul ignore if */\n\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (countryCode === '001') {\n countryCode = undefined;\n }\n }\n\n return countryCode;\n }\n }, {\n key: \"determineTheCountryIfNeeded\",\n value: function determineTheCountryIfNeeded() {\n // Suppose a user enters a phone number in international format,\n // and there're several countries corresponding to that country calling code,\n // and a country has been derived from the number, and then\n // a user enters one more digit and the number is no longer\n // valid for the derived country, so the country should be re-derived\n // on every new digit in those cases.\n //\n // If the phone number is being input in national format,\n // then it could be a case when `defaultCountry` wasn't specified\n // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n // and that \"calling code\" could correspond to a \"non-geographic entity\",\n // or there could be several countries corresponding to that country calling code.\n // In those cases, `this.country` is `undefined` and should be derived\n // from the number. Again, if country calling code is ambiguous, then\n // `this.country` should be re-derived with each new digit.\n //\n if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n this.determineTheCountry();\n }\n } // Prepends `+CountryCode ` in case of an international phone number\n\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n\n if (this.isInternational()) {\n var prefix = function prefix(text) {\n return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {\n spacing: text ? true : false\n }) + text;\n };\n\n var callingCode = this.state.callingCode;\n\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state2 = this.state,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber,\n complexPrefixBeforeNationalSignificantNumber = _this$state2.complexPrefixBeforeNationalSignificantNumber,\n nationalPrefix = _this$state2.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;\n\n if (prefix) {\n number = prefix + number;\n }\n\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;\n return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n\n if (number) {\n return number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER);\n }\n }\n }, {\n key: \"isCountryCallingCodeAmbiguous\",\n value: function isCountryCallingCodeAmbiguous() {\n var callingCode = this.state.callingCode;\n var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);\n return countryCodes && countryCodes.length > 1;\n } // Determines the country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, this.state.nationalSignificantNumber, this.metadata));\n }\n /**\r\n * Returns an instance of `PhoneNumber` class.\r\n * Will return `undefined` if no national (significant) number\r\n * digits have been entered so far, or if no `defaultCountry` has been\r\n * set and the user enters a phone number not in international format.\r\n */\n\n }, {\n key: \"getNumber\",\n value: function getNumber() {\n var _this$state3 = this.state,\n nationalSignificantNumber = _this$state3.nationalSignificantNumber,\n carrierCode = _this$state3.carrierCode;\n\n if (this.isInternational()) {\n if (!this.state.callingCode) {\n return;\n }\n } else {\n if (!this.state.country && !this.defaultCallingCode) {\n return;\n }\n }\n\n if (!nationalSignificantNumber) {\n return;\n }\n\n var countryCode = this.getCountry();\n var callingCode = this.getCountryCallingCode() || this.defaultCallingCode;\n var phoneNumber = new PhoneNumber(countryCode || callingCode, nationalSignificantNumber, this.metadata.metadata);\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n } // Phone number extensions are not supported by \"As You Type\" formatter.\n\n\n return phoneNumber;\n }\n /**\r\n * Returns `true` if the phone number is \"possible\".\r\n * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isPossible();\n }\n /**\r\n * Returns `true` if the phone number is \"valid\".\r\n * Is just a shortcut for `PhoneNumber.isValid()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isValid();\n }\n /**\r\n * @deprecated\r\n * This method is used in `react-phone-number-input/source/input-control.js`\r\n * in versions before `3.0.16`.\r\n */\n\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n /**\r\n * Returns the phone number characters entered by the user.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n /**\r\n * Returns the template for the formatted phone number.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n\n return AsYouType;\n}();\n\nexport { AsYouType as default };\n//# sourceMappingURL=AsYouType.js.map","import checkNumberLength from './helpers/checkNumberLength';\nimport parseDigits from './helpers/parseDigits';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\nexport function canFormatCompleteNumber(nationalSignificantNumber, metadata) {\n return checkNumberLength(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';\n}\n\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode; // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n\n if (formattedNumber) {\n return formattedNumber;\n }\n } // Format the number without using `national_prefix_formatting_rule`.\n\n\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\n\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.complexPrefixBeforeNationalSignificantNumber) {\n formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;\n }\n }\n\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n} // Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\n\n\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete';\nimport parseDigits from './helpers/parseDigits';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat';\nimport { VALID_PUNCTUATION } from './constants';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle'; // Used in phone number format template creation.\n// Could be any digit, I guess.\n\nvar DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`\n\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\n\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\n\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\n\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\n\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\n}; // Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\n\n\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n}; // A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\n\n\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)+' + '$'); // This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\n\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar AsYouTypeFormatter =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeFormatter(_ref) {\n var _this = this;\n\n var state = _ref.state,\n metadata = _ref.metadata;\n\n _classCallCheck(this, AsYouTypeFormatter);\n\n _defineProperty(this, \"getSeparatorAfterNationalPrefix\", function (format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (_this.isNANP) {\n return ' ';\n } // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n\n\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n } // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n\n\n return '';\n });\n\n _defineProperty(this, \"shouldTryNationalPrefixFormattingRule\", function (format, _ref2) {\n var international = _ref2.international,\n nationalPrefix = _ref2.nationalPrefix;\n\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n });\n\n this.metadata = metadata;\n this.resetFormat();\n }\n\n _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this2 = this;\n\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {\n for (var _iterator = this.matchingFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref3;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref3 = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref3 = _i.value;\n }\n\n var format = _ref3;\n var formattedCompleteNumber = formatCompleteNumber(state, format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this2.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: this.getSeparatorAfterNationalPrefix\n });\n\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n } // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n\n\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n } // Formats the next phone number digits.\n\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.\n\n var newlyChosenFormat = this.chooseFormat(state);\n\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref4) {\n var _this3 = this;\n\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n nationalPrefix = _ref4.nationalPrefix,\n international = _ref4.international;\n var leadingDigits = nationalSignificantNumber; // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this3.formatSuits(format, international, nationalPrefix) && _this3.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n }); // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n // and yielding another format for 4 `` (Australia in this case).\n\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n } // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n\n\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n\n if (leadingDigitsPatternsCount === 0) {\n return true;\n } // Start excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n\n\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n return true;\n } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are available\n // then format matching starts narrowing down the list of possible formats\n // (only previously matched formats are considered for next digits).\n\n\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Brackets are required for `^` to be applied to\n // all or-ed (`|`) parts, not just the first one.\n\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this4 = this;\n\n var _loop2 = function _loop2() {\n if (_isArray2) {\n if (_i2 >= _iterator2.length) return \"break\";\n _ref5 = _iterator2[_i2++];\n } else {\n _i2 = _iterator2.next();\n if (_i2.done) return \"break\";\n _ref5 = _i2.value;\n }\n\n var format = _ref5;\n\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this4.chosenFormat === format) {\n return \"break\";\n } // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n\n /* istanbul ignore if */\n\n\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this4.getFormatFormat(format, state.international))) {\n return \"continue\";\n }\n\n if (!_this4.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this4.matchingFormats = _this4.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return \"continue\";\n }\n\n _this4.chosenFormat = format;\n return \"break\";\n };\n\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n _loop: for (var _iterator2 = this.matchingFormats.slice(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref5;\n\n var _ret = _loop2();\n\n switch (_ret) {\n case \"break\":\n break _loop;\n\n case \"continue\":\n continue;\n }\n }\n\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n } // Get formatting template for this phone number format\n\n\n var template = this.getTemplateForFormat(format, state); // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref6, options) {\n var IDDPrefix = _ref6.IDDPrefix,\n missingPlus = _ref6.missingPlus;\n\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n\n if (missingPlus) {\n return '';\n }\n\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n } // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n\n\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n\n return cutAndStripNonPairedParens(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref7) {\n var nationalSignificantNumber = _ref7.nationalSignificantNumber,\n international = _ref7.international,\n nationalPrefix = _ref7.nationalPrefix,\n complexPrefixBeforeNationalSignificantNumber = _ref7.complexPrefixBeforeNationalSignificantNumber;\n var pattern = format.pattern();\n /* istanbul ignore else */\n\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d') // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n } // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n\n\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (nationalSignificantNumber.length > digits.length) {\n return;\n } // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n\n /* istanbul ignore else */\n\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n } // Generate formatting template for this phone number format.\n\n\n var template = digits // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n\n if (!nationalPrefixIncludedInTemplate) {\n if (complexPrefixBeforeNationalSignificantNumber) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.\n\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }]);\n\n return AsYouTypeFormatter;\n}();\n\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map","// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\n\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\n\nexport function countOccurences(symbol, string) {\n var count = 0; // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n} // Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\n\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n\n var result = '';\n\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n\n times >>= 1;\n string += string;\n }\n\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n\n i++;\n }\n\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n\n for (var _i2 = 0, _dangling_braces = dangling_braces; _i2 < _dangling_braces.length; _i2++) {\n var index = _dangling_braces[_i2];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = digits.split(''), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n var _ref2;\n\n if (_isArray2) {\n if (_i3 >= _iterator2.length) break;\n _ref2 = _iterator2[_i3++];\n } else {\n _i3 = _iterator2.next();\n if (_i3.done) break;\n _ref2 = _i3.value;\n }\n\n var digit = _ref2;\n\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport _extractCountryCallingCode from './helpers/extractCountryCallingCode';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport extractNationalNumberFromPossiblyIncompleteNumber from './helpers/extractNationalNumberFromPossiblyIncompleteNumber';\nimport stripIddPrefix from './helpers/stripIddPrefix';\nimport parseDigits from './helpers/parseDigits';\nimport { VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from './constants';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');\nvar VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';\nvar AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\n\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\n\nvar AsYouTypeParser =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n\n _classCallCheck(this, AsYouTypeParser);\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n\n _createClass(AsYouTypeParser, [{\n key: \"input\",\n value: function input(text, state) {\n var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),\n formattedDigits = _extractFormattedDigi2[0],\n hasPlus = _extractFormattedDigi2[1];\n\n var digits = parseDigits(formattedDigits); // Checks for a special case: just a leading `+` has been entered.\n\n var justLeadingPlus;\n\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber();\n\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n\n if (digits) {\n this.inputDigits(digits, state);\n }\n\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n /**\r\n * Inputs \"next\" phone number digits.\r\n * @param {string} digits\r\n * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means \"don't format the national phone number at this stage\".\r\n */\n\n }, {\n key: \"inputDigits\",\n value: function inputDigits(nextDigits, state) {\n var digits = state.digits;\n var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits.\n\n state.appendDigits(nextDigits); // Attempt to extract IDD prefix:\n // Some users input their phone number in international format,\n // but in an \"out-of-country\" dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers as soon as there're at least 3 digits.\n // Google's library attempts to extract IDD prefix at 3 digits,\n // so this library just copies that behavior.\n // I guess that's because the most commot IDD prefixes are\n // `00` (Europe) and `011` (US).\n // There exist really long IDD prefixes too:\n // for example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n // An IDD prefix is extracted here, and then every time when\n // there's a new digit and the number couldn't be formatted.\n\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\n } // If a phone number is being input in international format,\n // then it's not valid for it to have a national prefix.\n // Still, some people incorrectly input such numbers with a national prefix.\n // In such cases, only attempt to strip a national prefix if the number becomes too long.\n // (but that is done later, not here)\n\n\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);\n }\n }\n }\n }, {\n key: \"isWaitingForCountryCallingCode\",\n value: function isWaitingForCountryCallingCode(_ref2) {\n var international = _ref2.international,\n callingCode = _ref2.callingCode;\n return international && !callingCode;\n } // Extracts a country calling code from a number\n // being entered in internatonal format.\n\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = _extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n state.setCallingCode(countryCallingCode);\n state.update({\n nationalSignificantNumber: number\n });\n return true;\n }\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan) {\n if (numberingPlan) {\n this.hasSelectedNumberingPlan = true;\n\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n /**\r\n * Extracts a national (significant) number from user input.\r\n * Google's library is different in that it only applies `national_prefix_for_parsing`\r\n * and doesn't apply `national_prefix_transform_rule` after that.\r\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\r\n * @return {boolean} [extracted]\r\n */\n\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (nationalNumber === nationalDigits) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n /**\r\n * In Google's code this function is called \"attempt to extract longer NDD\".\r\n * \"Some national prefixes are a substring of others\", they say.\r\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\r\n */\n\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n\n var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously,\n // then it's always extracted as additional digits are added.\n // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`\n // doesn't do anything different from what it currently does.\n // So, just in case, here's this check, though it doesn't occur.\n\n /* istanbul ignore if */\n\n\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n }, {\n key: \"onExtractedNationalNumber\",\n value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {\n var complexPrefixBeforeNationalSignificantNumber;\n var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.\n\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the\n // last substring of the `digits`, then it means that it hasn't been altered:\n // no digits have been removed from the national (significant) number\n // while applying `national_prefix_transform_rule`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n\n if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then such prefix is stored in\n // `this.complexPrefixBeforeNationalSignificantNumber` property and will be\n // prepended \"as is\" to the national (significant) number to produce\n // a formatted result.\n\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,\n // because `onExtractedNationalNumber()` isn't called\n // when a national (significant) number hasn't been actually \"extracted\":\n // when a national (significant) number is equal to the national part of `digits`,\n // then `onExtractedNationalNumber()` doesn't get called.\n\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;\n }\n }\n\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,\n complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber\n }); // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n\n this.hasExtractedNationalSignificantNumber = true;\n this.onNationalSignificantNumberChange();\n }\n }, {\n key: \"reExtractNationalSignificantNumber\",\n value: function reExtractNationalSignificantNumber(state) {\n // Attempt to extract a national prefix.\n //\n // Some people incorrectly input national prefix\n // in an international phone number.\n // For example, some people write British phone numbers as `+44(0)...`.\n //\n // Also, in some rare cases, it is valid for a national prefix\n // to be a part of an international phone number.\n // For example, mobile phone numbers in Mexico are supposed to be\n // dialled internationally using a `1` national prefix,\n // so the national prefix will be part of an international number.\n //\n // Quote from:\n // https://www.mexperience.com/dialing-cell-phones-in-mexico/\n //\n // \"Dialing a Mexican cell phone from abroad\n // When you are calling a cell phone number in Mexico from outside Mexico,\n // it’s necessary to dial an additional “1” after Mexico’s country code\n // (which is “52”) and before the area code.\n // You also ignore the 045, and simply dial the area code and the\n // cell phone’s number.\n //\n // If you don’t add the “1”, you’ll receive a recorded announcement\n // asking you to redial using it.\n //\n // For example, if you are calling from the USA to a cell phone\n // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.\n // (Note that this is different to calling a land line in Mexico City\n // from abroad, where the number dialed would be +52 – 55 – 1234 5678)\".\n //\n // Google's demo output:\n // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX\n //\n if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, state.update)) {\n return true;\n } // If no format matches the phone number, then it could be\n // \"a really long IDD\" (quote from a comment in Google's library).\n // An IDD prefix is first extracted when the user has entered at least 3 digits,\n // and then here — every time when there's a new digit and the number\n // couldn't be formatted.\n // For example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n //\n // Could also check `!hasReceivedThreeLeadingDigits` here\n // to filter out the case when this check duplicates the one\n // already performed when there're 3 leading digits,\n // but it's not a big deal, and in most cases there\n // will be a suitable `format` when there're 3 leading digits.\n //\n\n\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n } // Google's AsYouType formatter supports sort of an \"autocorrection\" feature\n // when it \"autocorrects\" numbers that have been input for a country\n // with that country's calling code.\n // Such \"autocorrection\" feature looks weird, but different people have been requesting it:\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n // https://github.com/catamphetamine/libphonenumber-js/issues/375\n // https://github.com/catamphetamine/libphonenumber-js/issues/316\n\n\n if (this.fixMissingPlus(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n }\n }, {\n key: \"extractIddPrefix\",\n value: function extractIddPrefix(state) {\n // An IDD prefix can't be present in a number written with a `+`.\n // Also, don't re-extract an IDD prefix if has already been extracted.\n var international = state.international,\n IDDPrefix = state.IDDPrefix,\n digits = state.digits,\n nationalSignificantNumber = state.nationalSignificantNumber;\n\n if (international || IDDPrefix) {\n return;\n } // Some users input their phone number in \"out-of-country\"\n // dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers.\n\n\n var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n\n if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {\n // If an IDD prefix was stripped then convert the IDD-prefixed number\n // to international number for subsequent parsing.\n state.update({\n IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)\n });\n this.startInternationalNumber(state);\n return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode,\n number = _extractCountryCallin2.number;\n\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state);\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state) {\n state.startInternationalNumber(); // If a national (significant) number has been extracted before, reset it.\n\n if (state.nationalSignificantNumber) {\n state.resetNationalSignificantNumber();\n this.onNationalSignificantNumberChange();\n this.hasExtractedNationalSignificantNumber = undefined;\n }\n }\n }, {\n key: \"extractCallingCodeAndNationalSignificantNumber\",\n value: function extractCallingCodeAndNationalSignificantNumber(state) {\n if (this.extractCountryCallingCode(state)) {\n // `this.extractCallingCode()` is currently called when the number\n // couldn't be formatted during the standard procedure.\n // Normally, the national prefix would be re-extracted\n // for an international number if such number couldn't be formatted,\n // but since it's already not able to be formatted,\n // there won't be yet another retry, so also extract national prefix here.\n this.extractNationalSignificantNumber(state.getNationalDigits(), state.update);\n }\n }\n }]);\n\n return AsYouTypeParser;\n}();\n/**\r\n * Extracts formatted phone number from text (if there's any).\r\n * @param {string} text\r\n * @return {string} [formattedPhoneNumber]\r\n */\n\n\nexport { AsYouTypeParser as default };\n\nfunction extractFormattedPhoneNumber(text) {\n // Attempt to extract a possible number from the string passed in.\n var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);\n\n if (startsAt < 0) {\n return;\n } // Trim everything to the left of the phone number.\n\n\n text = text.slice(startsAt); // Trim the `+`.\n\n var hasPlus;\n\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n } // Trim everything to the right of the phone number.\n\n\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.\n\n if (hasPlus) {\n text = '+' + text;\n }\n\n return text;\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.\n\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n\n return [extractedNumber];\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nexport function extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part\n // can possibly be a part of some valid phone number\n // then parse phone number characters from a formatted phone number.\n\n\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar AsYouTypeState =\n/*#__PURE__*/\nfunction () {\n function AsYouTypeState(_ref) {\n var _this = this;\n\n var onCountryChange = _ref.onCountryChange,\n onCallingCodeChange = _ref.onCallingCodeChange;\n\n _classCallCheck(this, AsYouTypeState);\n\n _defineProperty(this, \"update\", function (properties) {\n for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n _this[key] = properties[key];\n }\n });\n\n this.onCountryChange = onCountryChange;\n this.onCallingCodeChange = onCallingCodeChange;\n }\n\n _createClass(AsYouTypeState, [{\n key: \"reset\",\n value: function reset(defaultCountry, defaultCallingCode) {\n this.international = false;\n this.IDDPrefix = undefined;\n this.missingPlus = undefined;\n this.callingCode = undefined;\n this.digits = '';\n this.resetNationalSignificantNumber();\n this.initCountryAndCallingCode(defaultCountry, defaultCallingCode);\n }\n }, {\n key: \"resetNationalSignificantNumber\",\n value: function resetNationalSignificantNumber() {\n this.nationalSignificantNumber = this.getNationalDigits();\n this.nationalSignificantNumberMatchesInput = true;\n this.nationalPrefix = undefined;\n this.carrierCode = undefined;\n this.complexPrefixBeforeNationalSignificantNumber = undefined;\n }\n }, {\n key: \"initCountryAndCallingCode\",\n value: function initCountryAndCallingCode(country, callingCode) {\n this.setCountry(country);\n this.setCallingCode(callingCode);\n }\n }, {\n key: \"setCountry\",\n value: function setCountry(country) {\n this.country = country;\n this.onCountryChange(country);\n }\n }, {\n key: \"setCallingCode\",\n value: function setCallingCode(callingCode) {\n this.callingCode = callingCode;\n return this.onCallingCodeChange(this.country, callingCode);\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber() {\n // Prepend the `+` to parsed input.\n this.international = true; // If a default country was set then reset it\n // because an explicitly international phone\n // number is being entered.\n\n this.initCountryAndCallingCode();\n }\n }, {\n key: \"appendDigits\",\n value: function appendDigits(nextDigits) {\n this.digits += nextDigits;\n }\n }, {\n key: \"appendNationalSignificantNumberDigits\",\n value: function appendNationalSignificantNumberDigits(nextDigits) {\n this.nationalSignificantNumber += nextDigits;\n }\n /**\r\n * Returns the part of `this.digits` that corresponds to the national number.\r\n * Basically, all digits that have been input by the user, except for the\r\n * international prefix and the country calling code part\r\n * (if the number is an international one).\r\n * @return {string}\r\n */\n\n }, {\n key: \"getNationalDigits\",\n value: function getNationalDigits() {\n if (this.international) {\n return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));\n }\n\n return this.digits;\n }\n }, {\n key: \"getDigitsWithoutInternationalPrefix\",\n value: function getDigitsWithoutInternationalPrefix() {\n if (this.international) {\n if (this.IDDPrefix) {\n return this.digits.slice(this.IDDPrefix.length);\n }\n }\n\n return this.digits;\n }\n }]);\n\n return AsYouTypeState;\n}();\n\nexport { AsYouTypeState as default };\n//# sourceMappingURL=AsYouTypeState.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://stackoverflow.com/a/46971044/970769\nvar ParseError = function ParseError(code) {\n _classCallCheck(this, ParseError);\n\n this.name = this.constructor.name;\n this.message = code;\n this.stack = new Error(code).stack;\n};\n\nexport { ParseError as default };\nParseError.prototype = Object.create(Error.prototype);\nParseError.prototype.constructor = ParseError;\n//# sourceMappingURL=ParseError.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport Metadata from './metadata';\nimport isPossibleNumber from './isPossibleNumber_';\nimport isValidNumber from './validate_';\nimport isValidNumberForRegion from './isValidNumberForRegion_';\nimport getNumberType from './helpers/getNumberType';\nimport formatNumber from './format_';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar PhoneNumber =\n/*#__PURE__*/\nfunction () {\n function PhoneNumber(countryCallingCode, nationalNumber, metadata) {\n _classCallCheck(this, PhoneNumber);\n\n if (!countryCallingCode) {\n throw new TypeError('`country` or `countryCallingCode` not passed');\n }\n\n if (!nationalNumber) {\n throw new TypeError('`nationalNumber` not passed');\n }\n\n var _metadata = new Metadata(metadata); // If country code is passed then derive `countryCallingCode` from it.\n // Also store the country code as `.country`.\n\n\n if (isCountryCode(countryCallingCode)) {\n this.country = countryCallingCode;\n\n _metadata.country(countryCallingCode);\n\n countryCallingCode = _metadata.countryCallingCode();\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (_metadata.isNonGeographicCallingCode(countryCallingCode)) {\n this.country = '001';\n }\n }\n }\n\n this.countryCallingCode = countryCallingCode;\n this.nationalNumber = nationalNumber;\n this.number = '+' + this.countryCallingCode + this.nationalNumber;\n this.metadata = metadata;\n }\n\n _createClass(PhoneNumber, [{\n key: \"isPossible\",\n value: function isPossible() {\n return isPossibleNumber(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isValid\",\n value: function isValid() {\n return isValidNumber(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"isNonGeographic\",\n value: function isNonGeographic() {\n var metadata = new Metadata(this.metadata);\n return metadata.isNonGeographicCallingCode(this.countryCallingCode);\n }\n }, {\n key: \"isEqual\",\n value: function isEqual(phoneNumber) {\n return this.number === phoneNumber.number && this.ext === phoneNumber.ext;\n } // // Is just an alias for `this.isValid() && this.country === country`.\n // // https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\n // isValidForRegion(country) {\n // \treturn isValidNumberForRegion(this, country, { v2: true }, this.metadata)\n // }\n\n }, {\n key: \"getType\",\n value: function getType() {\n return getNumberType(this, {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"format\",\n value: function format(_format, options) {\n return formatNumber(this, _format, options ? _objectSpread({}, options, {\n v2: true\n }) : {\n v2: true\n }, this.metadata);\n }\n }, {\n key: \"formatNational\",\n value: function formatNational(options) {\n return this.format('NATIONAL', options);\n }\n }, {\n key: \"formatInternational\",\n value: function formatInternational(options) {\n return this.format('INTERNATIONAL', options);\n }\n }, {\n key: \"getURI\",\n value: function getURI(options) {\n return this.format('RFC3966', options);\n }\n }]);\n\n return PhoneNumber;\n}();\n\nexport { PhoneNumber as default };\n\nvar isCountryCode = function isCountryCode(value) {\n return /^[A-Z]{2}$/.test(value);\n};\n//# sourceMappingURL=PhoneNumber.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n/**\r\n * A port of Google's `PhoneNumberMatcher.java`.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberMatcher.java\r\n * Date: 08.03.2018.\r\n */\nimport PhoneNumber from './PhoneNumber';\nimport { MAX_LENGTH_FOR_NSN, MAX_LENGTH_COUNTRY_CODE, VALID_PUNCTUATION } from './constants';\nimport createExtensionPattern from './helpers/extension/createExtensionPattern';\nimport RegExpCache from './findNumbers/RegExpCache';\nimport { limit, trimAfterFirstMatch } from './findNumbers/util';\nimport { _pL, _pN, pZ, PZ, pNd } from './findNumbers/utf-8';\nimport Leniency from './findNumbers/Leniency';\nimport parsePreCandidate from './findNumbers/parsePreCandidate';\nimport isValidPreCandidate from './findNumbers/isValidPreCandidate';\nimport isValidCandidate, { LEAD_CLASS } from './findNumbers/isValidCandidate';\nimport { isSupportedCountry } from './metadata';\nimport parseNumber from './parse_';\nvar EXTN_PATTERNS_FOR_MATCHING = createExtensionPattern('matching');\n/**\r\n * Patterns used to extract phone numbers from a larger phone-number-like pattern. These are\r\n * ordered according to specificity. For example, white-space is last since that is frequently\r\n * used in numbers, not just to separate two numbers. We have separate patterns since we don't\r\n * want to break up the phone-number-like text on more than one different kind of symbol at one\r\n * time, although symbols of the same type (e.g. space) can be safely grouped together.\r\n *\r\n * Note that if there is a match, we will always check any text found up to the first match as\r\n * well.\r\n */\n\nvar INNER_MATCHES = [// Breaks on the slash - e.g. \"651-234-2345/332-445-1234\"\n'\\\\/+(.*)/', // Note that the bracket here is inside the capturing group, since we consider it part of the\n// phone number. Will match a pattern like \"(650) 223 3345 (754) 223 3321\".\n'(\\\\([^(]*)', // Breaks on a hyphen - e.g. \"12345 - 332-445-1234 is my number.\"\n// We require a space on either side of the hyphen for it to be considered a separator.\n\"(?:\".concat(pZ, \"-|-\").concat(pZ, \")\").concat(pZ, \"*(.+)\"), // Various types of wide hyphens. Note we have decided not to enforce a space here, since it's\n// possible that it's supposed to be used to break two numbers without spaces, and we haven't\n// seen many instances of it used within a number.\n\"[\\u2012-\\u2015\\uFF0D]\".concat(pZ, \"*(.+)\"), // Breaks on a full stop - e.g. \"12345. 332-445-1234 is my number.\"\n\"\\\\.+\".concat(pZ, \"*([^.]+)\"), // Breaks on space - e.g. \"3324451234 8002341234\"\n\"\".concat(pZ, \"+(\").concat(PZ, \"+)\")]; // Limit on the number of leading (plus) characters.\n\nvar leadLimit = limit(0, 2); // Limit on the number of consecutive punctuation characters.\n\nvar punctuationLimit = limit(0, 4);\n/* The maximum number of digits allowed in a digit-separated block. As we allow all digits in a\r\n * single block, set high enough to accommodate the entire national number and the international\r\n * country code. */\n\nvar digitBlockLimit = MAX_LENGTH_FOR_NSN + MAX_LENGTH_COUNTRY_CODE; // Limit on the number of blocks separated by punctuation.\n// Uses digitBlockLimit since some formats use spaces to separate each digit.\n\nvar blockLimit = limit(0, digitBlockLimit);\n/* A punctuation sequence allowing white space. */\n\nvar punctuation = \"[\".concat(VALID_PUNCTUATION, \"]\") + punctuationLimit; // A digits block without punctuation.\n\nvar digitSequence = pNd + limit(1, digitBlockLimit);\n/**\r\n * Phone number pattern allowing optional punctuation.\r\n * The phone number pattern used by `find()`, similar to\r\n * VALID_PHONE_NUMBER, but with the following differences:\r\n * \r\n * - All captures are limited in order to place an upper bound to the text matched by the\r\n * pattern.\r\n *
\r\n * - Leading punctuation / plus signs are limited.\r\n *
- Consecutive occurrences of punctuation are limited.\r\n *
- Number of digits is limited.\r\n *
\r\n * - No whitespace is allowed at the start or end.\r\n *
- No alpha digits (vanity numbers such as 1-800-SIX-FLAGS) are currently supported.\r\n *
\r\n */\n\nvar PATTERN = '(?:' + LEAD_CLASS + punctuation + ')' + leadLimit + digitSequence + '(?:' + punctuation + digitSequence + ')' + blockLimit + '(?:' + EXTN_PATTERNS_FOR_MATCHING + ')?'; // Regular expression of trailing characters that we want to remove.\n// We remove all characters that are not alpha or numerical characters.\n// The hash character is retained here, as it may signify\n// the previous block was an extension.\n//\n// // Don't know what does '&&' mean here.\n// const UNWANTED_END_CHAR_PATTERN = new RegExp(`[[\\\\P{N}&&\\\\P{L}]&&[^#]]+$`)\n//\n\nvar UNWANTED_END_CHAR_PATTERN = new RegExp(\"[^\".concat(_pN).concat(_pL, \"#]+$\"));\nvar NON_DIGITS_PATTERN = /(\\D+)/;\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;\n/**\r\n * A stateful class that finds and extracts telephone numbers from {@linkplain CharSequence text}.\r\n * Instances can be created using the {@linkplain PhoneNumberUtil#findNumbers factory methods} in\r\n * {@link PhoneNumberUtil}.\r\n *\r\n * Vanity numbers (phone numbers using alphabetic digits such as 1-800-SIX-FLAGS are\r\n * not found.\r\n *\r\n *
This class is not thread-safe.\r\n */\n\nvar PhoneNumberMatcher =\n/*#__PURE__*/\nfunction () {\n /** The iteration tristate. */\n\n /** The next index to start searching at. Undefined in {@link State#DONE}. */\n // A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3\n // countries being used for the same doc with ~10 patterns for each country. Some pages will have\n // a lot more countries in use, but typically fewer numbers for each so expanding the cache for\n // that use-case won't have a lot of benefit.\n\n /**\r\n * Creates a new instance. See the factory methods in {@link PhoneNumberUtil} on how to obtain a\r\n * new instance.\r\n *\r\n * @param util the phone number util to use\r\n * @param text the character sequence that we will search, null for no text\r\n * @param country the country to assume for phone numbers not written in international format\r\n * (with a leading plus, or with the international dialing prefix of the specified region).\r\n * May be null or \"ZZ\" if only numbers with a leading plus should be\r\n * considered.\r\n * @param leniency the leniency to use when evaluating candidate phone numbers\r\n * @param maxTries the maximum number of invalid numbers to try before giving up on the text.\r\n * This is to cover degenerate cases where the text has a lot of false positives in it. Must\r\n * be {@code >= 0}.\r\n */\n function PhoneNumberMatcher() {\n var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var metadata = arguments.length > 2 ? arguments[2] : undefined;\n\n _classCallCheck(this, PhoneNumberMatcher);\n\n _defineProperty(this, \"state\", 'NOT_READY');\n\n _defineProperty(this, \"searchIndex\", 0);\n\n _defineProperty(this, \"regExpCache\", new RegExpCache(32));\n\n options = _objectSpread({}, options, {\n defaultCallingCode: options.defaultCallingCode,\n defaultCountry: options.defaultCountry && isSupportedCountry(options.defaultCountry, metadata) ? options.defaultCountry : undefined,\n leniency: options.leniency || options.extended ? 'POSSIBLE' : 'VALID',\n maxTries: options.maxTries || MAX_SAFE_INTEGER\n });\n\n if (!options.leniency) {\n throw new TypeError('`Leniency` not supplied');\n }\n\n if (options.maxTries < 0) {\n throw new TypeError('`maxTries` not supplied');\n }\n\n this.text = text;\n this.options = options;\n this.metadata = metadata;\n /** The degree of validation requested. */\n\n this.leniency = Leniency[options.leniency];\n\n if (!this.leniency) {\n throw new TypeError(\"Unknown leniency: \".concat(options.leniency, \".\"));\n }\n /** The maximum number of retries after matching an invalid number. */\n\n\n this.maxTries = options.maxTries;\n this.PATTERN = new RegExp(PATTERN, 'ig');\n }\n /**\r\n * Attempts to find the next subsequence in the searched sequence on or after {@code searchIndex}\r\n * that represents a phone number. Returns the next match, null if none was found.\r\n *\r\n * @param index the search index to start searching at\r\n * @return the phone number match found, null if none can be found\r\n */\n\n\n _createClass(PhoneNumberMatcher, [{\n key: \"find\",\n value: function find() {\n // // Reset the regular expression.\n // this.PATTERN.lastIndex = index\n var matches;\n\n while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) {\n var candidate = matches[0];\n var offset = matches.index;\n candidate = parsePreCandidate(candidate);\n\n if (isValidPreCandidate(candidate, offset, this.text)) {\n var match = // Try to come up with a valid match given the entire candidate.\n this.parseAndVerify(candidate, offset, this.text) // If that failed, try to find an \"inner match\" -\n // there might be a phone number within this candidate.\n || this.extractInnerMatch(candidate, offset, this.text);\n\n if (match) {\n if (this.options.v2) {\n var phoneNumber = new PhoneNumber(match.country || match.countryCallingCode, match.phone, this.metadata);\n\n if (match.ext) {\n phoneNumber.ext = match.ext;\n }\n\n return {\n startsAt: match.startsAt,\n endsAt: match.endsAt,\n number: phoneNumber\n };\n }\n\n return match;\n }\n }\n\n this.maxTries--;\n }\n }\n /**\r\n * Attempts to extract a match from `substring`\r\n * if the substring itself does not qualify as a match.\r\n */\n\n }, {\n key: \"extractInnerMatch\",\n value: function extractInnerMatch(substring, offset, text) {\n for (var _i = 0, _INNER_MATCHES = INNER_MATCHES; _i < _INNER_MATCHES.length; _i++) {\n var innerMatchPattern = _INNER_MATCHES[_i];\n var isFirstMatch = true;\n var candidateMatch = void 0;\n var innerMatchRegExp = new RegExp(innerMatchPattern, 'g');\n\n while (this.maxTries > 0 && (candidateMatch = innerMatchRegExp.exec(substring)) !== null) {\n if (isFirstMatch) {\n // We should handle any group before this one too.\n var _candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, substring.slice(0, candidateMatch.index));\n\n var _match = this.parseAndVerify(_candidate, offset, text);\n\n if (_match) {\n return _match;\n }\n\n this.maxTries--;\n isFirstMatch = false;\n }\n\n var candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, candidateMatch[1]); // Java code does `groupMatcher.start(1)` here,\n // but there's no way in javascript to get a `candidate` start index,\n // therefore resort to using this kind of an approximation.\n // (`groupMatcher` is called `candidateInSubstringMatch` in this javascript port)\n // https://stackoverflow.com/questions/15934353/get-index-of-each-capture-in-a-javascript-regex\n\n var candidateIndexGuess = substring.indexOf(candidate, candidateMatch.index);\n var match = this.parseAndVerify(candidate, offset + candidateIndexGuess, text);\n\n if (match) {\n return match;\n }\n\n this.maxTries--;\n }\n }\n }\n /**\r\n * Parses a phone number from the `candidate` using `parseNumber` and\r\n * verifies it matches the requested `leniency`. If parsing and verification succeed,\r\n * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`.\r\n *\r\n * @param candidate the candidate match\r\n * @param offset the offset of {@code candidate} within {@link #text}\r\n * @return the parsed and validated phone number match, or null\r\n */\n\n }, {\n key: \"parseAndVerify\",\n value: function parseAndVerify(candidate, offset, text) {\n if (!isValidCandidate(candidate, offset, text, this.options.leniency)) {\n return;\n }\n\n var number = parseNumber(candidate, {\n extended: true,\n defaultCountry: this.options.defaultCountry,\n defaultCallingCode: this.options.defaultCallingCode\n }, this.metadata);\n\n if (!number.possible) {\n return;\n }\n\n if (this.leniency(number, candidate, this.metadata, this.regExpCache)) {\n // // We used parseAndKeepRawInput to create this number,\n // // but for now we don't return the extra values parsed.\n // // TODO: stop clearing all values here and switch all users over\n // // to using rawInput() rather than the rawString() of PhoneNumberMatch.\n // number.clearCountryCodeSource()\n // number.clearRawInput()\n // number.clearPreferredDomesticCarrierCode()\n var result = {\n startsAt: offset,\n endsAt: offset + candidate.length,\n phone: number.phone\n };\n\n if (number.country && number.country !== '001') {\n result.country = number.country;\n } else {\n result.countryCallingCode = number.countryCallingCode;\n }\n\n if (number.ext) {\n result.ext = number.ext;\n }\n\n return result;\n }\n }\n }, {\n key: \"hasNext\",\n value: function hasNext() {\n if (this.state === 'NOT_READY') {\n this.lastMatch = this.find(); // (this.searchIndex)\n\n if (this.lastMatch) {\n // this.searchIndex = this.lastMatch.endsAt\n this.state = 'READY';\n } else {\n this.state = 'DONE';\n }\n }\n\n return this.state === 'READY';\n }\n }, {\n key: \"next\",\n value: function next() {\n // Check the state and find the next match as a side-effect if necessary.\n if (!this.hasNext()) {\n throw new Error('No next element');\n } // Don't retain that memory any longer than necessary.\n\n\n var result = this.lastMatch;\n this.lastMatch = null;\n this.state = 'NOT_READY';\n return result;\n }\n }]);\n\n return PhoneNumberMatcher;\n}();\n\nexport { PhoneNumberMatcher as default };\n//# sourceMappingURL=PhoneNumberMatcher.js.map","// The minimum length of the national significant number.\nexport var MIN_LENGTH_FOR_NSN = 2; // The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\n\nexport var MAX_LENGTH_FOR_NSN = 17; // The maximum length of the country calling code.\n\nexport var MAX_LENGTH_COUNTRY_CODE = 3; // Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\n\nexport var VALID_DIGITS = \"0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9\"; // `DASHES` will be right after the opening square bracket of the \"character class\"\n\nvar DASHES = \"-\\u2010-\\u2015\\u2212\\u30FC\\uFF0D\";\nvar SLASHES = \"\\uFF0F/\";\nvar DOTS = \"\\uFF0E.\";\nexport var WHITESPACE = \" \\xA0\\xAD\\u200B\\u2060\\u3000\";\nvar BRACKETS = \"()\\uFF08\\uFF09\\uFF3B\\uFF3D\\\\[\\\\]\"; // export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\n\nvar TILDES = \"~\\u2053\\u223C\\uFF5E\"; // Regular expression of acceptable punctuation found in phone numbers. This\n// excludes punctuation found as a leading character only. This consists of dash\n// characters, white space characters, full stops, slashes, square brackets,\n// parentheses and tildes. Full-width variants are also present.\n\nexport var VALID_PUNCTUATION = \"\".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);\nexport var PLUS_CHARS = \"+\\uFF0B\"; // const LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+')\n//# sourceMappingURL=constants.js.map","import _findNumbers from './findNumbers_';\nimport { normalizeArguments } from './parsePhoneNumber';\nexport default function findNumbers() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _findNumbers(text, options, metadata);\n}\n//# sourceMappingURL=findNumbers.js.map","function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9\nvar Node = function Node(key, value) {\n var next = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var prev = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n _classCallCheck(this, Node);\n\n this.key = key;\n this.value = value;\n this.next = next;\n this.prev = prev;\n};\n\nvar LRUCache =\n/*#__PURE__*/\nfunction () {\n //set default limit of 10 if limit is not passed.\n function LRUCache() {\n var limit = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 10;\n\n _classCallCheck(this, LRUCache);\n\n this.size = 0;\n this.limit = limit;\n this.head = null;\n this.tail = null;\n this.cache = {};\n } // Write Node to head of LinkedList\n // update cache with Node key and Node reference\n\n\n _createClass(LRUCache, [{\n key: \"put\",\n value: function put(key, value) {\n this.ensureLimit();\n\n if (!this.head) {\n this.head = this.tail = new Node(key, value);\n } else {\n var node = new Node(key, value, this.head);\n this.head.prev = node;\n this.head = node;\n } //Update the cache map\n\n\n this.cache[key] = this.head;\n this.size++;\n } // Read from cache map and make that node as new Head of LinkedList\n\n }, {\n key: \"get\",\n value: function get(key) {\n if (this.cache[key]) {\n var value = this.cache[key].value; // node removed from it's position and cache\n\n this.remove(key); // write node again to the head of LinkedList to make it most recently used\n\n this.put(key, value);\n return value;\n }\n\n console.log(\"Item not available in cache for key \".concat(key));\n }\n }, {\n key: \"ensureLimit\",\n value: function ensureLimit() {\n if (this.size === this.limit) {\n this.remove(this.tail.key);\n }\n }\n }, {\n key: \"remove\",\n value: function remove(key) {\n var node = this.cache[key];\n\n if (node.prev !== null) {\n node.prev.next = node.next;\n } else {\n this.head = node.next;\n }\n\n if (node.next !== null) {\n node.next.prev = node.prev;\n } else {\n this.tail = node.prev;\n }\n\n delete this.cache[key];\n this.size--;\n }\n }, {\n key: \"clear\",\n value: function clear() {\n this.head = null;\n this.tail = null;\n this.size = 0;\n this.cache = {};\n } // // Invokes the callback function with every node of the chain and the index of the node.\n // forEach(fn) {\n // let node = this.head;\n // let counter = 0;\n // while (node) {\n // fn(node, counter);\n // node = node.next;\n // counter++;\n // }\n // }\n // // To iterate over LRU with a 'for...of' loop\n // *[Symbol.iterator]() {\n // let node = this.head;\n // while (node) {\n // yield node;\n // node = node.next;\n // }\n // }\n\n }]);\n\n return LRUCache;\n}();\n\nexport { LRUCache as default };\n//# sourceMappingURL=LRUCache.js.map","import isValidNumber from '../validate_';\nimport parseDigits from '../helpers/parseDigits';\nimport { startsWith, endsWith } from './util';\n/**\r\n * Leniency when finding potential phone numbers in text segments\r\n * The levels here are ordered in increasing strictness.\r\n */\n\nexport default {\n /**\r\n * Phone numbers accepted are \"possible\", but not necessarily \"valid\".\r\n */\n POSSIBLE: function POSSIBLE(number, candidate, metadata) {\n return true;\n },\n\n /**\r\n * Phone numbers accepted are \"possible\" and \"valid\".\r\n * Numbers written in national format must have their national-prefix\r\n * present if it is usually written for a number of this type.\r\n */\n VALID: function VALID(number, candidate, metadata) {\n if (!isValidNumber(number, undefined, metadata) || !containsOnlyValidXChars(number, candidate.toString(), metadata)) {\n return false;\n } // Skipped for simplicity.\n // return isNationalPrefixPresentIfRequired(number, metadata)\n\n\n return true;\n },\n\n /**\r\n * Phone numbers accepted are \"valid\" and\r\n * are grouped in a possible way for this locale. For example, a US number written as\r\n * \"65 02 53 00 00\" and \"650253 0000\" are not accepted at this leniency level, whereas\r\n * \"650 253 0000\", \"650 2530000\" or \"6502530000\" are.\r\n * Numbers with more than one '/' symbol in the national significant number\r\n * are also dropped at this level.\r\n *\r\n * Warning: This level might result in lower coverage especially for regions outside of\r\n * country code \"+1\". If you are not sure about which level to use,\r\n * email the discussion group libphonenumber-discuss@googlegroups.com.\r\n */\n STRICT_GROUPING: function STRICT_GROUPING(number, candidate, metadata, regExpCache) {\n var candidateString = candidate.toString();\n\n if (!isValidNumber(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsRemainGrouped, regExpCache);\n },\n\n /**\r\n * Phone numbers accepted are {@linkplain PhoneNumberUtil#isValidNumber(PhoneNumber) valid} and\r\n * are grouped in the same way that we would have formatted it, or as a single block. For\r\n * example, a US number written as \"650 2530000\" is not accepted at this leniency level, whereas\r\n * \"650 253 0000\" or \"6502530000\" are.\r\n * Numbers with more than one '/' symbol are also dropped at this level.\r\n *
\r\n * Warning: This level might result in lower coverage especially for regions outside of country\r\n * code \"+1\". If you are not sure about which level to use, email the discussion group\r\n * libphonenumber-discuss@googlegroups.com.\r\n */\n EXACT_GROUPING: function EXACT_GROUPING(number, candidate, metadata, regExpCache) {\n var candidateString = candidate.toString();\n\n if (!isValidNumber(number, undefined, metadata) || !containsOnlyValidXChars(number, candidateString, metadata) || containsMoreThanOneSlashInNationalNumber(number, candidateString) || !isNationalPrefixPresentIfRequired(number, metadata)) {\n return false;\n }\n\n return checkNumberGroupingIsValid(number, candidate, metadata, allNumberGroupsAreExactlyPresent, regExpCache);\n }\n};\n\nfunction containsOnlyValidXChars(number, candidate, metadata) {\n // The characters 'x' and 'X' can be (1) a carrier code, in which case they always precede the\n // national significant number or (2) an extension sign, in which case they always precede the\n // extension number. We assume a carrier code is more than 1 digit, so the first case has to\n // have more than 1 consecutive 'x' or 'X', whereas the second case can only have exactly 1 'x'\n // or 'X'. We ignore the character if it appears as the last character of the string.\n for (var index = 0; index < candidate.length - 1; index++) {\n var charAtIndex = candidate.charAt(index);\n\n if (charAtIndex === 'x' || charAtIndex === 'X') {\n var charAtNextIndex = candidate.charAt(index + 1);\n\n if (charAtNextIndex === 'x' || charAtNextIndex === 'X') {\n // This is the carrier code case, in which the 'X's always precede the national\n // significant number.\n index++;\n\n if (util.isNumberMatch(number, candidate.substring(index)) != MatchType.NSN_MATCH) {\n return false;\n } // This is the extension sign case, in which the 'x' or 'X' should always precede the\n // extension number.\n\n } else if (parseDigits(candidate.substring(index)) !== number.ext) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction isNationalPrefixPresentIfRequired(number, _metadata) {\n // First, check how we deduced the country code. If it was written in international format, then\n // the national prefix is not required.\n if (number.getCountryCodeSource() != 'FROM_DEFAULT_COUNTRY') {\n return true;\n }\n\n var phoneNumberRegion = util.getRegionCodeForCountryCode(number.getCountryCode());\n var metadata = util.getMetadataForRegion(phoneNumberRegion);\n\n if (metadata == null) {\n return true;\n } // Check if a national prefix should be present when formatting this number.\n\n\n var nationalNumber = util.getNationalSignificantNumber(number);\n var formatRule = util.chooseFormattingPatternForNumber(metadata.numberFormats(), nationalNumber); // To do this, we check that a national prefix formatting rule was present\n // and that it wasn't just the first-group symbol ($1) with punctuation.\n\n if (formatRule && formatRule.getNationalPrefixFormattingRule().length > 0) {\n if (formatRule.getNationalPrefixOptionalWhenFormatting()) {\n // The national-prefix is optional in these cases, so we don't need to check if it was\n // present.\n return true;\n }\n\n if (PhoneNumberUtil.formattingRuleHasFirstGroupOnly(formatRule.getNationalPrefixFormattingRule())) {\n // National Prefix not needed for this number.\n return true;\n } // Normalize the remainder.\n\n\n var rawInputCopy = PhoneNumberUtil.normalizeDigitsOnly(number.getRawInput()); // Check if we found a national prefix and/or carrier code at the start of the raw input, and\n // return the result.\n\n return util.maybeStripNationalPrefixAndCarrierCode(rawInputCopy, metadata, null);\n }\n\n return true;\n}\n\nexport function containsMoreThanOneSlashInNationalNumber(number, candidate) {\n var firstSlashInBodyIndex = candidate.indexOf('/');\n\n if (firstSlashInBodyIndex < 0) {\n // No slashes, this is okay.\n return false;\n } // Now look for a second one.\n\n\n var secondSlashInBodyIndex = candidate.indexOf('/', firstSlashInBodyIndex + 1);\n\n if (secondSlashInBodyIndex < 0) {\n // Only one slash, this is okay.\n return false;\n } // If the first slash is after the country calling code, this is permitted.\n\n\n var candidateHasCountryCode = number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN || number.getCountryCodeSource() === CountryCodeSource.FROM_NUMBER_WITHOUT_PLUS_SIGN;\n\n if (candidateHasCountryCode && PhoneNumberUtil.normalizeDigitsOnly(candidate.substring(0, firstSlashInBodyIndex)) === String(number.getCountryCode())) {\n // Any more slashes and this is illegal.\n return candidate.slice(secondSlashInBodyIndex + 1).indexOf('/') >= 0;\n }\n\n return true;\n}\n\nfunction checkNumberGroupingIsValid(number, candidate, metadata, checkGroups, regExpCache) {\n var normalizedCandidate = normalizeDigits(candidate, true\n /* keep non-digits */\n );\n var formattedNumberGroups = getNationalNumberGroups(metadata, number, null);\n\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n } // If this didn't pass, see if there are any alternate formats that match, and try them instead.\n\n\n var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n\n if (alternateFormats) {\n for (var _iterator = alternateFormats.numberFormats(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var alternateFormat = _ref;\n\n if (alternateFormat.leadingDigitsPatterns().length > 0) {\n // There is only one leading digits pattern for alternate formats.\n var leadingDigitsRegExp = regExpCache.getPatternForRegExp('^' + alternateFormat.leadingDigitsPatterns()[0]);\n\n if (!leadingDigitsRegExp.test(nationalSignificantNumber)) {\n // Leading digits don't match; try another one.\n continue;\n }\n }\n\n formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat);\n\n if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {\n return true;\n }\n }\n }\n\n return false;\n}\n/**\r\n * Helper method to get the national-number part of a number, formatted without any national\r\n * prefix, and return it as a set of digit blocks that would be formatted together following\r\n * standard formatting rules.\r\n */\n\n\nfunction getNationalNumberGroups(metadata, number, formattingPattern) {\n if (formattingPattern) {\n // We format the NSN only, and split that according to the separator.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, 'RFC3966', metadata).split('-');\n } // This will be in the format +CC-DG1-DG2-DGX;ext=EXT where DG1..DGX represents groups of digits.\n\n\n var rfc3966Format = formatNumber(number, 'RFC3966', metadata); // We remove the extension part from the formatted string before splitting it into different\n // groups.\n\n var endIndex = rfc3966Format.indexOf(';');\n\n if (endIndex < 0) {\n endIndex = rfc3966Format.length;\n } // The country-code will have a '-' following it.\n\n\n var startIndex = rfc3966Format.indexOf('-') + 1;\n return rfc3966Format.slice(startIndex, endIndex).split('-');\n}\n\nfunction allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN); // Set this to the last group, skipping it if the number has an extension.\n\n var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1; // First we check if the national significant number is formatted as a block.\n // We use contains and not equals, since the national significant number may be present with\n // a prefix such as a national number prefix, or the country code itself.\n\n if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) {\n return true;\n } // Starting from the end, go through in reverse, excluding the first group, and check the\n // candidate and number groups are the same.\n\n\n var formattedNumberGroupIndex = formattedNumberGroups.length - 1;\n\n while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) {\n if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) {\n return false;\n }\n\n formattedNumberGroupIndex--;\n candidateNumberGroupIndex--;\n } // Now check the first group. There may be a national prefix at the start, so we only check\n // that the candidate group ends with the formatted number group.\n\n\n return candidateNumberGroupIndex >= 0 && endsWith(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]);\n}\n\nfunction allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) {\n var fromIndex = 0;\n\n if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) {\n // First skip the country code if the normalized candidate contained it.\n var countryCode = String(number.getCountryCode());\n fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length();\n } // Check each group of consecutive digits are not broken into separate groupings in the\n // {@code normalizedCandidate} string.\n\n\n for (var i = 0; i < formattedNumberGroups.length; i++) {\n // Fails if the substring of {@code normalizedCandidate} starting from {@code fromIndex}\n // doesn't contain the consecutive digits in formattedNumberGroups[i].\n fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i], fromIndex);\n\n if (fromIndex < 0) {\n return false;\n } // Moves {@code fromIndex} forward.\n\n\n fromIndex += formattedNumberGroups[i].length();\n\n if (i == 0 && fromIndex < normalizedCandidate.length()) {\n // We are at the position right after the NDC. We get the region used for formatting\n // information based on the country code in the phone number, rather than the number itself,\n // as we do not need to distinguish between different countries with the same country\n // calling code and this is faster.\n var region = util.getRegionCodeForCountryCode(number.getCountryCode());\n\n if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) {\n // This means there is no formatting symbol after the NDC. In this case, we only\n // accept the number if there is no formatting symbol at all in the number, except\n // for extensions. This is only important for countries with national prefixes.\n var nationalSignificantNumber = util.getNationalSignificantNumber(number);\n return startsWith(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i].length), nationalSignificantNumber);\n }\n }\n } // The check here makes sure that we haven't mistakenly already used the extension to\n // match the last group of the subscriber number. Note the extension cannot have\n // formatting in-between digits.\n\n\n return normalizedCandidate.slice(fromIndex).contains(number.getExtension());\n}\n//# sourceMappingURL=Leniency.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport LRUCache from './LRUCache'; // A cache for frequently used country-specific regular expressions. Set to 32 to cover ~2-3\n// countries being used for the same doc with ~10 patterns for each country. Some pages will have\n// a lot more countries in use, but typically fewer numbers for each so expanding the cache for\n// that use-case won't have a lot of benefit.\n\nvar RegExpCache =\n/*#__PURE__*/\nfunction () {\n function RegExpCache(size) {\n _classCallCheck(this, RegExpCache);\n\n this.cache = new LRUCache(size);\n }\n\n _createClass(RegExpCache, [{\n key: \"getPatternForRegExp\",\n value: function getPatternForRegExp(pattern) {\n var regExp = this.cache.get(pattern);\n\n if (!regExp) {\n regExp = new RegExp('^' + pattern);\n this.cache.put(pattern, regExp);\n }\n\n return regExp;\n }\n }]);\n\n return RegExpCache;\n}();\n\nexport { RegExpCache as default };\n//# sourceMappingURL=RegExpCache.js.map","// Copy-pasted from `PhoneNumberMatcher.js`.\nimport { PLUS_CHARS } from '../constants';\nimport { limit } from './util';\nimport { isLatinLetter, isInvalidPunctuationSymbol } from './utf-8';\nvar OPENING_PARENS = \"(\\\\[\\uFF08\\uFF3B\";\nvar CLOSING_PARENS = \")\\\\]\\uFF09\\uFF3D\";\nvar NON_PARENS = \"[^\".concat(OPENING_PARENS).concat(CLOSING_PARENS, \"]\");\nexport var LEAD_CLASS = \"[\".concat(OPENING_PARENS).concat(PLUS_CHARS, \"]\"); // Punctuation that may be at the start of a phone number - brackets and plus signs.\n\nvar LEAD_CLASS_LEADING = new RegExp('^' + LEAD_CLASS); // Limit on the number of pairs of brackets in a phone number.\n\nvar BRACKET_PAIR_LIMIT = limit(0, 3);\n/**\r\n * Pattern to check that brackets match. Opening brackets should be closed within a phone number.\r\n * This also checks that there is something inside the brackets. Having no brackets at all is also\r\n * fine.\r\n *\r\n * An opening bracket at the beginning may not be closed, but subsequent ones should be. It's\r\n * also possible that the leading bracket was dropped, so we shouldn't be surprised if we see a\r\n * closing bracket first. We limit the sets of brackets in a phone number to four.\r\n */\n\nvar MATCHING_BRACKETS_ENTIRE = new RegExp('^' + \"(?:[\" + OPENING_PARENS + \"])?\" + \"(?:\" + NON_PARENS + \"+\" + \"[\" + CLOSING_PARENS + \"])?\" + NON_PARENS + \"+\" + \"(?:[\" + OPENING_PARENS + \"]\" + NON_PARENS + \"+[\" + CLOSING_PARENS + \"])\" + BRACKET_PAIR_LIMIT + NON_PARENS + \"*\" + '$');\n/**\r\n * Matches strings that look like publication pages. Example:\r\n *
Computing Complete Answers to Queries in the Presence of Limited Access Patterns.\r\n * Chen Li. VLDB J. 12(3): 211-227 (2003).
\r\n *\r\n * The string \"211-227 (2003)\" is not a telephone number.\r\n */\n\nvar PUB_PAGES = /\\d{1,5}-+\\d{1,5}\\s{0,4}\\(\\d{1,4}/;\nexport default function isValidCandidate(candidate, offset, text, leniency) {\n // Check the candidate doesn't contain any formatting\n // which would indicate that it really isn't a phone number.\n if (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) {\n return;\n } // If leniency is set to VALID or stricter, we also want to skip numbers that are surrounded\n // by Latin alphabetic characters, to skip cases like abc8005001234 or 8005001234def.\n\n\n if (leniency !== 'POSSIBLE') {\n // If the candidate is not at the start of the text,\n // and does not start with phone-number punctuation,\n // check the previous character.\n if (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {\n var previousChar = text[offset - 1]; // We return null if it is a latin letter or an invalid punctuation symbol.\n\n if (isInvalidPunctuationSymbol(previousChar) || isLatinLetter(previousChar)) {\n return false;\n }\n }\n\n var lastCharIndex = offset + candidate.length;\n\n if (lastCharIndex < text.length) {\n var nextChar = text[lastCharIndex];\n\n if (isInvalidPunctuationSymbol(nextChar) || isLatinLetter(nextChar)) {\n return false;\n }\n }\n }\n\n return true;\n}\n//# sourceMappingURL=isValidCandidate.js.map","// Matches strings that look like dates using \"/\" as a separator.\n// Examples: 3/10/2011, 31/10/96 or 08/31/95.\nvar SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\\d\\/[01]?\\d)|(?:[01]?\\d\\/[0-3]?\\d))\\/(?:[12]\\d)?\\d{2}/; // Matches timestamps.\n// Examples: \"2012-01-02 08:00\".\n// Note that the reg-ex does not include the\n// trailing \":\\d\\d\" -- that is covered by TIME_STAMPS_SUFFIX.\n\nvar TIME_STAMPS = /[12]\\d{3}[-/]?[01]\\d[-/]?[0-3]\\d +[0-2]\\d$/;\nvar TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\\d/;\nexport default function isValidPreCandidate(candidate, offset, text) {\n // Skip a match that is more likely to be a date.\n if (SLASH_SEPARATED_DATES.test(candidate)) {\n return false;\n } // Skip potential time-stamps.\n\n\n if (TIME_STAMPS.test(candidate)) {\n var followingText = text.slice(offset + candidate.length);\n\n if (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {\n return false;\n }\n }\n\n return true;\n}\n//# sourceMappingURL=isValidPreCandidate.js.map","import { trimAfterFirstMatch } from './util'; // Regular expression of characters typically used to start a second phone number for the purposes\n// of parsing. This allows us to strip off parts of the number that are actually the start of\n// another number, such as for: (530) 583-6985 x302/x2303 -> the second extension here makes this\n// actually two phone numbers, (530) 583-6985 x302 and (530) 583-6985 x2303. We remove the second\n// extension so that the first number is parsed correctly.\n//\n// Matches a slash (\\ or /) followed by a space followed by an `x`.\n//\n\nvar SECOND_NUMBER_START_PATTERN = /[\\\\/] *x/;\nexport default function parsePreCandidate(candidate) {\n // Check for extra numbers at the end.\n // TODO: This is the place to start when trying to support extraction of multiple phone number\n // from split notations (+41 79 123 45 67 / 68).\n return trimAfterFirstMatch(SECOND_NUMBER_START_PATTERN, candidate);\n}\n//# sourceMappingURL=parsePreCandidate.js.map","// Javascript doesn't support UTF-8 regular expressions.\n// So mimicking them here.\n// Copy-pasted from `PhoneNumberMatcher.js`.\n\n/**\r\n * \"\\p{Z}\" is any kind of whitespace or invisible separator (\"Separator\").\r\n * http://www.regular-expressions.info/unicode.html\r\n * \"\\P{Z}\" is the reverse of \"\\p{Z}\".\r\n * \"\\p{N}\" is any kind of numeric character in any script (\"Number\").\r\n * \"\\p{Nd}\" is a digit zero through nine in any script except \"ideographic scripts\" (\"Decimal_Digit_Number\").\r\n * \"\\p{Sc}\" is a currency symbol (\"Currency_Symbol\").\r\n * \"\\p{L}\" is any kind of letter from any language (\"Letter\").\r\n * \"\\p{Mn}\" is \"non-spacing mark\".\r\n *\r\n * Javascript doesn't support Unicode Regular Expressions\r\n * so substituting it with this explicit set of characters.\r\n *\r\n * https://stackoverflow.com/questions/13210194/javascript-regex-equivalent-of-a-za-z-using-pl\r\n * https://github.com/danielberndt/babel-plugin-utf-8-regex/blob/master/src/transformer.js\r\n */\nvar _pZ = \" \\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000\";\nexport var pZ = \"[\".concat(_pZ, \"]\");\nexport var PZ = \"[^\".concat(_pZ, \"]\");\nexport var _pN = \"0-9\\xB2\\xB3\\xB9\\xBC-\\xBE\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u09F4-\\u09F9\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0B72-\\u0B77\\u0BE6-\\u0BF2\\u0C66-\\u0C6F\\u0C78-\\u0C7E\\u0CE6-\\u0CEF\\u0D66-\\u0D75\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F33\\u1040-\\u1049\\u1090-\\u1099\\u1369-\\u137C\\u16EE-\\u16F0\\u17E0-\\u17E9\\u17F0-\\u17F9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19DA\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\u2070\\u2074-\\u2079\\u2080-\\u2089\\u2150-\\u2182\\u2185-\\u2189\\u2460-\\u249B\\u24EA-\\u24FF\\u2776-\\u2793\\u2CFD\\u3007\\u3021-\\u3029\\u3038-\\u303A\\u3192-\\u3195\\u3220-\\u3229\\u3248-\\u324F\\u3251-\\u325F\\u3280-\\u3289\\u32B1-\\u32BF\\uA620-\\uA629\\uA6E6-\\uA6EF\\uA830-\\uA835\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\"; // const pN = `[${_pN}]`\n\nvar _pNd = \"0-9\\u0660-\\u0669\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9\\uFF10-\\uFF19\";\nexport var pNd = \"[\".concat(_pNd, \"]\");\nexport var _pL = \"A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0\\u08A2-\\u08AC\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA793\\uA7A0-\\uA7AA\\uA7F8-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA80-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\";\nvar pL = \"[\".concat(_pL, \"]\");\nvar pL_regexp = new RegExp(pL);\nvar _pSc = \"$\\xA2-\\xA5\\u058F\\u060B\\u09F2\\u09F3\\u09FB\\u0AF1\\u0BF9\\u0E3F\\u17DB\\u20A0-\\u20B9\\uA838\\uFDFC\\uFE69\\uFF04\\uFFE0\\uFFE1\\uFFE5\\uFFE6\";\nvar pSc = \"[\".concat(_pSc, \"]\");\nvar pSc_regexp = new RegExp(pSc);\nvar _pMn = \"\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u08FE\\u0900-\\u0902\\u093A\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0957\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4\\u17B5\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1BAB\\u1BE6\\u1BE8\\u1BE9\\u1BED\\u1BEF-\\u1BF1\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1CF4\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302D\\u3099\\u309A\\uA66F\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEC\\uAAED\\uAAF6\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26\";\nvar pMn = \"[\".concat(_pMn, \"]\");\nvar pMn_regexp = new RegExp(pMn);\nvar _InBasic_Latin = \"\\0-\\x7F\";\nvar _InLatin_1_Supplement = \"\\x80-\\xFF\";\nvar _InLatin_Extended_A = \"\\u0100-\\u017F\";\nvar _InLatin_Extended_Additional = \"\\u1E00-\\u1EFF\";\nvar _InLatin_Extended_B = \"\\u0180-\\u024F\";\nvar _InCombining_Diacritical_Marks = \"\\u0300-\\u036F\";\nvar latinLetterRegexp = new RegExp('[' + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + ']');\n/**\r\n * Helper method to determine if a character is a Latin-script letter or not.\r\n * For our purposes, combining marks should also return true since we assume\r\n * they have been added to a preceding Latin character.\r\n */\n\nexport function isLatinLetter(letter) {\n // Combining marks are a subset of non-spacing-mark.\n if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {\n return false;\n }\n\n return latinLetterRegexp.test(letter);\n}\nexport function isInvalidPunctuationSymbol(character) {\n return character === '%' || pSc_regexp.test(character);\n}\n//# sourceMappingURL=utf-8.js.map","/** Returns a regular expression quantifier with an upper and lower limit. */\nexport function limit(lower, upper) {\n if (lower < 0 || upper <= 0 || upper < lower) {\n throw new TypeError();\n }\n\n return \"{\".concat(lower, \",\").concat(upper, \"}\");\n}\n/**\r\n * Trims away any characters after the first match of {@code pattern} in {@code candidate},\r\n * returning the trimmed version.\r\n */\n\nexport function trimAfterFirstMatch(regexp, string) {\n var index = string.search(regexp);\n\n if (index >= 0) {\n return string.slice(0, index);\n }\n\n return string;\n}\nexport function startsWith(string, substring) {\n return string.indexOf(substring) === 0;\n}\nexport function endsWith(string, substring) {\n return string.indexOf(substring, string.length - substring.length) === string.length - substring.length;\n}\n//# sourceMappingURL=util.js.map","import PhoneNumberMatcher from './PhoneNumberMatcher';\nexport default function findNumbers(text, options, metadata) {\n var matcher = new PhoneNumberMatcher(text, options, metadata);\n var results = [];\n\n while (matcher.hasNext()) {\n results.push(matcher.next());\n }\n\n return results;\n}\n//# sourceMappingURL=findNumbers_.js.map","// This is a legacy function.\n// Use `findNumbers()` instead.\nimport _findPhoneNumbers, { searchPhoneNumbers as _searchPhoneNumbers } from './findPhoneNumbers_';\nimport { normalizeArguments } from './parsePhoneNumber';\nexport default function findPhoneNumbers() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _findPhoneNumbers(text, options, metadata);\n}\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\n\nexport function searchPhoneNumbers() {\n var _normalizeArguments2 = normalizeArguments(arguments),\n text = _normalizeArguments2.text,\n options = _normalizeArguments2.options,\n metadata = _normalizeArguments2.metadata;\n\n return _searchPhoneNumbers(text, options, metadata);\n}\n//# sourceMappingURL=findPhoneNumbers.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport findNumbers from './findNumbers';\nexport default function findPhoneNumbersInText(text, defaultCountry, options, metadata) {\n var args = getArguments(defaultCountry, options, metadata);\n return findNumbers(text, args.options, args.metadata);\n}\nexport function getArguments(defaultCountry, options, metadata) {\n if (metadata) {\n if (defaultCountry) {\n options = _objectSpread({}, options, {\n defaultCountry: defaultCountry\n });\n }\n } else {\n if (options) {\n metadata = options;\n\n if (defaultCountry) {\n if (is_object(defaultCountry)) {\n options = defaultCountry;\n } else {\n options = {\n defaultCountry: defaultCountry\n };\n }\n } else {\n options = undefined;\n }\n } else {\n metadata = defaultCountry;\n options = undefined;\n }\n }\n\n return {\n options: _objectSpread({}, options, {\n v2: true\n }),\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=findPhoneNumbersInText.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// This is a legacy function.\n// Use `findNumbers()` instead.\nimport { PLUS_CHARS, VALID_PUNCTUATION, VALID_DIGITS, WHITESPACE } from './constants';\nimport parse from './parse_';\nimport { VALID_PHONE_NUMBER_WITH_EXTENSION } from './helpers/isViablePhoneNumber';\nimport createExtensionPattern from './helpers/extension/createExtensionPattern';\nimport parsePreCandidate from './findNumbers/parsePreCandidate';\nimport isValidPreCandidate from './findNumbers/isValidPreCandidate';\nimport isValidCandidate from './findNumbers/isValidCandidate';\n/**\r\n * Regexp of all possible ways to write extensions, for use when parsing. This\r\n * will be run as a case-insensitive regexp match. Wide character versions are\r\n * also provided after each ASCII version. There are three regular expressions\r\n * here. The first covers RFC 3966 format, where the extension is added using\r\n * ';ext='. The second more generic one starts with optional white space and\r\n * ends with an optional full stop (.), followed by zero or more spaces/tabs\r\n * /commas and then the numbers themselves. The other one covers the special\r\n * case of American numbers where the extension is written with a hash at the\r\n * end, such as '- 503#'. Note that the only capturing groups should be around\r\n * the digits that you want to capture as part of the extension, or else parsing\r\n * will fail! We allow two options for representing the accented o - the\r\n * character itself, and one in the unicode decomposed form with the combining\r\n * acute accent.\r\n */\n\nexport var EXTN_PATTERNS_FOR_PARSING = createExtensionPattern('parsing');\nvar WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp('^[' + WHITESPACE + ']+');\nvar PUNCTUATION_IN_THE_END_PATTERN = new RegExp('[' + VALID_PUNCTUATION + ']+$'); // // Regular expression for getting opening brackets for a valid number\n// // found using `PHONE_NUMBER_START_PATTERN` for prepending those brackets to the number.\n// const BEFORE_NUMBER_DIGITS_PUNCTUATION = new RegExp('[' + OPENING_BRACKETS + ']+' + '[' + WHITESPACE + ']*' + '$')\n\nvar VALID_PRECEDING_CHARACTER_PATTERN = /[^a-zA-Z0-9]/;\nexport default function findPhoneNumbers(text, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n var search = new PhoneNumberSearch(text, options, metadata);\n var phones = [];\n\n while (search.hasNext()) {\n phones.push(search.next());\n }\n\n return phones;\n}\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\n\nexport function searchPhoneNumbers(text, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n var search = new PhoneNumberSearch(text, options, metadata);\n return _defineProperty({}, Symbol.iterator, function () {\n return {\n next: function next() {\n if (search.hasNext()) {\n return {\n done: false,\n value: search.next()\n };\n }\n\n return {\n done: true\n };\n }\n };\n });\n}\n/**\r\n * Extracts a parseable phone number including any opening brackets, etc.\r\n * @param {string} text - Input.\r\n * @return {object} `{ ?number, ?startsAt, ?endsAt }`.\r\n */\n\nexport var PhoneNumberSearch =\n/*#__PURE__*/\nfunction () {\n // Iteration tristate.\n function PhoneNumberSearch(text, options, metadata) {\n _classCallCheck(this, PhoneNumberSearch);\n\n _defineProperty(this, \"state\", 'NOT_READY');\n\n this.text = text; // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n\n this.options = options || {};\n this.metadata = metadata;\n this.regexp = new RegExp(VALID_PHONE_NUMBER_WITH_EXTENSION, 'ig');\n }\n\n _createClass(PhoneNumberSearch, [{\n key: \"find\",\n value: function find() {\n var matches = this.regexp.exec(this.text);\n\n if (!matches) {\n return;\n }\n\n var number = matches[0];\n var startsAt = matches.index;\n number = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, '');\n startsAt += matches[0].length - number.length; // Fixes not parsing numbers with whitespace in the end.\n // Also fixes not parsing numbers with opening parentheses in the end.\n // https://github.com/catamphetamine/libphonenumber-js/issues/252\n\n number = number.replace(PUNCTUATION_IN_THE_END_PATTERN, '');\n number = parsePreCandidate(number);\n var result = this.parseCandidate(number, startsAt);\n\n if (result) {\n return result;\n } // Tail recursion.\n // Try the next one if this one is not a valid phone number.\n\n\n return this.find();\n }\n }, {\n key: \"parseCandidate\",\n value: function parseCandidate(number, startsAt) {\n if (!isValidPreCandidate(number, startsAt, this.text)) {\n return;\n } // Don't parse phone numbers which are non-phone numbers\n // due to being part of something else (e.g. a UUID).\n // https://github.com/catamphetamine/libphonenumber-js/issues/213\n // Copy-pasted from Google's `PhoneNumberMatcher.js` (`.parseAndValidate()`).\n\n\n if (!isValidCandidate(number, startsAt, this.text, this.options.extended ? 'POSSIBLE' : 'VALID')) {\n return;\n } // // Prepend any opening brackets left behind by the\n // // `PHONE_NUMBER_START_PATTERN` regexp.\n // const text_before_number = text.slice(this.searching_from, startsAt)\n // const full_number_starts_at = text_before_number.search(BEFORE_NUMBER_DIGITS_PUNCTUATION)\n // if (full_number_starts_at >= 0)\n // {\n // \tnumber = text_before_number.slice(full_number_starts_at) + number\n // \tstartsAt = full_number_starts_at\n // }\n //\n // this.searching_from = matches.lastIndex\n\n\n var result = parse(number, this.options, this.metadata);\n\n if (!result.phone) {\n return;\n }\n\n result.startsAt = startsAt;\n result.endsAt = startsAt + number.length;\n return result;\n }\n }, {\n key: \"hasNext\",\n value: function hasNext() {\n if (this.state === 'NOT_READY') {\n this.last_match = this.find();\n\n if (this.last_match) {\n this.state = 'READY';\n } else {\n this.state = 'DONE';\n }\n }\n\n return this.state === 'READY';\n }\n }, {\n key: \"next\",\n value: function next() {\n // Check the state and find the next match as a side-effect if necessary.\n if (!this.hasNext()) {\n throw new Error('No next element');\n } // Don't retain that memory any longer than necessary.\n\n\n var result = this.last_match;\n this.last_match = null;\n this.state = 'NOT_READY';\n return result;\n }\n }]);\n\n return PhoneNumberSearch;\n}();\n//# sourceMappingURL=findPhoneNumbers_.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport _formatNumber from './format_';\nimport parse from './parse_';\nexport default function formatNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n format = _normalizeArguments.format,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _formatNumber(input, format, options, metadata);\n} // Sort out arguments\n\nfunction normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 5),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3],\n arg_5 = _Array$prototype$slic2[4];\n\n var input;\n var format;\n var options;\n var metadata; // Sort out arguments.\n // If the phone number is passed as a string.\n // `format('8005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n // If country code is supplied.\n // `format('8005553535', 'RU', 'NATIONAL', [options], metadata)`.\n if (typeof arg_3 === 'string') {\n format = arg_3;\n\n if (arg_5) {\n options = arg_4;\n metadata = arg_5;\n } else {\n metadata = arg_4;\n }\n\n input = parse(arg_1, {\n defaultCountry: arg_2,\n extended: true\n }, metadata);\n } // Just an international phone number is supplied\n // `format('+78005553535', 'NATIONAL', [options], metadata)`.\n else {\n if (typeof arg_2 !== 'string') {\n throw new Error('`format` argument not passed to `formatNumber(number, format)`');\n }\n\n format = arg_2;\n\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n\n input = parse(arg_1, {\n extended: true\n }, metadata);\n }\n } // If the phone number is passed as a parsed number object.\n // `format({ phone: '8005553535', country: 'RU' }, 'NATIONAL', [options], metadata)`.\n else if (is_object(arg_1)) {\n input = arg_1;\n format = arg_2;\n\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.'); // Legacy lowercase formats.\n\n\n if (format === 'International') {\n format = 'INTERNATIONAL';\n } else if (format === 'National') {\n format = 'NATIONAL';\n }\n\n return {\n input: input,\n format: format,\n options: options,\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=format.js.map","import AsYouType from './AsYouType';\n/**\r\n * Formats a (possibly incomplete) phone number.\r\n * The phone number can be either in E.164 format\r\n * or in a form of national number digits.\r\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\r\n * @param {string?} country - Two-letter (\"ISO 3166-1 alpha-2\") country code.\r\n * @return {string} Formatted (possibly incomplete) phone number.\r\n */\n\nexport default function formatIncompletePhoneNumber(value, country, metadata) {\n if (!metadata) {\n metadata = country;\n country = undefined;\n }\n\n return new AsYouType(country, metadata).input(value);\n}\n//# sourceMappingURL=formatIncompletePhoneNumber.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\nimport matchesEntirely from './helpers/matchesEntirely';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat';\nimport Metadata, { getCountryCallingCode } from './metadata';\nimport getIddPrefix from './helpers/getIddPrefix';\nimport { formatRFC3966 } from './helpers/RFC3966';\nvar DEFAULT_OPTIONS = {\n formatExtension: function formatExtension(formattedNumber, extension, metadata) {\n return \"\".concat(formattedNumber).concat(metadata.ext()).concat(extension);\n } // Formats a phone number\n //\n // Example use cases:\n //\n // ```js\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL')\n // formatNumber('8005553535', 'RU', 'INTERNATIONAL', metadata)\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL')\n // formatNumber({ phone: '8005553535', country: 'RU' }, 'INTERNATIONAL', metadata)\n // formatNumber('+78005553535', 'NATIONAL')\n // formatNumber('+78005553535', 'NATIONAL', metadata)\n // ```\n //\n\n};\nexport default function formatNumber(input, format, options, metadata) {\n // Apply default options.\n if (options) {\n options = _objectSpread({}, DEFAULT_OPTIONS, options);\n } else {\n options = DEFAULT_OPTIONS;\n }\n\n metadata = new Metadata(metadata);\n\n if (input.country && input.country !== '001') {\n // Validate `input.country`.\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else if (input.countryCallingCode) {\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else return input.phone || '';\n\n var countryCallingCode = metadata.countryCallingCode();\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // This variable should have been declared inside `case`s\n // but Babel has a bug and it says \"duplicate variable declaration\".\n\n var number;\n\n switch (format) {\n case 'NATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return '';\n }\n\n number = formatNationalNumber(nationalNumber, input.carrierCode, 'NATIONAL', metadata, options);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'INTERNATIONAL':\n // Legacy argument support.\n // (`{ country: ..., phone: '' }`)\n if (!nationalNumber) {\n return \"+\".concat(countryCallingCode);\n }\n\n number = formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata, options);\n number = \"+\".concat(countryCallingCode, \" \").concat(number);\n return addExtension(number, input.ext, metadata, options.formatExtension);\n\n case 'E.164':\n // `E.164` doesn't define \"phone number extensions\".\n return \"+\".concat(countryCallingCode).concat(nationalNumber);\n\n case 'RFC3966':\n return formatRFC3966({\n number: \"+\".concat(countryCallingCode).concat(nationalNumber),\n ext: input.ext\n });\n // For reference, here's Google's IDD formatter:\n // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546\n // Not saying that this IDD formatter replicates it 1:1, but it seems to work.\n // Who would even need to format phone numbers in IDD format anyway?\n\n case 'IDD':\n if (!options.fromCountry) {\n return; // throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n }\n\n var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);\n return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);\n\n default:\n throw new Error(\"Unknown \\\"format\\\" argument passed to \\\"formatNumber()\\\": \\\"\".concat(format, \"\\\"\"));\n }\n}\n\nfunction formatNationalNumber(number, carrierCode, formatAs, metadata, options) {\n var format = chooseFormatForNumber(metadata.formats(), number);\n\n if (!format) {\n return number;\n }\n\n return formatNationalNumberUsingFormat(number, format, {\n useInternationalFormat: formatAs === 'INTERNATIONAL',\n withNationalPrefix: format.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,\n carrierCode: carrierCode,\n metadata: metadata\n });\n}\n\nfunction chooseFormatForNumber(availableFormats, nationalNnumber) {\n for (var _iterator = availableFormats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var format = _ref;\n\n // Validate leading digits\n if (format.leadingDigitsPatterns().length > 0) {\n // The last leading_digits_pattern is used here, as it is the most detailed\n var lastLeadingDigitsPattern = format.leadingDigitsPatterns()[format.leadingDigitsPatterns().length - 1]; // If leading digits don't match then move on to the next phone number format\n\n if (nationalNnumber.search(lastLeadingDigitsPattern) !== 0) {\n continue;\n }\n } // Check that the national number matches the phone number format regular expression\n\n\n if (matchesEntirely(nationalNnumber, format.pattern())) {\n return format;\n }\n }\n}\n\nfunction addExtension(formattedNumber, ext, metadata, formatExtension) {\n return ext ? formatExtension(formattedNumber, ext, metadata) : formattedNumber;\n}\n\nfunction formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {\n var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata); // When calling within the same country calling code.\n\n if (fromCountryCallingCode === countryCallingCode) {\n var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, 'NATIONAL', metadata); // For NANPA regions, return the national format for these regions\n // but prefix it with the country calling code.\n\n if (countryCallingCode === '1') {\n return countryCallingCode + ' ' + formattedNumber;\n } // If regions share a country calling code, the country calling code need\n // not be dialled. This also applies when dialling within a region, so this\n // if clause covers both these cases. Technically this is the case for\n // dialling from La Reunion to other overseas departments of France (French\n // Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n // this edge case for now and for those cases return the version including\n // country calling code. Details here:\n // http://www.petitfute.com/voyage/225-info-pratiques-reunion\n //\n\n\n return formattedNumber;\n }\n\n var iddPrefix = getIddPrefix(fromCountry, undefined, metadata.metadata);\n\n if (iddPrefix) {\n return \"\".concat(iddPrefix, \" \").concat(countryCallingCode, \" \").concat(formatNationalNumber(nationalNumber, null, 'INTERNATIONAL', metadata));\n }\n}\n//# sourceMappingURL=format_.js.map","import Metadata from './metadata';\nexport default function getCountries(metadata) {\n return new Metadata(metadata).getCountries();\n}\n//# sourceMappingURL=getCountries.js.map","// Deprecated. Import from 'metadata.js' directly instead.\nexport { getCountryCallingCode as default } from './metadata';\n//# sourceMappingURL=getCountryCallingCode.js.map","import PhoneNumber from './PhoneNumber';\nexport default function getExampleNumber(country, examples, metadata) {\n if (examples[country]) {\n return new PhoneNumber(country, examples[country], metadata);\n }\n}\n//# sourceMappingURL=getExampleNumber.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport isViablePhoneNumber from './helpers/isViablePhoneNumber';\nimport _getNumberType from './helpers/getNumberType';\nimport parse from './parse_'; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function getNumberType() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _getNumberType(input, options, metadata);\n} // Sort out arguments\n\nexport function normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var input;\n var options = {};\n var metadata; // If the phone number is passed as a string.\n // `getNumberType('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n // If \"default country\" argument is being passed\n // then convert it to an `options` object.\n // `getNumberType('88005553535', 'RU', metadata)`.\n if (_typeof(arg_2) !== 'object') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n metadata = arg_3;\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n if (isViablePhoneNumber(arg_1)) {\n input = parse(arg_1, {\n defaultCountry: arg_2\n }, metadata);\n } else {\n input = {};\n }\n } // No \"resrict country\" argument is being passed.\n // International phone number is passed.\n // `getNumberType('+78005553535', metadata)`.\n else {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n if (isViablePhoneNumber(arg_1)) {\n input = parse(arg_1, undefined, metadata);\n } else {\n input = {};\n }\n }\n } // If the phone number is passed as a parsed phone number.\n // `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`.\n else if (is_object(arg_1)) {\n input = arg_1;\n\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n return {\n input: input,\n options: options,\n metadata: metadata\n };\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=getNumberType.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport isViablePhoneNumber from './isViablePhoneNumber'; // https://www.ietf.org/rfc/rfc3966.txt\n\n/**\r\n * @param {string} text - Phone URI (RFC 3966).\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\nexport function parseRFC3966(text) {\n var number;\n var ext; // Replace \"tel:\" with \"tel=\" for parsing convenience.\n\n text = text.replace(/^tel:/, 'tel=');\n\n for (var _iterator = text.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var part = _ref;\n\n var _part$split = part.split('='),\n _part$split2 = _slicedToArray(_part$split, 2),\n name = _part$split2[0],\n value = _part$split2[1];\n\n switch (name) {\n case 'tel':\n number = value;\n break;\n\n case 'ext':\n ext = value;\n break;\n\n case 'phone-context':\n // Only \"country contexts\" are supported.\n // \"Domain contexts\" are ignored.\n if (value[0] === '+') {\n number = value + number;\n }\n\n break;\n }\n } // If the phone number is not viable, then abort.\n\n\n if (!isViablePhoneNumber(number)) {\n return {};\n }\n\n var result = {\n number: number\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\n\nexport function formatRFC3966(_ref2) {\n var number = _ref2.number,\n ext = _ref2.ext;\n\n if (!number) {\n return '';\n }\n\n if (number[0] !== '+') {\n throw new Error(\"\\\"formatRFC3966()\\\" expects \\\"number\\\" to be in E.164 format.\");\n }\n\n return \"tel:\".concat(number).concat(ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","import { VALID_PUNCTUATION } from '../constants'; // Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\n// For some reason Google's metadata contains ``s with brackets and dashes.\n// Meanwhile, there's no single opinion about using punctuation in international phone numbers.\n//\n// For example, Google's `` for USA is `+1 213-373-4253`.\n// And here's a quote from WikiPedia's \"North American Numbering Plan\" page:\n// https://en.wikipedia.org/wiki/North_American_Numbering_Plan\n//\n// \"The country calling code for all countries participating in the NANP is 1.\n// In international format, an NANP number should be listed as +1 301 555 01 00,\n// where 301 is an area code (Maryland).\"\n//\n// I personally prefer the international format without any punctuation.\n// For example, brackets are remnants of the old age, meaning that the\n// phone number part in brackets (so called \"area code\") can be omitted\n// if dialing within the same \"area\".\n// And hyphens were clearly introduced for splitting local numbers into memorizable groups.\n// For example, remembering \"5553535\" is difficult but \"555-35-35\" is much simpler.\n// Imagine a man taking a bus from home to work and seeing an ad with a phone number.\n// He has a couple of seconds to memorize that number until it passes by.\n// If it were spaces instead of hyphens the man wouldn't necessarily get it,\n// but with hyphens instead of spaces the grouping is more explicit.\n// I personally think that hyphens introduce visual clutter,\n// so I prefer replacing them with spaces in international numbers.\n// In the modern age all output is done on displays where spaces are clearly distinguishable\n// so hyphens can be safely replaced with spaces without losing any legibility.\n//\n\nexport default function applyInternationalSeparatorStyle(formattedNumber) {\n return formattedNumber.replace(new RegExp(\"[\".concat(VALID_PUNCTUATION, \"]+\"), 'g'), ' ').trim();\n}\n//# sourceMappingURL=applyInternationalSeparatorStyle.js.map","import mergeArrays from './mergeArrays';\nexport default function checkNumberLength(nationalNumber, metadata) {\n return checkNumberLengthForType(nationalNumber, undefined, metadata);\n} // Checks whether a number is possible for the country based on its length.\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\n\nexport function checkNumberLengthForType(nationalNumber, type, metadata) {\n var type_info = metadata.type(type); // There should always be \"\" set for every type element.\n // This is declared in the XML schema.\n // For size efficiency, where a sub-description (e.g. fixed-line)\n // has the same \"\" as the \"general description\", this is missing,\n // so we fall back to the \"general description\". Where no numbers of the type\n // exist at all, there is one possible length (-1) which is guaranteed\n // not to match the length of any real phone number.\n\n var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths(); // let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n // Metadata before version `1.0.18` didn't contain `possible_lengths`.\n\n if (!possible_lengths) {\n return 'IS_POSSIBLE';\n }\n\n if (type === 'FIXED_LINE_OR_MOBILE') {\n // No such country in metadata.\n\n /* istanbul ignore next */\n if (!metadata.type('FIXED_LINE')) {\n // The rare case has been encountered where no fixedLine data is available\n // (true for some non-geographic entities), so we just check mobile.\n return checkNumberLengthForType(nationalNumber, 'MOBILE', metadata);\n }\n\n var mobile_type = metadata.type('MOBILE');\n\n if (mobile_type) {\n // Merge the mobile data in if there was any. \"Concat\" creates a new\n // array, it doesn't edit possible_lengths in place, so we don't need a copy.\n // Note that when adding the possible lengths from mobile, we have\n // to again check they aren't empty since if they are this indicates\n // they are the same as the general desc and should be obtained from there.\n possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths()); // The current list is sorted; we need to merge in the new list and\n // re-sort (duplicates are okay). Sorting isn't so expensive because\n // the lists are very small.\n // if (local_lengths) {\n // \tlocal_lengths = mergeArrays(local_lengths, mobile_type.possibleLengthsLocal())\n // } else {\n // \tlocal_lengths = mobile_type.possibleLengthsLocal()\n // }\n }\n } // If the type doesn't exist then return 'INVALID_LENGTH'.\n else if (type && !type_info) {\n return 'INVALID_LENGTH';\n }\n\n var actual_length = nationalNumber.length; // In `libphonenumber-js` all \"local-only\" formats are dropped for simplicity.\n // // This is safe because there is never an overlap beween the possible lengths\n // // and the local-only lengths; this is checked at build time.\n // if (local_lengths && local_lengths.indexOf(nationalNumber.length) >= 0)\n // {\n // \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n // }\n\n var minimum_length = possible_lengths[0];\n\n if (minimum_length === actual_length) {\n return 'IS_POSSIBLE';\n }\n\n if (minimum_length > actual_length) {\n return 'TOO_SHORT';\n }\n\n if (possible_lengths[possible_lengths.length - 1] < actual_length) {\n return 'TOO_LONG';\n } // We skip the first element since we've already checked it.\n\n\n return possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n//# sourceMappingURL=checkNumberLength.js.map","import { VALID_DIGITS } from '../../constants'; // The RFC 3966 format for extensions.\n\nvar RFC3966_EXTN_PREFIX = ';ext=';\n/**\r\n * Helper method for constructing regular expressions for parsing. Creates\r\n * an expression that captures up to max_length digits.\r\n * @return {string} RegEx pattern to capture extension digits.\r\n */\n\nvar getExtensionDigitsPattern = function getExtensionDigitsPattern(maxLength) {\n return \"([\".concat(VALID_DIGITS, \"]{1,\").concat(maxLength, \"})\");\n};\n/**\r\n * Helper initialiser method to create the regular-expression pattern to match\r\n * extensions.\r\n * Copy-pasted from Google's `libphonenumber`:\r\n * https://github.com/google/libphonenumber/blob/55b2646ec9393f4d3d6661b9c82ef9e258e8b829/javascript/i18n/phonenumbers/phonenumberutil.js#L759-L766\r\n * @return {string} RegEx pattern to capture extensions.\r\n */\n\n\nexport default function createExtensionPattern(purpose) {\n // We cap the maximum length of an extension based on the ambiguity of the way\n // the extension is prefixed. As per ITU, the officially allowed length for\n // extensions is actually 40, but we don't support this since we haven't seen real\n // examples and this introduces many false interpretations as the extension labels\n // are not standardized.\n\n /** @type {string} */\n var extLimitAfterExplicitLabel = '20';\n /** @type {string} */\n\n var extLimitAfterLikelyLabel = '15';\n /** @type {string} */\n\n var extLimitAfterAmbiguousChar = '9';\n /** @type {string} */\n\n var extLimitWhenNotSure = '6';\n /** @type {string} */\n\n var possibleSeparatorsBetweenNumberAndExtLabel = \"[ \\xA0\\\\t,]*\"; // Optional full stop (.) or colon, followed by zero or more spaces/tabs/commas.\n\n /** @type {string} */\n\n var possibleCharsAfterExtLabel = \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\";\n /** @type {string} */\n\n var optionalExtnSuffix = \"#?\"; // Here the extension is called out in more explicit way, i.e mentioning it obvious\n // patterns like \"ext.\".\n\n /** @type {string} */\n\n var explicitExtLabels = \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\\u0434\\u043E\\u0431|anexo)\"; // One-character symbols that can be used to indicate an extension, and less\n // commonly used or more ambiguous extension labels.\n\n /** @type {string} */\n\n var ambiguousExtLabels = \"(?:[x\\uFF58#\\uFF03~\\uFF5E]|int|\\uFF49\\uFF4E\\uFF54)\"; // When extension is not separated clearly.\n\n /** @type {string} */\n\n var ambiguousSeparator = \"[- ]+\"; // This is the same as possibleSeparatorsBetweenNumberAndExtLabel, but not matching\n // comma as extension label may have it.\n\n /** @type {string} */\n\n var possibleSeparatorsNumberExtLabelNoComma = \"[ \\xA0\\\\t]*\"; // \",,\" is commonly used for auto dialling the extension when connected. First\n // comma is matched through possibleSeparatorsBetweenNumberAndExtLabel, so we do\n // not repeat it here. Semi-colon works in Iphone and Android also to pop up a\n // button with the extension number following.\n\n /** @type {string} */\n\n var autoDiallingAndExtLabelsFound = \"(?:,{2}|;)\";\n /** @type {string} */\n\n var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);\n /** @type {string} */\n\n var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;\n /** @type {string} */\n\n var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + \"#\";\n /** @type {string} */\n\n var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;\n /** @type {string} */\n\n var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + \"(?:,)+\" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix; // The first regular expression covers RFC 3966 format, where the extension is added\n // using \";ext=\". The second more generic where extension is mentioned with explicit\n // labels like \"ext:\". In both the above cases we allow more numbers in extension than\n // any other extension labels. The third one captures when single character extension\n // labels or less commonly used labels are used. In such cases we capture fewer\n // extension digits in order to reduce the chance of falsely interpreting two\n // numbers beside each other as a number + extension. The fourth one covers the\n // special case of American numbers where the extension is written with a hash\n // at the end, such as \"- 503#\". The fifth one is exclusively for extension\n // autodialling formats which are used when dialling and in this case we accept longer\n // extensions. The last one is more liberal on the number of commas that acts as\n // extension labels, so we have a strict cap on the number of digits in such extensions.\n\n return rfcExtn + \"|\" + explicitExtn + \"|\" + ambiguousExtn + \"|\" + americanStyleExtnWithSuffix + \"|\" + autoDiallingExtn + \"|\" + onlyCommasExtn;\n}\n//# sourceMappingURL=createExtensionPattern.js.map","import createExtensionPattern from './createExtensionPattern'; // Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\n\nvar EXTN_PATTERN = new RegExp('(?:' + createExtensionPattern() + ')$', 'i'); // Strips any extension (as in, the part of the number dialled after the call is\n// connected, usually indicated with extn, ext, x or similar) from the end of\n// the number, and returns it.\n\nexport default function extractExtension(number) {\n var start = number.search(EXTN_PATTERN);\n\n if (start < 0) {\n return {};\n } // If we find a potential extension, and the number preceding this is a viable\n // number, we assume it is an extension.\n\n\n var numberWithoutExtension = number.slice(0, start);\n var matches = number.match(EXTN_PATTERN);\n var i = 1;\n\n while (i < matches.length) {\n if (matches[i]) {\n return {\n number: numberWithoutExtension,\n ext: matches[i]\n };\n }\n\n i++;\n }\n}\n//# sourceMappingURL=extractExtension.js.map","import stripIddPrefix from './stripIddPrefix';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport Metadata from '../metadata';\nimport { MAX_LENGTH_COUNTRY_CODE } from '../constants';\n/**\r\n * Converts a phone number digits (possibly with a `+`)\r\n * into a calling code and the rest phone number digits.\r\n * The \"rest phone number digits\" could include\r\n * a national prefix, carrier code, and national\r\n * (significant) number.\r\n * @param {string} number — Phone number digits (possibly with a `+`).\r\n * @param {string} [country] — Default country.\r\n * @param {string} [callingCode] — Default calling code (some phone numbering plans are non-geographic).\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`\r\n * @example\r\n * // Returns `{ countryCallingCode: \"1\", number: \"2133734253\" }`.\r\n * extractCountryCallingCode('2133734253', 'US', null, metadata)\r\n * extractCountryCallingCode('2133734253', null, '1', metadata)\r\n * extractCountryCallingCode('+12133734253', null, null, metadata)\r\n * extractCountryCallingCode('+12133734253', 'RU', null, metadata)\r\n */\n\nexport default function extractCountryCallingCode(number, country, callingCode, metadata) {\n if (!number) {\n return {};\n } // If this is not an international phone number,\n // then either extract an \"IDD\" prefix, or extract a\n // country calling code from a number by autocorrecting it\n // by prepending a leading `+` in cases when it starts\n // with the country calling code.\n // https://wikitravel.org/en/International_dialling_prefix\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n\n\n if (number[0] !== '+') {\n // Convert an \"out-of-country\" dialing phone number\n // to a proper international phone number.\n var numberWithoutIDD = stripIddPrefix(number, country, callingCode, metadata); // If an IDD prefix was stripped then\n // convert the number to international one\n // for subsequent parsing.\n\n if (numberWithoutIDD && numberWithoutIDD !== number) {\n number = '+' + numberWithoutIDD;\n } else {\n // Check to see if the number starts with the country calling code\n // for the default country. If so, we remove the country calling code,\n // and do some checks on the validity of the number before and after.\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n if (country || callingCode) {\n var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n shorterNumber = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n return {\n countryCallingCode: countryCallingCode,\n number: shorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n }\n } // Fast abortion: country codes do not begin with a '0'\n\n\n if (number[1] === '0') {\n return {};\n }\n\n metadata = new Metadata(metadata); // The thing with country phone codes\n // is that they are orthogonal to each other\n // i.e. there's no such country phone code A\n // for which country phone code B exists\n // where B starts with A.\n // Therefore, while scanning digits,\n // if a valid country code is found,\n // that means that it is the country code.\n //\n\n var i = 2;\n\n while (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n var _countryCallingCode = number.slice(1, i);\n\n if (metadata.hasCallingCode(_countryCallingCode)) {\n metadata.selectNumberingPlan(_countryCallingCode);\n return {\n countryCallingCode: _countryCallingCode,\n number: number.slice(i)\n };\n }\n\n i++;\n }\n\n return {};\n}\n//# sourceMappingURL=extractCountryCallingCode.js.map","import Metadata from '../metadata';\nimport matchesEntirely from './matchesEntirely';\nimport extractNationalNumber from './extractNationalNumber';\nimport checkNumberLength from './checkNumberLength';\nimport getCountryCallingCode from '../getCountryCallingCode';\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string?} country\r\n * @param {string?} callingCode\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\n\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, callingCode, metadata) {\n var countryCallingCode = country ? getCountryCallingCode(country, metadata) : callingCode;\n\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country, callingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n\n var _extractNationalNumbe2 = extractNationalNumber(number, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber; // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map","import extractNationalNumberFromPossiblyIncompleteNumber from './extractNationalNumberFromPossiblyIncompleteNumber';\nimport matchesEntirely from './matchesEntirely';\nimport checkNumberLength from './checkNumberLength';\n/**\r\n * Strips national prefix and carrier code from a complete phone number.\r\n * The difference from the non-\"FromCompleteNumber\" function is that\r\n * it won't extract national prefix if the resultant number is too short\r\n * to be a complete number for the selected phone numbering plan.\r\n * @param {string} number — Complete phone number digits.\r\n * @param {Metadata} metadata — Metadata with a phone numbering plan selected.\r\n * @return {object} `{ nationalNumber: string, carrierCode: string? }`.\r\n */\n\nexport default function extractNationalNumber(number, metadata) {\n // Parsing national prefixes and carrier codes\n // is only required for local phone numbers\n // but some people don't understand that\n // and sometimes write international phone numbers\n // with national prefixes (or maybe even carrier codes).\n // http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n // Google's original library forgives such mistakes\n // and so does this library, because it has been requested:\n // https://github.com/catamphetamine/libphonenumber-js/issues/127\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (!shouldExtractNationalPrefix(number, nationalNumber, metadata)) {\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n } // If a national prefix has been extracted, check to see\n // if the resultant number isn't too short.\n // Same code in Google's `libphonenumber`:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3291-L3302\n // For some reason, they do this check right after the `national_number_pattern` check\n // this library does in `shouldExtractNationalPrefix()` function.\n // Why is there a second \"resultant\" number validity check?\n // They don't provide an explanation.\n // This library just copies the behavior.\n\n\n if (number.length !== nationalNumber.length + (carrierCode ? carrierCode.length : 0)) {\n // If not using legacy generated metadata (before version `1.0.18`)\n // then it has \"possible lengths\", so use those to validate the number length.\n if (metadata.possibleLengths()) {\n // \"We require that the NSN remaining after stripping the national prefix and\n // carrier code be long enough to be a possible length for the region.\n // Otherwise, we don't do the stripping, since the original number could be\n // a valid short number.\"\n // https://github.com/google/libphonenumber/blob/876268eb1ad6cdc1b7b5bef17fc5e43052702d57/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3236-L3250\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'TOO_SHORT':\n case 'INVALID_LENGTH':\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // Don't strip the national prefix.\n return {\n nationalNumber: number\n };\n }\n }\n }\n\n return {\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n} // In some countries, the same digit could be a national prefix\n// or a leading digit of a valid phone number.\n// For example, in Russia, national prefix is `8`,\n// and also `800 555 35 35` is a valid number\n// in which `8` is not a national prefix, but the first digit\n// of a national (significant) number.\n// Same's with Belarus:\n// `82004910060` is a valid national (significant) number,\n// but `2004910060` is not.\n// To support such cases (to prevent the code from always stripping\n// national prefix), a condition is imposed: a national prefix\n// is not extracted when the original number is \"viable\" and the\n// resultant number is not, a \"viable\" national number being the one\n// that matches `national_number_pattern`.\n\nfunction shouldExtractNationalPrefix(number, nationalSignificantNumber, metadata) {\n // The equivalent in Google's code is:\n // https://github.com/google/libphonenumber/blob/e326fa1fc4283bb05eb35cb3c15c18f98a31af33/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2969-L3004\n if (matchesEntirely(number, metadata.nationalNumberPattern()) && !matchesEntirely(nationalSignificantNumber, metadata.nationalNumberPattern())) {\n return false;\n } // Just \"possible\" number check would be more relaxed, so it's not used.\n // if (isPossibleNumber(number, metadata) &&\n // \t!isPossibleNumber(numberWithNationalPrefixExtracted, metadata)) {\n // \treturn false\n // }\n\n\n return true;\n}\n//# sourceMappingURL=extractNationalNumber.js.map","/**\r\n * Strips any national prefix (such as 0, 1) present in a\r\n * (possibly incomplete) number provided.\r\n * \"Carrier codes\" are only used in Colombia and Brazil,\r\n * and only when dialing within those countries from a mobile phone to a fixed line number.\r\n * Sometimes it won't actually strip national prefix\r\n * and will instead prepend some digits to the `number`:\r\n * for example, when number `2345678` is passed with `VI` country selected,\r\n * it will return `{ number: \"3402345678\" }`, because `340` area code is prepended.\r\n * @param {string} number — National number digits.\r\n * @param {object} metadata — Metadata with country selected.\r\n * @return {object} `{ nationalNumber: string, nationalPrefix: string? carrierCode: string? }`.\r\n */\nexport default function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {\n if (number && metadata.numberingPlan.nationalPrefixForParsing()) {\n // See METADATA.md for the description of\n // `national_prefix_for_parsing` and `national_prefix_transform_rule`.\n // Attempt to parse the first digits as a national prefix.\n var prefixPattern = new RegExp('^(?:' + metadata.numberingPlan.nationalPrefixForParsing() + ')');\n var prefixMatch = prefixPattern.exec(number);\n\n if (prefixMatch) {\n var nationalNumber;\n var carrierCode; // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n // If a `national_prefix_for_parsing` has any \"capturing groups\"\n // then it means that the national (significant) number is equal to\n // those \"capturing groups\" transformed via `national_prefix_transform_rule`,\n // and nothing could be said about the actual national prefix:\n // what is it and was it even there.\n // If a `national_prefix_for_parsing` doesn't have any \"capturing groups\",\n // then everything it matches is a national prefix.\n // To determine whether `national_prefix_for_parsing` matched any\n // \"capturing groups\", the value of the result of calling `.exec()`\n // is looked at, and if it has non-undefined values where there're\n // \"capturing groups\" in the regular expression, then it means\n // that \"capturing groups\" have been matched.\n // It's not possible to tell whether there'll be any \"capturing gropus\"\n // before the matching process, because a `national_prefix_for_parsing`\n // could exhibit both behaviors.\n\n var capturedGroupsCount = prefixMatch.length - 1;\n var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];\n\n if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {\n nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule()); // If there's more than one captured group,\n // then carrier code is the second one.\n\n if (capturedGroupsCount > 1) {\n carrierCode = prefixMatch[1];\n }\n } // If there're no \"capturing groups\",\n // or if there're \"capturing groups\" but no\n // `national_prefix_transform_rule`,\n // then just strip the national prefix from the number,\n // and possibly a carrier code.\n // Seems like there could be more.\n else {\n // `prefixBeforeNationalNumber` is the whole substring matched by\n // the `national_prefix_for_parsing` regular expression.\n // There seem to be no guarantees that it's just a national prefix.\n // For example, if there's a carrier code, it's gonna be a\n // part of `prefixBeforeNationalNumber` too.\n var prefixBeforeNationalNumber = prefixMatch[0];\n nationalNumber = number.slice(prefixBeforeNationalNumber.length); // If there's at least one captured group,\n // then carrier code is the first one.\n\n if (hasCapturedGroups) {\n carrierCode = prefixMatch[1];\n }\n } // Tries to guess whether a national prefix was present in the input.\n // This is not something copy-pasted from Google's library:\n // they don't seem to have an equivalent for that.\n // So this isn't an \"officially approved\" way of doing something like that.\n // But since there seems no other existing method, this library uses it.\n\n\n var nationalPrefix;\n\n if (hasCapturedGroups) {\n var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);\n var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup); // Example: an Argentinian (AR) phone number `0111523456789`.\n // `prefixMatch[0]` is `01115`, and `$1` is `11`,\n // and the rest of the phone number is `23456789`.\n // The national number is transformed via `9$1` to `91123456789`.\n // National prefix `0` is detected being present at the start.\n // if (possibleNationalPrefix.indexOf(metadata.numberingPlan.nationalPrefix()) === 0) {\n\n if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {\n nationalPrefix = metadata.numberingPlan.nationalPrefix();\n }\n } else {\n nationalPrefix = prefixMatch[0];\n }\n\n return {\n nationalNumber: nationalNumber,\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode\n };\n }\n }\n\n return {\n nationalNumber: number\n };\n}\n//# sourceMappingURL=extractNationalNumberFromPossiblyIncompleteNumber.js.map","import applyInternationalSeparatorStyle from './applyInternationalSeparatorStyle'; // This was originally set to $1 but there are some countries for which the\n// first group is not used in the national pattern (e.g. Argentina) so the $1\n// group does not match correctly. Therefore, we use `\\d`, so that the first\n// group actually used in the pattern will be matched.\n\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\nexport default function formatNationalNumberUsingFormat(number, format, _ref) {\n var useInternationalFormat = _ref.useInternationalFormat,\n withNationalPrefix = _ref.withNationalPrefix,\n carrierCode = _ref.carrierCode,\n metadata = _ref.metadata;\n var formattedNumber = number.replace(new RegExp(format.pattern()), useInternationalFormat ? format.internationalFormat() : // This library doesn't use `domestic_carrier_code_formatting_rule`,\n // because that one is only used when formatting phone numbers\n // for dialing from a mobile phone, and this is not a dialing library.\n // carrierCode && format.domesticCarrierCodeFormattingRule()\n // \t// First, replace the $CC in the formatting rule with the desired carrier code.\n // \t// Then, replace the $FG in the formatting rule with the first group\n // \t// and the carrier code combined in the appropriate way.\n // \t? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))\n // \t: (\n // \t\twithNationalPrefix && format.nationalPrefixFormattingRule()\n // \t\t\t? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())\n // \t\t\t: format.format()\n // \t)\n withNationalPrefix && format.nationalPrefixFormattingRule() ? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()) : format.format());\n\n if (useInternationalFormat) {\n return applyInternationalSeparatorStyle(formattedNumber);\n }\n\n return formattedNumber;\n}\n//# sourceMappingURL=formatNationalNumberUsingFormat.js.map","import Metadata from '../metadata';\nimport getNumberType from './getNumberType';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\nexport default function getCountryByCallingCode(callingCode, nationalPhoneNumber, metadata) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(callingCode)) {\n return '001';\n }\n } // Is always non-empty, because `callingCode` is always valid\n\n\n var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);\n\n if (!possibleCountries) {\n return;\n } // If there's just one country corresponding to the country code,\n // then just return it, without further phone number digits validation.\n\n\n if (possibleCountries.length === 1) {\n return possibleCountries[0];\n }\n\n return selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata.metadata);\n}\n\nfunction selectCountryFromList(possibleCountries, nationalPhoneNumber, metadata) {\n // Re-create `metadata` because it will be selecting a `country`.\n metadata = new Metadata(metadata);\n\n for (var _iterator = possibleCountries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var country = _ref;\n metadata.country(country); // Leading digits check would be the simplest one\n\n if (metadata.leadingDigits()) {\n if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {\n return country;\n }\n } // Else perform full validation with all of those\n // fixed-line/mobile/etc regular expressions.\n else if (getNumberType({\n phone: nationalPhoneNumber,\n country: country\n }, undefined, metadata.metadata)) {\n return country;\n }\n }\n}\n//# sourceMappingURL=getCountryByCallingCode.js.map","import Metadata from '../metadata';\n/**\r\n * Pattern that makes it easy to distinguish whether a region has a single\r\n * international dialing prefix or not. If a region has a single international\r\n * prefix (e.g. 011 in USA), it will be represented as a string that contains\r\n * a sequence of ASCII digits, and possibly a tilde, which signals waiting for\r\n * the tone. If there are multiple available international prefixes in a\r\n * region, they will be represented as a regex string that always contains one\r\n * or more characters that are not ASCII digits or a tilde.\r\n */\n\nvar SINGLE_IDD_PREFIX_REG_EXP = /^[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?$/; // For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\n\nexport default function getIddPrefix(country, callingCode, metadata) {\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n\n if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {\n return countryMetadata.IDDPrefix();\n }\n\n return countryMetadata.defaultIDDPrefix();\n}\n//# sourceMappingURL=getIddPrefix.js.map","import Metadata from '../metadata';\nimport matchesEntirely from './matchesEntirely';\nvar NON_FIXED_LINE_PHONE_TYPES = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL']; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function getNumberType(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {}; // When `parse()` returned `{}`\n // meaning that the phone number is not a valid one.\n\n if (!input.country) {\n return;\n }\n\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(input.country, input.countryCallingCode);\n var nationalNumber = options.v2 ? input.nationalNumber : input.phone; // The following is copy-pasted from the original function:\n // https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n // Is this national number even valid for this country\n\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {\n return;\n } // Is it fixed line number\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'FIXED_LINE', metadata)) {\n // Because duplicate regular expressions are removed\n // to reduce metadata size, if \"mobile\" pattern is \"\"\n // then it means it was removed due to being a duplicate of the fixed-line pattern.\n //\n if (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n return 'FIXED_LINE_OR_MOBILE';\n } // v1 metadata.\n // Legacy.\n // Deprecated.\n\n\n if (!metadata.type('MOBILE')) {\n return 'FIXED_LINE_OR_MOBILE';\n } // Check if the number happens to qualify as both fixed line and mobile.\n // (no such country in the minimal metadata set)\n\n /* istanbul ignore if */\n\n\n if (isNumberTypeEqualTo(nationalNumber, 'MOBILE', metadata)) {\n return 'FIXED_LINE_OR_MOBILE';\n }\n\n return 'FIXED_LINE';\n }\n\n for (var _i = 0, _NON_FIXED_LINE_PHONE = NON_FIXED_LINE_PHONE_TYPES; _i < _NON_FIXED_LINE_PHONE.length; _i++) {\n var type = _NON_FIXED_LINE_PHONE[_i];\n\n if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {\n return type;\n }\n }\n}\nexport function isNumberTypeEqualTo(nationalNumber, type, metadata) {\n type = metadata.type(type);\n\n if (!type || !type.pattern()) {\n return false;\n } // Check if any possible number lengths are present;\n // if so, we use them to avoid checking\n // the validation pattern if they don't match.\n // If they are absent, this means they match\n // the general description, which we have\n // already checked before a specific number type.\n\n\n if (type.possibleLengths() && type.possibleLengths().indexOf(nationalNumber.length) < 0) {\n return false;\n }\n\n return matchesEntirely(nationalNumber, type.pattern());\n}\n//# sourceMappingURL=getNumberType.js.map","import { MIN_LENGTH_FOR_NSN, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from '../constants';\nimport createExtensionPattern from './extension/createExtensionPattern'; // Regular expression of viable phone numbers. This is location independent.\n// Checks we have at least three leading digits, and only valid punctuation,\n// alpha characters and digits in the phone number. Does not include extension\n// data. The symbol 'x' is allowed here as valid punctuation since it is often\n// used as a placeholder for carrier codes, for example in Brazilian phone\n// numbers. We also allow multiple '+' characters at the start.\n//\n// Corresponds to the following:\n// [digits]{minLengthNsn}|\n// plus_sign*\n// (([punctuation]|[star])*[digits]){3,}([punctuation]|[star]|[digits]|[alpha])*\n//\n// The first reg-ex is to allow short numbers (two digits long) to be parsed if\n// they are entered as \"15\" etc, but only if there is no punctuation in them.\n// The second expression restricts the number of digits to three or more, but\n// then allows them to be in international form, and to have alpha-characters\n// and punctuation. We split up the two reg-exes here and combine them when\n// creating the reg-ex VALID_PHONE_NUMBER_PATTERN itself so we can prefix it\n// with ^ and append $ to each branch.\n//\n// \"Note VALID_PUNCTUATION starts with a -,\n// so must be the first in the range\" (c) Google devs.\n// (wtf did they mean by saying that; probably nothing)\n//\n\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}'; //\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\n\nexport var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\nexport var VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions\n'(?:' + createExtensionPattern() + ')?'; // The combined regular expression for valid phone numbers:\n//\n\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp( // Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' + // Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER_WITH_EXTENSION + '$', 'i'); // Checks to see if the string of characters could possibly be a phone number at\n// all. At the moment, checks to see that the string begins with at least 2\n// digits, ignoring any punctuation commonly found in phone numbers. This method\n// does not require the number to be normalized in advance - but does assume\n// that leading non-number symbols have been removed, such as by the method\n// `extract_possible_number`.\n//\n\nexport default function isViablePhoneNumber(number) {\n return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);\n}\n//# sourceMappingURL=isViablePhoneNumber.js.map","/**\r\n * Checks whether the entire input sequence can be matched\r\n * against the regular expression.\r\n * @return {boolean}\r\n */\nexport default function matchesEntirely(text, regular_expression) {\n // If assigning the `''` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n text = text || '';\n return new RegExp('^(?:' + regular_expression + ')$').test(text);\n}\n//# sourceMappingURL=matchesEntirely.js.map","/**\r\n * Merges two arrays.\r\n * @param {*} a\r\n * @param {*} b\r\n * @return {*}\r\n */\nexport default function mergeArrays(a, b) {\n var merged = a.slice();\n\n for (var _iterator = b, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var element = _ref;\n\n if (a.indexOf(element) < 0) {\n merged.push(element);\n }\n }\n\n return merged.sort(function (a, b) {\n return a - b;\n }); // ES6 version, requires Set polyfill.\n // let merged = new Set(a)\n // for (const element of b) {\n // \tmerged.add(i)\n // }\n // return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=mergeArrays.js.map","// These mappings map a character (key) to a specific digit that should\n// replace it for normalization purposes. Non-European digits that\n// may be used in phone numbers are mapped to a European equivalent.\n//\n// E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\n//\nexport var DIGITS = {\n '0': '0',\n '1': '1',\n '2': '2',\n '3': '3',\n '4': '4',\n '5': '5',\n '6': '6',\n '7': '7',\n '8': '8',\n '9': '9',\n \"\\uFF10\": '0',\n // Fullwidth digit 0\n \"\\uFF11\": '1',\n // Fullwidth digit 1\n \"\\uFF12\": '2',\n // Fullwidth digit 2\n \"\\uFF13\": '3',\n // Fullwidth digit 3\n \"\\uFF14\": '4',\n // Fullwidth digit 4\n \"\\uFF15\": '5',\n // Fullwidth digit 5\n \"\\uFF16\": '6',\n // Fullwidth digit 6\n \"\\uFF17\": '7',\n // Fullwidth digit 7\n \"\\uFF18\": '8',\n // Fullwidth digit 8\n \"\\uFF19\": '9',\n // Fullwidth digit 9\n \"\\u0660\": '0',\n // Arabic-indic digit 0\n \"\\u0661\": '1',\n // Arabic-indic digit 1\n \"\\u0662\": '2',\n // Arabic-indic digit 2\n \"\\u0663\": '3',\n // Arabic-indic digit 3\n \"\\u0664\": '4',\n // Arabic-indic digit 4\n \"\\u0665\": '5',\n // Arabic-indic digit 5\n \"\\u0666\": '6',\n // Arabic-indic digit 6\n \"\\u0667\": '7',\n // Arabic-indic digit 7\n \"\\u0668\": '8',\n // Arabic-indic digit 8\n \"\\u0669\": '9',\n // Arabic-indic digit 9\n \"\\u06F0\": '0',\n // Eastern-Arabic digit 0\n \"\\u06F1\": '1',\n // Eastern-Arabic digit 1\n \"\\u06F2\": '2',\n // Eastern-Arabic digit 2\n \"\\u06F3\": '3',\n // Eastern-Arabic digit 3\n \"\\u06F4\": '4',\n // Eastern-Arabic digit 4\n \"\\u06F5\": '5',\n // Eastern-Arabic digit 5\n \"\\u06F6\": '6',\n // Eastern-Arabic digit 6\n \"\\u06F7\": '7',\n // Eastern-Arabic digit 7\n \"\\u06F8\": '8',\n // Eastern-Arabic digit 8\n \"\\u06F9\": '9' // Eastern-Arabic digit 9\n\n};\nexport function parseDigit(character) {\n return DIGITS[character];\n}\n/**\r\n * Parses phone number digits from a string.\r\n * Drops all punctuation leaving only digits.\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * parseDigits('8 (800) 555')\r\n * // Outputs '8800555'.\r\n * ```\r\n */\n\nexport default function parseDigits(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n var digit = parseDigit(character);\n\n if (digit) {\n result += digit;\n }\n }\n\n return result;\n}\n//# sourceMappingURL=parseDigits.js.map","import Metadata from '../metadata';\nimport { VALID_DIGITS } from '../constants';\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\nexport default function stripIddPrefix(number, country, callingCode, metadata) {\n if (!country) {\n return;\n } // Check if the number is IDD-prefixed.\n\n\n var countryMetadata = new Metadata(metadata);\n countryMetadata.selectNumberingPlan(country, callingCode);\n var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n if (number.search(IDDPrefixPattern) !== 0) {\n return;\n } // Strip IDD prefix.\n\n\n number = number.slice(number.match(IDDPrefixPattern)[0].length); // If there're any digits after an IDD prefix,\n // then those digits are a country calling code.\n // Since no country code starts with a `0`,\n // the code below validates that the next digit (if present) is not `0`.\n\n var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\n if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n if (matchedGroups[1] === '0') {\n return;\n }\n }\n\n return number;\n}\n//# sourceMappingURL=stripIddPrefix.js.map","import { normalizeArguments } from './getNumberType';\nimport _isPossibleNumber from './isPossibleNumber_';\n/**\r\n * Checks if a given phone number is possible.\r\n * Which means it only checks phone number length\r\n * and doesn't test any regular expressions.\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isPossibleNumber('+78005553535', metadata)\r\n * isPossibleNumber('8005553535', 'RU', metadata)\r\n * isPossibleNumber('88005553535', 'RU', metadata)\r\n * isPossibleNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\n\nexport default function isPossibleNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _isPossibleNumber(input, options, metadata);\n}\n//# sourceMappingURL=isPossibleNumber.js.map","import Metadata from './metadata';\nimport checkNumberLength from './helpers/checkNumberLength';\nexport default function isPossiblePhoneNumber(input, options, metadata) {\n /* istanbul ignore if */\n if (options === undefined) {\n options = {};\n }\n\n metadata = new Metadata(metadata);\n\n if (options.v2) {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n } else {\n if (!input.phone) {\n return false;\n }\n\n if (input.country) {\n if (!metadata.hasCountry(input.country)) {\n throw new Error(\"Unknown country: \".concat(input.country));\n }\n\n metadata.country(input.country);\n } else {\n if (!input.countryCallingCode) {\n throw new Error('Invalid phone number object passed');\n }\n\n metadata.selectNumberingPlan(input.countryCallingCode);\n }\n }\n\n if (metadata.possibleLengths()) {\n return isPossibleNumber(input.phone || input.nationalNumber, metadata);\n } else {\n // There was a bug between `1.7.35` and `1.7.37` where \"possible_lengths\"\n // were missing for \"non-geographical\" numbering plans.\n // Just assume the number is possible in such cases:\n // it's unlikely that anyone generated their custom metadata\n // in that short period of time (one day).\n // This code can be removed in some future major version update.\n if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {\n // \"Non-geographic entities\" did't have `possibleLengths`\n // due to a bug in metadata generation process.\n return true;\n } else {\n throw new Error('Missing \"possibleLengths\" in metadata. Perhaps the metadata has been generated before v1.0.18.');\n }\n }\n}\nexport function isPossibleNumber(nationalNumber, metadata) {\n //, isInternational) {\n switch (checkNumberLength(nationalNumber, metadata)) {\n case 'IS_POSSIBLE':\n return true;\n // This library ignores \"local-only\" phone numbers (for simplicity).\n // See the readme for more info on what are \"local-only\" phone numbers.\n // case 'IS_POSSIBLE_LOCAL_ONLY':\n // \treturn !isInternational\n\n default:\n return false;\n }\n}\n//# sourceMappingURL=isPossibleNumber_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString from './parsePhoneNumberFromString_';\nexport default function isPossiblePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = parsePhoneNumberFromString(text, options, metadata);\n return phoneNumber && phoneNumber.isPossible() || false;\n}\n//# sourceMappingURL=isPossiblePhoneNumber.js.map","import isViablePhoneNumber from './helpers/isViablePhoneNumber';\nimport parseNumber from './parse_';\nimport _isValidNumberForRegion from './isValidNumberForRegion_';\nexport default function isValidNumberForRegion(number, country, metadata) {\n if (typeof number !== 'string') {\n throw new TypeError('number must be a string');\n }\n\n if (typeof country !== 'string') {\n throw new TypeError('country must be a string');\n } // `parse` extracts phone numbers from raw text,\n // therefore it will cut off all \"garbage\" characters,\n // while this `validate` function needs to verify\n // that the phone number contains no \"garbage\"\n // therefore the explicit `isViablePhoneNumber` check.\n\n\n var input;\n\n if (isViablePhoneNumber(number)) {\n input = parseNumber(number, {\n defaultCountry: country\n }, metadata);\n } else {\n input = {};\n }\n\n return _isValidNumberForRegion(input, country, undefined, metadata);\n}\n//# sourceMappingURL=isValidNumberForRegion.js.map","import isValidNumber from './validate_';\n/**\r\n * Checks if a given phone number is valid within a given region.\r\n * Is just an alias for `phoneNumber.isValid() && phoneNumber.country === country`.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n */\n\nexport default function isValidNumberForRegion(input, country, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n return input.country === country && isValidNumber(input, options, metadata);\n}\n//# sourceMappingURL=isValidNumberForRegion_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString from './parsePhoneNumberFromString_';\nexport default function isValidPhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n options = _objectSpread({}, options, {\n extract: false\n });\n var phoneNumber = parsePhoneNumberFromString(text, options, metadata);\n return phoneNumber && phoneNumber.isValid() || false;\n}\n//# sourceMappingURL=isValidPhoneNumber.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nimport compare from './tools/semver-compare'; // Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\n\nvar V2 = '1.0.18'; // Added \"idd_prefix\" and \"default_idd_prefix\".\n\nvar V3 = '1.2.0'; // Moved `001` country code to \"nonGeographic\" section of metadata.\n\nvar V4 = '1.7.35';\nvar DEFAULT_EXT_PREFIX = ' ext. ';\nvar CALLING_CODE_REG_EXP = /^\\d+$/;\n/**\r\n * See: https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md\r\n */\n\nvar Metadata =\n/*#__PURE__*/\nfunction () {\n function Metadata(metadata) {\n _classCallCheck(this, Metadata);\n\n validateMetadata(metadata);\n this.metadata = metadata;\n setVersion.call(this, metadata);\n }\n\n _createClass(Metadata, [{\n key: \"getCountries\",\n value: function getCountries() {\n return Object.keys(this.metadata.countries).filter(function (_) {\n return _ !== '001';\n });\n }\n }, {\n key: \"getCountryMetadata\",\n value: function getCountryMetadata(countryCode) {\n return this.metadata.countries[countryCode];\n }\n }, {\n key: \"nonGeographic\",\n value: function nonGeographic() {\n if (this.v1 || this.v2 || this.v3) return; // `nonGeographical` was a typo.\n // It's present in metadata generated from `1.7.35` to `1.7.37`.\n\n return this.metadata.nonGeographic || this.metadata.nonGeographical;\n }\n }, {\n key: \"hasCountry\",\n value: function hasCountry(country) {\n return this.getCountryMetadata(country) !== undefined;\n }\n }, {\n key: \"hasCallingCode\",\n value: function hasCallingCode(callingCode) {\n if (this.getCountryCodesForCallingCode(callingCode)) {\n return true;\n }\n\n if (this.nonGeographic()) {\n if (this.nonGeographic()[callingCode]) {\n return true;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return true;\n }\n }\n }\n }, {\n key: \"isNonGeographicCallingCode\",\n value: function isNonGeographicCallingCode(callingCode) {\n if (this.nonGeographic()) {\n return this.nonGeographic()[callingCode] ? true : false;\n } else {\n return this.getCountryCodesForCallingCode(callingCode) ? false : true;\n }\n } // Deprecated.\n\n }, {\n key: \"country\",\n value: function country(countryCode) {\n return this.selectNumberingPlan(countryCode);\n }\n }, {\n key: \"selectNumberingPlan\",\n value: function selectNumberingPlan(countryCode, callingCode) {\n // Supports just passing `callingCode` as the first argument.\n if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {\n callingCode = countryCode;\n countryCode = null;\n }\n\n if (countryCode && countryCode !== '001') {\n if (!this.hasCountry(countryCode)) {\n throw new Error(\"Unknown country: \".concat(countryCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);\n } else if (callingCode) {\n if (!this.hasCallingCode(callingCode)) {\n throw new Error(\"Unknown calling code: \".concat(callingCode));\n }\n\n this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);\n } else {\n this.numberingPlan = undefined;\n }\n\n return this;\n }\n }, {\n key: \"getCountryCodesForCallingCode\",\n value: function getCountryCodesForCallingCode(callingCode) {\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes) {\n // Metadata before V4 included \"non-geographic entity\" calling codes\n // inside `country_calling_codes` (for example, `\"881\":[\"001\"]`).\n // Now the semantics of `country_calling_codes` has changed:\n // it's specifically for \"countries\" now.\n // Older versions of custom metadata will simply skip parsing\n // \"non-geographic entity\" phone numbers with new versions\n // of this library: it's not considered a bug,\n // because such numbers are extremely rare,\n // and developers extremely rarely use custom metadata.\n if (countryCodes.length === 1 && countryCodes[0].length === 3) {\n return;\n }\n\n return countryCodes;\n }\n }\n }, {\n key: \"getCountryCodeForCallingCode\",\n value: function getCountryCodeForCallingCode(callingCode) {\n var countryCodes = this.getCountryCodesForCallingCode(callingCode);\n\n if (countryCodes) {\n return countryCodes[0];\n }\n }\n }, {\n key: \"getNumberingPlanMetadata\",\n value: function getNumberingPlanMetadata(callingCode) {\n var countryCode = this.getCountryCodeForCallingCode(callingCode);\n\n if (countryCode) {\n return this.getCountryMetadata(countryCode);\n }\n\n if (this.nonGeographic()) {\n var metadata = this.nonGeographic()[callingCode];\n\n if (metadata) {\n return metadata;\n }\n } else {\n // A hacky workaround for old custom metadata (generated before V4).\n var countryCodes = this.countryCallingCodes()[callingCode];\n\n if (countryCodes && countryCodes.length === 1 && countryCodes[0] === '001') {\n return this.metadata.countries['001'];\n }\n }\n } // Deprecated.\n\n }, {\n key: \"countryCallingCode\",\n value: function countryCallingCode() {\n return this.numberingPlan.callingCode();\n } // Deprecated.\n\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n return this.numberingPlan.IDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n return this.numberingPlan.defaultIDDPrefix();\n } // Deprecated.\n\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n return this.numberingPlan.nationalNumberPattern();\n } // Deprecated.\n\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n return this.numberingPlan.possibleLengths();\n } // Deprecated.\n\n }, {\n key: \"formats\",\n value: function formats() {\n return this.numberingPlan.formats();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n return this.numberingPlan.nationalPrefixForParsing();\n } // Deprecated.\n\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.numberingPlan.nationalPrefixTransformRule();\n } // Deprecated.\n\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.numberingPlan.leadingDigits();\n } // Deprecated.\n\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n return this.numberingPlan.hasTypes();\n } // Deprecated.\n\n }, {\n key: \"type\",\n value: function type(_type) {\n return this.numberingPlan.type(_type);\n } // Deprecated.\n\n }, {\n key: \"ext\",\n value: function ext() {\n return this.numberingPlan.ext();\n }\n }, {\n key: \"countryCallingCodes\",\n value: function countryCallingCodes() {\n if (this.v1) return this.metadata.country_phone_code_to_countries;\n return this.metadata.country_calling_codes;\n } // Deprecated.\n\n }, {\n key: \"chooseCountryByCountryCallingCode\",\n value: function chooseCountryByCountryCallingCode(callingCode) {\n return this.selectNumberingPlan(callingCode);\n }\n }, {\n key: \"hasSelectedNumberingPlan\",\n value: function hasSelectedNumberingPlan() {\n return this.numberingPlan !== undefined;\n }\n }]);\n\n return Metadata;\n}();\n\nexport { Metadata as default };\n\nvar NumberingPlan =\n/*#__PURE__*/\nfunction () {\n function NumberingPlan(metadata, globalMetadataObject) {\n _classCallCheck(this, NumberingPlan);\n\n this.globalMetadataObject = globalMetadataObject;\n this.metadata = metadata;\n setVersion.call(this, globalMetadataObject.metadata);\n }\n\n _createClass(NumberingPlan, [{\n key: \"callingCode\",\n value: function callingCode() {\n return this.metadata[0];\n } // Formatting information for regions which share\n // a country calling code is contained by only one region\n // for performance reasons. For example, for NANPA region\n // (\"North American Numbering Plan Administration\",\n // which includes USA, Canada, Cayman Islands, Bahamas, etc)\n // it will be contained in the metadata for `US`.\n\n }, {\n key: \"getDefaultCountryMetadataForRegion\",\n value: function getDefaultCountryMetadataForRegion() {\n return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());\n }\n }, {\n key: \"IDDPrefix\",\n value: function IDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[1];\n }\n }, {\n key: \"defaultIDDPrefix\",\n value: function defaultIDDPrefix() {\n if (this.v1 || this.v2) return;\n return this.metadata[12];\n }\n }, {\n key: \"nationalNumberPattern\",\n value: function nationalNumberPattern() {\n if (this.v1 || this.v2) return this.metadata[1];\n return this.metadata[2];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.v1) return;\n return this.metadata[this.v2 ? 2 : 3];\n }\n }, {\n key: \"_getFormats\",\n value: function _getFormats(metadata) {\n return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];\n } // For countries of the same region (e.g. NANPA)\n // formats are all stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"formats\",\n value: function formats() {\n var _this = this;\n\n var formats = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];\n return formats.map(function (_) {\n return new Format(_, _this);\n });\n }\n }, {\n key: \"nationalPrefix\",\n value: function nationalPrefix() {\n return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n }\n }, {\n key: \"_getNationalPrefixFormattingRule\",\n value: function _getNationalPrefixFormattingRule(metadata) {\n return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n } // For countries of the same region (e.g. NANPA)\n // national prefix formatting rule is stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"_nationalPrefixForParsing\",\n value: function _nationalPrefixForParsing() {\n return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];\n }\n }, {\n key: \"nationalPrefixForParsing\",\n value: function nationalPrefixForParsing() {\n // If `national_prefix_for_parsing` is not set explicitly,\n // then infer it from `national_prefix` (if any)\n return this._nationalPrefixForParsing() || this.nationalPrefix();\n }\n }, {\n key: \"nationalPrefixTransformRule\",\n value: function nationalPrefixTransformRule() {\n return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n }\n }, {\n key: \"_getNationalPrefixIsOptionalWhenFormatting\",\n value: function _getNationalPrefixIsOptionalWhenFormatting() {\n return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n } // For countries of the same region (e.g. NANPA)\n // \"national prefix is optional when formatting\" flag is\n // stored in the \"main\" country for that region.\n // E.g. \"RU\" and \"KZ\", \"US\" and \"CA\".\n\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());\n }\n }, {\n key: \"leadingDigits\",\n value: function leadingDigits() {\n return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n }\n }, {\n key: \"types\",\n value: function types() {\n return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n }\n }, {\n key: \"hasTypes\",\n value: function hasTypes() {\n // Versions 1.2.0 - 1.2.4: can be `[]`.\n\n /* istanbul ignore next */\n if (this.types() && this.types().length === 0) {\n return false;\n } // Versions <= 1.2.4: can be `undefined`.\n // Version >= 1.2.5: can be `0`.\n\n\n return !!this.types();\n }\n }, {\n key: \"type\",\n value: function type(_type2) {\n if (this.hasTypes() && getType(this.types(), _type2)) {\n return new Type(getType(this.types(), _type2), this);\n }\n }\n }, {\n key: \"ext\",\n value: function ext() {\n if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n return this.metadata[13] || DEFAULT_EXT_PREFIX;\n }\n }]);\n\n return NumberingPlan;\n}();\n\nvar Format =\n/*#__PURE__*/\nfunction () {\n function Format(format, metadata) {\n _classCallCheck(this, Format);\n\n this._format = format;\n this.metadata = metadata;\n }\n\n _createClass(Format, [{\n key: \"pattern\",\n value: function pattern() {\n return this._format[0];\n }\n }, {\n key: \"format\",\n value: function format() {\n return this._format[1];\n }\n }, {\n key: \"leadingDigitsPatterns\",\n value: function leadingDigitsPatterns() {\n return this._format[2] || [];\n }\n }, {\n key: \"nationalPrefixFormattingRule\",\n value: function nationalPrefixFormattingRule() {\n return this._format[3] || this.metadata.nationalPrefixFormattingRule();\n }\n }, {\n key: \"nationalPrefixIsOptionalWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {\n return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n }\n }, {\n key: \"nationalPrefixIsMandatoryWhenFormattingInNationalFormat\",\n value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {\n // National prefix is omitted if there's no national prefix formatting rule\n // set for this country, or when the national prefix formatting rule\n // contains no national prefix itself, or when this rule is set but\n // national prefix is optional for this phone number format\n // (and it is not enforced explicitly)\n return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();\n } // Checks whether national prefix formatting rule contains national prefix.\n\n }, {\n key: \"usesNationalPrefix\",\n value: function usesNationalPrefix() {\n return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a \"dummy\" one.\n !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) // In compressed metadata, `this.nationalPrefixFormattingRule()` is `0`\n // when `national_prefix_formatting_rule` is not present.\n // So, `true` or `false` are returned explicitly here, so that\n // `0` number isn't returned.\n ? true : false;\n }\n }, {\n key: \"internationalFormat\",\n value: function internationalFormat() {\n return this._format[5] || this.format();\n }\n }]);\n\n return Format;\n}();\n/**\r\n * A pattern that is used to determine if the national prefix formatting rule\r\n * has the first group only, i.e., does not start with the national prefix.\r\n * Note that the pattern explicitly allows for unbalanced parentheses.\r\n */\n\n\nvar FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\\(?\\$1\\)?$/;\n\nvar Type =\n/*#__PURE__*/\nfunction () {\n function Type(type, metadata) {\n _classCallCheck(this, Type);\n\n this.type = type;\n this.metadata = metadata;\n }\n\n _createClass(Type, [{\n key: \"pattern\",\n value: function pattern() {\n if (this.metadata.v1) return this.type;\n return this.type[0];\n }\n }, {\n key: \"possibleLengths\",\n value: function possibleLengths() {\n if (this.metadata.v1) return;\n return this.type[1] || this.metadata.possibleLengths();\n }\n }]);\n\n return Type;\n}();\n\nfunction getType(types, type) {\n switch (type) {\n case 'FIXED_LINE':\n return types[0];\n\n case 'MOBILE':\n return types[1];\n\n case 'TOLL_FREE':\n return types[2];\n\n case 'PREMIUM_RATE':\n return types[3];\n\n case 'PERSONAL_NUMBER':\n return types[4];\n\n case 'VOICEMAIL':\n return types[5];\n\n case 'UAN':\n return types[6];\n\n case 'PAGER':\n return types[7];\n\n case 'VOIP':\n return types[8];\n\n case 'SHARED_COST':\n return types[9];\n }\n}\n\nexport function validateMetadata(metadata) {\n if (!metadata) {\n throw new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n } // `country_phone_code_to_countries` was renamed to\n // `country_calling_codes` in `1.0.18`.\n\n\n if (!is_object(metadata) || !is_object(metadata.countries)) {\n throw new Error(\"[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got \".concat(is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata, \".\"));\n }\n} // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar is_object = function is_object(_) {\n return _typeof(_) === 'object';\n}; // Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\n\nvar type_of = function type_of(_) {\n return _typeof(_);\n};\n/**\r\n * Returns extension prefix for a country.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string?}\r\n * @example\r\n * // Returns \" ext. \"\r\n * getExtPrefix(\"US\")\r\n */\n\n\nexport function getExtPrefix(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).ext();\n }\n\n return DEFAULT_EXT_PREFIX;\n}\n/**\r\n * Returns \"country calling code\" for a country.\r\n * Throws an error if the country doesn't exist or isn't supported by this library.\r\n * @param {string} country\r\n * @param {object} metadata\r\n * @return {string}\r\n * @example\r\n * // Returns \"44\"\r\n * getCountryCallingCode(\"GB\")\r\n */\n\nexport function getCountryCallingCode(country, metadata) {\n metadata = new Metadata(metadata);\n\n if (metadata.hasCountry(country)) {\n return metadata.country(country).countryCallingCode();\n }\n\n throw new Error(\"Unknown country: \".concat(country));\n}\nexport function isSupportedCountry(country, metadata) {\n // metadata = new Metadata(metadata)\n // return metadata.hasCountry(country)\n return metadata.countries[country] !== undefined;\n}\n\nfunction setVersion(metadata) {\n var version = metadata.version;\n\n if (typeof version === 'number') {\n this.v1 = version === 1;\n this.v2 = version === 2;\n this.v3 = version === 3;\n this.v4 = version === 4;\n } else {\n if (!version) {\n this.v1 = true;\n } else if (compare(version, V3) === -1) {\n this.v2 = true;\n } else if (compare(version, V4) === -1) {\n this.v3 = true;\n } else {\n this.v4 = true;\n }\n }\n} // const ISO_COUNTRY_CODE = /^[A-Z]{2}$/\n// function isCountryCode(countryCode) {\n// \treturn ISO_COUNTRY_CODE.test(countryCodeOrCountryCallingCode)\n// }\n//# sourceMappingURL=metadata.js.map","import _parseNumber from './parse_';\nimport { normalizeArguments } from './parsePhoneNumber'; // `options`:\n// {\n// country:\n// {\n// restrict - (a two-letter country code)\n// the phone number must be in this country\n//\n// default - (a two-letter country code)\n// default country to use for phone number parsing and validation\n// (if no country code could be derived from the phone number)\n// }\n// }\n//\n// Returns `{ country, number }`\n//\n// Example use cases:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\n\nexport default function parseNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _parseNumber(text, options, metadata);\n}\n//# sourceMappingURL=parse.js.map","import { parseDigit } from './helpers/parseDigits';\n/**\r\n * Parses phone number characters from a string.\r\n * Drops all punctuation leaving only digits and the leading `+` sign (if any).\r\n * Also converts wide-ascii and arabic-indic numerals to conventional numerals.\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n * @param {string} string\r\n * @return {string}\r\n * @example\r\n * ```js\r\n * // Outputs '8800555'.\r\n * parseIncompletePhoneNumber('8 (800) 555')\r\n * // Outputs '+7800555'.\r\n * parseIncompletePhoneNumber('+7 800 555')\r\n * ```\r\n */\n\nexport default function parseIncompletePhoneNumber(string) {\n var result = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes) but digits\n // (including non-European ones) don't fall into that range\n // so such \"exotic\" characters would be discarded anyway.\n\n for (var _iterator = string.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n var _ref;\n\n if (_isArray) {\n if (_i >= _iterator.length) break;\n _ref = _iterator[_i++];\n } else {\n _i = _iterator.next();\n if (_i.done) break;\n _ref = _i.value;\n }\n\n var character = _ref;\n result += parsePhoneNumberCharacter(character, result) || '';\n }\n\n return result;\n}\n/**\r\n * Parses next character while parsing phone number digits (including a `+`)\r\n * from text: discards everything except `+` and digits, and `+` is only allowed\r\n * at the start of a phone number.\r\n * For example, is used in `react-phone-number-input` where it uses\r\n * [`input-format`](https://gitlab.com/catamphetamine/input-format).\r\n * @param {string} character - Yet another character from raw input string.\r\n * @param {string?} prevParsedCharacters - Previous parsed characters.\r\n * @param {object} meta - Optional custom use-case-specific metadata.\r\n * @return {string?} The parsed character.\r\n */\n\nexport function parsePhoneNumberCharacter(character, prevParsedCharacters) {\n // Only allow a leading `+`.\n if (character === '+') {\n // If this `+` is not the first parsed character\n // then discard it.\n if (prevParsedCharacters) {\n return;\n }\n\n return '+';\n } // Allow digits.\n\n\n return parseDigit(character);\n}\n//# sourceMappingURL=parseIncompletePhoneNumber.js.map","function _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport parsePhoneNumber_ from './parsePhoneNumber_';\nexport default function parsePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumber_(text, options, metadata);\n}\nexport function normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var text;\n var options;\n var metadata; // If the phone number is passed as a string.\n // `parsePhoneNumber('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n text = arg_1;\n } else throw new TypeError('A text for parsing must be a string.'); // If \"default country\" argument is being passed then move it to `options`.\n // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.\n\n\n if (!arg_2 || typeof arg_2 === 'string') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n options = undefined;\n metadata = arg_3;\n }\n\n if (arg_2) {\n options = _objectSpread({\n defaultCountry: arg_2\n }, options);\n }\n } // `defaultCountry` is not passed.\n // Example: `parsePhoneNumber('+78005553535', [options], metadata)`.\n else if (isObject(arg_2)) {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new Error(\"Invalid second argument: \".concat(arg_2));\n\n return {\n text: text,\n options: options,\n metadata: metadata\n };\n} // Otherwise istanbul would show this as \"branch not covered\".\n\n/* istanbul ignore next */\n\nvar isObject = function isObject(_) {\n return _typeof(_) === 'object';\n};\n//# sourceMappingURL=parsePhoneNumber.js.map","import { normalizeArguments } from './parsePhoneNumber';\nimport parsePhoneNumberFromString_ from './parsePhoneNumberFromString_';\nexport default function parsePhoneNumberFromString() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumberFromString_(text, options, metadata);\n}\n//# sourceMappingURL=parsePhoneNumberFromString.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parsePhoneNumber from './parsePhoneNumber_';\nimport ParseError from './ParseError';\nimport { isSupportedCountry } from './metadata';\nexport default function parsePhoneNumberFromString(text, options, metadata) {\n // Validate `defaultCountry`.\n if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {\n options = _objectSpread({}, options, {\n defaultCountry: undefined\n });\n } // Parse phone number.\n\n\n try {\n return parsePhoneNumber(text, options, metadata);\n } catch (error) {\n /* istanbul ignore else */\n if (error instanceof ParseError) {//\n } else {\n throw error;\n }\n }\n}\n//# sourceMappingURL=parsePhoneNumberFromString_.js.map","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parseNumber from './parse_';\nexport default function parsePhoneNumber(text, options, metadata) {\n return parseNumber(text, _objectSpread({}, options, {\n v2: true\n }), metadata);\n}\n//# sourceMappingURL=parsePhoneNumber_.js.map","// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of December 31th, 2018.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\nimport { VALID_DIGITS, PLUS_CHARS, MIN_LENGTH_FOR_NSN, MAX_LENGTH_FOR_NSN } from './constants';\nimport ParseError from './ParseError';\nimport Metadata from './metadata';\nimport isViablePhoneNumber from './helpers/isViablePhoneNumber';\nimport extractExtension from './helpers/extension/extractExtension';\nimport parseIncompletePhoneNumber from './parseIncompletePhoneNumber';\nimport getCountryCallingCode from './getCountryCallingCode';\nimport { isPossibleNumber } from './isPossibleNumber_';\nimport { parseRFC3966 } from './helpers/RFC3966';\nimport PhoneNumber from './PhoneNumber';\nimport matchesEntirely from './helpers/matchesEntirely';\nimport extractCountryCallingCode from './helpers/extractCountryCallingCode';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign';\nimport extractNationalNumber from './helpers/extractNationalNumber';\nimport stripIddPrefix from './helpers/stripIddPrefix';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode'; // We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\n\nvar MAX_INPUT_STRING_LENGTH = 250; // This consists of the plus symbol, digits, and arabic-indic digits.\n\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']'); // Regular expression of trailing characters that we want to remove.\n// A trailing `#` is sometimes used when writing phone numbers with extensions in US.\n// Example: \"+1 (645) 123 1234-910#\" number has extension \"910\".\n\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + '#' + ']+$');\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false; // Examples:\n//\n// ```js\n// parse('8 (800) 555-35-35', 'RU')\n// parse('8 (800) 555-35-35', 'RU', metadata)\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n// parse('+7 800 555 35 35')\n// parse('+7 800 555 35 35', metadata)\n// ```\n//\n\nexport default function parse(text, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata); // Validate `defaultCountry`.\n\n if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n throw new Error(\"Unknown country: \".concat(options.defaultCountry));\n } // Parse the phone number.\n\n\n var _parseInput = parseInput(text, options.v2, options.extract),\n formattedPhoneNumber = _parseInput.number,\n ext = _parseInput.ext; // If the phone number is not viable then return nothing.\n\n\n if (!formattedPhoneNumber) {\n if (options.v2) {\n throw new ParseError('NOT_A_NUMBER');\n }\n\n return {};\n }\n\n var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata),\n country = _parsePhoneNumber.country,\n nationalNumber = _parsePhoneNumber.nationalNumber,\n countryCallingCode = _parsePhoneNumber.countryCallingCode,\n carrierCode = _parsePhoneNumber.carrierCode;\n\n if (!metadata.hasSelectedNumberingPlan()) {\n if (options.v2) {\n throw new ParseError('INVALID_COUNTRY');\n }\n\n return {};\n } // Validate national (significant) number length.\n\n\n if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {\n // Won't throw here because the regexp already demands length > 1.\n\n /* istanbul ignore if */\n if (options.v2) {\n throw new ParseError('TOO_SHORT');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n } // Validate national (significant) number length.\n //\n // A sidenote:\n //\n // They say that sometimes national (significant) numbers\n // can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n // https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n // Such numbers will just be discarded.\n //\n\n\n if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {\n if (options.v2) {\n throw new ParseError('TOO_LONG');\n } // Google's demo just throws an error in this case.\n\n\n return {};\n }\n\n if (options.v2) {\n var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);\n\n if (country) {\n phoneNumber.country = country;\n }\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n }\n\n if (ext) {\n phoneNumber.ext = ext;\n }\n\n return phoneNumber;\n } // Check if national phone number pattern matches the number.\n // National number pattern is different for each country,\n // even for those ones which are part of the \"NANPA\" group.\n\n\n var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;\n\n if (!options.extended) {\n return valid ? result(country, nationalNumber, ext) : {};\n } // isInternational: countryCallingCode !== undefined\n\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n carrierCode: carrierCode,\n valid: valid,\n possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, metadata) ? true : false,\n phone: nationalNumber,\n ext: ext\n };\n}\n/**\r\n * Extracts a formatted phone number from text.\r\n * Doesn't guarantee that the extracted phone number\r\n * is a valid phone number (for example, doesn't validate its length).\r\n * @param {string} text\r\n * @param {boolean} [extract] — If `false`, then will parse the entire `text` as a phone number.\r\n * @param {boolean} [throwOnError] — By default, it won't throw if the text is too long.\r\n * @return {string}\r\n * @example\r\n * // Returns \"(213) 373-4253\".\r\n * extractFormattedPhoneNumber(\"Call (213) 373-4253 for assistance.\")\r\n */\n\nfunction extractFormattedPhoneNumber(text, extract, throwOnError) {\n if (!text) {\n return;\n }\n\n if (text.length > MAX_INPUT_STRING_LENGTH) {\n if (throwOnError) {\n throw new ParseError('TOO_LONG');\n }\n\n return;\n }\n\n if (extract === false) {\n return text;\n } // Attempt to extract a possible number from the string passed in\n\n\n var startsAt = text.search(PHONE_NUMBER_START_PATTERN);\n\n if (startsAt < 0) {\n return;\n }\n\n return text // Trim everything to the left of the phone number\n .slice(startsAt) // Remove trailing non-numerical characters\n .replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n/**\r\n * @param {string} text - Input.\r\n * @param {boolean} v2 - Legacy API functions don't pass `v2: true` flag.\r\n * @param {boolean} [extract] - Whether to extract a phone number from `text`, or attempt to parse the entire text as a phone number.\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\n\n\nfunction parseInput(text, v2, extract) {\n // Parse RFC 3966 phone number URI.\n if (text && text.indexOf('tel:') === 0) {\n return parseRFC3966(text);\n }\n\n var number = extractFormattedPhoneNumber(text, extract, v2); // If the phone number is not viable, then abort.\n\n if (!number || !isViablePhoneNumber(number)) {\n return {};\n } // Attempt to parse extension first, since it doesn't require region-specific\n // data and we want to have the non-normalised number here.\n\n\n var withExtensionStripped = extractExtension(number);\n\n if (withExtensionStripped.ext) {\n return withExtensionStripped;\n }\n\n return {\n number: number\n };\n}\n/**\r\n * Creates `parse()` result object.\r\n */\n\n\nfunction result(country, nationalNumber, ext) {\n var result = {\n country: country,\n phone: nationalNumber\n };\n\n if (ext) {\n result.ext = ext;\n }\n\n return result;\n}\n/**\r\n * Parses a viable phone number.\r\n * @param {string} formattedPhoneNumber — Example: \"(213) 373-4253\".\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {Metadata} metadata\r\n * @return {object} Returns `{ country: string?, countryCallingCode: string?, nationalNumber: string? }`.\r\n */\n\n\nfunction parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {\n // Extract calling code from phone number.\n var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), defaultCountry, defaultCallingCode, metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number; // Choose a country by `countryCallingCode`.\n\n\n var country;\n\n if (countryCallingCode) {\n metadata.selectNumberingPlan(countryCallingCode);\n } // If `formattedPhoneNumber` is in \"national\" format\n // then `number` is defined and `countryCallingCode` isn't.\n else if (number && (defaultCountry || defaultCallingCode)) {\n metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);\n\n if (defaultCountry) {\n country = defaultCountry;\n } else {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n country = '001';\n }\n }\n }\n\n countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);\n } else return {};\n\n if (!number) {\n return {\n countryCallingCode: countryCallingCode\n };\n }\n\n var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), metadata),\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode; // Sometimes there are several countries\n // corresponding to the same country phone code\n // (e.g. NANPA countries all having `1` country phone code).\n // Therefore, to reliably determine the exact country,\n // national (significant) number should have been parsed first.\n //\n // When `metadata.json` is generated, all \"ambiguous\" country phone codes\n // get their countries populated with the full set of\n // \"phone number type\" regular expressions.\n //\n\n\n var exactCountry = getCountryByCallingCode(countryCallingCode, nationalNumber, metadata);\n\n if (exactCountry) {\n country = exactCountry;\n /* istanbul ignore if */\n\n if (exactCountry === '001') {// Can't happen with `USE_NON_GEOGRAPHIC_COUNTRY_CODE` being `false`.\n // If `USE_NON_GEOGRAPHIC_COUNTRY_CODE` is set to `true` for some reason,\n // then remove the \"istanbul ignore if\".\n } else {\n metadata.country(country);\n }\n }\n\n return {\n country: country,\n countryCallingCode: countryCallingCode,\n nationalNumber: nationalNumber,\n carrierCode: carrierCode\n };\n}\n//# sourceMappingURL=parse_.js.map","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { normalizeArguments } from './parsePhoneNumber';\nimport PhoneNumberMatcher from './PhoneNumberMatcher';\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\n\nexport default function searchNumbers() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n var matcher = new PhoneNumberMatcher(text, options, metadata);\n return _defineProperty({}, Symbol.iterator, function () {\n return {\n next: function next() {\n if (matcher.hasNext()) {\n return {\n done: false,\n value: matcher.next()\n };\n }\n\n return {\n done: true\n };\n }\n };\n });\n}\n//# sourceMappingURL=searchNumbers.js.map","import searchNumbers from './searchNumbers';\nimport { getArguments } from './findPhoneNumbersInText';\nexport default function searchPhoneNumbersInText(text, defaultCountry, options, metadata) {\n var args = getArguments(defaultCountry, options, metadata);\n return searchNumbers(text, args.options, args.metadata);\n}\n//# sourceMappingURL=searchPhoneNumbersInText.js.map","// Copy-pasted from:\n// https://github.com/substack/semver-compare/blob/master/index.js\n//\n// Inlining this function because some users reported issues with\n// importing from `semver-compare` in a browser with ES6 \"native\" modules.\n//\n// Fixes `semver-compare` not being able to compare versions with alpha/beta/etc \"tags\".\n// https://github.com/catamphetamine/libphonenumber-js/issues/381\nexport default function (a, b) {\n a = a.split('-');\n b = b.split('-');\n var pa = a[0].split('.');\n var pb = b[0].split('.');\n\n for (var i = 0; i < 3; i++) {\n var na = Number(pa[i]);\n var nb = Number(pb[i]);\n if (na > nb) return 1;\n if (nb > na) return -1;\n if (!isNaN(na) && isNaN(nb)) return 1;\n if (isNaN(na) && !isNaN(nb)) return -1;\n }\n\n if (a[1] && b[1]) {\n return a[1] > b[1] ? 1 : a[1] < b[1] ? -1 : 0;\n }\n\n return !a[1] && b[1] ? 1 : a[1] && !b[1] ? -1 : 0;\n}\n//# sourceMappingURL=semver-compare.js.map","import _isValidNumber from './validate_';\nimport { normalizeArguments } from './getNumberType'; // Finds out national phone number type (fixed line, mobile, etc)\n\nexport default function isValidNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n input = _normalizeArguments.input,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return _isValidNumber(input, options, metadata);\n}\n//# sourceMappingURL=validate.js.map","import Metadata from './metadata';\nimport matchesEntirely from './helpers/matchesEntirely';\nimport getNumberType from './helpers/getNumberType';\n/**\r\n * Checks if a given phone number is valid.\r\n *\r\n * If the `number` is a string, it will be parsed to an object,\r\n * but only if it contains only valid phone number characters (including punctuation).\r\n * If the `number` is an object, it is used as is.\r\n *\r\n * The optional `defaultCountry` argument is the default country.\r\n * I.e. it does not restrict to just that country,\r\n * e.g. in those cases where several countries share\r\n * the same phone numbering rules (NANPA, Britain, etc).\r\n * For example, even though the number `07624 369230`\r\n * belongs to the Isle of Man (\"IM\" country code)\r\n * calling `isValidNumber('07624369230', 'GB', metadata)`\r\n * still returns `true` because the country is not restricted to `GB`,\r\n * it's just that `GB` is the default one for the phone numbering rules.\r\n * For restricting the country see `isValidNumberForRegion()`\r\n * though restricting a country might not be a good idea.\r\n * https://github.com/googlei18n/libphonenumber/blob/master/FAQ.md#when-should-i-use-isvalidnumberforregion\r\n *\r\n * Examples:\r\n *\r\n * ```js\r\n * isValidNumber('+78005553535', metadata)\r\n * isValidNumber('8005553535', 'RU', metadata)\r\n * isValidNumber('88005553535', 'RU', metadata)\r\n * isValidNumber({ phone: '8005553535', country: 'RU' }, metadata)\r\n * ```\r\n */\n\nexport default function isValidNumber(input, options, metadata) {\n // If assigning the `{}` default value is moved to the arguments above,\n // code coverage would decrease for some weird reason.\n options = options || {};\n metadata = new Metadata(metadata); // This is just to support `isValidNumber({})`\n // for cases when `parseNumber()` returns `{}`.\n\n if (!input.country) {\n return false;\n }\n\n metadata.selectNumberingPlan(input.country, input.countryCallingCode); // By default, countries only have type regexps when it's required for\n // distinguishing different countries having the same `countryCallingCode`.\n\n if (metadata.hasTypes()) {\n return getNumberType(input, options, metadata.metadata) !== undefined;\n } // If there are no type regexps for this country in metadata then use\n // `nationalNumberPattern` as a \"better than nothing\" replacement.\n\n\n var national_number = options.v2 ? input.nationalNumber : input.phone;\n return matchesEntirely(national_number, metadata.nationalNumberPattern());\n}\n//# sourceMappingURL=validate_.js.map","import metadata from '../min/metadata'\r\n\r\nimport { PhoneNumberSearch as _PhoneNumberSearch } from '../es6/findPhoneNumbers_'\r\n\r\nexport function PhoneNumberSearch(text, options) {\r\n\t_PhoneNumberSearch.call(this, text, options, metadata)\r\n}\r\n\r\n// Deprecated.\r\nPhoneNumberSearch.prototype = Object.create(_PhoneNumberSearch.prototype, {})\r\nPhoneNumberSearch.prototype.constructor = PhoneNumberSearch\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport _findPhoneNumbers from '../es6/findPhoneNumbers'\r\n\r\nexport function findPhoneNumbers() {\r\n\treturn withMetadata(_findPhoneNumbers, arguments)\r\n}\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport _format from '../es6/format'\r\n\r\nexport function format() {\r\n\treturn withMetadata(_format, arguments)\r\n}\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport _getNumberType from '../es6/getNumberType'\r\n\r\nexport function getNumberType() {\r\n\treturn withMetadata(_getNumberType, arguments)\r\n}\r\n","// Deprecated.\r\n\r\nimport { withMetadata } from '../min/metadata'\r\n\r\nimport _isPossibleNumber from '../es6/isPossibleNumber'\r\n\r\nexport function isPossibleNumber() {\r\n\treturn withMetadata(_isPossibleNumber, arguments)\r\n}\r\n","// Deprecated.\r\n\r\nimport { withMetadata } from '../min/metadata'\r\n\r\nimport _isValidNumber from '../es6/validate'\r\n\r\nexport function isValidNumber() {\r\n\treturn withMetadata(_isValidNumber, arguments)\r\n}\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport _isValidNumberForRegion from '../es6/isValidNumberForRegion'\r\n\r\nexport function isValidNumberForRegion() {\r\n\treturn withMetadata(_isValidNumberForRegion, arguments)\r\n}\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport _parse from '../es6/parse'\r\n\r\nexport function parse() {\r\n\treturn withMetadata(_parse, arguments)\r\n}\r\n","import { withMetadata } from '../min/metadata'\r\n\r\nimport { searchPhoneNumbers as _searchPhoneNumbers } from '../es6/findPhoneNumbers'\r\n\r\nexport function searchPhoneNumbers() {\r\n\treturn withMetadata(_searchPhoneNumbers, arguments)\r\n}\r\n","// `parsePhoneNumber()` named export has been renamed to `parsePhoneNumberWithError()`.\r\nexport { parsePhoneNumberWithError, parsePhoneNumberWithError as parsePhoneNumber } from './min/exports/parsePhoneNumberWithError'\r\n// `parsePhoneNumberFromString()` named export is now considered legacy:\r\n// it has been promoted to a default export due to being too verbose.\r\nexport { parsePhoneNumberFromString, parsePhoneNumberFromString as default } from './min/exports/parsePhoneNumberFromString'\r\n\r\nexport { isValidPhoneNumber } from './min/exports/isValidPhoneNumber'\r\nexport { isPossiblePhoneNumber } from './min/exports/isPossiblePhoneNumber'\r\n\r\n// Deprecated.\r\nexport { findNumbers } from './min/exports/findNumbers'\r\n// Deprecated.\r\nexport { searchNumbers } from './min/exports/searchNumbers'\r\n\r\nexport { findPhoneNumbersInText } from './min/exports/findPhoneNumbersInText'\r\nexport { searchPhoneNumbersInText } from './min/exports/searchPhoneNumbersInText'\r\nexport { PhoneNumberMatcher } from './min/exports/PhoneNumberMatcher'\r\n\r\nexport { AsYouType } from './min/exports/AsYouType'\r\nexport { DIGIT_PLACEHOLDER } from './es6/AsYouTypeFormatter'\r\n\r\nexport { isSupportedCountry } from './min/exports/isSupportedCountry'\r\nexport { getCountries } from './min/exports/getCountries'\r\n// `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.\r\nexport { getCountryCallingCode, getCountryCallingCode as getPhoneCode } from './min/exports/getCountryCallingCode'\r\nexport { getExtPrefix } from './min/exports/getExtPrefix'\r\n\r\nexport { Metadata } from './min/exports/Metadata'\r\nexport { getExampleNumber } from './min/exports/getExampleNumber'\r\n\r\nexport { formatIncompletePhoneNumber } from './min/exports/formatIncompletePhoneNumber'\r\n\r\nexport {\r\n\tParseError,\r\n\tparseIncompletePhoneNumber,\r\n\tparsePhoneNumberCharacter,\r\n\tparseDigits,\r\n\tparseRFC3966,\r\n\tformatRFC3966\r\n} from './core/index'\r\n\r\n// Deprecated (old) exports.\r\nexport { parse as parseNumber, parse } from './index.es6.exports/parse'\r\nexport { format as formatNumber, format } from './index.es6.exports/format'\r\nexport { getNumberType } from './index.es6.exports/getNumberType'\r\nexport { isPossibleNumber } from './index.es6.exports/isPossibleNumber'\r\nexport { isValidNumber } from './index.es6.exports/isValidNumber'\r\nexport { isValidNumberForRegion } from './index.es6.exports/isValidNumberForRegion'\r\nexport { findPhoneNumbers } from './index.es6.exports/findPhoneNumbers'\r\nexport { searchPhoneNumbers } from './index.es6.exports/searchPhoneNumbers'\r\nexport { PhoneNumberSearch } from './index.es6.exports/PhoneNumberSearch'\r\n\r\n// Deprecated DIGITS export.\r\n// (it was used in `react-phone-number-input`)\r\nexport { DIGITS } from './es6/helpers/parseDigits'\r\n\r\n// Deprecated \"custom\" exports.\r\nexport { default as parseCustom } from './es6/parse'\r\nexport { default as formatCustom } from './es6/format'\r\nexport { default as isValidNumberCustom } from './es6/validate'\r\nexport { default as findPhoneNumbersCustom } from './es6/findPhoneNumbers'\r\nexport { searchPhoneNumbers as searchPhoneNumbersCustom } from './es6/findPhoneNumbers'\r\nexport { PhoneNumberSearch as PhoneNumberSearchCustom } from './es6/findPhoneNumbers_'\r\nexport { default as getNumberTypeCustom } from './es6/getNumberType'\r\nexport { default as getCountryCallingCodeCustom, default as getPhoneCodeCustom } from './es6/getCountryCallingCode'\r\nexport { default as AsYouTypeCustom } from './es6/AsYouType'\r\n","// This file is a workaround for a bug in web browsers' \"native\"\n// ES6 importing system which is uncapable of importing \"*.json\" files.\n// https://github.com/catamphetamine/libphonenumber-js/issues/239\nexport default {\"version\":4,\"country_calling_codes\":{\"1\":[\"US\",\"AG\",\"AI\",\"AS\",\"BB\",\"BM\",\"BS\",\"CA\",\"DM\",\"DO\",\"GD\",\"GU\",\"JM\",\"KN\",\"KY\",\"LC\",\"MP\",\"MS\",\"PR\",\"SX\",\"TC\",\"TT\",\"VC\",\"VG\",\"VI\"],\"7\":[\"RU\",\"KZ\"],\"20\":[\"EG\"],\"27\":[\"ZA\"],\"30\":[\"GR\"],\"31\":[\"NL\"],\"32\":[\"BE\"],\"33\":[\"FR\"],\"34\":[\"ES\"],\"36\":[\"HU\"],\"39\":[\"IT\",\"VA\"],\"40\":[\"RO\"],\"41\":[\"CH\"],\"43\":[\"AT\"],\"44\":[\"GB\",\"GG\",\"IM\",\"JE\"],\"45\":[\"DK\"],\"46\":[\"SE\"],\"47\":[\"NO\",\"SJ\"],\"48\":[\"PL\"],\"49\":[\"DE\"],\"51\":[\"PE\"],\"52\":[\"MX\"],\"53\":[\"CU\"],\"54\":[\"AR\"],\"55\":[\"BR\"],\"56\":[\"CL\"],\"57\":[\"CO\"],\"58\":[\"VE\"],\"60\":[\"MY\"],\"61\":[\"AU\",\"CC\",\"CX\"],\"62\":[\"ID\"],\"63\":[\"PH\"],\"64\":[\"NZ\"],\"65\":[\"SG\"],\"66\":[\"TH\"],\"81\":[\"JP\"],\"82\":[\"KR\"],\"84\":[\"VN\"],\"86\":[\"CN\"],\"90\":[\"TR\"],\"91\":[\"IN\"],\"92\":[\"PK\"],\"93\":[\"AF\"],\"94\":[\"LK\"],\"95\":[\"MM\"],\"98\":[\"IR\"],\"211\":[\"SS\"],\"212\":[\"MA\",\"EH\"],\"213\":[\"DZ\"],\"216\":[\"TN\"],\"218\":[\"LY\"],\"220\":[\"GM\"],\"221\":[\"SN\"],\"222\":[\"MR\"],\"223\":[\"ML\"],\"224\":[\"GN\"],\"225\":[\"CI\"],\"226\":[\"BF\"],\"227\":[\"NE\"],\"228\":[\"TG\"],\"229\":[\"BJ\"],\"230\":[\"MU\"],\"231\":[\"LR\"],\"232\":[\"SL\"],\"233\":[\"GH\"],\"234\":[\"NG\"],\"235\":[\"TD\"],\"236\":[\"CF\"],\"237\":[\"CM\"],\"238\":[\"CV\"],\"239\":[\"ST\"],\"240\":[\"GQ\"],\"241\":[\"GA\"],\"242\":[\"CG\"],\"243\":[\"CD\"],\"244\":[\"AO\"],\"245\":[\"GW\"],\"246\":[\"IO\"],\"247\":[\"AC\"],\"248\":[\"SC\"],\"249\":[\"SD\"],\"250\":[\"RW\"],\"251\":[\"ET\"],\"252\":[\"SO\"],\"253\":[\"DJ\"],\"254\":[\"KE\"],\"255\":[\"TZ\"],\"256\":[\"UG\"],\"257\":[\"BI\"],\"258\":[\"MZ\"],\"260\":[\"ZM\"],\"261\":[\"MG\"],\"262\":[\"RE\",\"YT\"],\"263\":[\"ZW\"],\"264\":[\"NA\"],\"265\":[\"MW\"],\"266\":[\"LS\"],\"267\":[\"BW\"],\"268\":[\"SZ\"],\"269\":[\"KM\"],\"290\":[\"SH\",\"TA\"],\"291\":[\"ER\"],\"297\":[\"AW\"],\"298\":[\"FO\"],\"299\":[\"GL\"],\"350\":[\"GI\"],\"351\":[\"PT\"],\"352\":[\"LU\"],\"353\":[\"IE\"],\"354\":[\"IS\"],\"355\":[\"AL\"],\"356\":[\"MT\"],\"357\":[\"CY\"],\"358\":[\"FI\",\"AX\"],\"359\":[\"BG\"],\"370\":[\"LT\"],\"371\":[\"LV\"],\"372\":[\"EE\"],\"373\":[\"MD\"],\"374\":[\"AM\"],\"375\":[\"BY\"],\"376\":[\"AD\"],\"377\":[\"MC\"],\"378\":[\"SM\"],\"380\":[\"UA\"],\"381\":[\"RS\"],\"382\":[\"ME\"],\"383\":[\"XK\"],\"385\":[\"HR\"],\"386\":[\"SI\"],\"387\":[\"BA\"],\"389\":[\"MK\"],\"420\":[\"CZ\"],\"421\":[\"SK\"],\"423\":[\"LI\"],\"500\":[\"FK\"],\"501\":[\"BZ\"],\"502\":[\"GT\"],\"503\":[\"SV\"],\"504\":[\"HN\"],\"505\":[\"NI\"],\"506\":[\"CR\"],\"507\":[\"PA\"],\"508\":[\"PM\"],\"509\":[\"HT\"],\"590\":[\"GP\",\"BL\",\"MF\"],\"591\":[\"BO\"],\"592\":[\"GY\"],\"593\":[\"EC\"],\"594\":[\"GF\"],\"595\":[\"PY\"],\"596\":[\"MQ\"],\"597\":[\"SR\"],\"598\":[\"UY\"],\"599\":[\"CW\",\"BQ\"],\"670\":[\"TL\"],\"672\":[\"NF\"],\"673\":[\"BN\"],\"674\":[\"NR\"],\"675\":[\"PG\"],\"676\":[\"TO\"],\"677\":[\"SB\"],\"678\":[\"VU\"],\"679\":[\"FJ\"],\"680\":[\"PW\"],\"681\":[\"WF\"],\"682\":[\"CK\"],\"683\":[\"NU\"],\"685\":[\"WS\"],\"686\":[\"KI\"],\"687\":[\"NC\"],\"688\":[\"TV\"],\"689\":[\"PF\"],\"690\":[\"TK\"],\"691\":[\"FM\"],\"692\":[\"MH\"],\"850\":[\"KP\"],\"852\":[\"HK\"],\"853\":[\"MO\"],\"855\":[\"KH\"],\"856\":[\"LA\"],\"880\":[\"BD\"],\"886\":[\"TW\"],\"960\":[\"MV\"],\"961\":[\"LB\"],\"962\":[\"JO\"],\"963\":[\"SY\"],\"964\":[\"IQ\"],\"965\":[\"KW\"],\"966\":[\"SA\"],\"967\":[\"YE\"],\"968\":[\"OM\"],\"970\":[\"PS\"],\"971\":[\"AE\"],\"972\":[\"IL\"],\"973\":[\"BH\"],\"974\":[\"QA\"],\"975\":[\"BT\"],\"976\":[\"MN\"],\"977\":[\"NP\"],\"992\":[\"TJ\"],\"993\":[\"TM\"],\"994\":[\"AZ\"],\"995\":[\"GE\"],\"996\":[\"KG\"],\"998\":[\"UZ\"]},\"countries\":{\"AC\":[\"247\",\"00\",\"(?:[01589]\\\\d|[46])\\\\d{4}\",[5,6]],\"AD\":[\"376\",\"00\",\"(?:1|6\\\\d)\\\\d{7}|[135-9]\\\\d{5}\",[6,8,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"[135-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]]],\"AE\":[\"971\",\"00\",\"(?:[4-7]\\\\d|9[0-689])\\\\d{7}|800\\\\d{2,9}|[2-4679]\\\\d{7}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{2,9})\",\"$1 $2\",[\"60|8\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[236]|[479][2-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{5})\",\"$1 $2 $3\",[\"[479]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AF\":[\"93\",\"00\",\"[2-7]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"]],\"0\"],\"AG\":[\"1\",\"011\",\"(?:268|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([457]\\\\d{6})$\",\"268$1\",0,\"268\"],\"AI\":[\"1\",\"011\",\"(?:264|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2457]\\\\d{6})$\",\"264$1\",0,\"264\"],\"AL\":[\"355\",\"00\",\"(?:700\\\\d\\\\d|900)\\\\d{3}|8\\\\d{5,7}|(?:[2-5]|6\\\\d)\\\\d{7}\",[6,7,8,9],[[\"(\\\\d{3})(\\\\d{3,4})\",\"$1 $2\",[\"80|9\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2358][2-5]|4\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[23578]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"]],\"0\"],\"AM\":[\"374\",\"00\",\"(?:[1-489]\\\\d|55|60|77)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]0\"],\"0 $1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2|3[12]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"1|47\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[3-9]\"],\"0$1\"]],\"0\"],\"AO\":[\"244\",\"00\",\"[29]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[29]\"]]]],\"AR\":[\"54\",\"00\",\"(?:11|[89]\\\\d\\\\d)\\\\d{8}|[2368]\\\\d{9}\",[10,11],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$1 $2-$3\",[\"2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])\",\"2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"1\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[68]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[23]\"],\"0$1\",1],[\"(\\\\d)(\\\\d{4})(\\\\d{2})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9(?:2[2-469]|3[3-578])\",\"9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))\",\"9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]\",\"9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$2 15-$3-$4\",[\"91\"],\"0$1\",0,\"$1 $2 $3-$4\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$2 15-$3-$4\",[\"9\"],\"0$1\",0,\"$1 $2 $3-$4\"]],\"0\",0,\"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?\",\"9$1\"],\"AS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|684|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([267]\\\\d{6})$\",\"684$1\",0,\"684\"],\"AT\":[\"43\",\"00\",\"1\\\\d{3,12}|2\\\\d{6,12}|43(?:(?:0\\\\d|5[02-9])\\\\d{3,9}|2\\\\d{4,5}|[3467]\\\\d{4}|8\\\\d{4,6}|9\\\\d{4,7})|5\\\\d{4,12}|8\\\\d{7,12}|9\\\\d{8,12}|(?:[367]\\\\d|4[0-24-9])\\\\d{4,11}\",[4,5,6,7,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{3,12})\",\"$1 $2\",[\"1(?:11|[2-9])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})\",\"$1 $2\",[\"517\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"5[079]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,10})\",\"$1 $2\",[\"(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,9})\",\"$1 $2\",[\"[2-467]|5[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,7})\",\"$1 $2 $3\",[\"5\"],\"0$1\"]],\"0\"],\"AU\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d{7,8}|8[0-24-9]\\\\d{7})|[2-478]\\\\d{8}|1\\\\d{4,7}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"16\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"16\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"14|4\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[2378]\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:30|[89])\"]]],\"0\",0,\"0|(183[12])\",0,0,0,[[\"(?:(?:2(?:[0-26-9]\\\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\\\d|2[0-8]))\\\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\\\d)\\\\d{3}|9(?:[02-9]\\\\d{3}|1(?:(?:[0-58]\\\\d|6[0135-9])\\\\d|7(?:0[0-24-9]|[1-9]\\\\d)|9(?:[0-46-9]\\\\d|5[0-79])))))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-4])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,[\"163\\\\d{2,6}\",[5,6,7,8,9]],[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{3}|45[0-4])\\\\d{3}|13\\\\d{4}\",[6,8,10]]],\"0011\"],\"AW\":[\"297\",\"00\",\"(?:[25-79]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[25-9]\"]]]],\"AX\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"2\\\\d{4,9}|35\\\\d{4,5}|(?:60\\\\d\\\\d|800)\\\\d{4,6}|7\\\\d{5,11}|(?:[14]\\\\d|3[0-46-9]|50)\\\\d{4,8}\",[5,6,7,8,9,10,11,12],0,\"0\",0,0,0,0,\"18\",0,\"00\"],\"AZ\":[\"994\",\"00\",\"365\\\\d{6}|(?:[124579]\\\\d|60|88)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[28]|2|365|46\",\"1[28]|2|365|46\",\"1[28]|2|365(?:[0-46-9]|5[0-35-9])|46\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[13-9]\"],\"0$1\"]],\"0\"],\"BA\":[\"387\",\"00\",\"6\\\\d{8}|(?:[35689]\\\\d|49|70)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[1-3]|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2-$3\",[\"[3-5]|6[56]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"6\"],\"0$1\"]],\"0\"],\"BB\":[\"1\",\"011\",\"(?:246|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"246$1\",0,\"246\"],\"BD\":[\"880\",\"00\",\"1\\\\d{9}|2\\\\d{7,8}|88\\\\d{4,6}|(?:8[0-79]|9\\\\d)\\\\d{4,8}|(?:[346]\\\\d|[57])\\\\d{5,8}\",[6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1-$2\",[\"31[5-8]|[459]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1-$2\",[\"3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:28|4[14]|5)|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,6})\",\"$1-$2\",[\"[13-9]\"],\"0$1\"],[\"(\\\\d)(\\\\d{7,8})\",\"$1-$2\",[\"2\"],\"0$1\"]],\"0\"],\"BE\":[\"32\",\"00\",\"4\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:80|9)0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[239]|4[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[15-8]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4\"],\"0$1\"]],\"0\"],\"BF\":[\"226\",\"00\",\"[025-7]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[025-7]\"]]]],\"BG\":[\"359\",\"00\",\"[2-7]\\\\d{6,7}|[89]\\\\d{6,8}|2\\\\d{5}\",[6,7,8,9],[[\"(\\\\d)(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"43[1-6]|70[1-9]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:70|8)0\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3\",[\"43[1-7]|7\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[48]|9[08]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"BH\":[\"973\",\"00\",\"[136-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[13679]|8[047]\"]]]],\"BI\":[\"257\",\"00\",\"(?:[267]\\\\d|31)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2367]\"]]]],\"BJ\":[\"229\",\"00\",\"[25689]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[25689]\"]]]],\"BL\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:2[7-9]|5[12]|87)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"BM\":[\"1\",\"011\",\"(?:441|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-8]\\\\d{6})$\",\"441$1\",0,\"441\"],\"BN\":[\"673\",\"00\",\"[2-578]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-578]\"]]]],\"BO\":[\"591\",\"00(?:1\\\\d)?\",\"(?:[2-467]\\\\d\\\\d|8001)\\\\d{5}\",[8,9],[[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[23]|4[46]\"]],[\"(\\\\d{8})\",\"$1\",[\"[67]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\",0,\"0(1\\\\d)?\"],\"BQ\":[\"599\",\"00\",\"(?:[34]1|7\\\\d)\\\\d{5}\",[7],0,0,0,0,0,0,\"[347]\"],\"BR\":[\"55\",\"00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)\",\"(?:[1-46-9]\\\\d\\\\d|5(?:[0-46-9]\\\\d|5[0-24679]))\\\\d{8}|[1-9]\\\\d{9}|[3589]\\\\d{8}|[34]\\\\d{7}\",[8,9,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"300|4(?:0[02]|37)\",\"4(?:02|37)0|[34]00\"]],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:[358]|90)0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2-$3\",[\"(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1 $2-$3\",[\"[16][1-9]|[2-57-9]\"],\"($1)\"]],\"0\",0,\"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\\\d{10,11}))?\",\"$2\"],\"BS\":[\"1\",\"011\",\"(?:242|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([3-8]\\\\d{6})$\",\"242$1\",0,\"242\"],\"BT\":[\"975\",\"00\",\"[17]\\\\d{7}|[2-8]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-68]|7[246]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[67]|7\"]]]],\"BW\":[\"267\",\"00\",\"(?:0800|(?:[37]|800)\\\\d)\\\\d{6}|(?:[2-6]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[24-6]|3[15-79]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"BY\":[\"375\",\"810\",\"(?:[12]\\\\d|33|44|902)\\\\d{7}|8(?:0[0-79]\\\\d{5,7}|[1-7]\\\\d{9})|8(?:1[0-489]|[5-79]\\\\d)\\\\d{7}|8[1-79]\\\\d{6,7}|8[0-79]\\\\d{5}|8\\\\d{5}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"800\"],\"8 $1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,4})\",\"$1 $2 $3\",[\"800\"],\"8 $1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{3})\",\"$1 $2-$3\",[\"1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])\",\"1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"1(?:[56]|7[467])|2[1-3]\"],\"8 0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-4]\"],\"8 0$1\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"8 $1\"]],\"8\",0,\"0|80?\",0,0,0,0,\"8~10\"],\"BZ\":[\"501\",\"00\",\"(?:0800\\\\d|[2-8])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-8]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"0\"]]]],\"CA\":[\"1\",\"011\",\"(?:[2-8]\\\\d|90)\\\\d{8}\",[10],0,\"1\",0,0,0,0,0,[[\"(?:2(?:04|[23]6|[48]9|50)|3(?:06|43|6[578])|4(?:03|1[68]|3[178]|50|74)|5(?:06|1[49]|48|79|8[17])|6(?:04|13|39|47|72)|7(?:0[59]|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\\\d{6}\"],[\"\"],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\"],[\"900[2-9]\\\\d{6}\"],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|(?:5(?:00|2[12]|33|44|66|77|88)|622)[2-9]\\\\d{6}\"],0,0,0,[\"600[2-9]\\\\d{6}\"]]],\"CC\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d|8[0-24-9])\\\\d{7}|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10],0,\"0\",0,\"0|([59]\\\\d{7})$\",\"8$1\",0,0,[[\"8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\\\d|70[23]|959))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-4])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{3}|45[0-4])\\\\d{3}|13\\\\d{4}\",[6,8,10]]],\"0011\"],\"CD\":[\"243\",\"00\",\"[189]\\\\d{8}|[1-68]\\\\d{6}\",[7,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[1-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\"],\"CF\":[\"236\",\"00\",\"(?:[27]\\\\d{3}|8776)\\\\d{4}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[278]\"]]]],\"CG\":[\"242\",\"00\",\"222\\\\d{6}|(?:0\\\\d|80)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"801\"]],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[02]\"]]]],\"CH\":[\"41\",\"00\",\"8\\\\d{11}|[2-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8[047]|90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-79]|81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"8\"],\"0$1\"]],\"0\"],\"CI\":[\"225\",\"00\",\"[02]\\\\d{9}|[02-9]\\\\d{7}\",[8,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[03-9]|2(?:[02-4]|1[023578])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d)(\\\\d{5})\",\"$1 $2 $3 $4\",[\"2\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"0\"]]]],\"CK\":[\"682\",\"00\",\"[2-578]\\\\d{4}\",[5],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"[2-578]\"]]]],\"CL\":[\"56\",\"(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0\",\"12300\\\\d{6}|6\\\\d{9,10}|[2-9]\\\\d{8}\",[9,10,11],[[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"219\",\"2196\"],\"($1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[1-3]\"],\"($1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"9[2-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"60|8\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"60\"]]]],\"CM\":[\"237\",\"00\",\"[26]\\\\d{8}|88\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"88\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[26]|88\"]]]],\"CN\":[\"86\",\"00|1(?:[12]\\\\d|79)\\\\d\\\\d00\",\"1[127]\\\\d{8,9}|2\\\\d{9}(?:\\\\d{2})?|[12]\\\\d{6,7}|86\\\\d{6}|(?:1[03-689]\\\\d|6)\\\\d{7,9}|(?:[3-579]\\\\d|8[0-57-9])\\\\d{6,9}\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5,6})\",\"$1 $2\",[\"(?:10|2[0-57-9])[19]\",\"(?:10|2[0-57-9])(?:10|9[56])\",\"(?:10|2[0-57-9])(?:100|9[56])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]\",\"(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))[19]\",\"85[23](?:10|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:10|9[56])\",\"85[23](?:100|95)|(?:3(?:[157]\\\\d|35|49|9[1-68])|4(?:[17]\\\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\\\d|4[13]|5[1-5]))(?:100|9[56])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"(?:4|80)0\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"10|2(?:[02-57-9]|1[1-9])\",\"10|2(?:[02-57-9]|1[1-9])\",\"10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-578]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"1[3-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"[12]\"],\"0$1\",1]],\"0\",0,\"0|(1(?:[12]\\\\d|79)\\\\d\\\\d)\",0,0,0,0,\"00\"],\"CO\":[\"57\",\"00(?:4(?:[14]4|56)|[579])\",\"(?:1\\\\d|3)\\\\d{9}|[124-8]\\\\d{7}\",[8,10,11],[[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"[14][2-9]|[25-8]\"],\"($1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"3\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{7})\",\"$1-$2-$3\",[\"1\"],\"0$1\",0,\"$1 $2 $3\"]],\"0\",0,\"0([3579]|4(?:[14]4|56))?\"],\"CR\":[\"506\",\"00\",\"(?:8\\\\d|90)\\\\d{8}|(?:[24-8]\\\\d{3}|3005)\\\\d{4}\",[8,10],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[3-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[89]\"]]],0,0,\"(19(?:0[0-2468]|1[09]|20|66|77|99))\"],\"CU\":[\"53\",\"119\",\"[27]\\\\d{6,7}|[34]\\\\d{5,7}|(?:5|8\\\\d\\\\d)\\\\d{7}\",[6,7,8,10],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"2[1-4]|[34]\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{6,7})\",\"$1 $2\",[\"7\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"5\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"8\"],\"0$1\"]],\"0\"],\"CV\":[\"238\",\"0\",\"(?:[2-59]\\\\d\\\\d|800)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[2-589]\"]]]],\"CW\":[\"599\",\"00\",\"(?:[34]1|60|(?:7|9\\\\d)\\\\d)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[3467]\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9[4-8]\"]]],0,0,0,0,0,\"[69]\"],\"CX\":[\"61\",\"001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011\",\"1(?:[0-79]\\\\d|8[0-24-9])\\\\d{7}|[148]\\\\d{8}|1\\\\d{5,7}\",[6,7,8,9,10],0,\"0\",0,\"0|([59]\\\\d{7})$\",\"8$1\",0,0,[[\"8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\\\d|7(?:0[01]|1[0-2])|958))\\\\d{3}\",[9]],[\"4(?:83[0-38]|93[0-4])\\\\d{5}|4(?:[0-3]\\\\d|4[047-9]|5[0-25-9]|6[06-9]|7[02-9]|8[0-24-9]|9[0-27-9])\\\\d{6}\",[9]],[\"180(?:0\\\\d{3}|2)\\\\d{3}\",[7,10]],[\"190[0-26]\\\\d{6}\",[10]],0,0,0,0,[\"14(?:5(?:1[0458]|[23][458])|71\\\\d)\\\\d{4}\",[9]],[\"13(?:00\\\\d{3}|45[0-4])\\\\d{3}|13\\\\d{4}\",[6,8,10]]],\"0011\"],\"CY\":[\"357\",\"00\",\"(?:[279]\\\\d|[58]0)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[257-9]\"]]]],\"CZ\":[\"420\",\"00\",\"(?:[2-578]\\\\d|60)\\\\d{7}|9\\\\d{8,11}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]|9[015-7]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]]],\"DE\":[\"49\",\"00\",\"[2579]\\\\d{5,14}|49(?:[34]0|69|8\\\\d)\\\\d\\\\d?|49(?:37|49|60|7[089]|9\\\\d)\\\\d{1,3}|49(?:[12]\\\\d|3[2-689]|7[1-7])\\\\d{1,8}|(?:1|[368]\\\\d|4[0-8])\\\\d{3,13}|49(?:[05]\\\\d|31|[46][1-8])\\\\d{1,9}\",[4,5,6,7,8,9,10,11,12,13,14,15],[[\"(\\\\d{2})(\\\\d{3,13})\",\"$1 $2\",[\"3[02]|40|[68]9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,12})\",\"$1 $2\",[\"2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\",\"2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2,11})\",\"$1 $2\",[\"[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]\",\"[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"138\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{2,10})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,11})\",\"$1 $2\",[\"181\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{4,10})\",\"$1 $2 $3\",[\"1(?:3|80)|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,8})\",\"$1 $2\",[\"1[67]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7,12})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"185\",\"1850\",\"18500\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"18[68]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{6})\",\"$1 $2\",[\"15[0568]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{7})\",\"$1 $2\",[\"15[1279]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{8})\",\"$1 $2\",[\"18\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{7,8})\",\"$1 $2 $3\",[\"1(?:6[023]|7)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{2})(\\\\d{7})\",\"$1 $2 $3\",[\"15[279]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{8})\",\"$1 $2 $3\",[\"15\"],\"0$1\"]],\"0\"],\"DJ\":[\"253\",\"00\",\"(?:2\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[27]\"]]]],\"DK\":[\"45\",\"00\",\"[2-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-9]\"]]]],\"DM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|767|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"767$1\",0,\"767\"],\"DO\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"8001|8[024]9\"],\"DZ\":[\"213\",\"00\",\"(?:[1-4]|[5-79]\\\\d|80)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-8]\"],\"0$1\"]],\"0\"],\"EC\":[\"593\",\"00\",\"1\\\\d{9,10}|(?:[2-7]|9\\\\d)\\\\d{7}\",[8,9,10,11],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2-$3\",[\"[2-7]\"],\"(0$1)\",0,\"$1-$2-$3\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"EE\":[\"372\",\"00\",\"8\\\\d{9}|[4578]\\\\d{7}|(?:[3-8]\\\\d|90)\\\\d{5}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88\",\"[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88\"]],[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[45]|8(?:00|[1-49])\",\"[45]|8(?:00[1-9]|[1-49])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"EG\":[\"20\",\"00\",\"[189]\\\\d{8,9}|[24-6]\\\\d{8}|[135]\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{7,8})\",\"$1 $2\",[\"[23]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,7})\",\"$1 $2\",[\"1[35]|[4-6]|8[2468]|9[235-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[189]\"],\"0$1\"]],\"0\"],\"EH\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],0,\"0\",0,0,0,0,\"528[89]\"],\"ER\":[\"291\",\"00\",\"[178]\\\\d{6}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[178]\"],\"0$1\"]],\"0\"],\"ES\":[\"34\",\"00\",\"[5-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[89]00\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-9]\"]]]],\"ET\":[\"251\",\"00\",\"(?:11|[2-59]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-59]\"],\"0$1\"]],\"0\"],\"FI\":[\"358\",\"00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))\",\"[1-35689]\\\\d{4}|7\\\\d{10,11}|(?:[124-7]\\\\d|3[0-46-9])\\\\d{8}|[1-9]\\\\d{5,8}\",[5,6,7,8,9,10,11,12],[[\"(\\\\d)(\\\\d{4,9})\",\"$1 $2\",[\"[2568][1-8]|3(?:0[1-9]|[1-9])|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"[12]00|[368]|70[07-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,8})\",\"$1 $2\",[\"[1245]|7[135]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6,10})\",\"$1 $2\",[\"7\"],\"0$1\"]],\"0\",0,0,0,0,\"1[03-79]|[2-9]\",0,\"00\"],\"FJ\":[\"679\",\"0(?:0|52)\",\"45\\\\d{5}|(?:0800\\\\d|[235-9])\\\\d{6}\",[7,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[235-9]|45\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]]],0,0,0,0,0,0,0,\"00\"],\"FK\":[\"500\",\"00\",\"[2-7]\\\\d{4}\",[5]],\"FM\":[\"691\",\"00\",\"(?:[39]\\\\d\\\\d|820)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[389]\"]]]],\"FO\":[\"298\",\"00\",\"[2-9]\\\\d{5}\",[6],[[\"(\\\\d{6})\",\"$1\",[\"[2-9]\"]]],0,0,\"(10(?:01|[12]0|88))\"],\"FR\":[\"33\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0 $1\"],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"[1-79]\"],\"0$1\"]],\"0\"],\"GA\":[\"241\",\"00\",\"(?:[067]\\\\d|11)\\\\d{6}|[2-7]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"11|[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]]],0,0,\"0(11\\\\d{6}|6[256]\\\\d{6}|7[47]\\\\d{6})\",\"$1\"],\"GB\":[\"44\",\"00\",\"[1-357-9]\\\\d{9}|[18]\\\\d{8}|8\\\\d{6}\",[7,9,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"800\",\"8001\",\"80011\",\"800111\",\"8001111\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"845\",\"8454\",\"84546\",\"845464\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"1(?:38|5[23]|69|76|94)\",\"1(?:(?:38|69)7|5(?:24|39)|768|946)\",\"1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"1(?:[2-69][02-9]|[78])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[25]|7(?:0|6[02-9])\",\"[25]|7(?:0|6(?:[03-9]|2[356]))\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1389]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"(?:1(?:1(?:3(?:[0-58]\\\\d\\\\d|73[03])|4(?:[0-5]\\\\d\\\\d|69[7-9]|70[059])|(?:5[0-26-9]|6[0-4]|[78][0-49])\\\\d\\\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\\\d)\\\\d|1(?:[0-7]\\\\d|8[02]))|(?:3(?:0\\\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\\\d)\\\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\\\d{3})\\\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\\\d)|76\\\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\\\d|7[4-79])|295[5-7]|35[34]\\\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\\\d{3}\",[9,10]],[\"7(?:457[0-57-9]|700[01]|911[028])\\\\d{5}|7(?:[1-3]\\\\d\\\\d|4(?:[0-46-9]\\\\d|5[0-689])|5(?:0[0-8]|[13-9]\\\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\\\d|8[02-9]|9[0-689])|8(?:[014-9]\\\\d|[23][0-8])|9(?:[024-9]\\\\d|1[02-9]|3[0-689]))\\\\d{6}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[2-49]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]],0,\" x\"],\"GD\":[\"1\",\"011\",\"(?:473|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"473$1\",0,\"473\"],\"GE\":[\"995\",\"00\",\"(?:[3-57]\\\\d\\\\d|800)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"32\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[57]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[348]\"],\"0$1\"]],\"0\"],\"GF\":[\"594\",\"00\",\"(?:[56]94|80\\\\d|976)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"GG\":[\"44\",\"00\",\"(?:1481|[357-9]\\\\d{3})\\\\d{6}|8\\\\d{6}(?:\\\\d{2})?\",[7,9,10],0,\"0\",0,\"0|([25-9]\\\\d{5})$\",\"1481$1\",0,0,[[\"1481[25-9]\\\\d{5}\",[10]],[\"7(?:(?:781|839)\\\\d|911[17])\\\\d{5}\",[10]],[\"80[08]\\\\d{7}|800\\\\d{6}|8001111\"],[\"(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\\\d|8[0-3]))\\\\d{7}|845464\\\\d\",[7,10]],[\"70\\\\d{8}\",[10]],0,[\"(?:3[0347]|55)\\\\d{8}\",[10]],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\\\d{6}\",[10]],[\"56\\\\d{8}\",[10]]]],\"GH\":[\"233\",\"00\",\"(?:[235]\\\\d{3}|800)\\\\d{5}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[235]\"],\"0$1\"]],\"0\"],\"GI\":[\"350\",\"00\",\"(?:[25]\\\\d\\\\d|606)\\\\d{5}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"2\"]]]],\"GL\":[\"299\",\"00\",\"(?:19|[2-689]\\\\d)\\\\d{4}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"19|[2-689]\"]]]],\"GM\":[\"220\",\"00\",\"[2-9]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"GN\":[\"224\",\"00\",\"722\\\\d{6}|(?:3|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"3\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[67]\"]]]],\"GP\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"590(?:0[1-68]|1[0-2]|2[0-68]|3[1289]|4[0-24-9]|5[3-579]|6[0189]|7[08]|8[0-689]|9\\\\d)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"GQ\":[\"240\",\"00\",\"222\\\\d{6}|(?:3\\\\d|55|[89]0)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235]\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[89]\"]]]],\"GR\":[\"30\",\"00\",\"5005000\\\\d{3}|8\\\\d{9,10}|(?:[269]\\\\d|70)\\\\d{8}\",[10,11],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"21|7\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2689]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"8\"]]]],\"GT\":[\"502\",\"00\",\"(?:1\\\\d{3}|[2-7])\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"GU\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|671|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([3-9]\\\\d{6})$\",\"671$1\",0,\"671\"],\"GW\":[\"245\",\"00\",\"[49]\\\\d{8}|4\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"40\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"]]]],\"GY\":[\"592\",\"001\",\"(?:862\\\\d|9008)\\\\d{3}|(?:[2-46]\\\\d|77)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-46-9]\"]]]],\"HK\":[\"852\",\"00(?:30|5[09]|[126-9]?)\",\"8[0-46-9]\\\\d{6,7}|9\\\\d{4}(?:\\\\d(?:\\\\d(?:\\\\d{4})?)?)?|(?:[235-79]\\\\d|46)\\\\d{6}\",[5,6,7,8,9,11],[[\"(\\\\d{3})(\\\\d{2,5})\",\"$1 $2\",[\"900\",\"9003\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]|8[1-4]|9(?:0[1-9]|[1-8])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"9\"]]],0,0,0,0,0,0,0,\"00\"],\"HN\":[\"504\",\"00\",\"8\\\\d{10}|[237-9]\\\\d{7}\",[8,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[237-9]\"]]]],\"HR\":[\"385\",\"00\",\"(?:[24-69]\\\\d|3[0-79])\\\\d{7}|80\\\\d{5,7}|[1-79]\\\\d{7}|6\\\\d{5,6}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"6[01]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-5]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"HT\":[\"509\",\"00\",\"[2-489]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-489]\"]]]],\"HU\":[\"36\",\"00\",\"[235-7]\\\\d{8}|[1-9]\\\\d{7}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]\"],\"(06 $1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"06 $1\"]],\"06\"],\"ID\":[\"62\",\"00[89]\",\"(?:(?:00[1-9]|8\\\\d)\\\\d{4}|[1-36])\\\\d{6}|00\\\\d{10}|[1-9]\\\\d{8,10}|[2-9]\\\\d{7}\",[7,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"15\"]],[\"(\\\\d{2})(\\\\d{5,9})\",\"$1 $2\",[\"2[124]|[36]1\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,7})\",\"$1 $2\",[\"800\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5,8})\",\"$1 $2\",[\"[2-79]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{3})\",\"$1-$2-$3\",[\"8[1-35-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6,8})\",\"$1 $2\",[\"1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"804\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"80\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1-$2-$3\",[\"8\"],\"0$1\"]],\"0\"],\"IE\":[\"353\",\"00\",\"(?:1\\\\d|[2569])\\\\d{6,8}|4\\\\d{6,9}|7\\\\d{8}|8\\\\d{8,9}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"2[24-9]|47|58|6[237-9]|9[35-9]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[45]0\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2569]|4[1-69]|7[14]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"70\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"81\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"4\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"IL\":[\"972\",\"0(?:0|1[2-9])\",\"1\\\\d{6}(?:\\\\d{3,5})?|[57]\\\\d{8}|[1-489]\\\\d{7}\",[7,8,9,10,11,12],[[\"(\\\\d{4})(\\\\d{3})\",\"$1-$2\",[\"125\"]],[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"121\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[2-489]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"12\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1-$2\",[\"159\"]],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3-$4\",[\"1[7-9]\"]],[\"(\\\\d{3})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3-$4\",[\"15\"]]],\"0\"],\"IM\":[\"44\",\"00\",\"1624\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"0|([25-8]\\\\d{5})$\",\"1624$1\",0,\"74576|(?:16|7[56])24\"],\"IN\":[\"91\",\"00\",\"(?:000800|[2-9]\\\\d\\\\d)\\\\d{7}|1\\\\d{7,12}\",[8,9,10,11,12,13],[[\"(\\\\d{8})\",\"$1\",[\"5(?:0|2[23]|3[03]|[67]1|88)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)\",\"5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)\"],0,1],[\"(\\\\d{4})(\\\\d{4,5})\",\"$1 $2\",[\"180\",\"1800\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"140\"],0,1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"11|2[02]|33|4[04]|79[1-7]|80[2-46]\",\"11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])\",\"11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]\",\"1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807\",\"1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]\",\"1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\\\d|7(?:1(?:[013-8]\\\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\\\d|5[0-367])|70[13-7]))[2-7]\"],\"0$1\",1],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"[6-9]\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{2,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1(?:6|8[06])\",\"1(?:6|8[06]0)\"],0,1],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"18\"],0,1]],\"0\"],\"IO\":[\"246\",\"00\",\"3\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"3\"]]]],\"IQ\":[\"964\",\"00\",\"(?:1|7\\\\d\\\\d)\\\\d{7}|[2-6]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"IR\":[\"98\",\"00\",\"[1-9]\\\\d{9}|(?:[1-8]\\\\d\\\\d|9)\\\\d{3,4}\",[4,5,6,7,10],[[\"(\\\\d{4,5})\",\"$1\",[\"96\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4,5})\",\"$1 $2\",[\"(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-8]\"],\"0$1\"]],\"0\"],\"IS\":[\"354\",\"00|1(?:0(?:01|[12]0)|100)\",\"(?:38\\\\d|[4-9])\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,0,\"00\"],\"IT\":[\"39\",\"00\",\"0\\\\d{5,10}|3[0-8]\\\\d{7,10}|55\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?|(?:1\\\\d|39)\\\\d{7,8}\",[6,7,8,9,10,11],[[\"(\\\\d{2})(\\\\d{4,6})\",\"$1 $2\",[\"0[26]\"]],[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"0[13-57-9][0159]|8(?:03|4[17]|9[245])\",\"0[13-57-9][0159]|8(?:03|4[17]|9(?:2|[45][0-4]))\"]],[\"(\\\\d{4})(\\\\d{2,6})\",\"$1 $2\",[\"0(?:[13-579][2-46-8]|8[236-8])\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"894\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[26]|5\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"1[4679]|[38]\"]],[\"(\\\\d{3})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"0[13-57-9][0159]\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{5})\",\"$1 $2 $3\",[\"0[26]\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"3\"]]],0,0,0,0,0,0,[[\"0669[0-79]\\\\d{1,6}|0(?:1(?:[0159]\\\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\\\d\\\\d|3(?:[0159]\\\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\\\d|6[0-8])|7(?:[0159]\\\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\\\d{2,7}\"],[\"3[1-9]\\\\d{8}|3[2-9]\\\\d{7}\",[9,10]],[\"80(?:0\\\\d{3}|3)\\\\d{3}\",[6,9]],[\"(?:0878\\\\d\\\\d|89(?:2|4[5-9]\\\\d))\\\\d{3}|89[45][0-4]\\\\d\\\\d|(?:1(?:44|6[346])|89(?:5[5-9]|9))\\\\d{6}\",[6,8,9,10]],[\"1(?:78\\\\d|99)\\\\d{6}\",[9,10]],0,0,0,[\"55\\\\d{8}\",[10]],[\"84(?:[08]\\\\d{3}|[17])\\\\d{3}\",[6,9]]]],\"JE\":[\"44\",\"00\",\"1534\\\\d{6}|(?:[3578]\\\\d|90)\\\\d{8}\",[10],0,\"0\",0,\"0|([0-24-8]\\\\d{5})$\",\"1534$1\",0,0,[[\"1534[0-24-8]\\\\d{5}\"],[\"7(?:(?:(?:50|82)9|937)\\\\d|7(?:00[378]|97[7-9]))\\\\d{5}\"],[\"80(?:07(?:35|81)|8901)\\\\d{4}\"],[\"(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\\\d{4}\"],[\"701511\\\\d{4}\"],0,[\"(?:3(?:0(?:07(?:35|81)|8901)|3\\\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\\\d{4})\\\\d{4}\"],[\"76(?:464|652)\\\\d{5}|76(?:0[0-2]|2[356]|34|4[01347]|5[49]|6[0-369]|77|81|9[139])\\\\d{6}\"],[\"56\\\\d{8}\"]]],\"JM\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|658|900)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"658|876\"],\"JO\":[\"962\",\"00\",\"(?:(?:[2689]|7\\\\d)\\\\d|32|53)\\\\d{6}\",[8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2356]|87\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"70\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"JP\":[\"81\",\"010\",\"00[1-9]\\\\d{6,14}|[257-9]\\\\d{9}|(?:00|[1-9]\\\\d\\\\d)\\\\d{6}\",[8,9,10,11,12,13,14,15,16,17],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1-$2-$3\",[\"(?:12|57|99)0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51|63)|9(?:49|80|9[16])\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9]|636)|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]\",\"1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9]|636[457-9])|9(?:496|802|9(?:1[23]|69))|1(?:45|58)[67]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"60\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[36]|4(?:2[09]|7[01])\",\"[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[27-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9])|5(?:2|3[045]|4[0-369]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|49|51|6(?:[0-24]|36|5[0-3589]|72|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:49|55|83)[29]|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]\",\"1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|7[015-9]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17|3[015-9]))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3[045]|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9(?:[019]|4[1-3]|6(?:[0-47-9]|5[01346-9])))|3(?:[29]|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[23]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|72|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|829(?:2|66)|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3\",[\"[14]|[289][2-9]|5[3-9]|7[2-4679]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"800\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[257-9]\"],\"0$1\"]],\"0\"],\"KE\":[\"254\",\"000\",\"(?:[17]\\\\d\\\\d|900)\\\\d{6}|(?:2|80)0\\\\d{6,7}|[4-6]\\\\d{6,8}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"[24-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[17]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\"],\"KG\":[\"996\",\"00\",\"8\\\\d{9}|(?:[235-8]\\\\d|99)\\\\d{7}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"3(?:1[346]|[24-79])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[235-79]|88\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d)(\\\\d{2,3})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"KH\":[\"855\",\"00[14-9]\",\"1\\\\d{9}|[1-9]\\\\d{7,8}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"KI\":[\"686\",\"00\",\"(?:[37]\\\\d|6[0-79])\\\\d{6}|(?:[2-48]\\\\d|50)\\\\d{3}\",[5,8],0,\"0\"],\"KM\":[\"269\",\"00\",\"[3478]\\\\d{6}\",[7],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[3478]\"]]]],\"KN\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"869$1\",0,\"869\"],\"KP\":[\"850\",\"00|99\",\"85\\\\d{6}|(?:19\\\\d|[2-7])\\\\d{7}\",[8,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-7]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"KR\":[\"82\",\"00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))\",\"00[1-9]\\\\d{8,11}|(?:[12]|5\\\\d{3})\\\\d{7}|[13-6]\\\\d{9}|(?:[1-6]\\\\d|80)\\\\d{7}|[3-6]\\\\d{4,5}|(?:00|7)0\\\\d{8}\",[5,6,8,9,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1-$2\",[\"(?:3[1-3]|[46][1-4]|5[1-5])1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"1\"]],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1-$2-$3\",[\"60|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1-$2-$3\",[\"[1346]|5[1-5]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2-$3\",[\"[57]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})(\\\\d{4})\",\"$1-$2-$3\",[\"5\"],\"0$1\"]],\"0\",0,\"0(8(?:[1-46-8]|5\\\\d\\\\d))?\"],\"KW\":[\"965\",\"00\",\"(?:18|[2569]\\\\d\\\\d)\\\\d{5}\",[7,8],[[\"(\\\\d{4})(\\\\d{3,4})\",\"$1 $2\",[\"[169]|2(?:[235]|4[1-35-9])|52\"]],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[25]\"]]]],\"KY\":[\"1\",\"011\",\"(?:345|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"345$1\",0,\"345\"],\"KZ\":[\"7\",\"810\",\"33622\\\\d{5}|(?:7\\\\d|80)\\\\d{8}\",[10],0,\"8\",0,0,0,0,\"33|7\",0,\"8~10\"],\"LA\":[\"856\",\"00\",\"[23]\\\\d{9}|3\\\\d{8}|(?:[235-8]\\\\d|41)\\\\d{6}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2[13]|3[14]|[4-8]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"30[013-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\"],\"LB\":[\"961\",\"00\",\"[27-9]\\\\d{7}|[13-9]\\\\d{6}\",[7,8],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[27-9]\"]]],\"0\"],\"LC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|758|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-8]\\\\d{6})$\",\"758$1\",0,\"758\"],\"LI\":[\"423\",\"00\",\"90\\\\d{5}|(?:[2378]|6\\\\d\\\\d)\\\\d{6}\",[7,9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[237-9]\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"69\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]]],\"0\",0,\"0|(1001)\"],\"LK\":[\"94\",\"00\",\"[1-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[1-689]\"],\"0$1\"]],\"0\"],\"LR\":[\"231\",\"00\",\"(?:2|33|5\\\\d|77|88)\\\\d{7}|[4-6]\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[4-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3578]\"],\"0$1\"]],\"0\"],\"LS\":[\"266\",\"00\",\"(?:[256]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2568]\"]]]],\"LT\":[\"370\",\"00\",\"(?:[3469]\\\\d|52|[78]0)\\\\d{6}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"52[0-7]\"],\"(8-$1)\",1],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"8 $1\",1],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"37|4(?:[15]|6[1-8])\"],\"(8-$1)\",1],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[3-6]\"],\"(8-$1)\",1]],\"8\",0,\"[08]\"],\"LU\":[\"352\",\"00\",\"35[013-9]\\\\d{4,8}|6\\\\d{8}|35\\\\d{2,4}|(?:[2457-9]\\\\d|3[0-46-9])\\\\d{2,9}\",[4,5,6,7,8,9,10,11],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"20[2-689]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"80[01]|90[015]\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"20\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,2})\",\"$1 $2 $3 $4 $5\",[\"2(?:[0367]|4[3-8])\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{1,5})\",\"$1 $2 $3 $4\",[\"[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]\"]]],0,0,\"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\\\d)\"],\"LV\":[\"371\",\"00\",\"(?:[268]\\\\d|90)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[269]|8[01]\"]]]],\"LY\":[\"218\",\"00\",\"[2-9]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MA\":[\"212\",\"00\",\"[5-8]\\\\d{8}\",[9],[[\"(\\\\d{5})(\\\\d{4})\",\"$1-$2\",[\"5(?:29|38)\",\"5(?:29|38)[89]\",\"5(?:29|38)[89]0\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5[45]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1-$2\",[\"5(?:2[2-489]|3[5-9]|9)|892\",\"5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1-$2\",[\"8\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1-$2\",[\"[5-7]\"],\"0$1\"]],\"0\",0,0,0,0,0,[[\"5(?:29(?:[189][05]|2[29]|3[01])|38[89][05])\\\\d{4}|5(?:2(?:[015-7]\\\\d|2[02-9]|3[0-578]|4[02-46-8]|8[0235-7]|90)|3(?:[0-47]\\\\d|5[02-9]|6[02-8]|80|9[3-9])|(?:4[067]|5[03])\\\\d)\\\\d{5}\"],[\"(?:6(?:[0-79]\\\\d|8[0-247-9])|7(?:0\\\\d|10|6[1267]|7[0-57]))\\\\d{6}\"],[\"80\\\\d{7}\"],[\"89\\\\d{7}\"],0,0,0,0,[\"592(?:4[0-2]|93)\\\\d{4}\"]]],\"MC\":[\"377\",\"00\",\"(?:[3489]|6\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"4\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[389]\"]],[\"(\\\\d)(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4 $5\",[\"6\"],\"0$1\"]],\"0\"],\"MD\":[\"373\",\"00\",\"(?:[235-7]\\\\d|[89]0)\\\\d{6}\",[8],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"22|3\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[25-7]\"],\"0$1\"]],\"0\"],\"ME\":[\"382\",\"00\",\"(?:20|[3-79]\\\\d)\\\\d{6}|80\\\\d{6,7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[2-9]\"],\"0$1\"]],\"0\"],\"MF\":[\"590\",\"00\",\"(?:590|(?:69|80)\\\\d|976)\\\\d{6}\",[9],0,\"0\",0,0,0,0,0,[[\"590(?:0[079]|[14]3|[27][79]|30|5[0-268]|87)\\\\d{4}\"],[\"69(?:0\\\\d\\\\d|1(?:2[2-9]|3[0-5]))\\\\d{4}\"],[\"80[0-5]\\\\d{6}\"],0,0,0,0,0,[\"976[01]\\\\d{5}\"]]],\"MG\":[\"261\",\"00\",\"[23]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[23]\"],\"0$1\"]],\"0\",0,\"0|([24-9]\\\\d{6})$\",\"20$1\"],\"MH\":[\"692\",\"011\",\"329\\\\d{4}|(?:[256]\\\\d|45)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[2-6]\"]]],\"1\"],\"MK\":[\"389\",\"00\",\"[2-578]\\\\d{7}\",[8],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[347]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[58]\"],\"0$1\"]],\"0\"],\"ML\":[\"223\",\"00\",\"[24-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24-9]\"]]]],\"MM\":[\"95\",\"00\",\"1\\\\d{5,7}|95\\\\d{6}|(?:[4-7]|9[0-46-9])\\\\d{6,8}|(?:2|8\\\\d)\\\\d{5,8}\",[6,7,8,9,10],[[\"(\\\\d)(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"16|2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[12]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[4-7]|8[1-35]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4,6})\",\"$1 $2 $3\",[\"9(?:2[0-4]|[35-9]|4[137-9])\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"92\"],\"0$1\"],[\"(\\\\d)(\\\\d{5})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"],\"0$1\"]],\"0\"],\"MN\":[\"976\",\"001\",\"[12]\\\\d{7,9}|[57-9]\\\\d{7}\",[8,9,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[12]1\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[57-9]\"]],[\"(\\\\d{3})(\\\\d{5,6})\",\"$1 $2\",[\"[12]2[1-3]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5,6})\",\"$1 $2\",[\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])\",\"[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]\"],\"0$1\"],[\"(\\\\d{5})(\\\\d{4,5})\",\"$1 $2\",[\"[12]\"],\"0$1\"]],\"0\"],\"MO\":[\"853\",\"00\",\"(?:28|[68]\\\\d)\\\\d{6}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[268]\"]]]],\"MP\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:67|90)0\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"670$1\",0,\"670\"],\"MQ\":[\"596\",\"00\",\"(?:69|80)\\\\d{7}|(?:59|97)6\\\\d{6}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[569]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"MR\":[\"222\",\"00\",\"(?:[2-4]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2-48]\"]]]],\"MS\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|664|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([34]\\\\d{6})$\",\"664$1\",0,\"664\"],\"MT\":[\"356\",\"00\",\"3550\\\\d{4}|(?:[2579]\\\\d\\\\d|800)\\\\d{5}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2357-9]\"]]]],\"MU\":[\"230\",\"0(?:0|[24-7]0|3[03])\",\"(?:[2-468]|5\\\\d)\\\\d{6}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-46]|8[013]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"5\"]]],0,0,0,0,0,0,0,\"020\"],\"MV\":[\"960\",\"0(?:0|19)\",\"(?:800|9[0-57-9]\\\\d)\\\\d{7}|[34679]\\\\d{6}\",[7,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[3467]|9[13-9]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]],0,0,0,0,0,0,0,\"00\"],\"MW\":[\"265\",\"00\",\"1\\\\d{6}(?:\\\\d{2})?|(?:[23]1|77|88|99)\\\\d{7}\",[7,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[137-9]\"],\"0$1\"]],\"0\"],\"MX\":[\"52\",\"0[09]\",\"(?:1(?:[01467]\\\\d|[2359][1-9]|8[1-79])|[2-9]\\\\d)\\\\d{8}\",[10,11],[[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"33|5[56]|81\"],0,1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2-9]\"],0,1],[\"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$2 $3 $4\",[\"1(?:33|5[56]|81)\"],0,1],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$2 $3 $4\",[\"1\"],0,1]],\"01\",0,\"0(?:[12]|4[45])|1\",0,0,0,0,\"00\"],\"MY\":[\"60\",\"00\",\"1\\\\d{8,9}|(?:3\\\\d|[4-9])\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"[4-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1-$2 $3\",[\"1(?:[02469]|[378][1-9])|8\"],\"0$1\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"3\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1-$2-$3-$4\",[\"1[36-8]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"15\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1-$2 $3\",[\"1\"],\"0$1\"]],\"0\"],\"MZ\":[\"258\",\"00\",\"(?:2|8\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2|8[2-79]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"8\"]]]],\"NA\":[\"264\",\"00\",\"[68]\\\\d{7,8}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"88\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"87\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"NC\":[\"687\",\"00\",\"[2-57-9]\\\\d{5}\",[6],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1.$2.$3\",[\"[2-57-9]\"]]]],\"NE\":[\"227\",\"00\",\"[027-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"08\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[089]|2[013]|7[04]\"]]]],\"NF\":[\"672\",\"00\",\"[13]\\\\d{5}\",[6],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"1[0-3]\"]],[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"[13]\"]]],0,0,\"([0-258]\\\\d{4})$\",\"3$1\"],\"NG\":[\"234\",\"009\",\"(?:[124-7]|9\\\\d{3})\\\\d{6}|[1-9]\\\\d{7}|[78]\\\\d{9,13}\",[7,8,10,11,12,13,14],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"78\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[12]|9(?:0[3-9]|[1-9])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[3-7]|8[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})(\\\\d{5,6})\",\"$1 $2 $3\",[\"[78]\"],\"0$1\"]],\"0\"],\"NI\":[\"505\",\"00\",\"(?:1800|[25-8]\\\\d{3})\\\\d{4}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[125-8]\"]]]],\"NL\":[\"31\",\"00\",\"(?:[124-7]\\\\d\\\\d|3(?:[02-9]\\\\d|1[0-8]))\\\\d{6}|[89]\\\\d{6,9}|1\\\\d{4,5}\",[5,6,7,8,9,10],[[\"(\\\\d{3})(\\\\d{4,7})\",\"$1 $2\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"66\"],\"0$1\"],[\"(\\\\d)(\\\\d{8})\",\"$1 $2\",[\"6\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1[16-8]|2[259]|3[124]|4[17-9]|5[124679]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-57-9]\"],\"0$1\"]],\"0\"],\"NO\":[\"47\",\"00\",\"(?:0|[2-9]\\\\d{3})\\\\d{4}\",[5,8],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"[489]|59\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[235-7]\"]]],0,0,0,0,0,\"[02-689]|7[0-8]\"],\"NP\":[\"977\",\"00\",\"(?:1\\\\d|9)\\\\d{9}|[1-9]\\\\d{7}\",[8,10,11],[[\"(\\\\d)(\\\\d{7})\",\"$1-$2\",[\"1[2-6]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1-$2\",[\"1[01]|[2-8]|9(?:[1-579]|6[2-6])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"9\"]]],\"0\"],\"NR\":[\"674\",\"00\",\"(?:444|(?:55|8\\\\d)\\\\d|666)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[4-68]\"]]]],\"NU\":[\"683\",\"00\",\"(?:[47]|888\\\\d)\\\\d{3}\",[4,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"8\"]]]],\"NZ\":[\"64\",\"0(?:0|161)\",\"[29]\\\\d{7,9}|50\\\\d{5}(?:\\\\d{2,3})?|6[0-35-9]\\\\d{6}|7\\\\d{7,8}|8\\\\d{4,9}|(?:11\\\\d|[34])\\\\d{7}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,8})\",\"$1 $2\",[\"8[1-579]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"50[036-8]|[89]0\",\"50(?:[0367]|88)|[89]0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1-$2 $3\",[\"24|[346]|7[2-57-9]|9[2-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:10|74)|[59]|80\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1|2[028]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,5})\",\"$1 $2 $3\",[\"2(?:[169]|7[0-35-9])|7|86\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"00\"],\"OM\":[\"968\",\"00\",\"(?:1505|[279]\\\\d{3}|500)\\\\d{4}|800\\\\d{5,6}\",[7,8,9],[[\"(\\\\d{3})(\\\\d{4,6})\",\"$1 $2\",[\"[58]\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[179]\"]]]],\"PA\":[\"507\",\"00\",\"8\\\\d{9}|[68]\\\\d{7}|[1-57-9]\\\\d{6}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[1-57-9]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1-$2\",[\"[68]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]]],\"PE\":[\"51\",\"19(?:1[124]|77|90)00\",\"(?:[14-8]|9\\\\d)\\\\d{7}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"1\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[4-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"]]],\"0\",0,0,0,0,0,0,0,\" Anexo \"],\"PF\":[\"689\",\"00\",\"4\\\\d{5}(?:\\\\d{2})?|8\\\\d{7,8}\",[6,8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"44\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"4|8[7-9]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"PG\":[\"675\",\"00|140[1-3]\",\"(?:180|[78]\\\\d{3})\\\\d{4}|(?:[2-589]\\\\d|64)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"18|[2-69]|85\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[78]\"]]],0,0,0,0,0,0,0,\"00\"],\"PH\":[\"63\",\"00\",\"1800\\\\d{7,9}|(?:2|[89]\\\\d{4})\\\\d{5}|[2-8]\\\\d{8}|[28]\\\\d{7}\",[6,8,9,10,11,12,13],[[\"(\\\\d)(\\\\d{5})\",\"$1 $2\",[\"2\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"(0$1)\"],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2\",\"3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"346|4(?:27|9[35])|883\",\"3469|4(?:279|9(?:30|56))|8834\"],\"(0$1)\"],[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[3-7]|8[2-8]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{4})(\\\\d{1,2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3 $4\",[\"1\"]]],\"0\"],\"PK\":[\"92\",\"00\",\"122\\\\d{6}|[24-8]\\\\d{10,11}|9(?:[013-9]\\\\d{8,10}|2(?:[01]\\\\d\\\\d|2(?:[06-8]\\\\d|1[01]))\\\\d{7})|(?:[2-8]\\\\d{3}|92(?:[0-7]\\\\d|8[1-9]))\\\\d{6}|[24-9]\\\\d{8}|[89]\\\\d{7}\",[8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{2,7})\",\"$1 $2 $3\",[\"[89]0\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"1\"]],[\"(\\\\d{3})(\\\\d{6,7})\",\"$1 $2\",[\"2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])\",\"9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{7,8})\",\"$1 $2\",[\"(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]\"],\"(0$1)\"],[\"(\\\\d{5})(\\\\d{5})\",\"$1 $2\",[\"58\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{7})\",\"$1 $2\",[\"3\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"[24-9]\"],\"(0$1)\"]],\"0\"],\"PL\":[\"48\",\"00\",\"6\\\\d{5}(?:\\\\d{2})?|8\\\\d{9}|[1-9]\\\\d{6}(?:\\\\d{2})?\",[6,7,8,9,10],[[\"(\\\\d{5})\",\"$1\",[\"19\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"11|64\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1 $2 $3\",[\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1\",\"(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"64\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"1[2-8]|[2-7]|8[1-79]|9[145]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"8\"]]]],\"PM\":[\"508\",\"00\",\"(?:[45]|80\\\\d\\\\d)\\\\d{5}\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[45]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"],\"0$1\"]],\"0\"],\"PR\":[\"1\",\"011\",\"(?:[589]\\\\d\\\\d|787)\\\\d{7}\",[10],0,\"1\",0,0,0,0,\"787|939\"],\"PS\":[\"970\",\"00\",\"[2489]2\\\\d{6}|(?:1\\\\d|5)\\\\d{8}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[2489]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"PT\":[\"351\",\"00\",\"1693\\\\d{5}|(?:[26-9]\\\\d|30)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2[12]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"16|[236-9]\"]]]],\"PW\":[\"680\",\"01[12]\",\"(?:[24-8]\\\\d\\\\d|345|900)\\\\d{4}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-9]\"]]]],\"PY\":[\"595\",\"00\",\"59\\\\d{4,6}|9\\\\d{5,10}|(?:[2-46-8]\\\\d|5[0-8])\\\\d{4,7}\",[6,7,8,9,10,11],[[\"(\\\\d{3})(\\\\d{3,6})\",\"$1 $2\",[\"[2-9]0\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{3})(\\\\d{4,5})\",\"$1 $2\",[\"2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"87\"]],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"9(?:[5-79]|8[1-6])\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-8]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"9\"]]],\"0\"],\"QA\":[\"974\",\"00\",\"[2-7]\\\\d{7}|(?:2\\\\d\\\\d|800)\\\\d{4}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"2[126]|8\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[2-7]\"]]]],\"RE\":[\"262\",\"00\",\"9769\\\\d{5}|(?:26|[68]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2689]\"],\"0$1\"]],\"0\",0,0,0,0,\"26[23]|69|[89]\"],\"RO\":[\"40\",\"00\",\"(?:[237]\\\\d|[89]0)\\\\d{7}|[23]\\\\d{5}\",[6,9],[[\"(\\\\d{3})(\\\\d{3})\",\"$1 $2\",[\"2[3-6]\",\"2[3-6]\\\\d9\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"219|31\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[23]1\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[237-9]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\" int \"],\"RS\":[\"381\",\"00\",\"38[02-9]\\\\d{6,9}|6\\\\d{7,9}|90\\\\d{4,8}|38\\\\d{5,6}|(?:7\\\\d\\\\d|800)\\\\d{3,9}|(?:[12]\\\\d|3[0-79])\\\\d{5,10}\",[6,7,8,9,10,11,12],[[\"(\\\\d{3})(\\\\d{3,9})\",\"$1 $2\",[\"(?:2[389]|39)0|[7-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{5,10})\",\"$1 $2\",[\"[1-36]\"],\"0$1\"]],\"0\"],\"RU\":[\"7\",\"810\",\"[347-9]\\\\d{9}\",[10],[[\"(\\\\d{4})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-8]|2[1-9])\",\"7(?:1(?:[0-6]2|7|8[27])|2(?:1[23]|[2-9]2))\",\"7(?:1(?:[0-6]2|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2\"],\"8 ($1)\",1],[\"(\\\\d{5})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"7(?:1[0-68]|2[1-9])\",\"7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))\",\"7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"8 ($1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[3489]\"],\"8 ($1)\",1]],\"8\",0,0,0,0,\"3[04-689]|[489]\",0,\"8~10\"],\"RW\":[\"250\",\"00\",\"(?:06|[27]\\\\d\\\\d|[89]00)\\\\d{6}\",[8,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"0\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[7-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"]]],\"0\"],\"SA\":[\"966\",\"00\",\"92\\\\d{7}|(?:[15]|8\\\\d)\\\\d{8}\",[9,10],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"9\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"81\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]]],\"0\"],\"SB\":[\"677\",\"0[01]\",\"(?:[1-6]|[7-9]\\\\d\\\\d)\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7|8[4-9]|9(?:[1-8]|9[0-8])\"]]]],\"SC\":[\"248\",\"010|0[0-2]\",\"8000\\\\d{3}|(?:[249]\\\\d|64)\\\\d{5}\",[7],[[\"(\\\\d)(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[246]|9[57]\"]]],0,0,0,0,0,0,0,\"00\"],\"SD\":[\"249\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"SE\":[\"46\",\"00\",\"(?:[26]\\\\d\\\\d|9)\\\\d{9}|[1-9]\\\\d{8}|[1-689]\\\\d{7}|[1-4689]\\\\d{6}|2\\\\d{5}\",[6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"20\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"9(?:00|39|44)\"],\"0$1\",0,\"$1 $2\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3\",[\"[12][136]|3[356]|4[0246]|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d)(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{2})\",\"$1-$2 $3\",[\"1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{3})(\\\\d{2,3})(\\\\d{3})\",\"$1-$2 $3\",[\"9(?:00|39|44)\"],\"0$1\",0,\"$1 $2 $3\"],[\"(\\\\d{2})(\\\\d{2,3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"10|7\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"8\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4\",[\"[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{3})\",\"$1-$2 $3 $4\",[\"9\"],\"0$1\",0,\"$1 $2 $3 $4\"],[\"(\\\\d{3})(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1-$2 $3 $4 $5\",[\"[26]\"],\"0$1\",0,\"$1 $2 $3 $4 $5\"]],\"0\"],\"SG\":[\"65\",\"0[0-3]\\\\d\",\"(?:(?:1\\\\d|8)\\\\d\\\\d|7000)\\\\d{7}|[3689]\\\\d{7}\",[8,10,11],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[369]|8(?:0[1-3]|[1-9])\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"]],[\"(\\\\d{4})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]]]],\"SH\":[\"290\",\"00\",\"(?:[256]\\\\d|8)\\\\d{3}\",[4,5],0,0,0,0,0,0,\"[256]\"],\"SI\":[\"386\",\"00|10(?:22|66|88|99)\",\"[1-7]\\\\d{7}|8\\\\d{4,7}|90\\\\d{4,6}\",[5,6,7,8],[[\"(\\\\d{2})(\\\\d{3,6})\",\"$1 $2\",[\"8[09]|9\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"59|8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[37][01]|4[0139]|51|6\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[1-57]\"],\"(0$1)\"]],\"0\",0,0,0,0,0,0,\"00\"],\"SJ\":[\"47\",\"00\",\"0\\\\d{4}|(?:[489]\\\\d|[57]9)\\\\d{6}\",[5,8],0,0,0,0,0,0,\"79\"],\"SK\":[\"421\",\"00\",\"[2-689]\\\\d{8}|[2-59]\\\\d{6}|[2-5]\\\\d{5}\",[6,7,9],[[\"(\\\\d)(\\\\d{2})(\\\\d{3,4})\",\"$1 $2 $3\",[\"21\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{2})(\\\\d{2,3})\",\"$1 $2 $3\",[\"[3-5][1-8]1\",\"[3-5][1-8]1[67]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{3})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"2\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[689]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1/$2 $3 $4\",[\"[3-5]\"],\"0$1\"]],\"0\"],\"SL\":[\"232\",\"00\",\"(?:[2378]\\\\d|66|99)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"[236-9]\"],\"(0$1)\"]],\"0\"],\"SM\":[\"378\",\"00\",\"(?:0549|[5-7]\\\\d)\\\\d{6}\",[8,10],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[5-7]\"]],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"0\"]]],0,0,\"([89]\\\\d{5})$\",\"0549$1\"],\"SN\":[\"221\",\"00\",\"(?:[378]\\\\d{4}|93330)\\\\d{4}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[379]\"]]]],\"SO\":[\"252\",\"00\",\"[346-9]\\\\d{8}|[12679]\\\\d{7}|[1-5]\\\\d{6}|[1348]\\\\d{5}\",[6,7,8,9],[[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"8[125]\"]],[\"(\\\\d{6})\",\"$1\",[\"[134]\"]],[\"(\\\\d)(\\\\d{6})\",\"$1 $2\",[\"[15]|2[0-79]|3[0-46-8]|4[0-7]\"]],[\"(\\\\d)(\\\\d{7})\",\"$1 $2\",[\"24|[67]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[3478]|64|90\"]],[\"(\\\\d{2})(\\\\d{5,7})\",\"$1 $2\",[\"1|28|6[1-35-9]|9[2-9]\"]]],\"0\"],\"SR\":[\"597\",\"00\",\"(?:[2-5]|68|[78]\\\\d)\\\\d{5}\",[6,7],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1-$2-$3\",[\"56\"]],[\"(\\\\d{3})(\\\\d{3})\",\"$1-$2\",[\"[2-5]\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1-$2\",[\"[6-8]\"]]]],\"SS\":[\"211\",\"00\",\"[19]\\\\d{8}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[19]\"],\"0$1\"]],\"0\"],\"ST\":[\"239\",\"00\",\"(?:22|9\\\\d)\\\\d{5}\",[7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[29]\"]]]],\"SV\":[\"503\",\"00\",\"[267]\\\\d{7}|[89]00\\\\d{4}(?:\\\\d{4})?\",[7,8,11],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[89]\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[267]\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"]]]],\"SX\":[\"1\",\"011\",\"7215\\\\d{6}|(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|(5\\\\d{6})$\",\"721$1\",0,\"721\"],\"SY\":[\"963\",\"00\",\"[1-39]\\\\d{8}|[1-5]\\\\d{7}\",[8,9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-5]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\",1]],\"0\"],\"SZ\":[\"268\",\"00\",\"0800\\\\d{4}|(?:[237]\\\\d|900)\\\\d{6}\",[8,9],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[0237]\"]],[\"(\\\\d{5})(\\\\d{4})\",\"$1 $2\",[\"9\"]]]],\"TA\":[\"290\",\"00\",\"8\\\\d{3}\",[4],0,0,0,0,0,0,\"8\"],\"TC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|649|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-479]\\\\d{6})$\",\"649$1\",0,\"649\"],\"TD\":[\"235\",\"00|16\",\"(?:22|[69]\\\\d|77)\\\\d{6}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[2679]\"]]],0,0,0,0,0,0,0,\"00\"],\"TG\":[\"228\",\"00\",\"[279]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[279]\"]]]],\"TH\":[\"66\",\"00[1-9]\",\"1\\\\d{9}|[1689]\\\\d{8}|[1-57]\\\\d{7}\",[8,9,10],[[\"(\\\\d)(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"2\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[13-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"1\"]]],\"0\"],\"TJ\":[\"992\",\"810\",\"(?:[02]0|11|[3-57-9]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{6})(\\\\d)(\\\\d{2})\",\"$1 $2 $3\",[\"331\",\"3317\"],0,1],[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[34]7|91[78]\"],0,1],[\"(\\\\d{4})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"3[1-5]\"],0,1],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[02-57-9]|11\"],0,1]],\"8\",0,0,0,0,0,0,\"8~10\"],\"TK\":[\"690\",\"00\",\"[2-47]\\\\d{3,6}\",[4,5,6,7]],\"TL\":[\"670\",\"00\",\"7\\\\d{7}|(?:[2-47]\\\\d|[89]0)\\\\d{5}\",[7,8],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[2-489]|70\"]],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"7\"]]]],\"TM\":[\"993\",\"810\",\"[1-6]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"12\"],\"(8 $1)\"],[\"(\\\\d{3})(\\\\d)(\\\\d{2})(\\\\d{2})\",\"$1 $2-$3-$4\",[\"[1-5]\"],\"(8 $1)\"],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"6\"],\"8 $1\"]],\"8\",0,0,0,0,0,0,\"8~10\"],\"TN\":[\"216\",\"00\",\"[2-57-9]\\\\d{7}\",[8],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-57-9]\"]]]],\"TO\":[\"676\",\"00\",\"(?:0800|(?:[5-8]\\\\d\\\\d|999)\\\\d)\\\\d{3}|[2-8]\\\\d{4}\",[5,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1-$2\",[\"[2-4]|50|6[09]|7[0-24-69]|8[05]\"]],[\"(\\\\d{4})(\\\\d{3})\",\"$1 $2\",[\"0\"]],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[5-9]\"]]]],\"TR\":[\"90\",\"00\",\"4\\\\d{6}|8\\\\d{11,12}|(?:[2-58]\\\\d\\\\d|900)\\\\d{7}\",[7,10,12,13],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"512|8[01589]|90\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"5(?:[0-59]|61)\",\"5(?:[0-59]|616)\",\"5(?:[0-59]|6161)\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[24][1-8]|3[1-9]\"],\"(0$1)\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{6,7})\",\"$1 $2 $3\",[\"80\"],\"0$1\",1]],\"0\"],\"TT\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-46-8]\\\\d{6})$\",\"868$1\",0,\"868\"],\"TV\":[\"688\",\"00\",\"(?:2|7\\\\d\\\\d|90)\\\\d{4}\",[5,6,7],[[\"(\\\\d{2})(\\\\d{3})\",\"$1 $2\",[\"2\"]],[\"(\\\\d{2})(\\\\d{4})\",\"$1 $2\",[\"90\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"TW\":[\"886\",\"0(?:0[25-79]|19)\",\"[2-689]\\\\d{8}|7\\\\d{9,10}|[2-8]\\\\d{7}|2\\\\d{6}\",[7,8,9,10,11],[[\"(\\\\d{2})(\\\\d)(\\\\d{4})\",\"$1 $2 $3\",[\"202\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[258]0\"],\"0$1\"],[\"(\\\\d)(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]\",\"[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4,5})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\",0,0,0,0,0,0,0,\"#\"],\"TZ\":[\"255\",\"00[056]\",\"(?:[26-8]\\\\d|41|90)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[24]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[67]\"],\"0$1\"]],\"0\"],\"UA\":[\"380\",\"00\",\"[89]\\\\d{9}|[3-9]\\\\d{8}\",[9,10],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]\",\"6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4[45][0-5]|5(?:0|6[37])|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]\",\"4[45][0-5]|5(?:0|6(?:3[14-7]|7))|6(?:[12][018]|[36-8])|7|89|9[1-9]|(?:48|57)[0137-9]\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"[3-6]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[89]\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"0~0\"],\"UG\":[\"256\",\"00[057]\",\"800\\\\d{6}|(?:[29]0|[347]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{4})(\\\\d{5})\",\"$1 $2\",[\"202\",\"2024\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{6})\",\"$1 $2\",[\"[27-9]|4(?:6[45]|[7-9])\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[34]\"],\"0$1\"]],\"0\"],\"US\":[\"1\",\"011\",\"[2-9]\\\\d{9}\",[10],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"($1) $2-$3\",[\"[2-9]\"],0,1,\"$1-$2-$3\"]],\"1\",0,0,0,0,0,[[\"(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[12]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[02357]|58|6[39]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[19]|6[1-47]|7[013-5]|8[056])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[0179]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[02-59]|8[156])|8(?:0[1-68]|1[02-8]|2[08]|3[0-289]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01579]|5[12469]|7[0-389]|8[04-69]))[2-9]\\\\d{6}\"],[\"\"],[\"8(?:00|33|44|55|66|77|88)[2-9]\\\\d{6}\"],[\"900[2-9]\\\\d{6}\"],[\"52(?:3(?:[2-46-9][02-9]\\\\d|5(?:[02-46-9]\\\\d|5[0-46-9]))|4(?:[2-478][02-9]\\\\d|5(?:[034]\\\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\\\d)|9(?:[05-9]\\\\d|2[0-5]|49)))\\\\d{4}|52[34][2-9]1[02-9]\\\\d{4}|5(?:00|2[12]|33|44|66|77|88)[2-9]\\\\d{6}\"]]],\"UY\":[\"598\",\"0(?:0|1[3-9]\\\\d)\",\"4\\\\d{9}|[249]\\\\d{7}|(?:[49]\\\\d|80)\\\\d{5}\",[7,8,10],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"405|8|90\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"9\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[24]\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"4\"],\"0$1\"]],\"0\",0,0,0,0,0,0,\"00\",\" int. \"],\"UZ\":[\"998\",\"810\",\"55501\\\\d{4}|(?:33|[679]\\\\d|88)\\\\d{7}\",[9],[[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[35-9]\"],\"8 $1\"]],\"8\",0,0,0,0,0,0,\"8~10\"],\"VA\":[\"39\",\"00\",\"0\\\\d{5,10}|3[0-8]\\\\d{7,10}|55\\\\d{8}|8\\\\d{5}(?:\\\\d{2,4})?|(?:1\\\\d|39)\\\\d{7,8}\",[6,7,8,9,10,11],0,0,0,0,0,0,\"06698\"],\"VC\":[\"1\",\"011\",\"(?:[58]\\\\d\\\\d|784|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-7]\\\\d{6})$\",\"784$1\",0,\"784\"],\"VE\":[\"58\",\"00\",\"[68]00\\\\d{7}|(?:[24]\\\\d|[59]0)\\\\d{8}\",[10],[[\"(\\\\d{3})(\\\\d{7})\",\"$1-$2\",[\"[24-689]\"],\"0$1\"]],\"0\"],\"VG\":[\"1\",\"011\",\"(?:284|[58]\\\\d\\\\d|900)\\\\d{7}\",[10],0,\"1\",0,\"1|([2-578]\\\\d{6})$\",\"284$1\",0,\"284\"],\"VI\":[\"1\",\"011\",\"[58]\\\\d{9}|(?:34|90)0\\\\d{7}\",[10],0,\"1\",0,\"1|([2-9]\\\\d{6})$\",\"340$1\",0,\"340\"],\"VN\":[\"84\",\"00\",\"[12]\\\\d{9}|[135-9]\\\\d{8}|[16]\\\\d{7}|[16-8]\\\\d{6}\",[7,8,9,10],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"80\"],\"0$1\",1],[\"(\\\\d{4})(\\\\d{4,6})\",\"$1 $2\",[\"1\"],0,1],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"[69]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[3578]\"],\"0$1\",1],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"2[48]\"],\"0$1\",1],[\"(\\\\d{3})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"2\"],\"0$1\",1]],\"0\"],\"VU\":[\"678\",\"00\",\"[48]8\\\\d{3}|(?:[23]|[579]\\\\d\\\\d)\\\\d{4}\",[5,7],[[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"[579]\"]]]],\"WF\":[\"681\",\"00\",\"(?:40|72)\\\\d{4}|8\\\\d{5}(?:\\\\d{3})?\",[6,9],[[\"(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3\",[\"[478]\"]],[\"(\\\\d{3})(\\\\d{2})(\\\\d{2})(\\\\d{2})\",\"$1 $2 $3 $4\",[\"8\"]]]],\"WS\":[\"685\",\"0\",\"(?:[2-6]|8\\\\d{5})\\\\d{4}|[78]\\\\d{6}|[68]\\\\d{5}\",[5,6,7,10],[[\"(\\\\d{5})\",\"$1\",[\"[2-5]|6[1-9]\"]],[\"(\\\\d{3})(\\\\d{3,7})\",\"$1 $2\",[\"[68]\"]],[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"7\"]]]],\"XK\":[\"383\",\"00\",\"[23]\\\\d{7,8}|(?:4\\\\d\\\\d|[89]00)\\\\d{5}\",[8,9],[[\"(\\\\d{3})(\\\\d{5})\",\"$1 $2\",[\"[89]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[2-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[23]\"],\"0$1\"]],\"0\"],\"YE\":[\"967\",\"00\",\"(?:1|7\\\\d)\\\\d{7}|[1-7]\\\\d{6}\",[7,8,9],[[\"(\\\\d)(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"[1-6]|7[24-68]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"7\"],\"0$1\"]],\"0\"],\"YT\":[\"262\",\"00\",\"80\\\\d{7}|(?:26|63)9\\\\d{6}\",[9],0,\"0\",0,0,0,0,\"269|63\"],\"ZA\":[\"27\",\"00\",\"[1-79]\\\\d{8}|8\\\\d{4,9}\",[5,6,7,8,9,10],[[\"(\\\\d{2})(\\\\d{3,4})\",\"$1 $2\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{2,3})\",\"$1 $2 $3\",[\"8[1-4]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"860\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"[1-9]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"8\"],\"0$1\"]],\"0\"],\"ZM\":[\"260\",\"00\",\"(?:63|80)0\\\\d{6}|(?:21|[79]\\\\d)\\\\d{7}\",[9],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[28]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"[79]\"],\"0$1\"]],\"0\"],\"ZW\":[\"263\",\"00\",\"2(?:[0-57-9]\\\\d{6,8}|6[0-24-9]\\\\d{6,7})|[38]\\\\d{9}|[35-8]\\\\d{8}|[3-6]\\\\d{7}|[1-689]\\\\d{6}|[1-3569]\\\\d{5}|[1356]\\\\d{4}\",[5,6,7,8,9,10],[[\"(\\\\d{3})(\\\\d{3,5})\",\"$1 $2\",[\"2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]\"],\"0$1\"],[\"(\\\\d)(\\\\d{3})(\\\\d{2,4})\",\"$1 $2 $3\",[\"[49]\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{4})\",\"$1 $2\",[\"80\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{7})\",\"$1 $2\",[\"24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2\",\"2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]\"],\"(0$1)\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{4})\",\"$1 $2 $3\",[\"7\"],\"0$1\"],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)\",\"2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{6})\",\"$1 $2\",[\"8\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3,5})\",\"$1 $2\",[\"1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]\"],\"0$1\"],[\"(\\\\d{2})(\\\\d{3})(\\\\d{3,4})\",\"$1 $2 $3\",[\"29[013-9]|39|54\"],\"0$1\"],[\"(\\\\d{4})(\\\\d{3,5})\",\"$1 $2\",[\"(?:25|54)8\",\"258|5483\"],\"0$1\"]],\"0\"]},\"nonGeographic\":{\"800\":[\"800\",0,\"[1-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[1-9]\"]]],0,0,0,0,0,0,[0,0,[\"[1-9]\\\\d{7}\"]]],\"808\":[\"808\",0,\"[1-9]\\\\d{7}\",[8],[[\"(\\\\d{4})(\\\\d{4})\",\"$1 $2\",[\"[1-9]\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,[\"[1-9]\\\\d{7}\"]]],\"870\":[\"870\",0,\"7\\\\d{11}|[35-7]\\\\d{8}\",[9,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"[35-7]\"]]],0,0,0,0,0,0,[0,[\"(?:[356]|774[45])\\\\d{8}|7[6-8]\\\\d{7}\"]]],\"878\":[\"878\",0,\"10\\\\d{10}\",[12],[[\"(\\\\d{2})(\\\\d{5})(\\\\d{5})\",\"$1 $2 $3\",[\"1\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"10\\\\d{10}\"]]],\"881\":[\"881\",0,\"[0-36-9]\\\\d{8}\",[9],[[\"(\\\\d)(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\",[\"[0-36-9]\"]]],0,0,0,0,0,0,[0,[\"[0-36-9]\\\\d{8}\"]]],\"882\":[\"882\",0,\"[13]\\\\d{6}(?:\\\\d{2,5})?|285\\\\d{9}|(?:[19]\\\\d|49)\\\\d{6}\",[7,8,9,10,11,12],[[\"(\\\\d{2})(\\\\d{5})\",\"$1 $2\",[\"16|342\"]],[\"(\\\\d{2})(\\\\d{6})\",\"$1 $2\",[\"4\"]],[\"(\\\\d{2})(\\\\d{2})(\\\\d{4})\",\"$1 $2 $3\",[\"[19]\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{3})\",\"$1 $2 $3\",[\"3[23]\"]],[\"(\\\\d{2})(\\\\d{3,4})(\\\\d{4})\",\"$1 $2 $3\",[\"1\"]],[\"(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"34[57]\"]],[\"(\\\\d{3})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"34\"]],[\"(\\\\d{2})(\\\\d{4,5})(\\\\d{5})\",\"$1 $2 $3\",[\"[1-3]\"]]],0,0,0,0,0,0,[0,[\"342\\\\d{4}|(?:337|49)\\\\d{6}|3(?:2|47|7\\\\d{3})\\\\d{7}\",[7,8,9,10,12]],0,0,0,0,0,0,[\"1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\\\d{4}|6\\\\d{5,10})|(?:(?:285\\\\d\\\\d|3(?:45|[69]\\\\d{3}))\\\\d|9[89])\\\\d{6}\"]]],\"883\":[\"883\",0,\"51\\\\d{7}(?:\\\\d{3})?\",[9,12],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3\",[\"510\"]],[\"(\\\\d{3})(\\\\d{3})(\\\\d{3})(\\\\d{3})\",\"$1 $2 $3 $4\",[\"510\"]],[\"(\\\\d{4})(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"5\"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,[\"51[013]0\\\\d{8}|5100\\\\d{5}\"]]],\"888\":[\"888\",0,\"\\\\d{11}\",[11],[[\"(\\\\d{3})(\\\\d{3})(\\\\d{5})\",\"$1 $2 $3\"]],0,0,0,0,0,0,[0,0,0,0,0,0,[\"\\\\d{11}\"]]],\"979\":[\"979\",0,\"[1359]\\\\d{8}\",[9],[[\"(\\\\d)(\\\\d{4})(\\\\d{4})\",\"$1 $2 $3\",[\"[1359]\"]]],0,0,0,0,0,0,[0,0,0,[\"[1359]\\\\d{8}\"]]]}}","import metadata from '../metadata'\r\nimport { AsYouType as _AsYouType } from '../../core/index'\r\n\r\nexport function AsYouType(country) {\r\n\treturn _AsYouType.call(this, country, metadata)\r\n}\r\n\r\nAsYouType.prototype = Object.create(_AsYouType.prototype, {})\r\nAsYouType.prototype.constructor = AsYouType","import metadata from '../metadata'\r\nimport { Metadata as _Metadata } from '../../core/index'\r\n\r\nexport function Metadata() {\r\n\treturn _Metadata.call(this, metadata)\r\n}\r\n\r\nMetadata.prototype = Object.create(_Metadata.prototype, {})\r\nMetadata.prototype.constructor = Metadata","import metadata from '../metadata'\r\nimport { PhoneNumberMatcher as _PhoneNumberMatcher } from '../../core/index'\r\n\r\nexport function PhoneNumberMatcher(text, options) {\r\n\treturn _PhoneNumberMatcher.call(this, text, options, metadata)\r\n}\r\nPhoneNumberMatcher.prototype = Object.create(_PhoneNumberMatcher.prototype, {})\r\nPhoneNumberMatcher.prototype.constructor = PhoneNumberMatcher\r\n","import { withMetadata } from '../metadata'\r\nimport { findNumbers as _findNumbers } from '../../core/index'\r\n\r\nexport function findNumbers() {\r\n\treturn withMetadata(_findNumbers, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { findPhoneNumbersInText as _findPhoneNumbersInText } from '../../core/index'\r\n\r\nexport function findPhoneNumbersInText() {\r\n\treturn withMetadata(_findPhoneNumbersInText, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { formatIncompletePhoneNumber as _formatIncompletePhoneNumber } from '../../core/index'\r\n\r\nexport function formatIncompletePhoneNumber() {\r\n\treturn withMetadata(_formatIncompletePhoneNumber, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { getCountries as _getCountries } from '../../core/index'\r\n\r\nexport function getCountries() {\r\n\treturn withMetadata(_getCountries, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { getCountryCallingCode as _getCountryCallingCode } from '../../core/index'\r\n\r\nexport function getCountryCallingCode() {\r\n\treturn withMetadata(_getCountryCallingCode, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { getExampleNumber as _getExampleNumber } from '../../core/index'\r\n\r\nexport function getExampleNumber() {\r\n\treturn withMetadata(_getExampleNumber, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { getExtPrefix as _getExtPrefix } from '../../core/index'\r\n\r\nexport function getExtPrefix() {\r\n\treturn withMetadata(_getExtPrefix, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { isPossiblePhoneNumber as _isPossiblePhoneNumber } from '../../core/index'\r\n\r\nexport function isPossiblePhoneNumber() {\r\n\treturn withMetadata(_isPossiblePhoneNumber, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { isSupportedCountry as _isSupportedCountry } from '../../core/index'\r\n\r\nexport function isSupportedCountry() {\r\n\treturn withMetadata(_isSupportedCountry, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { isValidPhoneNumber as _isValidPhoneNumber } from '../../core/index'\r\n\r\nexport function isValidPhoneNumber() {\r\n\treturn withMetadata(_isValidPhoneNumber, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { parsePhoneNumberFromString as _parsePhoneNumberFromString } from '../../core/index'\r\n\r\nexport function parsePhoneNumberFromString() {\r\n\treturn withMetadata(_parsePhoneNumberFromString, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { parsePhoneNumberWithError as _parsePhoneNumberWithError } from '../../core/index'\r\n\r\nexport function parsePhoneNumberWithError() {\r\n\treturn withMetadata(_parsePhoneNumberWithError, arguments)\r\n}\r\n","import { withMetadata } from '../metadata'\r\nimport { searchNumbers as _searchNumbers } from '../../core/index'\r\n\r\nexport function searchNumbers() {\r\n\treturn withMetadata(_searchNumbers, arguments)\r\n}","import { withMetadata } from '../metadata'\r\nimport { searchPhoneNumbersInText as _searchPhoneNumbersInText } from '../../core/index'\r\n\r\nexport function searchPhoneNumbersInText() {\r\n\treturn withMetadata(_searchPhoneNumbersInText, arguments)\r\n}","// Importing from `.json.js` a workaround for a bug in web browsers' \"native\"\r\n// ES6 importing system which is uncapable of importing \"*.json\" files.\r\n// https://github.com/catamphetamine/libphonenumber-js/issues/239\r\nimport metadata from '../metadata.min.json.js'\r\nexport default metadata\r\n\r\nexport function withMetadata(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}","// This file replaces `index.js` in bundlers like webpack or Rollup,\n// according to `browser` config in `package.json`.\n\nimport { urlAlphabet } from './url-alphabet/index.js'\n\nif (process.env.NODE_ENV !== 'production') {\n // All bundlers will remove this block in the production bundle.\n if (\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative' &&\n typeof crypto === 'undefined'\n ) {\n throw new Error(\n 'React Native does not have a built-in secure random generator. ' +\n 'If you don’t need unpredictable IDs use `nanoid/non-secure`. ' +\n 'For secure IDs, import `react-native-get-random-values` ' +\n 'before Nano ID.'\n )\n }\n if (typeof msCrypto !== 'undefined' && typeof crypto === 'undefined') {\n throw new Error(\n 'Import file with `if (!window.crypto) window.crypto = window.msCrypto`' +\n ' before importing Nano ID to fix IE 11 support'\n )\n }\n if (typeof crypto === 'undefined') {\n throw new Error(\n 'Your browser does not have secure random generator. ' +\n 'If you don’t need unpredictable IDs, you can use nanoid/non-secure.'\n )\n }\n}\n\nlet random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\n\nlet customRandom = (alphabet, size, getRandom) => {\n // First, a bitmask is necessary to generate the ID. The bitmask makes bytes\n // values closer to the alphabet size. The bitmask calculates the closest\n // `2^31 - 1` number, which exceeds the alphabet size.\n // For example, the bitmask for the alphabet size 30 is 31 (00011111).\n // `Math.clz32` is not used, because it is not available in browsers.\n let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1\n // Though, the bitmask solution is not perfect since the bytes exceeding\n // the alphabet size are refused. Therefore, to reliably generate the ID,\n // the random bytes redundancy has to be satisfied.\n\n // Note: every hardware random generator call is performance expensive,\n // because the system call for entropy collection takes a lot of time.\n // So, to avoid additional system calls, extra bytes are requested in advance.\n\n // Next, a step determines how many random bytes to generate.\n // The number of random bytes gets decided upon the ID size, mask,\n // alphabet size, and magic number 1.6 (using 1.6 peaks at performance\n // according to benchmarks).\n\n // `-~f => Math.ceil(f)` if f is a float\n // `-~i => i + 1` if i is an integer\n let step = -~((1.6 * mask * size) / alphabet.length)\n\n return () => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n let j = step\n while (j--) {\n // Adding `|| ''` refuses a random byte that exceeds the alphabet size.\n id += alphabet[bytes[j] & mask] || ''\n if (id.length === size) return id\n }\n }\n }\n}\n\nlet customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)\n\nlet nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array(size))\n\n // A compact alternative for `for (var i = 0; i < step; i++)`.\n while (size--) {\n // It is incorrect to use bytes exceeding the alphabet size.\n // The following mask reduces the random byte in the 0-255 value\n // range to the 0-63 value range. Therefore, adding hacks, such\n // as empty string fallback or magic numbers, is unneccessary because\n // the bitmask trims bytes down to the alphabet size.\n let byte = bytes[size] & 63\n if (byte < 36) {\n // `0-9a-z`\n id += byte.toString(36)\n } else if (byte < 62) {\n // `A-Z`\n id += (byte - 26).toString(36).toUpperCase()\n } else if (byte < 63) {\n id += '_'\n } else {\n id += '-'\n }\n }\n return id\n}\n\nexport { nanoid, customAlphabet, customRandom, urlAlphabet, random }\n","// This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped\n// optimize the gzip compression for this alphabet.\nlet urlAlphabet =\n 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW'\n\nexport { urlAlphabet }\n","/* @license\nPapa Parse\nv5.3.0\nhttps://github.com/mholt/PapaParse\nLicense: MIT\n*/\n!function(e,t){\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof module&&\"undefined\"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){\"use strict\";var f=\"undefined\"!=typeof self?self:\"undefined\"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var i=(t=t||{}).dynamicTyping||!1;U(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!U(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var r=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(i=f.URL||f.webkitURL||null,r=s.toString(),b.BLOB_URL||(b.BLOB_URL=i.createObjectURL(new Blob([\"(\",r,\")();\"],{type:\"text/javascript\"})))),t=new f.Worker(e);var i,r;return t.onmessage=m,t.id=h++,a[t.id]=t}();return r.userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=U(t.step),t.chunk=U(t.chunk),t.complete=U(t.complete),t.error=U(t.error),delete t.worker,void r.postMessage({input:e,config:t,workerId:r.id})}var n=null;b.NODE_STREAM_INPUT,\"string\"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&U(e.read)&&U(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,m=!0,_=\",\",v=\"\\r\\n\",s='\"',a=s+s,i=!1,r=null,o=!1;!function(){if(\"object\"!=typeof t)return;\"string\"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(_=t.delimiter);(\"boolean\"==typeof t.quotes||\"function\"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);\"boolean\"!=typeof t.skipEmptyLines&&\"string\"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines);\"string\"==typeof t.newline&&(v=t.newline);\"string\"==typeof t.quoteChar&&(s=t.quoteChar);\"boolean\"==typeof t.header&&(m=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error(\"Option columns is empty\");r=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);\"boolean\"==typeof t.escapeFormulae&&(o=t.escapeFormulae)}();var h=new RegExp(q(s),\"g\");\"string\"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return f(null,e,i);if(\"object\"==typeof e[0])return f(r||u(e[0]),e,i)}else if(\"object\"==typeof e)return\"string\"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:u(e.data[0])),Array.isArray(e.data[0])||\"object\"==typeof e.data[0]||(e.data=[e.data])),f(e.fields||[],e.data||[],i);throw new Error(\"Unable to serialize unrecognized input\");function u(e){if(\"object\"!=typeof e)return[];var t=[];for(var i in e)t.push(i);return t}function f(e,t,i){var r=\"\";\"string\"==typeof e&&(e=JSON.parse(e)),\"string\"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(U(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!U(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){U(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var r;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),n||(r.onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)),r.open(this._config.downloadRequestBody?\"POST\":\"GET\",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)r.setRequestHeader(t,e[t])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;r.setRequestHeader(\"Range\",\"bytes=\"+this._start+\"-\"+i)}try{r.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===r.status&&this._chunkError()}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:r.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader(\"Content-Range\");if(null===t)return-1;return parseInt(t.substring(t.lastIndexOf(\"/\")+1))}(r),this.parseChunk(r.responseText)))},this._chunkError=function(e){var t=r.statusText||e;this._sendError(new Error(t))}}function c(e){var r,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s=\"undefined\"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((r=new FileReader).onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(r.error)}}function p(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,t=this._config.chunkSize;return t?(e=i.substring(0,t),i=i.substring(t)):(e=i,i=\"\"),this._finished=!i,this.parseChunk(e)}}}function g(e){u.call(this,e=e||{});var t=[],i=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on(\"data\",this._streamData),this._input.on(\"end\",this._streamEnd),this._input.on(\"error\",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=!0},this._streamData=y(function(e){try{t.push(\"string\"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=y(function(){this._streamCleanUp(),r=!0,this._streamData(\"\")},this),this._streamCleanUp=y(function(){this._input.removeListener(\"data\",this._streamData),this._input.removeListener(\"end\",this._streamEnd),this._input.removeListener(\"error\",this._streamError)},this)}function i(_){var a,o,h,r=Math.pow(2,53),n=-r,s=/^\\s*-?(\\d+\\.?|\\.\\d+|\\d+\\.\\d+)(e[-+]?\\d+)?\\s*$/,u=/(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))/,t=this,i=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(U(_.step)){var p=_.step;_.step=function(e){if(c=e,m())g();else{if(g(),0===c.data.length)return;i+=e.data.length,_.preview&&i>_.preview?o.abort():(c.data=c.data[0],p(c,t))}}}function v(e){return\"greedy\"===_.skipEmptyLines?\"\"===e.join(\"\").trim():1===e.length&&0===e[0].length}function g(){if(c&&h&&(k(\"Delimiter\",\"UndetectableDelimiter\",\"Unable to auto-detect delimiting character; defaulted to '\"+b.DefaultDelimiter+\"'\"),h=!1),_.skipEmptyLines)for(var e=0;e=l.length?\"__parsed_extra\":l[i]),_.transform&&(s=_.transform(s,n)),s=y(n,s),\"__parsed_extra\"===n?(r[n]=r[n]||[],r[n].push(s)):r[n]=s}return _.header&&(i>l.length?k(\"FieldMismatch\",\"TooManyFields\",\"Too many fields: expected \"+l.length+\" fields but parsed \"+i,f+t):i=r.length/2?\"\\r\\n\":\"\\r\"}(e,r)),h=!1,_.delimiter)U(_.delimiter)&&(_.delimiter=_.delimiter(e),c.meta.delimiter=_.delimiter);else{var n=function(e,t,i,r,n){var s,a,o,h;n=n||[\",\",\"\\t\",\"|\",\";\",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u=L)return R(!0)}else for(_=M,M++;;){if(-1===(_=a.indexOf(O,_+1)))return i||u.push({type:\"Quotes\",code:\"MissingQuotes\",message:\"Quoted field unterminated\",row:h.length,index:M}),E();if(_===r-1)return E(a.substring(M,_).replace(m,O));if(O!==z||a[_+1]!==z){if(O===z||0===_||a[_-1]!==z){-1!==p&&p<_+1&&(p=a.indexOf(D,_+1)),-1!==g&&g<_+1&&(g=a.indexOf(I,_+1));var y=w(-1===g?p:Math.min(p,g));if(a[_+1+y]===D){f.push(a.substring(M,_).replace(m,O)),a[M=_+1+y+e]!==O&&(_=a.indexOf(O,M)),p=a.indexOf(D,M),g=a.indexOf(I,M);break}var k=w(g);if(a.substring(_+1+k,_+1+k+n)===I){if(f.push(a.substring(M,_).replace(m,O)),C(_+1+k+n),p=a.indexOf(D,M),_=a.indexOf(O,M),o&&(S(),j))return R();if(L&&h.length>=L)return R(!0);break}u.push({type:\"Quotes\",code:\"InvalidQuotes\",message:\"Trailing quote on quoted field is malformed\",row:h.length,index:M}),_++}}else _++}return E();function b(e){h.push(e),d=M}function w(e){var t=0;if(-1!==e){var i=a.substring(_+1,e);i&&\"\"===i.trim()&&(t=i.length)}return t}function E(e){return i||(void 0===e&&(e=a.substring(M)),f.push(e),M=r,b(f),o&&S()),R()}function C(e){M=e,b(f),f=[],g=a.indexOf(I,M)}function R(e){return{data:h,errors:u,meta:{delimiter:D,linebreak:I,aborted:j,truncated:!!e,cursor:d+(t||0)}}}function S(){A(R()),h=[],u=[]}function x(e,t,i){var r={nextDelim:void 0,quoteSearch:void 0},n=a.indexOf(O,t+1);if(t\n * @author\towenm \n * @license MIT\n */\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\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\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nvar version = \"1.13.0\";\n\nfunction userAgent(pattern) {\n if (typeof window !== 'undefined' && window.navigator) {\n return !!\n /*@__PURE__*/\n navigator.userAgent.match(pattern);\n }\n}\n\nvar IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\\.|msie|iemobile|Windows Phone)/i);\nvar Edge = userAgent(/Edge/i);\nvar FireFox = userAgent(/firefox/i);\nvar Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);\nvar IOS = userAgent(/iP(ad|od|hone)/i);\nvar ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);\n\nvar captureMode = {\n capture: false,\n passive: false\n};\n\nfunction on(el, event, fn) {\n el.addEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction off(el, event, fn) {\n el.removeEventListener(event, fn, !IE11OrLess && captureMode);\n}\n\nfunction matches(\n/**HTMLElement*/\nel,\n/**String*/\nselector) {\n if (!selector) return;\n selector[0] === '>' && (selector = selector.substring(1));\n\n if (el) {\n try {\n if (el.matches) {\n return el.matches(selector);\n } else if (el.msMatchesSelector) {\n return el.msMatchesSelector(selector);\n } else if (el.webkitMatchesSelector) {\n return el.webkitMatchesSelector(selector);\n }\n } catch (_) {\n return false;\n }\n }\n\n return false;\n}\n\nfunction getParentOrHost(el) {\n return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;\n}\n\nfunction closest(\n/**HTMLElement*/\nel,\n/**String*/\nselector,\n/**HTMLElement*/\nctx, includeCTX) {\n if (el) {\n ctx = ctx || document;\n\n do {\n if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {\n return el;\n }\n\n if (el === ctx) break;\n /* jshint boss:true */\n } while (el = getParentOrHost(el));\n }\n\n return null;\n}\n\nvar R_SPACE = /\\s+/g;\n\nfunction toggleClass(el, name, state) {\n if (el && name) {\n if (el.classList) {\n el.classList[state ? 'add' : 'remove'](name);\n } else {\n var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');\n el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');\n }\n }\n}\n\nfunction css(el, prop, val) {\n var style = el && el.style;\n\n if (style) {\n if (val === void 0) {\n if (document.defaultView && document.defaultView.getComputedStyle) {\n val = document.defaultView.getComputedStyle(el, '');\n } else if (el.currentStyle) {\n val = el.currentStyle;\n }\n\n return prop === void 0 ? val : val[prop];\n } else {\n if (!(prop in style) && prop.indexOf('webkit') === -1) {\n prop = '-webkit-' + prop;\n }\n\n style[prop] = val + (typeof val === 'string' ? '' : 'px');\n }\n }\n}\n\nfunction matrix(el, selfOnly) {\n var appliedTransforms = '';\n\n if (typeof el === 'string') {\n appliedTransforms = el;\n } else {\n do {\n var transform = css(el, 'transform');\n\n if (transform && transform !== 'none') {\n appliedTransforms = transform + ' ' + appliedTransforms;\n }\n /* jshint boss:true */\n\n } while (!selfOnly && (el = el.parentNode));\n }\n\n var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;\n /*jshint -W056 */\n\n return matrixFn && new matrixFn(appliedTransforms);\n}\n\nfunction find(ctx, tagName, iterator) {\n if (ctx) {\n var list = ctx.getElementsByTagName(tagName),\n i = 0,\n n = list.length;\n\n if (iterator) {\n for (; i < n; i++) {\n iterator(list[i], i);\n }\n }\n\n return list;\n }\n\n return [];\n}\n\nfunction getWindowScrollingElement() {\n var scrollingElement = document.scrollingElement;\n\n if (scrollingElement) {\n return scrollingElement;\n } else {\n return document.documentElement;\n }\n}\n/**\n * Returns the \"bounding client rect\" of given element\n * @param {HTMLElement} el The element whose boundingClientRect is wanted\n * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container\n * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr\n * @param {[Boolean]} undoScale Whether the container's scale() should be undone\n * @param {[HTMLElement]} container The parent the element will be placed in\n * @return {Object} The boundingClientRect of el, with specified adjustments\n */\n\n\nfunction getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {\n if (!el.getBoundingClientRect && el !== window) return;\n var elRect, top, left, bottom, right, height, width;\n\n if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {\n elRect = el.getBoundingClientRect();\n top = elRect.top;\n left = elRect.left;\n bottom = elRect.bottom;\n right = elRect.right;\n height = elRect.height;\n width = elRect.width;\n } else {\n top = 0;\n left = 0;\n bottom = window.innerHeight;\n right = window.innerWidth;\n height = window.innerHeight;\n width = window.innerWidth;\n }\n\n if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {\n // Adjust for translate()\n container = container || el.parentNode; // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)\n // Not needed on <= IE11\n\n if (!IE11OrLess) {\n do {\n if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {\n var containerRect = container.getBoundingClientRect(); // Set relative to edges of padding box of container\n\n top -= containerRect.top + parseInt(css(container, 'border-top-width'));\n left -= containerRect.left + parseInt(css(container, 'border-left-width'));\n bottom = top + elRect.height;\n right = left + elRect.width;\n break;\n }\n /* jshint boss:true */\n\n } while (container = container.parentNode);\n }\n }\n\n if (undoScale && el !== window) {\n // Adjust for scale()\n var elMatrix = matrix(container || el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d;\n\n if (elMatrix) {\n top /= scaleY;\n left /= scaleX;\n width /= scaleX;\n height /= scaleY;\n bottom = top + height;\n right = left + width;\n }\n }\n\n return {\n top: top,\n left: left,\n bottom: bottom,\n right: right,\n width: width,\n height: height\n };\n}\n/**\n * Checks if a side of an element is scrolled past a side of its parents\n * @param {HTMLElement} el The element who's side being scrolled out of view is in question\n * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')\n * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')\n * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element\n */\n\n\nfunction isScrolledPast(el, elSide, parentSide) {\n var parent = getParentAutoScrollElement(el, true),\n elSideVal = getRect(el)[elSide];\n /* jshint boss:true */\n\n while (parent) {\n var parentSideVal = getRect(parent)[parentSide],\n visible = void 0;\n\n if (parentSide === 'top' || parentSide === 'left') {\n visible = elSideVal >= parentSideVal;\n } else {\n visible = elSideVal <= parentSideVal;\n }\n\n if (!visible) return parent;\n if (parent === getWindowScrollingElement()) break;\n parent = getParentAutoScrollElement(parent, false);\n }\n\n return false;\n}\n/**\n * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)\n * and non-draggable elements\n * @param {HTMLElement} el The parent element\n * @param {Number} childNum The index of the child\n * @param {Object} options Parent Sortable's options\n * @return {HTMLElement} The child at index childNum, or null if not found\n */\n\n\nfunction getChild(el, childNum, options) {\n var currentChild = 0,\n i = 0,\n children = el.children;\n\n while (i < children.length) {\n if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && children[i] !== Sortable.dragged && closest(children[i], options.draggable, el, false)) {\n if (currentChild === childNum) {\n return children[i];\n }\n\n currentChild++;\n }\n\n i++;\n }\n\n return null;\n}\n/**\n * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)\n * @param {HTMLElement} el Parent element\n * @param {selector} selector Any other elements that should be ignored\n * @return {HTMLElement} The last child, ignoring ghostEl\n */\n\n\nfunction lastChild(el, selector) {\n var last = el.lastElementChild;\n\n while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {\n last = last.previousElementSibling;\n }\n\n return last || null;\n}\n/**\n * Returns the index of an element within its parent for a selected set of\n * elements\n * @param {HTMLElement} el\n * @param {selector} selector\n * @return {number}\n */\n\n\nfunction index(el, selector) {\n var index = 0;\n\n if (!el || !el.parentNode) {\n return -1;\n }\n /* jshint boss:true */\n\n\n while (el = el.previousElementSibling) {\n if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {\n index++;\n }\n }\n\n return index;\n}\n/**\n * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.\n * The value is returned in real pixels.\n * @param {HTMLElement} el\n * @return {Array} Offsets in the format of [left, top]\n */\n\n\nfunction getRelativeScrollOffset(el) {\n var offsetLeft = 0,\n offsetTop = 0,\n winScroller = getWindowScrollingElement();\n\n if (el) {\n do {\n var elMatrix = matrix(el),\n scaleX = elMatrix.a,\n scaleY = elMatrix.d;\n offsetLeft += el.scrollLeft * scaleX;\n offsetTop += el.scrollTop * scaleY;\n } while (el !== winScroller && (el = el.parentNode));\n }\n\n return [offsetLeft, offsetTop];\n}\n/**\n * Returns the index of the object within the given array\n * @param {Array} arr Array that may or may not hold the object\n * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find\n * @return {Number} The index of the object in the array, or -1\n */\n\n\nfunction indexOfObject(arr, obj) {\n for (var i in arr) {\n if (!arr.hasOwnProperty(i)) continue;\n\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);\n }\n }\n\n return -1;\n}\n\nfunction getParentAutoScrollElement(el, includeSelf) {\n // skip to window\n if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();\n var elem = el;\n var gotSelf = false;\n\n do {\n // we don't need to get elem css if it isn't even overflowing in the first place (performance)\n if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {\n var elemCSS = css(elem);\n\n if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {\n if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();\n if (gotSelf || includeSelf) return elem;\n gotSelf = true;\n }\n }\n /* jshint boss:true */\n\n } while (elem = elem.parentNode);\n\n return getWindowScrollingElement();\n}\n\nfunction extend(dst, src) {\n if (dst && src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dst[key] = src[key];\n }\n }\n }\n\n return dst;\n}\n\nfunction isRectEqual(rect1, rect2) {\n return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);\n}\n\nvar _throttleTimeout;\n\nfunction throttle(callback, ms) {\n return function () {\n if (!_throttleTimeout) {\n var args = arguments,\n _this = this;\n\n if (args.length === 1) {\n callback.call(_this, args[0]);\n } else {\n callback.apply(_this, args);\n }\n\n _throttleTimeout = setTimeout(function () {\n _throttleTimeout = void 0;\n }, ms);\n }\n };\n}\n\nfunction cancelThrottle() {\n clearTimeout(_throttleTimeout);\n _throttleTimeout = void 0;\n}\n\nfunction scrollBy(el, x, y) {\n el.scrollLeft += x;\n el.scrollTop += y;\n}\n\nfunction clone(el) {\n var Polymer = window.Polymer;\n var $ = window.jQuery || window.Zepto;\n\n if (Polymer && Polymer.dom) {\n return Polymer.dom(el).cloneNode(true);\n } else if ($) {\n return $(el).clone(true)[0];\n } else {\n return el.cloneNode(true);\n }\n}\n\nfunction setRect(el, rect) {\n css(el, 'position', 'absolute');\n css(el, 'top', rect.top);\n css(el, 'left', rect.left);\n css(el, 'width', rect.width);\n css(el, 'height', rect.height);\n}\n\nfunction unsetRect(el) {\n css(el, 'position', '');\n css(el, 'top', '');\n css(el, 'left', '');\n css(el, 'width', '');\n css(el, 'height', '');\n}\n\nvar expando = 'Sortable' + new Date().getTime();\n\nfunction AnimationStateManager() {\n var animationStates = [],\n animationCallbackId;\n return {\n captureAnimationState: function captureAnimationState() {\n animationStates = [];\n if (!this.options.animation) return;\n var children = [].slice.call(this.el.children);\n children.forEach(function (child) {\n if (css(child, 'display') === 'none' || child === Sortable.ghost) return;\n animationStates.push({\n target: child,\n rect: getRect(child)\n });\n\n var fromRect = _objectSpread({}, animationStates[animationStates.length - 1].rect); // If animating: compensate for current animation\n\n\n if (child.thisAnimationDuration) {\n var childMatrix = matrix(child, true);\n\n if (childMatrix) {\n fromRect.top -= childMatrix.f;\n fromRect.left -= childMatrix.e;\n }\n }\n\n child.fromRect = fromRect;\n });\n },\n addAnimationState: function addAnimationState(state) {\n animationStates.push(state);\n },\n removeAnimationState: function removeAnimationState(target) {\n animationStates.splice(indexOfObject(animationStates, {\n target: target\n }), 1);\n },\n animateAll: function animateAll(callback) {\n var _this = this;\n\n if (!this.options.animation) {\n clearTimeout(animationCallbackId);\n if (typeof callback === 'function') callback();\n return;\n }\n\n var animating = false,\n animationTime = 0;\n animationStates.forEach(function (state) {\n var time = 0,\n target = state.target,\n fromRect = target.fromRect,\n toRect = getRect(target),\n prevFromRect = target.prevFromRect,\n prevToRect = target.prevToRect,\n animatingRect = state.rect,\n targetMatrix = matrix(target, true);\n\n if (targetMatrix) {\n // Compensate for current animation\n toRect.top -= targetMatrix.f;\n toRect.left -= targetMatrix.e;\n }\n\n target.toRect = toRect;\n\n if (target.thisAnimationDuration) {\n // Could also check if animatingRect is between fromRect and toRect\n if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && // Make sure animatingRect is on line between toRect & fromRect\n (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {\n // If returning to same place as started from animation and on same axis\n time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);\n }\n } // if fromRect != toRect: animate\n\n\n if (!isRectEqual(toRect, fromRect)) {\n target.prevFromRect = fromRect;\n target.prevToRect = toRect;\n\n if (!time) {\n time = _this.options.animation;\n }\n\n _this.animate(target, animatingRect, toRect, time);\n }\n\n if (time) {\n animating = true;\n animationTime = Math.max(animationTime, time);\n clearTimeout(target.animationResetTimer);\n target.animationResetTimer = setTimeout(function () {\n target.animationTime = 0;\n target.prevFromRect = null;\n target.fromRect = null;\n target.prevToRect = null;\n target.thisAnimationDuration = null;\n }, time);\n target.thisAnimationDuration = time;\n }\n });\n clearTimeout(animationCallbackId);\n\n if (!animating) {\n if (typeof callback === 'function') callback();\n } else {\n animationCallbackId = setTimeout(function () {\n if (typeof callback === 'function') callback();\n }, animationTime);\n }\n\n animationStates = [];\n },\n animate: function animate(target, currentRect, toRect, duration) {\n if (duration) {\n css(target, 'transition', '');\n css(target, 'transform', '');\n var elMatrix = matrix(this.el),\n scaleX = elMatrix && elMatrix.a,\n scaleY = elMatrix && elMatrix.d,\n translateX = (currentRect.left - toRect.left) / (scaleX || 1),\n translateY = (currentRect.top - toRect.top) / (scaleY || 1);\n target.animatingX = !!translateX;\n target.animatingY = !!translateY;\n css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');\n this.forRepaintDummy = repaint(target); // repaint\n\n css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));\n css(target, 'transform', 'translate3d(0,0,0)');\n typeof target.animated === 'number' && clearTimeout(target.animated);\n target.animated = setTimeout(function () {\n css(target, 'transition', '');\n css(target, 'transform', '');\n target.animated = false;\n target.animatingX = false;\n target.animatingY = false;\n }, duration);\n }\n }\n };\n}\n\nfunction repaint(target) {\n return target.offsetWidth;\n}\n\nfunction calculateRealTime(animatingRect, fromRect, toRect, options) {\n return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;\n}\n\nvar plugins = [];\nvar defaults = {\n initializeByDefault: true\n};\nvar PluginManager = {\n mount: function mount(plugin) {\n // Set default static properties\n for (var option in defaults) {\n if (defaults.hasOwnProperty(option) && !(option in plugin)) {\n plugin[option] = defaults[option];\n }\n }\n\n plugins.forEach(function (p) {\n if (p.pluginName === plugin.pluginName) {\n throw \"Sortable: Cannot mount plugin \".concat(plugin.pluginName, \" more than once\");\n }\n });\n plugins.push(plugin);\n },\n pluginEvent: function pluginEvent(eventName, sortable, evt) {\n var _this = this;\n\n this.eventCanceled = false;\n\n evt.cancel = function () {\n _this.eventCanceled = true;\n };\n\n var eventNameGlobal = eventName + 'Global';\n plugins.forEach(function (plugin) {\n if (!sortable[plugin.pluginName]) return; // Fire global events if it exists in this sortable\n\n if (sortable[plugin.pluginName][eventNameGlobal]) {\n sortable[plugin.pluginName][eventNameGlobal](_objectSpread({\n sortable: sortable\n }, evt));\n } // Only fire plugin event if plugin is enabled in this sortable,\n // and plugin has event defined\n\n\n if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {\n sortable[plugin.pluginName][eventName](_objectSpread({\n sortable: sortable\n }, evt));\n }\n });\n },\n initializePlugins: function initializePlugins(sortable, el, defaults, options) {\n plugins.forEach(function (plugin) {\n var pluginName = plugin.pluginName;\n if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;\n var initialized = new plugin(sortable, el, sortable.options);\n initialized.sortable = sortable;\n initialized.options = sortable.options;\n sortable[pluginName] = initialized; // Add default options from plugin\n\n _extends(defaults, initialized.defaults);\n });\n\n for (var option in sortable.options) {\n if (!sortable.options.hasOwnProperty(option)) continue;\n var modified = this.modifyOption(sortable, option, sortable.options[option]);\n\n if (typeof modified !== 'undefined') {\n sortable.options[option] = modified;\n }\n }\n },\n getEventProperties: function getEventProperties(name, sortable) {\n var eventProperties = {};\n plugins.forEach(function (plugin) {\n if (typeof plugin.eventProperties !== 'function') return;\n\n _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));\n });\n return eventProperties;\n },\n modifyOption: function modifyOption(sortable, name, value) {\n var modifiedValue;\n plugins.forEach(function (plugin) {\n // Plugin must exist on the Sortable\n if (!sortable[plugin.pluginName]) return; // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin\n\n if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {\n modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);\n }\n });\n return modifiedValue;\n }\n};\n\nfunction dispatchEvent(_ref) {\n var sortable = _ref.sortable,\n rootEl = _ref.rootEl,\n name = _ref.name,\n targetEl = _ref.targetEl,\n cloneEl = _ref.cloneEl,\n toEl = _ref.toEl,\n fromEl = _ref.fromEl,\n oldIndex = _ref.oldIndex,\n newIndex = _ref.newIndex,\n oldDraggableIndex = _ref.oldDraggableIndex,\n newDraggableIndex = _ref.newDraggableIndex,\n originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n extraEventProperties = _ref.extraEventProperties;\n sortable = sortable || rootEl && rootEl[expando];\n if (!sortable) return;\n var evt,\n options = sortable.options,\n onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1); // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent(name, {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent(name, true, true);\n }\n\n evt.to = toEl || rootEl;\n evt.from = fromEl || rootEl;\n evt.item = targetEl || rootEl;\n evt.clone = cloneEl;\n evt.oldIndex = oldIndex;\n evt.newIndex = newIndex;\n evt.oldDraggableIndex = oldDraggableIndex;\n evt.newDraggableIndex = newDraggableIndex;\n evt.originalEvent = originalEvent;\n evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;\n\n var allEventProperties = _objectSpread({}, extraEventProperties, PluginManager.getEventProperties(name, sortable));\n\n for (var option in allEventProperties) {\n evt[option] = allEventProperties[option];\n }\n\n if (rootEl) {\n rootEl.dispatchEvent(evt);\n }\n\n if (options[onName]) {\n options[onName].call(sortable, evt);\n }\n}\n\nvar pluginEvent = function pluginEvent(eventName, sortable) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n originalEvent = _ref.evt,\n data = _objectWithoutProperties(_ref, [\"evt\"]);\n\n PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread({\n dragEl: dragEl,\n parentEl: parentEl,\n ghostEl: ghostEl,\n rootEl: rootEl,\n nextEl: nextEl,\n lastDownEl: lastDownEl,\n cloneEl: cloneEl,\n cloneHidden: cloneHidden,\n dragStarted: moved,\n putSortable: putSortable,\n activeSortable: Sortable.active,\n originalEvent: originalEvent,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n hideGhostForTarget: _hideGhostForTarget,\n unhideGhostForTarget: _unhideGhostForTarget,\n cloneNowHidden: function cloneNowHidden() {\n cloneHidden = true;\n },\n cloneNowShown: function cloneNowShown() {\n cloneHidden = false;\n },\n dispatchSortableEvent: function dispatchSortableEvent(name) {\n _dispatchEvent({\n sortable: sortable,\n name: name,\n originalEvent: originalEvent\n });\n }\n }, data));\n};\n\nfunction _dispatchEvent(info) {\n dispatchEvent(_objectSpread({\n putSortable: putSortable,\n cloneEl: cloneEl,\n targetEl: dragEl,\n rootEl: rootEl,\n oldIndex: oldIndex,\n oldDraggableIndex: oldDraggableIndex,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex\n }, info));\n}\n\nvar dragEl,\n parentEl,\n ghostEl,\n rootEl,\n nextEl,\n lastDownEl,\n cloneEl,\n cloneHidden,\n oldIndex,\n newIndex,\n oldDraggableIndex,\n newDraggableIndex,\n activeGroup,\n putSortable,\n awaitingDragStarted = false,\n ignoreNextClick = false,\n sortables = [],\n tapEvt,\n touchEvt,\n lastDx,\n lastDy,\n tapDistanceLeft,\n tapDistanceTop,\n moved,\n lastTarget,\n lastDirection,\n pastFirstInvertThresh = false,\n isCircumstantialInvert = false,\n targetMoveDistance,\n // For positioning ghost absolutely\nghostRelativeParent,\n ghostRelativeParentInitialScroll = [],\n // (left, top)\n_silent = false,\n savedInputChecked = [];\n/** @const */\n\nvar documentExists = typeof document !== 'undefined',\n PositionGhostAbsolutely = IOS,\n CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',\n // This will not pass for IE9, because IE9 DnD only works on anchors\nsupportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),\n supportCssPointerEvents = function () {\n if (!documentExists) return; // false when <= IE11\n\n if (IE11OrLess) {\n return false;\n }\n\n var el = document.createElement('x');\n el.style.cssText = 'pointer-events:auto';\n return el.style.pointerEvents === 'auto';\n}(),\n _detectDirection = function _detectDirection(el, options) {\n var elCSS = css(el),\n elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),\n child1 = getChild(el, 0, options),\n child2 = getChild(el, 1, options),\n firstChildCSS = child1 && css(child1),\n secondChildCSS = child2 && css(child2),\n firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,\n secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;\n\n if (elCSS.display === 'flex') {\n return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';\n }\n\n if (elCSS.display === 'grid') {\n return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';\n }\n\n if (child1 && firstChildCSS[\"float\"] && firstChildCSS[\"float\"] !== 'none') {\n var touchingSideChild2 = firstChildCSS[\"float\"] === 'left' ? 'left' : 'right';\n return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';\n }\n\n return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';\n},\n _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {\n var dragElS1Opp = vertical ? dragRect.left : dragRect.top,\n dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,\n dragElOppLength = vertical ? dragRect.width : dragRect.height,\n targetS1Opp = vertical ? targetRect.left : targetRect.top,\n targetS2Opp = vertical ? targetRect.right : targetRect.bottom,\n targetOppLength = vertical ? targetRect.width : targetRect.height;\n return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;\n},\n\n/**\n * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.\n * @param {Number} x X position\n * @param {Number} y Y position\n * @return {HTMLElement} Element of the first found nearest Sortable\n */\n_detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {\n var ret;\n sortables.some(function (sortable) {\n if (lastChild(sortable)) return;\n var rect = getRect(sortable),\n threshold = sortable[expando].options.emptyInsertThreshold,\n insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,\n insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;\n\n if (threshold && insideHorizontally && insideVertically) {\n return ret = sortable;\n }\n });\n return ret;\n},\n _prepareGroup = function _prepareGroup(options) {\n function toFn(value, pull) {\n return function (to, from, dragEl, evt) {\n var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;\n\n if (value == null && (pull || sameGroup)) {\n // Default pull value\n // Default pull and put value if same group\n return true;\n } else if (value == null || value === false) {\n return false;\n } else if (pull && value === 'clone') {\n return value;\n } else if (typeof value === 'function') {\n return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);\n } else {\n var otherGroup = (pull ? to : from).options.group.name;\n return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;\n }\n };\n }\n\n var group = {};\n var originalGroup = options.group;\n\n if (!originalGroup || _typeof(originalGroup) != 'object') {\n originalGroup = {\n name: originalGroup\n };\n }\n\n group.name = originalGroup.name;\n group.checkPull = toFn(originalGroup.pull, true);\n group.checkPut = toFn(originalGroup.put);\n group.revertClone = originalGroup.revertClone;\n options.group = group;\n},\n _hideGhostForTarget = function _hideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', 'none');\n }\n},\n _unhideGhostForTarget = function _unhideGhostForTarget() {\n if (!supportCssPointerEvents && ghostEl) {\n css(ghostEl, 'display', '');\n }\n}; // #1184 fix - Prevent click event on fallback if dragged but item not changed position\n\n\nif (documentExists) {\n document.addEventListener('click', function (evt) {\n if (ignoreNextClick) {\n evt.preventDefault();\n evt.stopPropagation && evt.stopPropagation();\n evt.stopImmediatePropagation && evt.stopImmediatePropagation();\n ignoreNextClick = false;\n return false;\n }\n }, true);\n}\n\nvar nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {\n if (dragEl) {\n evt = evt.touches ? evt.touches[0] : evt;\n\n var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);\n\n if (nearest) {\n // Create imitation event\n var event = {};\n\n for (var i in evt) {\n if (evt.hasOwnProperty(i)) {\n event[i] = evt[i];\n }\n }\n\n event.target = event.rootEl = nearest;\n event.preventDefault = void 0;\n event.stopPropagation = void 0;\n\n nearest[expando]._onDragOver(event);\n }\n }\n};\n\nvar _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {\n if (dragEl) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target);\n }\n};\n/**\n * @class Sortable\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nfunction Sortable(el, options) {\n if (!(el && el.nodeType && el.nodeType === 1)) {\n throw \"Sortable: `el` must be an HTMLElement, not \".concat({}.toString.call(el));\n }\n\n this.el = el; // root element\n\n this.options = options = _extends({}, options); // Export instance\n\n el[expando] = this;\n var defaults = {\n group: null,\n sort: true,\n disabled: false,\n store: null,\n handle: null,\n draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',\n swapThreshold: 1,\n // percentage; 0 <= x <= 1\n invertSwap: false,\n // invert always\n invertedSwapThreshold: null,\n // will be set to same as swapThreshold if default\n removeCloneOnHide: true,\n direction: function direction() {\n return _detectDirection(el, this.options);\n },\n ghostClass: 'sortable-ghost',\n chosenClass: 'sortable-chosen',\n dragClass: 'sortable-drag',\n ignore: 'a, img',\n filter: null,\n preventOnFilter: true,\n animation: 0,\n easing: null,\n setData: function setData(dataTransfer, dragEl) {\n dataTransfer.setData('Text', dragEl.textContent);\n },\n dropBubble: false,\n dragoverBubble: false,\n dataIdAttr: 'data-id',\n delay: 0,\n delayOnTouchOnly: false,\n touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,\n forceFallback: false,\n fallbackClass: 'sortable-fallback',\n fallbackOnBody: false,\n fallbackTolerance: 0,\n fallbackOffset: {\n x: 0,\n y: 0\n },\n supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,\n emptyInsertThreshold: 5\n };\n PluginManager.initializePlugins(this, el, defaults); // Set default options\n\n for (var name in defaults) {\n !(name in options) && (options[name] = defaults[name]);\n }\n\n _prepareGroup(options); // Bind all private methods\n\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n } // Setup drag mode\n\n\n this.nativeDraggable = options.forceFallback ? false : supportDraggable;\n\n if (this.nativeDraggable) {\n // Touch start threshold cannot be greater than the native dragstart threshold\n this.options.touchStartThreshold = 1;\n } // Bind events\n\n\n if (options.supportPointer) {\n on(el, 'pointerdown', this._onTapStart);\n } else {\n on(el, 'mousedown', this._onTapStart);\n on(el, 'touchstart', this._onTapStart);\n }\n\n if (this.nativeDraggable) {\n on(el, 'dragover', this);\n on(el, 'dragenter', this);\n }\n\n sortables.push(this.el); // Restore sorting\n\n options.store && options.store.get && this.sort(options.store.get(this) || []); // Add animation state manager\n\n _extends(this, AnimationStateManager());\n}\n\nSortable.prototype =\n/** @lends Sortable.prototype */\n{\n constructor: Sortable,\n _isOutsideThisEl: function _isOutsideThisEl(target) {\n if (!this.el.contains(target) && target !== this.el) {\n lastTarget = null;\n }\n },\n _getDirection: function _getDirection(evt, target) {\n return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;\n },\n _onTapStart: function _onTapStart(\n /** Event|TouchEvent */\n evt) {\n if (!evt.cancelable) return;\n\n var _this = this,\n el = this.el,\n options = this.options,\n preventOnFilter = options.preventOnFilter,\n type = evt.type,\n touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,\n target = (touch || evt).target,\n originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,\n filter = options.filter;\n\n _saveInputCheckedState(el); // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.\n\n\n if (dragEl) {\n return;\n }\n\n if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {\n return; // only left button and enabled\n } // cancel dnd if original target is content editable\n\n\n if (originalTarget.isContentEditable) {\n return;\n } // Safari ignores further event handling after mousedown\n\n\n if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {\n return;\n }\n\n target = closest(target, options.draggable, el, false);\n\n if (target && target.animated) {\n return;\n }\n\n if (lastDownEl === target) {\n // Ignoring duplicate `down`\n return;\n } // Get the index of the dragged element within its parent\n\n\n oldIndex = index(target);\n oldDraggableIndex = index(target, options.draggable); // Check filter\n\n if (typeof filter === 'function') {\n if (filter.call(this, evt, target, this)) {\n _dispatchEvent({\n sortable: _this,\n rootEl: originalTarget,\n name: 'filter',\n targetEl: target,\n toEl: el,\n fromEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n } else if (filter) {\n filter = filter.split(',').some(function (criteria) {\n criteria = closest(originalTarget, criteria.trim(), el, false);\n\n if (criteria) {\n _dispatchEvent({\n sortable: _this,\n rootEl: criteria,\n name: 'filter',\n targetEl: target,\n fromEl: el,\n toEl: el\n });\n\n pluginEvent('filter', _this, {\n evt: evt\n });\n return true;\n }\n });\n\n if (filter) {\n preventOnFilter && evt.cancelable && evt.preventDefault();\n return; // cancel dnd\n }\n }\n\n if (options.handle && !closest(originalTarget, options.handle, el, false)) {\n return;\n } // Prepare `dragstart`\n\n\n this._prepareDragStart(evt, touch, target);\n },\n _prepareDragStart: function _prepareDragStart(\n /** Event */\n evt,\n /** Touch */\n touch,\n /** HTMLElement */\n target) {\n var _this = this,\n el = _this.el,\n options = _this.options,\n ownerDocument = el.ownerDocument,\n dragStartFn;\n\n if (target && !dragEl && target.parentNode === el) {\n var dragRect = getRect(target);\n rootEl = el;\n dragEl = target;\n parentEl = dragEl.parentNode;\n nextEl = dragEl.nextSibling;\n lastDownEl = target;\n activeGroup = options.group;\n Sortable.dragged = dragEl;\n tapEvt = {\n target: dragEl,\n clientX: (touch || evt).clientX,\n clientY: (touch || evt).clientY\n };\n tapDistanceLeft = tapEvt.clientX - dragRect.left;\n tapDistanceTop = tapEvt.clientY - dragRect.top;\n this._lastX = (touch || evt).clientX;\n this._lastY = (touch || evt).clientY;\n dragEl.style['will-change'] = 'all';\n\n dragStartFn = function dragStartFn() {\n pluginEvent('delayEnded', _this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n _this._onDrop();\n\n return;\n } // Delayed drag has been triggered\n // we can re-enable the events: touchmove/mousemove\n\n\n _this._disableDelayedDragEvents();\n\n if (!FireFox && _this.nativeDraggable) {\n dragEl.draggable = true;\n } // Bind the events: dragstart/dragend\n\n\n _this._triggerDragStart(evt, touch); // Drag start event\n\n\n _dispatchEvent({\n sortable: _this,\n name: 'choose',\n originalEvent: evt\n }); // Chosen item\n\n\n toggleClass(dragEl, options.chosenClass, true);\n }; // Disable \"draggable\"\n\n\n options.ignore.split(',').forEach(function (criteria) {\n find(dragEl, criteria.trim(), _disableDraggable);\n });\n on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);\n on(ownerDocument, 'mouseup', _this._onDrop);\n on(ownerDocument, 'touchend', _this._onDrop);\n on(ownerDocument, 'touchcancel', _this._onDrop); // Make dragEl draggable (must be before delay for FireFox)\n\n if (FireFox && this.nativeDraggable) {\n this.options.touchStartThreshold = 4;\n dragEl.draggable = true;\n }\n\n pluginEvent('delayStart', this, {\n evt: evt\n }); // Delay is impossible for native DnD in Edge or IE\n\n if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n } // If the user moves the pointer or let go the click or touch\n // before the delay has been reached:\n // disable the delayed drag\n\n\n on(ownerDocument, 'mouseup', _this._disableDelayedDrag);\n on(ownerDocument, 'touchend', _this._disableDelayedDrag);\n on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);\n on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);\n on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);\n options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);\n _this._dragStartTimer = setTimeout(dragStartFn, options.delay);\n } else {\n dragStartFn();\n }\n }\n },\n _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(\n /** TouchEvent|PointerEvent **/\n e) {\n var touch = e.touches ? e.touches[0] : e;\n\n if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {\n this._disableDelayedDrag();\n }\n },\n _disableDelayedDrag: function _disableDelayedDrag() {\n dragEl && _disableDraggable(dragEl);\n clearTimeout(this._dragStartTimer);\n\n this._disableDelayedDragEvents();\n },\n _disableDelayedDragEvents: function _disableDelayedDragEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._disableDelayedDrag);\n off(ownerDocument, 'touchend', this._disableDelayedDrag);\n off(ownerDocument, 'touchcancel', this._disableDelayedDrag);\n off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);\n off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);\n },\n _triggerDragStart: function _triggerDragStart(\n /** Event */\n evt,\n /** Touch */\n touch) {\n touch = touch || evt.pointerType == 'touch' && evt;\n\n if (!this.nativeDraggable || touch) {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._onTouchMove);\n } else if (touch) {\n on(document, 'touchmove', this._onTouchMove);\n } else {\n on(document, 'mousemove', this._onTouchMove);\n }\n } else {\n on(dragEl, 'dragend', this);\n on(rootEl, 'dragstart', this._onDragStart);\n }\n\n try {\n if (document.selection) {\n // Timeout neccessary for IE9\n _nextTick(function () {\n document.selection.empty();\n });\n } else {\n window.getSelection().removeAllRanges();\n }\n } catch (err) {}\n },\n _dragStarted: function _dragStarted(fallback, evt) {\n\n awaitingDragStarted = false;\n\n if (rootEl && dragEl) {\n pluginEvent('dragStarted', this, {\n evt: evt\n });\n\n if (this.nativeDraggable) {\n on(document, 'dragover', _checkOutsideTargetEl);\n }\n\n var options = this.options; // Apply effect\n\n !fallback && toggleClass(dragEl, options.dragClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n Sortable.active = this;\n fallback && this._appendGhost(); // Drag start event\n\n _dispatchEvent({\n sortable: this,\n name: 'start',\n originalEvent: evt\n });\n } else {\n this._nulling();\n }\n },\n _emulateDragOver: function _emulateDragOver() {\n if (touchEvt) {\n this._lastX = touchEvt.clientX;\n this._lastY = touchEvt.clientY;\n\n _hideGhostForTarget();\n\n var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n var parent = target;\n\n while (target && target.shadowRoot) {\n target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);\n if (target === parent) break;\n parent = target;\n }\n\n dragEl.parentNode[expando]._isOutsideThisEl(target);\n\n if (parent) {\n do {\n if (parent[expando]) {\n var inserted = void 0;\n inserted = parent[expando]._onDragOver({\n clientX: touchEvt.clientX,\n clientY: touchEvt.clientY,\n target: target,\n rootEl: parent\n });\n\n if (inserted && !this.options.dragoverBubble) {\n break;\n }\n }\n\n target = parent; // store last element\n }\n /* jshint boss:true */\n while (parent = parent.parentNode);\n }\n\n _unhideGhostForTarget();\n }\n },\n _onTouchMove: function _onTouchMove(\n /**TouchEvent*/\n evt) {\n if (tapEvt) {\n var options = this.options,\n fallbackTolerance = options.fallbackTolerance,\n fallbackOffset = options.fallbackOffset,\n touch = evt.touches ? evt.touches[0] : evt,\n ghostMatrix = ghostEl && matrix(ghostEl, true),\n scaleX = ghostEl && ghostMatrix && ghostMatrix.a,\n scaleY = ghostEl && ghostMatrix && ghostMatrix.d,\n relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),\n dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),\n dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1); // only set the status to dragging, when we are actually dragging\n\n if (!Sortable.active && !awaitingDragStarted) {\n if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {\n return;\n }\n\n this._onDragStart(evt, true);\n }\n\n if (ghostEl) {\n if (ghostMatrix) {\n ghostMatrix.e += dx - (lastDx || 0);\n ghostMatrix.f += dy - (lastDy || 0);\n } else {\n ghostMatrix = {\n a: 1,\n b: 0,\n c: 0,\n d: 1,\n e: dx,\n f: dy\n };\n }\n\n var cssMatrix = \"matrix(\".concat(ghostMatrix.a, \",\").concat(ghostMatrix.b, \",\").concat(ghostMatrix.c, \",\").concat(ghostMatrix.d, \",\").concat(ghostMatrix.e, \",\").concat(ghostMatrix.f, \")\");\n css(ghostEl, 'webkitTransform', cssMatrix);\n css(ghostEl, 'mozTransform', cssMatrix);\n css(ghostEl, 'msTransform', cssMatrix);\n css(ghostEl, 'transform', cssMatrix);\n lastDx = dx;\n lastDy = dy;\n touchEvt = touch;\n }\n\n evt.cancelable && evt.preventDefault();\n }\n },\n _appendGhost: function _appendGhost() {\n // Bug if using scale(): https://stackoverflow.com/questions/2637058\n // Not being adjusted for\n if (!ghostEl) {\n var container = this.options.fallbackOnBody ? document.body : rootEl,\n rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),\n options = this.options; // Position absolutely\n\n if (PositionGhostAbsolutely) {\n // Get relatively positioned parent\n ghostRelativeParent = container;\n\n while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {\n ghostRelativeParent = ghostRelativeParent.parentNode;\n }\n\n if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {\n if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();\n rect.top += ghostRelativeParent.scrollTop;\n rect.left += ghostRelativeParent.scrollLeft;\n } else {\n ghostRelativeParent = getWindowScrollingElement();\n }\n\n ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);\n }\n\n ghostEl = dragEl.cloneNode(true);\n toggleClass(ghostEl, options.ghostClass, false);\n toggleClass(ghostEl, options.fallbackClass, true);\n toggleClass(ghostEl, options.dragClass, true);\n css(ghostEl, 'transition', '');\n css(ghostEl, 'transform', '');\n css(ghostEl, 'box-sizing', 'border-box');\n css(ghostEl, 'margin', 0);\n css(ghostEl, 'top', rect.top);\n css(ghostEl, 'left', rect.left);\n css(ghostEl, 'width', rect.width);\n css(ghostEl, 'height', rect.height);\n css(ghostEl, 'opacity', '0.8');\n css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');\n css(ghostEl, 'zIndex', '100000');\n css(ghostEl, 'pointerEvents', 'none');\n Sortable.ghost = ghostEl;\n container.appendChild(ghostEl); // Set transform-origin\n\n css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');\n }\n },\n _onDragStart: function _onDragStart(\n /**Event*/\n evt,\n /**boolean*/\n fallback) {\n var _this = this;\n\n var dataTransfer = evt.dataTransfer;\n var options = _this.options;\n pluginEvent('dragStart', this, {\n evt: evt\n });\n\n if (Sortable.eventCanceled) {\n this._onDrop();\n\n return;\n }\n\n pluginEvent('setupClone', this);\n\n if (!Sortable.eventCanceled) {\n cloneEl = clone(dragEl);\n cloneEl.draggable = false;\n cloneEl.style['will-change'] = '';\n\n this._hideClone();\n\n toggleClass(cloneEl, this.options.chosenClass, false);\n Sortable.clone = cloneEl;\n } // #1143: IFrame support workaround\n\n\n _this.cloneId = _nextTick(function () {\n pluginEvent('clone', _this);\n if (Sortable.eventCanceled) return;\n\n if (!_this.options.removeCloneOnHide) {\n rootEl.insertBefore(cloneEl, dragEl);\n }\n\n _this._hideClone();\n\n _dispatchEvent({\n sortable: _this,\n name: 'clone'\n });\n });\n !fallback && toggleClass(dragEl, options.dragClass, true); // Set proper drop events\n\n if (fallback) {\n ignoreNextClick = true;\n _this._loopId = setInterval(_this._emulateDragOver, 50);\n } else {\n // Undo what was set in _prepareDragStart before drag started\n off(document, 'mouseup', _this._onDrop);\n off(document, 'touchend', _this._onDrop);\n off(document, 'touchcancel', _this._onDrop);\n\n if (dataTransfer) {\n dataTransfer.effectAllowed = 'move';\n options.setData && options.setData.call(_this, dataTransfer, dragEl);\n }\n\n on(document, 'drop', _this); // #1276 fix:\n\n css(dragEl, 'transform', 'translateZ(0)');\n }\n\n awaitingDragStarted = true;\n _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));\n on(document, 'selectstart', _this);\n moved = true;\n\n if (Safari) {\n css(document.body, 'user-select', 'none');\n }\n },\n // Returns true - if no further action is needed (either inserted or another condition)\n _onDragOver: function _onDragOver(\n /**Event*/\n evt) {\n var el = this.el,\n target = evt.target,\n dragRect,\n targetRect,\n revert,\n options = this.options,\n group = options.group,\n activeSortable = Sortable.active,\n isOwner = activeGroup === group,\n canSort = options.sort,\n fromSortable = putSortable || activeSortable,\n vertical,\n _this = this,\n completedFired = false;\n\n if (_silent) return;\n\n function dragOverEvent(name, extra) {\n pluginEvent(name, _this, _objectSpread({\n evt: evt,\n isOwner: isOwner,\n axis: vertical ? 'vertical' : 'horizontal',\n revert: revert,\n dragRect: dragRect,\n targetRect: targetRect,\n canSort: canSort,\n fromSortable: fromSortable,\n target: target,\n completed: completed,\n onMove: function onMove(target, after) {\n return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);\n },\n changed: changed\n }, extra));\n } // Capture animation state\n\n\n function capture() {\n dragOverEvent('dragOverAnimationCapture');\n\n _this.captureAnimationState();\n\n if (_this !== fromSortable) {\n fromSortable.captureAnimationState();\n }\n } // Return invocation when dragEl is inserted (or completed)\n\n\n function completed(insertion) {\n dragOverEvent('dragOverCompleted', {\n insertion: insertion\n });\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n } else {\n activeSortable._showClone(_this);\n }\n\n if (_this !== fromSortable) {\n // Set ghost class to new sortable's ghost class\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);\n toggleClass(dragEl, options.ghostClass, true);\n }\n\n if (putSortable !== _this && _this !== Sortable.active) {\n putSortable = _this;\n } else if (_this === Sortable.active && putSortable) {\n putSortable = null;\n } // Animation\n\n\n if (fromSortable === _this) {\n _this._ignoreWhileAnimating = target;\n }\n\n _this.animateAll(function () {\n dragOverEvent('dragOverAnimationComplete');\n _this._ignoreWhileAnimating = null;\n });\n\n if (_this !== fromSortable) {\n fromSortable.animateAll();\n fromSortable._ignoreWhileAnimating = null;\n }\n } // Null lastTarget if it is not inside a previously swapped element\n\n\n if (target === dragEl && !dragEl.animated || target === el && !target.animated) {\n lastTarget = null;\n } // no bubbling and not fallback\n\n\n if (!options.dragoverBubble && !evt.rootEl && target !== document) {\n dragEl.parentNode[expando]._isOutsideThisEl(evt.target); // Do not detect for empty insert if already inserted\n\n\n !insertion && nearestEmptyInsertDetectEvent(evt);\n }\n\n !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();\n return completedFired = true;\n } // Call when dragEl has been inserted\n\n\n function changed() {\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n _dispatchEvent({\n sortable: _this,\n name: 'change',\n toEl: el,\n newIndex: newIndex,\n newDraggableIndex: newDraggableIndex,\n originalEvent: evt\n });\n }\n\n if (evt.preventDefault !== void 0) {\n evt.cancelable && evt.preventDefault();\n }\n\n target = closest(target, options.draggable, el, true);\n dragOverEvent('dragOver');\n if (Sortable.eventCanceled) return completedFired;\n\n if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {\n return completed(false);\n }\n\n ignoreNextClick = false;\n\n if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = !rootEl.contains(dragEl)) // Reverting item into the original list\n : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {\n vertical = this._getDirection(evt, target) === 'vertical';\n dragRect = getRect(dragEl);\n dragOverEvent('dragOverValid');\n if (Sortable.eventCanceled) return completedFired;\n\n if (revert) {\n parentEl = rootEl; // actualization\n\n capture();\n\n this._hideClone();\n\n dragOverEvent('revert');\n\n if (!Sortable.eventCanceled) {\n if (nextEl) {\n rootEl.insertBefore(dragEl, nextEl);\n } else {\n rootEl.appendChild(dragEl);\n }\n }\n\n return completed(true);\n }\n\n var elLastChild = lastChild(el, options.draggable);\n\n if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {\n // If already at end of list: Do not insert\n if (elLastChild === dragEl) {\n return completed(false);\n } // assign target only if condition is true\n\n\n if (elLastChild && el === evt.target) {\n target = elLastChild;\n }\n\n if (target) {\n targetRect = getRect(target);\n }\n\n if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {\n capture();\n el.appendChild(dragEl);\n parentEl = el; // actualization\n\n changed();\n return completed(true);\n }\n } else if (target.parentNode === el) {\n targetRect = getRect(target);\n var direction = 0,\n targetBeforeFirstSwap,\n differentLevel = dragEl.parentNode !== el,\n differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),\n side1 = vertical ? 'top' : 'left',\n scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),\n scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;\n\n if (lastTarget !== target) {\n targetBeforeFirstSwap = targetRect[side1];\n pastFirstInvertThresh = false;\n isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;\n }\n\n direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);\n var sibling;\n\n if (direction !== 0) {\n // Check if target is beside dragEl in respective direction (ignoring hidden elements)\n var dragIndex = index(dragEl);\n\n do {\n dragIndex -= direction;\n sibling = parentEl.children[dragIndex];\n } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));\n } // If dragEl is already beside target: Do not insert\n\n\n if (direction === 0 || sibling === target) {\n return completed(false);\n }\n\n lastTarget = target;\n lastDirection = direction;\n var nextSibling = target.nextElementSibling,\n after = false;\n after = direction === 1;\n\n var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);\n\n if (moveVector !== false) {\n if (moveVector === 1 || moveVector === -1) {\n after = moveVector === 1;\n }\n\n _silent = true;\n setTimeout(_unsilent, 30);\n capture();\n\n if (after && !nextSibling) {\n el.appendChild(dragEl);\n } else {\n target.parentNode.insertBefore(dragEl, after ? nextSibling : target);\n } // Undo chrome's scroll adjustment (has no effect on other browsers)\n\n\n if (scrolledPastTop) {\n scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);\n }\n\n parentEl = dragEl.parentNode; // actualization\n // must be done before animation\n\n if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {\n targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);\n }\n\n changed();\n return completed(true);\n }\n }\n\n if (el.contains(dragEl)) {\n return completed(false);\n }\n }\n\n return false;\n },\n _ignoreWhileAnimating: null,\n _offMoveEvents: function _offMoveEvents() {\n off(document, 'mousemove', this._onTouchMove);\n off(document, 'touchmove', this._onTouchMove);\n off(document, 'pointermove', this._onTouchMove);\n off(document, 'dragover', nearestEmptyInsertDetectEvent);\n off(document, 'mousemove', nearestEmptyInsertDetectEvent);\n off(document, 'touchmove', nearestEmptyInsertDetectEvent);\n },\n _offUpEvents: function _offUpEvents() {\n var ownerDocument = this.el.ownerDocument;\n off(ownerDocument, 'mouseup', this._onDrop);\n off(ownerDocument, 'touchend', this._onDrop);\n off(ownerDocument, 'pointerup', this._onDrop);\n off(ownerDocument, 'touchcancel', this._onDrop);\n off(document, 'selectstart', this);\n },\n _onDrop: function _onDrop(\n /**Event*/\n evt) {\n var el = this.el,\n options = this.options; // Get the index of the dragged element within its parent\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n pluginEvent('drop', this, {\n evt: evt\n });\n parentEl = dragEl && dragEl.parentNode; // Get again after plugin event\n\n newIndex = index(dragEl);\n newDraggableIndex = index(dragEl, options.draggable);\n\n if (Sortable.eventCanceled) {\n this._nulling();\n\n return;\n }\n\n awaitingDragStarted = false;\n isCircumstantialInvert = false;\n pastFirstInvertThresh = false;\n clearInterval(this._loopId);\n clearTimeout(this._dragStartTimer);\n\n _cancelNextTick(this.cloneId);\n\n _cancelNextTick(this._dragStartId); // Unbind events\n\n\n if (this.nativeDraggable) {\n off(document, 'drop', this);\n off(el, 'dragstart', this._onDragStart);\n }\n\n this._offMoveEvents();\n\n this._offUpEvents();\n\n if (Safari) {\n css(document.body, 'user-select', '');\n }\n\n css(dragEl, 'transform', '');\n\n if (evt) {\n if (moved) {\n evt.cancelable && evt.preventDefault();\n !options.dropBubble && evt.stopPropagation();\n }\n\n ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n // Remove clone(s)\n cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);\n }\n\n if (dragEl) {\n if (this.nativeDraggable) {\n off(dragEl, 'dragend', this);\n }\n\n _disableDraggable(dragEl);\n\n dragEl.style['will-change'] = ''; // Remove classes\n // ghostClass is added in dragStarted\n\n if (moved && !awaitingDragStarted) {\n toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);\n }\n\n toggleClass(dragEl, this.options.chosenClass, false); // Drag stop event\n\n _dispatchEvent({\n sortable: this,\n name: 'unchoose',\n toEl: parentEl,\n newIndex: null,\n newDraggableIndex: null,\n originalEvent: evt\n });\n\n if (rootEl !== parentEl) {\n if (newIndex >= 0) {\n // Add event\n _dispatchEvent({\n rootEl: parentEl,\n name: 'add',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n }); // Remove event\n\n\n _dispatchEvent({\n sortable: this,\n name: 'remove',\n toEl: parentEl,\n originalEvent: evt\n }); // drag from one list and drop into another\n\n\n _dispatchEvent({\n rootEl: parentEl,\n name: 'sort',\n toEl: parentEl,\n fromEl: rootEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n\n putSortable && putSortable.save();\n } else {\n if (newIndex !== oldIndex) {\n if (newIndex >= 0) {\n // drag & drop within the same list\n _dispatchEvent({\n sortable: this,\n name: 'update',\n toEl: parentEl,\n originalEvent: evt\n });\n\n _dispatchEvent({\n sortable: this,\n name: 'sort',\n toEl: parentEl,\n originalEvent: evt\n });\n }\n }\n }\n\n if (Sortable.active) {\n /* jshint eqnull:true */\n if (newIndex == null || newIndex === -1) {\n newIndex = oldIndex;\n newDraggableIndex = oldDraggableIndex;\n }\n\n _dispatchEvent({\n sortable: this,\n name: 'end',\n toEl: parentEl,\n originalEvent: evt\n }); // Save sorting\n\n\n this.save();\n }\n }\n }\n\n this._nulling();\n },\n _nulling: function _nulling() {\n pluginEvent('nulling', this);\n rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;\n savedInputChecked.forEach(function (el) {\n el.checked = true;\n });\n savedInputChecked.length = lastDx = lastDy = 0;\n },\n handleEvent: function handleEvent(\n /**Event*/\n evt) {\n switch (evt.type) {\n case 'drop':\n case 'dragend':\n this._onDrop(evt);\n\n break;\n\n case 'dragenter':\n case 'dragover':\n if (dragEl) {\n this._onDragOver(evt);\n\n _globalDragOver(evt);\n }\n\n break;\n\n case 'selectstart':\n evt.preventDefault();\n break;\n }\n },\n\n /**\n * Serializes the item into an array of string.\n * @returns {String[]}\n */\n toArray: function toArray() {\n var order = [],\n el,\n children = this.el.children,\n i = 0,\n n = children.length,\n options = this.options;\n\n for (; i < n; i++) {\n el = children[i];\n\n if (closest(el, options.draggable, this.el, false)) {\n order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));\n }\n }\n\n return order;\n },\n\n /**\n * Sorts the elements according to the array.\n * @param {String[]} order order of the items\n */\n sort: function sort(order, useAnimation) {\n var items = {},\n rootEl = this.el;\n this.toArray().forEach(function (id, i) {\n var el = rootEl.children[i];\n\n if (closest(el, this.options.draggable, rootEl, false)) {\n items[id] = el;\n }\n }, this);\n useAnimation && this.captureAnimationState();\n order.forEach(function (id) {\n if (items[id]) {\n rootEl.removeChild(items[id]);\n rootEl.appendChild(items[id]);\n }\n });\n useAnimation && this.animateAll();\n },\n\n /**\n * Save the current sorting\n */\n save: function save() {\n var store = this.options.store;\n store && store.set && store.set(this);\n },\n\n /**\n * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.\n * @param {HTMLElement} el\n * @param {String} [selector] default: `options.draggable`\n * @returns {HTMLElement|null}\n */\n closest: function closest$1(el, selector) {\n return closest(el, selector || this.options.draggable, this.el, false);\n },\n\n /**\n * Set/get option\n * @param {string} name\n * @param {*} [value]\n * @returns {*}\n */\n option: function option(name, value) {\n var options = this.options;\n\n if (value === void 0) {\n return options[name];\n } else {\n var modifiedValue = PluginManager.modifyOption(this, name, value);\n\n if (typeof modifiedValue !== 'undefined') {\n options[name] = modifiedValue;\n } else {\n options[name] = value;\n }\n\n if (name === 'group') {\n _prepareGroup(options);\n }\n }\n },\n\n /**\n * Destroy\n */\n destroy: function destroy() {\n pluginEvent('destroy', this);\n var el = this.el;\n el[expando] = null;\n off(el, 'mousedown', this._onTapStart);\n off(el, 'touchstart', this._onTapStart);\n off(el, 'pointerdown', this._onTapStart);\n\n if (this.nativeDraggable) {\n off(el, 'dragover', this);\n off(el, 'dragenter', this);\n } // Remove draggable attributes\n\n\n Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {\n el.removeAttribute('draggable');\n });\n\n this._onDrop();\n\n this._disableDelayedDragEvents();\n\n sortables.splice(sortables.indexOf(this.el), 1);\n this.el = el = null;\n },\n _hideClone: function _hideClone() {\n if (!cloneHidden) {\n pluginEvent('hideClone', this);\n if (Sortable.eventCanceled) return;\n css(cloneEl, 'display', 'none');\n\n if (this.options.removeCloneOnHide && cloneEl.parentNode) {\n cloneEl.parentNode.removeChild(cloneEl);\n }\n\n cloneHidden = true;\n }\n },\n _showClone: function _showClone(putSortable) {\n if (putSortable.lastPutMode !== 'clone') {\n this._hideClone();\n\n return;\n }\n\n if (cloneHidden) {\n pluginEvent('showClone', this);\n if (Sortable.eventCanceled) return; // show clone at dragEl or original position\n\n if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {\n rootEl.insertBefore(cloneEl, dragEl);\n } else if (nextEl) {\n rootEl.insertBefore(cloneEl, nextEl);\n } else {\n rootEl.appendChild(cloneEl);\n }\n\n if (this.options.group.revertClone) {\n this.animate(dragEl, cloneEl);\n }\n\n css(cloneEl, 'display', '');\n cloneHidden = false;\n }\n }\n};\n\nfunction _globalDragOver(\n/**Event*/\nevt) {\n if (evt.dataTransfer) {\n evt.dataTransfer.dropEffect = 'move';\n }\n\n evt.cancelable && evt.preventDefault();\n}\n\nfunction _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {\n var evt,\n sortable = fromEl[expando],\n onMoveFn = sortable.options.onMove,\n retVal; // Support for new CustomEvent feature\n\n if (window.CustomEvent && !IE11OrLess && !Edge) {\n evt = new CustomEvent('move', {\n bubbles: true,\n cancelable: true\n });\n } else {\n evt = document.createEvent('Event');\n evt.initEvent('move', true, true);\n }\n\n evt.to = toEl;\n evt.from = fromEl;\n evt.dragged = dragEl;\n evt.draggedRect = dragRect;\n evt.related = targetEl || toEl;\n evt.relatedRect = targetRect || getRect(toEl);\n evt.willInsertAfter = willInsertAfter;\n evt.originalEvent = originalEvent;\n fromEl.dispatchEvent(evt);\n\n if (onMoveFn) {\n retVal = onMoveFn.call(sortable, evt, originalEvent);\n }\n\n return retVal;\n}\n\nfunction _disableDraggable(el) {\n el.draggable = false;\n}\n\nfunction _unsilent() {\n _silent = false;\n}\n\nfunction _ghostIsLast(evt, vertical, sortable) {\n var rect = getRect(lastChild(sortable.el, sortable.options.draggable));\n var spacer = 10;\n return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;\n}\n\nfunction _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {\n var mouseOnAxis = vertical ? evt.clientY : evt.clientX,\n targetLength = vertical ? targetRect.height : targetRect.width,\n targetS1 = vertical ? targetRect.top : targetRect.left,\n targetS2 = vertical ? targetRect.bottom : targetRect.right,\n invert = false;\n\n if (!invertSwap) {\n // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold\n if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {\n // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2\n // check if past first invert threshold on side opposite of lastDirection\n if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {\n // past first invert threshold, do not restrict inverted threshold to dragEl shadow\n pastFirstInvertThresh = true;\n }\n\n if (!pastFirstInvertThresh) {\n // dragEl shadow (target move distance shadow)\n if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow\n : mouseOnAxis > targetS2 - targetMoveDistance) {\n return -lastDirection;\n }\n } else {\n invert = true;\n }\n } else {\n // Regular\n if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {\n return _getInsertDirection(target);\n }\n }\n }\n\n invert = invert || invertSwap;\n\n if (invert) {\n // Invert of regular\n if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {\n return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;\n }\n }\n\n return 0;\n}\n/**\n * Gets the direction dragEl must be swapped relative to target in order to make it\n * seem that dragEl has been \"inserted\" into that element's position\n * @param {HTMLElement} target The target whose position dragEl is being inserted at\n * @return {Number} Direction dragEl must be swapped\n */\n\n\nfunction _getInsertDirection(target) {\n if (index(dragEl) < index(target)) {\n return 1;\n } else {\n return -1;\n }\n}\n/**\n * Generate id\n * @param {HTMLElement} el\n * @returns {String}\n * @private\n */\n\n\nfunction _generateId(el) {\n var str = el.tagName + el.className + el.src + el.href + el.textContent,\n i = str.length,\n sum = 0;\n\n while (i--) {\n sum += str.charCodeAt(i);\n }\n\n return sum.toString(36);\n}\n\nfunction _saveInputCheckedState(root) {\n savedInputChecked.length = 0;\n var inputs = root.getElementsByTagName('input');\n var idx = inputs.length;\n\n while (idx--) {\n var el = inputs[idx];\n el.checked && savedInputChecked.push(el);\n }\n}\n\nfunction _nextTick(fn) {\n return setTimeout(fn, 0);\n}\n\nfunction _cancelNextTick(id) {\n return clearTimeout(id);\n} // Fixed #973:\n\n\nif (documentExists) {\n on(document, 'touchmove', function (evt) {\n if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {\n evt.preventDefault();\n }\n });\n} // Export utils\n\n\nSortable.utils = {\n on: on,\n off: off,\n css: css,\n find: find,\n is: function is(el, selector) {\n return !!closest(el, selector, el, false);\n },\n extend: extend,\n throttle: throttle,\n closest: closest,\n toggleClass: toggleClass,\n clone: clone,\n index: index,\n nextTick: _nextTick,\n cancelNextTick: _cancelNextTick,\n detectDirection: _detectDirection,\n getChild: getChild\n};\n/**\n * Get the Sortable instance of an element\n * @param {HTMLElement} element The element\n * @return {Sortable|undefined} The instance of Sortable\n */\n\nSortable.get = function (element) {\n return element[expando];\n};\n/**\n * Mount a plugin to Sortable\n * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted\n */\n\n\nSortable.mount = function () {\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n if (plugins[0].constructor === Array) plugins = plugins[0];\n plugins.forEach(function (plugin) {\n if (!plugin.prototype || !plugin.prototype.constructor) {\n throw \"Sortable: Mounted plugin must be a constructor function, not \".concat({}.toString.call(plugin));\n }\n\n if (plugin.utils) Sortable.utils = _objectSpread({}, Sortable.utils, plugin.utils);\n PluginManager.mount(plugin);\n });\n};\n/**\n * Create sortable instance\n * @param {HTMLElement} el\n * @param {Object} [options]\n */\n\n\nSortable.create = function (el, options) {\n return new Sortable(el, options);\n}; // Export\n\n\nSortable.version = version;\n\nvar autoScrolls = [],\n scrollEl,\n scrollRootEl,\n scrolling = false,\n lastAutoScrollX,\n lastAutoScrollY,\n touchEvt$1,\n pointerElemChangedInterval;\n\nfunction AutoScrollPlugin() {\n function AutoScroll() {\n this.defaults = {\n scroll: true,\n scrollSensitivity: 30,\n scrollSpeed: 10,\n bubbleScroll: true\n }; // Bind all private methods\n\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n }\n\n AutoScroll.prototype = {\n dragStarted: function dragStarted(_ref) {\n var originalEvent = _ref.originalEvent;\n\n if (this.sortable.nativeDraggable) {\n on(document, 'dragover', this._handleAutoScroll);\n } else {\n if (this.options.supportPointer) {\n on(document, 'pointermove', this._handleFallbackAutoScroll);\n } else if (originalEvent.touches) {\n on(document, 'touchmove', this._handleFallbackAutoScroll);\n } else {\n on(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref2) {\n var originalEvent = _ref2.originalEvent;\n\n // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)\n if (!this.options.dragOverBubble && !originalEvent.rootEl) {\n this._handleAutoScroll(originalEvent);\n }\n },\n drop: function drop() {\n if (this.sortable.nativeDraggable) {\n off(document, 'dragover', this._handleAutoScroll);\n } else {\n off(document, 'pointermove', this._handleFallbackAutoScroll);\n off(document, 'touchmove', this._handleFallbackAutoScroll);\n off(document, 'mousemove', this._handleFallbackAutoScroll);\n }\n\n clearPointerElemChangedInterval();\n clearAutoScrolls();\n cancelThrottle();\n },\n nulling: function nulling() {\n touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;\n autoScrolls.length = 0;\n },\n _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {\n this._handleAutoScroll(evt, true);\n },\n _handleAutoScroll: function _handleAutoScroll(evt, fallback) {\n var _this = this;\n\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n elem = document.elementFromPoint(x, y);\n touchEvt$1 = evt; // IE does not seem to have native autoscroll,\n // Edge's autoscroll seems too conditional,\n // MACOS Safari does not have autoscroll,\n // Firefox and Chrome are good\n\n if (fallback || Edge || IE11OrLess || Safari) {\n autoScroll(evt, this.options, elem, fallback); // Listener for pointer element change\n\n var ogElemScroller = getParentAutoScrollElement(elem, true);\n\n if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {\n pointerElemChangedInterval && clearPointerElemChangedInterval(); // Detect for pointer elem change, emulating native DnD behaviour\n\n pointerElemChangedInterval = setInterval(function () {\n var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);\n\n if (newElem !== ogElemScroller) {\n ogElemScroller = newElem;\n clearAutoScrolls();\n }\n\n autoScroll(evt, _this.options, newElem, fallback);\n }, 10);\n lastAutoScrollX = x;\n lastAutoScrollY = y;\n }\n } else {\n // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll\n if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {\n clearAutoScrolls();\n return;\n }\n\n autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);\n }\n }\n };\n return _extends(AutoScroll, {\n pluginName: 'scroll',\n initializeByDefault: true\n });\n}\n\nfunction clearAutoScrolls() {\n autoScrolls.forEach(function (autoScroll) {\n clearInterval(autoScroll.pid);\n });\n autoScrolls = [];\n}\n\nfunction clearPointerElemChangedInterval() {\n clearInterval(pointerElemChangedInterval);\n}\n\nvar autoScroll = throttle(function (evt, options, rootEl, isFallback) {\n // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521\n if (!options.scroll) return;\n var x = (evt.touches ? evt.touches[0] : evt).clientX,\n y = (evt.touches ? evt.touches[0] : evt).clientY,\n sens = options.scrollSensitivity,\n speed = options.scrollSpeed,\n winScroller = getWindowScrollingElement();\n var scrollThisInstance = false,\n scrollCustomFn; // New scroll root, set scrollEl\n\n if (scrollRootEl !== rootEl) {\n scrollRootEl = rootEl;\n clearAutoScrolls();\n scrollEl = options.scroll;\n scrollCustomFn = options.scrollFn;\n\n if (scrollEl === true) {\n scrollEl = getParentAutoScrollElement(rootEl, true);\n }\n }\n\n var layersOut = 0;\n var currentParent = scrollEl;\n\n do {\n var el = currentParent,\n rect = getRect(el),\n top = rect.top,\n bottom = rect.bottom,\n left = rect.left,\n right = rect.right,\n width = rect.width,\n height = rect.height,\n canScrollX = void 0,\n canScrollY = void 0,\n scrollWidth = el.scrollWidth,\n scrollHeight = el.scrollHeight,\n elCSS = css(el),\n scrollPosX = el.scrollLeft,\n scrollPosY = el.scrollTop;\n\n if (el === winScroller) {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');\n } else {\n canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');\n canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');\n }\n\n var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);\n var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);\n\n if (!autoScrolls[layersOut]) {\n for (var i = 0; i <= layersOut; i++) {\n if (!autoScrolls[i]) {\n autoScrolls[i] = {};\n }\n }\n }\n\n if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {\n autoScrolls[layersOut].el = el;\n autoScrolls[layersOut].vx = vx;\n autoScrolls[layersOut].vy = vy;\n clearInterval(autoScrolls[layersOut].pid);\n\n if (vx != 0 || vy != 0) {\n scrollThisInstance = true;\n /* jshint loopfunc:true */\n\n autoScrolls[layersOut].pid = setInterval(function () {\n // emulate drag over during autoscroll (fallback), emulating native DnD behaviour\n if (isFallback && this.layer === 0) {\n Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely\n\n }\n\n var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;\n var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;\n\n if (typeof scrollCustomFn === 'function') {\n if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {\n return;\n }\n }\n\n scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);\n }.bind({\n layer: layersOut\n }), 24);\n }\n }\n\n layersOut++;\n } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));\n\n scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not\n}, 30);\n\nvar drop = function drop(_ref) {\n var originalEvent = _ref.originalEvent,\n putSortable = _ref.putSortable,\n dragEl = _ref.dragEl,\n activeSortable = _ref.activeSortable,\n dispatchSortableEvent = _ref.dispatchSortableEvent,\n hideGhostForTarget = _ref.hideGhostForTarget,\n unhideGhostForTarget = _ref.unhideGhostForTarget;\n if (!originalEvent) return;\n var toSortable = putSortable || activeSortable;\n hideGhostForTarget();\n var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;\n var target = document.elementFromPoint(touch.clientX, touch.clientY);\n unhideGhostForTarget();\n\n if (toSortable && !toSortable.el.contains(target)) {\n dispatchSortableEvent('spill');\n this.onSpill({\n dragEl: dragEl,\n putSortable: putSortable\n });\n }\n};\n\nfunction Revert() {}\n\nRevert.prototype = {\n startIndex: null,\n dragStart: function dragStart(_ref2) {\n var oldDraggableIndex = _ref2.oldDraggableIndex;\n this.startIndex = oldDraggableIndex;\n },\n onSpill: function onSpill(_ref3) {\n var dragEl = _ref3.dragEl,\n putSortable = _ref3.putSortable;\n this.sortable.captureAnimationState();\n\n if (putSortable) {\n putSortable.captureAnimationState();\n }\n\n var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);\n\n if (nextSibling) {\n this.sortable.el.insertBefore(dragEl, nextSibling);\n } else {\n this.sortable.el.appendChild(dragEl);\n }\n\n this.sortable.animateAll();\n\n if (putSortable) {\n putSortable.animateAll();\n }\n },\n drop: drop\n};\n\n_extends(Revert, {\n pluginName: 'revertOnSpill'\n});\n\nfunction Remove() {}\n\nRemove.prototype = {\n onSpill: function onSpill(_ref4) {\n var dragEl = _ref4.dragEl,\n putSortable = _ref4.putSortable;\n var parentSortable = putSortable || this.sortable;\n parentSortable.captureAnimationState();\n dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);\n parentSortable.animateAll();\n },\n drop: drop\n};\n\n_extends(Remove, {\n pluginName: 'removeOnSpill'\n});\n\nvar lastSwapEl;\n\nfunction SwapPlugin() {\n function Swap() {\n this.defaults = {\n swapClass: 'sortable-swap-highlight'\n };\n }\n\n Swap.prototype = {\n dragStart: function dragStart(_ref) {\n var dragEl = _ref.dragEl;\n lastSwapEl = dragEl;\n },\n dragOverValid: function dragOverValid(_ref2) {\n var completed = _ref2.completed,\n target = _ref2.target,\n onMove = _ref2.onMove,\n activeSortable = _ref2.activeSortable,\n changed = _ref2.changed,\n cancel = _ref2.cancel;\n if (!activeSortable.options.swap) return;\n var el = this.sortable.el,\n options = this.options;\n\n if (target && target !== el) {\n var prevSwapEl = lastSwapEl;\n\n if (onMove(target) !== false) {\n toggleClass(target, options.swapClass, true);\n lastSwapEl = target;\n } else {\n lastSwapEl = null;\n }\n\n if (prevSwapEl && prevSwapEl !== lastSwapEl) {\n toggleClass(prevSwapEl, options.swapClass, false);\n }\n }\n\n changed();\n completed(true);\n cancel();\n },\n drop: function drop(_ref3) {\n var activeSortable = _ref3.activeSortable,\n putSortable = _ref3.putSortable,\n dragEl = _ref3.dragEl;\n var toSortable = putSortable || this.sortable;\n var options = this.options;\n lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);\n\n if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {\n if (dragEl !== lastSwapEl) {\n toSortable.captureAnimationState();\n if (toSortable !== activeSortable) activeSortable.captureAnimationState();\n swapNodes(dragEl, lastSwapEl);\n toSortable.animateAll();\n if (toSortable !== activeSortable) activeSortable.animateAll();\n }\n }\n },\n nulling: function nulling() {\n lastSwapEl = null;\n }\n };\n return _extends(Swap, {\n pluginName: 'swap',\n eventProperties: function eventProperties() {\n return {\n swapItem: lastSwapEl\n };\n }\n });\n}\n\nfunction swapNodes(n1, n2) {\n var p1 = n1.parentNode,\n p2 = n2.parentNode,\n i1,\n i2;\n if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;\n i1 = index(n1);\n i2 = index(n2);\n\n if (p1.isEqualNode(p2) && i1 < i2) {\n i2++;\n }\n\n p1.insertBefore(n2, p1.children[i1]);\n p2.insertBefore(n1, p2.children[i2]);\n}\n\nvar multiDragElements = [],\n multiDragClones = [],\n lastMultiDragSelect,\n // for selection with modifier key down (SHIFT)\nmultiDragSortable,\n initialFolding = false,\n // Initial multi-drag fold when drag started\nfolding = false,\n // Folding any other time\ndragStarted = false,\n dragEl$1,\n clonesFromRect,\n clonesHidden;\n\nfunction MultiDragPlugin() {\n function MultiDrag(sortable) {\n // Bind all private methods\n for (var fn in this) {\n if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {\n this[fn] = this[fn].bind(this);\n }\n }\n\n if (sortable.options.supportPointer) {\n on(document, 'pointerup', this._deselectMultiDrag);\n } else {\n on(document, 'mouseup', this._deselectMultiDrag);\n on(document, 'touchend', this._deselectMultiDrag);\n }\n\n on(document, 'keydown', this._checkKeyDown);\n on(document, 'keyup', this._checkKeyUp);\n this.defaults = {\n selectedClass: 'sortable-selected',\n multiDragKey: null,\n setData: function setData(dataTransfer, dragEl) {\n var data = '';\n\n if (multiDragElements.length && multiDragSortable === sortable) {\n multiDragElements.forEach(function (multiDragElement, i) {\n data += (!i ? '' : ', ') + multiDragElement.textContent;\n });\n } else {\n data = dragEl.textContent;\n }\n\n dataTransfer.setData('Text', data);\n }\n };\n }\n\n MultiDrag.prototype = {\n multiDragKeyDown: false,\n isMultiDrag: false,\n delayStartGlobal: function delayStartGlobal(_ref) {\n var dragged = _ref.dragEl;\n dragEl$1 = dragged;\n },\n delayEnded: function delayEnded() {\n this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);\n },\n setupClone: function setupClone(_ref2) {\n var sortable = _ref2.sortable,\n cancel = _ref2.cancel;\n if (!this.isMultiDrag) return;\n\n for (var i = 0; i < multiDragElements.length; i++) {\n multiDragClones.push(clone(multiDragElements[i]));\n multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;\n multiDragClones[i].draggable = false;\n multiDragClones[i].style['will-change'] = '';\n toggleClass(multiDragClones[i], this.options.selectedClass, false);\n multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);\n }\n\n sortable._hideClone();\n\n cancel();\n },\n clone: function clone(_ref3) {\n var sortable = _ref3.sortable,\n rootEl = _ref3.rootEl,\n dispatchSortableEvent = _ref3.dispatchSortableEvent,\n cancel = _ref3.cancel;\n if (!this.isMultiDrag) return;\n\n if (!this.options.removeCloneOnHide) {\n if (multiDragElements.length && multiDragSortable === sortable) {\n insertMultiDragClones(true, rootEl);\n dispatchSortableEvent('clone');\n cancel();\n }\n }\n },\n showClone: function showClone(_ref4) {\n var cloneNowShown = _ref4.cloneNowShown,\n rootEl = _ref4.rootEl,\n cancel = _ref4.cancel;\n if (!this.isMultiDrag) return;\n insertMultiDragClones(false, rootEl);\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', '');\n });\n cloneNowShown();\n clonesHidden = false;\n cancel();\n },\n hideClone: function hideClone(_ref5) {\n var _this = this;\n\n var sortable = _ref5.sortable,\n cloneNowHidden = _ref5.cloneNowHidden,\n cancel = _ref5.cancel;\n if (!this.isMultiDrag) return;\n multiDragClones.forEach(function (clone) {\n css(clone, 'display', 'none');\n\n if (_this.options.removeCloneOnHide && clone.parentNode) {\n clone.parentNode.removeChild(clone);\n }\n });\n cloneNowHidden();\n clonesHidden = true;\n cancel();\n },\n dragStartGlobal: function dragStartGlobal(_ref6) {\n var sortable = _ref6.sortable;\n\n if (!this.isMultiDrag && multiDragSortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n }\n\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.sortableIndex = index(multiDragElement);\n }); // Sort multi-drag elements\n\n multiDragElements = multiDragElements.sort(function (a, b) {\n return a.sortableIndex - b.sortableIndex;\n });\n dragStarted = true;\n },\n dragStarted: function dragStarted(_ref7) {\n var _this2 = this;\n\n var sortable = _ref7.sortable;\n if (!this.isMultiDrag) return;\n\n if (this.options.sort) {\n // Capture rects,\n // hide multi drag elements (by positioning them absolute),\n // set multi drag elements rects to dragRect,\n // show multi drag elements,\n // animate to rects,\n // unset rects & remove from DOM\n sortable.captureAnimationState();\n\n if (this.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n css(multiDragElement, 'position', 'absolute');\n });\n var dragRect = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRect);\n });\n folding = true;\n initialFolding = true;\n }\n }\n\n sortable.animateAll(function () {\n folding = false;\n initialFolding = false;\n\n if (_this2.options.animation) {\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n } // Remove all auxiliary multidrag items from el, if sorting enabled\n\n\n if (_this2.options.sort) {\n removeMultiDragElements();\n }\n });\n },\n dragOver: function dragOver(_ref8) {\n var target = _ref8.target,\n completed = _ref8.completed,\n cancel = _ref8.cancel;\n\n if (folding && ~multiDragElements.indexOf(target)) {\n completed(false);\n cancel();\n }\n },\n revert: function revert(_ref9) {\n var fromSortable = _ref9.fromSortable,\n rootEl = _ref9.rootEl,\n sortable = _ref9.sortable,\n dragRect = _ref9.dragRect;\n\n if (multiDragElements.length > 1) {\n // Setup unfold animation\n multiDragElements.forEach(function (multiDragElement) {\n sortable.addAnimationState({\n target: multiDragElement,\n rect: folding ? getRect(multiDragElement) : dragRect\n });\n unsetRect(multiDragElement);\n multiDragElement.fromRect = dragRect;\n fromSortable.removeAnimationState(multiDragElement);\n });\n folding = false;\n insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);\n }\n },\n dragOverCompleted: function dragOverCompleted(_ref10) {\n var sortable = _ref10.sortable,\n isOwner = _ref10.isOwner,\n insertion = _ref10.insertion,\n activeSortable = _ref10.activeSortable,\n parentEl = _ref10.parentEl,\n putSortable = _ref10.putSortable;\n var options = this.options;\n\n if (insertion) {\n // Clones must be hidden before folding animation to capture dragRectAbsolute properly\n if (isOwner) {\n activeSortable._hideClone();\n }\n\n initialFolding = false; // If leaving sort:false root, or already folding - Fold to new location\n\n if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {\n // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible\n var dragRectAbsolute = getRect(dragEl$1, false, true, true);\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n setRect(multiDragElement, dragRectAbsolute); // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted\n // while folding, and so that we can capture them again because old sortable will no longer be fromSortable\n\n parentEl.appendChild(multiDragElement);\n });\n folding = true;\n } // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out\n\n\n if (!isOwner) {\n // Only remove if not folding (folding will remove them anyways)\n if (!folding) {\n removeMultiDragElements();\n }\n\n if (multiDragElements.length > 1) {\n var clonesHiddenBefore = clonesHidden;\n\n activeSortable._showClone(sortable); // Unfold animation for clones if showing from hidden\n\n\n if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {\n multiDragClones.forEach(function (clone) {\n activeSortable.addAnimationState({\n target: clone,\n rect: clonesFromRect\n });\n clone.fromRect = clonesFromRect;\n clone.thisAnimationDuration = null;\n });\n }\n } else {\n activeSortable._showClone(sortable);\n }\n }\n }\n },\n dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {\n var dragRect = _ref11.dragRect,\n isOwner = _ref11.isOwner,\n activeSortable = _ref11.activeSortable;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n });\n\n if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {\n clonesFromRect = _extends({}, dragRect);\n var dragMatrix = matrix(dragEl$1, true);\n clonesFromRect.top -= dragMatrix.f;\n clonesFromRect.left -= dragMatrix.e;\n }\n },\n dragOverAnimationComplete: function dragOverAnimationComplete() {\n if (folding) {\n folding = false;\n removeMultiDragElements();\n }\n },\n drop: function drop(_ref12) {\n var evt = _ref12.originalEvent,\n rootEl = _ref12.rootEl,\n parentEl = _ref12.parentEl,\n sortable = _ref12.sortable,\n dispatchSortableEvent = _ref12.dispatchSortableEvent,\n oldIndex = _ref12.oldIndex,\n putSortable = _ref12.putSortable;\n var toSortable = putSortable || this.sortable;\n if (!evt) return;\n var options = this.options,\n children = parentEl.children; // Multi-drag selection\n\n if (!dragStarted) {\n if (options.multiDragKey && !this.multiDragKeyDown) {\n this._deselectMultiDrag();\n }\n\n toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));\n\n if (!~multiDragElements.indexOf(dragEl$1)) {\n multiDragElements.push(dragEl$1);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: dragEl$1,\n originalEvt: evt\n }); // Modifier activated, select from last to dragEl\n\n if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {\n var lastIndex = index(lastMultiDragSelect),\n currentIndex = index(dragEl$1);\n\n if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {\n // Must include lastMultiDragSelect (select it), in case modified selection from no selection\n // (but previous selection existed)\n var n, i;\n\n if (currentIndex > lastIndex) {\n i = lastIndex;\n n = currentIndex;\n } else {\n i = currentIndex;\n n = lastIndex + 1;\n }\n\n for (; i < n; i++) {\n if (~multiDragElements.indexOf(children[i])) continue;\n toggleClass(children[i], options.selectedClass, true);\n multiDragElements.push(children[i]);\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'select',\n targetEl: children[i],\n originalEvt: evt\n });\n }\n }\n } else {\n lastMultiDragSelect = dragEl$1;\n }\n\n multiDragSortable = toSortable;\n } else {\n multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);\n lastMultiDragSelect = null;\n dispatchEvent({\n sortable: sortable,\n rootEl: rootEl,\n name: 'deselect',\n targetEl: dragEl$1,\n originalEvt: evt\n });\n }\n } // Multi-drag drop\n\n\n if (dragStarted && this.isMultiDrag) {\n // Do not \"unfold\" after around dragEl if reverted\n if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {\n var dragRect = getRect(dragEl$1),\n multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');\n if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;\n toSortable.captureAnimationState();\n\n if (!initialFolding) {\n if (options.animation) {\n dragEl$1.fromRect = dragRect;\n multiDragElements.forEach(function (multiDragElement) {\n multiDragElement.thisAnimationDuration = null;\n\n if (multiDragElement !== dragEl$1) {\n var rect = folding ? getRect(multiDragElement) : dragRect;\n multiDragElement.fromRect = rect; // Prepare unfold animation\n\n toSortable.addAnimationState({\n target: multiDragElement,\n rect: rect\n });\n }\n });\n } // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert\n // properly they must all be removed\n\n\n removeMultiDragElements();\n multiDragElements.forEach(function (multiDragElement) {\n if (children[multiDragIndex]) {\n parentEl.insertBefore(multiDragElement, children[multiDragIndex]);\n } else {\n parentEl.appendChild(multiDragElement);\n }\n\n multiDragIndex++;\n }); // If initial folding is done, the elements may have changed position because they are now\n // unfolding around dragEl, even though dragEl may not have his index changed, so update event\n // must be fired here as Sortable will not.\n\n if (oldIndex === index(dragEl$1)) {\n var update = false;\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement.sortableIndex !== index(multiDragElement)) {\n update = true;\n return;\n }\n });\n\n if (update) {\n dispatchSortableEvent('update');\n }\n }\n } // Must be done after capturing individual rects (scroll bar)\n\n\n multiDragElements.forEach(function (multiDragElement) {\n unsetRect(multiDragElement);\n });\n toSortable.animateAll();\n }\n\n multiDragSortable = toSortable;\n } // Remove clones if necessary\n\n\n if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {\n multiDragClones.forEach(function (clone) {\n clone.parentNode && clone.parentNode.removeChild(clone);\n });\n }\n },\n nullingGlobal: function nullingGlobal() {\n this.isMultiDrag = dragStarted = false;\n multiDragClones.length = 0;\n },\n destroyGlobal: function destroyGlobal() {\n this._deselectMultiDrag();\n\n off(document, 'pointerup', this._deselectMultiDrag);\n off(document, 'mouseup', this._deselectMultiDrag);\n off(document, 'touchend', this._deselectMultiDrag);\n off(document, 'keydown', this._checkKeyDown);\n off(document, 'keyup', this._checkKeyUp);\n },\n _deselectMultiDrag: function _deselectMultiDrag(evt) {\n if (typeof dragStarted !== \"undefined\" && dragStarted) return; // Only deselect if selection is in this sortable\n\n if (multiDragSortable !== this.sortable) return; // Only deselect if target is not item in this sortable\n\n if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return; // Only deselect if left click\n\n if (evt && evt.button !== 0) return;\n\n while (multiDragElements.length) {\n var el = multiDragElements[0];\n toggleClass(el, this.options.selectedClass, false);\n multiDragElements.shift();\n dispatchEvent({\n sortable: this.sortable,\n rootEl: this.sortable.el,\n name: 'deselect',\n targetEl: el,\n originalEvt: evt\n });\n }\n },\n _checkKeyDown: function _checkKeyDown(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = true;\n }\n },\n _checkKeyUp: function _checkKeyUp(evt) {\n if (evt.key === this.options.multiDragKey) {\n this.multiDragKeyDown = false;\n }\n }\n };\n return _extends(MultiDrag, {\n // Static methods & properties\n pluginName: 'multiDrag',\n utils: {\n /**\r\n * Selects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be selected\r\n */\n select: function select(el) {\n var sortable = el.parentNode[expando];\n if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;\n\n if (multiDragSortable && multiDragSortable !== sortable) {\n multiDragSortable.multiDrag._deselectMultiDrag();\n\n multiDragSortable = sortable;\n }\n\n toggleClass(el, sortable.options.selectedClass, true);\n multiDragElements.push(el);\n },\n\n /**\r\n * Deselects the provided multi-drag item\r\n * @param {HTMLElement} el The element to be deselected\r\n */\n deselect: function deselect(el) {\n var sortable = el.parentNode[expando],\n index = multiDragElements.indexOf(el);\n if (!sortable || !sortable.options.multiDrag || !~index) return;\n toggleClass(el, sortable.options.selectedClass, false);\n multiDragElements.splice(index, 1);\n }\n },\n eventProperties: function eventProperties() {\n var _this3 = this;\n\n var oldIndicies = [],\n newIndicies = [];\n multiDragElements.forEach(function (multiDragElement) {\n oldIndicies.push({\n multiDragElement: multiDragElement,\n index: multiDragElement.sortableIndex\n }); // multiDragElements will already be sorted if folding\n\n var newIndex;\n\n if (folding && multiDragElement !== dragEl$1) {\n newIndex = -1;\n } else if (folding) {\n newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');\n } else {\n newIndex = index(multiDragElement);\n }\n\n newIndicies.push({\n multiDragElement: multiDragElement,\n index: newIndex\n });\n });\n return {\n items: _toConsumableArray(multiDragElements),\n clones: [].concat(multiDragClones),\n oldIndicies: oldIndicies,\n newIndicies: newIndicies\n };\n },\n optionListeners: {\n multiDragKey: function multiDragKey(key) {\n key = key.toLowerCase();\n\n if (key === 'ctrl') {\n key = 'Control';\n } else if (key.length > 1) {\n key = key.charAt(0).toUpperCase() + key.substr(1);\n }\n\n return key;\n }\n }\n });\n}\n\nfunction insertMultiDragElements(clonesInserted, rootEl) {\n multiDragElements.forEach(function (multiDragElement, i) {\n var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(multiDragElement, target);\n } else {\n rootEl.appendChild(multiDragElement);\n }\n });\n}\n/**\r\n * Insert multi-drag clones\r\n * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted\r\n * @param {HTMLElement} rootEl\r\n */\n\n\nfunction insertMultiDragClones(elementsInserted, rootEl) {\n multiDragClones.forEach(function (clone, i) {\n var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];\n\n if (target) {\n rootEl.insertBefore(clone, target);\n } else {\n rootEl.appendChild(clone);\n }\n });\n}\n\nfunction removeMultiDragElements() {\n multiDragElements.forEach(function (multiDragElement) {\n if (multiDragElement === dragEl$1) return;\n multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);\n });\n}\n\nSortable.mount(new AutoScrollPlugin());\nSortable.mount(Remove, Revert);\n\nexport default Sortable;\nexport { MultiDragPlugin as MultiDrag, Sortable, SwapPlugin as Swap };\n","!function(e,t){if(\"object\"==typeof exports&&\"object\"==typeof module)module.exports=t();else if(\"function\"==typeof define&&define.amd)define([],t);else{var n=t();for(var i in n)(\"object\"==typeof exports?exports:e)[i]=n[i]}}(window,(function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"/\",n(n.s=62)}([function(e,t,n){window,e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"/\",n(n.s=8)}([function(e,t){e.exports=n(4)},function(e,t){e.exports=n(38)},function(e,t){e.exports=n(8)},function(e,t){e.exports=n(41)},function(e,t){e.exports=n(63)},function(e,t){e.exports=n(64)},function(e,t){e.exports=n(59)},function(e,t){e.exports=n(61)},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"createBrowserNotifications\",(function(){return f})),n.d(t,\"BrowserNotification\",(function(){return l})),n.d(t,\"Decorator\",(function(){return p})),n.d(t,\"Err\",(function(){return d})),n.d(t,\"Evt\",(function(){return m})),n.d(t,\"createHttp\",(function(){return b})),n.d(t,\"createLogger\",(function(){return u})),n.d(t,\"Logger\",(function(){return a})),n.d(t,\"createNotifications\",(function(){return C})),n.d(t,\"Notifications\",(function(){return E})),n.d(t,\"Signal\",(function(){return k})),n.d(t,\"I18N\",(function(){return T}));var i=n(0),r=n.n(i),o=n(1);const s=(...e)=>e.map(e=>\"string\"==typeof e?e:JSON.stringify(e));var a;function u(e){const t=new a.Service(e);return a.POOL.addLogger(t),t}!function(e){e.MAX_LOGS_SIZE=1048576,e.LS_LOGS_KEY=\"uuip-logs\";const t=/[\\u0100-\\uFFFF]/g;let n;!function(e){e[e.Trace=1]=\"Trace\",e[e.Debug=2]=\"Debug\",e[e.Warn=3]=\"Warn\",e[e.Error=4]=\"Error\",e[e.Fatal=5]=\"Fatal\"}(n=e.Level||(e.Level={})),e.Service=class{constructor(e){this.loggerEmitter=r()(),this.prefix=e}log(t,...n){const i=s(this.prefix?[\"\"+this.prefix,...n]:n),r=Date.now(),a=o.DateTime.fromMillis(r).toFormat(\"yyyy-LL-dd HH:mm:ss:SSS\");switch(t){case e.Level.Trace:console.info(a,...i);break;case e.Level.Debug:console.log(a,...i);break;case e.Level.Warn:console.warn(a,...i);break;case e.Level.Error:case e.Level.Fatal:console.error(a,...i);break;default:console.log(...i)}const u={pfx:this.prefix,msgs:[...n],ts:r,lvl:t};this.emit(\"add\",u)}info(...e){this.log(n.Trace,...e)}warn(...e){this.log(n.Warn,...e)}error(...e){this.log(n.Error,...e)}emit(e,...t){this.loggerEmitter.emit(e,...t)}addEventListener(e,t){return this.loggerEmitter.on(e,t),()=>{this.removeEventListener(e,t)}}removeEventListener(e,t){this.loggerEmitter.off(e,t)}};class i{constructor(){this.loggers=new Map,this.logsCollection=[],this.prefixedLogsCollections={},this.logRecordsSerializedLength=0,this.onLoggerAddRecord=e=>{this.addLogRecord(e),this.save()},this.restore()}static getSerializedJsonLogRecordBytesSize(e=\"\"){const n=e.length;if(n){const i=e.replace(t,\"\").length;return 1*i+2*(n-i)}return n}get serializedJsonLogsBytesSize(){const e=this.logsCollection.length;return 2+this.logRecordsSerializedLength+1*(e-1)}save(){window.localStorage.setItem(e.LS_LOGS_KEY,JSON.stringify(this.logsCollection))}restore(){try{(JSON.parse(window.localStorage.getItem(e.LS_LOGS_KEY)||\"[]\")||[]).forEach(e=>this.addLogRecord(e))}catch(e){console.warn(\"Logger failed read logs from localStorage: \",e)}}addLogRecord(t){for(this.logsCollection.push(t),this.logRecordsSerializedLength+=i.getSerializedJsonLogRecordBytesSize(JSON.stringify(t)),this.prefixedLogsCollections[t.pfx]=this.prefixedLogsCollections[t.pfx]||new Set,this.prefixedLogsCollections[t.pfx].add(t);this.serializedJsonLogsBytesSize>e.MAX_LOGS_SIZE;)this.logsCollection.length&&this.removeLogRecord(this.logsCollection[0])}removeLogRecord(e){if(e){const t=this.logsCollection.indexOf(e);-1!==t&&(this.logsCollection.splice(t,1),this.logRecordsSerializedLength-=i.getSerializedJsonLogRecordBytesSize(JSON.stringify(e)),this.prefixedLogsCollections[e.pfx]&&this.prefixedLogsCollections[e.pfx].has(e)&&this.prefixedLogsCollections[e.pfx].delete(e))}}static getLogRecordReadable(e){return{prefix:e.pfx,messages:e.msgs,timestamp:o.DateTime.fromMillis(e.ts).toFormat(\"yyyy-LL-dd HH:mm:ss:SSS\"),level:n[e.lvl]}}static getLogsReadableJson(e){const t=e=>e.map(e=>i.getLogRecordReadable(e));return JSON.stringify(Array.isArray(e)?t(e):Object.keys(e).reduce((n,i)=>(n[i]=t(e[i]),n),{}),null,2)}static getLogsReadableText(e){const t=e=>e.reduce((e,t)=>{const n=i.getLogRecordReadable(t);return e+(n.timestamp+\" \")+n.prefix+\" \"+n.level+\" \"+s(n.messages).join(\" \")+\" \\r\\n\"},\"\");return Array.isArray(e)?t(e):Object.keys(e).reduce((n,i)=>(n+=`[SERVICE \"${i}\" LOGS]: `)+t(e[i]),\"\")}static getLogsUrl(e){return\"data:text/plain;charset=utf-8,\"+encodeURIComponent(e)}static browserDownload(e,t){try{if(document&&document.createElement){const n=document.createElement(\"a\");n.setAttribute(\"href\",e),n.setAttribute(\"download\",t),n.style.display=\"none\",document.body.appendChild(n),n.click(),document.body.removeChild(n)}else console.warn(\"Browser is not supported to download logs\")}catch(e){}}addLogger(e){this.loggers.set(e.prefix,e),e.removeEventListener(\"add\",this.onLoggerAddRecord),e.addEventListener(\"add\",this.onLoggerAddRecord)}getAllLogsJsonUrl(){return i.getLogsUrl(i.getLogsReadableJson(this.logsCollection))}getAllPrefixedLogsJsonUrl(){return i.getLogsUrl(i.getLogsReadableJson(this.getAllPrefixedLogsCollections()))}getPrefixedLogsJsonUrl(e){return i.getLogsUrl(i.getLogsReadableJson(this.getPrefixedLogsCollection(e)))}getAllLogsTextUrl(){return i.getLogsUrl(i.getLogsReadableText(this.logsCollection))}getPrefixedLogsTextUrl(e){return i.getLogsUrl(i.getLogsReadableText(this.getPrefixedLogsCollection(e)))}browserDownloadAllLogsJson(){i.browserDownload(this.getAllLogsJsonUrl(),new Date+\"_all_logs.json\")}browserDownloadAllPrefixedLogsJson(){i.browserDownload(this.getAllPrefixedLogsJsonUrl(),new Date+\"_all_prefixed_logs.json\")}browserDownloadPrefixedLogsJson(e){i.browserDownload(this.getPrefixedLogsJsonUrl(e),`${new Date}_${e}_logs.json`)}browserDownloadAllLogsText(){i.browserDownload(this.getAllLogsTextUrl(),new Date+\"_all_logs.log\")}browserDownloadPrefixedLogsText(e){i.browserDownload(this.getPrefixedLogsTextUrl(e),`${new Date}_${e}_logs.log`)}cleanupAllLogs(){this.logsCollection.length=0,this.logRecordsSerializedLength=0,Object.keys(this.prefixedLogsCollections).forEach(e=>this.prefixedLogsCollections[e]=new Set),this.save()}cleanupPrefixedLogs(e){this.getPrefixedLogsCollection(e).forEach(e=>this.removeLogRecord(e)),this.prefixedLogsCollections[e]=new Set,this.save()}getAllLogsCollection(){return[...this.logsCollection]}getAllPrefixedLogsCollections(){return Object.keys(this.prefixedLogsCollections).reduce((e,t)=>(e[t]=this.getPrefixedLogsCollection(t),e),{})}getPrefixedLogsCollection(e){return Array.from(this.prefixedLogsCollections[e]||new Set)}}e.ServicesPool=i,e.POOL=new e.ServicesPool}(a||(a={}));const c=u(\"unified-ui-platform-sdk\");var l,d;function f(e){return new l.Service(e)}function h(e,t){if(e.descriptor=e.descriptor||Object.getOwnPropertyDescriptor(e.target,e.key),\"function\"!=typeof e.descriptor.value)return console.warn(e.key,\"Decorator must be used on function\"),e.descriptor;const n=e.descriptor.value,i=e.target.constructor.name;return e.descriptor.value=function(){const e=[];for(let t=0;twindow.Notification.requestPermission(t=>e(t))):c.warn(\"Browser notification is not supported...\")}))}fire(e,t){return new window.Notification(e,Object.assign(Object.assign({},this.defaultOptions),t||{}))}}e.Service=t}(l||(l={})),function(e){class t extends Error{constructor(e,t){super(),this.isErr=\"yes\",this.id=e,this.stack=(new Error).stack,\"string\"==typeof t?this.message=t:t instanceof Error?(this.message=t.message,this.name=t.name):this.message=\"\"}}e.Message=t;class n extends Error{constructor(e,t){super(),this.isErr=\"yes\",this.id=e,this.stack=(new Error).stack,this.details=t,this.message=\"{err.details}\"}}e.Details=n,e.Create=class{}}(d||(d={}));var p,v,g=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};(v=p||(p={})).Debounce=function(e=250){return function(t,n,i){let r;return h({target:t,key:n,descriptor:i},(function(t,n){clearTimeout(r),r=window.setTimeout(()=>{clearTimeout(r),t.apply(this,n)},e)}))}},v.Evt=function(){return(e,t)=>{const n={get(){return new m(this,void 0!==t?t:e.key)},enumerable:!0,configurable:!0};return void 0!==t?Object.defineProperty(e,t,n):{kind:\"method\",placement:\"prototype\",key:e.key,descriptor:n}}},v.Exec=function(e,t=!0){return function(n,i,r){return h({target:n,key:i,descriptor:r},(function(n,r){return function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const o=\"_\"+i+\"_exec_flag\";if(t&&this[o])return void console.log(\"PREVENTING DOUBLE EXECUTION\");const s=t=>{if(this[o]=t,\"function\"==typeof e)e.call(this,{isExec:t,ctx:this});else{const n=e;t?n.before&&n.before.call(this,this):n.after&&n.after.call(this,this)}};s(!0);const a=n.apply(this,r);return a instanceof Promise?a.then(()=>s(!1)).catch(()=>s(!1)):(console.warn(\"Must be async function to use [@Executing] decorator\"),s(!1)),a}))}))}},v.Handle=function(e){return function(t,n,i){return h({target:t,key:n,descriptor:i},(function(t,i,r){return g(this,void 0,void 0,(function*(){const o=this,s=t=>g(this,void 0,void 0,(function*(){t.id&&\"string\"==typeof t.id&&\"yes\"===t.isErr||(\"string\"==typeof t||t instanceof Error?t=new d.Message(\"system\",t):(console.warn(\"Err must be 'string' or 'new Error()' instance\"),t=new d.Message(\"system\",\"\")));const i=t;i.ctx=o;const s=`Error] ${r}.${n} [${i.id}]: ${i.message}`;if(\"function\"==typeof e){const t=e;console.log(\"[Handled\"+s);const n=t.call(o,i);n instanceof Promise&&(yield n)}else{const t=e;if(t[i.id]){console.log(\"[Handled\"+s);const e=t[i.id].call(o,i);e instanceof Promise&&(yield e)}else if(t.handle){console.log(\"[Handled\"+s);const e=t.handle.call(o,i);e instanceof Promise&&(yield e)}else console.warn(\"[Unhandled \"+s);if(t.fallback){const e=t.fallback.call(o,i);e instanceof Promise&&(yield e)}}}));try{const e=t.apply(o,i);return e instanceof Promise?new Promise(t=>{e.then(t).catch(e=>g(this,void 0,void 0,(function*(){yield s(e),t(void 0)})))}):e}catch(e){return void(yield s(e))}}))}))}},v.Once=function(){return function(e,t,n){return h({target:e,key:t,descriptor:n},(function(e,n){const i=\"_\"+t+\"_once_flag\";if(!this[i])return this[i]=!0,e.call(this,n)}))}},v.Throttle=function(e=1e3/60){return function(t,n,i){let r=void 0,o=Date.now();return h({target:t,key:n,descriptor:i},(function(t,n){const i=(...n)=>{const s=Date.now();window.clearTimeout(r),!o||s-o>=e?(o=s,t.apply(this,n)):r=window.setTimeout(()=>i(...n),e-(s-o))};i(...n)}))}};class m{constructor(e,t){this.target=e,this.eventName=t}emit(e,t={bubbles:!0,composed:!0,cancelable:!1}){this.target.dispatchEvent(new CustomEvent(this.eventName,Object.assign({detail:e},t)))}}var y=n(3),S=n.n(y),w=n(4);function b(e){const t=S.a.create();return t.accessToken=e,t.interceptors.request.use(e=>{if(!e.headers.Authorization&&t.accessToken&&(e.headers.Authorization=\"Bearer \"+t.accessToken),!e.headers.TrackingID){const t=Object(w.v1)();e.headers.TrackingID=`uuip_${t}_1.0:1.0`}return e.headers[\"Content-Type\"]||(e.headers[\"Content-Type\"]=\"application/json\"),e}),t}var E,k,O=n(2),L=n.n(O);function C(e={}){const t=new E.Service;return t.updateConfig(e),t}!function(e){let t,n;!function(e){let t,n,i,r,o,s,a,u;!function(e){e.Info=\"info\",e.Warn=\"warn\",e.Error=\"error\",e.Success=\"success\",e.Chat=\"chat\",e.Default=\"default\"}(t=e.Type||(e.Type={})),e.TYPES=Object.values(t),function(e){e.Silent=\"silent\",e.AutoDismiss=\"autodismiss\",e.Acknowledge=\"acknowledge\"}(n=e.Mode||(e.Mode={})),e.MODES=Object.values(n),function(e){e.Added=\"added\",e.Pended=\"pended\",e.Activated=\"activated\",e.Deactivated=\"deactivated\",e.Removed=\"removed\"}(i=e.Status||(e.Status={})),e.StatusWeight={[i.Added]:0,[i.Pended]:1,[i.Activated]:2,[i.Deactivated]:3,[i.Removed]:4},e.STATUSES=Object.values(i),function(e){e.User=\"user_add\"}(r=e.AddEventReason||(e.AddEventReason={})),function(e){e.ServiceAutoPropagate=\"service_auto_propagate_pending\",e.ServiceAutoDismiss=\"service_autodismiss_pending\",e.UserSilent=\"user_silent_pending\"}(o=e.PendingEventReason||(e.PendingEventReason={})),function(e){e.ServiceAutoPropagate=\"service_auto_propagate_activate\"}(s=e.ActivateEventReason||(e.ActivateEventReason={})),function(e){e.UserNegative=\"user_negative_deactivate\",e.UserPositive=\"user_positive_deactivate\",e.UserNeutral=\"user_neutral_deactivate\"}(a=e.DeactivateEventReason||(e.DeactivateEventReason={})),function(e){e.User=\"user_remove\"}(u=e.RemoveEventReason||(e.RemoveEventReason={}))}(t=e.ItemMeta||(e.ItemMeta={})),function(e){e.STATUS_EVENTS=[\"add\",\"pending\",\"activate\",\"deactivate\",\"remove\"],e.STATUS_EVENT_MAP={add:t.Status.Added,pending:t.Status.Pended,activate:t.Status.Activated,deactivate:t.Status.Deactivated,remove:t.Status.Removed},e.DISABLED_ITEM_MODE={[t.Mode.Silent]:!1,[t.Mode.AutoDismiss]:!1,[t.Mode.Acknowledge]:!1},e.ACTIVATED_ITEM_MODE_LIMIT={[t.Mode.Silent]:0,[t.Mode.AutoDismiss]:10,[t.Mode.Acknowledge]:1},e.AUTO_DISMISS_TIMEOUT=5e3}(n=e.ServiceMeta||(e.ServiceMeta={}));class i{constructor(){this.hubEmitter=r()()}emit(e,...t){this.hubEmitter.emit(e,...t)}addEventListener(e,t){this.hubEmitter.on(e,t)}addOnceEventListener(e,t){this.hubEmitter.once(e,t)}removeEventListener(e,t){this.hubEmitter.off(e,t)}removeAllEventListeners(){L()(this.hubEmitter)}}e.Item=class{constructor(e,n){this._serviceHubSubscriptions=[],this._itemEmitter=r()();const{type:i,mode:s,title:a,data:u,timestamp:c}=e.data;this.type=i,this.title=a,this.data=u,this._mode=s,this.timestamp=c||(new Date).toISOString(),this.datetime=o.DateTime.fromISO(this.timestamp).toLocaleString(o.DateTime.DATETIME_SHORT_WITH_SECONDS),this.options=Object.freeze(this.validateAuxOptions(e.options||{})),n&&(this._serviceHubAdapter=n,this._status=t.Status.Added,this._reason=t.AddEventReason.User,this.bindItemHubListeners())}get status(){return this._status}get reason(){return this._reason}get mode(){return this._mode}validateAuxOptions(e){let n={};return e&&void 0!==e.AUTO_DISMISS_TIMEOUT&&this.mode===t.Mode.AutoDismiss&&(n=Object.assign(Object.assign({},n),{AUTO_DISMISS_TIMEOUT:e.AUTO_DISMISS_TIMEOUT})),n}bindItemHubListeners(){if(this._serviceHubAdapter){{const e=(e,n,i)=>{this.timestamp in e&&(this._status=n,this._reason=i,n===t.Status.Removed&&(this.unbindItemHubListeners(),this.removeAllEventListeners()),this.emit(\"statusUpdate\",n,i))};this._serviceHubAdapter.addEventListener(\"statusServiceUpdateResponse\",e);const n=()=>{var t;null===(t=this._serviceHubAdapter)||void 0===t||t.removeEventListener(\"statusServiceUpdateResponse\",e)};this._serviceHubSubscriptions.push(n)}{const e=(e,t)=>{this.timestamp in e&&(this._mode=t,this.emit(\"modeUpdate\",t))};this._serviceHubAdapter.addEventListener(\"modeStatusUpdateResponse\",e);const t=()=>{var t;null===(t=this._serviceHubAdapter)||void 0===t||t.removeEventListener(\"modeStatusUpdateResponse\",e)};this._serviceHubSubscriptions.push(t)}}}unbindItemHubListeners(){this._serviceHubSubscriptions&&(this._serviceHubSubscriptions.forEach(e=>e()),this._serviceHubSubscriptions.length=0)}deactivate(e){this._status&&t.StatusWeight[this._status]0))=>[...e,...t].sort(n),a=(e,t)=>e.reduce((e,n)=>(-1===t.indexOf(n)&&e.push(n),e),[]);class u{constructor(){this.emitter=r()(),this.map={},this.status=u.createStatus(),this.serviceConfig={DISABLED_ITEM_MODE:Object.assign({},n.DISABLED_ITEM_MODE),ACTIVATED_ITEM_MODE_LIMIT:Object.assign({},n.ACTIVATED_ITEM_MODE_LIMIT),AUTO_DISMISS_TIMEOUT:n.AUTO_DISMISS_TIMEOUT},this.activeAutoDismissTimeoutRefs={},this.serviceHubAdapter=new i,this.bindServiceHubEvents()}static mergeConfig(e,...t){if(!t.length)return e;const n=t.shift(),i=e=>e&&\"object\"==typeof e&&!Array.isArray(e);if(i(e)&&i(n))for(const t in n)i(n[t])?(e[t]||Object.assign(e,{[t]:{}}),this.mergeConfig(e[t],n[t])):Object.assign(e,{[t]:n[t]});return this.mergeConfig(e,...t)}static createStatus(){return{[t.Status.Added]:this.createStatusHolderCollection(),[t.Status.Pended]:this.createStatusHolderCollection(),[t.Status.Activated]:this.createStatusHolderCollection(),[t.Status.Deactivated]:this.createStatusHolderCollection(),[t.Status.Removed]:this.createStatusHolderCollection()}}static createStatusHolderCollection(){return Object.assign([],Object.assign(Object.assign({ids:[]},this.createStatusHolderSubCollections(t.MODES)),this.createStatusHolderSubCollections(t.TYPES)))}static createStatusHolderSubCollections(e){return Object.assign({},e.reduce((e,t)=>(e[t]=[],e),{}))}updateNotificationsCollections(){const e=u.createStatus();this.status.added.ids.forEach(n=>{const i=this.map[n];t.STATUSES.forEach(t=>{-1!==this.status[t].ids.indexOf(i.timestamp)&&(e[t].push(i),e[t].ids.push(n),e[t][i.mode].push(i),e[t][i.type].push(i))})}),this.status=e}setAutoDismiss(e,n=(()=>{})){this.prepareUpdateNotifications(e).forEach(e=>{var i;if(e.mode===t.Mode.AutoDismiss){const t=()=>n(e);this.activeAutoDismissTimeoutRefs[e.timestamp]=window.setTimeout(t,null!==(i=e.options.AUTO_DISMISS_TIMEOUT)&&void 0!==i?i:this.serviceConfig.AUTO_DISMISS_TIMEOUT)}})}removeAutoDismiss(e,t=(()=>{})){this.prepareUpdateNotifications(e).forEach(e=>{e.timestamp in this.activeAutoDismissTimeoutRefs&&(t(e),window.clearTimeout(this.activeAutoDismissTimeoutRefs[e.timestamp]),delete this.activeAutoDismissTimeoutRefs[e.timestamp])})}update(e,t,n){const i=Array.isArray(n)?n:[n];if(i.length){const n=i.map(e=>e.timestamp);switch(e){case\"add\":i.forEach(e=>this.map[e.timestamp]=e),this.status.added.ids=s(this.status.added.ids,n,u.sortTimestampsFn);break;case\"pending\":this.status.pended.ids=s(this.status.pended.ids,n,u.sortTimestampsFn),this.status.activated.ids=a(this.status.activated.ids,n),this.status.deactivated.ids=a(this.status.deactivated.ids,n);break;case\"activate\":this.status.pended.ids=a(this.status.pended.ids,n),this.status.activated.ids=s(this.status.activated.ids,n,u.sortTimestampsFn),this.status.deactivated.ids=a(this.status.deactivated.ids,n);break;case\"deactivate\":this.status.pended.ids=a(this.status.pended.ids,n),this.status.activated.ids=a(this.status.activated.ids,n),this.status.deactivated.ids=s(this.status.deactivated.ids,n,u.sortTimestampsFn);break;case\"remove\":this.status.pended.ids=a(this.status.pended.ids,n),this.status.activated.ids=a(this.status.activated.ids,n),this.status.deactivated.ids=a(this.status.deactivated.ids,n),this.status.added.ids=a(this.status.added.ids,n),this.status.removed.ids=s(this.status.removed.ids,n,u.sortTimestampsFn),n.forEach(e=>delete this.map[e])}this.updateNotificationsCollections(),this.emit(e,i,t),this.propagate(e,t,i)}}propagate(e,n,i){const r=Array.isArray(i)?i:[i];if(r.length)switch(e){case\"add\":this.update(\"pending\",t.PendingEventReason.ServiceAutoPropagate,r);break;case\"pending\":r.forEach(e=>{this.removeAutoDismiss(e)}),this.update(\"activate\",t.ActivateEventReason.ServiceAutoPropagate,this.prepareActiveCandidatesNotifications(this.status.pended));break;case\"activate\":r.forEach(e=>{this.setAutoDismiss(e,e=>{e.mode===t.Mode.AutoDismiss&&this.serviceHubAdapter.emit(\"statusServiceUpdateRequest\",e,t.Status.Pended,t.PendingEventReason.ServiceAutoDismiss)})});break;case\"deactivate\":r.forEach(e=>{this.removeAutoDismiss(e)}),this.update(\"activate\",t.ActivateEventReason.ServiceAutoPropagate,this.prepareActiveCandidatesNotifications(this.status.pended));break;case\"remove\":this.update(\"deactivate\",t.DeactivateEventReason.UserNegative,r)}}prepareAddNotifications(t){const n=Object.keys(this.serviceConfig.DISABLED_ITEM_MODE).reduce((e,t)=>(this.serviceConfig.DISABLED_ITEM_MODE[t]||e.push(t),e),[]).map(e=>`\"${e}\"`).join(\", \");return(Array.isArray(t)?t:[t]).filter(e=>!this.serviceConfig.DISABLED_ITEM_MODE[e.data.mode]||(c.error(`Trying to .add(...) notification mode \"${e.data.mode}\" that is disabled in this notifications service instance by configuration.Current configuration is: \"${JSON.stringify(this.config)}\"Only ${n} allowed. Ignoring .add(${JSON.stringify(e)}) notification...`),!1)).map(t=>new e.Item(t,this.serviceHubAdapter))}prepareUpdateNotifications(e){return(Array.isArray(e)?e:[e]).reduce((e,t)=>(t.timestamp in this.map?e.push(t):c.error(\"Trying to handle untracked notification. Call .add(...) first...\",JSON.stringify(t)),e),[])}prepareActiveCandidatesNotifications(e){const n=(Array.isArray(e)?e:[e]).reduce((e,t)=>(this.status.activated[t.mode].length+e[t.mode].lengthe.concat(t),[])}static sortByTimestampsFn(e,t){return u.sortTimestampsFn(e.timestamp,t.timestamp)}get added(){return this.status.added}get pended(){return this.status.pended}get activated(){return this.status.activated}get deactivated(){return this.status.deactivated}getNotificationStatus(e){return Object.keys(this.status).filter(e=>e!==t.Status.Added).find(t=>-1!==this.status[t].ids.indexOf(e.timestamp))}get config(){return Object.freeze(this.serviceConfig)}static validateUpdateConfig(e){const i=e;if(i.ACTIVATED_ITEM_MODE_LIMIT&&i.ACTIVATED_ITEM_MODE_LIMIT.acknowledge>n.ACTIVATED_ITEM_MODE_LIMIT.acknowledge)throw new Error(`\\n Max ${t.Mode.Acknowledge} limit is ${n.ACTIVATED_ITEM_MODE_LIMIT.acknowledge}\\n `);if(i.DISABLED_ITEM_MODE){if(!Object.keys(i.DISABLED_ITEM_MODE).reduce((e,t)=>(i.DISABLED_ITEM_MODE[t]&&e++,e),0))throw new Error(\"At least one notifications mode should be allowed in service instance\");Object.keys(i.ACTIVATED_ITEM_MODE_LIMIT).forEach(e=>{e in i.DISABLED_ITEM_MODE&&i.DISABLED_ITEM_MODE[e]&&c.warn(`Changing configuration limit count for mode \"${e}\" won't have any effect, because this mode is disabled in notifications service instance`)}),\"AUTO_DISMISS_TIMEOUT\"in i&&i.DISABLED_ITEM_MODE[t.Mode.AutoDismiss]&&c.warn(`Changing \"AUTO_DISMISS_TIMEOUT\" configuration option won't have any effect,because \"${t.Mode.AutoDismiss}\" mode is disabled in notifications service instance`)}return!0}updateConfig(e){u.validateUpdateConfig(e)&&(this.serviceConfig=u.mergeConfig({},this.serviceConfig,e),c.info(\"Updated notifications service configuration: \",this.config))}add(e){const n=this.prepareAddNotifications(e);return this.update(\"add\",t.AddEventReason.User,n),n}pending(e){const n=this.prepareUpdateNotifications(e);return this.serviceHubAdapter.emit(\"statusServiceUpdateRequest\",n,t.Status.Pended,t.PendingEventReason.UserSilent),n}deactivate(e,n){const i=this.prepareUpdateNotifications(e);return this.serviceHubAdapter.emit(\"statusServiceUpdateRequest\",i,t.Status.Deactivated,n),i}remove(e){const n=this.prepareUpdateNotifications(e);return this.serviceHubAdapter.emit(\"statusServiceUpdateRequest\",n,t.Status.Removed,t.RemoveEventReason.User),n}pendingAllActivated(){return this.pending(this.status.activated)}pendingAll(){return this.pending([...this.status.pended,...this.status.activated])}deactivateAllActivated(e){return this.deactivate(this.status.activated,e)}deactivateAll(e){return this.deactivate([...this.status.pended,...this.status.activated],e)}removeAllDeactivated(){return this.remove(this.status.deactivated)}removeAll(){return this.remove(this.status.added)}addEventListener(e,t){this.emitter.on(e,t)}removeEventListener(e,t){this.emitter.off(e,t)}addOnceEventListener(e,t){this.emitter.once(e,t)}removeAllEventListeners(){L()(this.emitter)}emit(e,...t){this.emitter.emit(e,...t)}bindServiceHubEvents(){this.serviceHubAdapter.addEventListener(\"statusServiceUpdateRequest\",(e,n,i)=>{const r=Array.isArray(e)?e:[e],o=r.reduce((e,t)=>(e[t.timestamp]=this.getNotificationStatus(t),e),{});{const e=r.filter(e=>(o[e.timestamp]===t.Status.Activated||e.mode!==t.Mode.Silent)&&n===t.Status.Pended);{const n=e.filter(e=>e.mode!==t.Mode.Silent);n.length&&this.serviceHubAdapter.emit(\"modeStatusUpdateResponse\",n.reduce((e,t)=>(e[t.timestamp]=t,e),{}),t.Mode.Silent)}e.length&&this.update(\"pending\",i,e)}{const e=r.filter(e=>{const i=o[e.timestamp];return(i===t.Status.Pended||i===t.Status.Activated)&&n===t.Status.Deactivated});e.length&&this.update(\"deactivate\",i,e)}r.filter(e=>{const i=o[e.timestamp];return(i===t.Status.Pended||i===t.Status.Activated||i===t.Status.Deactivated)&&n===t.Status.Removed}).length&&this.update(\"remove\",i,e)}),n.STATUS_EVENTS.forEach(e=>{this.addEventListener(e,(t,i)=>{const r=n.STATUS_EVENT_MAP[e],o=t.reduce((e,t)=>(e[t.timestamp]=t,e),{});this.serviceHubAdapter.emit(\"statusServiceUpdateResponse\",o,r,i)})})}}u.sortTimestampsFn=(e,t)=>e>t?1:e(this.listeners.push(e),{stopListen:()=>this.stopListen(e)}),this.listenOnce=e=>(this.listenersOnce.push(e),{stopListenOnce:()=>this.stopListenOnce(e)}),this.stopListen=e=>{const t=this.listeners.indexOf(e,0);return t>-1&&(this.listeners.splice(t,1),!0)},this.stopListenOnce=e=>{const t=this.listenersOnce.indexOf(e,0);return t>-1&&(this.listenersOnce.splice(t,1),!0)},this.stopListenAll=()=>{this.listeners=[],this.listenersOnce=[]},this.send=e=>{this.listeners.forEach(t=>t(e)),this.listenersOnce.forEach(t=>t(e)),this.listenersOnce=[]}}}class n{constructor(){this.listeners=[],this.listenersOnce=[],this.listen=e=>(this.listeners.push(e),{stopListen:()=>this.stopListen(e)}),this.listenOnce=e=>(this.listenersOnce.push(e),{stopListenOnce:()=>this.stopListenOnce(e)}),this.stopListen=e=>{const t=this.listeners.indexOf(e,0);return t>-1&&(this.listeners.splice(t,1),!0)},this.stopListenOnce=e=>{const t=this.listenersOnce.indexOf(e,0);return t>-1&&(this.listenersOnce.splice(t,1),!0)},this.stopListenAll=()=>{this.listeners=[],this.listenersOnce=[]},this.send=()=>{this.listeners.forEach(e=>e()),this.listenersOnce.forEach(e=>e()),this.listenersOnce=[]}}}e.create=new class{withData(){const e=new t;return{signal:e,send:e.send,stopListenAll:e.stopListenAll}}empty(){const e=new n;return{signal:e,send:e.send,stopListenAll:e.stopListenAll}}}}(k||(k={}));var T,x,I=n(5),A=n.n(I),N=n(6),R=n.n(N),D=n(7),M=n.n(D);(x=T||(T={})).createService=e=>{const t=A.a.createInstance();{const n=e&&e.backend?e.backend:new R.a;t.use(n)}{const n=e&&e.languageDetector?e.languageDetector:new M.a;t.use(n)}return e&&e.logger&&t.use({log:\"log\"in e.logger?e.logger.log:e.logger.info,warn:e.logger.warn,error:e.logger.error,type:\"logger\"}),t},x.mergeServiceInitOptions=(...e)=>Object.assign.call(null,{},...e),x.createMixin=e=>{const t=\"i18n\"in e?e.i18n:x.createService(),n=\"i18nInitOptions\"in e?e.i18nInitOptions:null;n||c.info(\"i18n mixin instance waiting service initialization outside...\");let i=!1;return e=>class extends e{constructor(){super(...arguments),this.onI18NInitialized=e=>this.requestUpdate(),this.onI18NLanguageChanged=e=>this.requestUpdate()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),t.on(\"initialized\",this.onI18NInitialized),t.on(\"languageChanged\",this.onI18NLanguageChanged),t.isInitialized||i||!n||(i=!0,t.init(n).finally(()=>i=!1))}disconnectedCallback(){t.off(\"initialized\",this.onI18NInitialized),t.off(\"languageChanged\",this.onI18NLanguageChanged),super.disconnectedCallback&&super.disconnectedCallback()}t(...e){return t.t(...e)}}}}])},function(e,t,n){\"use strict\";var i=n(10),r=Object.prototype.toString;function o(e){return\"[object Array]\"===r.call(e)}function s(e){return void 0===e}function a(e){return null!==e&&\"object\"==typeof e}function u(e){return\"[object Function]\"===r.call(e)}function c(e,t){if(null!=e)if(\"object\"!=typeof e&&(e=[e]),o(e))for(var n=0,i=e.length;n=200&&e<300}};u.headers={common:{Accept:\"application/json, text/plain, */*\"}},i.forEach([\"delete\",\"get\",\"head\"],(function(e){u.headers[e]={}})),i.forEach([\"post\",\"put\",\"patch\"],(function(e){u.headers[e]=i.merge(o)})),e.exports=u}).call(this,n(47))},function(e,t,n){\"use strict\";var i=n(1),r=n(49),o=n(11),s=n(51),a=n(54),u=n(55),c=n(15);e.exports=function(e){return new Promise((function(t,l){var d=e.data,f=e.headers;i.isFormData(d)&&delete f[\"Content-Type\"];var h=new XMLHttpRequest;if(e.auth){var p=e.auth.username||\"\",v=e.auth.password||\"\";f.Authorization=\"Basic \"+btoa(p+\":\"+v)}var g=s(e.baseURL,e.url);if(h.open(e.method.toUpperCase(),o(g,e.params,e.paramsSerializer),!0),h.timeout=e.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf(\"file:\"))){var n=\"getAllResponseHeaders\"in h?a(h.getAllResponseHeaders()):null,i={data:e.responseType&&\"text\"!==e.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:e,request:h};r(t,l,i),h=null}},h.onabort=function(){h&&(l(c(\"Request aborted\",e,\"ECONNABORTED\",h)),h=null)},h.onerror=function(){l(c(\"Network Error\",e,null,h)),h=null},h.ontimeout=function(){var t=\"timeout of \"+e.timeout+\"ms exceeded\";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),l(c(t,e,\"ECONNABORTED\",h)),h=null},i.isStandardBrowserEnv()){var m=n(56),y=(e.withCredentials||u(g))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(f[e.xsrfHeaderName]=y)}if(\"setRequestHeader\"in h&&i.forEach(f,(function(e,t){void 0===d&&\"content-type\"===t.toLowerCase()?delete f[t]:h.setRequestHeader(t,e)})),i.isUndefined(e.withCredentials)||(h.withCredentials=!!e.withCredentials),e.responseType)try{h.responseType=e.responseType}catch(t){if(\"json\"!==e.responseType)throw t}\"function\"==typeof e.onDownloadProgress&&h.addEventListener(\"progress\",e.onDownloadProgress),\"function\"==typeof e.onUploadProgress&&h.upload&&h.upload.addEventListener(\"progress\",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){h&&(h.abort(),l(e),h=null)})),void 0===d&&(d=null),h.send(d)}))}},function(e,t,n){\"use strict\";var i=n(50);e.exports=function(e,t,n,r,o){var s=new Error(e);return i(s,t,n,r,o)}},function(e,t,n){\"use strict\";var i=n(1);e.exports=function(e,t){t=t||{};var n={},r=[\"url\",\"method\",\"params\",\"data\"],o=[\"headers\",\"auth\",\"proxy\"],s=[\"baseURL\",\"url\",\"transformRequest\",\"transformResponse\",\"paramsSerializer\",\"timeout\",\"withCredentials\",\"adapter\",\"responseType\",\"xsrfCookieName\",\"xsrfHeaderName\",\"onUploadProgress\",\"onDownloadProgress\",\"maxContentLength\",\"validateStatus\",\"maxRedirects\",\"httpAgent\",\"httpsAgent\",\"cancelToken\",\"socketPath\"];i.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),i.forEach(o,(function(r){i.isObject(t[r])?n[r]=i.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:i.isObject(e[r])?n[r]=i.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),i.forEach(s,(function(i){void 0!==t[i]?n[i]=t[i]:void 0!==e[i]&&(n[i]=e[i])}));var a=r.concat(o).concat(s),u=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return i.forEach(u,(function(i){void 0!==t[i]?n[i]=t[i]:void 0!==e[i]&&(n[i]=e[i])})),n}},function(e,t,n){\"use strict\";function i(e){this.message=e}i.prototype.toString=function(){return\"Cancel\"+(this.message?\": \"+this.message:\"\")},i.prototype.__CANCEL__=!0,e.exports=i},function(e,t){var n;n=function(){return this}();try{n=n||new Function(\"return this\")()}catch(e){\"object\"==typeof window&&(n=window)}e.exports=n},function(e,t,n){\"use strict\";(function(e){var i,r,o,s=n(5),a=n(7),u=n.n(a);function c(e){return(c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}\"function\"==typeof fetch&&(void 0!==e&&e.fetch?i=e.fetch:\"undefined\"!=typeof window&&window.fetch&&(i=window.fetch)),\"function\"==typeof XMLHttpRequest&&(void 0!==e&&e.XMLHttpRequest?r=e.XMLHttpRequest:\"undefined\"!=typeof window&&window.XMLHttpRequest&&(r=window.XMLHttpRequest)),\"function\"==typeof ActiveXObject&&(void 0!==e&&e.ActiveXObject?o=e.ActiveXObject:\"undefined\"!=typeof window&&window.ActiveXObject&&(o=window.ActiveXObject)),i||!a||r||o||(i=u.a||a),\"function\"!=typeof i&&(i=void 0);var l=function(e,t){if(t&&\"object\"===c(t)){var n=\"\";for(var i in t)n+=\"&\"+encodeURIComponent(i)+\"=\"+encodeURIComponent(t[i]);if(!n)return e;e=e+(-1!==e.indexOf(\"?\")?\"&\":\"?\")+n.slice(1)}return e};t.a=function(e,t,n,a){return\"function\"==typeof n&&(a=n,n=void 0),a=a||function(){},i?function(e,t,n,r){e.queryStringParams&&(t=l(t,e.queryStringParams));var o=Object(s.a)({},\"function\"==typeof e.customHeaders?e.customHeaders():e.customHeaders);n&&(o[\"Content-Type\"]=\"application/json\"),i(t,Object(s.a)({method:n?\"POST\":\"GET\",body:n?e.stringify(n):void 0,headers:o},\"function\"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions)).then((function(e){if(!e.ok)return r(e.statusText||\"Error\",{status:e.status});e.text().then((function(t){r(null,{status:e.status,data:t})})).catch(r)})).catch(r)}(e,t,n,a):\"function\"==typeof XMLHttpRequest||\"function\"==typeof ActiveXObject?function(e,t,n,i){n&&\"object\"===c(n)&&(n=l(\"\",n).slice(1)),e.queryStringParams&&(t=l(t,e.queryStringParams));try{var s;(s=r?new r:new o(\"MSXML2.XMLHTTP.3.0\")).open(n?\"POST\":\"GET\",t,1),e.crossDomain||s.setRequestHeader(\"X-Requested-With\",\"XMLHttpRequest\"),s.withCredentials=!!e.withCredentials,n&&s.setRequestHeader(\"Content-Type\",\"application/x-www-form-urlencoded\"),s.overrideMimeType&&s.overrideMimeType(\"application/json\");var a=e.customHeaders;if(a=\"function\"==typeof a?a():a)for(var u in a)s.setRequestHeader(u,a[u]);s.onreadystatechange=function(){s.readyState>3&&i(s.status>=400?s.statusText:null,{status:s.status,data:s.responseText})},s.send(n)}catch(e){console&&console.log(e)}}(e,t,n,a):void 0}}).call(this,n(18))},function(e,t,n){\"use strict\";var i=n(9),r=n(21),o=n(25),s=n(33),a=n(34);(e.exports=function(e,t){var n,r,u,c,l;return arguments.length<2||\"string\"!=typeof e?(c=t,t=e,e=null):c=arguments[2],i(e)?(n=a.call(e,\"c\"),r=a.call(e,\"e\"),u=a.call(e,\"w\")):(n=u=!0,r=!1),l={value:t,configurable:n,enumerable:r,writable:u},c?o(s(c),l):l}).gs=function(e,t,n){var u,c,l,d;return\"string\"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],i(t)?r(t)?i(n)?r(n)||(l=n,n=void 0):n=void 0:(l=t,t=n=void 0):t=void 0,i(e)?(u=a.call(e,\"c\"),c=a.call(e,\"e\")):(u=!0,c=!1),d={get:t,set:n,configurable:u,enumerable:c},l?o(s(l),d):d}},function(e,t,n){\"use strict\";var i=n(22),r=/^\\s*class[\\s{/}]/,o=Function.prototype.toString;e.exports=function(e){return!!i(e)&&!r.test(o.call(e))}},function(e,t,n){\"use strict\";var i=n(23);e.exports=function(e){if(\"function\"!=typeof e)return!1;if(!hasOwnProperty.call(e,\"length\"))return!1;try{if(\"number\"!=typeof e.length)return!1;if(\"function\"!=typeof e.call)return!1;if(\"function\"!=typeof e.apply)return!1}catch(e){return!1}return!i(e)}},function(e,t,n){\"use strict\";var i=n(24);e.exports=function(e){if(!i(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(e){return!1}}},function(e,t,n){\"use strict\";var i=n(9),r={object:!0,function:!0,undefined:!0};e.exports=function(e){return!!i(e)&&hasOwnProperty.call(r,typeof e)}},function(e,t,n){\"use strict\";e.exports=n(26)()?Object.assign:n(27)},function(e,t,n){\"use strict\";e.exports=function(){var e,t=Object.assign;return\"function\"==typeof t&&(t(e={foo:\"raz\"},{bar:\"dwa\"},{trzy:\"trzy\"}),e.foo+e.bar+e.trzy===\"razdwatrzy\")}},function(e,t,n){\"use strict\";var i=n(28),r=n(32),o=Math.max;e.exports=function(e,t){var n,s,a,u=o(arguments.length,2);for(e=Object(r(e)),a=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},s=1;s-1}},function(e,t,n){\"use strict\";e.exports=function(e){if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return e}},function(e,t,n){\"use strict\";function i(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[t++]}};throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}return(t=e[Symbol.iterator]()).next.bind(t)}Object.defineProperty(t,\"__esModule\",{value:!0});var h=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(l(Error)),p=function(e){function t(t){return e.call(this,\"Invalid DateTime: \"+t.toMessage())||this}return o(t,e),t}(h),v=function(e){function t(t){return e.call(this,\"Invalid Interval: \"+t.toMessage())||this}return o(t,e),t}(h),g=function(e){function t(t){return e.call(this,\"Invalid Duration: \"+t.toMessage())||this}return o(t,e),t}(h),m=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(h),y=function(e){function t(t){return e.call(this,\"Invalid unit \"+t)||this}return o(t,e),t}(h),S=function(e){function t(){return e.apply(this,arguments)||this}return o(t,e),t}(h),w=function(e){function t(){return e.call(this,\"Zone is an abstract class\")||this}return o(t,e),t}(h),b=\"numeric\",E=\"short\",k=\"long\",O={year:b,month:b,day:b},L={year:b,month:E,day:b},C={year:b,month:E,day:b,weekday:E},T={year:b,month:k,day:b},x={year:b,month:k,day:b,weekday:k},I={hour:b,minute:b},A={hour:b,minute:b,second:b},N={hour:b,minute:b,second:b,timeZoneName:E},R={hour:b,minute:b,second:b,timeZoneName:k},D={hour:b,minute:b,hour12:!1},M={hour:b,minute:b,second:b,hour12:!1},_={hour:b,minute:b,second:b,hour12:!1,timeZoneName:E},j={hour:b,minute:b,second:b,hour12:!1,timeZoneName:k},V={year:b,month:b,day:b,hour:b,minute:b},P={year:b,month:b,day:b,hour:b,minute:b,second:b},q={year:b,month:E,day:b,hour:b,minute:b},U={year:b,month:E,day:b,hour:b,minute:b,second:b},F={year:b,month:E,day:b,weekday:E,hour:b,minute:b},H={year:b,month:k,day:b,hour:b,minute:b,timeZoneName:E},z={year:b,month:k,day:b,hour:b,minute:b,second:b,timeZoneName:E},Z={year:b,month:k,day:b,weekday:k,hour:b,minute:b,timeZoneName:k},J={year:b,month:k,day:b,weekday:k,hour:b,minute:b,second:b,timeZoneName:k};function B(e){return void 0===e}function G(e){return\"number\"==typeof e}function W(e){return\"number\"==typeof e&&e%1==0}function $(){try{return\"undefined\"!=typeof Intl&&Intl.DateTimeFormat}catch(e){return!1}}function K(){return!B(Intl.DateTimeFormat.prototype.formatToParts)}function Y(){try{return\"undefined\"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function X(e,t,n){if(0!==e.length)return e.reduce((function(e,i){var r=[t(i),i];return e&&n(e[0],r[0])===e[0]?e:r}),null)[1]}function Q(e,t){return t.reduce((function(t,n){return t[n]=e[n],t}),{})}function ee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function te(e,t,n){return W(e)&&e>=t&&e<=n}function ne(e,t){return void 0===t&&(t=2),e.toString().length=0&&(t=new Date(t)).setUTCFullYear(t.getUTCFullYear()-1900),+t}function le(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,i=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===i?53:52}function de(e){return e>99?e:e>60?1900+e:2e3+e}function fe(e,t,n,i){void 0===i&&(i=null);var r=new Date(e),o={hour12:!1,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\"};i&&(o.timeZone=i);var s=Object.assign({timeZoneName:t},o),a=$();if(a&&K()){var u=new Intl.DateTimeFormat(n,s).formatToParts(r).find((function(e){return\"timezonename\"===e.type.toLowerCase()}));return u?u.value:null}if(a){var c=new Intl.DateTimeFormat(n,o).format(r);return new Intl.DateTimeFormat(n,s).format(r).substring(c.length).replace(/^[, \\u200e]+/,\"\")}return null}function he(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var i=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-i:i)}function pe(e){var t=Number(e);if(\"boolean\"==typeof e||\"\"===e||Number.isNaN(t))throw new S(\"Invalid unit value \"+e);return t}function ve(e,t,n){var i={};for(var r in e)if(ee(e,r)){if(n.indexOf(r)>=0)continue;var o=e[r];if(null==o)continue;i[t(r)]=pe(o)}return i}function ge(e,t){var n=Math.trunc(Math.abs(e/60)),i=Math.trunc(Math.abs(e%60)),r=e>=0?\"+\":\"-\";switch(t){case\"short\":return\"\"+r+ne(n,2)+\":\"+ne(i,2);case\"narrow\":return\"\"+r+n+(i>0?\":\"+i:\"\");case\"techie\":return\"\"+r+ne(n,2)+ne(i,2);default:throw new RangeError(\"Value format \"+t+\" is out of range for property format\")}}function me(e){return Q(e,[\"hour\",\"minute\",\"second\",\"millisecond\"])}var ye=/[A-Za-z_+-]{1,256}(:?\\/[A-Za-z_+-]{1,256}(\\/[A-Za-z_+-]{1,256})?)?/;function Se(e){return JSON.stringify(e,Object.keys(e).sort())}var we=[\"January\",\"February\",\"March\",\"April\",\"May\",\"June\",\"July\",\"August\",\"September\",\"October\",\"November\",\"December\"],be=[\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"],Ee=[\"J\",\"F\",\"M\",\"A\",\"M\",\"J\",\"J\",\"A\",\"S\",\"O\",\"N\",\"D\"];function ke(e){switch(e){case\"narrow\":return Ee;case\"short\":return be;case\"long\":return we;case\"numeric\":return[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"11\",\"12\"];case\"2-digit\":return[\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\"];default:return null}}var Oe=[\"Monday\",\"Tuesday\",\"Wednesday\",\"Thursday\",\"Friday\",\"Saturday\",\"Sunday\"],Le=[\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\",\"Sun\"],Ce=[\"M\",\"T\",\"W\",\"T\",\"F\",\"S\",\"S\"];function Te(e){switch(e){case\"narrow\":return Ce;case\"short\":return Le;case\"long\":return Oe;case\"numeric\":return[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\"];default:return null}}var xe=[\"AM\",\"PM\"],Ie=[\"Before Christ\",\"Anno Domini\"],Ae=[\"BC\",\"AD\"],Ne=[\"B\",\"A\"];function Re(e){switch(e){case\"narrow\":return Ne;case\"short\":return Ae;case\"long\":return Ie;default:return null}}function De(e,t){for(var n,i=\"\",r=f(e);!(n=r()).done;){var o=n.value;o.literal?i+=o.val:i+=t(o.val)}return i}var Me={D:O,DD:L,DDD:T,DDDD:x,t:I,tt:A,ttt:N,tttt:R,T:D,TT:M,TTT:_,TTTT:j,f:V,ff:q,fff:H,ffff:Z,F:P,FF:U,FFF:z,FFFF:J},_e=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n=\"\",i=!1,r=[],o=0;o0&&r.push({literal:i,val:n}),t=null,n=\"\",i=!i):i||s===t?n+=s:(n.length>0&&r.push({literal:!1,val:n}),n=s,t=s)}return n.length>0&&r.push({literal:i,val:n}),r},e.macroTokenToFormatOpts=function(e){return Me[e]};var t=e.prototype;return t.formatWithSystemDefault=function(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,Object.assign({},this.opts,t)).format()},t.formatDateTime=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).format()},t.formatDateTimeParts=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).formatToParts()},t.resolvedOptions=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e,Object.assign({},this.opts,t)).resolvedOptions()},t.num=function(e,t){if(void 0===t&&(t=0),this.opts.forceSimple)return ne(e,t);var n=Object.assign({},this.opts);return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)},t.formatDateTimeFromString=function(t,n){var i=this,r=\"en\"===this.loc.listingMode(),o=this.loc.outputCalendar&&\"gregory\"!==this.loc.outputCalendar&&K(),s=function(e,n){return i.loc.extract(t,e,n)},a=function(e){return t.isOffsetFixed&&0===t.offset&&e.allowZ?\"Z\":t.isValid?t.zone.formatOffset(t.ts,e.format):\"\"},u=function(){return r?function(e){return xe[e.hour<12?0:1]}(t):s({hour:\"numeric\",hour12:!0},\"dayperiod\")},c=function(e,n){return r?function(e,t){return ke(t)[e.month-1]}(t,e):s(n?{month:e}:{month:e,day:\"numeric\"},\"month\")},l=function(e,n){return r?function(e,t){return Te(t)[e.weekday-1]}(t,e):s(n?{weekday:e}:{weekday:e,month:\"long\",day:\"numeric\"},\"weekday\")},d=function(e){return r?function(e,t){return Re(t)[e.year<0?0:1]}(t,e):s({era:e},\"era\")};return De(e.parseFormat(n),(function(n){switch(n){case\"S\":return i.num(t.millisecond);case\"u\":case\"SSS\":return i.num(t.millisecond,3);case\"s\":return i.num(t.second);case\"ss\":return i.num(t.second,2);case\"m\":return i.num(t.minute);case\"mm\":return i.num(t.minute,2);case\"h\":return i.num(t.hour%12==0?12:t.hour%12);case\"hh\":return i.num(t.hour%12==0?12:t.hour%12,2);case\"H\":return i.num(t.hour);case\"HH\":return i.num(t.hour,2);case\"Z\":return a({format:\"narrow\",allowZ:i.opts.allowZ});case\"ZZ\":return a({format:\"short\",allowZ:i.opts.allowZ});case\"ZZZ\":return a({format:\"techie\",allowZ:i.opts.allowZ});case\"ZZZZ\":return t.zone.offsetName(t.ts,{format:\"short\",locale:i.loc.locale});case\"ZZZZZ\":return t.zone.offsetName(t.ts,{format:\"long\",locale:i.loc.locale});case\"z\":return t.zoneName;case\"a\":return u();case\"d\":return o?s({day:\"numeric\"},\"day\"):i.num(t.day);case\"dd\":return o?s({day:\"2-digit\"},\"day\"):i.num(t.day,2);case\"c\":return i.num(t.weekday);case\"ccc\":return l(\"short\",!0);case\"cccc\":return l(\"long\",!0);case\"ccccc\":return l(\"narrow\",!0);case\"E\":return i.num(t.weekday);case\"EEE\":return l(\"short\",!1);case\"EEEE\":return l(\"long\",!1);case\"EEEEE\":return l(\"narrow\",!1);case\"L\":return o?s({month:\"numeric\",day:\"numeric\"},\"month\"):i.num(t.month);case\"LL\":return o?s({month:\"2-digit\",day:\"numeric\"},\"month\"):i.num(t.month,2);case\"LLL\":return c(\"short\",!0);case\"LLLL\":return c(\"long\",!0);case\"LLLLL\":return c(\"narrow\",!0);case\"M\":return o?s({month:\"numeric\"},\"month\"):i.num(t.month);case\"MM\":return o?s({month:\"2-digit\"},\"month\"):i.num(t.month,2);case\"MMM\":return c(\"short\",!1);case\"MMMM\":return c(\"long\",!1);case\"MMMMM\":return c(\"narrow\",!1);case\"y\":return o?s({year:\"numeric\"},\"year\"):i.num(t.year);case\"yy\":return o?s({year:\"2-digit\"},\"year\"):i.num(t.year.toString().slice(-2),2);case\"yyyy\":return o?s({year:\"numeric\"},\"year\"):i.num(t.year,4);case\"yyyyyy\":return o?s({year:\"numeric\"},\"year\"):i.num(t.year,6);case\"G\":return d(\"short\");case\"GG\":return d(\"long\");case\"GGGGG\":return d(\"narrow\");case\"kk\":return i.num(t.weekYear.toString().slice(-2),2);case\"kkkk\":return i.num(t.weekYear,4);case\"W\":return i.num(t.weekNumber);case\"WW\":return i.num(t.weekNumber,2);case\"o\":return i.num(t.ordinal);case\"ooo\":return i.num(t.ordinal,3);case\"q\":return i.num(t.quarter);case\"qq\":return i.num(t.quarter,2);case\"X\":return i.num(Math.floor(t.ts/1e3));case\"x\":return i.num(t.ts);default:return function(n){var r=e.macroTokenToFormatOpts(n);return r?i.formatWithSystemDefault(t,r):n}(n)}}))},t.formatDurationFromString=function(t,n){var i,r=this,o=function(e){switch(e[0]){case\"S\":return\"millisecond\";case\"s\":return\"second\";case\"m\":return\"minute\";case\"h\":return\"hour\";case\"d\":return\"day\";case\"M\":return\"month\";case\"y\":return\"year\";default:return null}},s=e.parseFormat(n),a=s.reduce((function(e,t){var n=t.literal,i=t.val;return n?e:e.concat(i)}),[]),u=t.shiftTo.apply(t,a.map(o).filter((function(e){return e})));return De(s,(i=u,function(e){var t=o(e);return t?r.num(i.get(t),e.length):e}))},e}(),je=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+\": \"+this.explanation:this.reason},e}(),Ve=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new w},t.formatOffset=function(e,t){throw new w},t.offset=function(e){throw new w},t.equals=function(e){throw new w},r(e,[{key:\"type\",get:function(){throw new w}},{key:\"name\",get:function(){throw new w}},{key:\"universal\",get:function(){throw new w}},{key:\"isValid\",get:function(){throw new w}}]),e}(),Pe=null,qe=function(e){function t(){return e.apply(this,arguments)||this}o(t,e);var n=t.prototype;return n.offsetName=function(e,t){return fe(e,t.format,t.locale)},n.formatOffset=function(e,t){return ge(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return\"local\"===e.type},r(t,[{key:\"type\",get:function(){return\"local\"}},{key:\"name\",get:function(){return $()?(new Intl.DateTimeFormat).resolvedOptions().timeZone:\"local\"}},{key:\"universal\",get:function(){return!1}},{key:\"isValid\",get:function(){return!0}}],[{key:\"instance\",get:function(){return null===Pe&&(Pe=new t),Pe}}]),t}(Ve),Ue=RegExp(\"^\"+ye.source+\"$\"),Fe={};var He={year:0,month:1,day:2,hour:3,minute:4,second:5};var ze={},Ze=function(e){function t(n){var i;return(i=e.call(this)||this).zoneName=n,i.valid=t.isValidZone(n),i}o(t,e),t.create=function(e){return ze[e]||(ze[e]=new t(e)),ze[e]},t.resetCache=function(){ze={},Fe={}},t.isValidSpecifier=function(e){return!(!e||!e.match(Ue))},t.isValidZone=function(e){try{return new Intl.DateTimeFormat(\"en-US\",{timeZone:e}).format(),!0}catch(e){return!1}},t.parseGMTOffset=function(e){if(e){var t=e.match(/^Etc\\/GMT([+-]\\d{1,2})$/i);if(t)return-60*parseInt(t[1])}return null};var n=t.prototype;return n.offsetName=function(e,t){return fe(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return ge(this.offset(e),t)},n.offset=function(e){var t,n=new Date(e),i=(t=this.name,Fe[t]||(Fe[t]=new Intl.DateTimeFormat(\"en-US\",{hour12:!1,timeZone:t,year:\"numeric\",month:\"2-digit\",day:\"2-digit\",hour:\"2-digit\",minute:\"2-digit\",second:\"2-digit\"})),Fe[t]),r=i.formatToParts?function(e,t){for(var n=e.formatToParts(t),i=[],r=0;r=0?l:1e3+l))/6e4},n.equals=function(e){return\"iana\"===e.type&&e.name===this.name},r(t,[{key:\"type\",get:function(){return\"iana\"}},{key:\"name\",get:function(){return this.zoneName}},{key:\"universal\",get:function(){return!1}},{key:\"isValid\",get:function(){return this.valid}}]),t}(Ve),Je=null,Be=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}o(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(e){if(e){var n=e.match(/^utc(?:([+-]\\d{1,2})(?::(\\d{2}))?)?$/i);if(n)return new t(he(n[1],n[2]))}return null},r(t,null,[{key:\"utcInstance\",get:function(){return null===Je&&(Je=new t(0)),Je}}]);var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return ge(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return\"fixed\"===e.type&&e.fixed===this.fixed},r(t,[{key:\"type\",get:function(){return\"fixed\"}},{key:\"name\",get:function(){return 0===this.fixed?\"UTC\":\"UTC\"+ge(this.fixed,\"narrow\")}},{key:\"universal\",get:function(){return!0}},{key:\"isValid\",get:function(){return!0}}]),t}(Ve),Ge=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}o(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return\"\"},n.offset=function(){return NaN},n.equals=function(){return!1},r(t,[{key:\"type\",get:function(){return\"invalid\"}},{key:\"name\",get:function(){return this.zoneName}},{key:\"universal\",get:function(){return!1}},{key:\"isValid\",get:function(){return!1}}]),t}(Ve);function We(e,t){var n;if(B(e)||null===e)return t;if(e instanceof Ve)return e;if(\"string\"==typeof e){var i=e.toLowerCase();return\"local\"===i?t:\"utc\"===i||\"gmt\"===i?Be.utcInstance:null!=(n=Ze.parseGMTOffset(e))?Be.instance(n):Ze.isValidSpecifier(i)?Ze.create(e):Be.parseSpecifier(i)||new Ge(e)}return G(e)?Be.instance(e):\"object\"==typeof e&&e.offset&&\"number\"==typeof e.offset?e:new Ge(e)}var $e=function(){return Date.now()},Ke=null,Ye=null,Xe=null,Qe=null,et=!1,tt=function(){function e(){}return e.resetCaches=function(){ft.resetCache(),Ze.resetCache()},r(e,null,[{key:\"now\",get:function(){return $e},set:function(e){$e=e}},{key:\"defaultZoneName\",get:function(){return e.defaultZone.name},set:function(e){Ke=e?We(e):null}},{key:\"defaultZone\",get:function(){return Ke||qe.instance}},{key:\"defaultLocale\",get:function(){return Ye},set:function(e){Ye=e}},{key:\"defaultNumberingSystem\",get:function(){return Xe},set:function(e){Xe=e}},{key:\"defaultOutputCalendar\",get:function(){return Qe},set:function(e){Qe=e}},{key:\"throwOnInvalid\",get:function(){return et},set:function(e){et=e}}]),e}(),nt={};function it(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),i=nt[n];return i||(i=new Intl.DateTimeFormat(e,t),nt[n]=i),i}var rt={};var ot={};function st(e,t){void 0===t&&(t={});var n=t,i=(n.base,function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i=0||(r[n]=e[n]);return r}(n,[\"base\"])),r=JSON.stringify([e,i]),o=ot[r];return o||(o=new Intl.RelativeTimeFormat(e,t),ot[r]=o),o}var at=null;function ut(e,t,n,i,r){var o=e.listingMode(n);return\"error\"===o?null:\"en\"===o?i(t):r(t)}var ct=function(){function e(e,t,n){if(this.padTo=n.padTo||0,this.floor=n.floor||!1,!t&&$()){var i={useGrouping:!1};n.padTo>0&&(i.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),i=rt[n];return i||(i=new Intl.NumberFormat(e,t),rt[n]=i),i}(e,i)}}return e.prototype.format=function(e){if(this.inf){var t=this.floor?Math.floor(e):e;return this.inf.format(t)}return ne(this.floor?Math.floor(e):oe(e,3),this.padTo)},e}(),lt=function(){function e(e,t,n){var i;if(this.opts=n,this.hasIntl=$(),e.zone.universal&&this.hasIntl?(i=\"UTC\",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:ui.fromMillis(e.ts+60*e.offset*1e3)):\"local\"===e.zone.type?this.dt=e:(this.dt=e,i=e.zone.name),this.hasIntl){var r=Object.assign({},this.opts);i&&(r.timeZone=i),this.dtf=it(t,r)}}var t=e.prototype;return t.format=function(){if(this.hasIntl)return this.dtf.format(this.dt.toJSDate());var e=function(e){switch(Se(Q(e,[\"weekday\",\"era\",\"year\",\"month\",\"day\",\"hour\",\"minute\",\"second\",\"timeZoneName\",\"hour12\"]))){case Se(O):return\"M/d/yyyy\";case Se(L):return\"LLL d, yyyy\";case Se(C):return\"EEE, LLL d, yyyy\";case Se(T):return\"LLLL d, yyyy\";case Se(x):return\"EEEE, LLLL d, yyyy\";case Se(I):return\"h:mm a\";case Se(A):return\"h:mm:ss a\";case Se(N):case Se(R):return\"h:mm a\";case Se(D):return\"HH:mm\";case Se(M):return\"HH:mm:ss\";case Se(_):case Se(j):return\"HH:mm\";case Se(V):return\"M/d/yyyy, h:mm a\";case Se(q):return\"LLL d, yyyy, h:mm a\";case Se(H):return\"LLLL d, yyyy, h:mm a\";case Se(Z):return\"EEEE, LLLL d, yyyy, h:mm a\";case Se(P):return\"M/d/yyyy, h:mm:ss a\";case Se(U):return\"LLL d, yyyy, h:mm:ss a\";case Se(F):return\"EEE, d LLL yyyy, h:mm a\";case Se(z):return\"LLLL d, yyyy, h:mm:ss a\";case Se(J):return\"EEEE, LLLL d, yyyy, h:mm:ss a\";default:return\"EEEE, LLLL d, yyyy, h:mm a\"}}(this.opts),t=ft.create(\"en-US\");return _e.create(t).formatDateTimeFromString(this.dt,e)},t.formatToParts=function(){return this.hasIntl&&K()?this.dtf.formatToParts(this.dt.toJSDate()):[]},t.resolvedOptions=function(){return this.hasIntl?this.dtf.resolvedOptions():{locale:\"en-US\",numberingSystem:\"latn\",outputCalendar:\"gregory\"}},e}(),dt=function(){function e(e,t,n){this.opts=Object.assign({style:\"long\"},n),!t&&Y()&&(this.rtf=st(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,i){void 0===n&&(n=\"always\"),void 0===i&&(i=!1);var r={years:[\"year\",\"yr.\"],quarters:[\"quarter\",\"qtr.\"],months:[\"month\",\"mo.\"],weeks:[\"week\",\"wk.\"],days:[\"day\",\"day\",\"days\"],hours:[\"hour\",\"hr.\"],minutes:[\"minute\",\"min.\"],seconds:[\"second\",\"sec.\"]},o=-1===[\"hours\",\"minutes\",\"seconds\"].indexOf(e);if(\"auto\"===n&&o){var s=\"days\"===e;switch(t){case 1:return s?\"tomorrow\":\"next \"+r[e][0];case-1:return s?\"yesterday\":\"last \"+r[e][0];case 0:return s?\"today\":\"this \"+r[e][0]}}var a=Object.is(t,-0)||t<0,u=Math.abs(t),c=1===u,l=r[e],d=i?c?l[1]:l[2]||l[1]:c?r[e][0]:e;return a?u+\" \"+d+\" ago\":\"in \"+u+\" \"+d}(t,e,this.opts.numeric,\"long\"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),ft=function(){function e(e,t,n,i){var r=function(e){var t=e.indexOf(\"-u-\");if(-1===t)return[e];var n,i=e.substring(0,t);try{n=it(e).resolvedOptions()}catch(e){n=it(i).resolvedOptions()}var r=n;return[i,r.numberingSystem,r.calendar]}(e),o=r[0],s=r[1],a=r[2];this.locale=o,this.numberingSystem=t||s||null,this.outputCalendar=n||a||null,this.intl=function(e,t,n){return $()?n||t?(e+=\"-u\",n&&(e+=\"-ca-\"+n),t&&(e+=\"-nu-\"+t),e):e:[]}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)},e.create=function(t,n,i,r){void 0===r&&(r=!1);var o=t||tt.defaultLocale;return new e(o||(r?\"en-US\":function(){if(at)return at;if($()){var e=(new Intl.DateTimeFormat).resolvedOptions().locale;return at=e&&\"und\"!==e?e:\"en-US\"}return at=\"en-US\"}()),n||tt.defaultNumberingSystem,i||tt.defaultOutputCalendar,o)},e.resetCache=function(){at=null,nt={},rt={},ot={}},e.fromObject=function(t){var n=void 0===t?{}:t,i=n.locale,r=n.numberingSystem,o=n.outputCalendar;return e.create(i,r,o)};var t=e.prototype;return t.listingMode=function(e){void 0===e&&(e=!0);var t=$()&&K(),n=this.isEnglish(),i=!(null!==this.numberingSystem&&\"latn\"!==this.numberingSystem||null!==this.outputCalendar&&\"gregory\"!==this.outputCalendar);return t||n&&i||e?!t||n&&i?\"en\":\"intl\":\"error\"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(Object.assign({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(Object.assign({},e,{defaultToEN:!1}))},t.months=function(e,t,n){var i=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),ut(this,e,n,ke,(function(){var n=t?{month:e,day:\"numeric\"}:{month:e},r=t?\"format\":\"standalone\";return i.monthsCache[r][e]||(i.monthsCache[r][e]=function(e){for(var t=[],n=1;n<=12;n++){var i=ui.utc(2016,n,1);t.push(e(i))}return t}((function(e){return i.extract(e,n,\"month\")}))),i.monthsCache[r][e]}))},t.weekdays=function(e,t,n){var i=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),ut(this,e,n,Te,(function(){var n=t?{weekday:e,year:\"numeric\",month:\"long\",day:\"numeric\"}:{weekday:e},r=t?\"format\":\"standalone\";return i.weekdaysCache[r][e]||(i.weekdaysCache[r][e]=function(e){for(var t=[],n=1;n<=7;n++){var i=ui.utc(2016,11,13+n);t.push(e(i))}return t}((function(e){return i.extract(e,n,\"weekday\")}))),i.weekdaysCache[r][e]}))},t.meridiems=function(e){var t=this;return void 0===e&&(e=!0),ut(this,void 0,e,(function(){return xe}),(function(){if(!t.meridiemCache){var e={hour:\"numeric\",hour12:!0};t.meridiemCache=[ui.utc(2016,11,13,9),ui.utc(2016,11,13,19)].map((function(n){return t.extract(n,e,\"dayperiod\")}))}return t.meridiemCache}))},t.eras=function(e,t){var n=this;return void 0===t&&(t=!0),ut(this,e,t,Re,(function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[ui.utc(-40,1,1),ui.utc(2017,1,1)].map((function(e){return n.extract(e,t,\"era\")}))),n.eraCache[e]}))},t.extract=function(e,t,n){var i=this.dtFormatter(e,t).formatToParts().find((function(e){return e.type.toLowerCase()===n}));return i?i.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new ct(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(e,t){return void 0===t&&(t={}),new lt(e,this.intl,t)},t.relFormatter=function(e){return void 0===e&&(e={}),new dt(this.intl,this.isEnglish(),e)},t.isEnglish=function(){return\"en\"===this.locale||\"en-us\"===this.locale.toLowerCase()||$()&&new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith(\"en-us\")},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},r(e,[{key:\"fastNumbers\",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||\"latn\"===e.numberingSystem)&&(\"latn\"===e.numberingSystem||!e.locale||e.locale.startsWith(\"en\")||$()&&\"latn\"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}();function ht(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),i=1;i3?Oe.indexOf(e)+1:Le.indexOf(e)+1),a}var Mt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\\s)?(\\d{1,2})\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\s(\\d{2,4})\\s(\\d\\d):(\\d\\d)(?::(\\d\\d))?\\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\\d\\d)(\\d\\d)))$/;function _t(e){var t,n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=e[6],u=e[7],c=e[8],l=e[9],d=e[10],f=e[11],h=Dt(n,o,r,i,s,a,u);return t=c?Rt[c]:l?0:he(d,f),[h,new Be(t)]}var jt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\\d\\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\\d{4}) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,Vt=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\\d\\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) GMT$/,Pt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \\d|\\d\\d) (\\d\\d):(\\d\\d):(\\d\\d) (\\d{4})$/;function qt(e){var t=e[1],n=e[2],i=e[3];return[Dt(t,e[4],i,n,e[5],e[6],e[7]),Be.utcInstance]}function Ut(e){var t=e[1],n=e[2],i=e[3],r=e[4],o=e[5],s=e[6];return[Dt(t,e[7],n,i,r,o,s),Be.utcInstance]}var Ft=ht(/([+-]\\d{6}|\\d{4})(?:-?(\\d\\d)(?:-?(\\d\\d))?)?/,wt),Ht=ht(/(\\d{4})-?W(\\d\\d)(?:-?(\\d))?/,wt),zt=ht(/(\\d{4})-?(\\d{3})/,wt),Zt=ht(St),Jt=pt(Ct,Tt,xt),Bt=pt(bt,Tt,xt),Gt=pt(Et,Tt),Wt=pt(Tt,xt);var $t=ht(/(\\d{4})-(\\d\\d)-(\\d\\d)/,Ot),Kt=ht(kt),Yt=pt(Ct,Tt,xt,It),Xt=pt(Tt,xt,It);var Qt={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},en=Object.assign({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},Qt),tn=Object.assign({years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:30.436875/7,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},Qt),nn=[\"years\",\"quarters\",\"months\",\"weeks\",\"days\",\"hours\",\"minutes\",\"seconds\",\"milliseconds\"],rn=nn.slice(0).reverse();function on(e,t,n){void 0===n&&(n=!1);var i={values:n?t.values:Object.assign({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new an(i)}function sn(e,t,n,i,r){var o=e[r][n],s=t[n]/o,a=!(Math.sign(s)===Math.sign(i[r]))&&0!==i[r]&&Math.abs(s)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(s):Math.trunc(s);i[r]+=a,t[n]-=a*o}var an=function(){function e(e){var t=\"longterm\"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||ft.create(),this.conversionAccuracy=t?\"longterm\":\"casual\",this.invalid=e.invalid||null,this.matrix=t?tn:en,this.isLuxonDuration=!0}e.fromMillis=function(t,n){return e.fromObject(Object.assign({milliseconds:t},n))},e.fromObject=function(t){if(null==t||\"object\"!=typeof t)throw new S(\"Duration.fromObject: argument expected to be an object, got \"+(null===t?\"null\":typeof t));return new e({values:ve(t,e.normalizeUnit,[\"locale\",\"numberingSystem\",\"conversionAccuracy\",\"zone\"]),loc:ft.fromObject(t),conversionAccuracy:t.conversionAccuracy})},e.fromISO=function(t,n){var i=function(e){return vt(e,[At,Nt])}(t)[0];if(i){var r=Object.assign(i,n);return e.fromObject(r)}return e.invalid(\"unparsable\",'the input \"'+t+\"\\\" can't be parsed as ISO 8601\")},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new S(\"need to specify a reason the Duration is invalid\");var i=t instanceof je?t:new je(t,n);if(tt.throwOnInvalid)throw new g(i);return new e({invalid:i})},e.normalizeUnit=function(e){var t={year:\"years\",years:\"years\",quarter:\"quarters\",quarters:\"quarters\",month:\"months\",months:\"months\",week:\"weeks\",weeks:\"weeks\",day:\"days\",days:\"days\",hour:\"hours\",hours:\"hours\",minute:\"minutes\",minutes:\"minutes\",second:\"seconds\",seconds:\"seconds\",millisecond:\"milliseconds\",milliseconds:\"milliseconds\"}[e?e.toLowerCase():e];if(!t)throw new y(e);return t},e.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=e.prototype;return t.toFormat=function(e,t){void 0===t&&(t={});var n=Object.assign({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?_e.create(this.loc,n).formatDurationFromString(this,e):\"Invalid Duration\"},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=Object.assign({},this.values);return e.includeConfig&&(t.conversionAccuracy=this.conversionAccuracy,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},t.toISO=function(){if(!this.isValid)return null;var e=\"P\";return 0!==this.years&&(e+=this.years+\"Y\"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+\"M\"),0!==this.weeks&&(e+=this.weeks+\"W\"),0!==this.days&&(e+=this.days+\"D\"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+=\"T\"),0!==this.hours&&(e+=this.hours+\"H\"),0!==this.minutes&&(e+=this.minutes+\"M\"),0===this.seconds&&0===this.milliseconds||(e+=oe(this.seconds+this.milliseconds/1e3,3)+\"S\"),\"P\"===e&&(e+=\"T0S\"),e},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t.valueOf=function(){return this.as(\"milliseconds\")},t.plus=function(e){if(!this.isValid)return this;for(var t,n=un(e),i={},r=f(nn);!(t=r()).done;){var o=t.value;(ee(n.values,o)||ee(this.values,o))&&(i[o]=n.get(o)+this.get(o))}return on(this,{values:i},!0)},t.minus=function(e){if(!this.isValid)return this;var t=un(e);return this.plus(t.negate())},t.mapUnits=function(e){if(!this.isValid)return this;for(var t={},n=0,i=Object.keys(this.values);n=0){r=l;var d=0;for(var h in a)d+=this.matrix[h][l]*a[h],a[h]=0;G(u[l])&&(d+=u[l]);var p=Math.trunc(d);for(var v in s[l]=p,a[l]=d-p,u)nn.indexOf(v)>nn.indexOf(l)&&sn(this.matrix,u,v,s,l)}else G(u[l])&&(a[l]=u[l])}for(var g in a)0!==a[g]&&(s[r]+=g===r?a[g]:a[g]/this.matrix[r][g]);return on(this,{values:s},!0).normalize()},t.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);te},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},t.set=function(t){var n=void 0===t?{}:t,i=n.start,r=n.end;return this.isValid?e.fromDateTimes(i||this.s,r||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var n=arguments.length,i=new Array(n),r=0;r+this.e?this.e:c;s.push(e.fromDateTimes(a,l)),a=l,u+=1}return s},t.splitBy=function(t){var n=un(t);if(!this.isValid||!n.isValid||0===n.as(\"milliseconds\"))return[];for(var i,r,o=this.s,s=[];o+this.e?this.e:i,s.push(e.fromDateTimes(o,r)),o=r;return s},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s=e.e)},t.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},t.intersection=function(t){if(!this.isValid)return this;var n=this.s>t.s?this.s:t.s,i=this.ei?null:e.fromDateTimes(n,i)},t.union=function(t){if(!this.isValid)return this;var n=this.st.e?this.e:t.e;return e.fromDateTimes(n,i)},e.merge=function(e){var t=e.sort((function(e,t){return e.s-t.s})).reduce((function(e,t){var n=e[0],i=e[1];return i?i.overlaps(t)||i.abutsStart(t)?[n,i.union(t)]:[n.concat([i]),t]:[n,t]}),[[],null]),n=t[0],i=t[1];return i&&n.push(i),n},e.xor=function(t){for(var n,i,r=null,o=0,s=[],a=t.map((function(e){return[{time:e.s,type:\"s\"},{time:e.e,type:\"e\"}]})),u=f((n=Array.prototype).concat.apply(n,a).sort((function(e,t){return e.time-t.time})));!(i=u()).done;){var c=i.value;1===(o+=\"s\"===c.type?1:-1)?r=c.time:(r&&+r!=+c.time&&s.push(e.fromDateTimes(r,c.time)),r=null)}return e.merge(s)},t.difference=function(){for(var t=this,n=arguments.length,i=new Array(n),r=0;r=0){var d;i=c;var f,h=l(e,t);if((r=e.plus(((d={})[c]=h,d)))>t)e=e.plus(((f={})[c]=h-1,f)),h-=1;else e=r;o[c]=h}}return[e,o,r,i]}(e,t,n),o=r[0],s=r[1],a=r[2],u=r[3],c=t-o,l=n.filter((function(e){return[\"hours\",\"minutes\",\"seconds\",\"milliseconds\"].indexOf(e)>=0}));if(0===l.length){var d;if(a0?(f=an.fromMillis(c,i)).shiftTo.apply(f,l).plus(h):h}var vn={arab:\"[٠-٩]\",arabext:\"[۰-۹]\",bali:\"[᭐-᭙]\",beng:\"[০-৯]\",deva:\"[०-९]\",fullwide:\"[0-9]\",gujr:\"[૦-૯]\",hanidec:\"[〇|一|二|三|四|五|六|七|八|九]\",khmr:\"[០-៩]\",knda:\"[೦-೯]\",laoo:\"[໐-໙]\",limb:\"[᥆-᥏]\",mlym:\"[൦-൯]\",mong:\"[᠐-᠙]\",mymr:\"[၀-၉]\",orya:\"[୦-୯]\",tamldec:\"[௦-௯]\",telu:\"[౦-౯]\",thai:\"[๐-๙]\",tibt:\"[༠-༩]\",latn:\"\\\\d\"},gn={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},mn=vn.hanidec.replace(/[\\[|\\]]/g,\"\").split(\"\");function yn(e,t){var n=e.numberingSystem;return void 0===t&&(t=\"\"),new RegExp(\"\"+vn[n||\"latn\"]+t)}function Sn(e,t){return void 0===t&&(t=function(e){return e}),{regex:e,deser:function(e){var n=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t=\"\";for(var n=0;n=s&&i<=a&&(t+=i-s)}}return parseInt(t,10)}return t}(n))}}}var wn=\"( |\"+String.fromCharCode(160)+\")\",bn=new RegExp(wn,\"g\");function En(e){return e.replace(/\\./g,\"\\\\.?\").replace(bn,wn)}function kn(e){return e.replace(/\\./g,\"\").replace(bn,\" \").toLowerCase()}function On(e,t){return null===e?null:{regex:RegExp(e.map(En).join(\"|\")),deser:function(n){var i=n[0];return e.findIndex((function(e){return kn(i)===kn(e)}))+t}}}function Ln(e,t){return{regex:e,deser:function(e){return he(e[1],e[2])},groups:t}}function Cn(e){return{regex:e,deser:function(e){return e[0]}}}var Tn={year:{\"2-digit\":\"yy\",numeric:\"yyyyy\"},month:{numeric:\"M\",\"2-digit\":\"MM\",short:\"MMM\",long:\"MMMM\"},day:{numeric:\"d\",\"2-digit\":\"dd\"},weekday:{short:\"EEE\",long:\"EEEE\"},dayperiod:\"a\",dayPeriod:\"a\",hour:{numeric:\"h\",\"2-digit\":\"hh\"},minute:{numeric:\"m\",\"2-digit\":\"mm\"},second:{numeric:\"s\",\"2-digit\":\"ss\"}};var xn=null;function In(e,t){if(e.literal)return e;var n=_e.macroTokenToFormatOpts(e.val);if(!n)return e;var i=_e.create(t,n).formatDateTimeParts((xn||(xn=ui.fromMillis(1555555555555)),xn)).map((function(e){return function(e,t,n){var i=e.type,r=e.value;if(\"literal\"===i)return{literal:!0,val:r};var o=n[i],s=Tn[i];return\"object\"==typeof s&&(s=s[o]),s?{literal:!1,val:s}:void 0}(e,0,n)}));return i.includes(void 0)?e:i}function An(e,t,n){var i=function(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return In(e,t)})))}(_e.parseFormat(n),e),r=i.map((function(t){return n=t,r=yn(i=e),o=yn(i,\"{2}\"),s=yn(i,\"{3}\"),a=yn(i,\"{4}\"),u=yn(i,\"{6}\"),c=yn(i,\"{1,2}\"),l=yn(i,\"{1,3}\"),d=yn(i,\"{1,6}\"),f=yn(i,\"{1,9}\"),h=yn(i,\"{2,4}\"),p=yn(i,\"{4,6}\"),v=function(e){return{regex:RegExp((t=e.val,t.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g,\"\\\\$&\"))),deser:function(e){return e[0]},literal:!0};var t},(g=function(e){if(n.literal)return v(e);switch(e.val){case\"G\":return On(i.eras(\"short\",!1),0);case\"GG\":return On(i.eras(\"long\",!1),0);case\"y\":return Sn(d);case\"yy\":return Sn(h,de);case\"yyyy\":return Sn(a);case\"yyyyy\":return Sn(p);case\"yyyyyy\":return Sn(u);case\"M\":return Sn(c);case\"MM\":return Sn(o);case\"MMM\":return On(i.months(\"short\",!0,!1),1);case\"MMMM\":return On(i.months(\"long\",!0,!1),1);case\"L\":return Sn(c);case\"LL\":return Sn(o);case\"LLL\":return On(i.months(\"short\",!1,!1),1);case\"LLLL\":return On(i.months(\"long\",!1,!1),1);case\"d\":return Sn(c);case\"dd\":return Sn(o);case\"o\":return Sn(l);case\"ooo\":return Sn(s);case\"HH\":return Sn(o);case\"H\":return Sn(c);case\"hh\":return Sn(o);case\"h\":return Sn(c);case\"mm\":return Sn(o);case\"m\":case\"q\":return Sn(c);case\"qq\":return Sn(o);case\"s\":return Sn(c);case\"ss\":return Sn(o);case\"S\":return Sn(l);case\"SSS\":return Sn(s);case\"u\":return Cn(f);case\"a\":return On(i.meridiems(),0);case\"kkkk\":return Sn(a);case\"kk\":return Sn(h,de);case\"W\":return Sn(c);case\"WW\":return Sn(o);case\"E\":case\"c\":return Sn(r);case\"EEE\":return On(i.weekdays(\"short\",!1,!1),1);case\"EEEE\":return On(i.weekdays(\"long\",!1,!1),1);case\"ccc\":return On(i.weekdays(\"short\",!0,!1),1);case\"cccc\":return On(i.weekdays(\"long\",!0,!1),1);case\"Z\":case\"ZZ\":return Ln(new RegExp(\"([+-]\"+c.source+\")(?::(\"+o.source+\"))?\"),2);case\"ZZZ\":return Ln(new RegExp(\"([+-]\"+c.source+\")(\"+o.source+\")?\"),2);case\"z\":return Cn(/[a-z_+-/]{1,256}?/i);default:return v(e)}}(n)||{invalidReason:\"missing Intl.DateTimeFormat.formatToParts support\"}).token=n,g;var n,i,r,o,s,a,u,c,l,d,f,h,p,v,g})),o=r.find((function(e){return e.invalidReason}));if(o)return{input:t,tokens:i,invalidReason:o.invalidReason};var s=function(e){return[\"^\"+e.map((function(e){return e.regex})).reduce((function(e,t){return e+\"(\"+t.source+\")\"}),\"\")+\"$\",e]}(r),a=s[0],u=s[1],c=RegExp(a,\"i\"),l=function(e,t,n){var i=e.match(t);if(i){var r={},o=1;for(var s in n)if(ee(n,s)){var a=n[s],u=a.groups?a.groups+1:1;!a.literal&&a.token&&(r[a.token.val[0]]=a.deser(i.slice(o,o+u))),o+=u}return[i,r]}return[i,{}]}(t,c,u),d=l[0],f=l[1],h=f?function(e){var t;return t=B(e.Z)?B(e.z)?null:Ze.create(e.z):new Be(e.Z),B(e.q)||(e.M=3*(e.q-1)+1),B(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),B(e.u)||(e.S=re(e.u)),[Object.keys(e).reduce((function(t,n){var i=function(e){switch(e){case\"S\":return\"millisecond\";case\"s\":return\"second\";case\"m\":return\"minute\";case\"h\":case\"H\":return\"hour\";case\"d\":return\"day\";case\"o\":return\"ordinal\";case\"L\":case\"M\":return\"month\";case\"y\":return\"year\";case\"E\":case\"c\":return\"weekday\";case\"W\":return\"weekNumber\";case\"k\":return\"weekYear\";case\"q\":return\"quarter\";default:return null}}(n);return i&&(t[i]=e[n]),t}),{}),t]}(f):[null,null],p=h[0],v=h[1];if(ee(f,\"a\")&&ee(f,\"H\"))throw new m(\"Can't include meridiem when specifying 24-hour format\");return{input:t,tokens:i,regex:c,rawMatches:d,matches:f,result:p,zone:v}}var Nn=[0,31,59,90,120,151,181,212,243,273,304,334],Rn=[0,31,60,91,121,152,182,213,244,274,305,335];function Dn(e,t){return new je(\"unit out of range\",\"you specified \"+t+\" (of type \"+typeof t+\") as a \"+e+\", which is invalid\")}function Mn(e,t,n){var i=new Date(Date.UTC(e,t-1,n)).getUTCDay();return 0===i?7:i}function _n(e,t,n){return n+(se(e)?Rn:Nn)[t-1]}function jn(e,t){var n=se(e)?Rn:Nn,i=n.findIndex((function(e){return ele(n)?(t=n+1,a=1):t=n,Object.assign({weekYear:t,weekNumber:a,weekday:s},me(e))}function Pn(e){var t,n=e.weekYear,i=e.weekNumber,r=e.weekday,o=Mn(n,1,4),s=ae(n),a=7*i+r-o-3;a<1?a+=ae(t=n-1):a>s?(t=n+1,a-=ae(n)):t=n;var u=jn(t,a),c=u.month,l=u.day;return Object.assign({year:t,month:c,day:l},me(e))}function qn(e){var t=e.year,n=_n(t,e.month,e.day);return Object.assign({year:t,ordinal:n},me(e))}function Un(e){var t=e.year,n=jn(t,e.ordinal),i=n.month,r=n.day;return Object.assign({year:t,month:i,day:r},me(e))}function Fn(e){var t=W(e.year),n=te(e.month,1,12),i=te(e.day,1,ue(e.year,e.month));return t?n?!i&&Dn(\"day\",e.day):Dn(\"month\",e.month):Dn(\"year\",e.year)}function Hn(e){var t=e.hour,n=e.minute,i=e.second,r=e.millisecond,o=te(t,0,23)||24===t&&0===n&&0===i&&0===r,s=te(n,0,59),a=te(i,0,59),u=te(r,0,999);return o?s?a?!u&&Dn(\"millisecond\",r):Dn(\"second\",i):Dn(\"minute\",n):Dn(\"hour\",t)}function zn(e){return new je(\"unsupported zone\",'the zone \"'+e.name+'\" is not supported')}function Zn(e){return null===e.weekData&&(e.weekData=Vn(e.c)),e.weekData}function Jn(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new ui(Object.assign({},n,t,{old:n}))}function Bn(e,t,n){var i=e-60*t*1e3,r=n.offset(i);if(t===r)return[i,t];i-=60*(r-t)*1e3;var o=n.offset(i);return r===o?[i,r]:[e-60*Math.min(r,o)*1e3,Math.max(r,o)]}function Gn(e,t){var n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Wn(e,t,n){return Bn(ce(e),t,n)}function $n(e,t){var n=e.o,i=e.c.year+Math.trunc(t.years),r=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),o=Object.assign({},e.c,{year:i,month:r,day:Math.min(e.c.day,ue(i,r))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),s=an.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(\"milliseconds\"),a=Bn(ce(o),n,e.zone),u=a[0],c=a[1];return 0!==s&&(u+=s,c=e.zone.offset(u)),{ts:u,o:c}}function Kn(e,t,n,i,r){var o=n.setZone,s=n.zone;if(e&&0!==Object.keys(e).length){var a=t||s,u=ui.fromObject(Object.assign(e,n,{zone:a,setZone:void 0}));return o?u:u.setZone(s)}return ui.invalid(new je(\"unparsable\",'the input \"'+r+\"\\\" can't be parsed as \"+i))}function Yn(e,t,n){return void 0===n&&(n=!0),e.isValid?_e.create(ft.create(\"en-US\"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Xn(e,t){var n=t.suppressSeconds,i=void 0!==n&&n,r=t.suppressMilliseconds,o=void 0!==r&&r,s=t.includeOffset,a=t.includeZone,u=void 0!==a&&a,c=t.spaceZone,l=void 0!==c&&c,d=t.format,f=void 0===d?\"extended\":d,h=\"basic\"===f?\"HHmm\":\"HH:mm\";return i&&0===e.second&&0===e.millisecond||(h+=\"basic\"===f?\"ss\":\":ss\",o&&0===e.millisecond||(h+=\".SSS\")),(u||s)&&l&&(h+=\" \"),u?h+=\"z\":s&&(h+=\"basic\"===f?\"ZZZ\":\"ZZ\"),Yn(e,h)}var Qn={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ei={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ti={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ni=[\"year\",\"month\",\"day\",\"hour\",\"minute\",\"second\",\"millisecond\"],ii=[\"weekYear\",\"weekNumber\",\"weekday\",\"hour\",\"minute\",\"second\",\"millisecond\"],ri=[\"year\",\"ordinal\",\"hour\",\"minute\",\"second\",\"millisecond\"];function oi(e){var t={year:\"year\",years:\"year\",month:\"month\",months:\"month\",day:\"day\",days:\"day\",hour:\"hour\",hours:\"hour\",minute:\"minute\",minutes:\"minute\",quarter:\"quarter\",quarters:\"quarter\",second:\"second\",seconds:\"second\",millisecond:\"millisecond\",milliseconds:\"millisecond\",weekday:\"weekday\",weekdays:\"weekday\",weeknumber:\"weekNumber\",weeksnumber:\"weekNumber\",weeknumbers:\"weekNumber\",weekyear:\"weekYear\",weekyears:\"weekYear\",ordinal:\"ordinal\"}[e.toLowerCase()];if(!t)throw new y(e);return t}function si(e,t){for(var n,i=f(ni);!(n=i()).done;){var r=n.value;B(e[r])&&(e[r]=Qn[r])}var o=Fn(e)||Hn(e);if(o)return ui.invalid(o);var s=tt.now(),a=Wn(e,t.offset(s),t),u=a[0],c=a[1];return new ui({ts:u,zone:t,o:c})}function ai(e,t,n){var i=!!B(n.round)||n.round,r=function(e,r){return e=oe(e,i||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,r)},o=function(i){return n.calendary?t.hasSame(e,i)?0:t.startOf(i).diff(e.startOf(i),i).get(i):t.diff(e,i).get(i)};if(n.unit)return r(o(n.unit),n.unit);for(var s,a=f(n.units);!(s=a()).done;){var u=s.value,c=o(u);if(Math.abs(c)>=1)return r(c,u)}return r(0,n.units[n.units.length-1])}var ui=function(){function e(e){var t=e.zone||tt.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new je(\"invalid input\"):null)||(t.isValid?null:zn(t));this.ts=B(e.ts)?tt.now():e.ts;var i=null,r=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var o=[e.old.c,e.old.o];i=o[0],r=o[1]}else{var s=t.offset(this.ts);i=Gn(this.ts,s),i=(n=Number.isNaN(i.year)?new je(\"invalid input\"):null)?null:i,r=n?null:s}this._zone=t,this.loc=e.loc||ft.create(),this.invalid=n,this.weekData=null,this.c=i,this.o=r,this.isLuxonDateTime=!0}e.local=function(t,n,i,r,o,s,a){return B(t)?new e({ts:tt.now()}):si({year:t,month:n,day:i,hour:r,minute:o,second:s,millisecond:a},tt.defaultZone)},e.utc=function(t,n,i,r,o,s,a){return B(t)?new e({ts:tt.now(),zone:Be.utcInstance}):si({year:t,month:n,day:i,hour:r,minute:o,second:s,millisecond:a},Be.utcInstance)},e.fromJSDate=function(t,n){void 0===n&&(n={});var i,r=(i=t,\"[object Date]\"===Object.prototype.toString.call(i)?t.valueOf():NaN);if(Number.isNaN(r))return e.invalid(\"invalid input\");var o=We(n.zone,tt.defaultZone);return o.isValid?new e({ts:r,zone:o,loc:ft.fromObject(n)}):e.invalid(zn(o))},e.fromMillis=function(t,n){if(void 0===n&&(n={}),G(t))return t<-864e13||t>864e13?e.invalid(\"Timestamp out of range\"):new e({ts:t,zone:We(n.zone,tt.defaultZone),loc:ft.fromObject(n)});throw new S(\"fromMillis requires a numerical input, but received a \"+typeof t+\" with value \"+t)},e.fromSeconds=function(t,n){if(void 0===n&&(n={}),G(t))return new e({ts:1e3*t,zone:We(n.zone,tt.defaultZone),loc:ft.fromObject(n)});throw new S(\"fromSeconds requires a numerical input\")},e.fromObject=function(t){var n=We(t.zone,tt.defaultZone);if(!n.isValid)return e.invalid(zn(n));var i=tt.now(),r=n.offset(i),o=ve(t,oi,[\"zone\",\"locale\",\"outputCalendar\",\"numberingSystem\"]),s=!B(o.ordinal),a=!B(o.year),u=!B(o.month)||!B(o.day),c=a||u,l=o.weekYear||o.weekNumber,d=ft.fromObject(t);if((c||s)&&l)throw new m(\"Can't mix weekYear/weekNumber units with year/month/day or ordinals\");if(u&&s)throw new m(\"Can't mix ordinal dates with month/day\");var h,p,v=l||o.weekday&&!c,g=Gn(i,r);v?(h=ii,p=ei,g=Vn(g)):s?(h=ri,p=ti,g=qn(g)):(h=ni,p=Qn);for(var y,S=!1,w=f(h);!(y=w()).done;){var b=y.value;B(o[b])?o[b]=S?p[b]:g[b]:S=!0}var E=(v?function(e){var t=W(e.weekYear),n=te(e.weekNumber,1,le(e.weekYear)),i=te(e.weekday,1,7);return t?n?!i&&Dn(\"weekday\",e.weekday):Dn(\"week\",e.week):Dn(\"weekYear\",e.weekYear)}(o):s?function(e){var t=W(e.year),n=te(e.ordinal,1,ae(e.year));return t?!n&&Dn(\"ordinal\",e.ordinal):Dn(\"year\",e.year)}(o):Fn(o))||Hn(o);if(E)return e.invalid(E);var k=Wn(v?Pn(o):s?Un(o):o,r,n),O=new e({ts:k[0],zone:n,o:k[1],loc:d});return o.weekday&&c&&t.weekday!==O.weekday?e.invalid(\"mismatched weekday\",\"you can't specify both a weekday of \"+o.weekday+\" and a date of \"+O.toISO()):O},e.fromISO=function(e,t){void 0===t&&(t={});var n=function(e){return vt(e,[Ft,Jt],[Ht,Bt],[zt,Gt],[Zt,Wt])}(e);return Kn(n[0],n[1],t,\"ISO 8601\",e)},e.fromRFC2822=function(e,t){void 0===t&&(t={});var n=function(e){return vt(function(e){return e.replace(/\\([^)]*\\)|[\\n\\t]/g,\" \").replace(/(\\s\\s+)/g,\" \").trim()}(e),[Mt,_t])}(e);return Kn(n[0],n[1],t,\"RFC 2822\",e)},e.fromHTTP=function(e,t){void 0===t&&(t={});var n=function(e){return vt(e,[jt,qt],[Vt,qt],[Pt,Ut])}(e);return Kn(n[0],n[1],t,\"HTTP\",t)},e.fromFormat=function(t,n,i){if(void 0===i&&(i={}),B(t)||B(n))throw new S(\"fromFormat requires an input string and a format\");var r=i,o=r.locale,s=void 0===o?null:o,a=r.numberingSystem,u=void 0===a?null:a,c=function(e,t,n){var i=An(e,t,n);return[i.result,i.zone,i.invalidReason]}(ft.fromOpts({locale:s,numberingSystem:u,defaultToEN:!0}),t,n),l=c[0],d=c[1],f=c[2];return f?e.invalid(f):Kn(l,d,i,\"format \"+n,t)},e.fromString=function(t,n,i){return void 0===i&&(i={}),e.fromFormat(t,n,i)},e.fromSQL=function(e,t){void 0===t&&(t={});var n=function(e){return vt(e,[$t,Yt],[Kt,Xt])}(e);return Kn(n[0],n[1],t,\"SQL\",e)},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new S(\"need to specify a reason the DateTime is invalid\");var i=t instanceof je?t:new je(t,n);if(tt.throwOnInvalid)throw new p(i);return new e({invalid:i})},e.isDateTime=function(e){return e&&e.isLuxonDateTime||!1};var t=e.prototype;return t.get=function(e){return this[e]},t.resolvedLocaleOpts=function(e){void 0===e&&(e={});var t=_e.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},t.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(Be.instance(e),t)},t.toLocal=function(){return this.setZone(tt.defaultZone)},t.setZone=function(t,n){var i=void 0===n?{}:n,r=i.keepLocalTime,o=void 0!==r&&r,s=i.keepCalendarTime,a=void 0!==s&&s;if((t=We(t,tt.defaultZone)).equals(this.zone))return this;if(t.isValid){var u=this.ts;if(o||a){var c=t.offset(this.ts);u=Wn(this.toObject(),c,t)[0]}return Jn(this,{ts:u,zone:t})}return e.invalid(zn(t))},t.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,i=t.numberingSystem,r=t.outputCalendar;return Jn(this,{loc:this.loc.clone({locale:n,numberingSystem:i,outputCalendar:r})})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var t,n=ve(e,oi,[]);!B(n.weekYear)||!B(n.weekNumber)||!B(n.weekday)?t=Pn(Object.assign(Vn(this.c),n)):B(n.ordinal)?(t=Object.assign(this.toObject(),n),B(n.day)&&(t.day=Math.min(ue(t.year,t.month),t.day))):t=Un(Object.assign(qn(this.c),n));var i=Wn(t,this.o,this.zone);return Jn(this,{ts:i[0],o:i[1]})},t.plus=function(e){return this.isValid?Jn(this,$n(this,un(e))):this},t.minus=function(e){return this.isValid?Jn(this,$n(this,un(e).negate())):this},t.startOf=function(e){if(!this.isValid)return this;var t={},n=an.normalizeUnit(e);switch(n){case\"years\":t.month=1;case\"quarters\":case\"months\":t.day=1;case\"weeks\":case\"days\":t.hour=0;case\"hours\":t.minute=0;case\"minutes\":t.second=0;case\"seconds\":t.millisecond=0}if(\"weeks\"===n&&(t.weekday=1),\"quarters\"===n){var i=Math.ceil(this.month/3);t.month=3*(i-1)+1}return this.set(t)},t.endOf=function(e){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e).minus(1):this},t.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?_e.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):\"Invalid DateTime\"},t.toLocaleString=function(e){return void 0===e&&(e=O),this.isValid?_e.create(this.loc.clone(e),e).formatDateTime(this):\"Invalid DateTime\"},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?_e.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){return void 0===e&&(e={}),this.isValid?this.toISODate(e)+\"T\"+this.toISOTime(e):null},t.toISODate=function(e){var t=(void 0===e?{}:e).format,n=\"basic\"===(void 0===t?\"extended\":t)?\"yyyyMMdd\":\"yyyy-MM-dd\";return this.year>9999&&(n=\"+\"+n),Yn(this,n)},t.toISOWeekDate=function(){return Yn(this,\"kkkk-'W'WW-c\")},t.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,i=void 0!==n&&n,r=t.suppressSeconds,o=void 0!==r&&r,s=t.includeOffset,a=void 0===s||s,u=t.format;return Xn(this,{suppressSeconds:o,suppressMilliseconds:i,includeOffset:a,format:void 0===u?\"extended\":u})},t.toRFC2822=function(){return Yn(this,\"EEE, dd LLL yyyy HH:mm:ss ZZZ\",!1)},t.toHTTP=function(){return Yn(this.toUTC(),\"EEE, dd LLL yyyy HH:mm:ss 'GMT'\")},t.toSQLDate=function(){return Yn(this,\"yyyy-MM-dd\")},t.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,i=void 0===n||n,r=t.includeZone;return Xn(this,{includeOffset:i,includeZone:void 0!==r&&r,spaceZone:!0})},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+\" \"+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():\"Invalid DateTime\"},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var t=Object.assign({},this.c);return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,t,n){if(void 0===t&&(t=\"milliseconds\"),void 0===n&&(n={}),!this.isValid||!e.isValid)return an.invalid(this.invalid||e.invalid,\"created by diffing an invalid DateTime\");var i,r=Object.assign({locale:this.locale,numberingSystem:this.numberingSystem},n),o=(i=t,Array.isArray(i)?i:[i]).map(an.normalizeUnit),s=e.valueOf()>this.valueOf(),a=pn(s?this:e,s?e:this,o,r);return s?a.negate():a},t.diffNow=function(t,n){return void 0===t&&(t=\"milliseconds\"),void 0===n&&(n={}),this.diff(e.local(),t,n)},t.until=function(e){return this.isValid?dn.fromDateTimes(this,e):this},t.hasSame=function(e,t){if(!this.isValid)return!1;if(\"millisecond\"===t)return this.valueOf()===e.valueOf();var n=e.valueOf();return this.startOf(t)<=n&&n<=this.endOf(t)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(t){if(void 0===t&&(t={}),!this.isValid)return null;var n=t.base||e.fromObject({zone:this.zone}),i=t.padding?thisthis.set({month:1}).offset||this.offset>this.set({month:5}).offset)}},{key:\"isInLeapYear\",get:function(){return se(this.year)}},{key:\"daysInMonth\",get:function(){return ue(this.year,this.month)}},{key:\"daysInYear\",get:function(){return this.isValid?ae(this.year):NaN}},{key:\"weeksInWeekYear\",get:function(){return this.isValid?le(this.weekYear):NaN}}],[{key:\"DATE_SHORT\",get:function(){return O}},{key:\"DATE_MED\",get:function(){return L}},{key:\"DATE_MED_WITH_WEEKDAY\",get:function(){return C}},{key:\"DATE_FULL\",get:function(){return T}},{key:\"DATE_HUGE\",get:function(){return x}},{key:\"TIME_SIMPLE\",get:function(){return I}},{key:\"TIME_WITH_SECONDS\",get:function(){return A}},{key:\"TIME_WITH_SHORT_OFFSET\",get:function(){return N}},{key:\"TIME_WITH_LONG_OFFSET\",get:function(){return R}},{key:\"TIME_24_SIMPLE\",get:function(){return D}},{key:\"TIME_24_WITH_SECONDS\",get:function(){return M}},{key:\"TIME_24_WITH_SHORT_OFFSET\",get:function(){return _}},{key:\"TIME_24_WITH_LONG_OFFSET\",get:function(){return j}},{key:\"DATETIME_SHORT\",get:function(){return V}},{key:\"DATETIME_SHORT_WITH_SECONDS\",get:function(){return P}},{key:\"DATETIME_MED\",get:function(){return q}},{key:\"DATETIME_MED_WITH_SECONDS\",get:function(){return U}},{key:\"DATETIME_MED_WITH_WEEKDAY\",get:function(){return F}},{key:\"DATETIME_FULL\",get:function(){return H}},{key:\"DATETIME_FULL_WITH_SECONDS\",get:function(){return z}},{key:\"DATETIME_HUGE\",get:function(){return Z}},{key:\"DATETIME_HUGE_WITH_SECONDS\",get:function(){return J}}]),e}();function ci(e){if(ui.isDateTime(e))return e;if(e&&e.valueOf&&G(e.valueOf()))return ui.fromJSDate(e);if(e&&\"object\"==typeof e)return ui.fromObject(e);throw new S(\"Unknown datetime argument: \"+e+\", of type \"+typeof e)}t.DateTime=ui,t.Duration=an,t.FixedOffsetZone=Be,t.IANAZone=Ze,t.Info=fn,t.Interval=dn,t.InvalidZone=Ge,t.LocalZone=qe,t.Settings=tt,t.Zone=Ve},function(e,t,n){\"use strict\";var i=n(40);e.exports=function(e){if(!i(e))throw new TypeError(e+\" is not an Object\");return e}},function(e,t,n){\"use strict\";var i=n(6),r={function:!0,object:!0};e.exports=function(e){return i(e)&&r[typeof e]||!1}},function(e,t,n){e.exports=n(42)},function(e,t,n){\"use strict\";var i=n(1),r=n(10),o=n(43),s=n(16);function a(e){var t=new o(e),n=r(o.prototype.request,t);return i.extend(n,o.prototype,t),i.extend(n,t),n}var u=a(n(13));u.Axios=o,u.create=function(e){return a(s(u.defaults,e))},u.Cancel=n(17),u.CancelToken=n(57),u.isCancel=n(12),u.all=function(e){return Promise.all(e)},u.spread=n(58),e.exports=u,e.exports.default=u},function(e,t,n){\"use strict\";var i=n(1),r=n(11),o=n(44),s=n(45),a=n(16);function u(e){this.defaults=e,this.interceptors={request:new o,response:new o}}u.prototype.request=function(e){\"string\"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=a(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method=\"get\";var t=[s,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},u.prototype.getUri=function(e){return e=a(this.defaults,e),r(e.url,e.params,e.paramsSerializer).replace(/^\\?/,\"\")},i.forEach([\"delete\",\"get\",\"head\",\"options\"],(function(e){u.prototype[e]=function(t,n){return this.request(i.merge(n||{},{method:e,url:t}))}})),i.forEach([\"post\",\"put\",\"patch\"],(function(e){u.prototype[e]=function(t,n,r){return this.request(i.merge(r||{},{method:e,url:t,data:n}))}})),e.exports=u},function(e,t,n){\"use strict\";var i=n(1);function r(){this.handlers=[]}r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){i.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=r},function(e,t,n){\"use strict\";var i=n(1),r=n(46),o=n(12),s=n(13);function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return a(e),e.headers=e.headers||{},e.data=r(e.data,e.headers,e.transformRequest),e.headers=i.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),i.forEach([\"delete\",\"get\",\"head\",\"post\",\"put\",\"patch\",\"common\"],(function(t){delete e.headers[t]})),(e.adapter||s.adapter)(e).then((function(t){return a(e),t.data=r(t.data,t.headers,e.transformResponse),t}),(function(t){return o(t)||(a(e),t&&t.response&&(t.response.data=r(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){\"use strict\";var i=n(1);e.exports=function(e,t,n){return i.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t){var n,i,r=e.exports={};function o(){throw new Error(\"setTimeout has not been defined\")}function s(){throw new Error(\"clearTimeout has not been defined\")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n=\"function\"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{i=\"function\"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var u,c=[],l=!1,d=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):d=-1,c.length&&h())}function h(){if(!l){var e=a(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++d1)for(var n=1;n=0)return;s[t]=\"set-cookie\"===t?(s[t]?s[t]:[]).concat([n]):s[t]?s[t]+\", \"+n:n}})),s):s}},function(e,t,n){\"use strict\";var i=n(1);e.exports=i.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement(\"a\");function r(e){var i=e;return t&&(n.setAttribute(\"href\",i),i=n.href),n.setAttribute(\"href\",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,\"\"):\"\",host:n.host,search:n.search?n.search.replace(/^\\?/,\"\"):\"\",hash:n.hash?n.hash.replace(/^#/,\"\"):\"\",hostname:n.hostname,port:n.port,pathname:\"/\"===n.pathname.charAt(0)?n.pathname:\"/\"+n.pathname}}return e=r(window.location.href),function(t){var n=i.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){\"use strict\";var i=n(1);e.exports=i.isStandardBrowserEnv()?{write:function(e,t,n,r,o,s){var a=[];a.push(e+\"=\"+encodeURIComponent(t)),i.isNumber(n)&&a.push(\"expires=\"+new Date(n).toGMTString()),i.isString(r)&&a.push(\"path=\"+r),i.isString(o)&&a.push(\"domain=\"+o),!0===s&&a.push(\"secure\"),document.cookie=a.join(\"; \")},read:function(e){var t=document.cookie.match(new RegExp(\"(^|;\\\\s*)(\"+e+\")=([^;]*)\"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,\"\",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){\"use strict\";var i=n(17);function r(e){if(\"function\"!=typeof e)throw new TypeError(\"executor must be a function.\");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new i(e),t(n.reason))}))}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e;return{token:new r((function(t){e=t})),cancel:e}},e.exports=r},function(e,t,n){\"use strict\";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){\"use strict\";n.r(t);var i=n(5),r=n(19);function o(e,t){if(!(e instanceof t))throw new TypeError(\"Cannot call a class as a function\")}function s(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o(this,e),this.services=t,this.options=n,this.allOptions=i,this.type=\"backend\",this.init(t,n,i)}var t,n,r;return t=e,(n=[{key:\"init\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=Object(i.a)(n,this.options||{},a()),this.allOptions=r,this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:\"readMulti\",value:function(e,t,n){var i=this.options.loadPath;\"function\"==typeof this.options.loadPath&&(i=this.options.loadPath(e,t));var r=this.services.interpolator.interpolate(i,{lng:e.join(\"+\"),ns:t.join(\"+\")});this.loadUrl(r,n,e,t)}},{key:\"read\",value:function(e,t,n){var i=this.options.loadPath;\"function\"==typeof this.options.loadPath&&(i=this.options.loadPath([e],[t]));var r=this.services.interpolator.interpolate(i,{lng:e,ns:t});this.loadUrl(r,n,e,t)}},{key:\"loadUrl\",value:function(e,t,n,i){var r=this;this.options.request(this.options,e,void 0,(function(o,s){if(s&&(s.status>=500&&s.status<600||!s.status))return t(\"failed loading \"+e,!0);if(s&&s.status>=400&&s.status<500)return t(\"failed loading \"+e,!1);if(!s&&o&&o.message&&o.message.indexOf(\"Failed to fetch\")>-1)return t(\"failed loading \"+e,!0);if(o)return t(o,!1);var a,u;try{a=\"string\"==typeof s.data?r.options.parse(s.data,n,i):s.data}catch(t){u=\"failed parsing \"+e+\" to json\"}if(u)return t(u,!1);t(null,a)}))}},{key:\"create\",value:function(e,t,n,i){var r=this;if(this.options.addPath){\"string\"==typeof e&&(e=[e]);var o=this.options.parsePayload(t,n,i);e.forEach((function(e){var n=r.services.interpolator.interpolate(r.options.addPath,{lng:e,ns:t});r.options.request(r.options,n,o,(function(e,t){}))}))}}},{key:\"reload\",value:function(){var e=this,t=this.services,n=t.backendConnector,i=t.languageUtils,r=t.logger,o=n.language;if(!o||\"cimode\"!==o.toLowerCase()){var s=[],a=function(e){i.toResolveHierarchy(e).forEach((function(e){s.indexOf(e)<0&&s.push(e)}))};a(o),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return a(e)})),s.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,\"read\",null,null,(function(i,o){i&&r.warn(\"loading namespace \".concat(e,\" for language \").concat(t,\" failed\"),i),!i&&o&&r.log(\"loaded namespace \".concat(e,\" for language \").concat(t),o),n.loaded(\"\".concat(t,\"|\").concat(e),i,o)}))}))}))}}}])&&s(t.prototype,n),r&&s(t,r),e}();u.type=\"backend\",t.default=u},function(e,t,n){\"use strict\";var i=function(){if(\"undefined\"!=typeof self)return self;if(\"undefined\"!=typeof window)return window;if(void 0!==i)return i;throw new Error(\"unable to locate global object\")}();e.exports=t=i.fetch,i.fetch&&(t.default=i.fetch.bind(i)),t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response},function(e,t,n){\"use strict\";n.r(t);var i=n(2),r=n(3),o=[],s=o.forEach,a=o.slice;function u(e){return s.call(a.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e}var c=/^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/,l=function(e,t,n){var i=n||{};i.path=i.path||\"/\";var r=e+\"=\"+encodeURIComponent(t);if(i.maxAge>0){var o=i.maxAge-0;if(isNaN(o))throw new Error(\"maxAge should be a Number\");r+=\"; Max-Age=\"+Math.floor(o)}if(i.domain){if(!c.test(i.domain))throw new TypeError(\"option domain is invalid\");r+=\"; Domain=\"+i.domain}if(i.path){if(!c.test(i.path))throw new TypeError(\"option path is invalid\");r+=\"; Path=\"+i.path}if(i.expires){if(\"function\"!=typeof i.expires.toUTCString)throw new TypeError(\"option expires is invalid\");r+=\"; Expires=\"+i.expires.toUTCString()}if(i.httpOnly&&(r+=\"; HttpOnly\"),i.secure&&(r+=\"; Secure\"),i.sameSite)switch(\"string\"==typeof i.sameSite?i.sameSite.toLowerCase():i.sameSite){case!0:r+=\"; SameSite=Strict\";break;case\"lax\":r+=\"; SameSite=Lax\";break;case\"strict\":r+=\"; SameSite=Strict\";break;case\"none\":r+=\"; SameSite=None\";break;default:throw new TypeError(\"option sameSite is invalid\")}return r},d=function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:\"/\",sameSite:\"strict\"};n&&(r.expires=new Date,r.expires.setTime(r.expires.getTime()+60*n*1e3)),i&&(r.domain=i),document.cookie=l(e,encodeURIComponent(t),r)},f=function(e){for(var t=e+\"=\",n=document.cookie.split(\";\"),i=0;i0)n[i].substring(0,r)===e.lookupQuerystring&&(t=n[i].substring(r+1))}return t}},v=null,g=function(){if(null!==v)return v;try{v=\"undefined\"!==window&&null!==window.localStorage;window.localStorage.setItem(\"i18next.translate.boo\",\"foo\"),window.localStorage.removeItem(\"i18next.translate.boo\")}catch(e){v=!1}return v},m={name:\"localStorage\",lookup:function(e){var t;if(e.lookupLocalStorage&&g()){var n=window.localStorage.getItem(e.lookupLocalStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupLocalStorage&&g()&&window.localStorage.setItem(t.lookupLocalStorage,e)}},y=null,S=function(){if(null!==y)return y;try{y=\"undefined\"!==window&&null!==window.sessionStorage;window.sessionStorage.setItem(\"i18next.translate.boo\",\"foo\"),window.sessionStorage.removeItem(\"i18next.translate.boo\")}catch(e){y=!1}return y},w={name:\"sessionStorage\",lookup:function(e){var t;if(e.lookupSessionStorage&&S()){var n=window.sessionStorage.getItem(e.lookupSessionStorage);n&&(t=n)}return t},cacheUserLanguage:function(e,t){t.lookupSessionStorage&&S()&&window.sessionStorage.setItem(t.lookupSessionStorage,e)}},b={name:\"navigator\",lookup:function(e){var t=[];if(\"undefined\"!=typeof navigator){if(navigator.languages)for(var n=0;n0?t:void 0}},E={name:\"htmlTag\",lookup:function(e){var t,n=e.htmlTag||(\"undefined\"!=typeof document?document.documentElement:null);return n&&\"function\"==typeof n.getAttribute&&(t=n.getAttribute(\"lang\")),t}},k={name:\"path\",lookup:function(e){var t;if(\"undefined\"!=typeof window){var n=window.location.pathname.match(/\\/([a-zA-Z-]*)/g);if(n instanceof Array)if(\"number\"==typeof e.lookupFromPathIndex){if(\"string\"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace(\"/\",\"\")}else t=n[0].replace(\"/\",\"\")}return t}},O={name:\"subdomain\",lookup:function(e){var t;if(\"undefined\"!=typeof window){var n=window.location.href.match(/(?:http[s]*\\:\\/\\/)*(.*?)\\.(?=[^\\/]*\\..{2,5})/gi);n instanceof Array&&(t=\"number\"==typeof e.lookupFromSubdomainIndex?n[e.lookupFromSubdomainIndex].replace(\"http://\",\"\").replace(\"https://\",\"\").replace(\".\",\"\"):n[0].replace(\"http://\",\"\").replace(\"https://\",\"\").replace(\".\",\"\"))}return t}};var L=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(i.a)(this,e),this.type=\"languageDetector\",this.detectors={},this.init(t,n)}return Object(r.a)(e,[{key:\"init\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=u(t,this.options||{},{order:[\"querystring\",\"cookie\",\"localStorage\",\"sessionStorage\",\"navigator\",\"htmlTag\"],lookupQuerystring:\"lng\",lookupCookie:\"i18next\",lookupLocalStorage:\"i18nextLng\",lookupSessionStorage:\"i18nextLng\",caches:[\"localStorage\"],excludeCacheFor:[\"cimode\"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(h),this.addDetector(p),this.addDetector(m),this.addDetector(w),this.addDetector(b),this.addDetector(E),this.addDetector(k),this.addDetector(O)}},{key:\"addDetector\",value:function(e){this.detectors[e.name]=e}},{key:\"detect\",value:function(e){var t=this;e||(e=this.options.order);var n=[];return e.forEach((function(e){if(t.detectors[e]){var i=t.detectors[e].lookup(t.options);i&&\"string\"==typeof i&&(i=[i]),i&&(n=n.concat(i))}})),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}},{key:\"cacheUserLanguage\",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();L.type=\"languageDetector\",t.default=L},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"Desktop\",(function(){return se}));var i=n(0);const r=Object(i.createLogger)(\"agentx-js-api\"),o=(e,t)=>({info:(...n)=>e.info(t,...n),warn:(...n)=>e.warn(t,...n),error:(...n)=>e.error(t,...n)});class s{constructor(e){this.logger=e.logger}check(e){return e?!!e.isInited||(this.logger.error(\"SERVICE still not initialized... Await it's init(...) first.\"),!1):(this.logger.error(\"SERVICE is not defined...\"),!1)}}const a=e=>new s(e);var u=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};const c={rps:120,tag:\"jsapi\"},l={rps:0,tag:\"jsapi\"},d={tag:\"jsapi\"},f=e=>e.actionsChannels.createSource(\"fireGeneralSilentNotification/Req\",c),h=e=>e.actionsChannels.createSource(\"fireGeneralAutoDismissNotification/Req\",l),p=e=>e.actionsChannels.createDestination(\"fireGeneralAutoDismissNotification/Res\",l),v=e=>e.actionsChannels.createSource(\"fireGeneralAcknowledgeNotification/Req\",l),g=e=>e.actionsChannels.createDestination(\"fireGeneralAcknowledgeNotification/Res\",l),m=e=>e.actionsChannels.createSource(\"addCustomTask\",c),y=e=>e.actionsChannels.createSource(\"getToken/Req\",l),S=e=>e.actionsChannels.createDestination(\"getToken/Res\",d),w=e=>e.actionsChannels.createSource(\"getTaskMap/Req\",l),b=e=>e.actionsChannels.createDestination(\"getTaskMap/Res\",d),E=e=>e.actionsChannels.createSource(\"getMediaTypeQueue/Req\",l),k=e=>e.actionsChannels.createDestination(\"getMediaTypeQueue/Res\",d),O=e=>e.actionsChannels.createSource(\"getIdleCodes/Req\",l),L=e=>e.actionsChannels.createDestination(\"getIdleCodes/Res\",d),C=e=>e.actionsChannels.createSource(\"getWrapUpCodes/Req\",l),T=e=>e.actionsChannels.createDestination(\"getWrapUpCodes/Res\",d);class x{constructor(e){this.lastReqTs=Date.now(),this.lastReqN=0,this.logger=e.logger,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}getNextReqId(){const e=Date.now();return this.lastReqTs!==e?(this.lastReqTs=e,this.lastReqN=0):this.lastReqN++,`${this.lastReqTs}_${this.lastReqN}`}init(e){e&&(this.SERVICE=e),this.checkService()&&(this.sourceActionsChannels={fireGeneralSilentNotification:f(this.SERVICE),fireGeneralAutoDismissNotification:h(this.SERVICE),fireGeneralAcknowledgeNotification:v(this.SERVICE),addCustomTask:m(this.SERVICE),getToken:y(this.SERVICE),getTaskMap:w(this.SERVICE),getMediaTypeQueue:E(this.SERVICE),getIdleCodes:O(this.SERVICE),getWrapUpCodes:C(this.SERVICE)},this.destinationActionsChannels={fireGeneralAutoDismissNotification:p(this.SERVICE),fireGeneralAcknowledgeNotification:g(this.SERVICE),getToken:S(this.SERVICE),getTaskMap:b(this.SERVICE),getMediaTypeQueue:k(this.SERVICE),getIdleCodes:L(this.SERVICE),getWrapUpCodes:T(this.SERVICE)},this.logger.info(\"Inited\"))}cleanup(){this.SERVICE=void 0,this.logger.info(\"Cleaned\")}fireGeneralSilentNotification(...e){this.checkService()&&this.sourceActionsChannels.fireGeneralSilentNotification.send(...e)}fireGeneralAutoDismissNotification(...e){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(t=>{const n=this.getNextReqId(),r=({args:[e,o,s,a]})=>{a===n&&(s!==i.Notifications.ItemMeta.Mode.AutoDismiss&&s!==i.Notifications.ItemMeta.Mode.Silent||e===i.Notifications.ItemMeta.Status.Deactivated&&(t([e,o,s]),this.destinationActionsChannels.fireGeneralAutoDismissNotification.removeListener(r)))};this.destinationActionsChannels.fireGeneralAutoDismissNotification.addListener(r),this.sourceActionsChannels.fireGeneralAutoDismissNotification.send(...e)})}))}fireGeneralAcknowledgeNotification(...e){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(t=>{const n=this.getNextReqId(),r=({args:[e,o,s,a]})=>{a===n&&(s!==i.Notifications.ItemMeta.Mode.Acknowledge&&s!==i.Notifications.ItemMeta.Mode.Silent||e===i.Notifications.ItemMeta.Status.Deactivated&&(t([e,o,s]),this.destinationActionsChannels.fireGeneralAcknowledgeNotification.removeListener(r)))};this.destinationActionsChannels.fireGeneralAcknowledgeNotification.addListener(r),this.sourceActionsChannels.fireGeneralAcknowledgeNotification.send(...e)})}))}addCustomTask(...e){this.checkService()&&this.sourceActionsChannels.addCustomTask.send(...e)}getTaskMap(){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(e=>{const t=this.getNextReqId(),n=({args:[i,r]})=>{r===t&&(e(i),this.destinationActionsChannels.getTaskMap.removeListener(n))};this.destinationActionsChannels.getTaskMap.addListener(n),this.sourceActionsChannels.getTaskMap.send(t)})}))}getMediaTypeQueue(e){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(t=>{const n=this.getNextReqId(),i=({args:[e,r]})=>{r===n&&(t(e),this.destinationActionsChannels.getMediaTypeQueue.removeListener(i))};this.destinationActionsChannels.getMediaTypeQueue.addListener(i),this.sourceActionsChannels.getMediaTypeQueue.send(e,n)})}))}getToken(){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(e=>{const t=this.getNextReqId(),n=({args:[i,r]})=>{r===t&&(e(i),this.destinationActionsChannels.getToken.removeListener(n))};this.destinationActionsChannels.getToken.addListener(n),this.sourceActionsChannels.getToken.send(t)})}))}getIdleCodes(){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(e=>{const t=this.getNextReqId(),n=({args:[i,r]})=>{r===t&&(e(i),this.destinationActionsChannels.getIdleCodes.removeListener(n))};this.destinationActionsChannels.getIdleCodes.addListener(n),this.sourceActionsChannels.getIdleCodes.send(t)})}))}getWrapUpCodes(){return u(this,void 0,void 0,(function*(){if(this.checkService())return yield new Promise(e=>{const t=this.getNextReqId(),n=({args:[i,r]})=>{r===t&&(e(i),this.destinationActionsChannels.getWrapUpCodes.removeListener(n))};this.destinationActionsChannels.getWrapUpCodes.addListener(n),this.sourceActionsChannels.getWrapUpCodes.send(t)})}))}}const I=o(r,\"[Actions JSAPI] =>\");class A{constructor(e){this.isInited=!1,this.listeners=new Map,this.listenersOnce=new Map,this.logger=e.logger}init(e){this.aqmServiceEntity=e.aqmServiceEntity,this.aqmServiceEntityString=e.aqmServiceEntityString,this.isInited=!0}cleanup(){this.removeAllEventListeners(),this.aqmServiceEntity=void 0,this.aqmServiceEntityString=void 0,this.isInited=!1}_addEventListener(e,t,n){var i,r,o;const s=n?\"listenersOnce\":\"listeners\";this[s].has(e)||this[s].set(e,new Map);const a=this[s].get(e),u=n?\"listenOnce\":\"listen\",c=i=>{let r=null;return n&&(r=this.aqmServiceEntity[e].listenOnce(()=>this.removeOnceEventListener(e,t))),()=>{var t;if(i){n?(i.stopListenOnce(),r&&r.stopListenOnce()):i.stopListen();const o=[];o.push(`UnBound \"${e}\"`),n&&o.push(\"Once\"),this.aqmServiceEntityString&&o.push(`from \"${this.aqmServiceEntityString}\"`),null===(t=this.logger)||void 0===t||t.info(o.join(\" \"))}}};if(this.aqmServiceEntity)if(e in this.aqmServiceEntity&&u in this.aqmServiceEntity[e]){const r=this.aqmServiceEntity[e][u](t);a.set(t,c(r));const o=[];o.push(`Bound \"${e}\"`),n&&o.push(\"Once\"),this.aqmServiceEntityString&&o.push(`to \"${this.aqmServiceEntityString}\"`),null===(i=this.logger)||void 0===i||i.info(o.join(\" \"))}else null===(r=this.logger)||void 0===r||r.warn(`EventName \"${e}\" is not recognized, so won't be subscribed...`);else null===(o=this.logger)||void 0===o||o.error(`\"${this.aqmServiceEntityString}\" is not ready yet. .init(...) first...`)}_removeEventListener(e,t,n){const i=n?\"listenersOnce\":\"listeners\";if(this[i].has(e)){const n=this[i].get(e);if(n){if(n.has(t)){n.get(t)(),n.delete(t)}n.size<1&&this[i].delete(e)}}}addEventListener(e,t){this._addEventListener(e,t,!1)}addOnceEventListener(e,t){this._addEventListener(e,t,!0)}removeEventListener(e,t){this._removeEventListener(e,t,!1)}removeOnceEventListener(e,t){this._removeEventListener(e,t,!0)}removeAllEventListeners(){[\"listeners\",\"listenersOnce\"].forEach(e=>{this[e].forEach((e,t)=>{e.forEach((e,t)=>e()),e.clear()}),this[e].clear()})}}const N=e=>new A(e);var R=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};class D{constructor(e){this.logger=e.logger,this.aqmEvents=e.aqmEvents,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}init(e){e&&(this.SERVICE=e),this.checkService()&&(this.aqmEvents.init({aqmServiceEntity:this.SERVICE.aqm.contact,aqmServiceEntityString:\"SERVICE.aqm.contact\"}),this.logger.info(\"Inited\"))}cleanup(){this.aqmEvents.cleanup(),this.SERVICE=void 0,this.logger.info(\"Cleaned\")}accept(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.accept(e)}))}consultAccept(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.consultAccept(e)}))}buddyAgents(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.buddyAgents(e)}))}end(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.end(e)}))}consultEnd(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.consultEnd(e)}))}cancelCtq(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.cancelCtq(e)}))}wrapup(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.wrapup(e)}))}vteamTransfer(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.vteamTransfer(e)}))}blindTransfer(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.blindTransfer(e)}))}hold(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.hold(e)}))}unHold(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.unHold(e)}))}consult(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.consult(e)}))}consultConference(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.consultConference(e)}))}decline(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.decline(e)}))}consultTransfer(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.consultTransfer(e)}))}vteamList(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.vteamList(e)}))}pauseRecording(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.pauseRecording(e)}))}resumeRecording(e){var t;return R(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.contact.resumeRecording(e)}))}addEventListener(e,t){this.checkService()&&this.aqmEvents.addEventListener(e,t)}addOnceEventListener(e,t){this.checkService()&&this.aqmEvents.addOnceEventListener(e,t)}removeEventListener(e,t){this.aqmEvents.removeEventListener(e,t)}removeOnceEventListener(e,t){this.aqmEvents.removeOnceEventListener(e,t)}removeAllEventListeners(){this.aqmEvents.removeAllEventListeners()}}const M=o(r,\"[AgentContact JSAPI] =>\"),_=o(M,\"[AqmServiceEvents: Contact] => \");var j=n(4),V=n.n(j),P=n(8),q=n.n(P),U=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};const F={agentName:void 0,agentProfileID:void 0,agentSessionId:void 0,teamId:void 0,teamName:void 0,dn:void 0,status:void 0,subStatus:void 0,idleCodes:void 0,wrapupCodes:void 0,outDialRegex:void 0,isOutboundEnabledForTenant:void 0,isOutboundEnabledForAgent:void 0};class H{constructor(e){this.emitter=V()(),this.listeners=new Set,this.teams=[],this.latestData=JSON.parse(JSON.stringify(F)),this.logger=e.logger,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}emit(e,...t){this.emitter.emit(e,...t)}update(e){const t=Object.keys(e).reduce((t,n)=>{const i=e[n],r=this.latestData[n];return JSON.stringify(i)!==JSON.stringify(r)&&t.push({name:n,value:i,oldValue:r}),t},[]);t.length&&(t.forEach(e=>this.latestData[e.name]=e.value),this.emit(\"updated\",t))}static getOutdialRegex(e){if(e&&e.dialPlanEntity){const t=e.dialPlanEntity.find(e=>\"Any Format\"===e.name);if(t)return t.regex}return\"\"}static findTeamName(e,t){const n=e.find(e=>e.teamId===t);return(null==n?void 0:n.teamName)||\"\"}init(e){return U(this,void 0,void 0,(function*(){e&&(this.SERVICE=e),this.checkService()&&(yield this.fetchLatestData(),this.subscribeSelfDataEvents(),this.logger.info(\"Inited\"))}))}cleanup(){this.unsubscribeSelfDataEvents(),this.removeAllEventListeners(),this.SERVICE=void 0,this.update(JSON.parse(JSON.stringify(F))),this.logger.info(\"Cleaned\")}fetchLatestData(){var e,t,n;return U(this,void 0,void 0,(function*(){const i=(null===(e=this.SERVICE)||void 0===e?void 0:e.conf.profile)?null===(t=this.SERVICE)||void 0===t?void 0:t.conf.profile:yield null===(n=this.SERVICE)||void 0===n?void 0:n.conf.fetchProfile();if(i){const{teams:e,agentName:t,agentProfileID:n,defaultDn:r,defaultIdleName:o,agentSubStatus:s,idleCodes:a,wrapupCodes:u,dialPlan:c,isOutboundEnabledForTenant:l,isOutboundEnabledForAgent:d}=i;this.teams=e;const f=r,h=o,p=s,v=H.getOutdialRegex(c);this.update({agentName:t,agentProfileID:n,dn:f,status:h,subStatus:p,idleCodes:a,wrapupCodes:u,outDialRegex:v,isOutboundEnabledForTenant:l,isOutboundEnabledForAgent:d})}}))}subscribeSelfDataEvents(){var e,t,n,i;if(this.checkService()){{const t=null===(e=this.SERVICE)||void 0===e?void 0:e.aqm.agent.eAgentReloginSuccess.listen(({data:e})=>{const{agentSessionId:t,teamId:n,dn:i,status:r,subStatus:o}=e,s=H.findTeamName(this.teams,n);this.update({agentSessionId:t,teamId:n,teamName:s,dn:i,status:r,subStatus:o})});this.listeners.add(()=>null==t?void 0:t.stopListen())}{const e=null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.agent.eAgentStationLoginSuccess.listen(({data:e})=>{const{agentSessionId:t,teamId:n,status:i,subStatus:r}=e,o=H.findTeamName(this.teams,n);this.update({agentSessionId:t,teamId:n,teamName:o,status:i,subStatus:r})});this.listeners.add(()=>null==e?void 0:e.stopListen())}{const e=null===(n=this.SERVICE)||void 0===n?void 0:n.aqm.agent.eAgentStateChangeSuccess.listen(({data:e})=>{const{agentSessionId:t,status:n,subStatus:i}=e;this.update({agentSessionId:t,status:n,subStatus:i})});this.listeners.add(()=>null==e?void 0:e.stopListen())}{const e=null===(i=this.SERVICE)||void 0===i?void 0:i.aqm.agent.eAgentDNRegistered.listen(({data:e})=>{const{dn:t}=e;this.update({dn:t})});this.listeners.add(()=>null==e?void 0:e.stopListen())}}}unsubscribeSelfDataEvents(){this.listeners.forEach(e=>e()),this.listeners.clear()}stateChange(e){var t;return U(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.agent.stateChange({data:e})}))}mockOutdialAniList(){var e;return U(this,void 0,void 0,(function*(){if(this.checkService())return null===(e=this.SERVICE)||void 0===e?void 0:e.aqm.agent.mockOutdialAniList({p:null})}))}fetchAddressBooks(){var e;return U(this,void 0,void 0,(function*(){if(this.checkService())return null===(e=this.SERVICE)||void 0===e?void 0:e.aqm.agent.fetchAddressBooks({p:null})}))}addEventListener(e,t){this.checkService()&&this.emitter.on(e,t)}removeEventListener(e,t){this.checkService()&&this.emitter.off(e,t)}removeAllEventListeners(){q()(this.emitter)}}const z=o(r,\"[AgentInfo JSAPI] =>\");var Z=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};class J{constructor(e){this.emitter=V()(),this.logger=e.logger,this.agentxSERVICE=e.SERVICE}waitUntil(e){return Z(this,void 0,void 0,(function*(){if(\"function\"==typeof e){yield new Promise(e=>setTimeout(e,1e3/30));!e()&&(yield this.waitUntil(e))}}))}checkService(e){return Z(this,void 0,void 0,(function*(){e?(e.isInited||(this.logger.warn(\"SERVICE is not inited. Awaiting it's initAgentxServices(...)...\"),yield this.waitUntil(()=>e.isInited)),this.logger.info(\"SERVICE is inited. Continuing...\"),this.emit(\"inited\")):this.logger.error(\"SERVICE is not defiend...\")}))}emit(e,...t){this.emitter.emit(e,...t)}init(){return Z(this,void 0,void 0,(function*(){this.agentxSERVICE?yield this.checkService(this.agentxSERVICE):this.logger.error(\"SERVICE is not defined...\")}))}cleanup(){this.agentxSERVICE=void 0,this.emit(\"cleaned\"),this.logger.info(\"Cleaned\")}get clientLocale(){return null!=window.navigator.languages?window.navigator.languages[0]:window.navigator.language}addEventListener(e,t){this.emitter.on(e,t)}removeEventListener(e,t){this.emitter.off(e,t)}}const B=o(r,\"[Config JSAPI] =>\");var G=function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))};class W{constructor(e){this.logger=e.logger,this.aqmEvents=e.aqmEvents,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}init(e){e&&(this.SERVICE=e),this.checkService()&&(this.aqmEvents.init({aqmServiceEntity:this.SERVICE.aqm.dialer,aqmServiceEntityString:\"SERVICE.aqm.dialer\"}),this.logger.info(\"Inited\"))}cleanup(){this.aqmEvents.cleanup(),this.SERVICE=void 0,this.logger.info(\"Cleaned\")}startOutdial(e){var t;return G(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.dialer.startOutdial(e)}))}updateCadVariables(e){var t;return G(this,void 0,void 0,(function*(){if(this.checkService())return null===(t=this.SERVICE)||void 0===t?void 0:t.aqm.dialer.updateCadVariables(e)}))}addEventListener(e,t){this.checkService()&&this.aqmEvents.addEventListener(e,t)}addOnceEventListener(e,t){this.checkService()&&this.aqmEvents.addOnceEventListener(e,t)}removeEventListener(e,t){this.aqmEvents.removeEventListener(e,t)}removeOnceEventListener(e,t){this.aqmEvents.removeOnceEventListener(e,t)}removeAllEventListeners(){this.aqmEvents.removeAllEventListeners()}}const $=o(r,\"[Dialer JSAPI] =>\"),K=o($,\"[AqmServiceEvents: Dialer] =>\");class Y{constructor(e){this.logger=e.logger,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}init(e){e&&(this.SERVICE=e),this.checkService()&&this.logger.info(\"Inited\")}cleanup(){this.SERVICE=void 0,this.logger.info(\"Cleaned\")}createInstance(e){return i.I18N.createService(e)}createMixin(e){return i.I18N.createMixin(e)}get DEFAULT_INIT_OPTIONS(){var e;if(this.checkService())return null===(e=this.SERVICE)||void 0===e?void 0:e.i18n.DEFAULT_INIT_OPTIONS}getMergedInitOptions(...e){return i.I18N.mergeServiceInitOptions(...e)}}const X=o(r,\"[I18N JSAPI] =>\");class Q{constructor(e){this.clientLoggers=new Map,this.logger=e.logger}createLogger(e){const t=Object(i.createLogger)(e);return this.clientLoggers.set(e,t),this.logger.info(`Client logger created: \"${e}\"`),t}cleanupLogs(e){this.clientLoggers.has(e)&&i.Logger.POOL.cleanupPrefixedLogs(e)}browserDownloadLogsJson(e){this.clientLoggers.has(e)&&i.Logger.POOL.browserDownloadPrefixedLogsJson(e)}browserDownloadLogsText(e){this.clientLoggers.has(e)&&i.Logger.POOL.browserDownloadPrefixedLogsText(e)}getLogsCollection(e){if(this.clientLoggers.has(e))return i.Logger.POOL.getPrefixedLogsCollection(e)}getLogsJsonUrl(e){if(this.clientLoggers.has(e))return i.Logger.POOL.getPrefixedLogsJsonUrl(e)}getLogsTextUrl(e){if(this.clientLoggers.has(e))return i.Logger.POOL.getPrefixedLogsTextUrl(e)}}const ee=o(r,\"[Logger JSAPI] =>\");class te{constructor(e){this.logger=e.logger,this.aqmEvents=e.aqmEvents,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}init(e){e&&(this.SERVICE=e),this.checkService()&&(this.aqmEvents.init({aqmServiceEntity:this.SERVICE.aqm.screenpop,aqmServiceEntityString:\"SERVICE.aqm.screenpop\"}),this.logger.info(\"Inited\"))}cleanup(){this.aqmEvents.cleanup(),this.SERVICE=void 0,this.logger.info(\"Cleaned\")}addEventListener(e,t){this.checkService()&&this.aqmEvents.addEventListener(e,t)}addOnceEventListener(e,t){this.checkService()&&this.aqmEvents.addOnceEventListener(e,t)}removeEventListener(e,t){this.aqmEvents.removeEventListener(e,t)}removeOnceEventListener(e,t){this.aqmEvents.removeOnceEventListener(e,t)}removeAllEventListeners(){this.aqmEvents.removeAllEventListeners()}}const ne=o(r,\"[ScreenPop JSAPI] =>\"),ie=o(ne,\"[AqmServiceEvents: ScreenPop] =>\");class re{constructor(e){this.logger=e.logger,this.serviceChecker=e.serviceChecker}checkService(){return this.serviceChecker.check(this.SERVICE)}init(e){e&&(this.SERVICE=e),this.checkService()&&this.logger.info(\"Inited\")}cleanup(){this.SERVICE=void 0,this.logger.info(\"Cleaned\")}listenKeyPress(...e){var t;this.checkService()&&(null===(t=this.SERVICE)||void 0===t||t.shortcut.event.listenKeyPress(...e))}listenKeyConflict(...e){var t;this.checkService()&&(null===(t=this.SERVICE)||void 0===t||t.shortcut.event.listenKeyConflict(...e))}listenConflictResolved(...e){var t;this.checkService()&&(null===(t=this.SERVICE)||void 0===t||t.shortcut.event.listenConflictResolved(...e))}register(...e){var t;this.checkService()&&(null===(t=this.SERVICE)||void 0===t||t.shortcut.register(...e))}unregisterKeys(...e){var t;this.checkService()&&(null===(t=this.SERVICE)||void 0===t||t.shortcut.unregisterKeys(...e))}getRegisteredKeys(){var e;if(this.checkService())return null===(e=this.SERVICE)||void 0===e?void 0:e.shortcut.getRegisteredKeys()}get DEFAULT_SHORTCUT_KEYS(){var e;return null===(e=this.SERVICE)||void 0===e?void 0:e.shortcut.DEFAULT_SHORTCUT_KEYS}get MODIFIERS(){var e;return null===(e=this.SERVICE)||void 0===e?void 0:e.shortcut.MODIFIERS}get REGISTERED_KEYS(){var e;return null===(e=this.SERVICE)||void 0===e?void 0:e.shortcut.REGISTERED_KEYS}}const oe=o(r,\"[ShortcutKey JSAPI] =>\"),se=(()=>{AGENTX_SERVICE?r.info('Found global \"AGENTX_SERVICE\"!'):r.error('Missed global \"AGENTX_SERVICE\"...');const e=(t=AGENTX_SERVICE,new J({logger:B,SERVICE:t}));var t;const n=new Q({logger:ee}),i=new re({logger:oe,serviceChecker:a({logger:oe})}),o=new x({logger:I,serviceChecker:a({logger:I})}),s=new H({logger:z,serviceChecker:a({logger:z})}),u=new D({logger:M,serviceChecker:a({logger:M}),aqmEvents:N({logger:_})}),c=new W({logger:$,aqmEvents:N({logger:K}),serviceChecker:a({logger:$})}),l=new te({logger:ne,aqmEvents:N({logger:ie}),serviceChecker:a({logger:ne})}),d=new Y({logger:X,serviceChecker:a({logger:X})});return e.addEventListener(\"inited\",()=>{u.init(AGENTX_SERVICE),s.init(AGENTX_SERVICE),c.init(AGENTX_SERVICE),l.init(AGENTX_SERVICE),i.init(AGENTX_SERVICE),o.init(AGENTX_SERVICE),d.init(AGENTX_SERVICE)}),e.addEventListener(\"cleaned\",()=>{u.cleanup(),s.cleanup(),c.cleanup(),l.cleanup(),i.cleanup(),d.cleanup(),o.cleanup()}),{config:e,logger:n,shortcutKey:i,actions:o,agentContact:u,agentStateInfo:s,dialer:c,screenpop:l,i18n:d}})()},function(e,t,n){\"use strict\";n.r(t),n.d(t,\"v1\",(function(){return h})),n.d(t,\"v3\",(function(){return b})),n.d(t,\"v4\",(function(){return E})),n.d(t,\"v5\",(function(){return L}));var i=\"undefined\"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||\"undefined\"!=typeof msCrypto&&\"function\"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function o(){if(!i)throw new Error(\"crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported\");return i(r)}for(var s=[],a=0;a<256;++a)s[a]=(a+256).toString(16).substr(1);var u,c,l=function(e,t){var n=t||0,i=s;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],\"-\",i[e[n++]],i[e[n++]],\"-\",i[e[n++]],i[e[n++]],\"-\",i[e[n++]],i[e[n++]],\"-\",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join(\"\")},d=0,f=0;var h=function(e,t,n){var i=t&&n||0,r=t||[],s=(e=e||{}).node||u,a=void 0!==e.clockseq?e.clockseq:c;if(null==s||null==a){var h=e.random||(e.rng||o)();null==s&&(s=u=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==a&&(a=c=16383&(h[6]<<8|h[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),v=void 0!==e.nsecs?e.nsecs:f+1,g=p-d+(v-f)/1e4;if(g<0&&void 0===e.clockseq&&(a=a+1&16383),(g<0||p>d)&&void 0===e.nsecs&&(v=0),v>=1e4)throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");d=p,f=v,c=a;var m=(1e4*(268435455&(p+=122192928e5))+v)%4294967296;r[i++]=m>>>24&255,r[i++]=m>>>16&255,r[i++]=m>>>8&255,r[i++]=255&m;var y=p/4294967296*1e4&268435455;r[i++]=y>>>8&255,r[i++]=255&y,r[i++]=y>>>24&15|16,r[i++]=y>>>16&255,r[i++]=a>>>8|128,r[i++]=255&a;for(var S=0;S<6;++S)r[i+S]=s[S];return t||l(r)};var p=function(e,t,n){var i=function(e,i,r,o){var s=r&&o||0;if(\"string\"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));for(var t=new Array(e.length),n=0;n>16)+(t>>16)+(n>>16)<<16|65535&n}function g(e,t,n,i,r,o){return v((s=v(v(t,e),v(i,o)))<<(a=r)|s>>>32-a,n);var s,a}function m(e,t,n,i,r,o,s){return g(t&n|~t&i,e,t,r,o,s)}function y(e,t,n,i,r,o,s){return g(t&i|n&~i,e,t,r,o,s)}function S(e,t,n,i,r,o,s){return g(t^n^i,e,t,r,o,s)}function w(e,t,n,i,r,o,s){return g(n^(t|~i),e,t,r,o,s)}var b=p(\"v3\",48,(function(e){if(\"string\"==typeof e){var t=unescape(encodeURIComponent(e));e=new Array(t.length);for(var n=0;n>5]>>>t%32&255,i=parseInt(\"0123456789abcdef\".charAt(n>>>4&15)+\"0123456789abcdef\".charAt(15&n),16),r.push(i);return r}(function(e,t){var n,i,r,o,s;e[t>>5]|=128<>>9<<4)]=t;var a=1732584193,u=-271733879,c=-1732584194,l=271733878;for(n=0;n>2)-1]=void 0,t=0;t>5]|=(255&e[t/8])<>>32-t}var L=p(\"v5\",80,(function(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(\"string\"==typeof e){var i=unescape(encodeURIComponent(e));e=new Array(i.length);for(var r=0;r>>0;v=p,p=h,h=O(f,30)>>>0,f=d,d=m}n[0]=n[0]+d>>>0,n[1]=n[1]+f>>>0,n[2]=n[2]+h>>>0,n[3]=n[3]+p>>>0,n[4]=n[4]+v>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,255&n[0],n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,255&n[1],n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,255&n[2],n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,255&n[3],n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,255&n[4]]}))},function(e,t,n){\"use strict\";function i(e){return(i=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};Object(s.a)(this,e),this.init(t,n)}return Object(a.a)(e,[{key:\"init\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||\"i18next:\",this.logger=e||h,this.options=t,this.debug=t.debug}},{key:\"setDebug\",value:function(e){this.debug=e}},{key:\"log\",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n1?t-1:0),i=1;i-1?e.replace(/###/g,\".\"):e}function r(){return!e||\"string\"==typeof e}for(var o=\"string\"!=typeof t?[].concat(t):t.split(\".\");o.length>1;){if(r())return{};var s=i(o.shift());!e[s]&&n&&(e[s]=new n),e=e[s]}return r()?{}:{obj:e,k:i(o.shift())}}function w(e,t,n){var i=S(e,t,Object);i.obj[i.k]=n}function b(e,t){var n=S(e,t),i=n.obj,r=n.k;if(i)return i[r]}function E(e,t,n){var i=b(e,n);return void 0!==i?i:b(t,n)}function k(e,t,n){for(var i in t)\"__proto__\"!==i&&\"constructor\"!==i&&(i in e?\"string\"==typeof e[i]||e[i]instanceof String||\"string\"==typeof t[i]||t[i]instanceof String?n&&(e[i]=t[i]):k(e[i],t[i],n):e[i]=t[i]);return e}function O(e){return e.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g,\"\\\\$&\")}var L={\"&\":\"&\",\"<\":\"<\",\">\":\">\",'\"':\""\",\"'\":\"'\",\"/\":\"/\"};function C(e){return\"string\"==typeof e?e.replace(/[&<>\"'\\/]/g,(function(e){return L[e]})):e}var T=\"undefined\"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf(\"MSIE\")>-1,x=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:[\"translation\"],defaultNS:\"translation\"};return Object(s.a)(this,t),n=c(this,l(t).call(this)),T&&v.call(u(n)),n.data=e||{},n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator=\".\"),n}return f(t,e),Object(a.a)(t,[{key:\"addNamespaces\",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:\"removeNamespaces\",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:\"getResource\",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator,o=[e,t];return n&&\"string\"!=typeof n&&(o=o.concat(n)),n&&\"string\"==typeof n&&(o=o.concat(r?n.split(r):n)),e.indexOf(\".\")>-1&&(o=e.split(\".\")),b(this.data,o)}},{key:\"addResource\",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=\".\");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(\".\")>-1&&(i=t,t=(s=e.split(\".\"))[1]),this.addNamespaces(t),w(this.data,s,i),r.silent||this.emit(\"added\",e,t,n,i)}},{key:\"addResources\",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)\"string\"!=typeof n[r]&&\"[object Array]\"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});i.silent||this.emit(\"added\",e,t,n)}},{key:\"addResourceBundle\",value:function(e,t,n,i,r){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(\".\")>-1&&(i=n,n=t,t=(a=e.split(\".\"))[1]),this.addNamespaces(t);var u=b(this.data,a)||{};i?k(u,n,r):u=o({},u,n),w(this.data,a,u),s.silent||this.emit(\"added\",e,t,n)}},{key:\"removeResourceBundle\",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit(\"removed\",e,t)}},{key:\"hasResourceBundle\",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:\"getResourceBundle\",value:function(e,t){return t||(t=this.options.defaultNS),\"v1\"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:\"getDataByLanguage\",value:function(e){return this.data[e]}},{key:\"toJSON\",value:function(){return this.data}}]),t}(v),I={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,i,r){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,i,r))})),t}},A={},N=function(e){function t(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object(s.a)(this,t),n=c(this,l(t).call(this)),T&&v.call(u(n)),y([\"resourceStore\",\"languageUtils\",\"pluralResolver\",\"interpolator\",\"backendConnector\",\"i18nFormat\",\"utils\"],e,u(n)),n.options=i,void 0===n.options.keySeparator&&(n.options.keySeparator=\".\"),n.logger=p.create(\"translator\"),n}return f(t,e),Object(a.a)(t,[{key:\"changeLanguage\",value:function(e){e&&(this.language=e)}},{key:\"exists\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:\"extractFromKey\",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=\":\");var i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:r};var s=e.split(n);(n!==i||n===i&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),e=s.join(i)}return\"string\"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:\"translate\",value:function(e,t,n){var r=this;if(\"object\"!==i(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return\"\";Array.isArray(e)||(e=[String(e)]);var s=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,a=this.extractFromKey(e[e.length-1],t),u=a.key,c=a.namespaces,l=c[c.length-1],d=t.lng||this.language,f=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&\"cimode\"===d.toLowerCase()){if(f){var h=t.nsSeparator||this.options.nsSeparator;return l+h+u}return u}var p=this.resolve(e,t),v=p&&p.res,g=p&&p.usedKey||u,m=p&&p.exactUsedKey||u,y=Object.prototype.toString.apply(v),S=[\"[object Number]\",\"[object Function]\",\"[object RegExp]\"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,E=\"string\"!=typeof v&&\"boolean\"!=typeof v&&\"number\"!=typeof v;if(b&&v&&E&&S.indexOf(y)<0&&(\"string\"!=typeof w||\"[object Array]\"!==y)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn(\"accessing an object - but returnObjects options is not enabled!\"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,v,t):\"key '\".concat(u,\" (\").concat(this.language,\")' returned an object instead of string.\");if(s){var k=\"[object Array]\"===y,O=k?[]:{},L=k?m:g;for(var C in v)if(Object.prototype.hasOwnProperty.call(v,C)){var T=\"\".concat(L).concat(s).concat(C);O[C]=this.translate(T,o({},t,{joinArrays:!1,ns:c})),O[C]===T&&(O[C]=v[C])}v=O}}else if(b&&\"string\"==typeof w&&\"[object Array]\"===y)(v=v.join(w))&&(v=this.extendTranslation(v,e,t,n));else{var x=!1,I=!1;if(!this.isValidLookup(v)&&void 0!==t.defaultValue){if(x=!0,void 0!==t.count){var A=this.pluralResolver.getSuffix(d,t.count);v=t[\"defaultValue\".concat(A)]}v||(v=t.defaultValue)}this.isValidLookup(v)||(I=!0,v=u);var N=t.defaultValue&&t.defaultValue!==v&&this.options.updateMissing;if(I||x||N){if(this.logger.log(N?\"updateKey\":\"missingKey\",d,l,u,N?t.defaultValue:v),s){var R=this.resolve(u,o({},t,{keySeparator:!1}));R&&R.res&&this.logger.warn(\"Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.\")}var D=[],M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(\"fallback\"===this.options.saveMissingTo&&M&&M[0])for(var _=0;_1&&void 0!==arguments[1]?arguments[1]:{};return\"string\"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var u=s.extractFromKey(e,a),c=u.key;n=c;var l=u.namespaces;s.options.fallbackNS&&(l=l.concat(s.options.fallbackNS));var d=void 0!==a.count&&\"string\"!=typeof a.count,f=void 0!==a.context&&\"string\"==typeof a.context&&\"\"!==a.context,h=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);l.forEach((function(e){s.isValidLookup(t)||(o=e,!A[\"\".concat(h[0],\"-\").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(A[\"\".concat(h[0],\"-\").concat(e)]=!0,s.logger.warn('key \"'.concat(n,'\" for languages \"').concat(h.join(\", \"),'\" won\\'t get resolved as namespace \"').concat(o,'\" was not yet loaded'),\"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!\")),h.forEach((function(n){if(!s.isValidLookup(t)){r=n;var o,u,l=c,h=[l];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(h,c,n,e,a);else d&&(o=s.pluralResolver.getSuffix(n,a.count)),d&&f&&h.push(l+o),f&&h.push(l+=\"\".concat(s.options.contextSeparator).concat(a.context)),d&&h.push(l+=o);for(;u=h.pop();)s.isValidLookup(t)||(i=u,t=s.getResource(n,e,u,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:i,usedLng:r,usedNS:o}}},{key:\"isValidLookup\",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&\"\"===e)}},{key:\"getResource\",value:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,i):this.resourceStore.getResource(e,t,n,i)}}]),t}(v);function R(e){return e.charAt(0).toUpperCase()+e.slice(1)}var D=function(){function e(t){Object(s.a)(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=p.create(\"languageUtils\")}return Object(a.a)(e,[{key:\"getScriptPartFromCode\",value:function(e){if(!e||e.indexOf(\"-\")<0)return null;var t=e.split(\"-\");return 2===t.length?null:(t.pop(),\"x\"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join(\"-\")))}},{key:\"getLanguagePartFromCode\",value:function(e){if(!e||e.indexOf(\"-\")<0)return e;var t=e.split(\"-\");return this.formatLanguageCode(t[0])}},{key:\"formatLanguageCode\",value:function(e){if(\"string\"==typeof e&&e.indexOf(\"-\")>-1){var t=[\"hans\",\"hant\",\"latn\",\"cyrl\",\"cans\",\"mong\",\"arab\"],n=e.split(\"-\");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=R(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),\"sgn\"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=R(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=R(n[2].toLowerCase()))),n.join(\"-\")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:\"isWhitelisted\",value:function(e){return this.logger.deprecate(\"languageUtils.isWhitelisted\",'function \"isWhitelisted\" will be renamed to \"isSupportedCode\" in the next major - please make sure to rename it\\'s usage asap.'),this.isSupportedCode(e)}},{key:\"isSupportedCode\",value:function(e){return(\"languageOnly\"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:\"getBestMatchFromCodes\",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var i=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(i)||(t=i)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var i=n.getLanguagePartFromCode(e);if(n.isSupportedCode(i))return t=i;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(i))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:\"getFallbackCodes\",value:function(e,t){if(!e)return[];if(\"function\"==typeof e&&(e=e(t)),\"string\"==typeof e&&(e=[e]),\"[object Array]\"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:\"toResolveHierarchy\",value:function(e,t){var n=this,i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn(\"rejecting language code not found in supportedLngs: \".concat(e)))};return\"string\"==typeof e&&e.indexOf(\"-\")>-1?(\"languageOnly\"!==this.options.load&&o(this.formatLanguageCode(e)),\"languageOnly\"!==this.options.load&&\"currentOnly\"!==this.options.load&&o(this.getScriptPartFromCode(e)),\"currentOnly\"!==this.options.load&&o(this.getLanguagePartFromCode(e))):\"string\"==typeof e&&o(this.formatLanguageCode(e)),i.forEach((function(e){r.indexOf(e)<0&&o(n.formatLanguageCode(e))})),r}}]),e}(),M=[{lngs:[\"ach\",\"ak\",\"am\",\"arn\",\"br\",\"fil\",\"gun\",\"ln\",\"mfe\",\"mg\",\"mi\",\"oc\",\"pt\",\"pt-BR\",\"tg\",\"ti\",\"tr\",\"uz\",\"wa\"],nr:[1,2],fc:1},{lngs:[\"af\",\"an\",\"ast\",\"az\",\"bg\",\"bn\",\"ca\",\"da\",\"de\",\"dev\",\"el\",\"en\",\"eo\",\"es\",\"et\",\"eu\",\"fi\",\"fo\",\"fur\",\"fy\",\"gl\",\"gu\",\"ha\",\"hi\",\"hu\",\"hy\",\"ia\",\"it\",\"kn\",\"ku\",\"lb\",\"mai\",\"ml\",\"mn\",\"mr\",\"nah\",\"nap\",\"nb\",\"ne\",\"nl\",\"nn\",\"no\",\"nso\",\"pa\",\"pap\",\"pms\",\"ps\",\"pt-PT\",\"rm\",\"sco\",\"se\",\"si\",\"so\",\"son\",\"sq\",\"sv\",\"sw\",\"ta\",\"te\",\"tk\",\"ur\",\"yo\"],nr:[1,2],fc:2},{lngs:[\"ay\",\"bo\",\"cgg\",\"fa\",\"ht\",\"id\",\"ja\",\"jbo\",\"ka\",\"kk\",\"km\",\"ko\",\"ky\",\"lo\",\"ms\",\"sah\",\"su\",\"th\",\"tt\",\"ug\",\"vi\",\"wo\",\"zh\"],nr:[1],fc:3},{lngs:[\"be\",\"bs\",\"cnr\",\"dz\",\"hr\",\"ru\",\"sr\",\"uk\"],nr:[1,2,5],fc:4},{lngs:[\"ar\"],nr:[0,1,2,3,11,100],fc:5},{lngs:[\"cs\",\"sk\"],nr:[1,2,5],fc:6},{lngs:[\"csb\",\"pl\"],nr:[1,2,5],fc:7},{lngs:[\"cy\"],nr:[1,2,3,8],fc:8},{lngs:[\"fr\"],nr:[1,2],fc:9},{lngs:[\"ga\"],nr:[1,2,3,7,11],fc:10},{lngs:[\"gd\"],nr:[1,2,3,20],fc:11},{lngs:[\"is\"],nr:[1,2],fc:12},{lngs:[\"jv\"],nr:[0,1],fc:13},{lngs:[\"kw\"],nr:[1,2,3,4],fc:14},{lngs:[\"lt\"],nr:[1,2,10],fc:15},{lngs:[\"lv\"],nr:[1,2,0],fc:16},{lngs:[\"mk\"],nr:[1,2],fc:17},{lngs:[\"mnk\"],nr:[0,1,2],fc:18},{lngs:[\"mt\"],nr:[1,2,11,20],fc:19},{lngs:[\"or\"],nr:[2,1],fc:2},{lngs:[\"ro\"],nr:[1,2,20],fc:20},{lngs:[\"sl\"],nr:[5,1,2,3],fc:21},{lngs:[\"he\",\"iw\"],nr:[1,2,20,21],fc:22}],_={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};function j(){var e={};return M.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:_[t.fc]}}))})),e}var V=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(s.a)(this,e),this.languageUtils=t,this.options=n,this.logger=p.create(\"pluralResolver\"),this.rules=j()}return Object(a.a)(e,[{key:\"addRule\",value:function(e,t){this.rules[e]=t}},{key:\"getRule\",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:\"needsPlural\",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:\"getPluralFormsOfKey\",value:function(e,t){var n=this,i=[],r=this.getRule(e);return r?(r.numbers.forEach((function(r){var o=n.getSuffix(e,r);i.push(\"\".concat(t).concat(o))})),i):i}},{key:\"getSuffix\",value:function(e,t){var n=this,i=this.getRule(e);if(i){var r=i.noAbs?i.plurals(t):i.plurals(Math.abs(t)),o=i.numbers[r];this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]&&(2===o?o=\"plural\":1===o&&(o=\"\"));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return\"v1\"===this.options.compatibilityJSON?1===o?\"\":\"number\"==typeof o?\"_plural_\".concat(o.toString()):s():\"v2\"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===i.numbers.length&&1===i.numbers[0]?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}return this.logger.warn(\"no plural rule found for: \".concat(e)),\"\"}}]),e}(),P=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(s.a)(this,e),this.logger=p.create(\"interpolator\"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return Object(a.a)(e,[{key:\"init\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:C,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?O(t.prefix):t.prefixEscaped||\"{{\",this.suffix=t.suffix?O(t.suffix):t.suffixEscaped||\"}}\",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||\",\",this.unescapePrefix=t.unescapeSuffix?\"\":t.unescapePrefix||\"-\",this.unescapeSuffix=this.unescapePrefix?\"\":t.unescapeSuffix||\"\",this.nestingPrefix=t.nestingPrefix?O(t.nestingPrefix):t.nestingPrefixEscaped||O(\"$t(\"),this.nestingSuffix=t.nestingSuffix?O(t.nestingSuffix):t.nestingSuffixEscaped||O(\")\"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||\",\",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:\"reset\",value:function(){this.options&&this.init(this.options)}},{key:\"resetRegExp\",value:function(){var e=\"\".concat(this.prefix,\"(.+?)\").concat(this.suffix);this.regexp=new RegExp(e,\"g\");var t=\"\".concat(this.prefix).concat(this.unescapePrefix,\"(.+?)\").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,\"g\");var n=\"\".concat(this.nestingPrefix,\"(.+?)\").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,\"g\")}},{key:\"interpolate\",value:function(e,t,n,i){var r,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\\$/g,\"$$$$\")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var r=E(t,u,e);return a.alwaysFormat?a.format(r,void 0,n):r}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(E(t,u,s),c,n,i)};this.resetRegExp();var d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;r=t.regex.exec(e);){if(void 0===(o=l(r[1].trim())))if(\"function\"==typeof d){var n=d(e,r,i);o=\"string\"==typeof n?n:\"\"}else{if(f){o=r[0];continue}a.logger.warn(\"missed to pass in variable \".concat(r[1],\" for interpolating \").concat(e)),o=\"\"}else\"string\"==typeof o||a.useRawValueToEscape||(o=m(o));if(e=e.replace(r[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:\"nest\",value:function(e,t){var n,i,r=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var i=e.split(new RegExp(\"\".concat(n,\"[ ]*{\"))),r=\"{\".concat(i[1]);e=i[0],r=(r=this.interpolate(r,a)).replace(/'/g,'\"');try{a=JSON.parse(r),t&&(a=o({},t,a))}catch(t){return this.logger.warn(\"failed parsing options string in nesting for key \".concat(e),t),\"\".concat(e).concat(n).concat(r)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var d=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=d.shift(),c=d,l=!0}if((i=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&\"string\"!=typeof i)return i;\"string\"!=typeof i&&(i=m(i)),i||(this.logger.warn(\"missed to resolve \".concat(n[1],\" for nesting \").concat(e)),i=\"\"),l&&(i=c.reduce((function(e,t){return r.format(e,t,s.lng,s)}),i.trim())),e=e.replace(n[0],i),this.regexp.lastIndex=0}return e}}]),e}();var q=function(e){function t(e,n,i){var r,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Object(s.a)(this,t),r=c(this,l(t).call(this)),T&&v.call(u(r)),r.backend=e,r.store=n,r.services=i,r.languageUtils=i.languageUtils,r.options=o,r.logger=p.create(\"backendConnector\"),r.state={},r.queue=[],r.backend&&r.backend.init&&r.backend.init(i,o.backend,o),r}return f(t,e),Object(a.a)(t,[{key:\"queueLoad\",value:function(e,t,n,i){var r=this,o=[],s=[],a=[],u=[];return e.forEach((function(e){var i=!0;t.forEach((function(t){var a=\"\".concat(e,\"|\").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[a]=2:r.state[a]<0||(1===r.state[a]?s.indexOf(a)<0&&s.push(a):(r.state[a]=1,i=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(t)<0&&u.push(t)))})),i||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:i}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:\"loaded\",value:function(e,t,n){var i=e.split(\"|\"),r=i[0],o=i[1];t&&this.emit(\"failedLoading\",r,o,t),n&&this.store.addResourceBundle(r,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var i,a,u,c,l,d;i=n.loaded,a=o,c=S(i,[r],Object),l=c.obj,d=c.k,l[d]=l[d]||[],u&&(l[d]=l[d].concat(a)),u||l[d].push(a),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit(\"loaded\",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:\"read\",value:function(e,t,n){var i=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,u){a&&u&&r<5?setTimeout((function(){i.read.call(i,e,t,n,r+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:\"prepareLoading\",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn(\"No backend was added via i18next.use. Will not load resources.\"),r&&r();\"string\"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),\"string\"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,i,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:\"load\",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:\"reload\",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:\"loadOne\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\",i=e.split(\"|\"),r=i[0],o=i[1];this.read(r,o,\"read\",void 0,void 0,(function(i,s){i&&t.logger.warn(\"\".concat(n,\"loading namespace \").concat(o,\" for language \").concat(r,\" failed\"),i),!i&&s&&t.logger.log(\"\".concat(n,\"loaded namespace \").concat(o,\" for language \").concat(r),s),t.loaded(e,i,s)}))}},{key:\"saveMissing\",value:function(e,t,n,i,r){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key \"'.concat(n,'\" as the namespace \"').concat(t,'\" was not yet loaded'),\"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!\"):null!=n&&\"\"!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,i,null,o({},s,{isUpdate:r})),e&&e[0]&&this.store.addResource(e[0],t,n,i))}}]),t}(v);function U(){return{debug:!1,initImmediate:!0,ns:[\"translation\"],defaultNS:[\"translation\"],fallbackLng:[\"dev\"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:\"all\",preload:!1,simplifyPluralSuffix:!0,keySeparator:\".\",nsSeparator:\":\",pluralSeparator:\"_\",contextSeparator:\"_\",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:\"fallback\",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if(\"object\"===i(e[1])&&(t=e[1]),\"string\"==typeof e[1]&&(t.defaultValue=e[1]),\"string\"==typeof e[2]&&(t.tDescription=e[2]),\"object\"===i(e[2])||\"object\"===i(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,i){return e},prefix:\"{{\",suffix:\"}}\",formatSeparator:\",\",unescapePrefix:\"-\",nestingPrefix:\"$t(\",nestingSuffix:\")\",nestingOptionsSeparator:\",\",maxReplaces:1e3,skipOnVariables:!1}}}function F(e){return\"string\"==typeof e.ns&&(e.ns=[e.ns]),\"string\"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),\"string\"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf(\"cimode\")<0&&(e.whitelist=e.whitelist.concat([\"cimode\"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf(\"cimode\")<0&&(e.supportedLngs=e.supportedLngs.concat([\"cimode\"])),e}function H(){}var z=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(Object(s.a)(this,t),e=c(this,l(t).call(this)),T&&v.call(u(e)),e.options=F(n),e.services={},e.logger=p,e.modules={external:[]},i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),c(e,u(e));setTimeout((function(){e.init(n,i)}),0)}return e}return f(t,e),Object(a.a)(t,[{key:\"init\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?\"function\"==typeof e?new e:e:null}if(\"function\"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate(\"whitelist\",'option \"whitelist\" will be renamed to \"supportedLngs\" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate(\"whitelist\",'options \"nonExplicitWhitelist\" will be renamed to \"nonExplicitSupportedLngs\" in the next major - please make sure to rename this option asap.'),this.options=o({},U(),this.options,F(t)),this.format=this.options.interpolation.format,n||(n=H),!this.options.isClone){this.modules.logger?p.init(i(this.modules.logger),this.options):p.init(null,this.options);var r=new D(this.options);this.store=new x(this.options.resources,this.options);var s=this.services;s.logger=p,s.resourceStore=this.store,s.languageUtils=r,s.pluralResolver=new V(r,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new P(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new q(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on(\"*\",(function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1?n-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:H,i=n,r=\"string\"==typeof e?e:this.language;if(\"function\"==typeof e&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&\"cimode\"===r.toLowerCase())return i();var o=[],s=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(r)s(r);else{var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.forEach((function(e){return s(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return s(e)})),this.services.backendConnector.load(o,this.options.ns,i)}else i(null)}},{key:\"reloadResources\",value:function(e,t,n){var i=g();return e||(e=this.languages),t||(t=this.options.ns),n||(n=H),this.services.backendConnector.reload(e,t,(function(e){i.resolve(),n(e)})),i}},{key:\"use\",value:function(e){if(!e)throw new Error(\"You are passing an undefined module! Please check the object you are passing to i18next.use()\");if(!e.type)throw new Error(\"You are passing a wrong module! Please check the object you are passing to i18next.use()\");return\"backend\"===e.type&&(this.modules.backend=e),(\"logger\"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),\"languageDetector\"===e.type&&(this.modules.languageDetector=e),\"i18nFormat\"===e.type&&(this.modules.i18nFormat=e),\"postProcessor\"===e.type&&I.addPostProcessor(e),\"3rdParty\"===e.type&&this.modules.external.push(e),this}},{key:\"changeLanguage\",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var i=g();this.emit(\"languageChanging\",e);var r=function(e){var r=\"string\"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);r&&(n.language||(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r)),n.translator.language||n.translator.changeLanguage(r),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(r)),n.loadResources(r,(function(e){!function(e,r){r?(n.language=r,n.languages=n.services.languageUtils.toResolveHierarchy(r),n.translator.changeLanguage(r),n.isLanguageChangingTo=void 0,n.emit(\"languageChanged\",r),n.logger.log(\"languageChanged\",r)):n.isLanguageChangingTo=void 0,i.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,r)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),i}},{key:\"getFixedT\",value:function(e,t){var n=this,r=function e(t,r){var s;if(\"object\"!==i(r)){for(var a=arguments.length,u=new Array(a>2?a-2:0),c=2;c1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn(\"hasLoadedNamespace: i18next was not initialized\",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn(\"hasLoadedNamespace: i18n.languages were undefined or empty\",this.languages),!1;var i=this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if(\"cimode\"===i.toLowerCase())return!0;var s=function(e,n){var i=t.services.backendConnector.state[\"\".concat(e,\"|\").concat(n)];return-1===i||2===i};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(i,e)||(!this.services.backendConnector.backend||!(!s(i,e)||r&&!s(o,e)))}},{key:\"loadNamespaces\",value:function(e,t){var n=this,i=g();return this.options.ns?(\"string\"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){i.resolve(),t&&t(e)})),i):(t&&t(),Promise.resolve())}},{key:\"loadLanguages\",value:function(e,t){var n=g();\"string\"==typeof e&&(e=[e]);var i=this.options.preload||[],r=e.filter((function(e){return i.indexOf(e)<0}));return r.length?(this.options.preload=i.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:\"dir\",value:function(e){if(e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),!e)return\"rtl\";return[\"ar\",\"shu\",\"sqr\",\"ssh\",\"xaa\",\"yhd\",\"yud\",\"aao\",\"abh\",\"abv\",\"acm\",\"acq\",\"acw\",\"acx\",\"acy\",\"adf\",\"ads\",\"aeb\",\"aec\",\"afb\",\"ajp\",\"apc\",\"apd\",\"arb\",\"arq\",\"ars\",\"ary\",\"arz\",\"auz\",\"avl\",\"ayh\",\"ayl\",\"ayn\",\"ayp\",\"bbz\",\"pga\",\"he\",\"iw\",\"ps\",\"pbt\",\"pbu\",\"pst\",\"prp\",\"prd\",\"ug\",\"ur\",\"ydd\",\"yds\",\"yih\",\"ji\",\"yi\",\"hbo\",\"men\",\"xmn\",\"fa\",\"jpr\",\"peo\",\"pes\",\"prs\",\"dv\",\"sam\"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?\"rtl\":\"ltr\"}},{key:\"createInstance\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new t(e,n)}},{key:\"cloneInstance\",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:H,r=o({},this.options,n,{isClone:!0}),s=new t(r),a=[\"store\",\"services\",\"language\"];return a.forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new N(s.services,s.options),s.translator.on(\"*\",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i {\n return new CSSResult(String(value), constructionToken);\n};\nconst textFromCSSResult = (value) => {\n if (value instanceof CSSResult) {\n return value.cssText;\n }\n else if (typeof value === 'number') {\n return value;\n }\n else {\n throw new Error(`Value passed to 'css' function must be a 'css' function result: ${value}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`);\n }\n};\n/**\n * Template tag which which can be used with LitElement's [[LitElement.styles |\n * `styles`]] property to set element styles. For security reasons, only literal\n * string values may be used. To incorporate non-literal values [[`unsafeCSS`]]\n * may be used inside a template string part.\n */\nexport const css = (strings, ...values) => {\n const cssText = values.reduce((acc, v, idx) => acc + textFromCSSResult(v) + strings[idx + 1], strings[0]);\n return new CSSResult(cssText, constructionToken);\n};\n//# sourceMappingURL=css-tag.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst legacyCustomElement = (tagName, clazz) => {\n window.customElements.define(tagName, clazz);\n // Cast as any because TS doesn't recognize the return type as being a\n // subtype of the decorated class when clazz is typed as\n // `Constructor` for some reason.\n // `Constructor` is helpful to make sure the decorator is\n // applied to elements however.\n // tslint:disable-next-line:no-any\n return clazz;\n};\nconst standardCustomElement = (tagName, descriptor) => {\n const { kind, elements } = descriptor;\n return {\n kind,\n elements,\n // This callback is called once the class is otherwise fully defined\n finisher(clazz) {\n window.customElements.define(tagName, clazz);\n }\n };\n};\n/**\n * Class decorator factory that defines the decorated class as a custom element.\n *\n * ```\n * @customElement('my-element')\n * class MyElement {\n * render() {\n * return html``;\n * }\n * }\n * ```\n * @category Decorator\n * @param tagName The name of the custom element to define.\n */\nexport const customElement = (tagName) => (classOrDescriptor) => (typeof classOrDescriptor === 'function') ?\n legacyCustomElement(tagName, classOrDescriptor) :\n standardCustomElement(tagName, classOrDescriptor);\nconst standardProperty = (options, element) => {\n // When decorating an accessor, pass it through and add property metadata.\n // Note, the `hasOwnProperty` check in `createProperty` ensures we don't\n // stomp over the user's accessor.\n if (element.kind === 'method' && element.descriptor &&\n !('value' in element.descriptor)) {\n return Object.assign(Object.assign({}, element), { finisher(clazz) {\n clazz.createProperty(element.key, options);\n } });\n }\n else {\n // createProperty() takes care of defining the property, but we still\n // must return some kind of descriptor, so return a descriptor for an\n // unused prototype field. The finisher calls createProperty().\n return {\n kind: 'field',\n key: Symbol(),\n placement: 'own',\n descriptor: {},\n // When @babel/plugin-proposal-decorators implements initializers,\n // do this instead of the initializer below. See:\n // https://github.com/babel/babel/issues/9260 extras: [\n // {\n // kind: 'initializer',\n // placement: 'own',\n // initializer: descriptor.initializer,\n // }\n // ],\n initializer() {\n if (typeof element.initializer === 'function') {\n this[element.key] = element.initializer.call(this);\n }\n },\n finisher(clazz) {\n clazz.createProperty(element.key, options);\n }\n };\n }\n};\nconst legacyProperty = (options, proto, name) => {\n proto.constructor\n .createProperty(name, options);\n};\n/**\n * A property decorator which creates a LitElement property which reflects a\n * corresponding attribute value. A [[`PropertyDeclaration`]] may optionally be\n * supplied to configure property features.\n *\n * This decorator should only be used for public fields. Private or protected\n * fields should use the [[`internalProperty`]] decorator.\n *\n * @example\n * ```ts\n * class MyElement {\n * @property({ type: Boolean })\n * clicked = false;\n * }\n * ```\n * @category Decorator\n * @ExportDecoratedItems\n */\nexport function property(options) {\n // tslint:disable-next-line:no-any decorator\n return (protoOrDescriptor, name) => (name !== undefined) ?\n legacyProperty(options, protoOrDescriptor, name) :\n standardProperty(options, protoOrDescriptor);\n}\n/**\n * Declares a private or protected property that still triggers updates to the\n * element when it changes.\n *\n * Properties declared this way must not be used from HTML or HTML templating\n * systems, they're solely for properties internal to the element. These\n * properties may be renamed by optimization tools like the Closure Compiler.\n * @category Decorator\n * @deprecated `internalProperty` has been renamed to `state` in lit-element\n * 3.0. Please update to `state` now to be compatible with 3.0.\n */\nexport function internalProperty(options) {\n return property({ attribute: false, hasChanged: options === null || options === void 0 ? void 0 : options.hasChanged });\n}\n/**\n * Declares a private or protected property that still triggers updates to the\n * element when it changes.\n *\n * Properties declared this way must not be used from HTML or HTML templating\n * systems, they're solely for properties internal to the element. These\n * properties may be renamed by optimization tools like the Closure Compiler.\n * @category Decorator\n */\nexport const state = (options) => internalProperty(options);\n/**\n * A property decorator that converts a class property into a getter that\n * executes a querySelector on the element's renderRoot.\n *\n * @param selector A DOMString containing one or more selectors to match.\n * @param cache An optional boolean which when true performs the DOM query only\n * once and caches the result.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector\n *\n * @example\n *\n * ```ts\n * class MyElement {\n * @query('#first')\n * first;\n *\n * render() {\n * return html`\n * \n * \n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function query(selector, cache) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n if (cache) {\n const prop = name !== undefined ? name : protoOrDescriptor.key;\n const key = typeof prop === 'symbol' ? Symbol() : `__${prop}`;\n descriptor.get = function () {\n if (this[key] === undefined) {\n (this[key] =\n this.renderRoot.querySelector(selector));\n }\n return this[key];\n };\n }\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\n// Note, in the future, we may extend this decorator to support the use case\n// where the queried element may need to do work to become ready to interact\n// with (e.g. load some implementation code). If so, we might elect to\n// add a second argument defining a function that can be run to make the\n// queried element loaded/updated/ready.\n/**\n * A property decorator that converts a class property into a getter that\n * returns a promise that resolves to the result of a querySelector on the\n * element's renderRoot done after the element's `updateComplete` promise\n * resolves. When the queried property may change with element state, this\n * decorator can be used instead of requiring users to await the\n * `updateComplete` before accessing the property.\n *\n * @param selector A DOMString containing one or more selectors to match.\n *\n * See: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector\n *\n * @example\n * ```ts\n * class MyElement {\n * @queryAsync('#first')\n * first;\n *\n * render() {\n * return html`\n * \n * \n * `;\n * }\n * }\n *\n * // external usage\n * async doSomethingWithFirst() {\n * (await aMyElement.first).doSomething();\n * }\n * ```\n * @category Decorator\n */\nexport function queryAsync(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n async get() {\n await this.updateComplete;\n return this.renderRoot.querySelector(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\n/**\n * A property decorator that converts a class property into a getter\n * that executes a querySelectorAll on the element's renderRoot.\n *\n * @param selector A DOMString containing one or more selectors to match.\n *\n * See:\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll\n *\n * @example\n * ```ts\n * class MyElement {\n * @queryAll('div')\n * divs;\n *\n * render() {\n * return html`\n * \n * \n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function queryAll(selector) {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n return this.renderRoot.querySelectorAll(selector);\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\nconst legacyQuery = (descriptor, proto, name) => {\n Object.defineProperty(proto, name, descriptor);\n};\nconst standardQuery = (descriptor, element) => ({\n kind: 'method',\n placement: 'prototype',\n key: element.key,\n descriptor,\n});\nconst standardEventOptions = (options, element) => {\n return Object.assign(Object.assign({}, element), { finisher(clazz) {\n Object.assign(clazz.prototype[element.key], options);\n } });\n};\nconst legacyEventOptions = \n// tslint:disable-next-line:no-any legacy decorator\n(options, proto, name) => {\n Object.assign(proto[name], options);\n};\n/**\n * Adds event listener options to a method used as an event listener in a\n * lit-html template.\n *\n * @param options An object that specifies event listener options as accepted by\n * `EventTarget#addEventListener` and `EventTarget#removeEventListener`.\n *\n * Current browsers support the `capture`, `passive`, and `once` options. See:\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters\n *\n * @example\n * ```ts\n * class MyElement {\n * clicked = false;\n *\n * render() {\n * return html`\n * \n * \n *
\n * `;\n * }\n *\n * @eventOptions({capture: true})\n * _onClick(e) {\n * this.clicked = true;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function eventOptions(options) {\n // Return value typed as any to prevent TypeScript from complaining that\n // standard decorator function signature does not match TypeScript decorator\n // signature\n // TODO(kschaaf): unclear why it was only failing on this decorator and not\n // the others\n return ((protoOrDescriptor, name) => (name !== undefined) ?\n legacyEventOptions(options, protoOrDescriptor, name) :\n standardEventOptions(options, protoOrDescriptor));\n}\n// x-browser support for matches\n// tslint:disable-next-line:no-any\nconst ElementProto = Element.prototype;\nconst legacyMatches = ElementProto.msMatchesSelector || ElementProto.webkitMatchesSelector;\n/**\n * A property decorator that converts a class property into a getter that\n * returns the `assignedNodes` of the given named `slot`. Note, the type of\n * this property should be annotated as `NodeListOf`.\n *\n * @param slotName A string name of the slot.\n * @param flatten A boolean which when true flattens the assigned nodes,\n * meaning any assigned nodes that are slot elements are replaced with their\n * assigned nodes.\n * @param selector A string which filters the results to elements that match\n * the given css selector.\n *\n * * @example\n * ```ts\n * class MyElement {\n * @queryAssignedNodes('list', true, '.item')\n * listItems;\n *\n * render() {\n * return html`\n * \n * `;\n * }\n * }\n * ```\n * @category Decorator\n */\nexport function queryAssignedNodes(slotName = '', flatten = false, selector = '') {\n return (protoOrDescriptor, \n // tslint:disable-next-line:no-any decorator\n name) => {\n const descriptor = {\n get() {\n const slotSelector = `slot${slotName ? `[name=${slotName}]` : ':not([name])'}`;\n const slot = this.renderRoot.querySelector(slotSelector);\n let nodes = slot && slot.assignedNodes({ flatten });\n if (nodes && selector) {\n nodes = nodes.filter((node) => node.nodeType === Node.ELEMENT_NODE &&\n // tslint:disable-next-line:no-any testing existence on older browsers\n (node.matches ?\n node.matches(selector) :\n legacyMatches.call(node, selector)));\n }\n return nodes;\n },\n enumerable: true,\n configurable: true,\n };\n return (name !== undefined) ?\n legacyQuery(descriptor, protoOrDescriptor, name) :\n standardQuery(descriptor, protoOrDescriptor);\n };\n}\n//# sourceMappingURL=decorators.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nvar _a;\n/**\n * Use this module if you want to create your own base class extending\n * [[UpdatingElement]].\n * @packageDocumentation\n */\n/*\n * When using Closure Compiler, JSCompiler_renameProperty(property, object) is\n * replaced at compile time by the munged name for object[property]. We cannot\n * alias this function, so we have to use a small shim that has the same\n * behavior when not compiling.\n */\nwindow.JSCompiler_renameProperty =\n (prop, _obj) => prop;\nexport const defaultConverter = {\n toAttribute(value, type) {\n switch (type) {\n case Boolean:\n return value ? '' : null;\n case Object:\n case Array:\n // if the value is `null` or `undefined` pass this through\n // to allow removing/no change behavior.\n return value == null ? value : JSON.stringify(value);\n }\n return value;\n },\n fromAttribute(value, type) {\n switch (type) {\n case Boolean:\n return value !== null;\n case Number:\n return value === null ? null : Number(value);\n case Object:\n case Array:\n // Type assert to adhere to Bazel's \"must type assert JSON parse\" rule.\n return JSON.parse(value);\n }\n return value;\n }\n};\n/**\n * Change function that returns true if `value` is different from `oldValue`.\n * This method is used as the default for a property's `hasChanged` function.\n */\nexport const notEqual = (value, old) => {\n // This ensures (old==NaN, value==NaN) always returns false\n return old !== value && (old === old || value === value);\n};\nconst defaultPropertyDeclaration = {\n attribute: true,\n type: String,\n converter: defaultConverter,\n reflect: false,\n hasChanged: notEqual\n};\nconst STATE_HAS_UPDATED = 1;\nconst STATE_UPDATE_REQUESTED = 1 << 2;\nconst STATE_IS_REFLECTING_TO_ATTRIBUTE = 1 << 3;\nconst STATE_IS_REFLECTING_TO_PROPERTY = 1 << 4;\n/**\n * The Closure JS Compiler doesn't currently have good support for static\n * property semantics where \"this\" is dynamic (e.g.\n * https://github.com/google/closure-compiler/issues/3177 and others) so we use\n * this hack to bypass any rewriting by the compiler.\n */\nconst finalized = 'finalized';\n/**\n * Base element class which manages element properties and attributes. When\n * properties change, the `update` method is asynchronously called. This method\n * should be supplied by subclassers to render updates as desired.\n * @noInheritDoc\n */\nexport class UpdatingElement extends HTMLElement {\n constructor() {\n super();\n this.initialize();\n }\n /**\n * Returns a list of attributes corresponding to the registered properties.\n * @nocollapse\n */\n static get observedAttributes() {\n // note: piggy backing on this to ensure we're finalized.\n this.finalize();\n const attributes = [];\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this._classProperties.forEach((v, p) => {\n const attr = this._attributeNameForProperty(p, v);\n if (attr !== undefined) {\n this._attributeToPropertyMap.set(attr, p);\n attributes.push(attr);\n }\n });\n return attributes;\n }\n /**\n * Ensures the private `_classProperties` property metadata is created.\n * In addition to `finalize` this is also called in `createProperty` to\n * ensure the `@property` decorator can add property metadata.\n */\n /** @nocollapse */\n static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }\n /**\n * Creates a property accessor on the element prototype if one does not exist\n * and stores a PropertyDeclaration for the property with the given options.\n * The property setter calls the property's `hasChanged` property option\n * or uses a strict identity check to determine whether or not to request\n * an update.\n *\n * This method may be overridden to customize properties; however,\n * when doing so, it's important to call `super.createProperty` to ensure\n * the property is setup correctly. This method calls\n * `getPropertyDescriptor` internally to get a descriptor to install.\n * To customize what properties do when they are get or set, override\n * `getPropertyDescriptor`. To customize the options for a property,\n * implement `createProperty` like this:\n *\n * static createProperty(name, options) {\n * options = Object.assign(options, {myOption: true});\n * super.createProperty(name, options);\n * }\n *\n * @nocollapse\n */\n static createProperty(name, options = defaultPropertyDeclaration) {\n // Note, since this can be called by the `@property` decorator which\n // is called before `finalize`, we ensure storage exists for property\n // metadata.\n this._ensureClassProperties();\n this._classProperties.set(name, options);\n // Do not generate an accessor if the prototype already has one, since\n // it would be lost otherwise and that would never be the user's intention;\n // Instead, we expect users to call `requestUpdate` themselves from\n // user-defined accessors. Note that if the super has an accessor we will\n // still overwrite it\n if (options.noAccessor || this.prototype.hasOwnProperty(name)) {\n return;\n }\n const key = typeof name === 'symbol' ? Symbol() : `__${name}`;\n const descriptor = this.getPropertyDescriptor(name, key, options);\n if (descriptor !== undefined) {\n Object.defineProperty(this.prototype, name, descriptor);\n }\n }\n /**\n * Returns a property descriptor to be defined on the given named property.\n * If no descriptor is returned, the property will not become an accessor.\n * For example,\n *\n * class MyElement extends LitElement {\n * static getPropertyDescriptor(name, key, options) {\n * const defaultDescriptor =\n * super.getPropertyDescriptor(name, key, options);\n * const setter = defaultDescriptor.set;\n * return {\n * get: defaultDescriptor.get,\n * set(value) {\n * setter.call(this, value);\n * // custom action.\n * },\n * configurable: true,\n * enumerable: true\n * }\n * }\n * }\n *\n * @nocollapse\n */\n static getPropertyDescriptor(name, key, options) {\n return {\n // tslint:disable-next-line:no-any no symbol in index\n get() {\n return this[key];\n },\n set(value) {\n const oldValue = this[name];\n this[key] = value;\n this\n .requestUpdateInternal(name, oldValue, options);\n },\n configurable: true,\n enumerable: true\n };\n }\n /**\n * Returns the property options associated with the given property.\n * These options are defined with a PropertyDeclaration via the `properties`\n * object or the `@property` decorator and are registered in\n * `createProperty(...)`.\n *\n * Note, this method should be considered \"final\" and not overridden. To\n * customize the options for a given property, override `createProperty`.\n *\n * @nocollapse\n * @final\n */\n static getPropertyOptions(name) {\n return this._classProperties && this._classProperties.get(name) ||\n defaultPropertyDeclaration;\n }\n /**\n * Creates property accessors for registered properties and ensures\n * any superclasses are also finalized.\n * @nocollapse\n */\n static finalize() {\n // finalize any superclasses\n const superCtor = Object.getPrototypeOf(this);\n if (!superCtor.hasOwnProperty(finalized)) {\n superCtor.finalize();\n }\n this[finalized] = true;\n this._ensureClassProperties();\n // initialize Map populated in observedAttributes\n this._attributeToPropertyMap = new Map();\n // make any properties\n // Note, only process \"own\" properties since this element will inherit\n // any properties defined on the superClass, and finalization ensures\n // the entire prototype chain is finalized.\n if (this.hasOwnProperty(JSCompiler_renameProperty('properties', this))) {\n const props = this.properties;\n // support symbols in properties (IE11 does not support this)\n const propKeys = [\n ...Object.getOwnPropertyNames(props),\n ...(typeof Object.getOwnPropertySymbols === 'function') ?\n Object.getOwnPropertySymbols(props) :\n []\n ];\n // This for/of is ok because propKeys is an array\n for (const p of propKeys) {\n // note, use of `any` is due to TypeSript lack of support for symbol in\n // index types\n // tslint:disable-next-line:no-any no symbol in index\n this.createProperty(p, props[p]);\n }\n }\n }\n /**\n * Returns the property name for the given attribute `name`.\n * @nocollapse\n */\n static _attributeNameForProperty(name, options) {\n const attribute = options.attribute;\n return attribute === false ?\n undefined :\n (typeof attribute === 'string' ?\n attribute :\n (typeof name === 'string' ? name.toLowerCase() : undefined));\n }\n /**\n * Returns true if a property should request an update.\n * Called when a property value is set and uses the `hasChanged`\n * option for the property if present or a strict identity check.\n * @nocollapse\n */\n static _valueHasChanged(value, old, hasChanged = notEqual) {\n return hasChanged(value, old);\n }\n /**\n * Returns the property value for the given attribute value.\n * Called via the `attributeChangedCallback` and uses the property's\n * `converter` or `converter.fromAttribute` property option.\n * @nocollapse\n */\n static _propertyValueFromAttribute(value, options) {\n const type = options.type;\n const converter = options.converter || defaultConverter;\n const fromAttribute = (typeof converter === 'function' ? converter : converter.fromAttribute);\n return fromAttribute ? fromAttribute(value, type) : value;\n }\n /**\n * Returns the attribute value for the given property value. If this\n * returns undefined, the property will *not* be reflected to an attribute.\n * If this returns null, the attribute will be removed, otherwise the\n * attribute will be set to the value.\n * This uses the property's `reflect` and `type.toAttribute` property options.\n * @nocollapse\n */\n static _propertyValueToAttribute(value, options) {\n if (options.reflect === undefined) {\n return;\n }\n const type = options.type;\n const converter = options.converter;\n const toAttribute = converter && converter.toAttribute ||\n defaultConverter.toAttribute;\n return toAttribute(value, type);\n }\n /**\n * Performs element initialization. By default captures any pre-set values for\n * registered properties.\n */\n initialize() {\n this._updateState = 0;\n this._updatePromise =\n new Promise((res) => this._enableUpdatingResolver = res);\n this._changedProperties = new Map();\n this._saveInstanceProperties();\n // ensures first update will be caught by an early access of\n // `updateComplete`\n this.requestUpdateInternal();\n }\n /**\n * Fixes any properties set on the instance before upgrade time.\n * Otherwise these would shadow the accessor and break these properties.\n * The properties are stored in a Map which is played back after the\n * constructor runs. Note, on very old versions of Safari (<=9) or Chrome\n * (<=41), properties created for native platform properties like (`id` or\n * `name`) may not have default values set in the element constructor. On\n * these browsers native properties appear on instances and therefore their\n * default value will overwrite any element default (e.g. if the element sets\n * this.id = 'id' in the constructor, the 'id' will become '' since this is\n * the native platform default).\n */\n _saveInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n this.constructor\n ._classProperties.forEach((_v, p) => {\n if (this.hasOwnProperty(p)) {\n const value = this[p];\n delete this[p];\n if (!this._instanceProperties) {\n this._instanceProperties = new Map();\n }\n this._instanceProperties.set(p, value);\n }\n });\n }\n /**\n * Applies previously saved instance properties.\n */\n _applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }\n connectedCallback() {\n // Ensure first connection completes an update. Updates cannot complete\n // before connection.\n this.enableUpdating();\n }\n enableUpdating() {\n if (this._enableUpdatingResolver !== undefined) {\n this._enableUpdatingResolver();\n this._enableUpdatingResolver = undefined;\n }\n }\n /**\n * Allows for `super.disconnectedCallback()` in extensions while\n * reserving the possibility of making non-breaking feature additions\n * when disconnecting at some point in the future.\n */\n disconnectedCallback() {\n }\n /**\n * Synchronizes property values when attributes change.\n */\n attributeChangedCallback(name, old, value) {\n if (old !== value) {\n this._attributeToProperty(name, value);\n }\n }\n _propertyToAttribute(name, value, options = defaultPropertyDeclaration) {\n const ctor = this.constructor;\n const attr = ctor._attributeNameForProperty(name, options);\n if (attr !== undefined) {\n const attrValue = ctor._propertyValueToAttribute(value, options);\n // an undefined value does not change the attribute.\n if (attrValue === undefined) {\n return;\n }\n // Track if the property is being reflected to avoid\n // setting the property again via `attributeChangedCallback`. Note:\n // 1. this takes advantage of the fact that the callback is synchronous.\n // 2. will behave incorrectly if multiple attributes are in the reaction\n // stack at time of calling. However, since we process attributes\n // in `update` this should not be possible (or an extreme corner case\n // that we'd like to discover).\n // mark state reflecting\n this._updateState = this._updateState | STATE_IS_REFLECTING_TO_ATTRIBUTE;\n if (attrValue == null) {\n this.removeAttribute(attr);\n }\n else {\n this.setAttribute(attr, attrValue);\n }\n // mark state not reflecting\n this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_ATTRIBUTE;\n }\n }\n _attributeToProperty(name, value) {\n // Use tracking info to avoid deserializing attribute value if it was\n // just set from a property setter.\n if (this._updateState & STATE_IS_REFLECTING_TO_ATTRIBUTE) {\n return;\n }\n const ctor = this.constructor;\n // Note, hint this as an `AttributeMap` so closure clearly understands\n // the type; it has issues with tracking types through statics\n // tslint:disable-next-line:no-unnecessary-type-assertion\n const propName = ctor._attributeToPropertyMap.get(name);\n if (propName !== undefined) {\n const options = ctor.getPropertyOptions(propName);\n // mark state reflecting\n this._updateState = this._updateState | STATE_IS_REFLECTING_TO_PROPERTY;\n this[propName] =\n // tslint:disable-next-line:no-any\n ctor._propertyValueFromAttribute(value, options);\n // mark state not reflecting\n this._updateState = this._updateState & ~STATE_IS_REFLECTING_TO_PROPERTY;\n }\n }\n /**\n * This protected version of `requestUpdate` does not access or return the\n * `updateComplete` promise. This promise can be overridden and is therefore\n * not free to access.\n */\n requestUpdateInternal(name, oldValue, options) {\n let shouldRequestUpdate = true;\n // If we have a property key, perform property update steps.\n if (name !== undefined) {\n const ctor = this.constructor;\n options = options || ctor.getPropertyOptions(name);\n if (ctor._valueHasChanged(this[name], oldValue, options.hasChanged)) {\n if (!this._changedProperties.has(name)) {\n this._changedProperties.set(name, oldValue);\n }\n // Add to reflecting properties set.\n // Note, it's important that every change has a chance to add the\n // property to `_reflectingProperties`. This ensures setting\n // attribute + property reflects correctly.\n if (options.reflect === true &&\n !(this._updateState & STATE_IS_REFLECTING_TO_PROPERTY)) {\n if (this._reflectingProperties === undefined) {\n this._reflectingProperties = new Map();\n }\n this._reflectingProperties.set(name, options);\n }\n }\n else {\n // Abort the request if the property should not be considered changed.\n shouldRequestUpdate = false;\n }\n }\n if (!this._hasRequestedUpdate && shouldRequestUpdate) {\n this._updatePromise = this._enqueueUpdate();\n }\n }\n /**\n * Requests an update which is processed asynchronously. This should\n * be called when an element should update based on some state not triggered\n * by setting a property. In this case, pass no arguments. It should also be\n * called when manually implementing a property setter. In this case, pass the\n * property `name` and `oldValue` to ensure that any configured property\n * options are honored. Returns the `updateComplete` Promise which is resolved\n * when the update completes.\n *\n * @param name {PropertyKey} (optional) name of requesting property\n * @param oldValue {any} (optional) old value of requesting property\n * @returns {Promise} A Promise that is resolved when the update completes.\n */\n requestUpdate(name, oldValue) {\n this.requestUpdateInternal(name, oldValue);\n return this.updateComplete;\n }\n /**\n * Sets up the element to asynchronously update.\n */\n async _enqueueUpdate() {\n this._updateState = this._updateState | STATE_UPDATE_REQUESTED;\n try {\n // Ensure any previous update has resolved before updating.\n // This `await` also ensures that property changes are batched.\n await this._updatePromise;\n }\n catch (e) {\n // Ignore any previous errors. We only care that the previous cycle is\n // done. Any error should have been handled in the previous update.\n }\n const result = this.performUpdate();\n // If `performUpdate` returns a Promise, we await it. This is done to\n // enable coordinating updates with a scheduler. Note, the result is\n // checked to avoid delaying an additional microtask unless we need to.\n if (result != null) {\n await result;\n }\n return !this._hasRequestedUpdate;\n }\n get _hasRequestedUpdate() {\n return (this._updateState & STATE_UPDATE_REQUESTED);\n }\n get hasUpdated() {\n return (this._updateState & STATE_HAS_UPDATED);\n }\n /**\n * Performs an element update. Note, if an exception is thrown during the\n * update, `firstUpdated` and `updated` will not be called.\n *\n * You can override this method to change the timing of updates. If this\n * method is overridden, `super.performUpdate()` must be called.\n *\n * For instance, to schedule updates to occur just before the next frame:\n *\n * ```\n * protected async performUpdate(): Promise {\n * await new Promise((resolve) => requestAnimationFrame(() => resolve()));\n * super.performUpdate();\n * }\n * ```\n */\n performUpdate() {\n // Abort any update if one is not pending when this is called.\n // This can happen if `performUpdate` is called early to \"flush\"\n // the update.\n if (!this._hasRequestedUpdate) {\n return;\n }\n // Mixin instance properties once, if they exist.\n if (this._instanceProperties) {\n this._applyInstanceProperties();\n }\n let shouldUpdate = false;\n const changedProperties = this._changedProperties;\n try {\n shouldUpdate = this.shouldUpdate(changedProperties);\n if (shouldUpdate) {\n this.update(changedProperties);\n }\n else {\n this._markUpdated();\n }\n }\n catch (e) {\n // Prevent `firstUpdated` and `updated` from running when there's an\n // update exception.\n shouldUpdate = false;\n // Ensure element can accept additional updates after an exception.\n this._markUpdated();\n throw e;\n }\n if (shouldUpdate) {\n if (!(this._updateState & STATE_HAS_UPDATED)) {\n this._updateState = this._updateState | STATE_HAS_UPDATED;\n this.firstUpdated(changedProperties);\n }\n this.updated(changedProperties);\n }\n }\n _markUpdated() {\n this._changedProperties = new Map();\n this._updateState = this._updateState & ~STATE_UPDATE_REQUESTED;\n }\n /**\n * Returns a Promise that resolves when the element has completed updating.\n * The Promise value is a boolean that is `true` if the element completed the\n * update without triggering another update. The Promise result is `false` if\n * a property was set inside `updated()`. If the Promise is rejected, an\n * exception was thrown during the update.\n *\n * To await additional asynchronous work, override the `_getUpdateComplete`\n * method. For example, it is sometimes useful to await a rendered element\n * before fulfilling this Promise. To do this, first await\n * `super._getUpdateComplete()`, then any subsequent state.\n *\n * @returns {Promise} The Promise returns a boolean that indicates if the\n * update resolved without triggering another update.\n */\n get updateComplete() {\n return this._getUpdateComplete();\n }\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * class MyElement extends LitElement {\n * async _getUpdateComplete() {\n * await super._getUpdateComplete();\n * await this._myChild.updateComplete;\n * }\n * }\n * @deprecated Override `getUpdateComplete()` instead for forward\n * compatibility with `lit-element` 3.0 / `@lit/reactive-element`.\n */\n _getUpdateComplete() {\n return this.getUpdateComplete();\n }\n /**\n * Override point for the `updateComplete` promise.\n *\n * It is not safe to override the `updateComplete` getter directly due to a\n * limitation in TypeScript which means it is not possible to call a\n * superclass getter (e.g. `super.updateComplete.then(...)`) when the target\n * language is ES5 (https://github.com/microsoft/TypeScript/issues/338).\n * This method should be overridden instead. For example:\n *\n * class MyElement extends LitElement {\n * async getUpdateComplete() {\n * await super.getUpdateComplete();\n * await this._myChild.updateComplete;\n * }\n * }\n */\n getUpdateComplete() {\n return this._updatePromise;\n }\n /**\n * Controls whether or not `update` should be called when the element requests\n * an update. By default, this method always returns `true`, but this can be\n * customized to control when to update.\n *\n * @param _changedProperties Map of changed properties with old values\n */\n shouldUpdate(_changedProperties) {\n return true;\n }\n /**\n * Updates the element. This method reflects property values to attributes.\n * It can be overridden to render and keep updated element DOM.\n * Setting properties inside this method will *not* trigger\n * another update.\n *\n * @param _changedProperties Map of changed properties with old values\n */\n update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\n // Use forEach so this works even if for/of loops are compiled to for\n // loops expecting arrays\n this._reflectingProperties.forEach((v, k) => this._propertyToAttribute(k, this[k], v));\n this._reflectingProperties = undefined;\n }\n this._markUpdated();\n }\n /**\n * Invoked whenever the element is updated. Implement to perform\n * post-updating tasks via DOM APIs, for example, focusing an element.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n */\n updated(_changedProperties) {\n }\n /**\n * Invoked when the element is first updated. Implement to perform one time\n * work on the element after update.\n *\n * Setting properties inside this method will trigger the element to update\n * again after this update cycle completes.\n *\n * @param _changedProperties Map of changed properties with old values\n */\n firstUpdated(_changedProperties) {\n }\n}\n_a = finalized;\n/**\n * Marks class as having finished creating properties.\n */\nUpdatingElement[_a] = true;\n//# sourceMappingURL=updating-element.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * The main LitElement module, which defines the [[`LitElement`]] base class and\n * related APIs.\n *\n * LitElement components can define a template and a set of observed\n * properties. Changing an observed property triggers a re-render of the\n * element.\n *\n * Import [[`LitElement`]] and [[`html`]] from this module to create a\n * component:\n *\n * ```js\n * import {LitElement, html} from 'lit-element';\n *\n * class MyElement extends LitElement {\n *\n * // Declare observed properties\n * static get properties() {\n * return {\n * adjective: {}\n * }\n * }\n *\n * constructor() {\n * this.adjective = 'awesome';\n * }\n *\n * // Define the element's template\n * render() {\n * return html`your ${adjective} template here
`;\n * }\n * }\n *\n * customElements.define('my-element', MyElement);\n * ```\n *\n * `LitElement` extends [[`UpdatingElement`]] and adds lit-html templating.\n * The `UpdatingElement` class is provided for users that want to build\n * their own custom element base classes that don't use lit-html.\n *\n * @packageDocumentation\n */\nimport { render } from 'lit-html/lib/shady-render.js';\nimport { UpdatingElement } from './lib/updating-element.js';\nexport * from './lib/updating-element.js';\nexport { UpdatingElement as ReactiveElement } from './lib/updating-element.js';\nexport * from './lib/decorators.js';\nexport { html, svg, TemplateResult, SVGTemplateResult } from 'lit-html/lit-html.js';\nimport { supportsAdoptingStyleSheets, unsafeCSS } from './lib/css-tag.js';\nexport * from './lib/css-tag.js';\n// IMPORTANT: do not change the property name or the assignment expression.\n// This line will be used in regexes to search for LitElement usage.\n// TODO(justinfagnani): inject version number at build time\n(window['litElementVersions'] || (window['litElementVersions'] = []))\n .push('2.5.1');\n/**\n * Sentinal value used to avoid calling lit-html's render function when\n * subclasses do not implement `render`\n */\nconst renderNotImplemented = {};\n/**\n * Base element class that manages element properties and attributes, and\n * renders a lit-html template.\n *\n * To define a component, subclass `LitElement` and implement a\n * `render` method to provide the component's template. Define properties\n * using the [[`properties`]] property or the [[`property`]] decorator.\n */\nexport class LitElement extends UpdatingElement {\n /**\n * Return the array of styles to apply to the element.\n * Override this method to integrate into a style management system.\n *\n * @nocollapse\n */\n static getStyles() {\n return this.styles;\n }\n /** @nocollapse */\n static _getUniqueStyles() {\n // Only gather styles once per class\n if (this.hasOwnProperty(JSCompiler_renameProperty('_styles', this))) {\n return;\n }\n // Take care not to call `this.getStyles()` multiple times since this\n // generates new CSSResults each time.\n // TODO(sorvell): Since we do not cache CSSResults by input, any\n // shared styles will generate new stylesheet objects, which is wasteful.\n // This should be addressed when a browser ships constructable\n // stylesheets.\n const userStyles = this.getStyles();\n if (Array.isArray(userStyles)) {\n // De-duplicate styles preserving the _last_ instance in the set.\n // This is a performance optimization to avoid duplicated styles that can\n // occur especially when composing via subclassing.\n // The last item is kept to try to preserve the cascade order with the\n // assumption that it's most important that last added styles override\n // previous styles.\n const addStyles = (styles, set) => styles.reduceRight((set, s) => \n // Note: On IE set.add() does not return the set\n Array.isArray(s) ? addStyles(s, set) : (set.add(s), set), set);\n // Array.from does not work on Set in IE, otherwise return\n // Array.from(addStyles(userStyles, new Set())).reverse()\n const set = addStyles(userStyles, new Set());\n const styles = [];\n set.forEach((v) => styles.unshift(v));\n this._styles = styles;\n }\n else {\n this._styles = userStyles === undefined ? [] : [userStyles];\n }\n // Ensure that there are no invalid CSSStyleSheet instances here. They are\n // invalid in two conditions.\n // (1) the sheet is non-constructible (`sheet` of a HTMLStyleElement), but\n // this is impossible to check except via .replaceSync or use\n // (2) the ShadyCSS polyfill is enabled (:. supportsAdoptingStyleSheets is\n // false)\n this._styles = this._styles.map((s) => {\n if (s instanceof CSSStyleSheet && !supportsAdoptingStyleSheets) {\n // Flatten the cssText from the passed constructible stylesheet (or\n // undetectable non-constructible stylesheet). The user might have\n // expected to update their stylesheets over time, but the alternative\n // is a crash.\n const cssText = Array.prototype.slice.call(s.cssRules)\n .reduce((css, rule) => css + rule.cssText, '');\n return unsafeCSS(cssText);\n }\n return s;\n });\n }\n /**\n * Performs element initialization. By default this calls\n * [[`createRenderRoot`]] to create the element [[`renderRoot`]] node and\n * captures any pre-set values for registered properties.\n */\n initialize() {\n super.initialize();\n this.constructor._getUniqueStyles();\n this.renderRoot = this.createRenderRoot();\n // Note, if renderRoot is not a shadowRoot, styles would/could apply to the\n // element's getRootNode(). While this could be done, we're choosing not to\n // support this now since it would require different logic around de-duping.\n if (window.ShadowRoot && this.renderRoot instanceof window.ShadowRoot) {\n this.adoptStyles();\n }\n }\n /**\n * Returns the node into which the element should render and by default\n * creates and returns an open shadowRoot. Implement to customize where the\n * element's DOM is rendered. For example, to render into the element's\n * childNodes, return `this`.\n * @returns {Element|DocumentFragment} Returns a node into which to render.\n */\n createRenderRoot() {\n return this.attachShadow(this.constructor.shadowRootOptions);\n }\n /**\n * Applies styling to the element shadowRoot using the [[`styles`]]\n * property. Styling will apply using `shadowRoot.adoptedStyleSheets` where\n * available and will fallback otherwise. When Shadow DOM is polyfilled,\n * ShadyCSS scopes styles and adds them to the document. When Shadow DOM\n * is available but `adoptedStyleSheets` is not, styles are appended to the\n * end of the `shadowRoot` to [mimic spec\n * behavior](https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets).\n */\n adoptStyles() {\n const styles = this.constructor._styles;\n if (styles.length === 0) {\n return;\n }\n // There are three separate cases here based on Shadow DOM support.\n // (1) shadowRoot polyfilled: use ShadyCSS\n // (2) shadowRoot.adoptedStyleSheets available: use it\n // (3) shadowRoot.adoptedStyleSheets polyfilled: append styles after\n // rendering\n if (window.ShadyCSS !== undefined && !window.ShadyCSS.nativeShadow) {\n window.ShadyCSS.ScopingShim.prepareAdoptedCssText(styles.map((s) => s.cssText), this.localName);\n }\n else if (supportsAdoptingStyleSheets) {\n this.renderRoot.adoptedStyleSheets =\n styles.map((s) => s instanceof CSSStyleSheet ? s : s.styleSheet);\n }\n else {\n // This must be done after rendering so the actual style insertion is done\n // in `update`.\n this._needsShimAdoptedStyleSheets = true;\n }\n }\n connectedCallback() {\n super.connectedCallback();\n // Note, first update/render handles styleElement so we only call this if\n // connected after first update.\n if (this.hasUpdated && window.ShadyCSS !== undefined) {\n window.ShadyCSS.styleElement(this);\n }\n }\n /**\n * Updates the element. This method reflects property values to attributes\n * and calls `render` to render DOM via lit-html. Setting properties inside\n * this method will *not* trigger another update.\n * @param _changedProperties Map of changed properties with old values\n */\n update(changedProperties) {\n // Setting properties in `render` should not trigger an update. Since\n // updates are allowed after super.update, it's important to call `render`\n // before that.\n const templateResult = this.render();\n super.update(changedProperties);\n // If render is not implemented by the component, don't call lit-html render\n if (templateResult !== renderNotImplemented) {\n this.constructor\n .render(templateResult, this.renderRoot, { scopeName: this.localName, eventContext: this });\n }\n // When native Shadow DOM is used but adoptedStyles are not supported,\n // insert styling after rendering to ensure adoptedStyles have highest\n // priority.\n if (this._needsShimAdoptedStyleSheets) {\n this._needsShimAdoptedStyleSheets = false;\n this.constructor._styles.forEach((s) => {\n const style = document.createElement('style');\n style.textContent = s.cssText;\n this.renderRoot.appendChild(style);\n });\n }\n }\n /**\n * Invoked on each update to perform rendering tasks. This method may return\n * any value renderable by lit-html's `NodePart` - typically a\n * `TemplateResult`. Setting properties inside this method will *not* trigger\n * the element to update.\n */\n render() {\n return renderNotImplemented;\n }\n}\n/**\n * Ensure this class is marked as `finalized` as an optimization ensuring\n * it will not needlessly try to `finalize`.\n *\n * Note this property name is a string to prevent breaking Closure JS Compiler\n * optimizations. See updating-element.ts for more information.\n */\nLitElement['finalized'] = true;\n/**\n * Reference to the underlying library method used to render the element's\n * DOM. By default, points to the `render` method from lit-html's shady-render\n * module.\n *\n * **Most users will never need to touch this property.**\n *\n * This property should not be confused with the `render` instance method,\n * which should be overridden to define a template for the element.\n *\n * Advanced users creating a new base class based on LitElement can override\n * this property to point to a custom render method with a signature that\n * matches [shady-render's `render`\n * method](https://lit-html.polymer-project.org/api/modules/shady_render.html#render).\n *\n * @nocollapse\n */\nLitElement.render = render;\n/** @nocollapse */\nLitElement.shadowRootOptions = { mode: 'open' };\n//# sourceMappingURL=lit-element.js.map","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributePart, directive, PropertyPart } from '../lit-html.js';\n// IE11 doesn't support classList on SVG elements, so we emulate it with a Set\nclass ClassList {\n constructor(element) {\n this.classes = new Set();\n this.changed = false;\n this.element = element;\n const classList = (element.getAttribute('class') || '').split(/\\s+/);\n for (const cls of classList) {\n this.classes.add(cls);\n }\n }\n add(cls) {\n this.classes.add(cls);\n this.changed = true;\n }\n remove(cls) {\n this.classes.delete(cls);\n this.changed = true;\n }\n commit() {\n if (this.changed) {\n let classString = '';\n this.classes.forEach((cls) => classString += cls + ' ');\n this.element.setAttribute('class', classString);\n }\n }\n}\n/**\n * Stores the ClassInfo object applied to a given AttributePart.\n * Used to unset existing values when a new ClassInfo object is applied.\n */\nconst previousClassesCache = new WeakMap();\n/**\n * A directive that applies CSS classes. This must be used in the `class`\n * attribute and must be the only part used in the attribute. It takes each\n * property in the `classInfo` argument and adds the property name to the\n * element's `class` if the property value is truthy; if the property value is\n * falsey, the property name is removed from the element's `class`. For example\n * `{foo: bar}` applies the class `foo` if the value of `bar` is truthy.\n * @param classInfo {ClassInfo}\n */\nexport const classMap = directive((classInfo) => (part) => {\n if (!(part instanceof AttributePart) || (part instanceof PropertyPart) ||\n part.committer.name !== 'class' || part.committer.parts.length > 1) {\n throw new Error('The `classMap` directive must be used in the `class` attribute ' +\n 'and must be the only part in the attribute.');\n }\n const { committer } = part;\n const { element } = committer;\n let previousClasses = previousClassesCache.get(part);\n if (previousClasses === undefined) {\n // Write static classes once\n // Use setAttribute() because className isn't a string on SVG elements\n element.setAttribute('class', committer.strings.join(' '));\n previousClassesCache.set(part, previousClasses = new Set());\n }\n const classList = (element.classList || new ClassList(element));\n // Remove old classes that no longer apply\n // We use forEach() instead of for-of so that re don't require down-level\n // iteration.\n previousClasses.forEach((name) => {\n if (!(name in classInfo)) {\n classList.remove(name);\n previousClasses.delete(name);\n }\n });\n // Add or remove classes based on their classMap value\n for (const name in classInfo) {\n const value = classInfo[name];\n if (value != previousClasses.has(name)) {\n // We explicitly want a loose truthy check of `value` because it seems\n // more convenient that '' and 0 are skipped.\n if (value) {\n classList.add(name);\n previousClasses.add(name);\n }\n else {\n classList.remove(name);\n previousClasses.delete(name);\n }\n }\n }\n if (typeof classList.commit === 'function') {\n classList.commit();\n }\n});\n//# sourceMappingURL=class-map.js.map","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributePart, directive } from '../lit-html.js';\nconst previousValues = new WeakMap();\n/**\n * For AttributeParts, sets the attribute if the value is defined and removes\n * the attribute if the value is undefined.\n *\n * For other part types, this directive is a no-op.\n */\nexport const ifDefined = directive((value) => (part) => {\n const previousValue = previousValues.get(part);\n if (value === undefined && part instanceof AttributePart) {\n // If the value is undefined, remove the attribute, but only if the value\n // was previously defined.\n if (previousValue !== undefined || !previousValues.has(part)) {\n const name = part.committer.name;\n part.committer.element.removeAttribute(name);\n }\n }\n else if (value !== previousValue) {\n part.setValue(value);\n }\n previousValues.set(part, value);\n});\n//# sourceMappingURL=if-defined.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { createMarker, directive, NodePart, removeNodes, reparentNodes } from '../lit-html.js';\n// Helper functions for manipulating parts\n// TODO(kschaaf): Refactor into Part API?\nconst createAndInsertPart = (containerPart, beforePart) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = beforePart === undefined ? containerPart.endNode :\n beforePart.startNode;\n const startNode = container.insertBefore(createMarker(), beforeNode);\n container.insertBefore(createMarker(), beforeNode);\n const newPart = new NodePart(containerPart.options);\n newPart.insertAfterNode(startNode);\n return newPart;\n};\nconst updatePart = (part, value) => {\n part.setValue(value);\n part.commit();\n return part;\n};\nconst insertPartBefore = (containerPart, part, ref) => {\n const container = containerPart.startNode.parentNode;\n const beforeNode = ref ? ref.startNode : containerPart.endNode;\n const endNode = part.endNode.nextSibling;\n if (endNode !== beforeNode) {\n reparentNodes(container, part.startNode, endNode, beforeNode);\n }\n};\nconst removePart = (part) => {\n removeNodes(part.startNode.parentNode, part.startNode, part.endNode.nextSibling);\n};\n// Helper for generating a map of array item to its index over a subset\n// of an array (used to lazily generate `newKeyToIndexMap` and\n// `oldKeyToIndexMap`)\nconst generateMap = (list, start, end) => {\n const map = new Map();\n for (let i = start; i <= end; i++) {\n map.set(list[i], i);\n }\n return map;\n};\n// Stores previous ordered list of parts and map of key to index\nconst partListCache = new WeakMap();\nconst keyListCache = new WeakMap();\n/**\n * A directive that repeats a series of values (usually `TemplateResults`)\n * generated from an iterable, and updates those items efficiently when the\n * iterable changes based on user-provided `keys` associated with each item.\n *\n * Note that if a `keyFn` is provided, strict key-to-DOM mapping is maintained,\n * meaning previous DOM for a given key is moved into the new position if\n * needed, and DOM will never be reused with values for different keys (new DOM\n * will always be created for new keys). This is generally the most efficient\n * way to use `repeat` since it performs minimum unnecessary work for insertions\n * and removals.\n *\n * IMPORTANT: If providing a `keyFn`, keys *must* be unique for all items in a\n * given call to `repeat`. The behavior when two or more items have the same key\n * is undefined.\n *\n * If no `keyFn` is provided, this directive will perform similar to mapping\n * items to values, and DOM will be reused against potentially different items.\n */\nexport const repeat = directive((items, keyFnOrTemplate, template) => {\n let keyFn;\n if (template === undefined) {\n template = keyFnOrTemplate;\n }\n else if (keyFnOrTemplate !== undefined) {\n keyFn = keyFnOrTemplate;\n }\n return (containerPart) => {\n if (!(containerPart instanceof NodePart)) {\n throw new Error('repeat can only be used in text bindings');\n }\n // Old part & key lists are retrieved from the last update\n // (associated with the part for this instance of the directive)\n const oldParts = partListCache.get(containerPart) || [];\n const oldKeys = keyListCache.get(containerPart) || [];\n // New part list will be built up as we go (either reused from\n // old parts or created for new keys in this update). This is\n // saved in the above cache at the end of the update.\n const newParts = [];\n // New value list is eagerly generated from items along with a\n // parallel array indicating its key.\n const newValues = [];\n const newKeys = [];\n let index = 0;\n for (const item of items) {\n newKeys[index] = keyFn ? keyFn(item, index) : index;\n newValues[index] = template(item, index);\n index++;\n }\n // Maps from key to index for current and previous update; these\n // are generated lazily only when needed as a performance\n // optimization, since they are only required for multiple\n // non-contiguous changes in the list, which are less common.\n let newKeyToIndexMap;\n let oldKeyToIndexMap;\n // Head and tail pointers to old parts and new values\n let oldHead = 0;\n let oldTail = oldParts.length - 1;\n let newHead = 0;\n let newTail = newValues.length - 1;\n // Overview of O(n) reconciliation algorithm (general approach\n // based on ideas found in ivi, vue, snabbdom, etc.):\n //\n // * We start with the list of old parts and new values (and\n // arrays of their respective keys), head/tail pointers into\n // each, and we build up the new list of parts by updating\n // (and when needed, moving) old parts or creating new ones.\n // The initial scenario might look like this (for brevity of\n // the diagrams, the numbers in the array reflect keys\n // associated with the old parts or new values, although keys\n // and parts/values are actually stored in parallel arrays\n // indexed using the same head/tail pointers):\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [ , , , , , , ]\n // newKeys: [0, 2, 1, 4, 3, 7, 6] <- reflects the user's new\n // item order\n // newHead ^ ^ newTail\n //\n // * Iterate old & new lists from both sides, updating,\n // swapping, or removing parts at the head/tail locations\n // until neither head nor tail can move.\n //\n // * Example below: keys at head pointers match, so update old\n // part 0 in-place (no need to move it) and record part 0 in\n // the `newParts` list. The last thing we do is advance the\n // `oldHead` and `newHead` pointers (will be reflected in the\n // next diagram).\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , ] <- heads matched: update 0\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: head pointers don't match, but tail\n // pointers do, so update part 6 in place (no need to move\n // it), and record part 6 in the `newParts` list. Last,\n // advance the `oldTail` and `oldHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- tails matched: update 6\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldTail\n // & newTail\n // newHead ^ ^ newTail\n //\n // * If neither head nor tail match; next check if one of the\n // old head/tail items was removed. We first need to generate\n // the reverse map of new keys to index (`newKeyToIndexMap`),\n // which is done once lazily as a performance optimization,\n // since we only hit this case if multiple non-contiguous\n // changes were made. Note that for contiguous removal\n // anywhere in the list, the head and tails would advance\n // from either end and pass each other before we get to this\n // case and removals would be handled in the final while loop\n // without needing to generate the map.\n //\n // * Example below: The key at `oldTail` was removed (no longer\n // in the `newKeyToIndexMap`), so remove that part from the\n // DOM and advance just the `oldTail` pointer.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, 2, 3, 4, 5, 6]\n // newParts: [0, , , , , , 6] <- 5 not in new map: remove\n // newKeys: [0, 2, 1, 4, 3, 7, 6] 5 and advance oldTail\n // newHead ^ ^ newTail\n //\n // * Once head and tail cannot move, any mismatches are due to\n // either new or moved items; if a new key is in the previous\n // \"old key to old index\" map, move the old part to the new\n // location, otherwise create and insert a new part. Note\n // that when moving an old part we null its position in the\n // oldParts array if it lies between the head and tail so we\n // know to skip it when the pointers get there.\n //\n // * Example below: neither head nor tail match, and neither\n // were removed; so find the `newHead` key in the\n // `oldKeyToIndexMap`, and move that old part's DOM into the\n // next head position (before `oldParts[oldHead]`). Last,\n // null the part in the `oldPart` array since it was\n // somewhere in the remaining oldParts still to be scanned\n // (between the head and tail pointers) so that we know to\n // skip that old part on future iterations.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, , , , , 6] <- stuck: update & move 2\n // newKeys: [0, 2, 1, 4, 3, 7, 6] into place and advance\n // newHead\n // newHead ^ ^ newTail\n //\n // * Note that for moves/insertions like the one above, a part\n // inserted at the head pointer is inserted before the\n // current `oldParts[oldHead]`, and a part inserted at the\n // tail pointer is inserted before `newParts[newTail+1]`. The\n // seeming asymmetry lies in the fact that new parts are\n // moved into place outside in, so to the right of the head\n // pointer are old parts, and to the right of the tail\n // pointer are new parts.\n //\n // * We always restart back from the top of the algorithm,\n // allowing matching and simple updates in place to\n // continue...\n //\n // * Example below: the head pointers once again match, so\n // simply update part 1 and record it in the `newParts`\n // array. Last, advance both head pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, , , , 6] <- heads matched: update 1\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance both oldHead\n // & newHead\n // newHead ^ ^ newTail\n //\n // * As mentioned above, items that were moved as a result of\n // being stuck (the final else clause in the code below) are\n // marked with null, so we always advance old pointers over\n // these so we're comparing the next actual old value on\n // either end.\n //\n // * Example below: `oldHead` is null (already placed in\n // newParts), so advance `oldHead`.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6] <- old head already used:\n // newParts: [0, 2, 1, , , , 6] advance oldHead\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ ^ newTail\n //\n // * Note it's not critical to mark old parts as null when they\n // are moved from head to tail or tail to head, since they\n // will be outside the pointer range and never visited again.\n //\n // * Example below: Here the old tail key matches the new head\n // key, so the part at the `oldTail` position and move its\n // DOM to the new head position (before `oldParts[oldHead]`).\n // Last, advance `oldTail` and `newHead` pointers.\n //\n // oldHead v v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, , , 6] <- old tail matches new\n // newKeys: [0, 2, 1, 4, 3, 7, 6] head: update & move 4,\n // advance oldTail & newHead\n // newHead ^ ^ newTail\n //\n // * Example below: Old and new head keys match, so update the\n // old head part in place, and advance the `oldHead` and\n // `newHead` pointers.\n //\n // oldHead v oldTail\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, ,6] <- heads match: update 3\n // newKeys: [0, 2, 1, 4, 3, 7, 6] and advance oldHead &\n // newHead\n // newHead ^ ^ newTail\n //\n // * Once the new or old pointers move past each other then all\n // we have left is additions (if old list exhausted) or\n // removals (if new list exhausted). Those are handled in the\n // final while loops at the end.\n //\n // * Example below: `oldHead` exceeded `oldTail`, so we're done\n // with the main loop. Create the remaining part and insert\n // it at the new head position, and the update is complete.\n //\n // (oldHead > oldTail)\n // oldKeys: [0, 1, -, 3, 4, 5, 6]\n // newParts: [0, 2, 1, 4, 3, 7 ,6] <- create and insert 7\n // newKeys: [0, 2, 1, 4, 3, 7, 6]\n // newHead ^ newTail\n //\n // * Note that the order of the if/else clauses is not\n // important to the algorithm, as long as the null checks\n // come first (to ensure we're always working on valid old\n // parts) and that the final else clause comes last (since\n // that's where the expensive moves occur). The order of\n // remaining clauses is is just a simple guess at which cases\n // will be most common.\n //\n // * TODO(kschaaf) Note, we could calculate the longest\n // increasing subsequence (LIS) of old items in new position,\n // and only move those not in the LIS set. However that costs\n // O(nlogn) time and adds a bit more code, and only helps\n // make rare types of mutations require fewer moves. The\n // above handles removes, adds, reversal, swaps, and single\n // moves of contiguous items in linear time, in the minimum\n // number of moves. As the number of multiple moves where LIS\n // might help approaches a random shuffle, the LIS\n // optimization becomes less helpful, so it seems not worth\n // the code at this point. Could reconsider if a compelling\n // case arises.\n while (oldHead <= oldTail && newHead <= newTail) {\n if (oldParts[oldHead] === null) {\n // `null` means old part at head has already been used\n // below; skip\n oldHead++;\n }\n else if (oldParts[oldTail] === null) {\n // `null` means old part at tail has already been used\n // below; skip\n oldTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newHead]) {\n // Old head matches new head; update in place\n newParts[newHead] =\n updatePart(oldParts[oldHead], newValues[newHead]);\n oldHead++;\n newHead++;\n }\n else if (oldKeys[oldTail] === newKeys[newTail]) {\n // Old tail matches new tail; update in place\n newParts[newTail] =\n updatePart(oldParts[oldTail], newValues[newTail]);\n oldTail--;\n newTail--;\n }\n else if (oldKeys[oldHead] === newKeys[newTail]) {\n // Old head matches new tail; update and move to new tail\n newParts[newTail] =\n updatePart(oldParts[oldHead], newValues[newTail]);\n insertPartBefore(containerPart, oldParts[oldHead], newParts[newTail + 1]);\n oldHead++;\n newTail--;\n }\n else if (oldKeys[oldTail] === newKeys[newHead]) {\n // Old tail matches new head; update and move to new head\n newParts[newHead] =\n updatePart(oldParts[oldTail], newValues[newHead]);\n insertPartBefore(containerPart, oldParts[oldTail], oldParts[oldHead]);\n oldTail--;\n newHead++;\n }\n else {\n if (newKeyToIndexMap === undefined) {\n // Lazily generate key-to-index maps, used for removals &\n // moves below\n newKeyToIndexMap = generateMap(newKeys, newHead, newTail);\n oldKeyToIndexMap = generateMap(oldKeys, oldHead, oldTail);\n }\n if (!newKeyToIndexMap.has(oldKeys[oldHead])) {\n // Old head is no longer in new list; remove\n removePart(oldParts[oldHead]);\n oldHead++;\n }\n else if (!newKeyToIndexMap.has(oldKeys[oldTail])) {\n // Old tail is no longer in new list; remove\n removePart(oldParts[oldTail]);\n oldTail--;\n }\n else {\n // Any mismatches at this point are due to additions or\n // moves; see if we have an old part we can reuse and move\n // into place\n const oldIndex = oldKeyToIndexMap.get(newKeys[newHead]);\n const oldPart = oldIndex !== undefined ? oldParts[oldIndex] : null;\n if (oldPart === null) {\n // No old part for this value; create a new one and\n // insert it\n const newPart = createAndInsertPart(containerPart, oldParts[oldHead]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead] = newPart;\n }\n else {\n // Reuse old part\n newParts[newHead] =\n updatePart(oldPart, newValues[newHead]);\n insertPartBefore(containerPart, oldPart, oldParts[oldHead]);\n // This marks the old part as having been used, so that\n // it will be skipped in the first two checks above\n oldParts[oldIndex] = null;\n }\n newHead++;\n }\n }\n }\n // Add parts for any remaining new values\n while (newHead <= newTail) {\n // For all remaining additions, we insert before last new\n // tail, since old pointers are no longer valid\n const newPart = createAndInsertPart(containerPart, newParts[newTail + 1]);\n updatePart(newPart, newValues[newHead]);\n newParts[newHead++] = newPart;\n }\n // Remove any remaining unused old parts\n while (oldHead <= oldTail) {\n const oldPart = oldParts[oldHead++];\n if (oldPart !== null) {\n removePart(oldPart);\n }\n }\n // Save order of new parts for next round\n partListCache.set(containerPart, newParts);\n keyListCache.set(containerPart, newKeys);\n };\n});\n//# sourceMappingURL=repeat.js.map","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributePart, directive, PropertyPart } from '../lit-html.js';\n/**\n * Stores the StyleInfo object applied to a given AttributePart.\n * Used to unset existing values when a new StyleInfo object is applied.\n */\nconst previousStylePropertyCache = new WeakMap();\n/**\n * A directive that applies CSS properties to an element.\n *\n * `styleMap` can only be used in the `style` attribute and must be the only\n * expression in the attribute. It takes the property names in the `styleInfo`\n * object and adds the property values as CSS properties. Property names with\n * dashes (`-`) are assumed to be valid CSS property names and set on the\n * element's style object using `setProperty()`. Names without dashes are\n * assumed to be camelCased JavaScript property names and set on the element's\n * style object using property assignment, allowing the style object to\n * translate JavaScript-style names to CSS property names.\n *\n * For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\n * '0'})` sets the `background-color`, `border-top` and `--size` properties.\n *\n * @param styleInfo {StyleInfo}\n */\nexport const styleMap = directive((styleInfo) => (part) => {\n if (!(part instanceof AttributePart) || (part instanceof PropertyPart) ||\n part.committer.name !== 'style' || part.committer.parts.length > 1) {\n throw new Error('The `styleMap` directive must be used in the style attribute ' +\n 'and must be the only part in the attribute.');\n }\n const { committer } = part;\n const { style } = committer.element;\n let previousStyleProperties = previousStylePropertyCache.get(part);\n if (previousStyleProperties === undefined) {\n // Write static styles once\n style.cssText = committer.strings.join(' ');\n previousStylePropertyCache.set(part, previousStyleProperties = new Set());\n }\n // Remove old properties that no longer exist in styleInfo\n // We use forEach() instead of for-of so that re don't require down-level\n // iteration.\n previousStyleProperties.forEach((name) => {\n if (!(name in styleInfo)) {\n previousStyleProperties.delete(name);\n if (name.indexOf('-') === -1) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style[name] = null;\n }\n else {\n style.removeProperty(name);\n }\n }\n });\n // Add or update properties\n for (const name in styleInfo) {\n previousStyleProperties.add(name);\n if (name.indexOf('-') === -1) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n style[name] = styleInfo[name];\n }\n else {\n style.setProperty(name, styleInfo[name]);\n }\n }\n});\n//# sourceMappingURL=style-map.js.map","/**\n * @license\n * Copyright (c) 2020 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { directive, NodePart } from '../lit-html.js';\n// For each part, remember the value that was last rendered to the part by the\n// templateContent directive, and the DocumentFragment that was last set as a\n// value. The DocumentFragment is used as a unique key to check if the last\n// value rendered to the part was with templateContent. If not, we'll always\n// re-render the value passed to templateContent.\nconst previousValues = new WeakMap();\n/**\n * Renders the content of a template element as HTML.\n *\n * Note, the template should be developer controlled and not user controlled.\n * Rendering a user-controlled template with this directive\n * could lead to cross-site-scripting vulnerabilities.\n */\nexport const templateContent = directive((template) => (part) => {\n if (!(part instanceof NodePart)) {\n throw new Error('templateContent can only be used in text bindings');\n }\n const previousValue = previousValues.get(part);\n if (previousValue !== undefined && template === previousValue.template &&\n part.value === previousValue.fragment) {\n return;\n }\n const fragment = document.importNode(template.content, true);\n part.setValue(fragment);\n previousValues.set(part, { template, fragment });\n});\n//# sourceMappingURL=template-content.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { isPrimitive } from '../lib/parts.js';\nimport { directive, NodePart } from '../lit-html.js';\n// For each part, remember the value that was last rendered to the part by the\n// unsafeHTML directive, and the DocumentFragment that was last set as a value.\n// The DocumentFragment is used as a unique key to check if the last value\n// rendered to the part was with unsafeHTML. If not, we'll always re-render the\n// value passed to unsafeHTML.\nconst previousValues = new WeakMap();\n/**\n * Renders the result as HTML, rather than text.\n *\n * Note, this is unsafe to use with any user-provided input that hasn't been\n * sanitized or escaped, as it may lead to cross-site-scripting\n * vulnerabilities.\n */\nexport const unsafeHTML = directive((value) => (part) => {\n if (!(part instanceof NodePart)) {\n throw new Error('unsafeHTML can only be used in text bindings');\n }\n const previousValue = previousValues.get(part);\n if (previousValue !== undefined && isPrimitive(value) &&\n value === previousValue.value && part.value === previousValue.fragment) {\n return;\n }\n const template = document.createElement('template');\n template.innerHTML = value; // innerHTML casts to string internally\n const fragment = document.importNode(template.content, true);\n part.setValue(fragment);\n previousValues.set(part, { value, fragment });\n});\n//# sourceMappingURL=unsafe-html.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { isPrimitive } from '../lib/parts.js';\nimport { directive } from '../lit-html.js';\nconst _state = new WeakMap();\n// Effectively infinity, but a SMI.\nconst _infinity = 0x7fffffff;\n/**\n * Renders one of a series of values, including Promises, to a Part.\n *\n * Values are rendered in priority order, with the first argument having the\n * highest priority and the last argument having the lowest priority. If a\n * value is a Promise, low-priority values will be rendered until it resolves.\n *\n * The priority of values can be used to create placeholder content for async\n * data. For example, a Promise with pending content can be the first,\n * highest-priority, argument, and a non_promise loading indicator template can\n * be used as the second, lower-priority, argument. The loading indicator will\n * render immediately, and the primary content will render when the Promise\n * resolves.\n *\n * Example:\n *\n * const content = fetch('./content.txt').then(r => r.text());\n * html`${until(content, html`Loading...`)}`\n */\nexport const until = directive((...args) => (part) => {\n let state = _state.get(part);\n if (state === undefined) {\n state = {\n lastRenderedIndex: _infinity,\n values: [],\n };\n _state.set(part, state);\n }\n const previousValues = state.values;\n let previousLength = previousValues.length;\n state.values = args;\n for (let i = 0; i < args.length; i++) {\n // If we've rendered a higher-priority value already, stop.\n if (i > state.lastRenderedIndex) {\n break;\n }\n const value = args[i];\n // Render non-Promise values immediately\n if (isPrimitive(value) ||\n typeof value.then !== 'function') {\n part.setValue(value);\n state.lastRenderedIndex = i;\n // Since a lower-priority value will never overwrite a higher-priority\n // synchronous value, we can stop processing now.\n break;\n }\n // If this is a Promise we've already handled, skip it.\n if (i < previousLength && value === previousValues[i]) {\n continue;\n }\n // We have a Promise that we haven't seen before, so priorities may have\n // changed. Forget what we rendered before.\n state.lastRenderedIndex = _infinity;\n previousLength = 0;\n Promise.resolve(value).then((resolvedValue) => {\n const index = state.values.indexOf(value);\n // If state.values doesn't contain the value, we've re-rendered without\n // the value, so don't render it. Then, only render if the value is\n // higher-priority than what's already been rendered.\n if (index > -1 && index < state.lastRenderedIndex) {\n state.lastRenderedIndex = index;\n part.setValue(resolvedValue);\n part.commit();\n }\n });\n }\n});\n//# sourceMappingURL=until.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { AttributeCommitter, BooleanAttributePart, EventPart, NodePart, PropertyCommitter } from './parts.js';\n/**\n * Creates Parts when a template is instantiated.\n */\nexport class DefaultTemplateProcessor {\n /**\n * Create parts for an attribute-position binding, given the event, attribute\n * name, and string literals.\n *\n * @param element The element containing the binding\n * @param name The attribute name\n * @param strings The string literals. There are always at least two strings,\n * event for fully-controlled bindings with a single expression.\n */\n handleAttributeExpressions(element, name, strings, options) {\n const prefix = name[0];\n if (prefix === '.') {\n const committer = new PropertyCommitter(element, name.slice(1), strings);\n return committer.parts;\n }\n if (prefix === '@') {\n return [new EventPart(element, name.slice(1), options.eventContext)];\n }\n if (prefix === '?') {\n return [new BooleanAttributePart(element, name.slice(1), strings)];\n }\n const committer = new AttributeCommitter(element, name, strings);\n return committer.parts;\n }\n /**\n * Create parts for a text-position binding.\n * @param templateFactory\n */\n handleTextExpression(options) {\n return new NodePart(options);\n }\n}\nexport const defaultTemplateProcessor = new DefaultTemplateProcessor();\n//# sourceMappingURL=default-template-processor.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nconst directives = new WeakMap();\n/**\n * Brands a function as a directive factory function so that lit-html will call\n * the function during template rendering, rather than passing as a value.\n *\n * A _directive_ is a function that takes a Part as an argument. It has the\n * signature: `(part: Part) => void`.\n *\n * A directive _factory_ is a function that takes arguments for data and\n * configuration and returns a directive. Users of directive usually refer to\n * the directive factory as the directive. For example, \"The repeat directive\".\n *\n * Usually a template author will invoke a directive factory in their template\n * with relevant arguments, which will then return a directive function.\n *\n * Here's an example of using the `repeat()` directive factory that takes an\n * array and a function to render an item:\n *\n * ```js\n * html`<${repeat(items, (item) => html`- ${item}
`)}
`\n * ```\n *\n * When `repeat` is invoked, it returns a directive function that closes over\n * `items` and the template function. When the outer template is rendered, the\n * return directive function is called with the Part for the expression.\n * `repeat` then performs it's custom logic to render multiple items.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object.\n *\n * @example\n *\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n * if (part.value !== v) {\n * part.setValue(v)\n * }\n * });\n */\nexport const directive = (f) => ((...args) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n});\nexport const isDirective = (o) => {\n return typeof o === 'function' && directives.has(o);\n};\n//# sourceMappingURL=directive.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n window.customElements.polyfillWrapFlushCallback !==\n undefined;\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes = (container, start, end = null, before = null) => {\n while (start !== end) {\n const n = start.nextSibling;\n container.insertBefore(start, before);\n start = n;\n }\n};\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes = (container, start, end = null) => {\n while (start !== end) {\n const n = start.nextSibling;\n container.removeChild(start);\n start = n;\n }\n};\n//# sourceMappingURL=dom.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { isTemplatePartActive } from './template.js';\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(template, nodesToRemove) {\n const { element: { content }, parts } = template;\n const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode.removeChild(n));\n}\nconst countNodes = (node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\nconst nextActiveIndexInTemplateParts = (parts, startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n};\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(template, node, refNode = null) {\n const { element: { content }, parts } = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker = document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n//# sourceMappingURL=modify-template.js.map","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n//# sourceMappingURL=part.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { isDirective } from './directive.js';\nimport { removeNodes } from './dom.js';\nimport { noChange, nothing } from './part.js';\nimport { TemplateInstance } from './template-instance.js';\nimport { TemplateResult } from './template-result.js';\nimport { createMarker } from './template.js';\nexport const isPrimitive = (value) => {\n return (value === null ||\n !(typeof value === 'object' || typeof value === 'function'));\n};\nexport const isIterable = (value) => {\n return Array.isArray(value) ||\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n !!(value && value[Symbol.iterator]);\n};\n/**\n * Writes attribute values to the DOM for a group of AttributeParts bound to a\n * single attribute. The value is only set once even if there are multiple parts\n * for an attribute.\n */\nexport class AttributeCommitter {\n constructor(element, name, strings) {\n this.dirty = true;\n this.element = element;\n this.name = name;\n this.strings = strings;\n this.parts = [];\n for (let i = 0; i < strings.length - 1; i++) {\n this.parts[i] = this._createPart();\n }\n }\n /**\n * Creates a single part. Override this to create a differnt type of part.\n */\n _createPart() {\n return new AttributePart(this);\n }\n _getValue() {\n const strings = this.strings;\n const l = strings.length - 1;\n const parts = this.parts;\n // If we're assigning an attribute via syntax like:\n // attr=\"${foo}\" or attr=${foo}\n // but not\n // attr=\"${foo} ${bar}\" or attr=\"${foo} baz\"\n // then we don't want to coerce the attribute value into one long\n // string. Instead we want to just return the value itself directly,\n // so that sanitizeDOMValue can get the actual value rather than\n // String(value)\n // The exception is if v is an array, in which case we do want to smash\n // it together into a string without calling String() on the array.\n //\n // This also allows trusted values (when using TrustedTypes) being\n // assigned to DOM sinks without being stringified in the process.\n if (l === 1 && strings[0] === '' && strings[1] === '') {\n const v = parts[0].value;\n if (typeof v === 'symbol') {\n return String(v);\n }\n if (typeof v === 'string' || !isIterable(v)) {\n return v;\n }\n }\n let text = '';\n for (let i = 0; i < l; i++) {\n text += strings[i];\n const part = parts[i];\n if (part !== undefined) {\n const v = part.value;\n if (isPrimitive(v) || !isIterable(v)) {\n text += typeof v === 'string' ? v : String(v);\n }\n else {\n for (const t of v) {\n text += typeof t === 'string' ? t : String(t);\n }\n }\n }\n }\n text += strings[l];\n return text;\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n this.element.setAttribute(this.name, this._getValue());\n }\n }\n}\n/**\n * A Part that controls all or part of an attribute value.\n */\nexport class AttributePart {\n constructor(committer) {\n this.value = undefined;\n this.committer = committer;\n }\n setValue(value) {\n if (value !== noChange && (!isPrimitive(value) || value !== this.value)) {\n this.value = value;\n // If the value is a not a directive, dirty the committer so that it'll\n // call setAttribute. If the value is a directive, it'll dirty the\n // committer if it calls setValue().\n if (!isDirective(value)) {\n this.committer.dirty = true;\n }\n }\n }\n commit() {\n while (isDirective(this.value)) {\n const directive = this.value;\n this.value = noChange;\n directive(this);\n }\n if (this.value === noChange) {\n return;\n }\n this.committer.commit();\n }\n}\n/**\n * A Part that controls a location within a Node tree. Like a Range, NodePart\n * has start and end locations and can set and update the Nodes between those\n * locations.\n *\n * NodeParts support several value types: primitives, Nodes, TemplateResults,\n * as well as arrays and iterables of those types.\n */\nexport class NodePart {\n constructor(options) {\n this.value = undefined;\n this.__pendingValue = undefined;\n this.options = options;\n }\n /**\n * Appends this part into a container.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n appendInto(container) {\n this.startNode = container.appendChild(createMarker());\n this.endNode = container.appendChild(createMarker());\n }\n /**\n * Inserts this part after the `ref` node (between `ref` and `ref`'s next\n * sibling). Both `ref` and its next sibling must be static, unchanging nodes\n * such as those that appear in a literal section of a template.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n insertAfterNode(ref) {\n this.startNode = ref;\n this.endNode = ref.nextSibling;\n }\n /**\n * Appends this part into a parent part.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n appendIntoPart(part) {\n part.__insert(this.startNode = createMarker());\n part.__insert(this.endNode = createMarker());\n }\n /**\n * Inserts this part after the `ref` part.\n *\n * This part must be empty, as its contents are not automatically moved.\n */\n insertAfterPart(ref) {\n ref.__insert(this.startNode = createMarker());\n this.endNode = ref.endNode;\n ref.endNode = this.startNode;\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n if (this.startNode.parentNode === null) {\n return;\n }\n while (isDirective(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = noChange;\n directive(this);\n }\n const value = this.__pendingValue;\n if (value === noChange) {\n return;\n }\n if (isPrimitive(value)) {\n if (value !== this.value) {\n this.__commitText(value);\n }\n }\n else if (value instanceof TemplateResult) {\n this.__commitTemplateResult(value);\n }\n else if (value instanceof Node) {\n this.__commitNode(value);\n }\n else if (isIterable(value)) {\n this.__commitIterable(value);\n }\n else if (value === nothing) {\n this.value = nothing;\n this.clear();\n }\n else {\n // Fallback, will render the string representation\n this.__commitText(value);\n }\n }\n __insert(node) {\n this.endNode.parentNode.insertBefore(node, this.endNode);\n }\n __commitNode(value) {\n if (this.value === value) {\n return;\n }\n this.clear();\n this.__insert(value);\n this.value = value;\n }\n __commitText(value) {\n const node = this.startNode.nextSibling;\n value = value == null ? '' : value;\n // If `value` isn't already a string, we explicitly convert it here in case\n // it can't be implicitly converted - i.e. it's a symbol.\n const valueAsString = typeof value === 'string' ? value : String(value);\n if (node === this.endNode.previousSibling &&\n node.nodeType === 3 /* Node.TEXT_NODE */) {\n // If we only have a single text node between the markers, we can just\n // set its value, rather than replacing it.\n // TODO(justinfagnani): Can we just check if this.value is primitive?\n node.data = valueAsString;\n }\n else {\n this.__commitNode(document.createTextNode(valueAsString));\n }\n this.value = value;\n }\n __commitTemplateResult(value) {\n const template = this.options.templateFactory(value);\n if (this.value instanceof TemplateInstance &&\n this.value.template === template) {\n this.value.update(value.values);\n }\n else {\n // Make sure we propagate the template processor from the TemplateResult\n // so that we use its syntax extension, etc. The template factory comes\n // from the render function options so that it can control template\n // caching and preprocessing.\n const instance = new TemplateInstance(template, value.processor, this.options);\n const fragment = instance._clone();\n instance.update(value.values);\n this.__commitNode(fragment);\n this.value = instance;\n }\n }\n __commitIterable(value) {\n // For an Iterable, we create a new InstancePart per item, then set its\n // value to the item. This is a little bit of overhead for every item in\n // an Iterable, but it lets us recurse easily and efficiently update Arrays\n // of TemplateResults that will be commonly returned from expressions like:\n // array.map((i) => html`${i}`), by reusing existing TemplateInstances.\n // If _value is an array, then the previous render was of an\n // iterable and _value will contain the NodeParts from the previous\n // render. If _value is not an array, clear this part and make a new\n // array for NodeParts.\n if (!Array.isArray(this.value)) {\n this.value = [];\n this.clear();\n }\n // Lets us keep track of how many items we stamped so we can clear leftover\n // items from a previous render\n const itemParts = this.value;\n let partIndex = 0;\n let itemPart;\n for (const item of value) {\n // Try to reuse an existing part\n itemPart = itemParts[partIndex];\n // If no existing part, create a new one\n if (itemPart === undefined) {\n itemPart = new NodePart(this.options);\n itemParts.push(itemPart);\n if (partIndex === 0) {\n itemPart.appendIntoPart(this);\n }\n else {\n itemPart.insertAfterPart(itemParts[partIndex - 1]);\n }\n }\n itemPart.setValue(item);\n itemPart.commit();\n partIndex++;\n }\n if (partIndex < itemParts.length) {\n // Truncate the parts array so _value reflects the current state\n itemParts.length = partIndex;\n this.clear(itemPart && itemPart.endNode);\n }\n }\n clear(startNode = this.startNode) {\n removeNodes(this.startNode.parentNode, startNode.nextSibling, this.endNode);\n }\n}\n/**\n * Implements a boolean attribute, roughly as defined in the HTML\n * specification.\n *\n * If the value is truthy, then the attribute is present with a value of\n * ''. If the value is falsey, the attribute is removed.\n */\nexport class BooleanAttributePart {\n constructor(element, name, strings) {\n this.value = undefined;\n this.__pendingValue = undefined;\n if (strings.length !== 2 || strings[0] !== '' || strings[1] !== '') {\n throw new Error('Boolean attributes can only contain a single expression');\n }\n this.element = element;\n this.name = name;\n this.strings = strings;\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n while (isDirective(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = noChange;\n directive(this);\n }\n if (this.__pendingValue === noChange) {\n return;\n }\n const value = !!this.__pendingValue;\n if (this.value !== value) {\n if (value) {\n this.element.setAttribute(this.name, '');\n }\n else {\n this.element.removeAttribute(this.name);\n }\n this.value = value;\n }\n this.__pendingValue = noChange;\n }\n}\n/**\n * Sets attribute values for PropertyParts, so that the value is only set once\n * even if there are multiple parts for a property.\n *\n * If an expression controls the whole property value, then the value is simply\n * assigned to the property under control. If there are string literals or\n * multiple expressions, then the strings are expressions are interpolated into\n * a string first.\n */\nexport class PropertyCommitter extends AttributeCommitter {\n constructor(element, name, strings) {\n super(element, name, strings);\n this.single =\n (strings.length === 2 && strings[0] === '' && strings[1] === '');\n }\n _createPart() {\n return new PropertyPart(this);\n }\n _getValue() {\n if (this.single) {\n return this.parts[0].value;\n }\n return super._getValue();\n }\n commit() {\n if (this.dirty) {\n this.dirty = false;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.element[this.name] = this._getValue();\n }\n }\n}\nexport class PropertyPart extends AttributePart {\n}\n// Detect event listener options support. If the `capture` property is read\n// from the options object, then options are supported. If not, then the third\n// argument to add/removeEventListener is interpreted as the boolean capture\n// value so we should only pass the `capture` property.\nlet eventOptionsSupported = false;\n// Wrap into an IIFE because MS Edge <= v41 does not support having try/catch\n// blocks right into the body of a module\n(() => {\n try {\n const options = {\n get capture() {\n eventOptionsSupported = true;\n return false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n window.addEventListener('test', options, options);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n window.removeEventListener('test', options, options);\n }\n catch (_e) {\n // event options not supported\n }\n})();\nexport class EventPart {\n constructor(element, eventName, eventContext) {\n this.value = undefined;\n this.__pendingValue = undefined;\n this.element = element;\n this.eventName = eventName;\n this.eventContext = eventContext;\n this.__boundHandleEvent = (e) => this.handleEvent(e);\n }\n setValue(value) {\n this.__pendingValue = value;\n }\n commit() {\n while (isDirective(this.__pendingValue)) {\n const directive = this.__pendingValue;\n this.__pendingValue = noChange;\n directive(this);\n }\n if (this.__pendingValue === noChange) {\n return;\n }\n const newListener = this.__pendingValue;\n const oldListener = this.value;\n const shouldRemoveListener = newListener == null ||\n oldListener != null &&\n (newListener.capture !== oldListener.capture ||\n newListener.once !== oldListener.once ||\n newListener.passive !== oldListener.passive);\n const shouldAddListener = newListener != null && (oldListener == null || shouldRemoveListener);\n if (shouldRemoveListener) {\n this.element.removeEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n }\n if (shouldAddListener) {\n this.__options = getOptions(newListener);\n this.element.addEventListener(this.eventName, this.__boundHandleEvent, this.__options);\n }\n this.value = newListener;\n this.__pendingValue = noChange;\n }\n handleEvent(event) {\n if (typeof this.value === 'function') {\n this.value.call(this.eventContext || this.element, event);\n }\n else {\n this.value.handleEvent(event);\n }\n }\n}\n// We copy options because of the inconsistent behavior of browsers when reading\n// the third argument of add/removeEventListener. IE11 doesn't support options\n// at all. Chrome 41 only reads `capture` if the argument is an object.\nconst getOptions = (o) => o &&\n (eventOptionsSupported ?\n { capture: o.capture, passive: o.passive, once: o.once } :\n o.capture);\n//# sourceMappingURL=parts.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\nimport { removeNodes } from './dom.js';\nimport { NodePart } from './parts.js';\nimport { templateFactory } from './template-factory.js';\nexport const parts = new WeakMap();\n/**\n * Renders a template result or other value to a container.\n *\n * To update a container with new values, reevaluate the template literal and\n * call `render` with the new result.\n *\n * @param result Any value renderable by NodePart - typically a TemplateResult\n * created by evaluating a template tag like `html` or `svg`.\n * @param container A DOM parent to render to. The entire contents are either\n * replaced, or efficiently updated if the same result type was previous\n * rendered there.\n * @param options RenderOptions for the entire render tree rendered to this\n * container. Render options must *not* change between renders to the same\n * container, as those changes will not effect previously rendered DOM.\n */\nexport const render = (result, container, options) => {\n let part = parts.get(container);\n if (part === undefined) {\n removeNodes(container, container.firstChild);\n parts.set(container, part = new NodePart(Object.assign({ templateFactory }, options)));\n part.appendInto(container);\n }\n part.setValue(result);\n part.commit();\n};\n//# sourceMappingURL=render.js.map","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n/**\n * Module to add shady DOM/shady CSS polyfill support to lit-html template\n * rendering. See the [[render]] method for details.\n *\n * @packageDocumentation\n */\n/**\n * Do not remove this comment; it keeps typedoc from misplacing the module\n * docs.\n */\nimport { removeNodes } from './dom.js';\nimport { insertNodeIntoTemplate, removeNodesFromTemplate } from './modify-template.js';\nimport { parts, render as litRender } from './render.js';\nimport { templateCaches } from './template-factory.js';\nimport { TemplateInstance } from './template-instance.js';\nimport { marker, Template } from './template.js';\nexport { html, svg, TemplateResult } from '../lit-html.js';\n// Get a key to lookup in `templateCaches`.\nconst getTemplateCacheKey = (type, scopeName) => `${type}--${scopeName}`;\nlet compatibleShadyCSSVersion = true;\nif (typeof window.ShadyCSS === 'undefined') {\n compatibleShadyCSSVersion = false;\n}\nelse if (typeof window.ShadyCSS.prepareTemplateDom === 'undefined') {\n console.warn(`Incompatible ShadyCSS version detected. ` +\n `Please update to at least @webcomponents/webcomponentsjs@2.0.2 and ` +\n `@webcomponents/shadycss@1.3.1.`);\n compatibleShadyCSSVersion = false;\n}\n/**\n * Template factory which scopes template DOM using ShadyCSS.\n * @param scopeName {string}\n */\nexport const shadyTemplateFactory = (scopeName) => (result) => {\n const cacheKey = getTemplateCacheKey(result.type, scopeName);\n let templateCache = templateCaches.get(cacheKey);\n if (templateCache === undefined) {\n templateCache = {\n stringsArray: new WeakMap(),\n keyString: new Map()\n };\n templateCaches.set(cacheKey, templateCache);\n }\n let template = templateCache.stringsArray.get(result.strings);\n if (template !== undefined) {\n return template;\n }\n const key = result.strings.join(marker);\n template = templateCache.keyString.get(key);\n if (template === undefined) {\n const element = result.getTemplateElement();\n if (compatibleShadyCSSVersion) {\n window.ShadyCSS.prepareTemplateDom(element, scopeName);\n }\n template = new Template(result, element);\n templateCache.keyString.set(key, template);\n }\n templateCache.stringsArray.set(result.strings, template);\n return template;\n};\nconst TEMPLATE_TYPES = ['html', 'svg'];\n/**\n * Removes all style elements from Templates for the given scopeName.\n */\nconst removeStylesFromLitTemplates = (scopeName) => {\n TEMPLATE_TYPES.forEach((type) => {\n const templates = templateCaches.get(getTemplateCacheKey(type, scopeName));\n if (templates !== undefined) {\n templates.keyString.forEach((template) => {\n const { element: { content } } = template;\n // IE 11 doesn't support the iterable param Set constructor\n const styles = new Set();\n Array.from(content.querySelectorAll('style')).forEach((s) => {\n styles.add(s);\n });\n removeNodesFromTemplate(template, styles);\n });\n }\n });\n};\nconst shadyRenderSet = new Set();\n/**\n * For the given scope name, ensures that ShadyCSS style scoping is performed.\n * This is done just once per scope name so the fragment and template cannot\n * be modified.\n * (1) extracts styles from the rendered fragment and hands them to ShadyCSS\n * to be scoped and appended to the document\n * (2) removes style elements from all lit-html Templates for this scope name.\n *\n * Note,