{"version":3,"sources":["webpack://libphonenumber/webpack/universalModuleDefinition","webpack://libphonenumber/webpack/bootstrap","webpack://libphonenumber/./es6/common.js","webpack://libphonenumber/./es6/metadata.js","webpack://libphonenumber/./es6/parse.js","webpack://libphonenumber/./es6/types.js","webpack://libphonenumber/./es6/RFC3966.js","webpack://libphonenumber/./es6/format.js","webpack://libphonenumber/./es6/IDD.js","webpack://libphonenumber/./es6/AsYouType.js","webpack://libphonenumber/./es6/getCountryCallingCode.js","webpack://libphonenumber/./es6/utf-8.common.js","webpack://libphonenumber/./es6/findNumbers.common.js","webpack://libphonenumber/./es6/findPhoneNumbers.js","webpack://libphonenumber/./es6/validate.js","webpack://libphonenumber/./node_modules/semver-compare/index.js","webpack://libphonenumber/./index.es6.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","parse_phone_number_digits","parse_national_number_and_country_calling_code","number","country","metadata","numberWithoutIDD","_IDD","stripIDDPrefix","MAX_LENGTH_COUNTRY_CODE","length","countryCallingCode","slice","countryCallingCodes","matches_entirely","text","arguments","undefined","regular_expression","matched_groups","match","create_extension_pattern","purpose","single_extension_characters","RFC3966_EXTN_PREFIX","CAPTURING_EXTN_DIGITS","VALID_DIGITS","WHITESPACE","PLUS_CHARS","VALID_PUNCTUATION","LEADING_PLUS_CHARS_PATTERN","RegExp","MAX_LENGTH_FOR_NSN","DIGIT_MAPPINGS","0","1","2","3","4","5","6","7","8","9","0","1","2","3","4","5","6","7","8","9","٠","١","٢","٣","٤","٥","٦","٧","٨","٩","۰","۱","۲","۳","۴","۵","۶","۷","۸","۹","test","replacements","replaced","_iterator","split","_isArray","Array","isArray","_i","Symbol","iterator","_ref","next","done","character","replacement","toUpperCase","drop_and_substitute_characters","validateMetadata","getExtPrefix","Metadata","ext","_semverCompare","_typeof","_typeof2","obj","constructor","_createClass","defineProperties","target","props","descriptor","writable","key","Constructor","protoProps","staticProps","_classCallCheck","instance","TypeError","V3","this","v1","version","v2","_semverCompare2","default","v3","countries","_country","country_metadata","hasCountry","Error","_this","formats","map","_","Format","nationalPrefix","types","_type","hasTypes","getType","Type","country_phone_code_to_countries","country_calling_codes","country_calling_code","format","_format","nationalPrefixFormattingRule","nationalPrefixIsOptionalWhenFormatting","usesNationalPrefix","replace","type","possibleLengths","is_object","keys","join","type_of","arg_1","arg_2","arg_3","arg_4","_sort_out_arguments","options","_extends","defaultCountry","default_options","_metadata2","sort_out_arguments","_parse_input","indexOf","_RFC","parseRFC3966","extract_formatted_phone_number","is_viable_phone_number","with_extension_stripped","start","search","EXTN_PATTERN","number_without_extension","matches","strip_extension","parse_input","formatted_phone_number","_parse_phone_number","default_country","_parse_national_numbe","_common","find_country_code","chooseCountryByCountryCallingCode","_parse_national_numbe2","national_number","carrier_code","_strip_national_prefi","strip_national_prefix_and_carrier_code","potential_national_number","carrierCode","_types","check_number_length_for_type","nationalNumberPattern","parse_national_number","parse_phone_number","selectedCountry","extended","MIN_LENGTH_FOR_NSN","valid","result","phone","possible","is_international","is_possible_number","assign","source","MAX_INPUT_STRING_LENGTH","EXTN_PATTERNS_FOR_PARSING","MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_PHONE_NUMBER","VALID_PHONE_NUMBER_PATTERN","PHONE_NUMBER_START_PATTERN","AFTER_PHONE_NUMBER_END_PATTERN","starts_at","nationalPrefixForParsing","national_prefix_pattern","national_prefix_matcher","exec","national_significant_number","captured_groups_count","nationalPrefixTransformRule","national_phone_number","possible_countries","leadingDigits","_types2","_find_country_code","input","is_of_type","pattern","non_fixed_line_types","type_info","possible_lengths","test_number_length_for_type","mobile_type","merge_arrays","actual_length","minimum_length","_parse","_parse2","a","b","merged","_iterator2","_isArray2","_i2","_ref2","element","push","sort","part","_part$split","_part$split2","_slicedToArray","formatRFC3966","arr","_arr","_n","_d","_e","_s","err","sliceIterator","arg_5","format_type","defaultOptions","format_national_number","add_extension","formatExtension","fromCountry","IDDPrefix","getIDDPrefix","humanReadable","formattedForSameCountryCallingCode","formatIDDSameCountryCallingCodeNumber","format_national_number_using_format","choose_format_for_number","local_to_international_style","_metadata","extension","FIRST_GROUP_PATTERN","international","enforce_national_prefix","format_pattern_matcher","national_prefix_may_be_omitted","formatted_number","internationalFormat","format_as","available_formats","leadingDigitsPatterns","last_leading_digits_pattern","local","trim","toCountryCallingCode","toCountryMetadata","fromCountryMetadata","countryMetadata","SINGLE_IDD_PREFIX","defaultIDDPrefix","IDDPrefixPattern","matchedGroups","CAPTURING_DIGIT_PATTERN","close_dangling_braces","count_occurences","repeat","DUMMY_DIGIT_MATCHER","LONGEST_DUMMY_PHONE_NUMBER","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","DIGIT_PLACEHOLDER_MATCHER_GLOBAL","CHARACTER_CLASS_PATTERN","STANDALONE_DIGIT_PATTERN","ELIGIBLE_FORMAT_PATTERN","VALID_INCOMPLETE_PHONE_NUMBER","VALID_INCOMPLETE_PHONE_NUMBER_PATTERN","AsYouType","country_code","reset","extracted_number","process_input","current_output","parsed_input","reset_countriness","determine_the_country","extract_country_calling_code","initialize_phone_number_formats_for_this_country_calling_code","reset_format","previous_national_prefix","national_prefix","extract_national_prefix","matching_formats","should_format","format_as_non_formatted_number","match_formats_by_leading_digits","formatted_national_phone_number","format_national_phone_number","full_phone_number","template","next_digits","national_number_formatted_with_previous_format","chosen_format","format_next_national_number_digits","attempt_to_format_complete_phone_number","choose_another_format","reformat_national_number","reset_country","partially_populated_template","last_match_position","filter","leading_digits","index_of_leading_digits_pattern","leading_digits_pattern_count","leading_digits_pattern_index","Math","min","leading_digits_pattern","is_format_applicable","create_formatting_template","full_number","formatted_national_number","national_number_rule","nationalPrefixIsMandatoryWhenFormatting","get_template_for_phone_number_format_pattern","number_pattern","dummy_phone_number_matching_format_pattern","number_format","get_format_format","strict_pattern","national_number_dummy_digits","digits","_iterator3","_isArray3","_i3","_ref3","digit","cut_before","retained_template","dangling_braces","symbol","string","count","_iterator4","_isArray4","_i4","_ref4","times","isLatinLetter","letter","pL_regexp","pMn_regexp","latinLetterRegexp","isInvalidPunctuationSymbol","pSc_regexp","_pL","isValidCandidate","candidate","offset","LEAD_CLASS_LEADING","previousChar","_utf","lastCharIndex","nextChar","OPENING_PARENS","LEAD_CLASS","CLOSING_PARENS","PhoneNumberSearch","phones","hasNext","searchPhoneNumbers","_sort_out_arguments2","_defineProperty","_findNumbers","WHITESPACE_IN_THE_BEGINNING_PATTERN","WHITESPACE_IN_THE_END_PATTERN","state","regexp","startsAt","index","endsAt","find","last_match","pa","pb","na","Number","nb","isNaN","parseNumber","parameters","_metadataMin2","apply","parse","formatNumber","_format2","getNumberType","isValidNumber","_validate2","findPhoneNumbers","_findPhoneNumbers2","_findPhoneNumbers","_validate","_getCountryCallingCode","_AsYouType","getCountryCallingCode","getPhoneCode","getPhoneCodeCustom","_getCountryCallingCode2","_AsYouType2","create"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,oBAAAH,GACA,iBAAAC,QACAA,QAAA,eAAAD,IAEAD,EAAA,eAAAC,IARA,CASCK,OAAA,WACD,mBCTA,IAAAC,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAP,QAGA,IAAAC,EAAAI,EAAAE,IACAC,EAAAD,EACAE,GAAA,EACAT,YAUA,OANAU,EAAAH,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAQ,GAAA,EAGAR,EAAAD,QA2CA,OAtCAM,EAAAM,EAAAF,EAGAJ,EAAAO,EAAAR,EAGAC,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,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uleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"libphonenumber\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"libphonenumber\"] = factory();\n\telse\n\t\troot[\"libphonenumber\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 15);\n","import { stripIDDPrefix } from './IDD';\n\n// `DASHES` will be right after the opening square bracket of the \"character class\"\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\\\\[\\\\]';\n// export const OPENING_BRACKETS = '(\\uFF08\\uFF3B\\\\\\['\nvar TILDES = '~\\u2053\\u223C\\uFF5E';\n\n// Digits accepted in phone numbers\n// (ascii, fullwidth, arabic-indic, and eastern arabic digits).\nexport var VALID_DIGITS = '0-9\\uFF10-\\uFF19\\u0660-\\u0669\\u06F0-\\u06F9';\n\n// 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.\nexport var VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + WHITESPACE + BRACKETS + TILDES;\n\nexport var PLUS_CHARS = '+\\uFF0B';\nvar LEADING_PLUS_CHARS_PATTERN = new RegExp('^[' + PLUS_CHARS + ']+');\n\n// The ITU says the maximum length should be 15,\n// but one can find longer numbers in Germany.\nexport var MAX_LENGTH_FOR_NSN = 17;\n\n// The maximum length of the country calling code.\nexport var MAX_LENGTH_COUNTRY_CODE = 3;\n\n// 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 DIGIT_MAPPINGS = {\n\t'0': '0',\n\t'1': '1',\n\t'2': '2',\n\t'3': '3',\n\t'4': '4',\n\t'5': '5',\n\t'6': '6',\n\t'7': '7',\n\t'8': '8',\n\t'9': '9',\n\t'\\uFF10': '0', // Fullwidth digit 0\n\t'\\uFF11': '1', // Fullwidth digit 1\n\t'\\uFF12': '2', // Fullwidth digit 2\n\t'\\uFF13': '3', // Fullwidth digit 3\n\t'\\uFF14': '4', // Fullwidth digit 4\n\t'\\uFF15': '5', // Fullwidth digit 5\n\t'\\uFF16': '6', // Fullwidth digit 6\n\t'\\uFF17': '7', // Fullwidth digit 7\n\t'\\uFF18': '8', // Fullwidth digit 8\n\t'\\uFF19': '9', // Fullwidth digit 9\n\t'\\u0660': '0', // Arabic-indic digit 0\n\t'\\u0661': '1', // Arabic-indic digit 1\n\t'\\u0662': '2', // Arabic-indic digit 2\n\t'\\u0663': '3', // Arabic-indic digit 3\n\t'\\u0664': '4', // Arabic-indic digit 4\n\t'\\u0665': '5', // Arabic-indic digit 5\n\t'\\u0666': '6', // Arabic-indic digit 6\n\t'\\u0667': '7', // Arabic-indic digit 7\n\t'\\u0668': '8', // Arabic-indic digit 8\n\t'\\u0669': '9', // Arabic-indic digit 9\n\t'\\u06F0': '0', // Eastern-Arabic digit 0\n\t'\\u06F1': '1', // Eastern-Arabic digit 1\n\t'\\u06F2': '2', // Eastern-Arabic digit 2\n\t'\\u06F3': '3', // Eastern-Arabic digit 3\n\t'\\u06F4': '4', // Eastern-Arabic digit 4\n\t'\\u06F5': '5', // Eastern-Arabic digit 5\n\t'\\u06F6': '6', // Eastern-Arabic digit 6\n\t'\\u06F7': '7', // Eastern-Arabic digit 7\n\t'\\u06F8': '8', // Eastern-Arabic digit 8\n\t'\\u06F9': '9' // Eastern-Arabic digit 9\n\n\n\t/**\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 *\r\n * E.g. in Iraq they don't write `+442323234` but rather `+٤٤٢٣٢٣٢٣٤`.\r\n *\r\n * @param {string} number\r\n * @return {string}\r\n */\n};export function parse_phone_number_digits(number) {\n\treturn (LEADING_PLUS_CHARS_PATTERN.test(number) ? '+' : '') + drop_and_substitute_characters(number, DIGIT_MAPPINGS);\n}\n\n// Parses a formatted phone number\n// and returns `{ country_calling_code, number }`\n// where `number` is the national (significant) phone number.\n//\n// (aka `maybeExtractCountryPhoneCode`)\n//\nexport function parse_national_number_and_country_calling_code(number, country, metadata) {\n\tnumber = parse_phone_number_digits(number);\n\n\tif (!number) {\n\t\treturn {};\n\t}\n\n\t// If this is not an international phone number,\n\t// then don't extract country phone code.\n\tif (number[0] !== '+') {\n\t\t// Convert an \"out-of-country\" dialing phone number\n\t\t// to a proper international phone number.\n\t\tvar numberWithoutIDD = stripIDDPrefix(number, country, metadata.metadata);\n\n\t\t// If an IDD prefix was stripped then\n\t\t// convert the number to international one.\n\t\tif (numberWithoutIDD && numberWithoutIDD !== number) {\n\t\t\tnumber = '+' + numberWithoutIDD;\n\t\t} else {\n\t\t\treturn { number: number };\n\t\t}\n\t}\n\n\t// Fast abortion: country codes do not begin with a '0'\n\tif (number[1] === '0') {\n\t\treturn {};\n\t}\n\n\t// The thing with country phone codes\n\t// is that they are orthogonal to each other\n\t// i.e. there's no such country phone code A\n\t// for which country phone code B exists\n\t// where B starts with A.\n\t// Therefore, while scanning digits,\n\t// if a valid country code is found,\n\t// that means that it is the country code.\n\t//\n\tvar i = 2;\n\twhile (i - 1 <= MAX_LENGTH_COUNTRY_CODE && i <= number.length) {\n\t\tvar countryCallingCode = number.slice(1, i);\n\n\t\tif (metadata.countryCallingCodes()[countryCallingCode]) {\n\t\t\treturn {\n\t\t\t\tcountryCallingCode: countryCallingCode,\n\t\t\t\tnumber: number.slice(i)\n\t\t\t};\n\t\t}\n\n\t\ti++;\n\t}\n\n\treturn {};\n}\n\n// Checks whether the entire input sequence can be matched\n// against the regular expression.\nexport function matches_entirely() {\n\tvar text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\tvar regular_expression = arguments[1];\n\n\tif (typeof regular_expression === 'string') {\n\t\tregular_expression = '^(?:' + regular_expression + ')$';\n\t}\n\n\tvar matched_groups = text.match(regular_expression);\n\treturn matched_groups !== null && matched_groups[0].length === text.length;\n}\n\n// For any character not being part of `replacements`\n// it is removed from the phone number.\nfunction drop_and_substitute_characters(text, replacements) {\n\tvar replaced = '';\n\n\t// Using `.split('')` to iterate through a string here\n\t// to avoid requiring `Symbol.iterator` polyfill.\n\t// `.split('')` is generally not safe for Unicode,\n\t// but in this particular case for `digits` it is safe.\n\t// for (const character of text)\n\tfor (var _iterator = text.split(''), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar character = _ref;\n\n\t\tvar replacement = replacements[character.toUpperCase()];\n\n\t\tif (replacement) {\n\t\t\treplaced += replacement;\n\t\t}\n\t}\n\n\treturn replaced;\n}\n\n// The RFC 3966 format for extensions.\nvar RFC3966_EXTN_PREFIX = ';ext=';\n\n// Pattern to capture digits used in an extension.\n// Places a maximum length of '7' for an extension.\nvar CAPTURING_EXTN_DIGITS = '([' + VALID_DIGITS + ']{1,7})';\n\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 */\nexport function create_extension_pattern(purpose) {\n\t// One-character symbols that can be used to indicate an extension.\n\tvar single_extension_characters = 'x\\uFF58#\\uFF03~\\uFF5E';\n\n\tswitch (purpose) {\n\t\t// For parsing, we are slightly more lenient in our interpretation than for matching. Here we\n\t\t// allow \"comma\" and \"semicolon\" as possible extension indicators. When matching, these are\n\t\tcase 'parsing':\n\t\t\tsingle_extension_characters = ',;' + single_extension_characters;\n\t}\n\n\treturn RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + '|' + '[ \\xA0\\\\t,]*' + '(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|' + '[' + single_extension_characters + ']|int|anexo|\\uFF49\\uFF4E\\uFF54)' + '[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*' + CAPTURING_EXTN_DIGITS + '#?|' + '[- ]+([' + VALID_DIGITS + ']{1,5})#';\n}\n//# sourceMappingURL=common.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nimport compare from 'semver-compare';\n\n// Added \"possibleLengths\" and renamed\n// \"country_phone_code_to_countries\" to \"country_calling_codes\".\nvar V2 = '1.0.18';\n\n// Added \"idd_prefix\" and \"default_idd_prefix\".\nvar V3 = '1.2.0';\n\nvar DEFAULT_EXT_PREFIX = ' ext. ';\n\nvar Metadata = function () {\n\tfunction Metadata(metadata) {\n\t\t_classCallCheck(this, Metadata);\n\n\t\tvalidateMetadata(metadata);\n\n\t\tthis.metadata = metadata;\n\n\t\tthis.v1 = !metadata.version;\n\t\tthis.v2 = metadata.version !== undefined && compare(metadata.version, V3) === -1;\n\t\tthis.v3 = metadata.version !== undefined; // && compare(metadata.version, V4) === -1\n\t}\n\n\t_createClass(Metadata, [{\n\t\tkey: 'hasCountry',\n\t\tvalue: function hasCountry(country) {\n\t\t\treturn this.metadata.countries[country] !== undefined;\n\t\t}\n\t}, {\n\t\tkey: 'country',\n\t\tvalue: function country(_country) {\n\t\t\tif (!_country) {\n\t\t\t\tthis._country = undefined;\n\t\t\t\tthis.country_metadata = undefined;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (!this.hasCountry(_country)) {\n\t\t\t\tthrow new Error('Unknown country: ' + _country);\n\t\t\t}\n\n\t\t\tthis._country = _country;\n\t\t\tthis.country_metadata = this.metadata.countries[_country];\n\t\t\treturn this;\n\t\t}\n\t}, {\n\t\tkey: 'countryCallingCode',\n\t\tvalue: function countryCallingCode() {\n\t\t\treturn this.country_metadata[0];\n\t\t}\n\t}, {\n\t\tkey: 'IDDPrefix',\n\t\tvalue: function IDDPrefix() {\n\t\t\tif (this.v1 || this.v2) return;\n\t\t\treturn this.country_metadata[1];\n\t\t}\n\t}, {\n\t\tkey: 'defaultIDDPrefix',\n\t\tvalue: function defaultIDDPrefix() {\n\t\t\tif (this.v1 || this.v2) return;\n\t\t\treturn this.country_metadata[12];\n\t\t}\n\t}, {\n\t\tkey: 'nationalNumberPattern',\n\t\tvalue: function nationalNumberPattern() {\n\t\t\tif (this.v1 || this.v2) return this.country_metadata[1];\n\t\t\treturn this.country_metadata[2];\n\t\t}\n\t}, {\n\t\tkey: 'possibleLengths',\n\t\tvalue: function possibleLengths() {\n\t\t\tif (this.v1) return;\n\t\t\treturn this.country_metadata[this.v2 ? 2 : 3];\n\t\t}\n\t}, {\n\t\tkey: 'formats',\n\t\tvalue: function formats() {\n\t\t\tvar _this = this;\n\n\t\t\tvar formats = this.country_metadata[this.v1 ? 2 : this.v2 ? 3 : 4] || [];\n\t\t\treturn formats.map(function (_) {\n\t\t\t\treturn new Format(_, _this);\n\t\t\t});\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefix',\n\t\tvalue: function nationalPrefix() {\n\t\t\treturn this.country_metadata[this.v1 ? 3 : this.v2 ? 4 : 5];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixFormattingRule',\n\t\tvalue: function nationalPrefixFormattingRule() {\n\t\t\treturn this.country_metadata[this.v1 ? 4 : this.v2 ? 5 : 6];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixForParsing',\n\t\tvalue: function nationalPrefixForParsing() {\n\t\t\t// If `national_prefix_for_parsing` is not set explicitly,\n\t\t\t// then infer it from `national_prefix` (if any)\n\t\t\treturn this.country_metadata[this.v1 ? 5 : this.v2 ? 6 : 7] || this.nationalPrefix();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixTransformRule',\n\t\tvalue: function nationalPrefixTransformRule() {\n\t\t\treturn this.country_metadata[this.v1 ? 6 : this.v2 ? 7 : 8];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function nationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn !!this.country_metadata[this.v1 ? 7 : this.v2 ? 8 : 9];\n\t\t}\n\t}, {\n\t\tkey: 'leadingDigits',\n\t\tvalue: function leadingDigits() {\n\t\t\treturn this.country_metadata[this.v1 ? 8 : this.v2 ? 9 : 10];\n\t\t}\n\t}, {\n\t\tkey: 'types',\n\t\tvalue: function types() {\n\t\t\treturn this.country_metadata[this.v1 ? 9 : this.v2 ? 10 : 11];\n\t\t}\n\t}, {\n\t\tkey: 'hasTypes',\n\t\tvalue: function hasTypes() {\n\t\t\t// Versions 1.2.0 - 1.2.4: can be `[]`.\n\t\t\tif (this.types() && this.types().length === 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Versions <= 1.2.4: can be `undefined`.\n\t\t\t// Version >= 1.2.5: can be `0`.\n\t\t\treturn !!this.types();\n\t\t}\n\t}, {\n\t\tkey: 'type',\n\t\tvalue: function type(_type) {\n\t\t\tif (this.hasTypes() && getType(this.types(), _type)) {\n\t\t\t\treturn new Type(getType(this.types(), _type), this);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'ext',\n\t\tvalue: function ext() {\n\t\t\tif (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;\n\t\t\treturn this.country_metadata[13] || DEFAULT_EXT_PREFIX;\n\t\t}\n\t}, {\n\t\tkey: 'countryCallingCodes',\n\t\tvalue: function countryCallingCodes() {\n\t\t\tif (this.v1) return this.metadata.country_phone_code_to_countries;\n\t\t\treturn this.metadata.country_calling_codes;\n\t\t}\n\n\t\t// Formatting information for regions which share\n\t\t// a country calling code is contained by only one region\n\t\t// for performance reasons. For example, for NANPA region\n\t\t// (\"North American Numbering Plan Administration\",\n\t\t// which includes USA, Canada, Cayman Islands, Bahamas, etc)\n\t\t// it will be contained in the metadata for `US`.\n\t\t//\n\t\t// `country_calling_code` is always valid.\n\t\t// But the actual country may not necessarily be part of the metadata.\n\t\t//\n\n\t}, {\n\t\tkey: 'chooseCountryByCountryCallingCode',\n\t\tvalue: function chooseCountryByCountryCallingCode(country_calling_code) {\n\t\t\tvar country = this.countryCallingCodes()[country_calling_code][0];\n\n\t\t\t// Do not want to test this case.\n\t\t\t// (custom metadata, not all countries).\n\t\t\t/* istanbul ignore else */\n\t\t\tif (this.hasCountry(country)) {\n\t\t\t\tthis.country(country);\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'selectedCountry',\n\t\tvalue: function selectedCountry() {\n\t\t\treturn this._country;\n\t\t}\n\t}]);\n\n\treturn Metadata;\n}();\n\nexport default Metadata;\n\nvar Format = function () {\n\tfunction Format(format, metadata) {\n\t\t_classCallCheck(this, Format);\n\n\t\tthis._format = format;\n\t\tthis.metadata = metadata;\n\t}\n\n\t_createClass(Format, [{\n\t\tkey: 'pattern',\n\t\tvalue: function pattern() {\n\t\t\treturn this._format[0];\n\t\t}\n\t}, {\n\t\tkey: 'format',\n\t\tvalue: function format() {\n\t\t\treturn this._format[1];\n\t\t}\n\t}, {\n\t\tkey: 'leadingDigitsPatterns',\n\t\tvalue: function leadingDigitsPatterns() {\n\t\t\treturn this._format[2] || [];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixFormattingRule',\n\t\tvalue: function nationalPrefixFormattingRule() {\n\t\t\treturn this._format[3] || this.metadata.nationalPrefixFormattingRule();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function nationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormatting();\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsMandatoryWhenFormatting',\n\t\tvalue: function nationalPrefixIsMandatoryWhenFormatting() {\n\t\t\t// National prefix is omitted if there's no national prefix formatting rule\n\t\t\t// set for this country, or when the national prefix formatting rule\n\t\t\t// contains no national prefix itself, or when this rule is set but\n\t\t\t// national prefix is optional for this phone number format\n\t\t\t// (and it is not enforced explicitly)\n\t\t\treturn this.nationalPrefixFormattingRule() &&\n\t\t\t// Check that national prefix formatting rule is not a dummy one.\n\t\t\t// Check that national prefix formatting rule actually has national prefix digit(s).\n\t\t\tthis.usesNationalPrefix() &&\n\t\t\t// Or maybe national prefix is optional for this format\n\t\t\t!this.nationalPrefixIsOptionalWhenFormatting();\n\t\t}\n\n\t\t// Checks whether national prefix formatting rule contains national prefix\n\n\t}, {\n\t\tkey: 'usesNationalPrefix',\n\t\tvalue: function usesNationalPrefix() {\n\t\t\t// Check that national prefix formatting rule is not a dummy one\n\t\t\treturn this.nationalPrefixFormattingRule() !== '$1' &&\n\t\t\t// Check that national prefix formatting rule actually has national prefix digit(s)\n\t\t\t/\\d/.test(this.nationalPrefixFormattingRule().replace('$1', ''));\n\t\t}\n\t}, {\n\t\tkey: 'internationalFormat',\n\t\tvalue: function internationalFormat() {\n\t\t\treturn this._format[5] || this.format();\n\t\t}\n\t}]);\n\n\treturn Format;\n}();\n\nvar Type = function () {\n\tfunction Type(type, metadata) {\n\t\t_classCallCheck(this, Type);\n\n\t\tthis.type = type;\n\t\tthis.metadata = metadata;\n\t}\n\n\t_createClass(Type, [{\n\t\tkey: 'pattern',\n\t\tvalue: function pattern() {\n\t\t\tif (this.metadata.v1) return this.type;\n\t\t\treturn this.type[0];\n\t\t}\n\t}, {\n\t\tkey: 'possibleLengths',\n\t\tvalue: function possibleLengths() {\n\t\t\tif (this.metadata.v1) return;\n\t\t\treturn this.type[1] || this.metadata.possibleLengths();\n\t\t}\n\t}]);\n\n\treturn Type;\n}();\n\nfunction getType(types, type) {\n\tswitch (type) {\n\t\tcase 'FIXED_LINE':\n\t\t\treturn types[0];\n\t\tcase 'MOBILE':\n\t\t\treturn types[1];\n\t\tcase 'TOLL_FREE':\n\t\t\treturn types[2];\n\t\tcase 'PREMIUM_RATE':\n\t\t\treturn types[3];\n\t\tcase 'PERSONAL_NUMBER':\n\t\t\treturn types[4];\n\t\tcase 'VOICEMAIL':\n\t\t\treturn types[5];\n\t\tcase 'UAN':\n\t\t\treturn types[6];\n\t\tcase 'PAGER':\n\t\t\treturn types[7];\n\t\tcase 'VOIP':\n\t\t\treturn types[8];\n\t\tcase 'SHARED_COST':\n\t\t\treturn types[9];\n\t}\n}\n\nexport function validateMetadata(metadata) {\n\tif (!metadata) {\n\t\tthrow new Error('[libphonenumber-js] `metadata` argument not passed. Check your arguments.');\n\t}\n\n\t// `country_phone_code_to_countries` was renamed to\n\t// `country_calling_codes` in `1.0.18`.\n\tif (!is_object(metadata) || !is_object(metadata.countries) || !is_object(metadata.country_calling_codes) && !is_object(metadata.country_phone_code_to_countries)) {\n\t\tthrow new Error('[libphonenumber-js] `metadata` argument was passed but it\\'s not a valid metadata. Must be an object having `.countries` and `.country_calling_codes` child object properties. Got ' + (is_object(metadata) ? 'an object of shape: { ' + Object.keys(metadata).join(', ') + ' }' : 'a ' + type_of(metadata) + ': ' + metadata) + '.');\n\t}\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar type_of = function type_of(_) {\n\treturn typeof _ === 'undefined' ? 'undefined' : _typeof(_);\n};\n\nexport function getExtPrefix(country, metadata) {\n\treturn new Metadata(metadata).country(country).ext();\n}\n//# sourceMappingURL=metadata.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of 17th November, 2016.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport { parse_phone_number_digits, parse_national_number_and_country_calling_code, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS, MAX_LENGTH_FOR_NSN, matches_entirely, create_extension_pattern } from './common';\n\nimport Metadata from './metadata';\n\nimport get_number_type, { check_number_length_for_type } from './types';\n\nimport { parseRFC3966 } from './RFC3966';\n\n// The minimum length of the national significant number.\nvar MIN_LENGTH_FOR_NSN = 2;\n\n// We don't allow input strings for parsing to be longer than 250 chars.\n// This prevents malicious input from consuming CPU.\nvar MAX_INPUT_STRING_LENGTH = 250;\n\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 */\nvar EXTN_PATTERNS_FOR_PARSING = create_extension_pattern('parsing');\n\n// Regexp of all known extension prefixes used by different regions followed by\n// 1 or more valid digits, for use when parsing.\nvar EXTN_PATTERN = new RegExp('(?:' + EXTN_PATTERNS_FOR_PARSING + ')$', 'i');\n\n// 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//\nvar MIN_LENGTH_PHONE_NUMBER_PATTERN = '[' + VALID_DIGITS + ']{' + MIN_LENGTH_FOR_NSN + '}';\n//\n// And this is the second reg-exp:\n// (see MIN_LENGTH_PHONE_NUMBER_PATTERN for a full description of this reg-exp)\n//\nvar VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\n// The combined regular expression for valid phone numbers:\n//\nvar VALID_PHONE_NUMBER_PATTERN = new RegExp(\n// Either a short two-digit-only phone number\n'^' + MIN_LENGTH_PHONE_NUMBER_PATTERN + '$' + '|' +\n// Or a longer fully parsed phone number (min 3 characters)\n'^' + VALID_PHONE_NUMBER +\n// Phone number extensions\n'(?:' + EXTN_PATTERNS_FOR_PARSING + ')?' + '$', 'i');\n\n// This consists of the plus symbol, digits, and arabic-indic digits.\nvar PHONE_NUMBER_START_PATTERN = new RegExp('[' + PLUS_CHARS + VALID_DIGITS + ']');\n\n// Regular expression of trailing characters that we want to remove.\nvar AFTER_PHONE_NUMBER_END_PATTERN = new RegExp('[^' + VALID_DIGITS + ']+$');\n\nvar default_options = {\n\tcountry: {}\n\n\t// `options`:\n\t// {\n\t// country:\n\t// {\n\t// restrict - (a two-letter country code)\n\t// the phone number must be in this country\n\t//\n\t// default - (a two-letter country code)\n\t// default country to use for phone number parsing and validation\n\t// (if no country code could be derived from the phone number)\n\t// }\n\t// }\n\t//\n\t// Returns `{ country, number }`\n\t//\n\t// Example use cases:\n\t//\n\t// ```js\n\t// parse('8 (800) 555-35-35', 'RU')\n\t// parse('8 (800) 555-35-35', 'RU', metadata)\n\t// parse('8 (800) 555-35-35', { country: { default: 'RU' } })\n\t// parse('8 (800) 555-35-35', { country: { default: 'RU' } }, metadata)\n\t// parse('+7 800 555 35 35')\n\t// parse('+7 800 555 35 35', metadata)\n\t// ```\n\t//\n};export default function parse(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\t// Validate `defaultCountry`.\n\n\n\tif (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {\n\t\tthrow new Error('Unknown country: ' + options.defaultCountry);\n\t}\n\n\t// Parse the phone number.\n\n\tvar _parse_input = parse_input(text),\n\t formatted_phone_number = _parse_input.number,\n\t ext = _parse_input.ext;\n\n\t// If the phone number is not viable then return nothing.\n\n\n\tif (!formatted_phone_number) {\n\t\treturn {};\n\t}\n\n\tvar _parse_phone_number = parse_phone_number(formatted_phone_number, options.defaultCountry, metadata),\n\t country = _parse_phone_number.country,\n\t national_number = _parse_phone_number.national_number,\n\t countryCallingCode = _parse_phone_number.countryCallingCode,\n\t carrierCode = _parse_phone_number.carrierCode;\n\n\tif (!metadata.selectedCountry()) {\n\t\treturn options.extended ? { countryCallingCode: countryCallingCode } : {};\n\t}\n\n\t// Validate national (significant) number length.\n\t//\n\t// A sidenote:\n\t//\n\t// They say that sometimes national (significant) numbers\n\t// can be longer than `MAX_LENGTH_FOR_NSN` (e.g. in Germany).\n\t// https://github.com/googlei18n/libphonenumber/blob/7e1748645552da39c4e1ba731e47969d97bdb539/resources/phonenumber.proto#L36\n\t// Such numbers will just be discarded.\n\t//\n\tif (national_number.length < MIN_LENGTH_FOR_NSN || national_number.length > MAX_LENGTH_FOR_NSN) {\n\t\t// Google's demo just throws an error in this case.\n\t\treturn options.extended ? { countryCallingCode: countryCallingCode } : {};\n\t}\n\n\t// Check if national phone number pattern matches the number\n\t// National number pattern is different for each country,\n\t// even for those ones which are part of the \"NANPA\" group.\n\tvar valid = country && matches_entirely(national_number, new RegExp(metadata.nationalNumberPattern())) ? true : false;\n\n\tif (!options.extended) {\n\t\treturn valid ? result(country, national_number, ext) : {};\n\t}\n\n\treturn {\n\t\tcountry: country,\n\t\tcountryCallingCode: countryCallingCode,\n\t\tcarrierCode: carrierCode,\n\t\tvalid: valid,\n\t\tpossible: valid ? true : options.extended === true && metadata.possibleLengths() && is_possible_number(national_number, countryCallingCode !== undefined, metadata),\n\t\tphone: national_number,\n\t\text: ext\n\t};\n}\n\n// 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//\nexport function is_viable_phone_number(number) {\n\treturn number.length >= MIN_LENGTH_FOR_NSN && matches_entirely(number, VALID_PHONE_NUMBER_PATTERN);\n}\n\n/**\r\n * Extracts a parseable phone number.\r\n * @param {string} text - Input.\r\n * @return {string}.\r\n */\nexport function extract_formatted_phone_number(text) {\n\tif (!text || text.length > MAX_INPUT_STRING_LENGTH) {\n\t\treturn;\n\t}\n\n\t// Attempt to extract a possible number from the string passed in\n\n\tvar starts_at = text.search(PHONE_NUMBER_START_PATTERN);\n\n\tif (starts_at < 0) {\n\t\treturn;\n\t}\n\n\treturn text\n\t// Trim everything to the left of the phone number\n\t.slice(starts_at)\n\t// Remove trailing non-numerical characters\n\t.replace(AFTER_PHONE_NUMBER_END_PATTERN, '');\n}\n\n// Strips any national prefix (such as 0, 1) present in the number provided.\n// \"Carrier codes\" are only used in Colombia and Brazil,\n// and only when dialing within those countries from a mobile phone to a fixed line number.\nexport function strip_national_prefix_and_carrier_code(number, metadata) {\n\tif (!number || !metadata.nationalPrefixForParsing()) {\n\t\treturn { number: number };\n\t}\n\n\t// Attempt to parse the first digits as a national prefix\n\tvar national_prefix_pattern = new RegExp('^(?:' + metadata.nationalPrefixForParsing() + ')');\n\tvar national_prefix_matcher = national_prefix_pattern.exec(number);\n\n\t// If no national prefix is present in the phone number,\n\t// but the national prefix is optional for this country,\n\t// then consider this phone number valid.\n\t//\n\t// Google's reference `libphonenumber` implementation\n\t// wouldn't recognize such phone numbers as valid,\n\t// but I think it would perfectly make sense\n\t// to consider such phone numbers as valid\n\t// because if a national phone number was originally\n\t// formatted without the national prefix\n\t// then it must be parseable back into the original national number.\n\t// In other words, `parse(format(number))`\n\t// must always be equal to `number`.\n\t//\n\tif (!national_prefix_matcher) {\n\t\treturn { number: number };\n\t}\n\n\tvar national_significant_number = void 0;\n\n\t// `national_prefix_for_parsing` capturing groups\n\t// (used only for really messy cases: Argentina, Brazil, Mexico, Somalia)\n\tvar captured_groups_count = national_prefix_matcher.length - 1;\n\n\t// If the national number tranformation is needed then do it.\n\t//\n\t// I don't know what did they mean by `&& national_prefix_matcher[captured_groups_count]`.\n\t// https://github.com/googlei18n/libphonenumber/blob/d978e59c2e6b1ddfb6816cd190e1b62d9a96bc3b/javascript/i18n/phonenumbers/phonenumberutil.js#L3885\n\t// https://github.com/googlei18n/libphonenumber/blob/d978e59c2e6b1ddfb6816cd190e1b62d9a96bc3b/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L2906\n\t//\n\tif (metadata.nationalPrefixTransformRule() && national_prefix_matcher[captured_groups_count]) {\n\t\tnational_significant_number = number.replace(national_prefix_pattern, metadata.nationalPrefixTransformRule());\n\t}\n\t// Else, no transformation is necessary,\n\t// and just strip the national prefix.\n\telse {\n\t\t\tnational_significant_number = number.slice(national_prefix_matcher[0].length);\n\t\t}\n\n\tvar carrierCode = void 0;\n\tif (captured_groups_count > 0) {\n\t\tcarrierCode = national_prefix_matcher[1];\n\t}\n\n\t// The following is done in `get_country_and_national_number_for_local_number()` instead.\n\t//\n\t// // Verify the parsed national (significant) number for this country\n\t// const national_number_rule = new RegExp(metadata.nationalNumberPattern())\n\t// //\n\t// // If the original number (before stripping national prefix) was viable,\n\t// // and the resultant number is not, then prefer the original phone number.\n\t// // This is because for some countries (e.g. Russia) the same digit could be both\n\t// // a national prefix and a leading digit of a valid national phone number,\n\t// // like `8` is the national prefix for Russia and both\n\t// // `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t// if (matches_entirely(number, national_number_rule) &&\n\t// \t\t!matches_entirely(national_significant_number, national_number_rule))\n\t// {\n\t// \treturn number\n\t// }\n\n\t// Return the parsed national (significant) number\n\treturn {\n\t\tnumber: national_significant_number,\n\t\tcarrierCode: carrierCode\n\t};\n}\n\nexport function find_country_code(country_calling_code, national_phone_number, metadata) {\n\t// Is always non-empty, because `country_calling_code` is always valid\n\tvar possible_countries = metadata.countryCallingCodes()[country_calling_code];\n\n\t// If there's just one country corresponding to the country code,\n\t// then just return it, without further phone number digits validation.\n\tif (possible_countries.length === 1) {\n\t\treturn possible_countries[0];\n\t}\n\n\treturn _find_country_code(possible_countries, national_phone_number, metadata.metadata);\n}\n\n// Changes `metadata` `country`.\nfunction _find_country_code(possible_countries, national_phone_number, metadata) {\n\tmetadata = new Metadata(metadata);\n\n\tfor (var _iterator = possible_countries, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar country = _ref;\n\n\t\tmetadata.country(country);\n\n\t\t// Leading digits check would be the simplest one\n\t\tif (metadata.leadingDigits()) {\n\t\t\tif (national_phone_number && national_phone_number.search(metadata.leadingDigits()) === 0) {\n\t\t\t\treturn country;\n\t\t\t}\n\t\t}\n\t\t// Else perform full validation with all of those\n\t\t// fixed-line/mobile/etc regular expressions.\n\t\telse if (get_number_type({ phone: national_phone_number, country: country }, metadata.metadata)) {\n\t\t\t\treturn country;\n\t\t\t}\n\t}\n}\n\n// Sort out arguments\nfunction sort_out_arguments(arg_1, arg_2, arg_3, arg_4) {\n\tvar text = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `parse('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\ttext = arg_1;\n\t} else throw new TypeError('A phone number for parsing must be a string.');\n\n\t// If \"default country\" argument is being passed\n\t// then move it to `options`.\n\t// `parse('88005553535', 'RU', [options], metadata)`.\n\tif (typeof arg_2 === 'string') {\n\t\tif (arg_4) {\n\t\t\toptions = _extends({ defaultCountry: arg_2 }, arg_3);\n\t\t\tmetadata = arg_4;\n\t\t} else {\n\t\t\toptions = { defaultCountry: arg_2 };\n\t\t\tmetadata = arg_3;\n\t\t}\n\t}\n\t// No \"default country\" argument is being passed.\n\t// International phone number is passed.\n\t// `parse('+78005553535', [options], metadata)`.\n\telse {\n\t\t\tif (arg_3) {\n\t\t\t\toptions = arg_2;\n\t\t\t\tmetadata = arg_3;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_2;\n\t\t\t}\n\t\t}\n\n\t// Apply default options.\n\tif (options) {\n\t\toptions = _extends({}, default_options, options);\n\t} else {\n\t\toptions = default_options;\n\t}\n\n\treturn { text: text, options: options, metadata: new Metadata(metadata) };\n}\n\n// 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.\nfunction strip_extension(number) {\n\tvar start = number.search(EXTN_PATTERN);\n\tif (start < 0) {\n\t\treturn {};\n\t}\n\n\t// If we find a potential extension, and the number preceding this is a viable\n\t// number, we assume it is an extension.\n\tvar number_without_extension = number.slice(0, start);\n\t/* istanbul ignore if - seems a bit of a redundant check */\n\tif (!is_viable_phone_number(number_without_extension)) {\n\t\treturn {};\n\t}\n\n\tvar matches = number.match(EXTN_PATTERN);\n\tvar i = 1;\n\twhile (i < matches.length) {\n\t\tif (matches[i] != null && matches[i].length > 0) {\n\t\t\treturn {\n\t\t\t\tnumber: number_without_extension,\n\t\t\t\text: matches[i]\n\t\t\t};\n\t\t}\n\t\ti++;\n\t}\n}\n\nfunction is_possible_number(national_number, is_international, metadata) {\n\tswitch (check_number_length_for_type(national_number, undefined, metadata)) {\n\t\tcase 'IS_POSSIBLE':\n\t\t\treturn true;\n\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t// \treturn !is_international\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\n/**\r\n * @param {string} text - Input.\r\n * @return {object} `{ ?number, ?ext }`.\r\n */\nfunction parse_input(text) {\n\t// Parse RFC 3966 phone number URI.\n\tif (text && text.indexOf('tel:') === 0) {\n\t\treturn parseRFC3966(text);\n\t}\n\n\tvar number = extract_formatted_phone_number(text);\n\n\t// If the phone number is not viable, then abort.\n\tif (!number || !is_viable_phone_number(number)) {\n\t\treturn {};\n\t}\n\n\t// Attempt to parse extension first, since it doesn't require region-specific\n\t// data and we want to have the non-normalised number here.\n\tvar with_extension_stripped = strip_extension(number);\n\tif (with_extension_stripped.ext) {\n\t\treturn with_extension_stripped;\n\t}\n\n\treturn { number: number };\n}\n\n/**\r\n * Creates `parse()` result object.\r\n */\nfunction result(country, national_number, ext) {\n\tvar result = {\n\t\tcountry: country,\n\t\tphone: national_number\n\t};\n\n\tif (ext) {\n\t\tresult.ext = ext;\n\t}\n\n\treturn result;\n}\n\n/**\r\n * Parses a viable phone number.\r\n * Returns `{ country, countryCallingCode, national_number }`.\r\n */\nfunction parse_phone_number(formatted_phone_number, default_country, metadata) {\n\tvar _parse_national_numbe = parse_national_number_and_country_calling_code(formatted_phone_number, default_country, metadata),\n\t countryCallingCode = _parse_national_numbe.countryCallingCode,\n\t number = _parse_national_numbe.number;\n\n\tif (!number) {\n\t\treturn { countryCallingCode: countryCallingCode };\n\t}\n\n\tvar country = void 0;\n\n\t// Attempt to extract country from international phone number.\n\tif (countryCallingCode) {\n\t\t// Sometimes there are several countries\n\t\t// corresponding to the same country phone code\n\t\t// (e.g. NANPA countries all having `1` country phone code).\n\t\t// Therefore, to reliably determine the exact country,\n\t\t// national (significant) number should have been parsed first.\n\t\t//\n\t\t// When `metadata.json` is generated, all \"ambiguous\" country phone codes\n\t\t// get their countries populated with the full set of\n\t\t// \"phone number type\" regular expressions.\n\t\t//\n\t\tcountry = find_country_code(countryCallingCode, number, metadata);\n\n\t\tif (country) {\n\t\t\tmetadata.country(country);\n\t\t} else {\n\t\t\t// Formatting information for regions which share\n\t\t\t// a country calling code is contained by only one region\n\t\t\t// for performance reasons. For example, for NANPA region\n\t\t\t// (\"North American Numbering Plan Administration\",\n\t\t\t// which includes USA, Canada, Cayman Islands, Bahamas, etc)\n\t\t\t// it will be contained in the metadata for `US`.\n\t\t\tmetadata.chooseCountryByCountryCallingCode(countryCallingCode);\n\t\t}\n\t} else if (default_country) {\n\t\tcountry = default_country;\n\t\tmetadata.country(country);\n\t\tcountryCallingCode = metadata.countryCallingCode();\n\t} else return {};\n\n\t// Parsing national prefixes and carrier codes\n\t// is only required for local phone numbers\n\t// but some people don't understand that\n\t// and sometimes write international phone numbers\n\t// with national prefixes (or maybe even carrier codes).\n\t// http://ucken.blogspot.ru/2016/03/trunk-prefixes-in-skype4b.html\n\t// Google's original library forgives such mistakes\n\t// and so does this library, because it has been requested:\n\t// https://github.com/catamphetamine/libphonenumber-js/issues/127\n\n\tvar _parse_national_numbe2 = parse_national_number(number, metadata),\n\t national_number = _parse_national_numbe2.national_number,\n\t carrier_code = _parse_national_numbe2.carrier_code;\n\n\treturn {\n\t\tcountry: country,\n\t\tcountryCallingCode: countryCallingCode,\n\t\tnational_number: national_number,\n\t\tcarrierCode: carrier_code\n\t};\n}\n\nfunction parse_national_number(number, metadata) {\n\tvar national_number = parse_phone_number_digits(number);\n\tvar carrier_code = void 0;\n\n\t// Only strip national prefixes for non-international phone numbers\n\t// because national prefixes can't be present in international phone numbers.\n\t// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`\n\t// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,\n\t// and then it would assume that's a valid number which it isn't.\n\t// So no forgiveness for grandmas here.\n\t// The issue asking for this fix:\n\t// https://github.com/catamphetamine/libphonenumber-js/issues/159\n\n\tvar _strip_national_prefi = strip_national_prefix_and_carrier_code(national_number, metadata),\n\t potential_national_number = _strip_national_prefi.number,\n\t carrierCode = _strip_national_prefi.carrierCode;\n\n\t// If metadata has \"possible lengths\" then employ the new algorythm.\n\n\n\tif (metadata.possibleLengths()) {\n\t\t// We require that the NSN remaining after stripping the national prefix and\n\t\t// carrier code be long enough to be a possible length for the region.\n\t\t// Otherwise, we don't do the stripping, since the original number could be\n\t\t// a valid short number.\n\t\tswitch (check_number_length_for_type(potential_national_number, undefined, metadata)) {\n\t\t\tcase 'TOO_SHORT':\n\t\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t\tcase 'INVALID_LENGTH':\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnational_number = potential_national_number;\n\t\t\t\tcarrier_code = carrierCode;\n\t\t}\n\t} else {\n\t\t// If the original number (before stripping national prefix) was viable,\n\t\t// and the resultant number is not, then prefer the original phone number.\n\t\t// This is because for some countries (e.g. Russia) the same digit could be both\n\t\t// a national prefix and a leading digit of a valid national phone number,\n\t\t// like `8` is the national prefix for Russia and both\n\t\t// `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t\tif (matches_entirely(national_number, metadata.nationalNumberPattern()) && !matches_entirely(potential_national_number, metadata.nationalNumberPattern())) {\n\t\t\t// Keep the number without stripping national prefix.\n\t\t} else {\n\t\t\tnational_number = potential_national_number;\n\t\t\tcarrier_code = carrierCode;\n\t\t}\n\t}\n\n\treturn {\n\t\tnational_number: national_number,\n\t\tcarrier_code: carrier_code\n\t};\n}\n\n// Determines the country for a given (possibly incomplete) phone number.\n// export function get_country_from_phone_number(number, metadata)\n// {\n// \treturn parse_phone_number(number, null, metadata).country\n// }\n//# sourceMappingURL=parse.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nimport parse, { is_viable_phone_number } from './parse';\n\nimport { matches_entirely } from './common';\n\nimport Metadata from './metadata';\n\nvar non_fixed_line_types = ['MOBILE', 'PREMIUM_RATE', 'TOLL_FREE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL'];\n\n// Finds out national phone number type (fixed line, mobile, etc)\nexport default function get_number_type(arg_1, arg_2, arg_3) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3),\n\t input = _sort_out_arguments.input,\n\t metadata = _sort_out_arguments.metadata;\n\n\t// When no input was passed\n\n\n\tif (!input) {\n\t\treturn;\n\t}\n\n\t// When `parse()` returned `{}`\n\t// meaning that the phone number is not a valid one.\n\tif (!input.country) {\n\t\treturn;\n\t}\n\n\tif (!metadata.hasCountry(input.country)) {\n\t\tthrow new Error('Unknown country: ' + input.country);\n\t}\n\n\tvar national_number = input.phone;\n\tmetadata.country(input.country);\n\n\t// The following is copy-pasted from the original function:\n\t// https://github.com/googlei18n/libphonenumber/blob/3ea547d4fbaa2d0b67588904dfa5d3f2557c27ff/javascript/i18n/phonenumbers/phonenumberutil.js#L2835\n\n\t// Is this national number even valid for this country\n\tif (!matches_entirely(national_number, metadata.nationalNumberPattern())) {\n\t\treturn;\n\t}\n\n\t// Is it fixed line number\n\tif (is_of_type(national_number, 'FIXED_LINE', metadata)) {\n\t\t// Because duplicate regular expressions are removed\n\t\t// to reduce metadata size, if \"mobile\" pattern is \"\"\n\t\t// then it means it was removed due to being a duplicate of the fixed-line pattern.\n\t\t//\n\t\tif (metadata.type('MOBILE') && metadata.type('MOBILE').pattern() === '') {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\t// v1 metadata.\n\t\t// Legacy.\n\t\t// Deprecated.\n\t\tif (!metadata.type('MOBILE')) {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\t// Check if the number happens to qualify as both fixed line and mobile.\n\t\t// (no such country in the minimal metadata set)\n\t\t/* istanbul ignore if */\n\t\tif (is_of_type(national_number, 'MOBILE', metadata)) {\n\t\t\treturn 'FIXED_LINE_OR_MOBILE';\n\t\t}\n\n\t\treturn 'FIXED_LINE';\n\t}\n\n\tfor (var _iterator = non_fixed_line_types, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar _type = _ref;\n\n\t\tif (is_of_type(national_number, _type, metadata)) {\n\t\t\treturn _type;\n\t\t}\n\t}\n}\n\nexport function is_of_type(national_number, type, metadata) {\n\ttype = metadata.type(type);\n\n\tif (!type || !type.pattern()) {\n\t\treturn false;\n\t}\n\n\t// Check if any possible number lengths are present;\n\t// if so, we use them to avoid checking\n\t// the validation pattern if they don't match.\n\t// If they are absent, this means they match\n\t// the general description, which we have\n\t// already checked before a specific number type.\n\tif (type.possibleLengths() && type.possibleLengths().indexOf(national_number.length) < 0) {\n\t\treturn false;\n\t}\n\n\treturn matches_entirely(national_number, type.pattern());\n}\n\n// Sort out arguments\nexport function sort_out_arguments(arg_1, arg_2, arg_3) {\n\tvar input = void 0;\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `getNumberType('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\t// If \"resrict country\" argument is being passed\n\t\t// then convert it to an `options` object.\n\t\t// `getNumberType('88005553535', 'RU', metadata)`.\n\t\tif (typeof arg_2 === 'string' || arg_2 === undefined) {\n\t\t\tmetadata = arg_3;\n\n\t\t\t// `parse` extracts phone numbers from raw text,\n\t\t\t// therefore it will cut off all \"garbage\" characters,\n\t\t\t// while this `validate` function needs to verify\n\t\t\t// that the phone number contains no \"garbage\"\n\t\t\t// therefore the explicit `is_viable_phone_number` check.\n\t\t\tif (is_viable_phone_number(arg_1)) {\n\t\t\t\tinput = parse(arg_1, arg_2, metadata);\n\t\t\t}\n\t\t}\n\t\t// No \"resrict country\" argument is being passed.\n\t\t// International phone number is passed.\n\t\t// `getNumberType('+78005553535', metadata)`.\n\t\telse {\n\t\t\t\tmetadata = arg_2;\n\n\t\t\t\t// `parse` extracts phone numbers from raw text,\n\t\t\t\t// therefore it will cut off all \"garbage\" characters,\n\t\t\t\t// while this `validate` function needs to verify\n\t\t\t\t// that the phone number contains no \"garbage\"\n\t\t\t\t// therefore the explicit `is_viable_phone_number` check.\n\t\t\t\tif (is_viable_phone_number(arg_1)) {\n\t\t\t\t\tinput = parse(arg_1, metadata);\n\t\t\t\t}\n\t\t\t}\n\t}\n\t// If the phone number is passed as a parsed phone number.\n\t// `getNumberType({ phone: '88005553535', country: 'RU' }, ...)`.\n\telse if (is_object(arg_1) && typeof arg_1.phone === 'string') {\n\t\t\t// The `arg_1` must be a valid phone number\n\t\t\t// as a whole, not just a part of it which gets parsed here.\n\t\t\tif (is_viable_phone_number(arg_1.phone)) {\n\t\t\t\tinput = arg_1;\n\t\t\t}\n\n\t\t\tmetadata = arg_2;\n\t\t} else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n\treturn { input: input, metadata: new Metadata(metadata) };\n}\n\n// Should only be called for the \"new\" metadata which has \"possible lengths\".\nexport function check_number_length_for_type(national_number, type, metadata) {\n\tvar type_info = metadata.type(type);\n\n\t// There should always be \"\" set for every type element.\n\t// This is declared in the XML schema.\n\t// For size efficiency, where a sub-description (e.g. fixed-line)\n\t// has the same \"\" as the \"general description\", this is missing,\n\t// so we fall back to the \"general description\". Where no numbers of the type\n\t// exist at all, there is one possible length (-1) which is guaranteed\n\t// not to match the length of any real phone number.\n\tvar possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();\n\t// let local_lengths = type_info && type.possibleLengthsLocal() || metadata.possibleLengthsLocal()\n\n\tif (type === 'FIXED_LINE_OR_MOBILE') {\n\t\t// No such country in metadata.\n\t\t/* istanbul ignore next */\n\t\tif (!metadata.type('FIXED_LINE')) {\n\t\t\t// The rare case has been encountered where no fixedLine data is available\n\t\t\t// (true for some non-geographical entities), so we just check mobile.\n\t\t\treturn test_number_length_for_type(national_number, 'MOBILE', metadata);\n\t\t}\n\n\t\tvar mobile_type = metadata.type('MOBILE');\n\n\t\tif (mobile_type) {\n\t\t\t// Merge the mobile data in if there was any. \"Concat\" creates a new\n\t\t\t// array, it doesn't edit possible_lengths in place, so we don't need a copy.\n\t\t\t// Note that when adding the possible lengths from mobile, we have\n\t\t\t// to again check they aren't empty since if they are this indicates\n\t\t\t// they are the same as the general desc and should be obtained from there.\n\t\t\tpossible_lengths = merge_arrays(possible_lengths, mobile_type.possibleLengths());\n\t\t\t// The current list is sorted; we need to merge in the new list and\n\t\t\t// re-sort (duplicates are okay). Sorting isn't so expensive because\n\t\t\t// the lists are very small.\n\n\t\t\t// if (local_lengths)\n\t\t\t// {\n\t\t\t// \tlocal_lengths = merge_arrays(local_lengths, mobile_type.possibleLengthsLocal())\n\t\t\t// }\n\t\t\t// else\n\t\t\t// {\n\t\t\t// \tlocal_lengths = mobile_type.possibleLengthsLocal()\n\t\t\t// }\n\t\t}\n\t}\n\t// If the type doesn't exist then return 'INVALID_LENGTH'.\n\telse if (type && !type_info) {\n\t\t\treturn 'INVALID_LENGTH';\n\t\t}\n\n\tvar actual_length = national_number.length;\n\n\t// // This is safe because there is never an overlap beween the possible lengths\n\t// // and the local-only lengths; this is checked at build time.\n\t// if (local_lengths && local_lengths.indexOf(national_number.length) >= 0)\n\t// {\n\t// \treturn 'IS_POSSIBLE_LOCAL_ONLY'\n\t// }\n\n\tvar minimum_length = possible_lengths[0];\n\n\tif (minimum_length === actual_length) {\n\t\treturn 'IS_POSSIBLE';\n\t}\n\n\tif (minimum_length > actual_length) {\n\t\treturn 'TOO_SHORT';\n\t}\n\n\tif (possible_lengths[possible_lengths.length - 1] < actual_length) {\n\t\treturn 'TOO_LONG';\n\t}\n\n\t// We skip the first element since we've already checked it.\n\treturn possible_lengths.indexOf(actual_length, 1) >= 0 ? 'IS_POSSIBLE' : 'INVALID_LENGTH';\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\nexport function merge_arrays(a, b) {\n\tvar merged = a.slice();\n\n\tfor (var _iterator2 = b, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n\t\tvar _ref2;\n\n\t\tif (_isArray2) {\n\t\t\tif (_i2 >= _iterator2.length) break;\n\t\t\t_ref2 = _iterator2[_i2++];\n\t\t} else {\n\t\t\t_i2 = _iterator2.next();\n\t\t\tif (_i2.done) break;\n\t\t\t_ref2 = _i2.value;\n\t\t}\n\n\t\tvar element = _ref2;\n\n\t\tif (a.indexOf(element) < 0) {\n\t\t\tmerged.push(element);\n\t\t}\n\t}\n\n\treturn merged.sort(function (a, b) {\n\t\treturn a - b;\n\t});\n\n\t// ES6 version, requires Set polyfill.\n\t// let merged = new Set(a)\n\t// for (const element of b)\n\t// {\n\t// \tmerged.add(i)\n\t// }\n\t// return Array.from(merged).sort((a, b) => a - b)\n}\n//# sourceMappingURL=types.js.map","var _slicedToArray = function () { function sliceIterator(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\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nimport { is_viable_phone_number } from './parse';\n\n// 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 */\nexport function parseRFC3966(text) {\n\tvar number = void 0;\n\tvar ext = void 0;\n\n\tfor (var _iterator = text.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar part = _ref;\n\n\t\tvar _part$split = part.split(':'),\n\t\t _part$split2 = _slicedToArray(_part$split, 2),\n\t\t name = _part$split2[0],\n\t\t value = _part$split2[1];\n\n\t\tswitch (name) {\n\t\t\tcase 'tel':\n\t\t\t\tnumber = value;\n\t\t\t\tbreak;\n\t\t\tcase 'ext':\n\t\t\t\text = value;\n\t\t\t\tbreak;\n\t\t\tcase 'phone-context':\n\t\t\t\t// Only \"country contexts\" are supported.\n\t\t\t\t// \"Domain contexts\" are ignored.\n\t\t\t\tif (value[0] === '+') {\n\t\t\t\t\tnumber = value + number;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t// If the phone number is not viable, then abort.\n\tif (!is_viable_phone_number(number)) {\n\t\treturn {};\n\t}\n\n\tvar result = { number: number };\n\tif (ext) {\n\t\tresult.ext = ext;\n\t}\n\treturn result;\n}\n\n/**\r\n * @param {object} - `{ ?number, ?extension }`.\r\n * @return {string} Phone URI (RFC 3966).\r\n */\nexport function formatRFC3966(_ref2) {\n\tvar number = _ref2.number,\n\t ext = _ref2.ext;\n\n\tif (!number) {\n\t\treturn '';\n\t}\n\n\tif (number[0] !== '+') {\n\t\tthrow new Error('\"formatRFC3966()\" expects \"number\" to be in E.164 format.');\n\t}\n\n\treturn 'tel:' + number + (ext ? ';ext=' + ext : '');\n}\n//# sourceMappingURL=RFC3966.js.map","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n// This is a port of Google Android `libphonenumber`'s\n// `phonenumberutil.js` of 17th November, 2016.\n//\n// https://github.com/googlei18n/libphonenumber/commits/master/javascript/i18n/phonenumbers/phonenumberutil.js\n\nimport { parse_national_number_and_country_calling_code, VALID_PUNCTUATION, matches_entirely } from './common';\n\nimport { getIDDPrefix } from './IDD';\n\nimport Metadata from './metadata';\n\nimport { formatRFC3966 } from './RFC3966';\n\nvar defaultOptions = {\n\tformatExtension: function formatExtension(number, extension, metadata) {\n\t\treturn '' + number + metadata.ext() + extension;\n\t}\n\n\t// Formats a phone number\n\t//\n\t// Example use cases:\n\t//\n\t// ```js\n\t// format('8005553535', 'RU', 'International')\n\t// format('8005553535', 'RU', 'International', metadata)\n\t// format({ phone: '8005553535', country: 'RU' }, 'International')\n\t// format({ phone: '8005553535', country: 'RU' }, 'International', metadata)\n\t// format('+78005553535', 'National')\n\t// format('+78005553535', 'National', metadata)\n\t// ```\n\t//\n};export default function format(arg_1, arg_2, arg_3, arg_4, arg_5) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4, arg_5),\n\t input = _sort_out_arguments.input,\n\t format_type = _sort_out_arguments.format_type,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tif (input.country && metadata.hasCountry(input.country)) {\n\t\tmetadata.country(input.country);\n\t}\n\n\tvar _parse_national_numbe = parse_national_number_and_country_calling_code(input.phone, null, metadata),\n\t countryCallingCode = _parse_national_numbe.countryCallingCode,\n\t number = _parse_national_numbe.number;\n\n\tcountryCallingCode = countryCallingCode || input.countryCallingCode;\n\n\tif (countryCallingCode) {\n\t\t// Check country restriction\n\t\tif (input.country && metadata.selectedCountry() && countryCallingCode !== metadata.countryCallingCode()) {\n\t\t\treturn input.phone;\n\t\t}\n\n\t\tmetadata.chooseCountryByCountryCallingCode(countryCallingCode);\n\t}\n\n\tif (!metadata.selectedCountry()) {\n\t\treturn input.phone;\n\t}\n\n\tswitch (format_type) {\n\t\tcase 'International':\n\t\t\tif (!number) {\n\t\t\t\treturn '+' + metadata.countryCallingCode();\n\t\t\t}\n\t\t\tnumber = format_national_number(number, 'International', false, metadata);\n\t\t\tnumber = '+' + metadata.countryCallingCode() + ' ' + number;\n\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\n\t\tcase 'E.164':\n\t\t\t// `E.164` doesn't define \"phone number extensions\".\n\t\t\treturn '+' + metadata.countryCallingCode() + input.phone;\n\n\t\tcase 'RFC3966':\n\t\t\treturn formatRFC3966({\n\t\t\t\tnumber: '+' + metadata.countryCallingCode() + input.phone,\n\t\t\t\text: input.ext\n\t\t\t});\n\n\t\tcase 'IDD':\n\t\t\tif (!options.fromCountry) {\n\t\t\t\treturn;\n\t\t\t\t// throw new Error('`fromCountry` option not passed for IDD-prefixed formatting.')\n\t\t\t}\n\t\t\tvar IDDPrefix = getIDDPrefix(options.fromCountry, metadata.metadata);\n\t\t\tif (!IDDPrefix) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (options.humanReadable) {\n\t\t\t\tvar formattedForSameCountryCallingCode = countryCallingCode && formatIDDSameCountryCallingCodeNumber(number, countryCallingCode, options.fromCountry, metadata);\n\t\t\t\tif (formattedForSameCountryCallingCode) {\n\t\t\t\t\tnumber = formattedForSameCountryCallingCode;\n\t\t\t\t} else {\n\t\t\t\t\tnumber = IDDPrefix + ' ' + metadata.countryCallingCode() + ' ' + format_national_number(number, 'International', false, metadata);\n\t\t\t\t}\n\t\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\t\t\t}\n\t\t\treturn '' + IDDPrefix + metadata.countryCallingCode() + number;\n\n\t\tcase 'National':\n\t\t\tif (!number) {\n\t\t\t\treturn '';\n\t\t\t}\n\t\t\tnumber = format_national_number(number, 'National', false, metadata);\n\t\t\treturn add_extension(number, input.ext, metadata, options.formatExtension);\n\t}\n}\n\n// 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.\nexport var FIRST_GROUP_PATTERN = /(\\$\\d)/;\n\nexport function format_national_number_using_format(number, format, international, enforce_national_prefix, metadata) {\n\tvar format_pattern_matcher = new RegExp(format.pattern());\n\n\t// National prefix is omitted if there's no national prefix formatting rule\n\t// set for this country, or when this rule is set but\n\t// national prefix is optional for this phone number format\n\t// (and it is not enforced explicitly)\n\tvar national_prefix_may_be_omitted = !format.nationalPrefixFormattingRule() || format.nationalPrefixFormattingRule() && format.nationalPrefixIsOptionalWhenFormatting() && !enforce_national_prefix;\n\n\tif (!international && !national_prefix_may_be_omitted) {\n\t\treturn number.replace(format_pattern_matcher, format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()));\n\t}\n\n\tvar formatted_number = number.replace(format_pattern_matcher, international ? format.internationalFormat() : format.format());\n\n\tif (international) {\n\t\treturn local_to_international_style(formatted_number);\n\t}\n\n\treturn formatted_number;\n}\n\nfunction format_national_number(number, format_as, enforce_national_prefix, metadata) {\n\tvar format = choose_format_for_number(metadata.formats(), number);\n\n\tif (!format) {\n\t\treturn number;\n\t}\n\n\treturn format_national_number_using_format(number, format, format_as === 'International', enforce_national_prefix, metadata);\n}\n\nexport function choose_format_for_number(available_formats, national_number) {\n\tfor (var _iterator = available_formats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\tvar _ref;\n\n\t\tif (_isArray) {\n\t\t\tif (_i >= _iterator.length) break;\n\t\t\t_ref = _iterator[_i++];\n\t\t} else {\n\t\t\t_i = _iterator.next();\n\t\t\tif (_i.done) break;\n\t\t\t_ref = _i.value;\n\t\t}\n\n\t\tvar _format = _ref;\n\n\t\t// Validate leading digits\n\t\tif (_format.leadingDigitsPatterns().length > 0) {\n\t\t\t// The last leading_digits_pattern is used here, as it is the most detailed\n\t\t\tvar last_leading_digits_pattern = _format.leadingDigitsPatterns()[_format.leadingDigitsPatterns().length - 1];\n\n\t\t\t// If leading digits don't match then move on to the next phone number format\n\t\t\tif (national_number.search(last_leading_digits_pattern) !== 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\t// Check that the national number matches the phone number format regular expression\n\t\tif (matches_entirely(national_number, new RegExp(_format.pattern()))) {\n\t\t\treturn _format;\n\t\t}\n\t}\n}\n\n// Removes brackets and replaces dashes with spaces.\n//\n// E.g. \"(999) 111-22-33\" -> \"999 111 22 33\"\n//\nexport function local_to_international_style(local) {\n\treturn local.replace(new RegExp('[' + VALID_PUNCTUATION + ']+', 'g'), ' ').trim();\n}\n\n// Sort out arguments\nfunction sort_out_arguments(arg_1, arg_2, arg_3, arg_4, arg_5) {\n\tvar input = void 0;\n\tvar format_type = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// Sort out arguments.\n\n\t// If the phone number is passed as a string.\n\t// `format('8005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\t// If country code is supplied.\n\t\t// `format('8005553535', 'RU', 'National', [options], metadata)`.\n\t\tif (typeof arg_3 === 'string') {\n\t\t\t// Will be `parse()`d later in code\n\t\t\tinput = {\n\t\t\t\tphone: arg_1,\n\t\t\t\tcountry: arg_2\n\t\t\t};\n\n\t\t\tformat_type = arg_3;\n\n\t\t\tif (arg_5) {\n\t\t\t\toptions = arg_4;\n\t\t\t\tmetadata = arg_5;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_4;\n\t\t\t}\n\t\t}\n\t\t// Just an international phone number is supplied\n\t\t// `format('+78005553535', 'National', [options], metadata)`.\n\t\telse {\n\t\t\t\t// Will be `parse()`d later in code\n\t\t\t\tinput = {\n\t\t\t\t\tphone: arg_1\n\t\t\t\t};\n\n\t\t\t\tif (typeof arg_2 !== 'string') {\n\t\t\t\t\tthrow new Error('Format type argument not passed for `format()`');\n\t\t\t\t}\n\n\t\t\t\tformat_type = arg_2;\n\n\t\t\t\tif (arg_4) {\n\t\t\t\t\toptions = arg_3;\n\t\t\t\t\tmetadata = arg_4;\n\t\t\t\t} else {\n\t\t\t\t\tmetadata = arg_3;\n\t\t\t\t}\n\t\t\t}\n\t}\n\t// If the phone number is passed as a parsed number object.\n\t// `format({ phone: '8005553535', country: 'RU' }, 'National', [options], metadata)`.\n\telse if (is_object(arg_1) && typeof arg_1.phone === 'string') {\n\t\t\tinput = arg_1;\n\t\t\tformat_type = arg_2;\n\n\t\t\tif (arg_4) {\n\t\t\t\toptions = arg_3;\n\t\t\t\tmetadata = arg_4;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_3;\n\t\t\t}\n\t\t} else throw new TypeError('A phone number must either be a string or an object of shape { phone, [country] }.');\n\n\t// Validate `format_type`.\n\tswitch (format_type) {\n\t\tcase 'International':\n\t\tcase 'E.164':\n\t\tcase 'National':\n\t\tcase 'RFC3966':\n\t\tcase 'IDD':\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error('Unknown format type argument passed to \"format()\": \"' + format_type + '\"');\n\t}\n\n\t// Apply default options.\n\tif (options) {\n\t\toptions = _extends({}, defaultOptions, options);\n\t} else {\n\t\toptions = defaultOptions;\n\t}\n\n\treturn { input: input, format_type: format_type, options: options, metadata: new Metadata(metadata) };\n}\n\n// Babel transforms `typeof` into some \"branches\"\n// so istanbul will show this as \"branch not covered\".\n/* istanbul ignore next */\nvar is_object = function is_object(_) {\n\treturn (typeof _ === 'undefined' ? 'undefined' : _typeof(_)) === 'object';\n};\n\nfunction add_extension(number, ext, metadata, formatExtension) {\n\treturn ext ? formatExtension(number, ext, metadata) : number;\n}\n\nexport function formatIDDSameCountryCallingCodeNumber(number, toCountryCallingCode, fromCountry, toCountryMetadata) {\n\tvar fromCountryMetadata = new Metadata(toCountryMetadata.metadata);\n\tfromCountryMetadata.country(fromCountry);\n\n\t// If calling within the same country calling code.\n\tif (toCountryCallingCode === fromCountryMetadata.countryCallingCode()) {\n\t\t// For NANPA regions, return the national format for these regions\n\t\t// but prefix it with the country calling code.\n\t\tif (toCountryCallingCode === '1') {\n\t\t\treturn toCountryCallingCode + ' ' + format_national_number(number, 'National', false, toCountryMetadata);\n\t\t}\n\n\t\t// If regions share a country calling code, the country calling code need\n\t\t// not be dialled. This also applies when dialling within a region, so this\n\t\t// if clause covers both these cases. Technically this is the case for\n\t\t// dialling from La Reunion to other overseas departments of France (French\n\t\t// Guiana, Martinique, Guadeloupe), but not vice versa - so we don't cover\n\t\t// this edge case for now and for those cases return the version including\n\t\t// country calling code. Details here:\n\t\t// http://www.petitfute.com/voyage/225-info-pratiques-reunion\n\t\treturn format_national_number(number, 'National', false, toCountryMetadata);\n\t}\n}\n//# sourceMappingURL=format.js.map","import Metadata from './metadata';\nimport { matches_entirely, VALID_DIGITS } from './common';\n\nvar CAPTURING_DIGIT_PATTERN = new RegExp('([' + VALID_DIGITS + '])');\n\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 */\nvar SINGLE_IDD_PREFIX = /[\\d]+(?:[~\\u2053\\u223C\\uFF5E][\\d]+)?/;\n\n// export function isSingleIDDPrefix(IDDPrefix)\n// {\n// \treturn matches_entirely(IDDPrefix, SINGLE_IDD_PREFIX)\n// }\n\n// For regions that have multiple IDD prefixes\n// a preferred IDD prefix is returned.\nexport function getIDDPrefix(country, metadata) {\n\tvar countryMetadata = new Metadata(metadata);\n\tcountryMetadata.country(country);\n\n\tif (matches_entirely(countryMetadata.IDDPrefix(), SINGLE_IDD_PREFIX)) {\n\t\treturn countryMetadata.IDDPrefix();\n\t}\n\n\treturn countryMetadata.defaultIDDPrefix();\n}\n\nexport function stripIDDPrefix(number, country, metadata) {\n\tif (!country) {\n\t\treturn;\n\t}\n\n\t// Check if the number is IDD-prefixed.\n\n\tvar countryMetadata = new Metadata(metadata);\n\tcountryMetadata.country(country);\n\n\tvar IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());\n\n\tif (number.search(IDDPrefixPattern) !== 0) {\n\t\treturn;\n\t}\n\n\t// Strip IDD prefix.\n\tnumber = number.slice(number.match(IDDPrefixPattern)[0].length);\n\n\t// Some kind of a weird edge case.\n\t// No explanation from Google given.\n\tvar matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);\n\t/* istanbul ignore next */\n\tif (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {\n\t\tif (matchedGroups[1] === '0') {\n\t\t\treturn;\n\t\t}\n\t}\n\n\treturn number;\n}\n//# sourceMappingURL=IDD.js.map","var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// This is an enhanced port of Google Android `libphonenumber`'s\n// `asyoutypeformatter.js` of 17th November, 2016.\n//\n// https://github.com/googlei18n/libphonenumber/blob/8d21a365061de2ba0675c878a710a7b24f74d2ae/javascript/i18n/phonenumbers/asyoutypeformatter.js\n\nimport Metadata from './metadata';\n\nimport { matches_entirely, VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS, parse_phone_number_digits, parse_national_number_and_country_calling_code } from './common';\n\nimport { extract_formatted_phone_number, find_country_code, strip_national_prefix_and_carrier_code } from './parse';\n\nimport { FIRST_GROUP_PATTERN, format_national_number_using_format, local_to_international_style } from './format';\n\nimport { check_number_length_for_type } from './types';\n\n// Used in phone number format template creation.\n// Could be any digit, I guess.\nvar DUMMY_DIGIT = '9';\nvar DUMMY_DIGIT_MATCHER = new RegExp(DUMMY_DIGIT, 'g');\n// I don't know why is it exactly `15`\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;\n// 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.\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);\n\n// The digits that have not been entered yet will be represented by a \\u2008,\n// the punctuation space.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);\nvar DIGIT_PLACEHOLDER_MATCHER_GLOBAL = new RegExp(DIGIT_PLACEHOLDER, 'g');\n\n// A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\nvar CHARACTER_CLASS_PATTERN = /\\[([^\\[\\]])*\\]/g;\n\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.\nvar STANDALONE_DIGIT_PATTERN = /\\d(?=[^,}][^,}])/g;\n\n// A pattern that is used to determine if a `format` is eligible\n// to be used by the \"as you type formatter\".\n// It is eligible when the `format` contains groups of the dollar sign\n// followed by a single digit, separated by valid phone number punctuation.\n// This prevents invalid punctuation (such as the star sign in Israeli star numbers)\n// getting into the output of the \"as you type formatter\".\nvar ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)+' + '$');\n\n// 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.\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar VALID_INCOMPLETE_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\nvar VALID_INCOMPLETE_PHONE_NUMBER_PATTERN = new RegExp('^' + VALID_INCOMPLETE_PHONE_NUMBER + '$', 'i');\n\nvar AsYouType = function () {\n\n\t/**\r\n * @param {string} [country_code] - The default country used for parsing non-international phone numbers.\r\n * @param {Object} metadata\r\n */\n\tfunction AsYouType(country_code, metadata) {\n\t\t_classCallCheck(this, AsYouType);\n\n\t\tthis.options = {};\n\n\t\tthis.metadata = new Metadata(metadata);\n\n\t\tif (country_code && this.metadata.hasCountry(country_code)) {\n\t\t\tthis.default_country = country_code;\n\t\t}\n\n\t\tthis.reset();\n\t}\n\t// Not setting `options` to a constructor argument\n\t// not to break backwards compatibility\n\t// for older versions of the library.\n\n\n\t_createClass(AsYouType, [{\n\t\tkey: 'input',\n\t\tvalue: function input(text) {\n\t\t\t// Parse input\n\n\t\t\tvar extracted_number = extract_formatted_phone_number(text) || '';\n\n\t\t\t// Special case for a lone '+' sign\n\t\t\t// since it's not considered a possible phone number.\n\t\t\tif (!extracted_number) {\n\t\t\t\tif (text && text.indexOf('+') >= 0) {\n\t\t\t\t\textracted_number = '+';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate possible first part of a phone number\n\t\t\tif (!matches_entirely(extracted_number, VALID_INCOMPLETE_PHONE_NUMBER_PATTERN)) {\n\t\t\t\treturn this.current_output;\n\t\t\t}\n\n\t\t\treturn this.process_input(parse_phone_number_digits(extracted_number));\n\t\t}\n\t}, {\n\t\tkey: 'process_input',\n\t\tvalue: function process_input(input) {\n\t\t\t// If an out of position '+' sign detected\n\t\t\t// (or a second '+' sign),\n\t\t\t// then just drop it from the input.\n\t\t\tif (input[0] === '+') {\n\t\t\t\tif (!this.parsed_input) {\n\t\t\t\t\tthis.parsed_input += '+';\n\n\t\t\t\t\t// If a default country was set\n\t\t\t\t\t// then reset it because an explicitly international\n\t\t\t\t\t// phone number is being entered\n\t\t\t\t\tthis.reset_countriness();\n\t\t\t\t}\n\n\t\t\t\tinput = input.slice(1);\n\t\t\t}\n\n\t\t\t// Raw phone number\n\t\t\tthis.parsed_input += input;\n\n\t\t\t// // Reset phone number validation state\n\t\t\t// this.valid = false\n\n\t\t\t// Add digits to the national number\n\t\t\tthis.national_number += input;\n\n\t\t\t// TODO: Deprecated: rename `this.national_number`\n\t\t\t// to `this.nationalNumber` and remove `.getNationalNumber()`.\n\n\t\t\t// Try to format the parsed input\n\n\t\t\tif (this.is_international()) {\n\t\t\t\tif (!this.countryCallingCode) {\n\t\t\t\t\t// No need to format anything\n\t\t\t\t\t// if there's no national phone number.\n\t\t\t\t\t// (e.g. just the country calling code)\n\t\t\t\t\tif (!this.national_number) {\n\t\t\t\t\t\t// Return raw phone number\n\t\t\t\t\t\treturn this.parsed_input;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If one looks at country phone codes\n\t\t\t\t\t// then he can notice that no one country phone code\n\t\t\t\t\t// is ever a (leftmost) substring of another country phone code.\n\t\t\t\t\t// So if a valid country code is extracted so far\n\t\t\t\t\t// then it means that this is the country code.\n\n\t\t\t\t\t// If no country phone code could be extracted so far,\n\t\t\t\t\t// then just return the raw phone number,\n\t\t\t\t\t// because it has no way of knowing\n\t\t\t\t\t// how to format the phone number so far.\n\t\t\t\t\tif (!this.extract_country_calling_code()) {\n\t\t\t\t\t\t// Return raw phone number\n\t\t\t\t\t\treturn this.parsed_input;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Initialize country-specific data\n\t\t\t\t\tthis.initialize_phone_number_formats_for_this_country_calling_code();\n\t\t\t\t\tthis.reset_format();\n\t\t\t\t\tthis.determine_the_country();\n\t\t\t\t}\n\t\t\t\t// `this.country` could be `undefined`,\n\t\t\t\t// for instance, when there is ambiguity\n\t\t\t\t// in a form of several different countries\n\t\t\t\t// each corresponding to the same country phone code\n\t\t\t\t// (e.g. NANPA: USA, Canada, etc),\n\t\t\t\t// and there's not enough digits entered\n\t\t\t\t// to reliably determine the country\n\t\t\t\t// the phone number belongs to.\n\t\t\t\t// Therefore, in cases of such ambiguity,\n\t\t\t\t// each time something is input,\n\t\t\t\t// try to determine the country\n\t\t\t\t// (if it's not determined yet).\n\t\t\t\telse if (!this.country) {\n\t\t\t\t\t\tthis.determine_the_country();\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Some national prefixes are substrings of other national prefixes\n\t\t\t\t// (for the same country), therefore try to extract national prefix each time\n\t\t\t\t// because a longer national prefix might be available at some point in time.\n\n\t\t\t\tvar previous_national_prefix = this.national_prefix;\n\t\t\t\tthis.national_number = this.national_prefix + this.national_number;\n\n\t\t\t\t// Possibly extract a national prefix\n\t\t\t\tthis.extract_national_prefix();\n\n\t\t\t\tif (this.national_prefix !== previous_national_prefix) {\n\t\t\t\t\t// National number has changed\n\t\t\t\t\t// (due to another national prefix been extracted)\n\t\t\t\t\t// therefore national number has changed\n\t\t\t\t\t// therefore reset all previous formatting data.\n\t\t\t\t\t// (and leading digits matching state)\n\t\t\t\t\tthis.matching_formats = this.available_formats;\n\t\t\t\t\tthis.reset_format();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!this.should_format()) {\n\t\t\t\treturn this.format_as_non_formatted_number();\n\t\t\t}\n\n\t\t\t// Check the available phone number formats\n\t\t\t// based on the currently available leading digits.\n\t\t\tthis.match_formats_by_leading_digits();\n\n\t\t\t// Format the phone number (given the next digits)\n\t\t\tvar formatted_national_phone_number = this.format_national_phone_number(input);\n\n\t\t\t// If the phone number could be formatted,\n\t\t\t// then return it, possibly prepending with country phone code\n\t\t\t// (for international phone numbers only)\n\t\t\tif (formatted_national_phone_number) {\n\t\t\t\treturn this.full_phone_number(formatted_national_phone_number);\n\t\t\t}\n\n\t\t\t// If the phone number couldn't be formatted,\n\t\t\t// then just fall back to the raw phone number.\n\t\t\treturn this.parsed_input;\n\t\t}\n\t}, {\n\t\tkey: 'format_as_non_formatted_number',\n\t\tvalue: function format_as_non_formatted_number() {\n\t\t\tif (this.is_international() && this.countryCallingCode) {\n\t\t\t\tif (this.national_number) {\n\t\t\t\t\t// For convenience, the public `.template` property\n\t\t\t\t\t// contains the whole international number\n\t\t\t\t\t// if the phone number being input is international:\n\t\t\t\t\t// 'x' for the '+' sign, 'x'es for the country phone code,\n\t\t\t\t\t// a spacebar and then the template for the national number digits.\n\t\t\t\t\tthis.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.countryCallingCode.length) + ' ' + repeat(DIGIT_PLACEHOLDER, this.national_number.length);\n\n\t\t\t\t\treturn '+' + this.countryCallingCode + ' ' + this.national_number;\n\t\t\t\t}\n\n\t\t\t\treturn '+' + this.countryCallingCode;\n\t\t\t}\n\n\t\t\treturn this.parsed_input;\n\t\t}\n\t}, {\n\t\tkey: 'format_national_phone_number',\n\t\tvalue: function format_national_phone_number(next_digits) {\n\t\t\t// Format the next phone number digits\n\t\t\t// using the previously chosen phone number format.\n\t\t\t//\n\t\t\t// This is done here because if `attempt_to_format_complete_phone_number`\n\t\t\t// was placed before this call then the `template`\n\t\t\t// wouldn't reflect the situation correctly (and would therefore be inconsistent)\n\t\t\t//\n\t\t\tvar national_number_formatted_with_previous_format = void 0;\n\t\t\tif (this.chosen_format) {\n\t\t\t\tnational_number_formatted_with_previous_format = this.format_next_national_number_digits(next_digits);\n\t\t\t}\n\n\t\t\t// See if the input digits can be formatted properly already. If not,\n\t\t\t// use the results from format_next_national_number_digits(), which does formatting\n\t\t\t// based on the formatting pattern chosen.\n\n\t\t\tvar formatted_number = this.attempt_to_format_complete_phone_number();\n\n\t\t\t// Just because a phone number doesn't have a suitable format\n\t\t\t// that doesn't mean that the phone is invalid\n\t\t\t// because phone number formats only format phone numbers,\n\t\t\t// they don't validate them and some (rare) phone numbers\n\t\t\t// are meant to stay non-formatted.\n\t\t\tif (formatted_number) {\n\t\t\t\t// if (this.country)\n\t\t\t\t// {\n\t\t\t\t// \tthis.valid = true\n\t\t\t\t// }\n\n\t\t\t\treturn formatted_number;\n\t\t\t}\n\n\t\t\t// For some phone number formats national prefix\n\n\t\t\t// If the previously chosen phone number format\n\t\t\t// didn't match the next (current) digit being input\n\t\t\t// (leading digits pattern didn't match).\n\t\t\tif (this.choose_another_format()) {\n\t\t\t\t// And a more appropriate phone number format\n\t\t\t\t// has been chosen for these `leading digits`,\n\t\t\t\t// then format the national phone number (so far)\n\t\t\t\t// using the newly selected phone number pattern.\n\n\t\t\t\t// Will return `undefined` if it couldn't format\n\t\t\t\t// the supplied national number\n\t\t\t\t// using the selected phone number pattern.\n\n\t\t\t\treturn this.reformat_national_number();\n\t\t\t}\n\n\t\t\t// If could format the next (current) digit\n\t\t\t// using the previously chosen phone number format\n\t\t\t// then return the formatted number so far.\n\n\t\t\t// If no new phone number format could be chosen,\n\t\t\t// and couldn't format the supplied national number\n\t\t\t// using the selected phone number pattern,\n\t\t\t// then it will return `undefined`.\n\n\t\t\treturn national_number_formatted_with_previous_format;\n\t\t}\n\t}, {\n\t\tkey: 'reset',\n\t\tvalue: function reset() {\n\t\t\t// Input stripped of non-phone-number characters.\n\t\t\t// Can only contain a possible leading '+' sign and digits.\n\t\t\tthis.parsed_input = '';\n\n\t\t\tthis.current_output = '';\n\n\t\t\t// This contains the national prefix that has been extracted. It contains only\n\t\t\t// digits without formatting.\n\t\t\tthis.national_prefix = '';\n\n\t\t\tthis.national_number = '';\n\n\t\t\tthis.reset_countriness();\n\n\t\t\tthis.reset_format();\n\n\t\t\t// this.valid = false\n\n\t\t\treturn this;\n\t\t}\n\t}, {\n\t\tkey: 'reset_country',\n\t\tvalue: function reset_country() {\n\t\t\tif (this.is_international()) {\n\t\t\t\tthis.country = undefined;\n\t\t\t} else {\n\t\t\t\tthis.country = this.default_country;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'reset_countriness',\n\t\tvalue: function reset_countriness() {\n\t\t\tthis.reset_country();\n\n\t\t\tif (this.default_country && !this.is_international()) {\n\t\t\t\tthis.metadata.country(this.default_country);\n\t\t\t\tthis.countryCallingCode = this.metadata.countryCallingCode();\n\n\t\t\t\tthis.initialize_phone_number_formats_for_this_country_calling_code();\n\t\t\t} else {\n\t\t\t\tthis.metadata.country(undefined);\n\t\t\t\tthis.countryCallingCode = undefined;\n\n\t\t\t\tthis.available_formats = [];\n\t\t\t\tthis.matching_formats = this.available_formats;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'reset_format',\n\t\tvalue: function reset_format() {\n\t\t\tthis.chosen_format = undefined;\n\t\t\tthis.template = undefined;\n\t\t\tthis.partially_populated_template = undefined;\n\t\t\tthis.last_match_position = -1;\n\t\t}\n\n\t\t// Format each digit of national phone number (so far)\n\t\t// using the newly selected phone number pattern.\n\n\t}, {\n\t\tkey: 'reformat_national_number',\n\t\tvalue: function reformat_national_number() {\n\t\t\t// Format each digit of national phone number (so far)\n\t\t\t// using the selected phone number pattern.\n\t\t\treturn this.format_next_national_number_digits(this.national_number);\n\t\t}\n\t}, {\n\t\tkey: 'initialize_phone_number_formats_for_this_country_calling_code',\n\t\tvalue: function initialize_phone_number_formats_for_this_country_calling_code() {\n\t\t\t// Get all \"eligible\" phone number formats for this country\n\t\t\tthis.available_formats = this.metadata.formats().filter(function (format) {\n\t\t\t\treturn ELIGIBLE_FORMAT_PATTERN.test(format.internationalFormat());\n\t\t\t});\n\n\t\t\tthis.matching_formats = this.available_formats;\n\t\t}\n\t}, {\n\t\tkey: 'match_formats_by_leading_digits',\n\t\tvalue: function match_formats_by_leading_digits() {\n\t\t\tvar leading_digits = this.national_number;\n\n\t\t\t// \"leading digits\" pattern list starts with\n\t\t\t// one of a maximum length of 3 digits,\n\t\t\t// and then with each additional digit\n\t\t\t// a more precise \"leading digits\" pattern is specified.\n\n\t\t\tvar index_of_leading_digits_pattern = leading_digits.length - MIN_LEADING_DIGITS_LENGTH;\n\n\t\t\tif (index_of_leading_digits_pattern < 0) {\n\t\t\t\tindex_of_leading_digits_pattern = 0;\n\t\t\t}\n\n\t\t\tthis.matching_formats = this.matching_formats.filter(function (format) {\n\t\t\t\tvar leading_digits_pattern_count = format.leadingDigitsPatterns().length;\n\n\t\t\t\t// Keep everything that isn't restricted by leading digits.\n\t\t\t\tif (leading_digits_pattern_count === 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tvar leading_digits_pattern_index = Math.min(index_of_leading_digits_pattern, leading_digits_pattern_count - 1);\n\t\t\t\tvar leading_digits_pattern = format.leadingDigitsPatterns()[leading_digits_pattern_index];\n\n\t\t\t\t// Brackets are required for `^` to be applied to\n\t\t\t\t// all or-ed (`|`) parts, not just the first one.\n\t\t\t\treturn new RegExp('^(' + leading_digits_pattern + ')').test(leading_digits);\n\t\t\t});\n\n\t\t\t// If there was a phone number format chosen\n\t\t\t// and it no longer holds given the new leading digits then reset it.\n\t\t\t// The test for this `if` condition is marked as:\n\t\t\t// \"Reset a chosen format when it no longer holds given the new leading digits\".\n\t\t\t// To construct a valid test case for this one can find a country\n\t\t\t// in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n\t\t\t// and yielding another format for 4 `` (Australia in this case).\n\t\t\tif (this.chosen_format && this.matching_formats.indexOf(this.chosen_format) === -1) {\n\t\t\t\tthis.reset_format();\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'should_format',\n\t\tvalue: function should_format() {\n\t\t\t// Start matching any formats at all when the national number\n\t\t\t// entered so far is at least 3 digits long,\n\t\t\t// otherwise format matching would give false negatives\n\t\t\t// like when the digits entered so far are `2`\n\t\t\t// and the leading digits pattern is `21` –\n\t\t\t// it's quite obvious in this case that the format could be the one\n\t\t\t// but due to the absence of further digits it would give false negative.\n\t\t\t//\n\t\t\t// Google could have provided leading digits patterns starting\n\t\t\t// with a single digit but they chose not to (for whatever reasons).\n\t\t\t//\n\t\t\treturn this.national_number >= MIN_LEADING_DIGITS_LENGTH;\n\t\t}\n\n\t\t// Check to see if there is an exact pattern match for these digits. If so, we\n\t\t// should use this instead of any other formatting template whose\n\t\t// `leadingDigitsPattern` also matches the input.\n\n\t}, {\n\t\tkey: 'attempt_to_format_complete_phone_number',\n\t\tvalue: function attempt_to_format_complete_phone_number() {\n\t\t\tfor (var _iterator = this.matching_formats, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {\n\t\t\t\tvar _ref;\n\n\t\t\t\tif (_isArray) {\n\t\t\t\t\tif (_i >= _iterator.length) break;\n\t\t\t\t\t_ref = _iterator[_i++];\n\t\t\t\t} else {\n\t\t\t\t\t_i = _iterator.next();\n\t\t\t\t\tif (_i.done) break;\n\t\t\t\t\t_ref = _i.value;\n\t\t\t\t}\n\n\t\t\t\tvar format = _ref;\n\n\t\t\t\tvar matcher = new RegExp('^(?:' + format.pattern() + ')$');\n\n\t\t\t\tif (!matcher.test(this.national_number)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!this.is_format_applicable(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// To leave the formatter in a consistent state\n\t\t\t\tthis.reset_format();\n\t\t\t\tthis.chosen_format = format;\n\n\t\t\t\tvar formatted_number = format_national_number_using_format(this.national_number, format, this.is_international(), this.national_prefix.length > 0, this.metadata);\n\n\t\t\t\t// Set `this.template` and `this.partially_populated_template`.\n\t\t\t\t//\n\t\t\t\t// `else` case doesn't ever happen\n\t\t\t\t// with the current metadata,\n\t\t\t\t// but just in case.\n\t\t\t\t//\n\t\t\t\t/* istanbul ignore else */\n\t\t\t\tif (this.create_formatting_template(format)) {\n\t\t\t\t\t// Populate `this.partially_populated_template`\n\t\t\t\t\tthis.reformat_national_number();\n\t\t\t\t} else {\n\t\t\t\t\t// Prepend `+CountryCode` in case of an international phone number\n\t\t\t\t\tvar full_number = this.full_phone_number(formatted_number);\n\t\t\t\t\tthis.template = full_number.replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER);\n\t\t\t\t\tthis.partially_populated_template = full_number;\n\t\t\t\t}\n\n\t\t\t\treturn formatted_number;\n\t\t\t}\n\t\t}\n\n\t\t// Prepends `+CountryCode` in case of an international phone number\n\n\t}, {\n\t\tkey: 'full_phone_number',\n\t\tvalue: function full_phone_number(formatted_national_number) {\n\t\t\tif (this.is_international()) {\n\t\t\t\treturn '+' + this.countryCallingCode + ' ' + formatted_national_number;\n\t\t\t}\n\n\t\t\treturn formatted_national_number;\n\t\t}\n\n\t\t// Extracts the country calling code from the beginning\n\t\t// of the entered `national_number` (so far),\n\t\t// and places the remaining input into the `national_number`.\n\n\t}, {\n\t\tkey: 'extract_country_calling_code',\n\t\tvalue: function extract_country_calling_code() {\n\t\t\tvar _parse_national_numbe = parse_national_number_and_country_calling_code(this.parsed_input, this.default_country, this.metadata),\n\t\t\t countryCallingCode = _parse_national_numbe.countryCallingCode,\n\t\t\t number = _parse_national_numbe.number;\n\n\t\t\tif (!countryCallingCode) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.countryCallingCode = countryCallingCode;\n\t\t\tthis.national_number = number;\n\n\t\t\tthis.metadata.chooseCountryByCountryCallingCode(countryCallingCode);\n\t\t\treturn this.metadata.selectedCountry() !== undefined;\n\t\t}\n\t}, {\n\t\tkey: 'extract_national_prefix',\n\t\tvalue: function extract_national_prefix() {\n\t\t\tthis.national_prefix = '';\n\n\t\t\tif (!this.metadata.selectedCountry()) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Only strip national prefixes for non-international phone numbers\n\t\t\t// because national prefixes can't be present in international phone numbers.\n\t\t\t// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`\n\t\t\t// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,\n\t\t\t// and then it would assume that's a valid number which it isn't.\n\t\t\t// So no forgiveness for grandmas here.\n\t\t\t// The issue asking for this fix:\n\t\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/159\n\n\t\t\tvar _strip_national_prefi = strip_national_prefix_and_carrier_code(this.national_number, this.metadata),\n\t\t\t potential_national_number = _strip_national_prefi.number;\n\n\t\t\t// We require that the NSN remaining after stripping the national prefix and\n\t\t\t// carrier code be long enough to be a possible length for the region.\n\t\t\t// Otherwise, we don't do the stripping, since the original number could be\n\t\t\t// a valid short number.\n\n\n\t\t\tif (!this.metadata.possibleLengths() || this.is_possible_number(this.national_number) && !this.is_possible_number(potential_national_number)) {\n\t\t\t\t// Verify the parsed national (significant) number for this country\n\t\t\t\tvar national_number_rule = new RegExp(this.metadata.nationalNumberPattern());\n\t\t\t\t//\n\t\t\t\t// If the original number (before stripping national prefix) was viable,\n\t\t\t\t// and the resultant number is not, then prefer the original phone number.\n\t\t\t\t// This is because for some countries (e.g. Russia) the same digit could be both\n\t\t\t\t// a national prefix and a leading digit of a valid national phone number,\n\t\t\t\t// like `8` is the national prefix for Russia and both\n\t\t\t\t// `8 800 555 35 35` and `800 555 35 35` are valid numbers.\n\t\t\t\tif (matches_entirely(this.national_number, national_number_rule) && !matches_entirely(potential_national_number, national_number_rule)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.national_prefix = this.national_number.slice(0, this.national_number.length - potential_national_number.length);\n\t\t\tthis.national_number = potential_national_number;\n\n\t\t\treturn this.national_prefix;\n\t\t}\n\t}, {\n\t\tkey: 'is_possible_number',\n\t\tvalue: function is_possible_number(number) {\n\t\t\tvar validation_result = check_number_length_for_type(number, undefined, this.metadata);\n\t\t\tswitch (validation_result) {\n\t\t\t\tcase 'IS_POSSIBLE':\n\t\t\t\t\treturn true;\n\t\t\t\t// case 'IS_POSSIBLE_LOCAL_ONLY':\n\t\t\t\t// \treturn !this.is_international()\n\t\t\t\tdefault:\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}, {\n\t\tkey: 'choose_another_format',\n\t\tvalue: function choose_another_format() {\n\t\t\t// When there are multiple available formats, the formatter uses the first\n\t\t\t// format where a formatting template could be created.\n\t\t\tfor (var _iterator2 = this.matching_formats, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {\n\t\t\t\tvar _ref2;\n\n\t\t\t\tif (_isArray2) {\n\t\t\t\t\tif (_i2 >= _iterator2.length) break;\n\t\t\t\t\t_ref2 = _iterator2[_i2++];\n\t\t\t\t} else {\n\t\t\t\t\t_i2 = _iterator2.next();\n\t\t\t\t\tif (_i2.done) break;\n\t\t\t\t\t_ref2 = _i2.value;\n\t\t\t\t}\n\n\t\t\t\tvar format = _ref2;\n\n\t\t\t\t// If this format is currently being used\n\t\t\t\t// and is still possible, then stick to it.\n\t\t\t\tif (this.chosen_format === format) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// If this `format` is suitable for \"as you type\",\n\t\t\t\t// then extract the template from this format\n\t\t\t\t// and use it to format the phone number being input.\n\n\t\t\t\tif (!this.is_format_applicable(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (!this.create_formatting_template(format)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis.chosen_format = format;\n\n\t\t\t\t// With a new formatting template, the matched position\n\t\t\t\t// using the old template needs to be reset.\n\t\t\t\tthis.last_match_position = -1;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t// No format matches the phone number,\n\t\t\t// therefore set `country` to `undefined`\n\t\t\t// (or to the default country).\n\t\t\tthis.reset_country();\n\n\t\t\t// No format matches the national phone number entered\n\t\t\tthis.reset_format();\n\t\t}\n\t}, {\n\t\tkey: 'is_format_applicable',\n\t\tvalue: function is_format_applicable(format) {\n\t\t\t// If national prefix is mandatory for this phone number format\n\t\t\t// and the user didn't input the national prefix,\n\t\t\t// then this phone number format isn't suitable.\n\t\t\tif (!this.is_international() && !this.national_prefix && format.nationalPrefixIsMandatoryWhenFormatting()) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t}, {\n\t\tkey: 'create_formatting_template',\n\t\tvalue: function create_formatting_template(format) {\n\t\t\t// The formatter doesn't format numbers when numberPattern contains '|', e.g.\n\t\t\t// (20|3)\\d{4}. In those cases we quickly return.\n\t\t\t// (Though there's no such format in current metadata)\n\t\t\t/* istanbul ignore if */\n\t\t\tif (format.pattern().indexOf('|') >= 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Get formatting template for this phone number format\n\t\t\tvar template = this.get_template_for_phone_number_format_pattern(format);\n\n\t\t\t// If the national number entered is too long\n\t\t\t// for any phone number format, then abort.\n\t\t\tif (!template) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// This one is for national number only\n\t\t\tthis.partially_populated_template = template;\n\n\t\t\t// For convenience, the public `.template` property\n\t\t\t// contains the whole international number\n\t\t\t// if the phone number being input is international:\n\t\t\t// 'x' for the '+' sign, 'x'es for the country phone code,\n\t\t\t// a spacebar and then the template for the formatted national number.\n\t\t\tif (this.is_international()) {\n\t\t\t\tthis.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.countryCallingCode.length) + ' ' + template;\n\t\t\t}\n\t\t\t// For local numbers, replace national prefix\n\t\t\t// with a digit placeholder.\n\t\t\telse {\n\t\t\t\t\tthis.template = template.replace(/\\d/g, DIGIT_PLACEHOLDER);\n\t\t\t\t}\n\n\t\t\t// This one is for the full phone number\n\t\t\treturn this.template;\n\t\t}\n\n\t\t// Generates formatting template for a phone number format\n\n\t}, {\n\t\tkey: 'get_template_for_phone_number_format_pattern',\n\t\tvalue: function get_template_for_phone_number_format_pattern(format) {\n\t\t\t// A very smart trick by the guys at Google\n\t\t\tvar number_pattern = format.pattern()\n\t\t\t// Replace anything in the form of [..] with \\d\n\t\t\t.replace(CHARACTER_CLASS_PATTERN, '\\\\d')\n\t\t\t// Replace any standalone digit (not the one in `{}`) with \\d\n\t\t\t.replace(STANDALONE_DIGIT_PATTERN, '\\\\d');\n\n\t\t\t// This match will always succeed,\n\t\t\t// because the \"longest dummy phone number\"\n\t\t\t// has enough length to accomodate any possible\n\t\t\t// national phone number format pattern.\n\t\t\tvar dummy_phone_number_matching_format_pattern = LONGEST_DUMMY_PHONE_NUMBER.match(number_pattern)[0];\n\n\t\t\t// If the national number entered is too long\n\t\t\t// for any phone number format, then abort.\n\t\t\tif (this.national_number.length > dummy_phone_number_matching_format_pattern.length) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Prepare the phone number format\n\t\t\tvar number_format = this.get_format_format(format);\n\n\t\t\t// Get a formatting template which can be used to efficiently format\n\t\t\t// a partial number where digits are added one by one.\n\n\t\t\t// Below `strict_pattern` is used for the\n\t\t\t// regular expression (with `^` and `$`).\n\t\t\t// This wasn't originally in Google's `libphonenumber`\n\t\t\t// and I guess they don't really need it\n\t\t\t// because they're not using \"templates\" to format phone numbers\n\t\t\t// but I added `strict_pattern` after encountering\n\t\t\t// South Korean phone number formatting bug.\n\t\t\t//\n\t\t\t// Non-strict regular expression bug demonstration:\n\t\t\t//\n\t\t\t// this.national_number : `111111111` (9 digits)\n\t\t\t//\n\t\t\t// number_pattern : (\\d{2})(\\d{3,4})(\\d{4})\n\t\t\t// number_format : `$1 $2 $3`\n\t\t\t// dummy_phone_number_matching_format_pattern : `9999999999` (10 digits)\n\t\t\t//\n\t\t\t// '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n\t\t\t//\n\t\t\t// template : xx xxxx xxxx\n\t\t\t//\n\t\t\t// But the correct template in this case is `xx xxx xxxx`.\n\t\t\t// The template was generated incorrectly because of the\n\t\t\t// `{3,4}` variability in the `number_pattern`.\n\t\t\t//\n\t\t\t// The fix is, if `this.national_number` has already sufficient length\n\t\t\t// to satisfy the `number_pattern` completely then `this.national_number` is used\n\t\t\t// instead of `dummy_phone_number_matching_format_pattern`.\n\n\t\t\tvar strict_pattern = new RegExp('^' + number_pattern + '$');\n\t\t\tvar national_number_dummy_digits = this.national_number.replace(/\\d/g, DUMMY_DIGIT);\n\n\t\t\t// If `this.national_number` has already sufficient length\n\t\t\t// to satisfy the `number_pattern` completely then use it\n\t\t\t// instead of `dummy_phone_number_matching_format_pattern`.\n\t\t\tif (strict_pattern.test(national_number_dummy_digits)) {\n\t\t\t\tdummy_phone_number_matching_format_pattern = national_number_dummy_digits;\n\t\t\t}\n\n\t\t\t// Generate formatting template for this phone number format\n\t\t\treturn dummy_phone_number_matching_format_pattern\n\t\t\t// Format the dummy phone number according to the format\n\t\t\t.replace(new RegExp(number_pattern), number_format)\n\t\t\t// Replace each dummy digit with a DIGIT_PLACEHOLDER\n\t\t\t.replace(DUMMY_DIGIT_MATCHER, DIGIT_PLACEHOLDER);\n\t\t}\n\t}, {\n\t\tkey: 'format_next_national_number_digits',\n\t\tvalue: function format_next_national_number_digits(digits) {\n\t\t\t// Using `.split('')` to iterate through a string here\n\t\t\t// to avoid requiring `Symbol.iterator` polyfill.\n\t\t\t// `.split('')` is generally not safe for Unicode,\n\t\t\t// but in this particular case for `digits` it is safe.\n\t\t\t// for (const digit of digits)\n\t\t\tfor (var _iterator3 = digits.split(''), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {\n\t\t\t\tvar _ref3;\n\n\t\t\t\tif (_isArray3) {\n\t\t\t\t\tif (_i3 >= _iterator3.length) break;\n\t\t\t\t\t_ref3 = _iterator3[_i3++];\n\t\t\t\t} else {\n\t\t\t\t\t_i3 = _iterator3.next();\n\t\t\t\t\tif (_i3.done) break;\n\t\t\t\t\t_ref3 = _i3.value;\n\t\t\t\t}\n\n\t\t\t\tvar digit = _ref3;\n\n\t\t\t\t// If there is room for more digits in current `template`,\n\t\t\t\t// then set the next digit in the `template`,\n\t\t\t\t// and return the formatted digits so far.\n\n\t\t\t\t// If more digits are entered than the current format could handle\n\t\t\t\tif (this.partially_populated_template.slice(this.last_match_position + 1).search(DIGIT_PLACEHOLDER_MATCHER) === -1) {\n\t\t\t\t\t// Reset the current format,\n\t\t\t\t\t// so that the new format will be chosen\n\t\t\t\t\t// in a subsequent `this.choose_another_format()` call\n\t\t\t\t\t// later in code.\n\t\t\t\t\tthis.chosen_format = undefined;\n\t\t\t\t\tthis.template = undefined;\n\t\t\t\t\tthis.partially_populated_template = undefined;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis.last_match_position = this.partially_populated_template.search(DIGIT_PLACEHOLDER_MATCHER);\n\t\t\t\tthis.partially_populated_template = this.partially_populated_template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n\t\t\t}\n\n\t\t\t// Return the formatted phone number so far\n\t\t\treturn close_dangling_braces(this.partially_populated_template, this.last_match_position + 1).replace(DIGIT_PLACEHOLDER_MATCHER_GLOBAL, ' ');\n\t\t}\n\t}, {\n\t\tkey: 'is_international',\n\t\tvalue: function is_international() {\n\t\t\treturn this.parsed_input && this.parsed_input[0] === '+';\n\t\t}\n\t}, {\n\t\tkey: 'get_format_format',\n\t\tvalue: function get_format_format(format) {\n\t\t\tif (this.is_international()) {\n\t\t\t\treturn local_to_international_style(format.internationalFormat());\n\t\t\t}\n\n\t\t\t// If national prefix formatting rule is set\n\t\t\t// for this phone number format\n\t\t\tif (format.nationalPrefixFormattingRule()) {\n\t\t\t\t// If the user did input the national prefix\n\t\t\t\t// (or if the national prefix formatting rule does not require national prefix)\n\t\t\t\t// then maybe make it part of the phone number template\n\t\t\t\tif (this.national_prefix || !format.usesNationalPrefix()) {\n\t\t\t\t\t// Make the national prefix part of the phone number template\n\t\t\t\t\treturn format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn format.format();\n\t\t}\n\n\t\t// Determines the country of the phone number\n\t\t// entered so far based on the country phone code\n\t\t// and the national phone number.\n\n\t}, {\n\t\tkey: 'determine_the_country',\n\t\tvalue: function determine_the_country() {\n\t\t\tthis.country = find_country_code(this.countryCallingCode, this.national_number, this.metadata);\n\t\t}\n\t}, {\n\t\tkey: 'getNationalNumber',\n\t\tvalue: function getNationalNumber() {\n\t\t\treturn this.national_number;\n\t\t}\n\t}]);\n\n\treturn AsYouType;\n}();\n\nexport default AsYouType;\n\n\nexport function close_dangling_braces(template, cut_before) {\n\tvar retained_template = template.slice(0, cut_before);\n\n\tvar opening_braces = count_occurences('(', retained_template);\n\tvar closing_braces = count_occurences(')', retained_template);\n\n\tvar dangling_braces = opening_braces - closing_braces;\n\n\twhile (dangling_braces > 0 && cut_before < template.length) {\n\t\tif (template[cut_before] === ')') {\n\t\t\tdangling_braces--;\n\t\t}\n\t\tcut_before++;\n\t}\n\n\treturn template.slice(0, cut_before);\n}\n\n// Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\nexport function count_occurences(symbol, string) {\n\tvar count = 0;\n\n\t// Using `.split('')` to iterate through a string here\n\t// to avoid requiring `Symbol.iterator` polyfill.\n\t// `.split('')` is generally not safe for Unicode,\n\t// but in this particular case for counting brackets it is safe.\n\t// for (const character of string)\n\tfor (var _iterator4 = string.split(''), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {\n\t\tvar _ref4;\n\n\t\tif (_isArray4) {\n\t\t\tif (_i4 >= _iterator4.length) break;\n\t\t\t_ref4 = _iterator4[_i4++];\n\t\t} else {\n\t\t\t_i4 = _iterator4.next();\n\t\t\tif (_i4.done) break;\n\t\t\t_ref4 = _i4.value;\n\t\t}\n\n\t\tvar character = _ref4;\n\n\t\tif (character === symbol) {\n\t\t\tcount++;\n\t\t}\n\t}\n\n\treturn count;\n}\n\n// Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\nexport function repeat(string, times) {\n\tif (times < 1) {\n\t\treturn '';\n\t}\n\n\tvar result = '';\n\n\twhile (times > 1) {\n\t\tif (times & 1) {\n\t\t\tresult += string;\n\t\t}\n\n\t\ttimes >>= 1;\n\t\tstring += string;\n\t}\n\n\treturn result + string;\n}\n//# sourceMappingURL=AsYouType.js.map","import Metadata from './metadata';\n\nexport default function (country, metadata) {\n\tmetadata = new Metadata(metadata);\n\n\tif (!metadata.hasCountry(country)) {\n\t\tthrow new Error('Unknown country: ' + country);\n\t}\n\n\treturn metadata.country(country).countryCallingCode();\n}\n//# sourceMappingURL=getCountryCallingCode.js.map","// Javascript doesn't support UTF-8 regular expressions.\n// So mimicking them here.\n\n// Copy-pasted from `PhoneNumberMatcher.js`.\n\n/**\r\n * \"\\p{L}\" is any kind of letter from any language (\"Letter\").\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 */\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 = '[' + _pL + ']';\nvar pL_regexp = new RegExp(pL);\n\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 = '[' + _pSc + ']';\nvar pSc_regexp = new RegExp(pSc);\n\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 = '[' + _pMn + ']';\nvar pMn_regexp = new RegExp(pMn);\n\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';\n\nvar latinLetterRegexp = new RegExp('[' + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + ']');\n\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 */\nexport function isLatinLetter(letter) {\n\t// Combining marks are a subset of non-spacing-mark.\n\tif (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {\n\t\treturn false;\n\t}\n\n\treturn latinLetterRegexp.test(letter);\n}\n\nexport function isInvalidPunctuationSymbol(character) {\n\treturn character === '%' || pSc_regexp.test(character);\n}\n//# sourceMappingURL=utf-8.common.js.map","// Copy-pasted from `PhoneNumberMatcher.js`.\n\nimport { PLUS_CHARS } from './common';\n\nimport { isLatinLetter, isInvalidPunctuationSymbol } from './utf-8.common';\n\nexport var OPENING_PARENS = '(\\\\[\\uFF08\\uFF3B';\nexport var CLOSING_PARENS = ')\\\\]\\uFF09\\uFF3D';\n\nexport var LEAD_CLASS = '[' + OPENING_PARENS + PLUS_CHARS + ']';\n\n// Punctuation that may be at the start of a phone number - brackets and plus signs.\nvar LEAD_CLASS_LEADING = new RegExp('^' + LEAD_CLASS);\n\nexport function isValidCandidate(candidate, offset, text) {\n\t// If the candidate is not at the start of the text,\n\t// and does not start with phone-number punctuation,\n\t// check the previous character.\n\tif (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {\n\t\tvar previousChar = text[offset - 1];\n\t\t// We return null if it is a latin letter or an invalid punctuation symbol.\n\t\tif (isInvalidPunctuationSymbol(previousChar) || isLatinLetter(previousChar)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tvar lastCharIndex = offset + candidate.length;\n\tif (lastCharIndex < text.length) {\n\t\tvar nextChar = text[lastCharIndex];\n\t\tif (isInvalidPunctuationSymbol(nextChar) || isLatinLetter(nextChar)) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n//# sourceMappingURL=findNumbers.common.js.map","var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\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 parse from './parse';\nimport Metadata from './metadata';\n\nimport { PLUS_CHARS, VALID_PUNCTUATION, VALID_DIGITS,\n// OPENING_BRACKETS,\nWHITESPACE, create_extension_pattern } from './common';\n\nimport { isValidCandidate } from './findNumbers.common';\n\n// Copy-pasted from `./parse.js`.\nvar VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';\n\nvar EXTN_PATTERNS_FOR_PARSING = create_extension_pattern('parsing');\n\nvar WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp('^[' + WHITESPACE + ']+');\nvar WHITESPACE_IN_THE_END_PATTERN = new RegExp('[' + WHITESPACE + ']+$');\n\n// // 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]/;\n\nexport default function findPhoneNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments.text,\n\t options = _sort_out_arguments.options,\n\t metadata = _sort_out_arguments.metadata;\n\n\tvar search = new PhoneNumberSearch(text, options, metadata.metadata);\n\n\tvar phones = [];\n\n\twhile (search.hasNext()) {\n\t\tphones.push(search.next());\n\t}\n\n\treturn phones;\n}\n\n/**\r\n * @return ES6 `for ... of` iterator.\r\n */\nexport function searchPhoneNumbers(arg_1, arg_2, arg_3, arg_4) {\n\tvar _sort_out_arguments2 = sort_out_arguments(arg_1, arg_2, arg_3, arg_4),\n\t text = _sort_out_arguments2.text,\n\t options = _sort_out_arguments2.options,\n\t metadata = _sort_out_arguments2.metadata;\n\n\tvar search = new PhoneNumberSearch(text, options, metadata.metadata);\n\n\treturn _defineProperty({}, Symbol.iterator, function () {\n\t\treturn {\n\t\t\tnext: function next() {\n\t\t\t\tif (search.hasNext()) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tdone: false,\n\t\t\t\t\t\tvalue: search.next()\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\tdone: true\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t});\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 */\nexport var PhoneNumberSearch = function () {\n\tfunction PhoneNumberSearch(text) {\n\t\tvar options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\t\tvar metadata = arguments[2];\n\n\t\t_classCallCheck(this, PhoneNumberSearch);\n\n\t\tthis.state = 'NOT_READY';\n\n\t\tthis.text = text;\n\t\tthis.options = options;\n\t\tthis.metadata = metadata;\n\n\t\tthis.regexp = new RegExp(VALID_PHONE_NUMBER +\n\t\t// Phone number extensions\n\t\t'(?:' + EXTN_PATTERNS_FOR_PARSING + ')?', 'ig');\n\n\t\t// this.searching_from = 0\n\t}\n\t// Iteration tristate.\n\n\n\t_createClass(PhoneNumberSearch, [{\n\t\tkey: 'find',\n\t\tvalue: function find() {\n\t\t\tvar matches = this.regexp.exec(this.text);\n\n\t\t\tif (!matches) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar number = matches[0];\n\t\t\tvar startsAt = matches.index;\n\n\t\t\tnumber = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, '');\n\t\t\tstartsAt += matches[0].length - number.length;\n\t\t\tnumber = number.replace(WHITESPACE_IN_THE_END_PATTERN, '');\n\n\t\t\t// Don't parse phone numbers which are non-phone numbers\n\t\t\t// due to being part of something else (e.g. a UUID).\n\t\t\t// https://github.com/catamphetamine/libphonenumber-js/issues/213\n\t\t\t// Copy-pasted from Google's `PhoneNumberMatcher.js` (`.parseAndValidate()`).\n\t\t\tif (!isValidCandidate(number, startsAt, this.text)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// // Prepend any opening brackets left behind by the\n\t\t\t// // `PHONE_NUMBER_START_PATTERN` regexp.\n\t\t\t// const text_before_number = text.slice(this.searching_from, startsAt)\n\t\t\t// const full_number_starts_at = text_before_number.search(BEFORE_NUMBER_DIGITS_PUNCTUATION)\n\t\t\t// if (full_number_starts_at >= 0)\n\t\t\t// {\n\t\t\t// \tnumber = text_before_number.slice(full_number_starts_at) + number\n\t\t\t// \tstartsAt = full_number_starts_at\n\t\t\t// }\n\t\t\t//\n\t\t\t// this.searching_from = matches.lastIndex\n\n\t\t\tvar result = parse(number, this.options, this.metadata);\n\n\t\t\tif (result.phone) {\n\t\t\t\tresult.startsAt = startsAt;\n\t\t\t\tresult.endsAt = startsAt + number.length;\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t\t// Tail recursion.\n\t\t\t// Try the next one if this one is not a valid phone number.\n\t\t\treturn this.find();\n\t\t}\n\t}, {\n\t\tkey: 'hasNext',\n\t\tvalue: function hasNext() {\n\t\t\tif (this.state === 'NOT_READY') {\n\t\t\t\tthis.last_match = this.find();\n\n\t\t\t\tif (this.last_match) {\n\t\t\t\t\tthis.state = 'READY';\n\t\t\t\t} else {\n\t\t\t\t\tthis.state = 'DONE';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this.state === 'READY';\n\t\t}\n\t}, {\n\t\tkey: 'next',\n\t\tvalue: function next() {\n\t\t\t// Check the state and find the next match as a side-effect if necessary.\n\t\t\tif (!this.hasNext()) {\n\t\t\t\tthrow new Error('No next element');\n\t\t\t}\n\n\t\t\t// Don't retain that memory any longer than necessary.\n\t\t\tvar result = this.last_match;\n\t\t\tthis.last_match = null;\n\t\t\tthis.state = 'NOT_READY';\n\t\t\treturn result;\n\t\t}\n\t}]);\n\n\treturn PhoneNumberSearch;\n}();\n\nexport function sort_out_arguments(arg_1, arg_2, arg_3, arg_4) {\n\tvar text = void 0;\n\tvar options = void 0;\n\tvar metadata = void 0;\n\n\t// If the phone number is passed as a string.\n\t// `parse('88005553535', ...)`.\n\tif (typeof arg_1 === 'string') {\n\t\ttext = arg_1;\n\t} else throw new TypeError('A text for parsing must be a string.');\n\n\t// If \"default country\" argument is being passed\n\t// then move it to `options`.\n\t// `findNumbers('88005553535', 'RU', [options], metadata)`.\n\tif (typeof arg_2 === 'string') {\n\t\tif (arg_4) {\n\t\t\toptions = _extends({ defaultCountry: arg_2 }, arg_3);\n\t\t\tmetadata = arg_4;\n\t\t} else {\n\t\t\toptions = { defaultCountry: arg_2 };\n\t\t\tmetadata = arg_3;\n\t\t}\n\t}\n\t// No \"default country\" argument is being passed.\n\t// Only international phone numbers are passed.\n\t// `findNumbers('+78005553535', [options], metadata)`.\n\telse {\n\t\t\tif (arg_3) {\n\t\t\t\toptions = arg_2;\n\t\t\t\tmetadata = arg_3;\n\t\t\t} else {\n\t\t\t\tmetadata = arg_2;\n\t\t\t}\n\t\t}\n\n\tif (!options) {\n\t\toptions = {};\n\t}\n\n\t// // Apply default options.\n\t// if (options)\n\t// {\n\t// \toptions = { ...default_options, ...options }\n\t// }\n\t// else\n\t// {\n\t// \toptions = default_options\n\t// }\n\n\treturn { text: text, options: options, metadata: new Metadata(metadata) };\n}\n//# sourceMappingURL=findPhoneNumbers.js.map","import parse, { is_viable_phone_number } from './parse';\nimport get_number_type, { sort_out_arguments } from './types';\n\n// Checks if a given phone number is valid\n//\n// Example use cases:\n//\n// ```js\n// is_valid('8005553535', 'RU')\n// is_valid('8005553535', 'RU', metadata)\n// is_valid({ phone: '8005553535', country: 'RU' })\n// is_valid({ phone: '8005553535', country: 'RU' }, metadata)\n// is_valid('+78005553535')\n// is_valid('+78005553535', metadata)\n// ```\n//\nexport default function is_valid(arg_1, arg_2, arg_3) {\n\tvar _sort_out_arguments = sort_out_arguments(arg_1, arg_2, arg_3),\n\t input = _sort_out_arguments.input,\n\t metadata = _sort_out_arguments.metadata;\n\n\tif (!input) {\n\t\treturn false;\n\t}\n\n\tif (!input.country) {\n\t\treturn false;\n\t}\n\n\tif (!metadata.hasCountry(input.country)) {\n\t\tthrow new Error('Unknown country: ' + input.country);\n\t}\n\n\tmetadata.country(input.country);\n\n\tif (metadata.hasTypes()) {\n\t\treturn get_number_type(input, metadata.metadata) !== undefined;\n\t}\n\n\treturn true;\n}\n//# sourceMappingURL=validate.js.map","module.exports = function cmp (a, b) {\n var pa = a.split('.');\n var pb = b.split('.');\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 return 0;\n};\n","import metadata from './metadata.min.json'\r\n\r\nimport parseNumberCustom from './es6/parse'\r\nimport formatNumberCustom from './es6/format'\r\nimport getNumberTypeCustom from './es6/types'\r\nimport isValidNumberCustom from './es6/validate'\r\nimport findPhoneNumbersCustom, { searchPhoneNumbers as searchPhoneNumbersCustom, PhoneNumberSearch as PhoneNumberSearchCustom } from './es6/findPhoneNumbers'\r\nimport AsYouTypeCustom from './es6/AsYouType'\r\nimport getCountryCallingCodeCustom from './es6/getCountryCallingCode'\r\nexport { default as Metadata } from './es6/metadata'\r\nimport { getExtPrefix as getExtPrefixCustom } from './es6/metadata'\r\nimport { parseRFC3966 as parseRFC3966Custom, formatRFC3966 as formatRFC3966Custom } from './es6/RFC3966'\r\n\r\nexport function parseNumber()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn parseNumberCustom.apply(this, parameters)\r\n}\r\n\r\n// Deprecated: remove `parse()` export in 2.0.0.\r\n// (renamed to `parseNumber()`)\r\nexport function parse()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn parseNumberCustom.apply(this, parameters)\r\n}\r\n\r\nexport function formatNumber()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn formatNumberCustom.apply(this, parameters)\r\n}\r\n\r\n// Deprecated: remove `format()` export in 2.0.0.\r\n// (renamed to `formatNumber()`)\r\nexport function format()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn formatNumberCustom.apply(this, parameters)\r\n}\r\n\r\nexport function getNumberType()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn getNumberTypeCustom.apply(this, parameters)\r\n}\r\n\r\nexport function isValidNumber()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn isValidNumberCustom.apply(this, parameters)\r\n}\r\n\r\nexport function findPhoneNumbers()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn findPhoneNumbersCustom.apply(this, parameters)\r\n}\r\n\r\nexport function searchPhoneNumbers()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn searchPhoneNumbersCustom.apply(this, parameters)\r\n}\r\n\r\nexport function PhoneNumberSearch(text, options)\r\n{\r\n\tPhoneNumberSearchCustom.call(this, text, options, metadata)\r\n}\r\n\r\nPhoneNumberSearch.prototype = Object.create(PhoneNumberSearchCustom.prototype, {})\r\nPhoneNumberSearch.prototype.constructor = PhoneNumberSearch\r\n\r\nexport function AsYouType(country)\r\n{\r\n\tAsYouTypeCustom.call(this, country, metadata)\r\n}\r\n\r\nAsYouType.prototype = Object.create(AsYouTypeCustom.prototype, {})\r\nAsYouType.prototype.constructor = AsYouType\r\n\r\nexport function getExtPrefix()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn getExtPrefixCustom.apply(this, parameters)\r\n}\r\n\r\nexport function parseRFC3966()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn parseRFC3966Custom.apply(this, parameters)\r\n}\r\n\r\nexport function formatRFC3966()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(metadata)\r\n\treturn formatRFC3966Custom.apply(this, parameters)\r\n}\r\n\r\n// Deprecated: remove DIGITS export in 2.0.0 (unused).\r\nexport { DIGIT_MAPPINGS as DIGITS } from './es6/common'\r\n\r\n// Deprecated: remove this in 2.0.0 and make `custom.js` in ES6\r\n// (the old `custom.js` becomes `custom.commonjs.js`).\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/types'\r\nexport { default as getCountryCallingCodeCustom } from './es6/getCountryCallingCode'\r\n\r\nexport\r\n{\r\n\tdefault as AsYouTypeCustom,\r\n\t// `DIGIT_PLACEHOLDER` is used by `react-phone-number-input`.\r\n\tDIGIT_PLACEHOLDER\r\n}\r\nfrom './es6/AsYouType'\r\n\r\nexport function getCountryCallingCode(country)\r\n{\r\n\treturn getCountryCallingCodeCustom(country, metadata)\r\n}\r\n\r\n// `getPhoneCode` name is deprecated, use `getCountryCallingCode` instead.\r\nexport function getPhoneCode(country)\r\n{\r\n\treturn getCountryCallingCode(country)\r\n}\r\n\r\n// `getPhoneCodeCustom` name is deprecated, use `getCountryCallingCodeCustom` instead.\r\nexport function getPhoneCodeCustom(country, metadata)\r\n{\r\n\treturn getCountryCallingCodeCustom(country, metadata)\r\n}"],"sourceRoot":""}