{"version":3,"sources":["webpack://libphonenumber/webpack/universalModuleDefinition","webpack://libphonenumber/webpack/bootstrap","webpack://libphonenumber/./es6/metadata.js","webpack://libphonenumber/./es6/parse.js","webpack://libphonenumber/./es6/common.js","webpack://libphonenumber/./es6/types.js","webpack://libphonenumber/./es6/RFC3966.js","webpack://libphonenumber/./es6/format.js","webpack://libphonenumber/./es6/AsYouType.js","webpack://libphonenumber/./es6/getCountryCallingCode.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","_semverCompare","_createClass","defineProperties","target","props","length","descriptor","writable","key","Constructor","protoProps","staticProps","_classCallCheck","instance","TypeError","Metadata","metadata","this","countries","Error","v1","version","v2","country","undefined","_country","country_metadata","hasCountry","_this","formats","map","_","Format","nationalPrefix","types","_type","hasTypes","getType","Type","country_phone_code_to_countries","country_calling_codes","country_calling_code","countryCallingCodes","format","_format","nationalPrefixFormattingRule","nationalPrefixIsOptionalWhenFormatting","usesNationalPrefix","test","replace","type","possibleLengths","arg_1","arg_2","arg_3","arg_4","_sort_out_arguments","text","options","_extends","defaultCountry","default_options","_metadata2","default","sort_out_arguments","_parse_input","indexOf","_RFC","parseRFC3966","number","extract_formatted_phone_number","is_viable_phone_number","with_extension_stripped","start","search","EXTN_PATTERN","number_without_extension","slice","matches","match","ext","strip_extension","parse_input","formatted_phone_number","_parse_phone_number","default_country","_parse_national_numbe","_common","parse_national_number_and_country_calling_code","countryCallingCode","find_country_code","chooseCountryByCountryCallingCode","_parse_national_numbe2","national_number","parse_phone_number_digits","carrier_code","_strip_national_prefi","strip_national_prefix_and_carrier_code","potential_national_number","carrierCode","_types","check_number_length_for_type","matches_entirely","nationalNumberPattern","parse_national_number","parse_phone_number","selectedCountry","extended","MIN_LENGTH_FOR_NSN","MAX_LENGTH_FOR_NSN","valid","RegExp","result","phone","possible","is_international","is_possible_number","assign","arguments","source","MAX_INPUT_STRING_LENGTH","EXTN_PATTERNS_FOR_PARSING","create_extension_pattern","MIN_LENGTH_PHONE_NUMBER_PATTERN","VALID_DIGITS","VALID_PHONE_NUMBER","PLUS_CHARS","VALID_PUNCTUATION","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","original_country","_iterator","_isArray","Array","isArray","_i","Symbol","iterator","_ref","next","done","leadingDigits","_types2","_find_country_code","MAX_LENGTH_COUNTRY_CODE","regular_expression","matched_groups","purpose","single_extension_characters","RFC3966_EXTN_PREFIX","CAPTURING_EXTN_DIGITS","WHITESPACE","LEADING_PLUS_CHARS_PATTERN","DIGIT_MAPPINGS","0","1","2","3","4","5","6","7","8","9","0","1","2","3","4","5","6","7","8","9","٠","١","٢","٣","٤","٥","٦","٧","٨","٩","۰","۱","۲","۳","۴","۵","۶","۷","۸","۹","replacements","replaced","split","character","replacement","toUpperCase","drop_and_substitute_characters","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","_typeof","_typeof2","obj","constructor","_parse2","is_object","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","format_national_number","add_extension","formatExtension","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","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","PhoneNumberSearch","phones","hasNext","searchPhoneNumbers","_sort_out_arguments2","_defineProperty","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","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["(function webpackUniversalModuleDefinition(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 = 12);\n","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\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\nvar Metadata = function () {\n\tfunction Metadata(metadata) {\n\t\t_classCallCheck(this, Metadata);\n\n\t\t// Metadata is required.\n\t\tif (!metadata || !metadata.countries) {\n\t\t\tthrow new Error('Metadata is required');\n\t\t}\n\n\t\tthis.metadata = metadata;\n\n\t\tthis.v1 = !metadata.version;\n\t\tthis.v2 = metadata.version; // && compare(version, V3) === -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: 'nationalNumberPattern',\n\t\tvalue: function nationalNumberPattern() {\n\t\t\treturn this.country_metadata[1];\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[2];\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 : 3] || [];\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 : 4];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixFormattingRule',\n\t\tvalue: function nationalPrefixFormattingRule() {\n\t\t\treturn this.country_metadata[this.v1 ? 4 : 5];\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 : 6] || 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 : 7];\n\t\t}\n\t}, {\n\t\tkey: 'nationalPrefixIsOptionalWhenFormatting',\n\t\tvalue: function nationalPrefixIsOptionalWhenFormatting() {\n\t\t\treturn this.country_metadata[this.v1 ? 7 : 8];\n\t\t}\n\t}, {\n\t\tkey: 'leadingDigits',\n\t\tvalue: function leadingDigits() {\n\t\t\treturn this.country_metadata[this.v1 ? 8 : 9];\n\t\t}\n\t}, {\n\t\tkey: 'types',\n\t\tvalue: function types() {\n\t\t\treturn this.country_metadata[this.v1 ? 9 : 10];\n\t\t}\n\t}, {\n\t\tkey: 'hasTypes',\n\t\tvalue: function hasTypes() {\n\t\t\treturn this.types() !== undefined;\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: '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//# 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 {};\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\tvar original_country = metadata.selectedCountry();\n\tvar country = _find_country_code(possible_countries, national_phone_number, metadata);\n\tmetadata.country(original_country);\n\treturn country;\n}\n\n// Changes `metadata` `country`.\nfunction _find_country_code(possible_countries, national_phone_number, metadata) {\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// Metadata is required.\n\tif (!metadata || !metadata.countries) {\n\t\tthrow new Error('Metadata is required');\n\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, 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","// `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, 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\treturn { number: number };\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\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\t// Metadata is required.\n\tif (!metadata || !metadata.countries) {\n\t\tthrow new Error('Metadata is required');\n\t}\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 Metadata from './metadata';\n\nimport { formatRFC3966 } from './RFC3966';\n\nvar default_options = {\n\tformatExtension: function formatExtension(number, extension) {\n\t\treturn number + ' 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, 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, 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 '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, 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// Metadata is required.\n\tif (!metadata) {\n\t\tthrow new Error('Metadata is required');\n\t}\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\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({}, default_options, options);\n\t} else {\n\t\toptions = default_options;\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, formatExtension) {\n\treturn ext ? formatExtension(number, ext) : number;\n}\n//# sourceMappingURL=format.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\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.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\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.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","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\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\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// // 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, { defaultCountry: this.options.defaultCountry }, 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\t// Metadata is required.\n\tif (!metadata || !metadata.countries) {\n\t\tthrow new Error('Metadata is required');\n\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 { 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 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":""}