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ACN,GAAM,SACN,GAAM,UACN,GAAM,SACN,GAAM,gBACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,SACN,GAAM,0BACN,GAAM,oCACN,GAAM,2BACN,GAAM,QACN,GAAM,cACN,GAAM,gBACN,GAAM,eACN,GAAM,QACN,GAAM,WACN,GAAM,QACN,GAAM,WACN,GAAM,aACN,GAAM,OACN,GAAM,aACN,GAAM,aACN,GAAM,mBACN,GAAM,SACN,GAAM,iBACN,GAAM,UACN,GAAM,WACN,GAAM,UACN,GAAM,WACN,GAAM,qBACN,GAAM,UACN,GAAM,UACN,GAAM,UACN,GAAM,QACN,GAAM,iBACN,GAAM,UACN,GAAM,QACN,GAAM,WACN,GAAM,UACN,GAAM,OACN,GAAM,mBACN,GAAM,iCACN,GAAM,gBACN,GAAM,SACN,GAAM,QACN,GAAM,iBACN,GAAM,UACN,GAAM,UACN,GAAM,gBACN,GAAM,WACN,GAAM,QACN,GAAM,YACN,GAAM,YACN,GAAM,SACN,GAAM,SACN,GAAM,aACN,GAAM,oBACN,GAAM,SACN,GAAM,+CACN,GAAM,YACN,GAAM,OACN,GAAM,gBACN,GAAM,SACN,GAAM,YACN,GAAM,oCACN,GAAM,WACN,GAAM,UACN,GAAM,QACN,GAAM,UACN,GAAM,YACN,GAAM,UACN,GAAM,SACN,GAAM,cACN,GAAM,QACN,GAAM,iCACN,GAAM,OACN,GAAM,OACN,GAAM,UACN,GAAM,QACN,GAAM,SACN,GAAM,UACN,GAAM,SACN,GAAM,QACN,GAAM,QACN,GAAM,aACN,GAAM,WACN,GAAM,WACN,GAAM,UACN,GAAM,wBACN,GAAM,cACN,GAAM,cACN,GAAM,SACN,GAAM,iBACN,GAAM,aACN,GAAM,OACN,GAAM,UACN,GAAM,cACN,GAAM,gBACN,GAAM,YACN,GAAM,UACN,GAAM,UACN,GAAM,YACN,GAAM,aACN,GAAM,SACN,GAAM,QACN,GAAM,UACN,GAAM,SACN,GAAM,UACN,GAAM,aACN,GAAM,6BACN,GAAM,aACN,GAAM,mBACN,GAAM,kBACN,GAAM,OACN,GAAM,UACN,GAAM,WACN,GAAM,QACN,GAAM,2BACN,GAAM,aACN,GAAM,aACN,GAAM,aACN,GAAM,QACN,GAAM,YACN,GAAM,WACN,GAAM,SACN,GAAM,SACN,GAAM,WACN,GAAM,aACN,GAAM,UACN,GAAM,gBACN,GAAM,QACN,GAAM,iBACN,GAAM,UACN,GAAM,YACN,GAAM,cACN,GAAM,SACN,GAAM,QACN,GAAM,QACN,GAAM,OACN,GAAM,cACN,GAAM,OACN,GAAM,gBACN,GAAM,SACN,GAAM,OACN,GAAM,mBACN,GAAM,mBACN,GAAM,cACN,GAAM,WACN,GAAM,SACN,GAAM,4BACN,GAAM,WACN,GAAM,cACN,GAAM,YACN,GAAM,WACN,GAAM,QACN,GAAM,WACN,GAAM,QACN,GAAM,UACN,GAAM,UACN,GAAM,SACN,GAAM,SACN,GAAM,SACN,GAAM,eACN,GAAM,kBACN,GAAM,aACN,GAAM,QACN,GAAM,SACN,GAAM,YACN,GAAM,eACN,GAAM,WACN,GAAM,yBACN,GAAM,WACN,GAAM,eACN,GAAM,aACN,GAAM,UACN,GAAM,UACN,GAAM,WACN,GAAM,cACN,GAAM,wBACN,GAAM,cACN,GAAM,eACN,GAAM,QACN,GAAM,YACN,GAAM,mBACN,GAAM,2BACN,GAAM,OACN,GAAM,8BACN,GAAM,OACN,GAAM,WACN,GAAM,aACN,GAAM,UACN,GAAM,cACN,GAAM,eACN,GAAM,UACN,GAAM,QACN,GAAM,SACN,GAAM,sBACN,GAAM,SACN,GAAM,SACN,GAAM,WACN,GAAM,UACN,GAAM,SACN,GAAM,uCACN,GAAM,gBACN,GAAM,UACN,GAAM,aACN,GAAM,gCACN,GAAM,mCACN,GAAM,YACN,GAAM,0BACN,GAAM,uBACN,GAAM,UACN,GAAM,UACN,GAAM,oBACN,GAAM,QACN,GAAM,SACN,GAAM,QACN,GAAM,UACN,GAAM,eACN,GAAM,SACN,GAAM,WACN,G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AAOnnB,GAAK,EAAmB3G,UAChC","sources":["webpack://bravely/./node_modules/js-cookie/src/js.cookie.js","webpack://bravely/./node_modules/react-i18next/dist/es/withTranslation.js","webpack://bravely/./node_modules/libphonenumber-js/es6/normalizeArguments.js","webpack://bravely/./node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js","webpack://bravely/./node_modules/libphonenumber-js/es6/parsePhoneNumber_.js","webpack://bravely/./node_modules/libphonenumber-js/es6/parsePhoneNumber.js","webpack://bravely/./node_modules/react-phone-number-input/locale/en.json.js","webpack://bravely/./node_modules/react-phone-number-input/modules/PropTypes.js","webpack://bravely/./node_modules/input-format/modules/helpers.js","webpack://bravely/./node_modules/input-format/modules/templateFormatter.js","webpack://bravely/./node_modules/input-format/modules/closeBraces.js","webpack://bravely/./node_modules/input-format/modules/dom.js","webpack://bravely/./node_modules/input-format/modules/inputControl.js","webpack://bravely/./node_modules/input-format/modules/parse.js","webpack://bravely/./node_modules/input-format/modules/edit.js","webpack://bravely/./node_modules/input-format/modules/format.js","webpack://bravely/./node_modules/input-format/modules/react/Input.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeState.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouTypeParser.js","webpack://bravely/./node_modules/libphonenumber-js/es6/AsYouType.js","webpack://bravely/./node_modules/react-phone-number-input/modules/helpers/inputValuePrefix.js","webpack://bravely/./node_modules/react-phone-number-input/modules/InputSmart.js","webpack://bravely/./node_modules/react-phone-number-input/modules/InputBasic.js","webpack://bravely/./node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js","webpack://bravely/./node_modules/country-flag-icons/modules/unicode.js","webpack://bravely/./node_modules/react-phone-number-input/modules/CountrySelect.js","webpack://bravely/./node_modules/react-phone-number-input/modules/Flag.js","webpack://bravely/./node_modules/react-phone-number-input/modules/InternationalIcon.js","webpack://bravely/./node_modules/react-phone-number-input/modules/helpers/countries.js","webpack://bravely/./node_modules/libphonenumber-js/es6/getCountries.js","webpack://bravely/./node_modules/react-phone-number-input/modules/CountryIcon.js","webpack://bravely/./node_modules/react-phone-number-input/modules/helpers/getInternationalPhoneNumberPrefix.js","webpack://bravely/./node_modules/react-phone-number-input/modules/helpers/phoneInputHelpers.js","webpack://bravely/./node_modules/react-phone-number-input/modules/helpers/getPhoneInputWithCountryStateUpdateFromNewProps.js","webpack://bravely/./node_modules/react-phone-number-input/modules/PhoneInputWithCountry.js","webpack://bravely/./node_modules/react-phone-number-input/modules/PhoneInputWithCountryDefault.js","webpack://bravely/./node_modules/react-phone-number-input/min/index.js"],"sourcesContent":["/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nvar _excluded = [\"forwardedRef\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { createElement, forwardRef as forwardRefReact } from 'react';\nimport { useTranslation } from './useTranslation';\nimport { getDisplayName } from './utils';\nexport function withTranslation(ns) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return function Extend(WrappedComponent) {\n function I18nextWithTranslation(_ref) {\n var forwardedRef = _ref.forwardedRef,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n var _useTranslation = useTranslation(ns, _objectSpread(_objectSpread({}, rest), {}, {\n keyPrefix: options.keyPrefix\n })),\n _useTranslation2 = _slicedToArray(_useTranslation, 3),\n t = _useTranslation2[0],\n i18n = _useTranslation2[1],\n ready = _useTranslation2[2];\n\n var passDownProps = _objectSpread(_objectSpread({}, rest), {}, {\n t: t,\n i18n: i18n,\n tReady: ready\n });\n\n if (options.withRef && forwardedRef) {\n passDownProps.ref = forwardedRef;\n } else if (!options.withRef && forwardedRef) {\n passDownProps.forwardedRef = forwardedRef;\n }\n\n return createElement(WrappedComponent, passDownProps);\n }\n\n I18nextWithTranslation.displayName = \"withI18nextTranslation(\".concat(getDisplayName(WrappedComponent), \")\");\n I18nextWithTranslation.WrappedComponent = WrappedComponent;\n\n var forwardRef = function forwardRef(props, ref) {\n return createElement(I18nextWithTranslation, Object.assign({}, props, {\n forwardedRef: ref\n }));\n };\n\n return options.withRef ? forwardRefReact(forwardRef) : I18nextWithTranslation;\n };\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport isObject from './helpers/isObject.js'; // Extracts the following properties from function arguments:\n// * input `text`\n// * `options` object\n// * `metadata` JSON\n\nexport default function normalizeArguments(args) {\n var _Array$prototype$slic = Array.prototype.slice.call(args),\n _Array$prototype$slic2 = _slicedToArray(_Array$prototype$slic, 4),\n arg_1 = _Array$prototype$slic2[0],\n arg_2 = _Array$prototype$slic2[1],\n arg_3 = _Array$prototype$slic2[2],\n arg_4 = _Array$prototype$slic2[3];\n\n var text;\n var options;\n var metadata; // If the phone number is passed as a string.\n // `parsePhoneNumber('88005553535', ...)`.\n\n if (typeof arg_1 === 'string') {\n text = arg_1;\n } else throw new TypeError('A text for parsing must be a string.'); // If \"default country\" argument is being passed then move it to `options`.\n // `parsePhoneNumber('88005553535', 'RU', [options], metadata)`.\n\n\n if (!arg_2 || typeof arg_2 === 'string') {\n if (arg_4) {\n options = arg_3;\n metadata = arg_4;\n } else {\n options = undefined;\n metadata = arg_3;\n }\n\n if (arg_2) {\n options = _objectSpread({\n defaultCountry: arg_2\n }, options);\n }\n } // `defaultCountry` is not passed.\n // Example: `parsePhoneNumber('+78005553535', [options], metadata)`.\n else if (isObject(arg_2)) {\n if (arg_3) {\n options = arg_2;\n metadata = arg_3;\n } else {\n metadata = arg_2;\n }\n } else throw new Error(\"Invalid second argument: \".concat(arg_2));\n\n return {\n text: text,\n options: options,\n metadata: metadata\n };\n}\n//# sourceMappingURL=normalizeArguments.js.map","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parse from './parse.js';\nexport default function parsePhoneNumberWithError(text, options, metadata) {\n return parse(text, _objectSpread(_objectSpread({}, options), {}, {\n v2: true\n }), metadata);\n}\n//# sourceMappingURL=parsePhoneNumberWithError_.js.map","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport parsePhoneNumberWithError from './parsePhoneNumberWithError_.js';\nimport ParseError from './ParseError.js';\nimport { isSupportedCountry } from './metadata.js';\nexport default function parsePhoneNumber(text, options, metadata) {\n // Validate `defaultCountry`.\n if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {\n options = _objectSpread(_objectSpread({}, options), {}, {\n defaultCountry: undefined\n });\n } // Parse phone number.\n\n\n try {\n return parsePhoneNumberWithError(text, options, metadata);\n } catch (error) {\n /* istanbul ignore else */\n if (error instanceof ParseError) {//\n } else {\n throw error;\n }\n }\n}\n//# sourceMappingURL=parsePhoneNumber_.js.map","import normalizeArguments from './normalizeArguments.js';\nimport parsePhoneNumber_ from './parsePhoneNumber_.js';\nexport default function parsePhoneNumber() {\n var _normalizeArguments = normalizeArguments(arguments),\n text = _normalizeArguments.text,\n options = _normalizeArguments.options,\n metadata = _normalizeArguments.metadata;\n\n return parsePhoneNumber_(text, options, metadata);\n}\n//# sourceMappingURL=parsePhoneNumber.js.map","export default {\n \"ext\": \"ext.\",\n \"country\": \"Phone number country\",\n \"phone\": \"Phone\",\n \"AB\": \"Abkhazia\",\n \"AC\": \"Ascension Island\",\n \"AD\": \"Andorra\",\n \"AE\": \"United Arab Emirates\",\n \"AF\": \"Afghanistan\",\n \"AG\": \"Antigua and Barbuda\",\n \"AI\": \"Anguilla\",\n \"AL\": \"Albania\",\n \"AM\": \"Armenia\",\n \"AO\": \"Angola\",\n \"AQ\": \"Antarctica\",\n \"AR\": \"Argentina\",\n \"AS\": \"American Samoa\",\n \"AT\": \"Austria\",\n \"AU\": \"Australia\",\n \"AW\": \"Aruba\",\n \"AX\": \"Åland Islands\",\n \"AZ\": \"Azerbaijan\",\n \"BA\": \"Bosnia and Herzegovina\",\n \"BB\": \"Barbados\",\n \"BD\": \"Bangladesh\",\n \"BE\": \"Belgium\",\n \"BF\": \"Burkina Faso\",\n \"BG\": \"Bulgaria\",\n \"BH\": \"Bahrain\",\n \"BI\": \"Burundi\",\n \"BJ\": \"Benin\",\n \"BL\": \"Saint Barthélemy\",\n \"BM\": \"Bermuda\",\n \"BN\": \"Brunei Darussalam\",\n \"BO\": \"Bolivia\",\n \"BQ\": \"Bonaire, Sint Eustatius and Saba\",\n \"BR\": \"Brazil\",\n \"BS\": \"Bahamas\",\n \"BT\": \"Bhutan\",\n \"BV\": \"Bouvet Island\",\n \"BW\": \"Botswana\",\n \"BY\": \"Belarus\",\n \"BZ\": \"Belize\",\n \"CA\": \"Canada\",\n \"CC\": \"Cocos (Keeling) Islands\",\n \"CD\": \"Congo, Democratic Republic of the\",\n \"CF\": \"Central African Republic\",\n \"CG\": \"Congo\",\n \"CH\": \"Switzerland\",\n \"CI\": \"Cote d'Ivoire\",\n \"CK\": \"Cook Islands\",\n \"CL\": \"Chile\",\n \"CM\": \"Cameroon\",\n \"CN\": \"China\",\n \"CO\": \"Colombia\",\n \"CR\": \"Costa Rica\",\n \"CU\": \"Cuba\",\n \"CV\": \"Cape Verde\",\n \"CW\": \"Curaçao\",\n \"CX\": \"Christmas Island\",\n \"CY\": \"Cyprus\",\n \"CZ\": \"Czech Republic\",\n \"DE\": \"Germany\",\n \"DJ\": \"Djibouti\",\n \"DK\": \"Denmark\",\n \"DM\": \"Dominica\",\n \"DO\": \"Dominican Republic\",\n \"DZ\": \"Algeria\",\n \"EC\": \"Ecuador\",\n \"EE\": \"Estonia\",\n \"EG\": \"Egypt\",\n \"EH\": \"Western Sahara\",\n \"ER\": \"Eritrea\",\n \"ES\": \"Spain\",\n \"ET\": \"Ethiopia\",\n \"FI\": \"Finland\",\n \"FJ\": \"Fiji\",\n \"FK\": \"Falkland Islands\",\n \"FM\": \"Federated States of Micronesia\",\n \"FO\": \"Faroe Islands\",\n \"FR\": \"France\",\n \"GA\": \"Gabon\",\n \"GB\": \"United Kingdom\",\n \"GD\": \"Grenada\",\n \"GE\": \"Georgia\",\n \"GF\": \"French Guiana\",\n \"GG\": \"Guernsey\",\n \"GH\": \"Ghana\",\n \"GI\": \"Gibraltar\",\n \"GL\": \"Greenland\",\n \"GM\": \"Gambia\",\n \"GN\": \"Guinea\",\n \"GP\": \"Guadeloupe\",\n \"GQ\": \"Equatorial Guinea\",\n \"GR\": \"Greece\",\n \"GS\": \"South Georgia and the South Sandwich Islands\",\n \"GT\": \"Guatemala\",\n \"GU\": \"Guam\",\n \"GW\": \"Guinea-Bissau\",\n \"GY\": \"Guyana\",\n \"HK\": \"Hong Kong\",\n \"HM\": \"Heard Island and McDonald Islands\",\n \"HN\": \"Honduras\",\n \"HR\": \"Croatia\",\n \"HT\": \"Haiti\",\n \"HU\": \"Hungary\",\n \"ID\": \"Indonesia\",\n \"IE\": \"Ireland\",\n \"IL\": \"Israel\",\n \"IM\": \"Isle of Man\",\n \"IN\": \"India\",\n \"IO\": \"British Indian Ocean Territory\",\n \"IQ\": \"Iraq\",\n \"IR\": \"Iran\",\n \"IS\": \"Iceland\",\n \"IT\": \"Italy\",\n \"JE\": \"Jersey\",\n \"JM\": \"Jamaica\",\n \"JO\": \"Jordan\",\n \"JP\": \"Japan\",\n \"KE\": \"Kenya\",\n \"KG\": \"Kyrgyzstan\",\n \"KH\": \"Cambodia\",\n \"KI\": \"Kiribati\",\n \"KM\": \"Comoros\",\n \"KN\": \"Saint Kitts and Nevis\",\n \"KP\": \"North Korea\",\n \"KR\": \"South Korea\",\n \"KW\": \"Kuwait\",\n \"KY\": \"Cayman Islands\",\n \"KZ\": \"Kazakhstan\",\n \"LA\": \"Laos\",\n \"LB\": \"Lebanon\",\n \"LC\": \"Saint Lucia\",\n \"LI\": \"Liechtenstein\",\n \"LK\": \"Sri Lanka\",\n \"LR\": \"Liberia\",\n \"LS\": \"Lesotho\",\n \"LT\": \"Lithuania\",\n \"LU\": \"Luxembourg\",\n \"LV\": \"Latvia\",\n \"LY\": \"Libya\",\n \"MA\": \"Morocco\",\n \"MC\": \"Monaco\",\n \"MD\": \"Moldova\",\n \"ME\": \"Montenegro\",\n \"MF\": \"Saint Martin (French Part)\",\n \"MG\": \"Madagascar\",\n \"MH\": \"Marshall Islands\",\n \"MK\": \"North Macedonia\",\n \"ML\": \"Mali\",\n \"MM\": \"Myanmar\",\n \"MN\": \"Mongolia\",\n \"MO\": \"Macao\",\n \"MP\": \"Northern Mariana Islands\",\n \"MQ\": \"Martinique\",\n \"MR\": \"Mauritania\",\n \"MS\": \"Montserrat\",\n \"MT\": \"Malta\",\n \"MU\": \"Mauritius\",\n \"MV\": \"Maldives\",\n \"MW\": \"Malawi\",\n \"MX\": \"Mexico\",\n \"MY\": \"Malaysia\",\n \"MZ\": \"Mozambique\",\n \"NA\": \"Namibia\",\n \"NC\": \"New Caledonia\",\n \"NE\": \"Niger\",\n \"NF\": \"Norfolk Island\",\n \"NG\": \"Nigeria\",\n \"NI\": \"Nicaragua\",\n \"NL\": \"Netherlands\",\n \"NO\": \"Norway\",\n \"NP\": \"Nepal\",\n \"NR\": \"Nauru\",\n \"NU\": \"Niue\",\n \"NZ\": \"New Zealand\",\n \"OM\": \"Oman\",\n \"OS\": \"South Ossetia\",\n \"PA\": \"Panama\",\n \"PE\": \"Peru\",\n \"PF\": \"French Polynesia\",\n \"PG\": \"Papua New Guinea\",\n \"PH\": \"Philippines\",\n \"PK\": \"Pakistan\",\n \"PL\": \"Poland\",\n \"PM\": \"Saint Pierre and Miquelon\",\n \"PN\": \"Pitcairn\",\n \"PR\": \"Puerto Rico\",\n \"PS\": \"Palestine\",\n \"PT\": \"Portugal\",\n \"PW\": \"Palau\",\n \"PY\": \"Paraguay\",\n \"QA\": \"Qatar\",\n \"RE\": \"Reunion\",\n \"RO\": \"Romania\",\n \"RS\": \"Serbia\",\n \"RU\": \"Russia\",\n \"RW\": \"Rwanda\",\n \"SA\": \"Saudi Arabia\",\n \"SB\": \"Solomon Islands\",\n \"SC\": \"Seychelles\",\n \"SD\": \"Sudan\",\n \"SE\": \"Sweden\",\n \"SG\": \"Singapore\",\n \"SH\": \"Saint Helena\",\n \"SI\": \"Slovenia\",\n \"SJ\": \"Svalbard and Jan Mayen\",\n \"SK\": \"Slovakia\",\n \"SL\": \"Sierra Leone\",\n \"SM\": \"San Marino\",\n \"SN\": \"Senegal\",\n \"SO\": \"Somalia\",\n \"SR\": \"Suriname\",\n \"SS\": \"South Sudan\",\n \"ST\": \"Sao Tome and Principe\",\n \"SV\": \"El Salvador\",\n \"SX\": \"Sint Maarten\",\n \"SY\": \"Syria\",\n \"SZ\": \"Swaziland\",\n \"TA\": \"Tristan da Cunha\",\n \"TC\": \"Turks and Caicos Islands\",\n \"TD\": \"Chad\",\n \"TF\": \"French Southern Territories\",\n \"TG\": \"Togo\",\n \"TH\": \"Thailand\",\n \"TJ\": \"Tajikistan\",\n \"TK\": \"Tokelau\",\n \"TL\": \"Timor-Leste\",\n \"TM\": \"Turkmenistan\",\n \"TN\": \"Tunisia\",\n \"TO\": \"Tonga\",\n \"TR\": \"Turkey\",\n \"TT\": \"Trinidad and Tobago\",\n \"TV\": \"Tuvalu\",\n \"TW\": \"Taiwan\",\n \"TZ\": \"Tanzania\",\n \"UA\": \"Ukraine\",\n \"UG\": \"Uganda\",\n \"UM\": \"United States Minor Outlying Islands\",\n \"US\": \"United States\",\n \"UY\": \"Uruguay\",\n \"UZ\": \"Uzbekistan\",\n \"VA\": \"Holy See (Vatican City State)\",\n \"VC\": \"Saint Vincent and the Grenadines\",\n \"VE\": \"Venezuela\",\n \"VG\": \"Virgin Islands, British\",\n \"VI\": \"Virgin Islands, U.S.\",\n \"VN\": \"Vietnam\",\n \"VU\": \"Vanuatu\",\n \"WF\": \"Wallis and Futuna\",\n \"WS\": \"Samoa\",\n \"XK\": \"Kosovo\",\n \"YE\": \"Yemen\",\n \"YT\": \"Mayotte\",\n \"ZA\": \"South Africa\",\n \"ZM\": \"Zambia\",\n \"ZW\": \"Zimbabwe\",\n \"ZZ\": \"International\"\n}","import PropTypes from 'prop-types';\nexport var metadata = PropTypes.shape({\n country_calling_codes: PropTypes.object.isRequired,\n countries: PropTypes.object.isRequired\n});\nexport var labels = PropTypes.objectOf(PropTypes.string);\n//# sourceMappingURL=PropTypes.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// Counts all occurences of a symbol in a string\nexport function count_occurences(symbol, string) {\n var count = 0; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes)\n // but template placeholder characters don't fall into that range\n // so skipping such miscellaneous \"exotic\" characters\n // won't matter here for just counting placeholder character occurrences.\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n}\n//# sourceMappingURL=helpers.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { count_occurences } from './helpers.js';\nimport close_braces from './closeBraces.js'; // Takes a `template` where character placeholders\n// are denoted by 'x'es (e.g. 'x (xxx) xxx-xx-xx').\n//\n// Returns a function which takes `value` characters\n// and returns the `template` filled with those characters.\n// If the `template` can only be partially filled\n// then it is cut off.\n//\n// If `should_close_braces` is `true`,\n// then it will also make sure all dangling braces are closed,\n// e.g. \"8 (8\" -> \"8 (8 )\" (iPhone style phone number input).\n//\n\nexport default function (template) {\n var placeholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'x';\n var should_close_braces = arguments.length > 2 ? arguments[2] : undefined;\n\n if (!template) {\n return function (value) {\n return {\n text: value\n };\n };\n }\n\n var characters_in_template = count_occurences(placeholder, template);\n return function (value) {\n if (!value) {\n return {\n text: '',\n template: template\n };\n }\n\n var value_character_index = 0;\n var filled_in_template = ''; // Using `.split('')` here instead of normal `for ... of`\n // because the importing application doesn't neccessarily include an ES6 polyfill.\n // The `.split('')` approach discards \"exotic\" UTF-8 characters\n // (the ones consisting of four bytes)\n // but template placeholder characters don't fall into that range\n // and appending UTF-8 characters to a string in parts still works.\n\n for (var _iterator = _createForOfIteratorHelperLoose(template.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n\n if (character !== placeholder) {\n filled_in_template += character;\n continue;\n }\n\n filled_in_template += value[value_character_index];\n value_character_index++; // If the last available value character has been filled in,\n // then return the filled in template\n // (either trim the right part or retain it,\n // if no more character placeholders in there)\n\n if (value_character_index === value.length) {\n // If there are more character placeholders\n // in the right part of the template\n // then simply trim it.\n if (value.length < characters_in_template) {\n break;\n }\n }\n }\n\n if (should_close_braces) {\n filled_in_template = close_braces(filled_in_template, template);\n }\n\n return {\n text: filled_in_template,\n template: template\n };\n };\n}\n//# sourceMappingURL=templateFormatter.js.map","import { count_occurences } from './helpers.js';\nexport default function closeBraces(retained_template, template) {\n var placeholder = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'x';\n var empty_placeholder = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ' ';\n var cut_before = retained_template.length;\n var opening_braces = count_occurences('(', retained_template);\n var closing_braces = count_occurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n retained_template += template[cut_before].replace(placeholder, empty_placeholder);\n\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return retained_template;\n}\n//# sourceMappingURL=closeBraces.js.map","export function isReadOnly(element) {\n return element.hasAttribute('readonly');\n} // Gets selection bounds\n\nexport function getSelection(element) {\n // If no selection, return nothing\n if (element.selectionStart === element.selectionEnd) {\n return;\n }\n\n return {\n start: element.selectionStart,\n end: element.selectionEnd\n };\n} // Key codes\n\nexport var Keys = {\n Backspace: 8,\n Delete: 46\n}; // Finds out the operation to be intercepted and performed\n// based on the key down event `keyCode`.\n\nexport function getOperation(event) {\n switch (event.keyCode) {\n case Keys.Backspace:\n return 'Backspace';\n\n case Keys.Delete:\n return 'Delete';\n }\n} // Gets caret position\n\nexport function getCaretPosition(element) {\n return element.selectionStart;\n} // Sets caret position\n\nexport function setCaretPosition(element, caret_position) {\n // Sanity check\n if (caret_position === undefined) {\n return;\n } // Set caret position.\n // There has been an issue with caret positioning on Android devices.\n // https://github.com/catamphetamine/input-format/issues/2\n // I was revisiting this issue and looked for similar issues in other libraries.\n // For example, there's [`text-mask`](https://github.com/text-mask/text-mask) library.\n // They've had exactly the same issue when the caret seemingly refused to be repositioned programmatically.\n // The symptoms were the same: whenever the caret passed through a non-digit character of a mask (a whitespace, a bracket, a dash, etc), it looked as if it placed itself one character before its correct position.\n // https://github.com/text-mask/text-mask/issues/300\n // They seem to have found a basic fix for it: calling `input.setSelectionRange()` in a timeout rather than instantly for Android devices.\n // https://github.com/text-mask/text-mask/pull/400/files\n // I've implemented the same workaround here.\n\n\n if (isAndroid()) {\n setTimeout(function () {\n return element.setSelectionRange(caret_position, caret_position);\n }, 0);\n } else {\n element.setSelectionRange(caret_position, caret_position);\n }\n}\n\nfunction isAndroid() {\n // `navigator` is not defined when running mocha tests.\n if (typeof navigator !== 'undefined') {\n return ANDROID_USER_AGENT_REG_EXP.test(navigator.userAgent);\n }\n}\n\nvar ANDROID_USER_AGENT_REG_EXP = /Android/i;\n//# sourceMappingURL=dom.js.map","import edit from './edit.js';\nimport parse from './parse.js';\nimport format from './format.js';\nimport { isReadOnly, getOperation, getSelection, getCaretPosition, setCaretPosition } from './dom.js'; // Deprecated.\n// I don't know why this function exists.\n\nexport function onCut(event, input, _parse, _format, on_change) {\n if (isReadOnly(input)) {\n return;\n } // The actual cut hasn't happened just yet hence the timeout.\n\n\n setTimeout(function () {\n return formatInputText(input, _parse, _format, undefined, on_change);\n }, 0);\n} // Deprecated.\n// I don't know why this function exists.\n\nexport function onPaste(event, input, _parse, _format, on_change) {\n if (isReadOnly(input)) {\n return;\n }\n\n var selection = getSelection(input); // If selection is made,\n // just erase the selected text\n // prior to pasting\n\n if (selection) {\n eraseSelection(input, selection);\n }\n\n formatInputText(input, _parse, _format, undefined, on_change);\n}\nexport function onChange(event, input, _parse, _format, on_change) {\n formatInputText(input, _parse, _format, undefined, on_change);\n} // \"Delete\" and \"Backspace\" keys are special\n// in a way that they're not handled by the regular `onChange()` handler\n// and instead are intercepted and re-applied manually.\n// The reason is that normally hitting \"Backspace\" or \"Delete\"\n// results in erasing a character, but that character might be any character,\n// while it would be a better \"user experience\" if it erased not just any character\n// but the closest \"meaningful\" character.\n// For example, if a template is `(xxx) xxx-xxxx`,\n// and the `` value is `(111) 222-3333`,\n// then, if a user begins erasing the `3333` part via \"Backspace\"\n// and reaches the \"-\" character, then it would just erase the \"-\" character.\n// Nothing wrong with that, but it would be a better \"user experience\"\n// if hitting \"Backspace\" at that position would erase the closest \"meaningful\"\n// character, which would be the rightmost `2`.\n// So, what this `onKeyDown()` handler does is it intercepts\n// \"Backspace\" and \"Delete\" keys and re-applies those operations manually\n// following the logic described above.\n\nexport function onKeyDown(event, input, _parse, _format, on_change) {\n if (isReadOnly(input)) {\n return;\n }\n\n var operation = getOperation(event);\n\n switch (operation) {\n case 'Delete':\n case 'Backspace':\n // Intercept this operation and perform it manually.\n event.preventDefault();\n var selection = getSelection(input); // If a selection is made, just erase the selected text.\n\n if (selection) {\n eraseSelection(input, selection);\n return formatInputText(input, _parse, _format, undefined, on_change);\n } // Else, perform the (character erasing) operation manually.\n\n\n return formatInputText(input, _parse, _format, operation, on_change);\n\n default: // Will be handled normally as part of the `onChange` handler.\n\n }\n}\n/**\r\n * Erases the selected text inside an ``.\r\n * @param {DOMElement} input\r\n * @param {Selection} selection\r\n */\n\nfunction eraseSelection(input, selection) {\n var text = input.value;\n text = text.slice(0, selection.start) + text.slice(selection.end);\n input.value = text;\n setCaretPosition(input, selection.start);\n}\n/**\r\n * Parses and re-formats `` textual value.\r\n * E.g. when a user enters something into the ``\r\n * that raw input must first be parsed and the re-formatted properly.\r\n * Is called either after some user input (e.g. entered a character, pasted something)\r\n * or after the user performed an `operation` (e.g. \"Backspace\", \"Delete\").\r\n * @param {DOMElement} input\r\n * @param {Function} parse\r\n * @param {Function} format\r\n * @param {string} [operation] - The operation that triggered `` textual value change. E.g. \"Backspace\", \"Delete\".\r\n * @param {Function} onChange\r\n */\n\n\nfunction formatInputText(input, _parse, _format, operation, on_change) {\n // Parse `` textual value.\n // Get the `value` and `caret` position.\n var _parse2 = parse(input.value, getCaretPosition(input), _parse),\n value = _parse2.value,\n caret = _parse2.caret; // If a user performed an operation (\"Backspace\", \"Delete\")\n // then apply that operation and get the new `value` and `caret` position.\n\n\n if (operation) {\n var newValueAndCaret = edit(value, caret, operation);\n value = newValueAndCaret.value;\n caret = newValueAndCaret.caret;\n } // Format the `value`.\n // (and reposition the caret accordingly)\n\n\n var formatted = format(value, caret, _format);\n var text = formatted.text;\n caret = formatted.caret; // Set `` textual value manually\n // to prevent React from resetting the caret position\n // later inside a subsequent `render()`.\n // Doesn't work for custom `inputComponent`s for some reason.\n\n input.value = text; // Position the caret properly.\n\n setCaretPosition(input, caret); // If the `` textual value did change,\n // then the parsed `value` may have changed too.\n\n on_change(value);\n}\n//# sourceMappingURL=inputControl.js.map","// Parses the `text`.\n//\n// Returns `{ value, caret }` where `caret` is\n// the caret position inside `value`\n// corresponding to the `caret_position` inside `text`.\n//\n// The `text` is parsed by feeding each character sequentially to\n// `parse_character(character, value)` function\n// and appending the result (if it's not `undefined`) to `value`.\n//\n// Example:\n//\n// `text` is `8 (800) 555-35-35`,\n// `caret_position` is `4` (before the first `0`).\n// `parse_character` is `(character, value) =>\n// if (character >= '0' && character <= '9') { return character }`.\n//\n// then `parse()` outputs `{ value: '88005553535', caret: 2 }`.\n//\nexport default function parse(text, caret_position, parse_character) {\n var value = '';\n var focused_input_character_index = 0;\n var index = 0;\n\n while (index < text.length) {\n var character = parse_character(text[index], value);\n\n if (character !== undefined) {\n value += character;\n\n if (caret_position !== undefined) {\n if (caret_position === index) {\n focused_input_character_index = value.length - 1;\n } else if (caret_position > index) {\n focused_input_character_index = value.length;\n }\n }\n }\n\n index++;\n } // If caret position wasn't specified\n\n\n if (caret_position === undefined) {\n // Then set caret position to \"after the last input character\"\n focused_input_character_index = value.length;\n }\n\n var result = {\n value: value,\n caret: focused_input_character_index\n };\n return result;\n}\n//# sourceMappingURL=parse.js.map","// Edits text `value` (if `operation` is passed) and repositions the `caret` if needed.\n//\n// Example:\n//\n// value - '88005553535'\n// caret - 2 // starting from 0; is positioned before the first zero\n// operation - 'Backspace'\n//\n// Returns\n// {\n// \tvalue: '8005553535'\n// \tcaret: 1\n// }\n//\n// Currently supports just 'Delete' and 'Backspace' operations\n//\nexport default function edit(value, caret, operation) {\n switch (operation) {\n case 'Backspace':\n // If there exists the previous character,\n // then erase it and reposition the caret.\n if (caret > 0) {\n // Remove the previous character\n value = value.slice(0, caret - 1) + value.slice(caret); // Position the caret where the previous (erased) character was\n\n caret--;\n }\n\n break;\n\n case 'Delete':\n // Remove current digit (if any)\n value = value.slice(0, caret) + value.slice(caret + 1);\n break;\n }\n\n return {\n value: value,\n caret: caret\n };\n}\n//# sourceMappingURL=edit.js.map","import template_formatter from './templateFormatter.js'; // Formats `value` value preserving `caret` at the same character.\n//\n// `{ value, caret }` attribute is the result of `parse()` function call.\n//\n// Returns `{ text, caret }` where the new `caret` is the caret position\n// inside `text` text corresponding to the original `caret` position inside `value`.\n//\n// `formatter(value)` is a function returning `{ text, template }`.\n//\n// `text` is the `value` value formatted using `template`.\n// It may either cut off the non-filled right part of the `template`\n// or it may fill the non-filled character placeholders\n// in the right part of the `template` with `spacer`\n// which is a space (' ') character by default.\n//\n// `template` is the template used to format the `value`.\n// It can be either a full-length template or a partial template.\n//\n// `formatter` can also be a string — a `template`\n// where character placeholders are denoted by 'x'es.\n// In this case `formatter` function is automatically created.\n//\n// Example:\n//\n// `value` is '880',\n// `caret` is `2` (before the first `0`)\n//\n// `formatter` is `'880' =>\n// { text: '8 (80 )', template: 'x (xxx) xxx-xx-xx' }`\n//\n// The result is `{ text: '8 (80 )', caret: 4 }`.\n//\n\nexport default function format(value, caret, formatter) {\n if (typeof formatter === 'string') {\n formatter = template_formatter(formatter);\n }\n\n var _ref = formatter(value) || {},\n text = _ref.text,\n template = _ref.template;\n\n if (text === undefined) {\n text = value;\n }\n\n if (template) {\n if (caret === undefined) {\n caret = text.length;\n } else {\n var index = 0;\n var found = false;\n var possibly_last_input_character_index = -1;\n\n while (index < text.length && index < template.length) {\n // Character placeholder found\n if (text[index] !== template[index]) {\n if (caret === 0) {\n found = true;\n caret = index;\n break;\n }\n\n possibly_last_input_character_index = index;\n caret--;\n }\n\n index++;\n } // If the caret was positioned after last input character,\n // then the text caret index is just after the last input character.\n\n\n if (!found) {\n caret = possibly_last_input_character_index + 1;\n }\n }\n }\n\n return {\n text: text,\n caret: caret\n };\n}\n//# sourceMappingURL=format.js.map","var _excluded = [\"value\", \"parse\", \"format\", \"inputComponent\", \"onChange\", \"onKeyDown\"];\n\nfunction _extends() { _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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n// This is just `./ReactInput.js` rewritten in Hooks.\nimport React, { useCallback, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { onChange as onInputChange, onKeyDown as onInputKeyDown } from '../inputControl.js'; // Usage:\n//\n// this.setState({ phone })}\n// \tparse={character => character}\n// \tformat={value => ({ text: value, template: 'xxxxxxxx' })}/>\n//\n\nfunction Input(_ref, ref) {\n var value = _ref.value,\n parse = _ref.parse,\n format = _ref.format,\n InputComponent = _ref.inputComponent,\n onChange = _ref.onChange,\n onKeyDown = _ref.onKeyDown,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n var internalRef = useRef();\n var setRef = useCallback(function (instance) {\n internalRef.current = instance;\n\n if (ref) {\n if (typeof ref === 'function') {\n ref(instance);\n } else {\n ref.current = instance;\n }\n }\n }, [ref]);\n\n var _onChange = useCallback(function (event) {\n return onInputChange(event, internalRef.current, parse, format, onChange);\n }, [internalRef, parse, format, onChange]);\n\n var _onKeyDown = useCallback(function (event) {\n if (onKeyDown) {\n onKeyDown(event);\n }\n\n return onInputKeyDown(event, internalRef.current, parse, format, onChange);\n }, [internalRef, parse, format, onChange, onKeyDown]);\n\n return /*#__PURE__*/React.createElement(InputComponent, _extends({}, rest, {\n ref: setRef,\n value: format(isEmptyValue(value) ? '' : value).text,\n onKeyDown: _onKeyDown,\n onChange: _onChange\n }));\n}\n\nInput = /*#__PURE__*/React.forwardRef(Input);\nInput.propTypes = {\n // Parses a single characher of `` text.\n parse: PropTypes.func.isRequired,\n // Formats `value` into `` text.\n format: PropTypes.func.isRequired,\n // Renders `` by default.\n inputComponent: PropTypes.elementType.isRequired,\n // `` `type` attribute.\n type: PropTypes.string.isRequired,\n // Is parsed from text.\n value: PropTypes.string,\n // This handler is called each time `` text is changed.\n onChange: PropTypes.func.isRequired,\n // Passthrough\n onKeyDown: PropTypes.func,\n onCut: PropTypes.func,\n onPaste: PropTypes.func\n};\nInput.defaultProps = {\n // Renders `` by default.\n inputComponent: 'input',\n // `` `type` attribute.\n type: 'text'\n};\nexport default Input;\n\nfunction isEmptyValue(value) {\n return value === undefined || value === null;\n}\n//# sourceMappingURL=Input.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n// This \"state\" object simply holds the state of the \"AsYouType\" parser:\n//\n// * `country?: string`\n// * `callingCode?: string`\n// * `digits: string`\n// * `international: boolean`\n// * `missingPlus: boolean`\n// * `IDDPrefix?: string`\n// * `carrierCode?: string`\n// * `nationalPrefix?: string`\n// * `nationalSignificantNumber?: string`\n// * `nationalSignificantNumberMatchesInput: boolean`\n// * `complexPrefixBeforeNationalSignificantNumber?: string`\n//\n// `state.country` and `state.callingCode` aren't required to be in sync.\n// For example, `state.country` could be `\"AR\"` and `state.callingCode` could be `undefined`.\n// So `state.country` and `state.callingCode` are totally independent.\n//\nvar AsYouTypeState = /*#__PURE__*/function () {\n function AsYouTypeState(_ref) {\n var onCountryChange = _ref.onCountryChange,\n onCallingCodeChange = _ref.onCallingCodeChange;\n\n _classCallCheck(this, AsYouTypeState);\n\n this.onCountryChange = onCountryChange;\n this.onCallingCodeChange = onCallingCodeChange;\n }\n\n _createClass(AsYouTypeState, [{\n key: \"reset\",\n value: function reset(_ref2) {\n var country = _ref2.country,\n callingCode = _ref2.callingCode;\n this.international = false;\n this.missingPlus = false;\n this.IDDPrefix = undefined;\n this.callingCode = undefined;\n this.digits = '';\n this.resetNationalSignificantNumber();\n this.initCountryAndCallingCode(country, callingCode);\n }\n }, {\n key: \"resetNationalSignificantNumber\",\n value: function resetNationalSignificantNumber() {\n this.nationalSignificantNumber = this.getNationalDigits();\n this.nationalSignificantNumberMatchesInput = true;\n this.nationalPrefix = undefined;\n this.carrierCode = undefined;\n this.complexPrefixBeforeNationalSignificantNumber = undefined;\n }\n }, {\n key: \"update\",\n value: function update(properties) {\n for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n this[key] = properties[key];\n }\n }\n }, {\n key: \"initCountryAndCallingCode\",\n value: function initCountryAndCallingCode(country, callingCode) {\n this.setCountry(country);\n this.setCallingCode(callingCode);\n }\n }, {\n key: \"setCountry\",\n value: function setCountry(country) {\n this.country = country;\n this.onCountryChange(country);\n }\n }, {\n key: \"setCallingCode\",\n value: function setCallingCode(callingCode) {\n this.callingCode = callingCode;\n this.onCallingCodeChange(callingCode, this.country);\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(country, callingCode) {\n // Prepend the `+` to parsed input.\n this.international = true; // If a default country was set then reset it\n // because an explicitly international phone\n // number is being entered.\n\n this.initCountryAndCallingCode(country, callingCode);\n }\n }, {\n key: \"appendDigits\",\n value: function appendDigits(nextDigits) {\n this.digits += nextDigits;\n }\n }, {\n key: \"appendNationalSignificantNumberDigits\",\n value: function appendNationalSignificantNumberDigits(nextDigits) {\n this.nationalSignificantNumber += nextDigits;\n }\n /**\r\n * Returns the part of `this.digits` that corresponds to the national number.\r\n * Basically, all digits that have been input by the user, except for the\r\n * international prefix and the country calling code part\r\n * (if the number is an international one).\r\n * @return {string}\r\n */\n\n }, {\n key: \"getNationalDigits\",\n value: function getNationalDigits() {\n if (this.international) {\n return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));\n }\n\n return this.digits;\n }\n }, {\n key: \"getDigitsWithoutInternationalPrefix\",\n value: function getDigitsWithoutInternationalPrefix() {\n if (this.international) {\n if (this.IDDPrefix) {\n return this.digits.slice(this.IDDPrefix.length);\n }\n }\n\n return this.digits;\n }\n }]);\n\n return AsYouTypeState;\n}();\n\nexport { AsYouTypeState as default };\n//# sourceMappingURL=AsYouTypeState.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// Should be the same as `DIGIT_PLACEHOLDER` in `libphonenumber-metadata-generator`.\nexport var DIGIT_PLACEHOLDER = 'x'; // '\\u2008' (punctuation space)\n\nvar DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER); // Counts all occurences of a symbol in a string.\n// Unicode-unsafe (because using `.split()`).\n\nexport function countOccurences(symbol, string) {\n var count = 0; // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for counting brackets it is safe.\n // for (const character of string)\n\n for (var _iterator = _createForOfIteratorHelperLoose(string.split('')), _step; !(_step = _iterator()).done;) {\n var character = _step.value;\n\n if (character === symbol) {\n count++;\n }\n }\n\n return count;\n} // Repeats a string (or a symbol) N times.\n// http://stackoverflow.com/questions/202605/repeat-string-javascript\n\nexport function repeat(string, times) {\n if (times < 1) {\n return '';\n }\n\n var result = '';\n\n while (times > 1) {\n if (times & 1) {\n result += string;\n }\n\n times >>= 1;\n string += string;\n }\n\n return result + string;\n}\nexport function cutAndStripNonPairedParens(string, cutBeforeIndex) {\n if (string[cutBeforeIndex] === ')') {\n cutBeforeIndex++;\n }\n\n return stripNonPairedParens(string.slice(0, cutBeforeIndex));\n}\nexport function closeNonPairedParens(template, cut_before) {\n var retained_template = template.slice(0, cut_before);\n var opening_braces = countOccurences('(', retained_template);\n var closing_braces = countOccurences(')', retained_template);\n var dangling_braces = opening_braces - closing_braces;\n\n while (dangling_braces > 0 && cut_before < template.length) {\n if (template[cut_before] === ')') {\n dangling_braces--;\n }\n\n cut_before++;\n }\n\n return template.slice(0, cut_before);\n}\nexport function stripNonPairedParens(string) {\n var dangling_braces = [];\n var i = 0;\n\n while (i < string.length) {\n if (string[i] === '(') {\n dangling_braces.push(i);\n } else if (string[i] === ')') {\n dangling_braces.pop();\n }\n\n i++;\n }\n\n var start = 0;\n var cleared_string = '';\n dangling_braces.push(string.length);\n\n for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {\n var index = _dangling_braces[_i];\n cleared_string += string.slice(start, index);\n start = index + 1;\n }\n\n return cleared_string;\n}\nexport function populateTemplateWithDigits(template, position, digits) {\n // Using `.split('')` to iterate through a string here\n // to avoid requiring `Symbol.iterator` polyfill.\n // `.split('')` is generally not safe for Unicode,\n // but in this particular case for `digits` it is safe.\n // for (const digit of digits)\n for (var _iterator2 = _createForOfIteratorHelperLoose(digits.split('')), _step2; !(_step2 = _iterator2()).done;) {\n var digit = _step2.value;\n\n // If there is room for more digits in current `template`,\n // then set the next digit in the `template`,\n // and return the formatted digits so far.\n // If more digits are entered than the current format could handle.\n if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {\n return;\n }\n\n position = template.search(DIGIT_PLACEHOLDER_MATCHER);\n template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);\n }\n\n return [template, position];\n}\n//# sourceMappingURL=AsYouTypeFormatter.util.js.map","import checkNumberLength from './helpers/checkNumberLength.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport formatNationalNumberUsingFormat from './helpers/formatNationalNumberUsingFormat.js';\nexport default function formatCompleteNumber(state, format, _ref) {\n var metadata = _ref.metadata,\n shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;\n var matcher = new RegExp(\"^(?:\".concat(format.pattern(), \")$\"));\n\n if (matcher.test(state.nationalSignificantNumber)) {\n return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, {\n metadata: metadata,\n shouldTryNationalPrefixFormattingRule: shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix\n });\n }\n}\nexport function canFormatCompleteNumber(nationalSignificantNumber, metadata) {\n return checkNumberLength(nationalSignificantNumber, metadata) === 'IS_POSSIBLE';\n}\n\nfunction formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format, _ref2) {\n var metadata = _ref2.metadata,\n shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;\n // `format` has already been checked for `nationalPrefix` requirement.\n var nationalSignificantNumber = state.nationalSignificantNumber,\n international = state.international,\n nationalPrefix = state.nationalPrefix,\n carrierCode = state.carrierCode; // Format the number with using `national_prefix_formatting_rule`.\n // If the resulting formatted number is a valid formatted number, then return it.\n //\n // Google's AsYouType formatter is different in a way that it doesn't try\n // to format using the \"national prefix formatting rule\", and instead it\n // simply prepends a national prefix followed by a \" \" character.\n // This code does that too, but as a fallback.\n // The reason is that \"national prefix formatting rule\" may use parentheses,\n // which wouldn't be included has it used the simpler Google's way.\n //\n\n if (shouldTryNationalPrefixFormattingRule(format)) {\n var formattedNumber = formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: true,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n\n if (formattedNumber) {\n return formattedNumber;\n }\n } // Format the number without using `national_prefix_formatting_rule`.\n\n\n return formatNationalNumber(state, format, {\n useNationalPrefixFormattingRule: false,\n getSeparatorAfterNationalPrefix: getSeparatorAfterNationalPrefix,\n metadata: metadata\n });\n}\n\nfunction formatNationalNumber(state, format, _ref3) {\n var metadata = _ref3.metadata,\n useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule,\n getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;\n var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format, {\n carrierCode: state.carrierCode,\n useInternationalFormat: state.international,\n withNationalPrefix: useNationalPrefixFormattingRule,\n metadata: metadata\n });\n\n if (!useNationalPrefixFormattingRule) {\n if (state.nationalPrefix) {\n // If a national prefix was extracted, then just prepend it,\n // followed by a \" \" character.\n formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format) + formattedNationalNumber;\n } else if (state.complexPrefixBeforeNationalSignificantNumber) {\n formattedNationalNumber = state.complexPrefixBeforeNationalSignificantNumber + ' ' + formattedNationalNumber;\n }\n }\n\n if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {\n return formattedNationalNumber;\n }\n} // Check that the formatted phone number contains exactly\n// the same digits that have been input by the user.\n// For example, when \"0111523456789\" is input for `AR` country,\n// the extracted `this.nationalSignificantNumber` is \"91123456789\",\n// which means that the national part of `this.digits` isn't simply equal to\n// `this.nationalPrefix` + `this.nationalSignificantNumber`.\n//\n// Also, a `format` can add extra digits to the `this.nationalSignificantNumber`\n// being formatted via `metadata[country].national_prefix_transform_rule`.\n// For example, for `VI` country, it prepends `340` to the national number,\n// and if this check hasn't been implemented, then there would be a bug\n// when `340` \"area coude\" is \"duplicated\" during input for `VI` country:\n// https://github.com/catamphetamine/libphonenumber-js/issues/318\n//\n// So, all these \"gotchas\" are filtered out.\n//\n// In the original Google's code, the comments say:\n// \"Check that we didn't remove nor add any extra digits when we matched\n// this formatting pattern. This usually happens after we entered the last\n// digit during AYTF. Eg: In case of MX, we swallow mobile token (1) when\n// formatted but AYTF should retain all the number entered and not change\n// in order to match a format (of same leading digits and length) display\n// in that way.\"\n// \"If it's the same (i.e entered number and format is same), then it's\n// safe to return this in formatted number as nothing is lost / added.\"\n// Otherwise, don't use this format.\n// https://github.com/google/libphonenumber/commit/3e7c1f04f5e7200f87fb131e6f85c6e99d60f510#diff-9149457fa9f5d608a11bb975c6ef4bc5\n// https://github.com/google/libphonenumber/commit/3ac88c7106e7dcb553bcc794b15f19185928a1c6#diff-2dcb77e833422ee304da348b905cde0b\n//\n\n\nfunction isValidFormattedNationalNumber(formattedNationalNumber, state) {\n return parseDigits(formattedNationalNumber) === state.getNationalDigits();\n}\n//# sourceMappingURL=AsYouTypeFormatter.complete.js.map","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nvar PatternParser = /*#__PURE__*/function () {\n function PatternParser() {\n _classCallCheck(this, PatternParser);\n }\n\n _createClass(PatternParser, [{\n key: \"parse\",\n value: function parse(pattern) {\n this.context = [{\n or: true,\n instructions: []\n }];\n this.parsePattern(pattern);\n\n if (this.context.length !== 1) {\n throw new Error('Non-finalized contexts left when pattern parse ended');\n }\n\n var _this$context$ = this.context[0],\n branches = _this$context$.branches,\n instructions = _this$context$.instructions;\n\n if (branches) {\n return {\n op: '|',\n args: branches.concat([expandSingleElementArray(instructions)])\n };\n }\n /* istanbul ignore if */\n\n\n if (instructions.length === 0) {\n throw new Error('Pattern is required');\n }\n\n if (instructions.length === 1) {\n return instructions[0];\n }\n\n return instructions;\n }\n }, {\n key: \"startContext\",\n value: function startContext(context) {\n this.context.push(context);\n }\n }, {\n key: \"endContext\",\n value: function endContext() {\n this.context.pop();\n }\n }, {\n key: \"getContext\",\n value: function getContext() {\n return this.context[this.context.length - 1];\n }\n }, {\n key: \"parsePattern\",\n value: function parsePattern(pattern) {\n if (!pattern) {\n throw new Error('Pattern is required');\n }\n\n var match = pattern.match(OPERATOR);\n\n if (!match) {\n if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {\n throw new Error(\"Illegal characters found in a pattern: \".concat(pattern));\n }\n\n this.getContext().instructions = this.getContext().instructions.concat(pattern.split(''));\n return;\n }\n\n var operator = match[1];\n var before = pattern.slice(0, match.index);\n var rightPart = pattern.slice(match.index + operator.length);\n\n switch (operator) {\n case '(?:':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n or: true,\n instructions: [],\n branches: []\n });\n break;\n\n case ')':\n if (!this.getContext().or) {\n throw new Error('\")\" operator must be preceded by \"(?:\" operator');\n }\n\n if (before) {\n this.parsePattern(before);\n }\n\n if (this.getContext().instructions.length === 0) {\n throw new Error('No instructions found after \"|\" operator in an \"or\" group');\n }\n\n var _this$getContext = this.getContext(),\n branches = _this$getContext.branches;\n\n branches.push(expandSingleElementArray(this.getContext().instructions));\n this.endContext();\n this.getContext().instructions.push({\n op: '|',\n args: branches\n });\n break;\n\n case '|':\n if (!this.getContext().or) {\n throw new Error('\"|\" operator can only be used inside \"or\" groups');\n }\n\n if (before) {\n this.parsePattern(before);\n } // The top-level is an implicit \"or\" group, if required.\n\n\n if (!this.getContext().branches) {\n // `branches` are not defined only for the root implicit \"or\" operator.\n\n /* istanbul ignore else */\n if (this.context.length === 1) {\n this.getContext().branches = [];\n } else {\n throw new Error('\"branches\" not found in an \"or\" group context');\n }\n }\n\n this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));\n this.getContext().instructions = [];\n break;\n\n case '[':\n if (before) {\n this.parsePattern(before);\n }\n\n this.startContext({\n oneOfSet: true\n });\n break;\n\n case ']':\n if (!this.getContext().oneOfSet) {\n throw new Error('\"]\" operator must be preceded by \"[\" operator');\n }\n\n this.endContext();\n this.getContext().instructions.push({\n op: '[]',\n args: parseOneOfSet(before)\n });\n break;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unknown operator: \".concat(operator));\n }\n\n if (rightPart) {\n this.parsePattern(rightPart);\n }\n }\n }]);\n\n return PatternParser;\n}();\n\nexport { PatternParser as default };\n\nfunction parseOneOfSet(pattern) {\n var values = [];\n var i = 0;\n\n while (i < pattern.length) {\n if (pattern[i] === '-') {\n if (i === 0 || i === pattern.length - 1) {\n throw new Error(\"Couldn't parse a one-of set pattern: \".concat(pattern));\n }\n\n var prevValue = pattern[i - 1].charCodeAt(0) + 1;\n var nextValue = pattern[i + 1].charCodeAt(0) - 1;\n var value = prevValue;\n\n while (value <= nextValue) {\n values.push(String.fromCharCode(value));\n value++;\n }\n } else {\n values.push(pattern[i]);\n }\n\n i++;\n }\n\n return values;\n}\n\nvar ILLEGAL_CHARACTER_REGEXP = /[\\(\\)\\[\\]\\?\\:\\|]/;\nvar OPERATOR = new RegExp( // any of:\n'(' + // or operator\n'\\\\|' + // or\n'|' + // or group start\n'\\\\(\\\\?\\\\:' + // or\n'|' + // or group end\n'\\\\)' + // or\n'|' + // one-of set start\n'\\\\[' + // or\n'|' + // one-of set end\n'\\\\]' + ')');\n\nfunction expandSingleElementArray(array) {\n if (array.length === 1) {\n return array[0];\n }\n\n return array;\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternParser.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport PatternParser from './AsYouTypeFormatter.PatternParser.js';\n\nvar PatternMatcher = /*#__PURE__*/function () {\n function PatternMatcher(pattern) {\n _classCallCheck(this, PatternMatcher);\n\n this.matchTree = new PatternParser().parse(pattern);\n }\n\n _createClass(PatternMatcher, [{\n key: \"match\",\n value: function match(string) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n allowOverflow = _ref.allowOverflow;\n\n if (!string) {\n throw new Error('String is required');\n }\n\n var result = _match(string.split(''), this.matchTree, true);\n\n if (result && result.match) {\n delete result.matchedChars;\n }\n\n if (result && result.overflow) {\n if (!allowOverflow) {\n return;\n }\n }\n\n return result;\n }\n }]);\n\n return PatternMatcher;\n}();\n/**\r\n * Matches `characters` against a pattern compiled into a `tree`.\r\n * @param {string[]} characters\r\n * @param {Tree} tree — A pattern compiled into a `tree`. See the `*.d.ts` file for the description of the `tree` structure.\r\n * @param {boolean} last — Whether it's the last (rightmost) subtree on its level of the match tree.\r\n * @return {object} See the `*.d.ts` file for the description of the result object.\r\n */\n\n\nexport { PatternMatcher as default };\n\nfunction _match(characters, tree, last) {\n // If `tree` is a string, then `tree` is a single character.\n // That's because when a pattern is parsed, multi-character-string parts\n // of a pattern are compiled into arrays of single characters.\n // I still wrote this piece of code for a \"general\" hypothetical case\n // when `tree` could be a string of several characters, even though\n // such case is not possible with the current implementation.\n if (typeof tree === 'string') {\n var characterString = characters.join('');\n\n if (tree.indexOf(characterString) === 0) {\n // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore else */\n if (characters.length === tree.length) {\n return {\n match: true,\n matchedChars: characters\n };\n } // `tree` is always a single character.\n // If `tree.indexOf(characterString) === 0`\n // then `characters.length === tree.length`.\n\n /* istanbul ignore next */\n\n\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n\n if (characterString.indexOf(tree) === 0) {\n if (last) {\n // The `else` path is not possible because `tree` is always a single character.\n // The `else` case for `characters.length > tree.length` would be\n // `characters.length <= tree.length` which means `characters.length <= 1`.\n // `characters` array can't be empty, so that means `characters === [tree]`,\n // which would also mean `tree.indexOf(characterString) === 0` and that'd mean\n // that the `if (tree.indexOf(characterString) === 0)` condition before this\n // `if` condition would be entered, and returned from there, not reaching this code.\n\n /* istanbul ignore else */\n if (characters.length > tree.length) {\n return {\n overflow: true\n };\n }\n }\n\n return {\n match: true,\n matchedChars: characters.slice(0, tree.length)\n };\n }\n\n return;\n }\n\n if (Array.isArray(tree)) {\n var restCharacters = characters.slice();\n var i = 0;\n\n while (i < tree.length) {\n var subtree = tree[i];\n\n var result = _match(restCharacters, subtree, last && i === tree.length - 1);\n\n if (!result) {\n return;\n } else if (result.overflow) {\n return result;\n } else if (result.match) {\n // Continue with the next subtree with the rest of the characters.\n restCharacters = restCharacters.slice(result.matchedChars.length);\n\n if (restCharacters.length === 0) {\n if (i === tree.length - 1) {\n return {\n match: true,\n matchedChars: characters\n };\n } else {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n }\n }\n } else {\n /* istanbul ignore else */\n if (result.partialMatch) {\n return {\n partialMatch: true // matchedChars: characters\n\n };\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(result, null, 2)));\n }\n }\n\n i++;\n } // If `last` then overflow has already been checked\n // by the last element of the `tree` array.\n\n /* istanbul ignore if */\n\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: characters.slice(0, characters.length - restCharacters.length)\n };\n }\n\n switch (tree.op) {\n case '|':\n var partialMatch;\n\n for (var _iterator = _createForOfIteratorHelperLoose(tree.args), _step; !(_step = _iterator()).done;) {\n var branch = _step.value;\n\n var _result = _match(characters, branch, last);\n\n if (_result) {\n if (_result.overflow) {\n return _result;\n } else if (_result.match) {\n return {\n match: true,\n matchedChars: _result.matchedChars\n };\n } else {\n /* istanbul ignore else */\n if (_result.partialMatch) {\n partialMatch = true;\n } else {\n throw new Error(\"Unsupported match result:\\n\".concat(JSON.stringify(_result, null, 2)));\n }\n }\n }\n }\n\n if (partialMatch) {\n return {\n partialMatch: true // matchedChars: ...\n\n };\n } // Not even a partial match.\n\n\n return;\n\n case '[]':\n for (var _iterator2 = _createForOfIteratorHelperLoose(tree.args), _step2; !(_step2 = _iterator2()).done;) {\n var _char = _step2.value;\n\n if (characters[0] === _char) {\n if (characters.length === 1) {\n return {\n match: true,\n matchedChars: characters\n };\n }\n\n if (last) {\n return {\n overflow: true\n };\n }\n\n return {\n match: true,\n matchedChars: [_char]\n };\n }\n } // No character matches.\n\n\n return;\n\n /* istanbul ignore next */\n\n default:\n throw new Error(\"Unsupported instruction tree: \".concat(tree));\n }\n}\n//# sourceMappingURL=AsYouTypeFormatter.PatternMatcher.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { DIGIT_PLACEHOLDER, countOccurences, repeat, cutAndStripNonPairedParens, closeNonPairedParens, stripNonPairedParens, populateTemplateWithDigits } from './AsYouTypeFormatter.util.js';\nimport formatCompleteNumber, { canFormatCompleteNumber } from './AsYouTypeFormatter.complete.js';\nimport PatternMatcher from './AsYouTypeFormatter.PatternMatcher.js';\nimport parseDigits from './helpers/parseDigits.js';\nexport { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.util.js';\nimport { FIRST_GROUP_PATTERN } from './helpers/formatNationalNumberUsingFormat.js';\nimport { VALID_PUNCTUATION } from './constants.js';\nimport applyInternationalSeparatorStyle from './helpers/applyInternationalSeparatorStyle.js'; // Used in phone number format template creation.\n// Could be any digit, I guess.\n\nvar DUMMY_DIGIT = '9'; // I don't know why is it exactly `15`\n\nvar LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15; // Create a phone number consisting only of the digit 9 that matches the\n// `number_pattern` by applying the pattern to the \"longest phone number\" string.\n\nvar LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH); // A set of characters that, if found in a national prefix formatting rules, are an indicator to\n// us that we should separate the national prefix from the number when formatting.\n\nvar NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/; // Deprecated: Google has removed some formatting pattern related code from their repo.\n// https://github.com/googlei18n/libphonenumber/commit/a395b4fef3caf57c4bc5f082e1152a4d2bd0ba4c\n// \"We no longer have numbers in formatting matching patterns, only \\d.\"\n// Because this library supports generating custom metadata\n// some users may still be using old metadata so the relevant\n// code seems to stay until some next major version update.\n\nvar SUPPORT_LEGACY_FORMATTING_PATTERNS = true; // A pattern that is used to match character classes in regular expressions.\n// An example of a character class is \"[1-4]\".\n\nvar CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\[([^\\[\\]])*\\]/g;\n}; // Any digit in a regular expression that actually denotes a digit. For\n// example, in the regular expression \"80[0-2]\\d{6,10}\", the first 2 digits\n// (8 and 0) are standalone digits, but the rest are not.\n// Two look-aheads are needed because the number following \\\\d could be a\n// two-digit number, since the phone number can be as long as 15 digits.\n\n\nvar CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function () {\n return /\\d(?=[^,}][^,}])/g;\n}; // A regular expression that is used to determine if a `format` is\n// suitable to be used in the \"as you type formatter\".\n// A `format` is suitable when the resulting formatted number has\n// the same digits as the user has entered.\n//\n// In the simplest case, that would mean that the format\n// doesn't add any additional digits when formatting a number.\n// Google says that it also shouldn't add \"star\" (`*`) characters,\n// like it does in some Israeli formats.\n// Such basic format would only contain \"valid punctuation\"\n// and \"captured group\" identifiers ($1, $2, etc).\n//\n// An example of a format that adds additional digits:\n//\n// Country: `AR` (Argentina).\n// Format:\n// {\n// \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n// \"leading_digits_patterns\": [\"91\"],\n// \"national_prefix_formatting_rule\": \"0$1\",\n// \"format\": \"$2 15-$3-$4\",\n// \"international_format\": \"$1 $2 $3-$4\"\n// }\n//\n// In the format above, the `format` adds `15` to the digits when formatting a number.\n// A sidenote: this format actually is suitable because `national_prefix_for_parsing`\n// has previously removed `15` from a national number, so re-adding `15` in `format`\n// doesn't actually result in any extra digits added to user's input.\n// But verifying that would be a complex procedure, so the code chooses a simpler path:\n// it simply filters out all `format`s that contain anything but \"captured group\" ids.\n//\n// This regular expression is called `ELIGIBLE_FORMAT_PATTERN` in Google's\n// `libphonenumber` code.\n//\n\n\nvar NON_ALTERING_FORMAT_REG_EXP = new RegExp('[' + VALID_PUNCTUATION + ']*' + // Google developers say:\n// \"We require that the first matching group is present in the\n// output pattern to ensure no data is lost while formatting.\"\n'\\\\$1' + '[' + VALID_PUNCTUATION + ']*' + '(\\\\$\\\\d[' + VALID_PUNCTUATION + ']*)*' + '$'); // This is the minimum length of the leading digits of a phone number\n// to guarantee the first \"leading digits pattern\" for a phone number format\n// to be preemptive.\n\nvar MIN_LEADING_DIGITS_LENGTH = 3;\n\nvar AsYouTypeFormatter = /*#__PURE__*/function () {\n function AsYouTypeFormatter(_ref) {\n var state = _ref.state,\n metadata = _ref.metadata;\n\n _classCallCheck(this, AsYouTypeFormatter);\n\n this.metadata = metadata;\n this.resetFormat();\n }\n\n _createClass(AsYouTypeFormatter, [{\n key: \"resetFormat\",\n value: function resetFormat() {\n this.chosenFormat = undefined;\n this.template = undefined;\n this.nationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplate = undefined;\n this.populatedNationalNumberTemplatePosition = -1;\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan, state) {\n this.resetFormat();\n\n if (numberingPlan) {\n this.isNANP = numberingPlan.callingCode() === '1';\n this.matchingFormats = numberingPlan.formats();\n\n if (state.nationalSignificantNumber) {\n this.narrowDownMatchingFormats(state);\n }\n } else {\n this.isNANP = undefined;\n this.matchingFormats = [];\n }\n }\n /**\r\n * Formats an updated phone number.\r\n * @param {string} nextDigits — Additional phone number digits.\r\n * @param {object} state — `AsYouType` state.\r\n * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.\r\n */\n\n }, {\n key: \"format\",\n value: function format(nextDigits, state) {\n var _this = this;\n\n // See if the phone number digits can be formatted as a complete phone number.\n // If not, use the results from `formatNationalNumberWithNextDigits()`,\n // which formats based on the chosen formatting pattern.\n //\n // Attempting to format complete phone number first is how it's done\n // in Google's `libphonenumber`, so this library just follows it.\n // Google's `libphonenumber` code doesn't explain in detail why does it\n // attempt to format digits as a complete phone number\n // instead of just going with a previoulsy (or newly) chosen `format`:\n //\n // \"Checks to see if there is an exact pattern match for these digits.\n // If so, we should use this instead of any other formatting template\n // whose leadingDigitsPattern also matches the input.\"\n //\n if (canFormatCompleteNumber(state.nationalSignificantNumber, this.metadata)) {\n for (var _iterator = _createForOfIteratorHelperLoose(this.matchingFormats), _step; !(_step = _iterator()).done;) {\n var format = _step.value;\n var formattedCompleteNumber = formatCompleteNumber(state, format, {\n metadata: this.metadata,\n shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format) {\n return _this.shouldTryNationalPrefixFormattingRule(format, {\n international: state.international,\n nationalPrefix: state.nationalPrefix\n });\n },\n getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format) {\n return _this.getSeparatorAfterNationalPrefix(format);\n }\n });\n\n if (formattedCompleteNumber) {\n this.resetFormat();\n this.chosenFormat = format;\n this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\\d/g, DIGIT_PLACEHOLDER), state);\n this.populatedNationalNumberTemplate = formattedCompleteNumber; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);\n return formattedCompleteNumber;\n }\n }\n } // Format the digits as a partial (incomplete) phone number\n // using the previously chosen formatting pattern (or a newly chosen one).\n\n\n return this.formatNationalNumberWithNextDigits(nextDigits, state);\n } // Formats the next phone number digits.\n\n }, {\n key: \"formatNationalNumberWithNextDigits\",\n value: function formatNationalNumberWithNextDigits(nextDigits, state) {\n var previouslyChosenFormat = this.chosenFormat; // Choose a format from the list of matching ones.\n\n var newlyChosenFormat = this.chooseFormat(state);\n\n if (newlyChosenFormat) {\n if (newlyChosenFormat === previouslyChosenFormat) {\n // If it can format the next (current) digits\n // using the previously chosen phone number format\n // then return the updated formatted number.\n return this.formatNextNationalNumberDigits(nextDigits);\n } else {\n // If a more appropriate phone number format\n // has been chosen for these \"leading digits\",\n // then re-format the national phone number part\n // using the newly selected format.\n return this.formatNextNationalNumberDigits(state.getNationalDigits());\n }\n }\n }\n }, {\n key: \"narrowDownMatchingFormats\",\n value: function narrowDownMatchingFormats(_ref2) {\n var _this2 = this;\n\n var nationalSignificantNumber = _ref2.nationalSignificantNumber,\n nationalPrefix = _ref2.nationalPrefix,\n international = _ref2.international;\n var leadingDigits = nationalSignificantNumber; // \"leading digits\" pattern list starts with a\n // \"leading digits\" pattern fitting a maximum of 3 leading digits.\n // So, after a user inputs 3 digits of a national (significant) phone number\n // this national (significant) number can already be formatted.\n // The next \"leading digits\" pattern is for 4 leading digits max,\n // and the \"leading digits\" pattern after it is for 5 leading digits max, etc.\n // This implementation is different from Google's\n // in that it searches for a fitting format\n // even if the user has entered less than\n // `MIN_LEADING_DIGITS_LENGTH` digits of a national number.\n // Because some leading digit patterns already match for a single first digit.\n\n var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;\n\n if (leadingDigitsPatternIndex < 0) {\n leadingDigitsPatternIndex = 0;\n }\n\n this.matchingFormats = this.matchingFormats.filter(function (format) {\n return _this2.formatSuits(format, international, nationalPrefix) && _this2.formatMatches(format, leadingDigits, leadingDigitsPatternIndex);\n }); // If there was a phone number format chosen\n // and it no longer holds given the new leading digits then reset it.\n // The test for this `if` condition is marked as:\n // \"Reset a chosen format when it no longer holds given the new leading digits\".\n // To construct a valid test case for this one can find a country\n // in `PhoneNumberMetadata.xml` yielding one format for 3 ``\n // and yielding another format for 4 `` (Australia in this case).\n\n if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {\n this.resetFormat();\n }\n }\n }, {\n key: \"formatSuits\",\n value: function formatSuits(format, international, nationalPrefix) {\n // When a prefix before a national (significant) number is\n // simply a national prefix, then it's parsed as `this.nationalPrefix`.\n // In more complex cases, a prefix before national (significant) number\n // could include a national prefix as well as some \"capturing groups\",\n // and in that case there's no info whether a national prefix has been parsed.\n // If national prefix is not used when formatting a phone number\n // using this format, but a national prefix has been entered by the user,\n // and was extracted, then discard such phone number format.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L175-L184\n if (nationalPrefix && !format.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&\n !format.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {\n return false;\n } // If national prefix is mandatory for this phone number format\n // and there're no guarantees that a national prefix is present in user input\n // then discard this phone number format as not suitable.\n // In Google's \"AsYouType\" formatter code, the equivalent would be this part:\n // https://github.com/google/libphonenumber/blob/0a45cfd96e71cad8edb0e162a70fcc8bd9728933/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L185-L193\n\n\n if (!international && !nationalPrefix && format.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {\n return false;\n }\n\n return true;\n }\n }, {\n key: \"formatMatches\",\n value: function formatMatches(format, leadingDigits, leadingDigitsPatternIndex) {\n var leadingDigitsPatternsCount = format.leadingDigitsPatterns().length; // If this format is not restricted to a certain\n // leading digits pattern then it fits.\n // The test case could be found by searching for \"leadingDigitsPatternsCount === 0\".\n\n if (leadingDigitsPatternsCount === 0) {\n return true;\n } // Start narrowing down the list of possible formats based on the leading digits.\n // (only previously matched formats take part in the narrowing down process)\n // `leading_digits_patterns` start with 3 digits min\n // and then go up from there one digit at a time.\n\n\n leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);\n var leadingDigitsPattern = format.leadingDigitsPatterns()[leadingDigitsPatternIndex]; // Google imposes a requirement on the leading digits\n // to be minimum 3 digits long in order to be eligible\n // for checking those with a leading digits pattern.\n //\n // Since `leading_digits_patterns` start with 3 digits min,\n // Google's original `libphonenumber` library only starts\n // excluding any non-matching formats only when the\n // national number entered so far is at least 3 digits long,\n // otherwise format matching would give false negatives.\n //\n // For example, when the digits entered so far are `2`\n // and the leading digits pattern is `21` –\n // it's quite obvious in this case that the format could be the one\n // but due to the absence of further digits it would give false negative.\n //\n // Also, `leading_digits_patterns` doesn't always correspond to a single\n // digits count. For example, `60|8` pattern would already match `8`\n // but the `60` part would require having at least two leading digits,\n // so the whole pattern would require inputting two digits first in order to\n // decide on whether it matches the input, even when the input is \"80\".\n //\n // This library — `libphonenumber-js` — allows filtering by `leading_digits_patterns`\n // even when there's only 1 or 2 digits of the national (significant) number.\n // To do that, it uses a non-strict pattern matcher written specifically for that.\n //\n\n if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {\n // Before leading digits < 3 matching was implemented:\n // return true\n //\n // After leading digits < 3 matching was implemented:\n try {\n return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {\n allowOverflow: true\n }) !== undefined;\n } catch (error)\n /* istanbul ignore next */\n {\n // There's a slight possibility that there could be some undiscovered bug\n // in the pattern matcher code. Since the \"leading digits < 3 matching\"\n // feature is not \"essential\" for operation, it can fall back to the old way\n // in case of any issues rather than halting the application's execution.\n console.error(error);\n return true;\n }\n } // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are\n // available then use the usual regular expression matching.\n //\n // The whole pattern is wrapped in round brackets (`()`) because\n // the pattern can use \"or\" operator (`|`) at the top level of the pattern.\n //\n\n\n return new RegExp(\"^(\".concat(leadingDigitsPattern, \")\")).test(leadingDigits);\n }\n }, {\n key: \"getFormatFormat\",\n value: function getFormatFormat(format, international) {\n return international ? format.internationalFormat() : format.format();\n }\n }, {\n key: \"chooseFormat\",\n value: function chooseFormat(state) {\n var _this3 = this;\n\n var _loop = function _loop() {\n var format = _step2.value;\n\n // If this format is currently being used\n // and is still suitable, then stick to it.\n if (_this3.chosenFormat === format) {\n return \"break\";\n } // Sometimes, a formatting rule inserts additional digits in a phone number,\n // and \"as you type\" formatter can't do that: it should only use the digits\n // that the user has input.\n //\n // For example, in Argentina, there's a format for mobile phone numbers:\n //\n // {\n // \"pattern\": \"(\\\\d)(\\\\d{2})(\\\\d{4})(\\\\d{4})\",\n // \"leading_digits_patterns\": [\"91\"],\n // \"national_prefix_formatting_rule\": \"0$1\",\n // \"format\": \"$2 15-$3-$4\",\n // \"international_format\": \"$1 $2 $3-$4\"\n // }\n //\n // In that format, `international_format` is used instead of `format`\n // because `format` inserts `15` in the formatted number,\n // and `AsYouType` formatter should only use the digits\n // the user has actually input, without adding any extra digits.\n // In this case, it wouldn't make a difference, because the `15`\n // is first stripped when applying `national_prefix_for_parsing`\n // and then re-added when using `format`, so in reality it doesn't\n // add any new digits to the number, but to detect that, the code\n // would have to be more complex: it would have to try formatting\n // the digits using the format and then see if any digits have\n // actually been added or removed, and then, every time a new digit\n // is input, it should re-check whether the chosen format doesn't\n // alter the digits.\n //\n // Google's code doesn't go that far, and so does this library:\n // it simply requires that a `format` doesn't add any additonal\n // digits to user's input.\n //\n // Also, people in general should move from inputting phone numbers\n // in national format (possibly with national prefixes)\n // and use international phone number format instead:\n // it's a logical thing in the modern age of mobile phones,\n // globalization and the internet.\n //\n\n /* istanbul ignore if */\n\n\n if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format, state.international))) {\n return \"continue\";\n }\n\n if (!_this3.createTemplateForFormat(format, state)) {\n // Remove the format if it can't generate a template.\n _this3.matchingFormats = _this3.matchingFormats.filter(function (_) {\n return _ !== format;\n });\n return \"continue\";\n }\n\n _this3.chosenFormat = format;\n return \"break\";\n };\n\n // When there are multiple available formats, the formatter uses the first\n // format where a formatting template could be created.\n //\n // For some weird reason, `istanbul` says \"else path not taken\"\n // for the `for of` line below. Supposedly that means that\n // the loop doesn't ever go over the last element in the list.\n // That's true because there always is `this.chosenFormat`\n // when `this.matchingFormats` is non-empty.\n // And, for some weird reason, it doesn't think that the case\n // with empty `this.matchingFormats` qualifies for a valid \"else\" path.\n // So simply muting this `istanbul` warning.\n // It doesn't skip the contents of the `for of` loop,\n // it just skips the `for of` line.\n //\n\n /* istanbul ignore next */\n for (var _iterator2 = _createForOfIteratorHelperLoose(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done;) {\n var _ret = _loop();\n\n if (_ret === \"break\") break;\n if (_ret === \"continue\") continue;\n }\n\n if (!this.chosenFormat) {\n // No format matches the national (significant) phone number.\n this.resetFormat();\n }\n\n return this.chosenFormat;\n }\n }, {\n key: \"createTemplateForFormat\",\n value: function createTemplateForFormat(format, state) {\n // The formatter doesn't format numbers when numberPattern contains '|', e.g.\n // (20|3)\\d{4}. In those cases we quickly return.\n // (Though there's no such format in current metadata)\n\n /* istanbul ignore if */\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format.pattern().indexOf('|') >= 0) {\n return;\n } // Get formatting template for this phone number format\n\n\n var template = this.getTemplateForFormat(format, state); // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (template) {\n this.setNationalNumberTemplate(template, state);\n return true;\n }\n }\n }, {\n key: \"getSeparatorAfterNationalPrefix\",\n value: function getSeparatorAfterNationalPrefix(format) {\n // `US` metadata doesn't have a `national_prefix_formatting_rule`,\n // so the `if` condition below doesn't apply to `US`,\n // but in reality there shoudl be a separator\n // between a national prefix and a national (significant) number.\n // So `US` national prefix separator is a \"special\" \"hardcoded\" case.\n if (this.isNANP) {\n return ' ';\n } // If a `format` has a `national_prefix_formatting_rule`\n // and that rule has a separator after a national prefix,\n // then it means that there should be a separator\n // between a national prefix and a national (significant) number.\n\n\n if (format && format.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format.nationalPrefixFormattingRule())) {\n return ' ';\n } // At this point, there seems to be no clear evidence that\n // there should be a separator between a national prefix\n // and a national (significant) number. So don't insert one.\n\n\n return '';\n }\n }, {\n key: \"getInternationalPrefixBeforeCountryCallingCode\",\n value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {\n var IDDPrefix = _ref3.IDDPrefix,\n missingPlus = _ref3.missingPlus;\n\n if (IDDPrefix) {\n return options && options.spacing === false ? IDDPrefix : IDDPrefix + ' ';\n }\n\n if (missingPlus) {\n return '';\n }\n\n return '+';\n }\n }, {\n key: \"getTemplate\",\n value: function getTemplate(state) {\n if (!this.template) {\n return;\n } // `this.template` holds the template for a \"complete\" phone number.\n // The currently entered phone number is most likely not \"complete\",\n // so trim all non-populated digits.\n\n\n var index = -1;\n var i = 0;\n var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {\n spacing: false\n }) : '';\n\n while (i < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {\n index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);\n i++;\n }\n\n return cutAndStripNonPairedParens(this.template, index + 1);\n }\n }, {\n key: \"setNationalNumberTemplate\",\n value: function setNationalNumberTemplate(template, state) {\n this.nationalNumberTemplate = template;\n this.populatedNationalNumberTemplate = template; // With a new formatting template, the matched position\n // using the old template needs to be reset.\n\n this.populatedNationalNumberTemplatePosition = -1; // For convenience, the public `.template` property\n // contains the whole international number\n // if the phone number being input is international:\n // 'x' for the '+' sign, 'x'es for the country phone code,\n // a spacebar and then the template for the formatted national number.\n\n if (state.international) {\n this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\\d\\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + ' ' + template;\n } else {\n this.template = template;\n }\n }\n /**\r\n * Generates formatting template for a national phone number,\r\n * optionally containing a national prefix, for a format.\r\n * @param {Format} format\r\n * @param {string} nationalPrefix\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplateForFormat\",\n value: function getTemplateForFormat(format, _ref4) {\n var nationalSignificantNumber = _ref4.nationalSignificantNumber,\n international = _ref4.international,\n nationalPrefix = _ref4.nationalPrefix,\n complexPrefixBeforeNationalSignificantNumber = _ref4.complexPrefixBeforeNationalSignificantNumber;\n var pattern = format.pattern();\n /* istanbul ignore else */\n\n if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {\n pattern = pattern // Replace anything in the form of [..] with \\d\n .replace(CREATE_CHARACTER_CLASS_PATTERN(), '\\\\d') // Replace any standalone digit (not the one in `{}`) with \\d\n .replace(CREATE_STANDALONE_DIGIT_PATTERN(), '\\\\d');\n } // Generate a dummy national number (consisting of `9`s)\n // that fits this format's `pattern`.\n //\n // This match will always succeed,\n // because the \"longest dummy phone number\"\n // has enough length to accomodate any possible\n // national phone number format pattern.\n //\n\n\n var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0]; // If the national number entered is too long\n // for any phone number format, then abort.\n\n if (nationalSignificantNumber.length > digits.length) {\n return;\n } // Get a formatting template which can be used to efficiently format\n // a partial number where digits are added one by one.\n // Below `strictPattern` is used for the\n // regular expression (with `^` and `$`).\n // This wasn't originally in Google's `libphonenumber`\n // and I guess they don't really need it\n // because they're not using \"templates\" to format phone numbers\n // but I added `strictPattern` after encountering\n // South Korean phone number formatting bug.\n //\n // Non-strict regular expression bug demonstration:\n //\n // this.nationalSignificantNumber : `111111111` (9 digits)\n //\n // pattern : (\\d{2})(\\d{3,4})(\\d{4})\n // format : `$1 $2 $3`\n // digits : `9999999999` (10 digits)\n //\n // '9999999999'.replace(new RegExp(/(\\d{2})(\\d{3,4})(\\d{4})/g), '$1 $2 $3') = \"99 9999 9999\"\n //\n // template : xx xxxx xxxx\n //\n // But the correct template in this case is `xx xxx xxxx`.\n // The template was generated incorrectly because of the\n // `{3,4}` variability in the `pattern`.\n //\n // The fix is, if `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then `this.nationalSignificantNumber`\n // is used instead of `digits`.\n\n\n var strictPattern = new RegExp('^' + pattern + '$');\n var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\\d/g, DUMMY_DIGIT); // If `this.nationalSignificantNumber` has already sufficient length\n // to satisfy the `pattern` completely then use it\n // instead of `digits`.\n\n if (strictPattern.test(nationalNumberDummyDigits)) {\n digits = nationalNumberDummyDigits;\n }\n\n var numberFormat = this.getFormatFormat(format, international);\n var nationalPrefixIncludedInTemplate; // If a user did input a national prefix (and that's guaranteed),\n // and if a `format` does have a national prefix formatting rule,\n // then see if that national prefix formatting rule\n // prepends exactly the same national prefix the user has input.\n // If that's the case, then use the `format` with the national prefix formatting rule.\n // Otherwise, use the `format` without the national prefix formatting rule,\n // and prepend a national prefix manually to it.\n\n if (this.shouldTryNationalPrefixFormattingRule(format, {\n international: international,\n nationalPrefix: nationalPrefix\n })) {\n var numberFormatWithNationalPrefix = numberFormat.replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule()); // If `national_prefix_formatting_rule` of a `format` simply prepends\n // national prefix at the start of a national (significant) number,\n // then such formatting can be used with `AsYouType` formatter.\n // There seems to be no `else` case: everywhere in metadata,\n // national prefix formatting rule is national prefix + $1,\n // or `($1)`, in which case such format isn't even considered\n // when the user has input a national prefix.\n\n /* istanbul ignore else */\n\n if (parseDigits(format.nationalPrefixFormattingRule()) === (nationalPrefix || '') + parseDigits('$1')) {\n numberFormat = numberFormatWithNationalPrefix;\n nationalPrefixIncludedInTemplate = true; // Replace all digits of the national prefix in the formatting template\n // with `DIGIT_PLACEHOLDER`s.\n\n if (nationalPrefix) {\n var i = nationalPrefix.length;\n\n while (i > 0) {\n numberFormat = numberFormat.replace(/\\d/, DIGIT_PLACEHOLDER);\n i--;\n }\n }\n }\n } // Generate formatting template for this phone number format.\n\n\n var template = digits // Format the dummy phone number according to the format.\n .replace(new RegExp(pattern), numberFormat) // Replace each dummy digit with a DIGIT_PLACEHOLDER.\n .replace(new RegExp(DUMMY_DIGIT, 'g'), DIGIT_PLACEHOLDER); // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then just prepend such prefix\n // before the national (significant) number, optionally spacing\n // the two with a whitespace.\n\n if (!nationalPrefixIncludedInTemplate) {\n if (complexPrefixBeforeNationalSignificantNumber) {\n // Prepend the prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, complexPrefixBeforeNationalSignificantNumber.length) + ' ' + template;\n } else if (nationalPrefix) {\n // Prepend national prefix to the template manually.\n template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format) + template;\n }\n }\n\n if (international) {\n template = applyInternationalSeparatorStyle(template);\n }\n\n return template;\n }\n }, {\n key: \"formatNextNationalNumberDigits\",\n value: function formatNextNationalNumberDigits(digits) {\n var result = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);\n\n if (!result) {\n // Reset the format.\n this.resetFormat();\n return;\n }\n\n this.populatedNationalNumberTemplate = result[0];\n this.populatedNationalNumberTemplatePosition = result[1]; // Return the formatted phone number so far.\n\n return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1); // The old way which was good for `input-format` but is not so good\n // for `react-phone-number-input`'s default input (`InputBasic`).\n // return closeNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1)\n // \t.replace(new RegExp(DIGIT_PLACEHOLDER, 'g'), ' ')\n }\n }, {\n key: \"shouldTryNationalPrefixFormattingRule\",\n value: function shouldTryNationalPrefixFormattingRule(format, _ref5) {\n var international = _ref5.international,\n nationalPrefix = _ref5.nationalPrefix;\n\n if (format.nationalPrefixFormattingRule()) {\n // In some countries, `national_prefix_formatting_rule` is `($1)`,\n // so it applies even if the user hasn't input a national prefix.\n // `format.usesNationalPrefix()` detects such cases.\n var usesNationalPrefix = format.usesNationalPrefix();\n\n if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {\n return true;\n }\n }\n }\n }]);\n\n return AsYouTypeFormatter;\n}();\n\nexport { AsYouTypeFormatter as default };\n//# sourceMappingURL=AsYouTypeFormatter.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport _extractCountryCallingCode from './helpers/extractCountryCallingCode.js';\nimport extractCountryCallingCodeFromInternationalNumberWithoutPlusSign from './helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js';\nimport extractNationalNumberFromPossiblyIncompleteNumber from './helpers/extractNationalNumberFromPossiblyIncompleteNumber.js';\nimport stripIddPrefix from './helpers/stripIddPrefix.js';\nimport parseDigits from './helpers/parseDigits.js';\nimport { VALID_DIGITS, VALID_PUNCTUATION, PLUS_CHARS } from './constants.js';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+';\nvar VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp('^' + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + '$', 'i');\nvar VALID_FORMATTED_PHONE_NUMBER_PART = '(?:' + '[' + PLUS_CHARS + ']' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*' + '|' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + ')';\nvar AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp('[^' + VALID_PUNCTUATION + VALID_DIGITS + ']+' + '.*' + '$'); // Tests whether `national_prefix_for_parsing` could match\n// different national prefixes.\n// Matches anything that's not a digit or a square bracket.\n\nvar COMPLEX_NATIONAL_PREFIX = /[^\\d\\[\\]]/;\n\nvar AsYouTypeParser = /*#__PURE__*/function () {\n function AsYouTypeParser(_ref) {\n var defaultCountry = _ref.defaultCountry,\n defaultCallingCode = _ref.defaultCallingCode,\n metadata = _ref.metadata,\n onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;\n\n _classCallCheck(this, AsYouTypeParser);\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.metadata = metadata;\n this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;\n }\n\n _createClass(AsYouTypeParser, [{\n key: \"input\",\n value: function input(text, state) {\n var _extractFormattedDigi = extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi2 = _slicedToArray(_extractFormattedDigi, 2),\n formattedDigits = _extractFormattedDigi2[0],\n hasPlus = _extractFormattedDigi2[1];\n\n var digits = parseDigits(formattedDigits); // Checks for a special case: just a leading `+` has been entered.\n\n var justLeadingPlus;\n\n if (hasPlus) {\n if (!state.digits) {\n state.startInternationalNumber();\n\n if (!digits) {\n justLeadingPlus = true;\n }\n }\n }\n\n if (digits) {\n this.inputDigits(digits, state);\n }\n\n return {\n digits: digits,\n justLeadingPlus: justLeadingPlus\n };\n }\n /**\r\n * Inputs \"next\" phone number digits.\r\n * @param {string} digits\r\n * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means \"don't format the national phone number at this stage\".\r\n */\n\n }, {\n key: \"inputDigits\",\n value: function inputDigits(nextDigits, state) {\n var digits = state.digits;\n var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3; // Append phone number digits.\n\n state.appendDigits(nextDigits); // Attempt to extract IDD prefix:\n // Some users input their phone number in international format,\n // but in an \"out-of-country\" dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers as soon as there're at least 3 digits.\n // Google's library attempts to extract IDD prefix at 3 digits,\n // so this library just copies that behavior.\n // I guess that's because the most commot IDD prefixes are\n // `00` (Europe) and `011` (US).\n // There exist really long IDD prefixes too:\n // for example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n // An IDD prefix is extracted here, and then every time when\n // there's a new digit and the number couldn't be formatted.\n\n if (hasReceivedThreeLeadingDigits) {\n this.extractIddPrefix(state);\n }\n\n if (this.isWaitingForCountryCallingCode(state)) {\n if (!this.extractCountryCallingCode(state)) {\n return;\n }\n } else {\n state.appendNationalSignificantNumberDigits(nextDigits);\n } // If a phone number is being input in international format,\n // then it's not valid for it to have a national prefix.\n // Still, some people incorrectly input such numbers with a national prefix.\n // In such cases, only attempt to strip a national prefix if the number becomes too long.\n // (but that is done later, not here)\n\n\n if (!state.international) {\n if (!this.hasExtractedNationalSignificantNumber) {\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }\n }, {\n key: \"isWaitingForCountryCallingCode\",\n value: function isWaitingForCountryCallingCode(_ref2) {\n var international = _ref2.international,\n callingCode = _ref2.callingCode;\n return international && !callingCode;\n } // Extracts a country calling code from a number\n // being entered in internatonal format.\n\n }, {\n key: \"extractCountryCallingCode\",\n value: function extractCountryCallingCode(state) {\n var _extractCountryCallin = _extractCountryCallingCode('+' + state.getDigitsWithoutInternationalPrefix(), this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n countryCallingCode = _extractCountryCallin.countryCallingCode,\n number = _extractCountryCallin.number;\n\n if (countryCallingCode) {\n state.setCallingCode(countryCallingCode);\n state.update({\n nationalSignificantNumber: number\n });\n return true;\n }\n }\n }, {\n key: \"reset\",\n value: function reset(numberingPlan) {\n if (numberingPlan) {\n this.hasSelectedNumberingPlan = true;\n\n var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();\n\n this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);\n } else {\n this.hasSelectedNumberingPlan = undefined;\n this.couldPossiblyExtractAnotherNationalSignificantNumber = undefined;\n }\n }\n /**\r\n * Extracts a national (significant) number from user input.\r\n * Google's library is different in that it only applies `national_prefix_for_parsing`\r\n * and doesn't apply `national_prefix_transform_rule` after that.\r\n * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539\r\n * @return {boolean} [extracted]\r\n */\n\n }, {\n key: \"extractNationalSignificantNumber\",\n value: function extractNationalSignificantNumber(nationalDigits, setState) {\n if (!this.hasSelectedNumberingPlan) {\n return;\n }\n\n var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe.nationalPrefix,\n nationalNumber = _extractNationalNumbe.nationalNumber,\n carrierCode = _extractNationalNumbe.carrierCode;\n\n if (nationalNumber === nationalDigits) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n /**\r\n * In Google's code this function is called \"attempt to extract longer NDD\".\r\n * \"Some national prefixes are a substring of others\", they say.\r\n * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.\r\n */\n\n }, {\n key: \"extractAnotherNationalSignificantNumber\",\n value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {\n if (!this.hasExtractedNationalSignificantNumber) {\n return this.extractNationalSignificantNumber(nationalDigits, setState);\n }\n\n if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {\n return;\n }\n\n var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata),\n nationalPrefix = _extractNationalNumbe2.nationalPrefix,\n nationalNumber = _extractNationalNumbe2.nationalNumber,\n carrierCode = _extractNationalNumbe2.carrierCode; // If a national prefix has been extracted previously,\n // then it's always extracted as additional digits are added.\n // That's assuming `extractNationalNumberFromPossiblyIncompleteNumber()`\n // doesn't do anything different from what it currently does.\n // So, just in case, here's this check, though it doesn't occur.\n\n /* istanbul ignore if */\n\n\n if (nationalNumber === prevNationalSignificantNumber) {\n return;\n }\n\n this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);\n return true;\n }\n }, {\n key: \"onExtractedNationalNumber\",\n value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {\n var complexPrefixBeforeNationalSignificantNumber;\n var nationalSignificantNumberMatchesInput; // This check also works with empty `this.nationalSignificantNumber`.\n\n var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber); // If the extracted national (significant) number is the\n // last substring of the `digits`, then it means that it hasn't been altered:\n // no digits have been removed from the national (significant) number\n // while applying `national_prefix_transform_rule`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/blob/master/METADATA.md#national_prefix_for_parsing--national_prefix_transform_rule\n\n if (nationalSignificantNumberIndex >= 0 && nationalSignificantNumberIndex === nationalDigits.length - nationalSignificantNumber.length) {\n nationalSignificantNumberMatchesInput = true; // If a prefix of a national (significant) number is not as simple\n // as just a basic national prefix, then such prefix is stored in\n // `this.complexPrefixBeforeNationalSignificantNumber` property and will be\n // prepended \"as is\" to the national (significant) number to produce\n // a formatted result.\n\n var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex); // `prefixBeforeNationalNumber` is always non-empty,\n // because `onExtractedNationalNumber()` isn't called\n // when a national (significant) number hasn't been actually \"extracted\":\n // when a national (significant) number is equal to the national part of `digits`,\n // then `onExtractedNationalNumber()` doesn't get called.\n\n if (prefixBeforeNationalNumber !== nationalPrefix) {\n complexPrefixBeforeNationalSignificantNumber = prefixBeforeNationalNumber;\n }\n }\n\n setState({\n nationalPrefix: nationalPrefix,\n carrierCode: carrierCode,\n nationalSignificantNumber: nationalSignificantNumber,\n nationalSignificantNumberMatchesInput: nationalSignificantNumberMatchesInput,\n complexPrefixBeforeNationalSignificantNumber: complexPrefixBeforeNationalSignificantNumber\n }); // `onExtractedNationalNumber()` is only called when\n // the national (significant) number actually did change.\n\n this.hasExtractedNationalSignificantNumber = true;\n this.onNationalSignificantNumberChange();\n }\n }, {\n key: \"reExtractNationalSignificantNumber\",\n value: function reExtractNationalSignificantNumber(state) {\n // Attempt to extract a national prefix.\n //\n // Some people incorrectly input national prefix\n // in an international phone number.\n // For example, some people write British phone numbers as `+44(0)...`.\n //\n // Also, in some rare cases, it is valid for a national prefix\n // to be a part of an international phone number.\n // For example, mobile phone numbers in Mexico are supposed to be\n // dialled internationally using a `1` national prefix,\n // so the national prefix will be part of an international number.\n //\n // Quote from:\n // https://www.mexperience.com/dialing-cell-phones-in-mexico/\n //\n // \"Dialing a Mexican cell phone from abroad\n // When you are calling a cell phone number in Mexico from outside Mexico,\n // it’s necessary to dial an additional “1” after Mexico’s country code\n // (which is “52”) and before the area code.\n // You also ignore the 045, and simply dial the area code and the\n // cell phone’s number.\n //\n // If you don’t add the “1”, you’ll receive a recorded announcement\n // asking you to redial using it.\n //\n // For example, if you are calling from the USA to a cell phone\n // in Mexico City, you would dial +52 – 1 – 55 – 1234 5678.\n // (Note that this is different to calling a land line in Mexico City\n // from abroad, where the number dialed would be +52 – 55 – 1234 5678)\".\n //\n // Google's demo output:\n // https://libphonenumber.appspot.com/phonenumberparser?number=%2b5215512345678&country=MX\n //\n if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function (stateUpdate) {\n return state.update(stateUpdate);\n })) {\n return true;\n } // If no format matches the phone number, then it could be\n // \"a really long IDD\" (quote from a comment in Google's library).\n // An IDD prefix is first extracted when the user has entered at least 3 digits,\n // and then here — every time when there's a new digit and the number\n // couldn't be formatted.\n // For example, in Australia the default IDD prefix is `0011`,\n // and it could even be as long as `14880011`.\n //\n // Could also check `!hasReceivedThreeLeadingDigits` here\n // to filter out the case when this check duplicates the one\n // already performed when there're 3 leading digits,\n // but it's not a big deal, and in most cases there\n // will be a suitable `format` when there're 3 leading digits.\n //\n\n\n if (this.extractIddPrefix(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n } // Google's AsYouType formatter supports sort of an \"autocorrection\" feature\n // when it \"autocorrects\" numbers that have been input for a country\n // with that country's calling code.\n // Such \"autocorrection\" feature looks weird, but different people have been requesting it:\n // https://github.com/catamphetamine/libphonenumber-js/issues/376\n // https://github.com/catamphetamine/libphonenumber-js/issues/375\n // https://github.com/catamphetamine/libphonenumber-js/issues/316\n\n\n if (this.fixMissingPlus(state)) {\n this.extractCallingCodeAndNationalSignificantNumber(state);\n return true;\n }\n }\n }, {\n key: \"extractIddPrefix\",\n value: function extractIddPrefix(state) {\n // An IDD prefix can't be present in a number written with a `+`.\n // Also, don't re-extract an IDD prefix if has already been extracted.\n var international = state.international,\n IDDPrefix = state.IDDPrefix,\n digits = state.digits,\n nationalSignificantNumber = state.nationalSignificantNumber;\n\n if (international || IDDPrefix) {\n return;\n } // Some users input their phone number in \"out-of-country\"\n // dialing format instead of using the leading `+`.\n // https://github.com/catamphetamine/libphonenumber-js/issues/185\n // Detect such numbers.\n\n\n var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);\n\n if (numberWithoutIDD !== undefined && numberWithoutIDD !== digits) {\n // If an IDD prefix was stripped then convert the IDD-prefixed number\n // to international number for subsequent parsing.\n state.update({\n IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)\n });\n this.startInternationalNumber(state, {\n country: undefined,\n callingCode: undefined\n });\n return true;\n }\n }\n }, {\n key: \"fixMissingPlus\",\n value: function fixMissingPlus(state) {\n if (!state.international) {\n var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata),\n newCallingCode = _extractCountryCallin2.countryCallingCode,\n number = _extractCountryCallin2.number;\n\n if (newCallingCode) {\n state.update({\n missingPlus: true\n });\n this.startInternationalNumber(state, {\n country: state.country,\n callingCode: newCallingCode\n });\n return true;\n }\n }\n }\n }, {\n key: \"startInternationalNumber\",\n value: function startInternationalNumber(state, _ref3) {\n var country = _ref3.country,\n callingCode = _ref3.callingCode;\n state.startInternationalNumber(country, callingCode); // If a national (significant) number has been extracted before, reset it.\n\n if (state.nationalSignificantNumber) {\n state.resetNationalSignificantNumber();\n this.onNationalSignificantNumberChange();\n this.hasExtractedNationalSignificantNumber = undefined;\n }\n }\n }, {\n key: \"extractCallingCodeAndNationalSignificantNumber\",\n value: function extractCallingCodeAndNationalSignificantNumber(state) {\n if (this.extractCountryCallingCode(state)) {\n // `this.extractCallingCode()` is currently called when the number\n // couldn't be formatted during the standard procedure.\n // Normally, the national prefix would be re-extracted\n // for an international number if such number couldn't be formatted,\n // but since it's already not able to be formatted,\n // there won't be yet another retry, so also extract national prefix here.\n this.extractNationalSignificantNumber(state.getNationalDigits(), function (stateUpdate) {\n return state.update(stateUpdate);\n });\n }\n }\n }]);\n\n return AsYouTypeParser;\n}();\n/**\r\n * Extracts formatted phone number from text (if there's any).\r\n * @param {string} text\r\n * @return {string} [formattedPhoneNumber]\r\n */\n\n\nexport { AsYouTypeParser as default };\n\nfunction extractFormattedPhoneNumber(text) {\n // Attempt to extract a possible number from the string passed in.\n var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);\n\n if (startsAt < 0) {\n return;\n } // Trim everything to the left of the phone number.\n\n\n text = text.slice(startsAt); // Trim the `+`.\n\n var hasPlus;\n\n if (text[0] === '+') {\n hasPlus = true;\n text = text.slice('+'.length);\n } // Trim everything to the right of the phone number.\n\n\n text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, ''); // Re-add the previously trimmed `+`.\n\n if (hasPlus) {\n text = '+' + text;\n }\n\n return text;\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nfunction _extractFormattedDigitsAndPlus(text) {\n // Extract a formatted phone number part from text.\n var extractedNumber = extractFormattedPhoneNumber(text) || ''; // Trim a `+`.\n\n if (extractedNumber[0] === '+') {\n return [extractedNumber.slice('+'.length), true];\n }\n\n return [extractedNumber];\n}\n/**\r\n * Extracts formatted phone number digits (and a `+`) from text (if there're any).\r\n * @param {string} text\r\n * @return {any[]}\r\n */\n\n\nexport function extractFormattedDigitsAndPlus(text) {\n var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text),\n _extractFormattedDigi4 = _slicedToArray(_extractFormattedDigi3, 2),\n formattedDigits = _extractFormattedDigi4[0],\n hasPlus = _extractFormattedDigi4[1]; // If the extracted phone number part\n // can possibly be a part of some valid phone number\n // then parse phone number characters from a formatted phone number.\n\n\n if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {\n formattedDigits = '';\n }\n\n return [formattedDigits, hasPlus];\n}\n//# sourceMappingURL=AsYouTypeParser.js.map","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport Metadata from './metadata.js';\nimport PhoneNumber from './PhoneNumber.js';\nimport AsYouTypeState from './AsYouTypeState.js';\nimport AsYouTypeFormatter, { DIGIT_PLACEHOLDER } from './AsYouTypeFormatter.js';\nimport AsYouTypeParser, { extractFormattedDigitsAndPlus } from './AsYouTypeParser.js';\nimport getCountryByCallingCode from './helpers/getCountryByCallingCode.js';\nimport getCountryByNationalNumber from './helpers/getCountryByNationalNumber.js';\nimport isObject from './helpers/isObject.js';\nvar USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;\n\nvar AsYouType = /*#__PURE__*/function () {\n /**\r\n * @param {(string|object)?} [optionsOrDefaultCountry] - The default country used for parsing non-international phone numbers. Can also be an `options` object.\r\n * @param {Object} metadata\r\n */\n function AsYouType(optionsOrDefaultCountry, metadata) {\n _classCallCheck(this, AsYouType);\n\n this.metadata = new Metadata(metadata);\n\n var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry),\n _this$getCountryAndCa2 = _slicedToArray(_this$getCountryAndCa, 2),\n defaultCountry = _this$getCountryAndCa2[0],\n defaultCallingCode = _this$getCountryAndCa2[1]; // `this.defaultCountry` and `this.defaultCallingCode` aren't required to be in sync.\n // For example, `this.defaultCountry` could be `\"AR\"` and `this.defaultCallingCode` could be `undefined`.\n // So `this.defaultCountry` and `this.defaultCallingCode` are totally independent.\n\n\n this.defaultCountry = defaultCountry;\n this.defaultCallingCode = defaultCallingCode;\n this.reset();\n }\n\n _createClass(AsYouType, [{\n key: \"getCountryAndCallingCode\",\n value: function getCountryAndCallingCode(optionsOrDefaultCountry) {\n // Set `defaultCountry` and `defaultCallingCode` options.\n var defaultCountry;\n var defaultCallingCode; // Turns out `null` also has type \"object\". Weird.\n\n if (optionsOrDefaultCountry) {\n if (isObject(optionsOrDefaultCountry)) {\n defaultCountry = optionsOrDefaultCountry.defaultCountry;\n defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;\n } else {\n defaultCountry = optionsOrDefaultCountry;\n }\n }\n\n if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {\n defaultCountry = undefined;\n }\n\n if (defaultCallingCode) {\n /* istanbul ignore if */\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {\n defaultCountry = '001';\n }\n }\n }\n\n return [defaultCountry, defaultCallingCode];\n }\n /**\r\n * Inputs \"next\" phone number characters.\r\n * @param {string} text\r\n * @return {string} Formatted phone number characters that have been input so far.\r\n */\n\n }, {\n key: \"input\",\n value: function input(text) {\n var _this$parser$input = this.parser.input(text, this.state),\n digits = _this$parser$input.digits,\n justLeadingPlus = _this$parser$input.justLeadingPlus;\n\n if (justLeadingPlus) {\n this.formattedOutput = '+';\n } else if (digits) {\n this.determineTheCountryIfNeeded(); // Match the available formats by the currently available leading digits.\n\n if (this.state.nationalSignificantNumber) {\n this.formatter.narrowDownMatchingFormats(this.state);\n }\n\n var formattedNationalNumber;\n\n if (this.metadata.hasSelectedNumberingPlan()) {\n formattedNationalNumber = this.formatter.format(digits, this.state);\n }\n\n if (formattedNationalNumber === undefined) {\n // See if another national (significant) number could be re-extracted.\n if (this.parser.reExtractNationalSignificantNumber(this.state)) {\n this.determineTheCountryIfNeeded(); // If it could, then re-try formatting the new national (significant) number.\n\n var nationalDigits = this.state.getNationalDigits();\n\n if (nationalDigits) {\n formattedNationalNumber = this.formatter.format(nationalDigits, this.state);\n }\n }\n }\n\n this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();\n }\n\n return this.formattedOutput;\n }\n }, {\n key: \"reset\",\n value: function reset() {\n var _this = this;\n\n this.state = new AsYouTypeState({\n onCountryChange: function onCountryChange(country) {\n // Before version `1.6.0`, the official `AsYouType` formatter API\n // included the `.country` property of an `AsYouType` instance.\n // Since that property (along with the others) have been moved to\n // `this.state`, `this.country` property is emulated for compatibility\n // with the old versions.\n _this.country = country;\n },\n onCallingCodeChange: function onCallingCodeChange(callingCode, country) {\n _this.metadata.selectNumberingPlan(country, callingCode);\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n\n _this.parser.reset(_this.metadata.numberingPlan);\n }\n });\n this.formatter = new AsYouTypeFormatter({\n state: this.state,\n metadata: this.metadata\n });\n this.parser = new AsYouTypeParser({\n defaultCountry: this.defaultCountry,\n defaultCallingCode: this.defaultCallingCode,\n metadata: this.metadata,\n state: this.state,\n onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {\n _this.determineTheCountryIfNeeded();\n\n _this.formatter.reset(_this.metadata.numberingPlan, _this.state);\n }\n });\n this.state.reset({\n country: this.defaultCountry,\n callingCode: this.defaultCallingCode\n });\n this.formattedOutput = '';\n return this;\n }\n /**\r\n * Returns `true` if the phone number is being input in international format.\r\n * In other words, returns `true` if and only if the parsed phone number starts with a `\"+\"`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isInternational\",\n value: function isInternational() {\n return this.state.international;\n }\n /**\r\n * Returns the \"calling code\" part of the phone number when it's being input\r\n * in an international format.\r\n * If no valid calling code has been entered so far, returns `undefined`.\r\n * @return {string} [callingCode]\r\n */\n\n }, {\n key: \"getCallingCode\",\n value: function getCallingCode() {\n // If the number is being input in national format and some \"default calling code\"\n // has been passed to `AsYouType` constructor, then `this.state.callingCode`\n // is equal to that \"default calling code\".\n //\n // If the number is being input in national format and no \"default calling code\"\n // has been passed to `AsYouType` constructor, then returns `undefined`,\n // even if a \"default country\" has been passed to `AsYouType` constructor.\n //\n if (this.isInternational()) {\n return this.state.callingCode;\n }\n } // A legacy alias.\n\n }, {\n key: \"getCountryCallingCode\",\n value: function getCountryCallingCode() {\n return this.getCallingCode();\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * Returns `undefined` if no phone number has been input yet.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"getCountry\",\n value: function getCountry() {\n var digits = this.state.digits; // Return `undefined` if no digits have been input yet.\n\n if (digits) {\n return this._getCountry();\n }\n }\n /**\r\n * Returns a two-letter country code of the phone number.\r\n * Returns `undefined` for \"non-geographic\" phone numbering plans.\r\n * @return {string} [country]\r\n */\n\n }, {\n key: \"_getCountry\",\n value: function _getCountry() {\n var country = this.state.country;\n /* istanbul ignore if */\n\n if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {\n // `AsYouType.getCountry()` returns `undefined`\n // for \"non-geographic\" phone numbering plans.\n if (country === '001') {\n return;\n }\n }\n\n return country;\n }\n }, {\n key: \"determineTheCountryIfNeeded\",\n value: function determineTheCountryIfNeeded() {\n // Suppose a user enters a phone number in international format,\n // and there're several countries corresponding to that country calling code,\n // and a country has been derived from the number, and then\n // a user enters one more digit and the number is no longer\n // valid for the derived country, so the country should be re-derived\n // on every new digit in those cases.\n //\n // If the phone number is being input in national format,\n // then it could be a case when `defaultCountry` wasn't specified\n // when creating `AsYouType` instance, and just `defaultCallingCode` was specified,\n // and that \"calling code\" could correspond to a \"non-geographic entity\",\n // or there could be several countries corresponding to that country calling code.\n // In those cases, `this.country` is `undefined` and should be derived\n // from the number. Again, if country calling code is ambiguous, then\n // `this.country` should be re-derived with each new digit.\n //\n if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {\n this.determineTheCountry();\n }\n } // Prepends `+CountryCode ` in case of an international phone number\n\n }, {\n key: \"getFullNumber\",\n value: function getFullNumber(formattedNationalNumber) {\n var _this2 = this;\n\n if (this.isInternational()) {\n var prefix = function prefix(text) {\n return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {\n spacing: text ? true : false\n }) + text;\n };\n\n var callingCode = this.state.callingCode;\n\n if (!callingCode) {\n return prefix(\"\".concat(this.state.getDigitsWithoutInternationalPrefix()));\n }\n\n if (!formattedNationalNumber) {\n return prefix(callingCode);\n }\n\n return prefix(\"\".concat(callingCode, \" \").concat(formattedNationalNumber));\n }\n\n return formattedNationalNumber;\n }\n }, {\n key: \"getNonFormattedNationalNumberWithPrefix\",\n value: function getNonFormattedNationalNumberWithPrefix() {\n var _this$state = this.state,\n nationalSignificantNumber = _this$state.nationalSignificantNumber,\n complexPrefixBeforeNationalSignificantNumber = _this$state.complexPrefixBeforeNationalSignificantNumber,\n nationalPrefix = _this$state.nationalPrefix;\n var number = nationalSignificantNumber;\n var prefix = complexPrefixBeforeNationalSignificantNumber || nationalPrefix;\n\n if (prefix) {\n number = prefix + number;\n }\n\n return number;\n }\n }, {\n key: \"getNonFormattedNumber\",\n value: function getNonFormattedNumber() {\n var nationalSignificantNumberMatchesInput = this.state.nationalSignificantNumberMatchesInput;\n return this.getFullNumber(nationalSignificantNumberMatchesInput ? this.getNonFormattedNationalNumberWithPrefix() : this.state.getNationalDigits());\n }\n }, {\n key: \"getNonFormattedTemplate\",\n value: function getNonFormattedTemplate() {\n var number = this.getNonFormattedNumber();\n\n if (number) {\n return number.replace(/[\\+\\d]/g, DIGIT_PLACEHOLDER);\n }\n }\n }, {\n key: \"isCountryCallingCodeAmbiguous\",\n value: function isCountryCallingCodeAmbiguous() {\n var callingCode = this.state.callingCode;\n var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);\n return countryCodes && countryCodes.length > 1;\n } // Determines the country of the phone number\n // entered so far based on the country phone code\n // and the national phone number.\n\n }, {\n key: \"determineTheCountry\",\n value: function determineTheCountry() {\n this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {\n nationalNumber: this.state.nationalSignificantNumber,\n defaultCountry: this.defaultCountry,\n metadata: this.metadata\n }));\n }\n /**\r\n * Returns a E.164 phone number value for the user's input.\r\n *\r\n * For example, for country `\"US\"` and input `\"(222) 333-4444\"`\r\n * it will return `\"+12223334444\"`.\r\n *\r\n * For international phone number input, it will also auto-correct\r\n * some minor errors such as using a national prefix when writing\r\n * an international phone number. For example, if the user inputs\r\n * `\"+44 0 7400 000000\"` then it will return an auto-corrected\r\n * `\"+447400000000\"` phone number value.\r\n *\r\n * Will return `undefined` if no digits have been input,\r\n * or when inputting a phone number in national format and no\r\n * default country or default \"country calling code\" have been set.\r\n *\r\n * @return {string} [value]\r\n */\n\n }, {\n key: \"getNumberValue\",\n value: function getNumberValue() {\n var _this$state2 = this.state,\n digits = _this$state2.digits,\n callingCode = _this$state2.callingCode,\n country = _this$state2.country,\n nationalSignificantNumber = _this$state2.nationalSignificantNumber; // Will return `undefined` if no digits have been input.\n\n if (!digits) {\n return;\n }\n\n if (this.isInternational()) {\n if (callingCode) {\n return '+' + callingCode + nationalSignificantNumber;\n } else {\n return '+' + digits;\n }\n } else {\n if (country || callingCode) {\n var callingCode_ = country ? this.metadata.countryCallingCode() : callingCode;\n return '+' + callingCode_ + nationalSignificantNumber;\n }\n }\n }\n /**\r\n * Returns an instance of `PhoneNumber` class.\r\n * Will return `undefined` if no national (significant) number\r\n * digits have been entered so far, or if no `defaultCountry` has been\r\n * set and the user enters a phone number not in international format.\r\n */\n\n }, {\n key: \"getNumber\",\n value: function getNumber() {\n var _this$state3 = this.state,\n nationalSignificantNumber = _this$state3.nationalSignificantNumber,\n carrierCode = _this$state3.carrierCode,\n callingCode = _this$state3.callingCode; // `this._getCountry()` is basically same as `this.state.country`\n // with the only change that it return `undefined` in case of a\n // \"non-geographic\" numbering plan instead of `\"001\"` \"internal use\" value.\n\n var country = this._getCountry();\n\n if (!nationalSignificantNumber) {\n return;\n } // `state.country` and `state.callingCode` aren't required to be in sync.\n // For example, `country` could be `\"AR\"` and `callingCode` could be `undefined`.\n // So `country` and `callingCode` are totally independent.\n\n\n if (!country && !callingCode) {\n return;\n } // By default, if `defaultCountry` parameter was passed when\n // creating `AsYouType` instance, `state.country` is gonna be\n // that `defaultCountry`, which doesn't entirely conform with\n // `parsePhoneNumber()`'s behavior where it attempts to determine\n // the country more precisely in cases when multiple countries\n // could correspond to the same `countryCallingCode`.\n // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/103#note_1417192969\n //\n // Because `AsYouType.getNumber()` method is supposed to be a 1:1\n // equivalent for `parsePhoneNumber(AsYouType.getNumberValue())`,\n // then it should also behave accordingly in cases of `country` ambiguity.\n // That's how users of this library would expect it to behave anyway.\n //\n\n\n if (country) {\n if (country === this.defaultCountry) {\n // `state.country` and `state.callingCode` aren't required to be in sync.\n // For example, `state.country` could be `\"AR\"` and `state.callingCode` could be `undefined`.\n // So `state.country` and `state.callingCode` are totally independent.\n var metadata = new Metadata(this.metadata.metadata);\n metadata.selectNumberingPlan(country);\n\n var _callingCode = metadata.numberingPlan.callingCode();\n\n var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);\n\n if (ambiguousCountries.length > 1) {\n var exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {\n countries: ambiguousCountries,\n defaultCountry: this.defaultCountry,\n metadata: this.metadata.metadata\n });\n\n if (exactCountry) {\n country = exactCountry;\n }\n }\n }\n }\n\n var phoneNumber = new PhoneNumber(country || callingCode, nationalSignificantNumber, this.metadata.metadata);\n\n if (carrierCode) {\n phoneNumber.carrierCode = carrierCode;\n } // Phone number extensions are not supported by \"As You Type\" formatter.\n\n\n return phoneNumber;\n }\n /**\r\n * Returns `true` if the phone number is \"possible\".\r\n * Is just a shortcut for `PhoneNumber.isPossible()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isPossible\",\n value: function isPossible() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isPossible();\n }\n /**\r\n * Returns `true` if the phone number is \"valid\".\r\n * Is just a shortcut for `PhoneNumber.isValid()`.\r\n * @return {boolean}\r\n */\n\n }, {\n key: \"isValid\",\n value: function isValid() {\n var phoneNumber = this.getNumber();\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumber.isValid();\n }\n /**\r\n * @deprecated\r\n * This method is used in `react-phone-number-input/source/input-control.js`\r\n * in versions before `3.0.16`.\r\n */\n\n }, {\n key: \"getNationalNumber\",\n value: function getNationalNumber() {\n return this.state.nationalSignificantNumber;\n }\n /**\r\n * Returns the phone number characters entered by the user.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getChars\",\n value: function getChars() {\n return (this.state.international ? '+' : '') + this.state.digits;\n }\n /**\r\n * Returns the template for the formatted phone number.\r\n * @return {string}\r\n */\n\n }, {\n key: \"getTemplate\",\n value: function getTemplate() {\n return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || '';\n }\n }]);\n\n return AsYouType;\n}();\n\nexport { AsYouType as default };\n//# sourceMappingURL=AsYouType.js.map","import { getCountryCallingCode } from 'libphonenumber-js/core';\nexport function getInputValuePrefix(_ref) {\n var country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n metadata = _ref.metadata;\n return country && international && !withCountryCallingCode ? \"+\".concat(getCountryCallingCode(country, metadata)) : '';\n}\nexport function removeInputValuePrefix(value, prefix) {\n if (prefix) {\n value = value.slice(prefix.length);\n\n if (value[0] === ' ') {\n value = value.slice(1);\n }\n }\n\n return value;\n}\n//# sourceMappingURL=inputValuePrefix.js.map","var _excluded = [\"country\", \"international\", \"withCountryCallingCode\", \"metadata\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport Input from 'input-format/react';\nimport { AsYouType, parsePhoneNumberCharacter } from 'libphonenumber-js/core';\nimport { getInputValuePrefix, removeInputValuePrefix } from './helpers/inputValuePrefix.js';\nexport function createInput(defaultMetadata) {\n /**\r\n * `InputSmart` is a \"smarter\" implementation of a `Component`\r\n * that can be passed to ``. It parses and formats\r\n * the user's and maintains the caret's position in the process.\r\n * The caret positioning is maintained using `input-format` library.\r\n * Relies on being run in a DOM environment for calling caret positioning functions.\r\n */\n function InputSmart(_ref, ref) {\n var country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n _ref$metadata = _ref.metadata,\n metadata = _ref$metadata === void 0 ? defaultMetadata : _ref$metadata,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n var format = useCallback(function (value) {\n // \"As you type\" formatter.\n var formatter = new AsYouType(country, metadata);\n var prefix = getInputValuePrefix({\n country: country,\n international: international,\n withCountryCallingCode: withCountryCallingCode,\n metadata: metadata\n }); // Format the number.\n\n var text = formatter.input(prefix + value);\n var template = formatter.getTemplate();\n\n if (prefix) {\n text = removeInputValuePrefix(text, prefix); // `AsYouType.getTemplate()` can be `undefined`.\n\n if (template) {\n template = removeInputValuePrefix(template, prefix);\n }\n }\n\n return {\n text: text,\n template: template\n };\n }, [country, metadata]);\n return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {\n ref: ref,\n parse: parsePhoneNumberCharacter,\n format: format\n }));\n }\n\n InputSmart = /*#__PURE__*/React.forwardRef(InputSmart);\n InputSmart.propTypes = {\n /**\r\n * The parsed phone number.\r\n * \"Parsed\" not in a sense of \"E.164\"\r\n * but rather in a sense of \"having only\r\n * digits and possibly a leading plus character\".\r\n * Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n */\n value: PropTypes.string.isRequired,\n\n /**\r\n * A function of `value: string`.\r\n * Updates the `value` property.\r\n */\n onChange: PropTypes.func.isRequired,\n\n /**\r\n * A two-letter country code for formatting `value`\r\n * as a national phone number (e.g. `(800) 555 35 35`).\r\n * E.g. \"US\", \"RU\", etc.\r\n * If no `country` is passed then `value`\r\n * is formatted as an international phone number.\r\n * (e.g. `+7 800 555 35 35`)\r\n * Perhaps the `country` property should have been called `defaultCountry`\r\n * because if `value` is an international number then `country` is ignored.\r\n */\n country: PropTypes.string,\n\n /**\r\n * If `country` property is passed along with `international={true}` property\r\n * then the phone number will be input in \"international\" format for that `country`\r\n * (without \"country calling code\").\r\n * For example, if `country=\"US\"` property is passed to \"without country select\" input\r\n * then the phone number will be input in the \"national\" format for `US` (`(213) 373-4253`).\r\n * But if both `country=\"US\"` and `international={true}` properties are passed then\r\n * the phone number will be input in the \"international\" format for `US` (`213 373 4253`)\r\n * (without \"country calling code\" `+1`).\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If `country` and `international` properties are set,\r\n * then by default it won't include \"country calling code\" in the input field.\r\n * To change that, pass `withCountryCallingCode` property,\r\n * and it will include \"country calling code\" in the input field.\r\n */\n withCountryCallingCode: PropTypes.bool,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n */\n metadata: PropTypes.object\n };\n return InputSmart;\n}\nexport default createInput();\n//# sourceMappingURL=InputSmart.js.map","var _excluded = [\"value\", \"onChange\", \"country\", \"international\", \"withCountryCallingCode\", \"metadata\", \"inputComponent\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { parseIncompletePhoneNumber, formatIncompletePhoneNumber } from 'libphonenumber-js/core';\nimport { getInputValuePrefix, removeInputValuePrefix } from './helpers/inputValuePrefix.js';\nexport function createInput(defaultMetadata) {\n /**\r\n * `InputBasic` is the most basic implementation of a `Component`\r\n * that can be passed to ``. It parses and formats\r\n * the user's input but doesn't control the caret in the process:\r\n * when erasing or inserting digits in the middle of a phone number\r\n * the caret usually jumps to the end (this is the expected behavior).\r\n * Why does `InputBasic` exist when there's `InputSmart`?\r\n * One reason is working around the [Samsung Galaxy smart caret positioning bug]\r\n * (https://github.com/catamphetamine/react-phone-number-input/issues/75).\r\n * Another reason is that, unlike `InputSmart`, it doesn't require DOM environment.\r\n */\n function InputBasic(_ref, ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n country = _ref.country,\n international = _ref.international,\n withCountryCallingCode = _ref.withCountryCallingCode,\n _ref$metadata = _ref.metadata,\n metadata = _ref$metadata === void 0 ? defaultMetadata : _ref$metadata,\n _ref$inputComponent = _ref.inputComponent,\n Input = _ref$inputComponent === void 0 ? 'input' : _ref$inputComponent,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n var prefix = getInputValuePrefix({\n country: country,\n international: international,\n withCountryCallingCode: withCountryCallingCode,\n metadata: metadata\n });\n\n var _onChange = useCallback(function (event) {\n var newValue = parseIncompletePhoneNumber(event.target.value); // By default, if a value is something like `\"(123)\"`\n // then Backspace would only erase the rightmost brace\n // becoming something like `\"(123\"`\n // which would give the same `\"123\"` value\n // which would then be formatted back to `\"(123)\"`\n // and so a user wouldn't be able to erase the phone number.\n // Working around this issue with this simple hack.\n\n if (newValue === value) {\n var newValueFormatted = format(prefix, newValue, country, metadata);\n\n if (newValueFormatted.indexOf(event.target.value) === 0) {\n // Trim the last digit (or plus sign).\n newValue = newValue.slice(0, -1);\n }\n }\n\n onChange(newValue);\n }, [prefix, value, onChange, country, metadata]);\n\n return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {\n ref: ref,\n value: format(prefix, value, country, metadata),\n onChange: _onChange\n }));\n }\n\n InputBasic = /*#__PURE__*/React.forwardRef(InputBasic);\n InputBasic.propTypes = {\n /**\r\n * The parsed phone number.\r\n * \"Parsed\" not in a sense of \"E.164\"\r\n * but rather in a sense of \"having only\r\n * digits and possibly a leading plus character\".\r\n * Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n */\n value: PropTypes.string.isRequired,\n\n /**\r\n * A function of `value: string`.\r\n * Updates the `value` property.\r\n */\n onChange: PropTypes.func.isRequired,\n\n /**\r\n * A two-letter country code for formatting `value`\r\n * as a national phone number (e.g. `(800) 555 35 35`).\r\n * E.g. \"US\", \"RU\", etc.\r\n * If no `country` is passed then `value`\r\n * is formatted as an international phone number.\r\n * (e.g. `+7 800 555 35 35`)\r\n * Perhaps the `country` property should have been called `defaultCountry`\r\n * because if `value` is an international number then `country` is ignored.\r\n */\n country: PropTypes.string,\n\n /**\r\n * If `country` property is passed along with `international={true}` property\r\n * then the phone number will be input in \"international\" format for that `country`\r\n * (without \"country calling code\").\r\n * For example, if `country=\"US\"` property is passed to \"without country select\" input\r\n * then the phone number will be input in the \"national\" format for `US` (`(213) 373-4253`).\r\n * But if both `country=\"US\"` and `international={true}` properties are passed then\r\n * the phone number will be input in the \"international\" format for `US` (`213 373 4253`)\r\n * (without \"country calling code\" `+1`).\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If `country` and `international` properties are set,\r\n * then by default it won't include \"country calling code\" in the input field.\r\n * To change that, pass `withCountryCallingCode` property,\r\n * and it will include \"country calling code\" in the input field.\r\n */\n withCountryCallingCode: PropTypes.bool,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n */\n metadata: PropTypes.object,\n\n /**\r\n * The `` component.\r\n */\n inputComponent: PropTypes.elementType\n };\n return InputBasic;\n}\nexport default createInput();\n\nfunction format(prefix, value, country, metadata) {\n return removeInputValuePrefix(formatIncompletePhoneNumber(prefix + value, country, metadata), prefix);\n}\n//# sourceMappingURL=InputBasic.js.map","import AsYouType from './AsYouType.js';\n/**\r\n * Formats a (possibly incomplete) phone number.\r\n * The phone number can be either in E.164 format\r\n * or in a form of national number digits.\r\n * @param {string} value - A possibly incomplete phone number. Either in E.164 format or in a form of national number digits.\r\n * @param {string|object} [optionsOrDefaultCountry] - A two-letter (\"ISO 3166-1 alpha-2\") country code, or an object of shape `{ defaultCountry?: string, defaultCallingCode?: string }`.\r\n * @return {string} Formatted (possibly incomplete) phone number.\r\n */\n\nexport default function formatIncompletePhoneNumber(value, optionsOrDefaultCountry, metadata) {\n if (!metadata) {\n metadata = optionsOrDefaultCountry;\n optionsOrDefaultCountry = undefined;\n }\n\n return new AsYouType(optionsOrDefaultCountry, metadata).input(value);\n}\n//# sourceMappingURL=formatIncompletePhoneNumber.js.map","/**\r\n * Creates Unicode flag from a two-letter ISO country code.\r\n * https://stackoverflow.com/questions/24050671/how-to-put-japan-flag-character-in-a-string\r\n * @param {string} country — A two-letter ISO country code (case-insensitive).\r\n * @return {string}\r\n */\nexport default function getCountryFlag(country) {\n return getRegionalIndicatorSymbol(country[0]) + getRegionalIndicatorSymbol(country[1]);\n}\n/**\r\n * Converts a letter to a Regional Indicator Symbol.\r\n * @param {string} letter\r\n * @return {string}\r\n */\n\nfunction getRegionalIndicatorSymbol(letter) {\n return String.fromCodePoint(0x1F1E6 - 65 + letter.toUpperCase().charCodeAt(0));\n}\n//# sourceMappingURL=unicode.js.map","var _excluded = [\"value\", \"onChange\", \"options\", \"disabled\", \"readOnly\"],\n _excluded2 = [\"value\", \"options\", \"className\", \"iconComponent\", \"getIconAspectRatio\", \"arrowComponent\", \"unicodeFlags\"];\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React, { useCallback, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport getUnicodeFlagIcon from 'country-flag-icons/unicode';\nexport default function CountrySelect(_ref) {\n var value = _ref.value,\n onChange = _ref.onChange,\n options = _ref.options,\n disabled = _ref.disabled,\n readOnly = _ref.readOnly,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n var onChange_ = useCallback(function (event) {\n var value = event.target.value;\n onChange(value === 'ZZ' ? undefined : value);\n }, [onChange]);\n var selectedOption = useMemo(function () {\n return getSelectedOption(options, value);\n }, [options, value]); // \"ZZ\" means \"International\".\n // (HTML requires each `` have some string `value`).\n\n return /*#__PURE__*/React.createElement(\"select\", _extends({}, rest, {\n disabled: disabled || readOnly,\n readOnly: readOnly,\n value: value || 'ZZ',\n onChange: onChange_\n }), options.map(function (_ref2) {\n var value = _ref2.value,\n label = _ref2.label,\n divider = _ref2.divider;\n return /*#__PURE__*/React.createElement(\"option\", {\n key: divider ? '|' : value || 'ZZ',\n value: divider ? '|' : value || 'ZZ',\n disabled: divider ? true : false,\n style: divider ? DIVIDER_STYLE : undefined\n }, label);\n }));\n}\nCountrySelect.propTypes = {\n /**\r\n * A two-letter country code.\r\n * Example: \"US\", \"RU\", etc.\r\n */\n value: PropTypes.string,\n\n /**\r\n * A function of `value: string`.\r\n * Updates the `value` property.\r\n */\n onChange: PropTypes.func.isRequired,\n // `` options.\n options: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.string,\n label: PropTypes.string,\n divider: PropTypes.bool\n })).isRequired,\n // `readonly` attribute doesn't work on a ``.\n // https://github.com/catamphetamine/react-phone-number-input/issues/419#issuecomment-1764384480\n // https://www.delftstack.com/howto/html/html-select-readonly/\n // To work around that, if `readOnly: true` property is passed\n // to this component, it behaves analogous to `disabled: true`.\n disabled: PropTypes.bool,\n readOnly: PropTypes.bool\n};\nvar DIVIDER_STYLE = {\n fontSize: '1px',\n backgroundColor: 'currentColor',\n color: 'inherit'\n};\nexport function CountrySelectWithIcon(_ref3) {\n var value = _ref3.value,\n options = _ref3.options,\n className = _ref3.className,\n Icon = _ref3.iconComponent,\n getIconAspectRatio = _ref3.getIconAspectRatio,\n _ref3$arrowComponent = _ref3.arrowComponent,\n Arrow = _ref3$arrowComponent === void 0 ? DefaultArrowComponent : _ref3$arrowComponent,\n unicodeFlags = _ref3.unicodeFlags,\n rest = _objectWithoutProperties(_ref3, _excluded2);\n\n var selectedOption = useMemo(function () {\n return getSelectedOption(options, value);\n }, [options, value]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"PhoneInputCountry\"\n }, /*#__PURE__*/React.createElement(CountrySelect, _extends({}, rest, {\n value: value,\n options: options,\n className: classNames('PhoneInputCountrySelect', className)\n })), unicodeFlags && value && /*#__PURE__*/React.createElement(\"div\", {\n className: \"PhoneInputCountryIconUnicode\"\n }, getUnicodeFlagIcon(value)), !(unicodeFlags && value) && /*#__PURE__*/React.createElement(Icon, {\n \"aria-hidden\": true,\n country: value,\n label: selectedOption && selectedOption.label,\n aspectRatio: unicodeFlags ? 1 : undefined\n }), /*#__PURE__*/React.createElement(Arrow, null));\n}\nCountrySelectWithIcon.propTypes = {\n // Country flag component.\n iconComponent: PropTypes.elementType,\n // Select arrow component.\n arrowComponent: PropTypes.elementType,\n // Set to `true` to render Unicode flag icons instead of SVG images.\n unicodeFlags: PropTypes.bool\n};\n\nfunction DefaultArrowComponent() {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"PhoneInputCountrySelectArrow\"\n });\n}\n\nfunction getSelectedOption(options, value) {\n for (var _iterator = _createForOfIteratorHelperLoose(options), _step; !(_step = _iterator()).done;) {\n var option = _step.value;\n\n if (!option.divider && option.value === value) {\n return option;\n }\n }\n}\n//# sourceMappingURL=CountrySelect.js.map","var _excluded = [\"country\", \"countryName\", \"flags\", \"flagUrl\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames'; // Default country flag icon.\n// `` is wrapped in a `` to prevent SVGs from exploding in size in IE 11.\n// https://github.com/catamphetamine/react-phone-number-input/issues/111\n\nexport default function FlagComponent(_ref) {\n var country = _ref.country,\n countryName = _ref.countryName,\n flags = _ref.flags,\n flagUrl = _ref.flagUrl,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n if (flags && flags[country]) {\n return flags[country]({\n title: countryName\n });\n }\n\n return /*#__PURE__*/React.createElement(\"img\", _extends({}, rest, {\n alt: countryName,\n role: countryName ? undefined : \"presentation\",\n src: flagUrl.replace('{XX}', country).replace('{xx}', country.toLowerCase())\n }));\n}\nFlagComponent.propTypes = {\n // The country to be selected by default.\n // Two-letter country code (\"ISO 3166-1 alpha-2\").\n country: PropTypes.string.isRequired,\n // Will be HTML `title` attribute of the ``.\n countryName: PropTypes.string.isRequired,\n // Country flag icon components.\n // By default flag icons are inserted as ``s\n // with their `src` pointed to `country-flag-icons` gitlab pages website.\n // There might be cases (e.g. an offline application)\n // where having a large (3 megabyte) `` flags\n // bundle is more appropriate.\n // `import flags from 'react-phone-number-input/flags'`.\n flags: PropTypes.objectOf(PropTypes.elementType),\n // A URL for a country flag icon.\n // By default it points to `country-flag-icons` gitlab pages website.\n flagUrl: PropTypes.string.isRequired\n};\n//# sourceMappingURL=Flag.js.map","var _excluded = [\"aspectRatio\"],\n _excluded2 = [\"title\"],\n _excluded3 = [\"title\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nexport default function InternationalIcon(_ref) {\n var aspectRatio = _ref.aspectRatio,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n if (aspectRatio === 1) {\n return /*#__PURE__*/React.createElement(InternationalIcon1x1, rest);\n } else {\n return /*#__PURE__*/React.createElement(InternationalIcon3x2, rest);\n }\n}\nInternationalIcon.propTypes = {\n title: PropTypes.string.isRequired,\n aspectRatio: PropTypes.number\n}; // 3x2.\n// Using `` in ``s:\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title\n\nfunction InternationalIcon3x2(_ref2) {\n var title = _ref2.title,\n rest = _objectWithoutProperties(_ref2, _excluded2);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, rest, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 75 50\"\n }), /*#__PURE__*/React.createElement(\"title\", null, title), /*#__PURE__*/React.createElement(\"g\", {\n className: \"PhoneInputInternationalIconGlobe\",\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: \"2\",\n strokeMiterlimit: \"10\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M47.2,36.1C48.1,36,49,36,50,36c7.4,0,14,1.7,18.5,4.3\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M68.6,9.6C64.2,12.3,57.5,14,50,14c-7.4,0-14-1.7-18.5-4.3\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: \"26\",\n y1: \"25\",\n x2: \"74\",\n y2: \"25\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: \"50\",\n y1: \"1\",\n x2: \"50\",\n y2: \"49\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M46.3,48.7c1.2,0.2,2.5,0.3,3.7,0.3c13.3,0,24-10.7,24-24S63.3,1,50,1S26,11.7,26,25c0,2,0.3,3.9,0.7,5.8\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n d: \"M46.8,48.2c1,0.6,2.1,0.8,3.2,0.8c6.6,0,12-10.7,12-24S56.6,1,50,1S38,11.7,38,25c0,1.4,0.1,2.7,0.2,4c0,0.1,0,0.2,0,0.2\"\n })), /*#__PURE__*/React.createElement(\"path\", {\n className: \"PhoneInputInternationalIconPhone\",\n stroke: \"none\",\n fill: \"currentColor\",\n d: \"M12.4,17.9c2.9-2.9,5.4-4.8,0.3-11.2S4.1,5.2,1.3,8.1C-2,11.4,1.1,23.5,13.1,35.6s24.3,15.2,27.5,11.9c2.8-2.8,7.8-6.3,1.4-11.5s-8.3-2.6-11.2,0.3c-2,2-7.2-2.2-11.7-6.7S10.4,19.9,12.4,17.9z\"\n }));\n}\n\nInternationalIcon3x2.propTypes = {\n title: PropTypes.string.isRequired\n}; // 1x1.\n// Using `` in ``s:\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title\n\nfunction InternationalIcon1x1(_ref3) {\n var title = _ref3.title,\n rest = _objectWithoutProperties(_ref3, _excluded3);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({}, rest, {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 50 50\"\n }), /*#__PURE__*/React.createElement(\"title\", null, title), /*#__PURE__*/React.createElement(\"g\", {\n className: \"PhoneInputInternationalIconGlobe\",\n stroke: \"currentColor\",\n fill: \"none\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\"\n }, /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.45,13A21.44,21.44,0,1,1,37.08,41.56\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M19.36,35.47a36.9,36.9,0,0,1-2.28-13.24C17.08,10.39,21.88.85,27.8.85s10.72,9.54,10.72,21.38c0,6.48-1.44,12.28-3.71,16.21\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M17.41,33.4A39,39,0,0,1,27.8,32.06c6.62,0,12.55,1.5,16.48,3.86\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M44.29,8.53c-3.93,2.37-9.86,3.88-16.49,3.88S15.25,10.9,11.31,8.54\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: \"27.8\",\n y1: \"0.85\",\n x2: \"27.8\",\n y2: \"34.61\"\n }), /*#__PURE__*/React.createElement(\"line\", {\n x1: \"15.2\",\n y1: \"22.23\",\n x2: \"49.15\",\n y2: \"22.23\"\n })), /*#__PURE__*/React.createElement(\"path\", {\n className: \"PhoneInputInternationalIconPhone\",\n stroke: \"transparent\",\n fill: \"currentColor\",\n d: \"M9.42,26.64c2.22-2.22,4.15-3.59.22-8.49S3.08,17,.93,19.17c-2.49,2.48-.13,11.74,9,20.89s18.41,11.5,20.89,9c2.15-2.15,5.91-4.77,1-8.71s-6.27-2-8.49.22c-1.55,1.55-5.48-1.69-8.86-5.08S7.87,28.19,9.42,26.64Z\"\n }));\n}\n\nInternationalIcon1x1.propTypes = {\n title: PropTypes.string.isRequired\n};\n//# sourceMappingURL=InternationalIcon.js.map","function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { isSupportedCountry } from 'libphonenumber-js/core';\nexport { getCountries } from 'libphonenumber-js/core';\n/**\r\n * Sorts country `` options.\r\n * Can move some country `` options\r\n * to the top of the list, for example.\r\n * @param {object[]} countryOptions — Country `` options.\r\n * @param {string[]} [countryOptionsOrder] — Country `` options order. Example: `[\"US\", \"CA\", \"AU\", \"|\", \"...\"]`.\r\n * @return {object[]}\r\n */\n\nexport function sortCountryOptions(options, order) {\n if (!order) {\n return options;\n }\n\n var optionsOnTop = [];\n var optionsOnBottom = [];\n var appendTo = optionsOnTop;\n\n for (var _iterator = _createForOfIteratorHelperLoose(order), _step; !(_step = _iterator()).done;) {\n var element = _step.value;\n\n if (element === '|') {\n appendTo.push({\n divider: true\n });\n } else if (element === '...' || element === '…') {\n appendTo = optionsOnBottom;\n } else {\n (function () {\n var countryCode = void 0;\n\n if (element === '🌐') {\n countryCode = undefined;\n } else {\n countryCode = element;\n } // Find the position of the option.\n\n\n var index = options.indexOf(options.filter(function (option) {\n return option.value === countryCode;\n })[0]); // Get the option.\n\n var option = options[index]; // Remove the option from its default position.\n\n options.splice(index, 1); // Add the option on top.\n\n appendTo.push(option);\n })();\n }\n }\n\n return optionsOnTop.concat(options).concat(optionsOnBottom);\n}\nexport function getSupportedCountryOptions(countryOptions, metadata) {\n if (countryOptions) {\n countryOptions = countryOptions.filter(function (option) {\n switch (option) {\n case '🌐':\n case '|':\n case '...':\n case '…':\n return true;\n\n default:\n return isCountrySupportedWithError(option, metadata);\n }\n });\n\n if (countryOptions.length > 0) {\n return countryOptions;\n }\n }\n}\nexport function isCountrySupportedWithError(country, metadata) {\n if (isSupportedCountry(country, metadata)) {\n return true;\n } else {\n console.error(\"Country not found: \".concat(country));\n return false;\n }\n}\nexport function getSupportedCountries(countries, metadata) {\n if (countries) {\n countries = countries.filter(function (country) {\n return isCountrySupportedWithError(country, metadata);\n });\n\n if (countries.length === 0) {\n countries = undefined;\n }\n }\n\n return countries;\n}\n//# sourceMappingURL=countries.js.map","import Metadata from './metadata.js';\nexport default function getCountries(metadata) {\n return new Metadata(metadata).getCountries();\n}\n//# sourceMappingURL=getCountries.js.map","var _excluded = [\"country\", \"label\", \"aspectRatio\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport DefaultInternationalIcon from './InternationalIcon.js';\nimport Flag from './Flag.js';\nexport function createCountryIconComponent(_ref) {\n var flags = _ref.flags,\n flagUrl = _ref.flagUrl,\n FlagComponent = _ref.flagComponent,\n InternationalIcon = _ref.internationalIcon;\n\n function CountryIcon(_ref2) {\n var country = _ref2.country,\n label = _ref2.label,\n aspectRatio = _ref2.aspectRatio,\n rest = _objectWithoutProperties(_ref2, _excluded);\n\n // `aspectRatio` is currently a hack for the default \"International\" icon\n // to render it as a square when Unicode flag icons are used.\n // So `aspectRatio` property is only used with the default \"International\" icon.\n var _aspectRatio = InternationalIcon === DefaultInternationalIcon ? aspectRatio : undefined;\n\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, rest, {\n className: classNames('PhoneInputCountryIcon', {\n 'PhoneInputCountryIcon--square': _aspectRatio === 1,\n 'PhoneInputCountryIcon--border': country\n })\n }), country ? /*#__PURE__*/React.createElement(FlagComponent, {\n country: country,\n countryName: label,\n flags: flags,\n flagUrl: flagUrl,\n className: \"PhoneInputCountryIconImg\"\n }) : /*#__PURE__*/React.createElement(InternationalIcon, {\n title: label,\n aspectRatio: _aspectRatio,\n className: \"PhoneInputCountryIconImg\"\n }));\n }\n\n CountryIcon.propTypes = {\n country: PropTypes.string,\n label: PropTypes.string.isRequired,\n aspectRatio: PropTypes.number\n };\n return CountryIcon;\n}\nexport default createCountryIconComponent({\n // Must be equal to `defaultProps.flagUrl` in `./PhoneInputWithCountry.js`.\n flagUrl: 'https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg',\n flagComponent: Flag,\n internationalIcon: DefaultInternationalIcon\n});\n//# sourceMappingURL=CountryIcon.js.map","import { getCountryCallingCode, Metadata } from 'libphonenumber-js/core';\nvar ONLY_DIGITS_REGEXP = /^\\d+$/;\nexport default function getInternationalPhoneNumberPrefix(country, metadata) {\n // Standard international phone number prefix: \"+\" and \"country calling code\".\n var prefix = '+' + getCountryCallingCode(country, metadata); // \"Leading digits\" can't be used to rule out any countries.\n // So the \"pre-fill with leading digits on country selection\" feature had to be reverted.\n // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/10#note_1231042367\n // // Get \"leading digits\" for a phone number of the country.\n // // If there're \"leading digits\" then they can be part of the prefix too.\n // // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/10\n // metadata = new Metadata(metadata)\n // metadata.selectNumberingPlan(country)\n // // \"Leading digits\" patterns are only defined for about 20% of all countries.\n // // By definition, matching \"leading digits\" is a sufficient but not a necessary\n // // condition for a phone number to belong to a country.\n // // The point of \"leading digits\" check is that it's the fastest one to get a match.\n // // https://gitlab.com/catamphetamine/libphonenumber-js/blob/master/METADATA.md#leading_digits\n // const leadingDigits = metadata.numberingPlan.leadingDigits()\n // if (leadingDigits && ONLY_DIGITS_REGEXP.test(leadingDigits)) {\n // \tprefix += leadingDigits\n // }\n\n return prefix;\n}\n//# sourceMappingURL=getInternationalPhoneNumberPrefix.js.map","import parsePhoneNumber_, { getCountryCallingCode, AsYouType, Metadata } from 'libphonenumber-js/core';\nimport getInternationalPhoneNumberPrefix from './getInternationalPhoneNumberPrefix.js';\n/**\r\n * Decides which country should be pre-selected\r\n * when the phone number input component is first mounted.\r\n * @param {object?} phoneNumber - An instance of `PhoneNumber` class.\r\n * @param {string?} country - Pre-defined country (two-letter code).\r\n * @param {string[]?} countries - A list of countries available.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {string?}\r\n */\n\nexport function getPreSelectedCountry(_ref) {\n var value = _ref.value,\n phoneNumber = _ref.phoneNumber,\n defaultCountry = _ref.defaultCountry,\n getAnyCountry = _ref.getAnyCountry,\n countries = _ref.countries,\n required = _ref.required,\n metadata = _ref.metadata;\n var country; // If can get country from E.164 phone number\n // then it overrides the `country` passed (or not passed).\n\n if (phoneNumber && phoneNumber.country) {\n // `country` will be left `undefined` in case of non-detection.\n country = phoneNumber.country;\n } else if (defaultCountry) {\n if (!value || couldNumberBelongToCountry(value, defaultCountry, metadata)) {\n country = defaultCountry;\n }\n } // Only pre-select a country if it's in the available `countries` list.\n\n\n if (countries && countries.indexOf(country) < 0) {\n country = undefined;\n } // If there will be no \"International\" option\n // then some `country` must be selected.\n // It will still be the wrong country though.\n // But still country `` can't be left in a broken state.\n\n\n if (!country && required && countries && countries.length > 0) {\n country = getAnyCountry(); // noCountryMatchesTheNumber = true\n }\n\n return country;\n}\n/**\r\n * Generates a sorted list of country `` options.\r\n * @param {string[]} countries - A list of two-letter (\"ISO 3166-1 alpha-2\") country codes.\r\n * @param {object} labels - Custom country labels. E.g. `{ RU: 'Россия', US: 'США', ... }`.\r\n * @param {boolean} addInternationalOption - Whether should include \"International\" option at the top of the list.\r\n * @return {object[]} A list of objects having shape `{ value : string, label : string }`.\r\n */\n\nexport function getCountrySelectOptions(_ref2) {\n var countries = _ref2.countries,\n countryNames = _ref2.countryNames,\n addInternationalOption = _ref2.addInternationalOption,\n compareStringsLocales = _ref2.compareStringsLocales,\n _compareStrings = _ref2.compareStrings;\n\n // Default country name comparator uses `String.localeCompare()`.\n if (!_compareStrings) {\n _compareStrings = compareStrings;\n } // Generates a `` option for each country.\n\n\n var countrySelectOptions = countries.map(function (country) {\n return {\n value: country,\n // All `locale` country names included in this library\n // include all countries (this is checked at build time).\n // The only case when a country name might be missing\n // is when a developer supplies their own `labels` property.\n // To guard against such cases, a missing country name\n // is substituted by country code.\n label: countryNames[country] || country\n };\n }); // Sort the list of countries alphabetically.\n\n countrySelectOptions.sort(function (a, b) {\n return _compareStrings(a.label, b.label, compareStringsLocales);\n }); // Add the \"International\" option to the country list (if suitable)\n\n if (addInternationalOption) {\n countrySelectOptions.unshift({\n label: countryNames.ZZ\n });\n }\n\n return countrySelectOptions;\n}\n/**\r\n * Parses a E.164 phone number to an instance of `PhoneNumber` class.\r\n * @param {string?} value = E.164 phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {object} Object having shape `{ country: string?, countryCallingCode: string, number: string }`. `PhoneNumber`: https://gitlab.com/catamphetamine/libphonenumber-js#phonenumber.\r\n * @example\r\n * parsePhoneNumber('+78005553535')\r\n */\n\nexport function parsePhoneNumber(value, metadata) {\n return parsePhoneNumber_(value || '', metadata);\n}\n/**\r\n * Generates national number digits for a parsed phone.\r\n * May prepend national prefix.\r\n * The phone number must be a complete and valid phone number.\r\n * @param {object} phoneNumber - An instance of `PhoneNumber` class.\r\n * @param {object} metadata - `libphonenumber-js` metadata\r\n * @return {string}\r\n * @example\r\n * getNationalNumberDigits({ country: 'RU', phone: '8005553535' })\r\n * // returns '88005553535'\r\n */\n\nexport function generateNationalNumberDigits(phoneNumber) {\n return phoneNumber.formatNational().replace(/\\D/g, '');\n}\n/**\r\n * Migrates parsed `` `value` for the newly selected `country`.\r\n * @param {string?} phoneDigits - Phone number digits (and `+`) parsed from phone number `` (it's not the same as the `value` property).\r\n * @param {string?} prevCountry - Previously selected country.\r\n * @param {string?} newCountry - Newly selected country. Can't be same as previously selected country.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @param {boolean} useNationalFormat - whether should attempt to convert from international to national number for the new country.\r\n * @return {string?}\r\n */\n\nexport function getPhoneDigitsForNewCountry(phoneDigits, _ref3) {\n var prevCountry = _ref3.prevCountry,\n newCountry = _ref3.newCountry,\n metadata = _ref3.metadata,\n useNationalFormat = _ref3.useNationalFormat;\n\n if (prevCountry === newCountry) {\n return phoneDigits;\n } // If `parsed_input` is empty\n // then no need to migrate anything.\n\n\n if (!phoneDigits) {\n if (useNationalFormat) {\n return '';\n } else {\n if (newCountry) {\n // If `phoneDigits` is empty then set `phoneDigits` to\n // `+{getCountryCallingCode(newCountry)}`.\n return getInternationalPhoneNumberPrefix(newCountry, metadata);\n }\n\n return '';\n }\n } // If switching to some country.\n // (from \"International\" or another country)\n // If switching from \"International\" then `phoneDigits` starts with a `+`.\n // Otherwise it may or may not start with a `+`.\n\n\n if (newCountry) {\n // If the phone number was entered in international format\n // then migrate it to the newly selected country.\n // The phone number may be incomplete.\n // The phone number entered not necessarily starts with\n // the previously selected country phone prefix.\n if (phoneDigits[0] === '+') {\n // If the international phone number is for the new country\n // then convert it to local if required.\n if (useNationalFormat) {\n // // If a phone number is being input in international form\n // // and the country can already be derived from it,\n // // and if it is the new country, then format as a national number.\n // const derived_country = getCountryFromPossiblyIncompleteInternationalPhoneNumber(phoneDigits, metadata)\n // if (derived_country === newCountry) {\n // \treturn stripCountryCallingCode(phoneDigits, derived_country, metadata)\n // }\n // Actually, the two countries don't necessarily need to match:\n // the condition could be looser here, because several countries\n // might share the same international phone number format\n // (for example, \"NANPA\" countries like US, Canada, etc).\n // The looser condition would be just \"same nternational phone number format\"\n // which would mean \"same country calling code\" in the context of `libphonenumber-js`.\n if (phoneDigits.indexOf('+' + getCountryCallingCode(newCountry, metadata)) === 0) {\n return stripCountryCallingCode(phoneDigits, newCountry, metadata);\n } // Simply discard the previously entered international phone number,\n // because otherwise any \"smart\" transformation like getting the\n // \"national (significant) number\" part and then prepending the\n // newly selected country's \"country calling code\" to it\n // would just be confusing for a user without being actually useful.\n\n\n return ''; // // Simply strip the leading `+` character\n // // therefore simply converting all digits into a \"local\" phone number.\n // // https://github.com/catamphetamine/react-phone-number-input/issues/287\n // return phoneDigits.slice(1)\n }\n\n if (prevCountry) {\n var newCountryPrefix = getInternationalPhoneNumberPrefix(newCountry, metadata);\n\n if (phoneDigits.indexOf(newCountryPrefix) === 0) {\n return phoneDigits;\n } else {\n return newCountryPrefix;\n }\n } else {\n var defaultValue = getInternationalPhoneNumberPrefix(newCountry, metadata); // If `phoneDigits`'s country calling code part is the same\n // as for the new `country`, then leave `phoneDigits` as is.\n\n if (phoneDigits.indexOf(defaultValue) === 0) {\n return phoneDigits;\n } // If `phoneDigits`'s country calling code part is not the same\n // as for the new `country`, then set `phoneDigits` to\n // `+{getCountryCallingCode(newCountry)}`.\n\n\n return defaultValue;\n } // // If the international phone number already contains\n // // any country calling code then trim the country calling code part.\n // // (that could also be the newly selected country phone code prefix as well)\n // // `phoneDigits` doesn't neccessarily belong to `prevCountry`.\n // // (e.g. if a user enters an international number\n // // not belonging to any of the reduced `countries` list).\n // phoneDigits = stripCountryCallingCode(phoneDigits, prevCountry, metadata)\n // // Prepend country calling code prefix\n // // for the newly selected country.\n // return e164(phoneDigits, newCountry, metadata) || `+${getCountryCallingCode(newCountry, metadata)}`\n\n }\n } // If switching to \"International\" from a country.\n else {\n // If the phone number was entered in national format.\n if (phoneDigits[0] !== '+') {\n // Format the national phone number as an international one.\n // The phone number entered not necessarily even starts with\n // the previously selected country phone prefix.\n // Even if the phone number belongs to whole another country\n // it will still be parsed into some national phone number.\n //\n // Ignore the now-uncovered `|| ''` code branch:\n // previously `e164()` function could return an empty string\n // even when `phoneDigits` were not empty.\n // Now it always returns some `value` when there're any `phoneDigits`.\n // Still, didn't remove the `|| ''` code branch just in case\n // that logic changes somehow in some future, so there're no\n // possible bugs related to that.\n //\n // (ignore the `|| ''` code branch)\n\n /* istanbul ignore next */\n return e164(phoneDigits, prevCountry, metadata) || '';\n }\n }\n\n return phoneDigits;\n}\n/**\r\n * Converts phone number digits to a (possibly incomplete) E.164 phone number.\r\n * @param {string?} number - A possibly incomplete phone number digits string. Can be a possibly incomplete E.164 phone number.\r\n * @param {string?} country\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\nexport function e164(number, country, metadata) {\n if (!number) {\n return;\n } // If the phone number is being input in international format.\n\n\n if (number[0] === '+') {\n // If it's just the `+` sign then return nothing.\n if (number === '+') {\n return;\n } // Return a E.164 phone number.\n //\n // Could return `number` \"as is\" here, but there's a possibility\n // that some user might incorrectly input an international number\n // with a \"national prefix\". Such numbers aren't considered valid,\n // but `libphonenumber-js` is \"forgiving\" when it comes to parsing\n // user's input, and this input component follows that behavior.\n //\n\n\n var asYouType = new AsYouType(country, metadata);\n asYouType.input(number); // This function would return `undefined` only when `number` is `\"+\"`,\n // but at this point it is known that `number` is not `\"+\"`.\n\n return asYouType.getNumberValue();\n } // For non-international phone numbers\n // an accompanying country code is required.\n // The situation when `country` is `undefined`\n // and a non-international phone number is passed\n // to this function shouldn't happen.\n\n\n if (!country) {\n return;\n }\n\n var partial_national_significant_number = getNationalSignificantNumberDigits(number, country, metadata); //\n // Even if no \"national (significant) number\" digits have been input,\n // still return a non-`undefined` value.\n // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/113\n //\n // For example, if the user has selected country `US` and entered `\"1\"`\n // then that `\"1\"` is just a \"national prefix\" and no \"national (significant) number\"\n // digits have been input yet. Still, return `\"+1\"` as `value` in such cases,\n // because otherwise the app would think that the input is empty and mark it as such\n // while in reality it isn't empty, which might be thought of as a \"bug\", or just\n // a \"weird\" behavior.\n //\n // if (partial_national_significant_number) {\n\n return \"+\".concat(getCountryCallingCode(country, metadata)).concat(partial_national_significant_number || ''); // }\n}\n/**\r\n * Trims phone number digits if they exceed the maximum possible length\r\n * for a national (significant) number for the country.\r\n * @param {string} number - A possibly incomplete phone number digits string. Can be a possibly incomplete E.164 phone number.\r\n * @param {string} country\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string} Can be empty.\r\n */\n\nexport function trimNumber(number, country, metadata) {\n var nationalSignificantNumberPart = getNationalSignificantNumberDigits(number, country, metadata);\n\n if (nationalSignificantNumberPart) {\n var overflowDigitsCount = nationalSignificantNumberPart.length - getMaxNumberLength(country, metadata);\n\n if (overflowDigitsCount > 0) {\n return number.slice(0, number.length - overflowDigitsCount);\n }\n }\n\n return number;\n}\n\nfunction getMaxNumberLength(country, metadata) {\n // Get \"possible lengths\" for a phone number of the country.\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country); // Return the last \"possible length\".\n\n return metadata.numberingPlan.possibleLengths()[metadata.numberingPlan.possibleLengths().length - 1];\n} // If the phone number being input is an international one\n// then tries to derive the country from the phone number.\n// (regardless of whether there's any country currently selected)\n\n/**\r\n * @param {string} partialE164Number - A possibly incomplete E.164 phone number.\r\n * @param {string?} country - Currently selected country.\r\n * @param {string[]?} countries - A list of available countries. If not passed then \"all countries\" are assumed.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\n\nexport function getCountryForPartialE164Number(partialE164Number, _ref4) {\n var country = _ref4.country,\n countries = _ref4.countries,\n required = _ref4.required,\n metadata = _ref4.metadata;\n\n if (partialE164Number === '+') {\n // Don't change the currently selected country yet.\n return country;\n }\n\n var derived_country = getCountryFromPossiblyIncompleteInternationalPhoneNumber(partialE164Number, metadata); // If a phone number is being input in international form\n // and the country can already be derived from it,\n // then select that country.\n\n if (derived_country && (!countries || countries.indexOf(derived_country) >= 0)) {\n return derived_country;\n } // If \"International\" country option has not been disabled\n // and the international phone number entered doesn't correspond\n // to the currently selected country then reset the currently selected country.\n else if (country && !required && !couldNumberBelongToCountry(partialE164Number, country, metadata)) {\n return undefined;\n } // Don't change the currently selected country.\n\n\n return country;\n}\n/**\r\n * Parses `` value. Derives `country` from `input`. Derives an E.164 `value`.\r\n * @param {string?} phoneDigits — Parsed `` value. Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n * @param {string?} prevPhoneDigits — Previous parsed `` value. Examples: `\"\"`, `\"+\"`, `\"+123\"`, `\"123\"`.\r\n * @param {string?} country - Currently selected country.\r\n * @param {boolean} countryRequired - Is selecting some country required.\r\n * @param {function} getAnyCountry - Can be used to get any country when selecting some country required.\r\n * @param {string[]?} countries - A list of available countries. If not passed then \"all countries\" are assumed.\r\n * @param {boolean} international - Set to `true` to force international phone number format (leading `+`). Set to `false` to force \"national\" phone number format. Is `undefined` by default.\r\n * @param {boolean} limitMaxLength — Whether to enable limiting phone number max length.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {object} An object of shape `{ input, country, value }`.\r\n */\n\nexport function onPhoneDigitsChange(phoneDigits, _ref5) {\n var prevPhoneDigits = _ref5.prevPhoneDigits,\n country = _ref5.country,\n defaultCountry = _ref5.defaultCountry,\n countryRequired = _ref5.countryRequired,\n getAnyCountry = _ref5.getAnyCountry,\n countries = _ref5.countries,\n international = _ref5.international,\n limitMaxLength = _ref5.limitMaxLength,\n countryCallingCodeEditable = _ref5.countryCallingCodeEditable,\n metadata = _ref5.metadata;\n\n if (international && countryCallingCodeEditable === false) {\n if (country) {\n // For international phone numbers written with non-editable country calling code,\n // the `` value must always start with that non-editable country calling code.\n var prefix = getInternationalPhoneNumberPrefix(country, metadata); // If the input value doesn't start with the non-editable country calling code,\n // it should be fixed.\n\n if (phoneDigits.indexOf(prefix) !== 0) {\n var _value; // If a phone number input is declared as\n // `international: true` and `countryCallingCodeEditable: false`,\n // then the value of the `` is gonna be non-empty at all times,\n // even before the user has started to input any digits in the input field,\n // because the country calling code is always there by design.\n //\n // The fact that the input value is always non-empty results in a side effect:\n // whenever a user tabs into such input field, its value gets automatically selected.\n // If at that moment in time the user starts typing in the national digits of the phone number,\n // the selected `` value gets automatically replaced by those typed-in digits\n // so the value changes from `+xxx` to `y`, because inputting anything while having\n // the `` value selected results in erasing that `` value.\n //\n // This component handles such cases by restoring the `` value to what\n // it should be in such cases: `+xxxy`.\n // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/43\n //\n\n\n var hasStartedTypingInNationalNumberDigitsHavingInputValueSelected = phoneDigits && phoneDigits[0] !== '+';\n\n if (hasStartedTypingInNationalNumberDigitsHavingInputValueSelected) {\n // Fix the input value to what it should be: `y` → `+xxxy`.\n phoneDigits = prefix + phoneDigits;\n _value = e164(phoneDigits, country, metadata);\n } else {\n // In other cases, simply reset the `` value, because there're only two\n // possible cases:\n // * The user has selected the `` value and then hit Delete/Backspace to erase it.\n // * The user has pasted an international phone number for another country calling code,\n // which is considered a non-valid value.\n phoneDigits = prefix;\n }\n\n return {\n phoneDigits: phoneDigits,\n value: _value,\n country: country\n };\n }\n }\n } // If `international` property is `false`, then it means\n // \"enforce national-only format during input\",\n // so, if that's the case, then remove all `+` characters,\n // but only if some country is currently selected.\n // (not if \"International\" country is selected).\n\n\n if (international === false && country && phoneDigits && phoneDigits[0] === '+') {\n phoneDigits = convertInternationalPhoneDigitsToNational(phoneDigits, country, metadata);\n } // Trim the input to not exceed the maximum possible number length.\n\n\n if (phoneDigits && country && limitMaxLength) {\n phoneDigits = trimNumber(phoneDigits, country, metadata);\n } // If this `onChange()` event was triggered\n // as a result of selecting \"International\" country,\n // then force-prepend a `+` sign if the phone number\n // `` value isn't in international format.\n // Also, force-prepend a `+` sign if international\n // phone number input format is set.\n\n\n if (phoneDigits && phoneDigits[0] !== '+' && (!country || international)) {\n phoneDigits = '+' + phoneDigits;\n } // If the previously entered phone number\n // has been entered in international format\n // and the user decides to erase it,\n // then also reset the `country`\n // because it was most likely automatically selected\n // while the user was typing in the phone number\n // in international format.\n // This fixes the issue when a user is presented\n // with a phone number input with no country selected\n // and then types in their local phone number\n // then discovers that the input's messed up\n // (a `+` has been prepended at the start of their input\n // and a random country has been selected),\n // decides to undo it all by erasing everything\n // and then types in their local phone number again\n // resulting in a seemingly correct phone number\n // but in reality that phone number has incorrect country.\n // https://github.com/catamphetamine/react-phone-number-input/issues/273\n\n\n if (!phoneDigits && prevPhoneDigits && prevPhoneDigits[0] === '+') {\n if (international) {\n country = undefined;\n } else {\n country = defaultCountry;\n }\n } // Also resets such \"randomly\" selected country\n // as soon as the user erases the number\n // digit-by-digit up to the leading `+` sign.\n\n\n if (phoneDigits === '+' && prevPhoneDigits && prevPhoneDigits[0] === '+' && prevPhoneDigits.length > '+'.length) {\n country = undefined;\n } // Generate the new `value` property.\n\n\n var value;\n\n if (phoneDigits) {\n if (phoneDigits[0] === '+') {\n if (phoneDigits === '+') {\n value = undefined;\n } else if (country && getInternationalPhoneNumberPrefix(country, metadata).indexOf(phoneDigits) === 0) {\n // Selected a `country` and started inputting an\n // international phone number for this country\n // but hasn't input any \"national (significant) number\" digits yet.\n // In that case, assume `value` be `undefined`.\n //\n // For example, if selected `country` `\"US\"`\n // and started inputting phone number `\"+1\"`\n // then `value` `undefined` will be returned from this function.\n //\n value = undefined;\n } else {\n value = e164(phoneDigits, country, metadata);\n }\n } else {\n value = e164(phoneDigits, country, metadata);\n }\n } // Derive the country from the phone number.\n // (regardless of whether there's any country currently selected,\n // because there could be several countries corresponding to one country calling code)\n\n\n if (value) {\n country = getCountryForPartialE164Number(value, {\n country: country,\n countries: countries,\n metadata: metadata\n }); // If `international` property is `false`, then it means\n // \"enforce national-only format during input\",\n // so, if that's the case, then remove all `+` characters,\n // but only if some country is currently selected.\n // (not if \"International\" country is selected).\n\n if (international === false && country && phoneDigits && phoneDigits[0] === '+') {\n phoneDigits = convertInternationalPhoneDigitsToNational(phoneDigits, country, metadata); // Re-calculate `value` because `phoneDigits` has changed.\n\n value = e164(phoneDigits, country, metadata);\n }\n }\n\n if (!country && countryRequired) {\n country = defaultCountry || getAnyCountry();\n }\n\n return {\n phoneDigits: phoneDigits,\n country: country,\n value: value\n };\n}\n\nfunction convertInternationalPhoneDigitsToNational(input, country, metadata) {\n // Handle the case when a user might have pasted\n // a phone number in international format.\n if (input.indexOf(getInternationalPhoneNumberPrefix(country, metadata)) === 0) {\n // Create \"as you type\" formatter.\n var formatter = new AsYouType(country, metadata); // Input partial national phone number.\n\n formatter.input(input); // Return the parsed partial national phone number.\n\n var phoneNumber = formatter.getNumber();\n\n if (phoneNumber) {\n // Transform the number to a national one,\n // and remove all non-digits.\n return phoneNumber.formatNational().replace(/\\D/g, '');\n } else {\n return '';\n }\n } else {\n // Just remove the `+` sign.\n return input.replace(/\\D/g, '');\n }\n}\n/**\r\n * Determines the country for a given (possibly incomplete) E.164 phone number.\r\n * @param {string} number - A possibly incomplete E.164 phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string?}\r\n */\n\n\nexport function getCountryFromPossiblyIncompleteInternationalPhoneNumber(number, metadata) {\n var formatter = new AsYouType(null, metadata);\n formatter.input(number); // // `001` is a special \"non-geograpical entity\" code\n // // in Google's `libphonenumber` library.\n // if (formatter.getCountry() === '001') {\n // \treturn\n // }\n\n return formatter.getCountry();\n}\n/**\r\n * Compares two strings.\r\n * A helper for `Array.sort()`.\r\n * @param {string} a — First string.\r\n * @param {string} b — Second string.\r\n * @param {(string[]|string)} [locales] — The `locales` argument of `String.localeCompare`.\r\n */\n\nexport function compareStrings(a, b, locales) {\n // Use `String.localeCompare` if it's available.\n // https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare\n // Which means everyone except IE <= 10 and Safari <= 10.\n // `localeCompare()` is available in latest Node.js versions.\n\n /* istanbul ignore else */\n if (String.prototype.localeCompare) {\n return a.localeCompare(b, locales);\n }\n /* istanbul ignore next */\n\n\n return a < b ? -1 : a > b ? 1 : 0;\n}\n/**\r\n * Strips `+${countryCallingCode}` prefix from an E.164 phone number.\r\n * @param {string} number - (possibly incomplete) E.164 phone number.\r\n * @param {string?} country - A possible country for this phone number.\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string}\r\n */\n\nexport function stripCountryCallingCode(number, country, metadata) {\n // Just an optimization, so that it\n // doesn't have to iterate through all country calling codes.\n if (country) {\n var countryCallingCodePrefix = '+' + getCountryCallingCode(country, metadata); // If `country` fits the actual `number`.\n\n if (number.length < countryCallingCodePrefix.length) {\n if (countryCallingCodePrefix.indexOf(number) === 0) {\n return '';\n }\n } else {\n if (number.indexOf(countryCallingCodePrefix) === 0) {\n return number.slice(countryCallingCodePrefix.length);\n }\n }\n } // If `country` doesn't fit the actual `number`.\n // Try all available country calling codes.\n\n\n for (var _i = 0, _Object$keys = Object.keys(metadata.country_calling_codes); _i < _Object$keys.length; _i++) {\n var country_calling_code = _Object$keys[_i];\n\n if (number.indexOf(country_calling_code) === '+'.length) {\n return number.slice('+'.length + country_calling_code.length);\n }\n }\n\n return '';\n}\n/**\r\n * Parses a partially entered national phone number digits\r\n * (or a partially entered E.164 international phone number)\r\n * and returns the national significant number part.\r\n * National significant number returned doesn't come with a national prefix.\r\n * @param {string} number - National number digits. Or possibly incomplete E.164 phone number.\r\n * @param {string?} country\r\n * @param {object} metadata - `libphonenumber-js` metadata.\r\n * @return {string} [result]\r\n */\n\nexport function getNationalSignificantNumberDigits(number, country, metadata) {\n // Create \"as you type\" formatter.\n var formatter = new AsYouType(country, metadata); // Input partial national phone number.\n\n formatter.input(number); // Return the parsed partial national phone number.\n\n var phoneNumber = formatter.getNumber();\n return phoneNumber && phoneNumber.nationalNumber;\n}\n/**\r\n * Checks if a partially entered E.164 phone number could belong to a country.\r\n * @param {string} number\r\n * @param {string} country\r\n * @return {boolean}\r\n */\n\nexport function couldNumberBelongToCountry(number, country, metadata) {\n var intlPhoneNumberPrefix = getInternationalPhoneNumberPrefix(country, metadata);\n var i = 0;\n\n while (i < number.length && i < intlPhoneNumberPrefix.length) {\n if (number[i] !== intlPhoneNumberPrefix[i]) {\n return false;\n }\n\n i++;\n }\n\n return true;\n}\n/**\r\n * Gets initial \"phone digits\" (including `+`, if using international format).\r\n * @return {string} [phoneDigits] Returns `undefined` if there should be no initial \"phone digits\".\r\n */\n\nexport function getInitialPhoneDigits(_ref6) {\n var value = _ref6.value,\n phoneNumber = _ref6.phoneNumber,\n defaultCountry = _ref6.defaultCountry,\n international = _ref6.international,\n useNationalFormat = _ref6.useNationalFormat,\n metadata = _ref6.metadata;\n\n // If the `value` (E.164 phone number)\n // belongs to the currently selected country\n // and `useNationalFormat` is `true`\n // then convert `value` (E.164 phone number)\n // to a local phone number digits.\n // E.g. '+78005553535' -> '88005553535'.\n if ((international === false || useNationalFormat) && phoneNumber && phoneNumber.country) {\n return generateNationalNumberDigits(phoneNumber);\n } // If `international` property is `true`,\n // meaning \"enforce international phone number format\",\n // then always show country calling code in the input field.\n\n\n if (!value && international && defaultCountry) {\n return getInternationalPhoneNumberPrefix(defaultCountry, metadata);\n }\n\n return value;\n}\n//# sourceMappingURL=phoneInputHelpers.js.map","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { getInitialPhoneDigits, getCountryForPartialE164Number, parsePhoneNumber } from './phoneInputHelpers.js';\nimport getInternationalPhoneNumberPrefix from './getInternationalPhoneNumberPrefix.js';\nimport { isCountrySupportedWithError, getSupportedCountries } from './countries.js';\nexport default function getPhoneInputWithCountryStateUpdateFromNewProps(props, prevProps, state) {\n var metadata = props.metadata,\n countries = props.countries,\n newDefaultCountry = props.defaultCountry,\n newValue = props.value,\n newReset = props.reset,\n international = props.international,\n displayInitialValueAsLocalNumber = props.displayInitialValueAsLocalNumber,\n initialValueFormat = props.initialValueFormat;\n var prevDefaultCountry = prevProps.defaultCountry,\n prevValue = prevProps.value,\n prevReset = prevProps.reset;\n var country = state.country,\n value = state.value,\n hasUserSelectedACountry = state.hasUserSelectedACountry;\n\n var _getInitialPhoneDigits = function _getInitialPhoneDigits(parameters) {\n return getInitialPhoneDigits(_objectSpread(_objectSpread({}, parameters), {}, {\n international: international,\n useNationalFormat: displayInitialValueAsLocalNumber || initialValueFormat === 'national',\n metadata: metadata\n }));\n }; // Some users requested a way to reset the component\n // (both number `` and country ``).\n // Whenever `reset` property changes both number ``\n // and country `` are reset.\n // It's not implemented as some instance `.reset()` method\n // because `ref` is forwarded to ``.\n // It's also not replaced with just resetting `country` on\n // external `value` reset, because a user could select a country\n // and then not input any `value`, and so the selected country\n // would be \"stuck\", if not using this `reset` property.\n // https://github.com/catamphetamine/react-phone-number-input/issues/300\n\n\n if (newReset !== prevReset) {\n return {\n phoneDigits: _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: newDefaultCountry\n }),\n value: undefined,\n country: newDefaultCountry,\n hasUserSelectedACountry: undefined\n };\n } // `value` is the value currently shown in the component:\n // it's stored in the component's `state`, and it's not the `value` property.\n // `prevValue` is \"previous `value` property\".\n // `newValue` is \"new `value` property\".\n // If the default country changed\n // (e.g. in case of ajax GeoIP detection after page loaded)\n // then select it, but only if the user hasn't already manually\n // selected a country, and no phone number has been manually entered so far.\n // Because if the user has already started inputting a phone number\n // then they're okay with no country being selected at all (\"International\")\n // and they don't want to be disturbed, don't want their input to be screwed, etc.\n\n\n if (newDefaultCountry !== prevDefaultCountry) {\n var isNewDefaultCountrySupported = !newDefaultCountry || isCountrySupportedWithError(newDefaultCountry, metadata);\n\n var noValueHasBeenEnteredByTheUser = // By default, \"no value has been entered\" means `value` is `undefined`.\n !value || // When `international` is `true`, and some country has been pre-selected,\n // then the `` contains a pre-filled value of `+${countryCallingCode}${leadingDigits}`,\n // so in case of `international` being `true`, \"the user hasn't entered anything\" situation\n // doesn't just mean `value` is `undefined`, but could also mean `value` is `+${countryCallingCode}`.\n international && value === _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: prevDefaultCountry\n }); // Only update the `defaultCountry` property if no phone number\n // has been entered by the user or pre-set by the application.\n\n\n var noValueHasBeenEntered = !newValue && noValueHasBeenEnteredByTheUser;\n\n if (!hasUserSelectedACountry && isNewDefaultCountrySupported && noValueHasBeenEntered) {\n return {\n country: newDefaultCountry,\n // If `phoneDigits` is empty, then automatically select the new `country`\n // and set `phoneDigits` to `+{getCountryCallingCode(newCountry)}`.\n // The code assumes that \"no phone number has been entered by the user\",\n // and no `value` property has been passed, so the `phoneNumber` parameter\n // of `_getInitialPhoneDigits({ value, phoneNumber, ... })` is `undefined`.\n phoneDigits: _getInitialPhoneDigits({\n value: undefined,\n defaultCountry: newDefaultCountry\n }),\n // `value` is `undefined` and it stays so.\n value: undefined\n };\n }\n } // If a new `value` is set externally.\n // (e.g. as a result of an ajax API request\n // to get user's phone after page loaded)\n // The first part — `newValue !== prevValue` —\n // is basically `props.value !== prevProps.value`\n // so it means \"if value property was changed externally\".\n // The second part — `newValue !== value` —\n // is for ignoring the `getDerivedStateFromProps()` call\n // which happens in `this.onChange()` right after `this.setState()`.\n // If this `getDerivedStateFromProps()` call isn't ignored\n // then the country flag would reset on each input.\n\n\n if (!valuesAreEqual(newValue, prevValue) && !valuesAreEqual(newValue, value)) {\n var phoneNumber;\n var parsedCountry;\n\n if (newValue) {\n phoneNumber = parsePhoneNumber(newValue, metadata);\n var supportedCountries = getSupportedCountries(countries, metadata);\n\n if (phoneNumber && phoneNumber.country) {\n // Ignore `else` because all countries are supported in metadata.\n\n /* istanbul ignore next */\n if (!supportedCountries || supportedCountries.indexOf(phoneNumber.country) >= 0) {\n parsedCountry = phoneNumber.country;\n }\n } else {\n parsedCountry = getCountryForPartialE164Number(newValue, {\n country: undefined,\n countries: supportedCountries,\n metadata: metadata\n }); // In cases when multiple countries correspond to the same country calling code,\n // the phone number digits of `newValue` have to be matched against country-specific\n // regular expressions in order to determine the exact country.\n // Sometimes, that algorithm can't decide for sure which country does the phone number belong to,\n // for example when the digits of `newValue` don't match any of those regular expressions.\n // and the country of the phone number couldn't be determined.\n // In those cases, people prefer the component to show the flag of the `defaultCountry`\n // if the phone number could potentially belong to that `defaultCountry`.\n // At least that's how the component behaves when a user pastes an international\n // phone number into the input field: for example, when `defaultCountry` is `\"US\"`\n // and the user pastes value \"+1 555 555 5555\" into the input field, it keep showing \"US\" flag.\n // So when setting new `value` property externally, the component should behave the same way:\n // it should select the `defaultCountry` when the new `value` could potentially belong\n // to that country in cases when the exact country can't be determined.\n // https://github.com/catamphetamine/react-phone-number-input/issues/413#issuecomment-1536219404\n\n if (!parsedCountry) {\n if (newDefaultCountry) {\n if (newValue.indexOf(getInternationalPhoneNumberPrefix(newDefaultCountry, metadata)) === 0) {\n parsedCountry = newDefaultCountry;\n }\n }\n }\n }\n }\n\n var hasUserSelectedACountryUpdate;\n\n if (!newValue) {\n // Reset `hasUserSelectedACountry` flag in `state`.\n hasUserSelectedACountryUpdate = {\n hasUserSelectedACountry: undefined\n };\n }\n\n return _objectSpread(_objectSpread({}, hasUserSelectedACountryUpdate), {}, {\n phoneDigits: _getInitialPhoneDigits({\n phoneNumber: phoneNumber,\n value: newValue,\n defaultCountry: newDefaultCountry\n }),\n value: newValue,\n country: newValue ? parsedCountry : newDefaultCountry\n });\n } // `defaultCountry` didn't change.\n // `value` didn't change.\n // `phoneDigits` didn't change, because `value` didn't change.\n //\n // So no need to update state.\n\n}\n\nfunction valuesAreEqual(value1, value2) {\n // If `value` has been set to `null` externally then convert it to `undefined`.\n //\n // For example, `react-hook-form` sets `value` to `null` when the user clears the input.\n // https://gitlab.com/catamphetamine/react-phone-number-input/-/issues/164\n // In that case, without this conversion of `null` to `undefined`, it would reset\n // the selected country to `defaultCountry` because in that case `newValue !== value`\n // because `null !== undefined`.\n //\n // Historically, empty `value` is encoded as `undefined`.\n // Perhaps empty `value` would be better encoded as `null` instead.\n // But because that would be a potentially breaking change for some people,\n // it's left as is for the current \"major\" version of this library.\n //\n if (value1 === null) {\n value1 = undefined;\n }\n\n if (value2 === null) {\n value2 = undefined;\n }\n\n return value1 === value2;\n}\n//# sourceMappingURL=getPhoneInputWithCountryStateUpdateFromNewProps.js.map","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar _excluded = [\"name\", \"disabled\", \"readOnly\", \"autoComplete\", \"style\", \"className\", \"inputRef\", \"inputComponent\", \"numberInputProps\", \"smartCaret\", \"countrySelectComponent\", \"countrySelectProps\", \"containerComponent\", \"defaultCountry\", \"countries\", \"countryOptionsOrder\", \"labels\", \"flags\", \"flagComponent\", \"flagUrl\", \"addInternationalOption\", \"internationalIcon\", \"displayInitialValueAsLocalNumber\", \"initialValueFormat\", \"onCountryChange\", \"limitMaxLength\", \"countryCallingCodeEditable\", \"focusInputOnCountrySelection\", \"reset\", \"metadata\", \"international\", \"locales\"];\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\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 React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport InputSmart from './InputSmart.js';\nimport InputBasic from './InputBasic.js';\nimport { CountrySelectWithIcon as CountrySelect } from './CountrySelect.js';\nimport Flag from './Flag.js';\nimport InternationalIcon from './InternationalIcon.js';\nimport { sortCountryOptions, isCountrySupportedWithError, getSupportedCountries, getSupportedCountryOptions, getCountries } from './helpers/countries.js';\nimport { createCountryIconComponent } from './CountryIcon.js';\nimport { metadata as metadataPropType, labels as labelsPropType } from './PropTypes.js';\nimport { getPreSelectedCountry, getCountrySelectOptions as _getCountrySelectOptions, parsePhoneNumber, generateNationalNumberDigits, getPhoneDigitsForNewCountry, getInitialPhoneDigits, onPhoneDigitsChange, e164 } from './helpers/phoneInputHelpers.js';\nimport getPhoneInputWithCountryStateUpdateFromNewProps from './helpers/getPhoneInputWithCountryStateUpdateFromNewProps.js';\n\nvar PhoneNumberInput_ = /*#__PURE__*/function (_React$PureComponent) {\n _inherits(PhoneNumberInput_, _React$PureComponent);\n\n var _super = _createSuper(PhoneNumberInput_);\n\n function PhoneNumberInput_(props) {\n var _this;\n\n _classCallCheck(this, PhoneNumberInput_);\n\n _this = _super.call(this, props);\n\n _defineProperty(_assertThisInitialized(_this), \"setInputRef\", function (instance) {\n _this.inputRef.current = instance;\n var ref = _this.props.inputRef;\n\n if (ref) {\n if (typeof ref === 'function') {\n ref(instance);\n } else {\n ref.current = instance;\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"isCountrySupportedWithError\", function (country) {\n var metadata = _this.props.metadata;\n return isCountrySupportedWithError(country, metadata);\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryChange\", function (newCountry) {\n var _this$props = _this.props,\n international = _this$props.international,\n metadata = _this$props.metadata,\n onChange = _this$props.onChange,\n focusInputOnCountrySelection = _this$props.focusInputOnCountrySelection;\n var _this$state = _this.state,\n prevPhoneDigits = _this$state.phoneDigits,\n prevCountry = _this$state.country; // After the new `country` has been selected,\n // if the phone number `` holds any digits\n // then migrate those digits for the new `country`.\n\n var newPhoneDigits = getPhoneDigitsForNewCountry(prevPhoneDigits, {\n prevCountry: prevCountry,\n newCountry: newCountry,\n metadata: metadata,\n // Convert the phone number to \"national\" format\n // when the user changes the selected country by hand.\n useNationalFormat: !international\n });\n var newValue = e164(newPhoneDigits, newCountry, metadata); // Focus phone number `` upon country selection.\n\n if (focusInputOnCountrySelection) {\n _this.inputRef.current.focus();\n } // If the user has already manually selected a country\n // then don't override that already selected country\n // if the `defaultCountry` property changes.\n // That's what `hasUserSelectedACountry` flag is for.\n\n\n _this.setState({\n country: newCountry,\n hasUserSelectedACountry: true,\n phoneDigits: newPhoneDigits,\n value: newValue\n }, function () {\n // Update the new `value` property.\n // Doing it after the `state` has been updated\n // because `onChange()` will trigger `getDerivedStateFromProps()`\n // with the new `value` which will be compared to `state.value` there.\n onChange(newValue);\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onChange\", function (_phoneDigits) {\n var _this$props2 = _this.props,\n defaultCountry = _this$props2.defaultCountry,\n onChange = _this$props2.onChange,\n addInternationalOption = _this$props2.addInternationalOption,\n international = _this$props2.international,\n limitMaxLength = _this$props2.limitMaxLength,\n countryCallingCodeEditable = _this$props2.countryCallingCodeEditable,\n metadata = _this$props2.metadata;\n var _this$state2 = _this.state,\n countries = _this$state2.countries,\n prevPhoneDigits = _this$state2.phoneDigits,\n currentlySelectedCountry = _this$state2.country;\n\n var _onPhoneDigitsChange = onPhoneDigitsChange(_phoneDigits, {\n prevPhoneDigits: prevPhoneDigits,\n country: currentlySelectedCountry,\n countryRequired: !addInternationalOption,\n defaultCountry: defaultCountry,\n getAnyCountry: function getAnyCountry() {\n return _this.getFirstSupportedCountry({\n countries: countries\n });\n },\n countries: countries,\n international: international,\n limitMaxLength: limitMaxLength,\n countryCallingCodeEditable: countryCallingCodeEditable,\n metadata: metadata\n }),\n phoneDigits = _onPhoneDigitsChange.phoneDigits,\n country = _onPhoneDigitsChange.country,\n value = _onPhoneDigitsChange.value;\n\n var stateUpdate = {\n phoneDigits: phoneDigits,\n value: value,\n country: country\n };\n\n if (countryCallingCodeEditable === false) {\n // If it simply did `setState({ phoneDigits: intlPrefix })` here,\n // then it would have no effect when erasing an inital international prefix\n // via Backspace, because `phoneDigits` in `state` wouldn't change\n // as a result, because it was `prefix` and it became `prefix`,\n // so the component wouldn't rerender, and the user would be able\n // to erase the country calling code part, and that part is\n // assumed to be non-eraseable. That's why the component is\n // forcefully rerendered here.\n // https://github.com/catamphetamine/react-phone-number-input/issues/367#issuecomment-721703501\n if (!value && phoneDigits === _this.state.phoneDigits) {\n // Force a re-render of the `` in order to reset its value.\n stateUpdate.forceRerender = {};\n }\n }\n\n _this.setState(stateUpdate, // Update the new `value` property.\n // Doing it after the `state` has been updated\n // because `onChange()` will trigger `getDerivedStateFromProps()`\n // with the new `value` which will be compared to `state.value` there.\n function () {\n return onChange(value);\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onFocus\", function () {\n return _this.setState({\n isFocused: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"_onBlur\", function () {\n return _this.setState({\n isFocused: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onFocus\", function (event) {\n _this._onFocus();\n\n var onFocus = _this.props.onFocus;\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onBlur\", function (event) {\n var onBlur = _this.props.onBlur;\n\n _this._onBlur();\n\n if (onBlur) {\n onBlur(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryFocus\", function (event) {\n _this._onFocus(); // this.setState({ countrySelectFocused: true })\n\n\n var countrySelectProps = _this.props.countrySelectProps;\n\n if (countrySelectProps) {\n var onFocus = countrySelectProps.onFocus;\n\n if (onFocus) {\n onFocus(event);\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"onCountryBlur\", function (event) {\n _this._onBlur(); // this.setState({ countrySelectFocused: false })\n\n\n var countrySelectProps = _this.props.countrySelectProps;\n\n if (countrySelectProps) {\n var onBlur = countrySelectProps.onBlur;\n\n if (onBlur) {\n onBlur(event);\n }\n }\n });\n\n _this.inputRef = /*#__PURE__*/React.createRef();\n var _this$props3 = _this.props,\n _value = _this$props3.value,\n labels = _this$props3.labels,\n _international = _this$props3.international,\n _addInternationalOption = _this$props3.addInternationalOption,\n displayInitialValueAsLocalNumber = _this$props3.displayInitialValueAsLocalNumber,\n initialValueFormat = _this$props3.initialValueFormat,\n _metadata = _this$props3.metadata;\n var _this$props4 = _this.props,\n _defaultCountry = _this$props4.defaultCountry,\n _countries = _this$props4.countries; // Validate `defaultCountry`.\n\n if (_defaultCountry) {\n if (!_this.isCountrySupportedWithError(_defaultCountry)) {\n _defaultCountry = undefined;\n }\n } // Validate `countries`.\n\n\n _countries = getSupportedCountries(_countries, _metadata);\n var phoneNumber = parsePhoneNumber(_value, _metadata);\n _this.CountryIcon = createCountryIconComponent(_this.props);\n var preSelectedCountry = getPreSelectedCountry({\n value: _value,\n phoneNumber: phoneNumber,\n defaultCountry: _defaultCountry,\n required: !_addInternationalOption,\n countries: _countries || getCountries(_metadata),\n getAnyCountry: function getAnyCountry() {\n return _this.getFirstSupportedCountry({\n countries: _countries\n });\n },\n metadata: _metadata\n });\n _this.state = {\n // Workaround for `this.props` inside `getDerivedStateFromProps()`.\n props: _this.props,\n // The country selected.\n country: preSelectedCountry,\n // `countries` are stored in `this.state` because they're filtered.\n // For example, a developer might theoretically pass some unsupported\n // countries as part of the `countries` property, and because of that\n // the component uses `this.state.countries` (which are filtered)\n // instead of `this.props.countries`\n // (which could potentially contain unsupported countries).\n countries: _countries,\n // `phoneDigits` state property holds non-formatted user's input.\n // The reason is that there's no way of finding out\n // in which form should `value` be displayed: international or national.\n // E.g. if `value` is `+78005553535` then it could be input\n // by a user both as `8 (800) 555-35-35` and `+7 800 555 35 35`.\n // Hence storing just `value` is not sufficient for correct formatting.\n // E.g. if a user entered `8 (800) 555-35-35`\n // then value is `+78005553535` and `phoneDigits` are `88005553535`\n // and if a user entered `+7 800 555 35 35`\n // then value is `+78005553535` and `phoneDigits` are `+78005553535`.\n phoneDigits: getInitialPhoneDigits({\n value: _value,\n phoneNumber: phoneNumber,\n defaultCountry: _defaultCountry,\n international: _international,\n useNationalFormat: displayInitialValueAsLocalNumber || initialValueFormat === 'national',\n metadata: _metadata\n }),\n // `value` property is duplicated in state.\n // The reason is that `getDerivedStateFromProps()`\n // needs this `value` to compare to the new `value` property\n // to find out if `phoneDigits` needs updating:\n // If the `value` property was changed externally\n // then it won't be equal to `state.value`\n // in which case `phoneDigits` and `country` should be updated.\n value: _value\n };\n return _this;\n }\n\n _createClass(PhoneNumberInput_, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var onCountryChange = this.props.onCountryChange;\n var defaultCountry = this.props.defaultCountry;\n var selectedCountry = this.state.country;\n\n if (onCountryChange) {\n if (defaultCountry) {\n if (!this.isCountrySupportedWithError(defaultCountry)) {\n defaultCountry = undefined;\n }\n }\n\n if (selectedCountry !== defaultCountry) {\n onCountryChange(selectedCountry);\n }\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps, prevState) {\n var onCountryChange = this.props.onCountryChange;\n var country = this.state.country; // Call `onCountryChange` when user selects another country.\n\n if (onCountryChange && country !== prevState.country) {\n onCountryChange(country);\n }\n }\n }, {\n key: \"getCountrySelectOptions\",\n value: function getCountrySelectOptions(_ref) {\n var countries = _ref.countries;\n var _this$props5 = this.props,\n international = _this$props5.international,\n countryCallingCodeEditable = _this$props5.countryCallingCodeEditable,\n countryOptionsOrder = _this$props5.countryOptionsOrder,\n addInternationalOption = _this$props5.addInternationalOption,\n labels = _this$props5.labels,\n locales = _this$props5.locales,\n metadata = _this$props5.metadata;\n return this.useMemoCountrySelectOptions(function () {\n return sortCountryOptions(_getCountrySelectOptions({\n countries: countries || getCountries(metadata),\n countryNames: labels,\n addInternationalOption: international && countryCallingCodeEditable === false ? false : addInternationalOption,\n compareStringsLocales: locales // compareStrings\n\n }), getSupportedCountryOptions(countryOptionsOrder, metadata));\n }, [countries, countryOptionsOrder, addInternationalOption, labels, metadata]);\n }\n }, {\n key: \"useMemoCountrySelectOptions\",\n value: function useMemoCountrySelectOptions(generator, dependencies) {\n if (!this.countrySelectOptionsMemoDependencies || !areEqualArrays(dependencies, this.countrySelectOptionsMemoDependencies)) {\n this.countrySelectOptionsMemo = generator();\n this.countrySelectOptionsMemoDependencies = dependencies;\n }\n\n return this.countrySelectOptionsMemo;\n }\n }, {\n key: \"getFirstSupportedCountry\",\n value: function getFirstSupportedCountry(_ref2) {\n var countries = _ref2.countries;\n var countryOptions = this.getCountrySelectOptions({\n countries: countries\n });\n return countryOptions[0].value;\n } // A shorthand for not passing `metadata` as a second argument.\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$props6 = this.props,\n name = _this$props6.name,\n disabled = _this$props6.disabled,\n readOnly = _this$props6.readOnly,\n autoComplete = _this$props6.autoComplete,\n style = _this$props6.style,\n className = _this$props6.className,\n inputRef = _this$props6.inputRef,\n inputComponent = _this$props6.inputComponent,\n numberInputProps = _this$props6.numberInputProps,\n smartCaret = _this$props6.smartCaret,\n CountrySelectComponent = _this$props6.countrySelectComponent,\n countrySelectProps = _this$props6.countrySelectProps,\n ContainerComponent = _this$props6.containerComponent,\n defaultCountry = _this$props6.defaultCountry,\n countriesProperty = _this$props6.countries,\n countryOptionsOrder = _this$props6.countryOptionsOrder,\n labels = _this$props6.labels,\n flags = _this$props6.flags,\n flagComponent = _this$props6.flagComponent,\n flagUrl = _this$props6.flagUrl,\n addInternationalOption = _this$props6.addInternationalOption,\n internationalIcon = _this$props6.internationalIcon,\n displayInitialValueAsLocalNumber = _this$props6.displayInitialValueAsLocalNumber,\n initialValueFormat = _this$props6.initialValueFormat,\n onCountryChange = _this$props6.onCountryChange,\n limitMaxLength = _this$props6.limitMaxLength,\n countryCallingCodeEditable = _this$props6.countryCallingCodeEditable,\n focusInputOnCountrySelection = _this$props6.focusInputOnCountrySelection,\n reset = _this$props6.reset,\n metadata = _this$props6.metadata,\n international = _this$props6.international,\n locales = _this$props6.locales,\n rest = _objectWithoutProperties(_this$props6, _excluded);\n\n var _this$state3 = this.state,\n country = _this$state3.country,\n countries = _this$state3.countries,\n phoneDigits = _this$state3.phoneDigits,\n isFocused = _this$state3.isFocused;\n var InputComponent = smartCaret ? InputSmart : InputBasic;\n var countrySelectOptions = this.getCountrySelectOptions({\n countries: countries\n });\n return /*#__PURE__*/React.createElement(ContainerComponent, {\n style: style,\n className: classNames(className, 'PhoneInput', {\n 'PhoneInput--focus': isFocused,\n 'PhoneInput--disabled': disabled,\n 'PhoneInput--readOnly': readOnly\n })\n }, /*#__PURE__*/React.createElement(CountrySelectComponent, _extends({\n name: name ? \"\".concat(name, \"Country\") : undefined,\n \"aria-label\": labels.country\n }, countrySelectProps, {\n value: country,\n options: countrySelectOptions,\n onChange: this.onCountryChange,\n onFocus: this.onCountryFocus,\n onBlur: this.onCountryBlur,\n disabled: disabled || countrySelectProps && countrySelectProps.disabled,\n readOnly: readOnly || countrySelectProps && countrySelectProps.readOnly,\n iconComponent: this.CountryIcon\n })), /*#__PURE__*/React.createElement(InputComponent, _extends({\n ref: this.setInputRef,\n type: \"tel\",\n autoComplete: autoComplete\n }, numberInputProps, rest, {\n name: name,\n metadata: metadata,\n country: country,\n value: phoneDigits || '',\n onChange: this.onChange,\n onFocus: this.onFocus,\n onBlur: this.onBlur,\n disabled: disabled,\n readOnly: readOnly,\n inputComponent: inputComponent,\n className: classNames('PhoneInputInput', numberInputProps && numberInputProps.className, rest.className)\n })));\n }\n }], [{\n key: \"getDerivedStateFromProps\",\n value: // `state` holds previous props as `props`, and also:\n // * `country` — The currently selected country, e.g. `\"RU\"`.\n // * `value` — The currently entered phone number (E.164), e.g. `+78005553535`.\n // * `phoneDigits` — The parsed `` value, e.g. `8005553535`.\n // (and a couple of other less significant properties)\n function getDerivedStateFromProps(props, state) {\n return _objectSpread({\n // Emulate `prevProps` via `state.props`.\n props: props\n }, getPhoneInputWithCountryStateUpdateFromNewProps(props, state.props, state));\n }\n }]);\n\n return PhoneNumberInput_;\n}(React.PureComponent); // This wrapper is only to `.forwardRef()` to the ``.\n\n\nvar PhoneNumberInput = /*#__PURE__*/React.forwardRef(function (props, ref) {\n return /*#__PURE__*/React.createElement(PhoneNumberInput_, _extends({}, withDefaultProps(props), {\n inputRef: ref\n }));\n});\nPhoneNumberInput.propTypes = {\n /**\r\n * Phone number in `E.164` format.\r\n *\r\n * Example:\r\n *\r\n * `\"+12223333333\"`\r\n *\r\n * Any \"falsy\" value like `undefined`, `null` or an empty string `\"\"` is treated like \"empty\".\r\n */\n value: PropTypes.string,\n\n /**\r\n * A function of `value: string?`.\r\n *\r\n * Updates the `value` property as the user inputs a phone number.\r\n *\r\n * If the user erases the input value, the argument is `undefined`.\r\n */\n onChange: PropTypes.func.isRequired,\n\n /**\r\n * Toggles the `--focus` CSS class.\r\n * @ignore\r\n */\n onFocus: PropTypes.func,\n\n /**\r\n * `onBlur` is usually passed by `redux-form`.\r\n * @ignore\r\n */\n onBlur: PropTypes.func,\n\n /**\r\n * Set to `true` to mark both the phone number ``\r\n * and the country `` as `disabled`.\r\n */\n disabled: PropTypes.bool,\n\n /**\r\n * Set to `true` to mark both the phone number ``\r\n * and the country `` as `readonly`.\r\n */\n readOnly: PropTypes.bool,\n\n /**\r\n * Sets `autoComplete` property for phone number ``.\r\n *\r\n * Web browser's \"autocomplete\" feature\r\n * remembers the phone number being input\r\n * and can also autofill the ``\r\n * with previously remembered phone numbers.\r\n *\r\n * https://developers.google.com\r\n * /web/updates/2015/06/checkout-faster-with-autofill\r\n *\r\n * For example, can be used to turn it off:\r\n *\r\n * \"So when should you use `autocomplete=\"off\"`?\r\n * One example is when you've implemented your own version\r\n * of autocomplete for search. Another example is any form field\r\n * where users will input and submit different kinds of information\r\n * where it would not be useful to have the browser remember\r\n * what was submitted previously\".\r\n */\n // (is `\"tel\"` by default)\n autoComplete: PropTypes.string,\n\n /**\r\n * Set to `\"national\"` to show the initial `value` in\r\n * \"national\" format rather than \"international\".\r\n *\r\n * For example, if `initialValueFormat` is `\"national\"`\r\n * and the initial `value=\"+12133734253\"` is passed\r\n * then the `` value will be `\"(213) 373-4253\"`.\r\n *\r\n * By default, `initialValueFormat` is `undefined`,\r\n * meaning that if the initial `value=\"+12133734253\"` is passed\r\n * then the `` value will be `\"+1 213 373 4253\"`.\r\n *\r\n * The reason for such default behaviour is that\r\n * the newer generation grows up when there are no stationary phones\r\n * and therefore everyone inputs phone numbers in international format\r\n * in their smartphones so people gradually get more accustomed to\r\n * writing phone numbers in international format rather than in local format.\r\n * Future people won't be using \"national\" format, only \"international\".\r\n */\n // (is `undefined` by default)\n initialValueFormat: PropTypes.oneOf(['national']),\n // `displayInitialValueAsLocalNumber` property has been\n // superceded by `initialValueFormat` property.\n displayInitialValueAsLocalNumber: PropTypes.bool,\n\n /**\r\n * The country to be selected by default.\r\n * For example, can be set after a GeoIP lookup.\r\n *\r\n * Example: `\"US\"`.\r\n */\n // A two-letter country code (\"ISO 3166-1 alpha-2\").\n defaultCountry: PropTypes.string,\n\n /**\r\n * If specified, only these countries will be available for selection.\r\n *\r\n * Example:\r\n *\r\n * `[\"RU\", \"UA\", \"KZ\"]`\r\n */\n countries: PropTypes.arrayOf(PropTypes.string),\n\n /**\r\n * Custom country `` option names.\r\n * Also some labels like \"ext\" and country `` `aria-label`.\r\n *\r\n * Example:\r\n *\r\n * `{ \"ZZ\": \"Международный\", RU: \"Россия\", US: \"США\", ... }`\r\n *\r\n * See the `locales` directory for examples.\r\n */\n labels: labelsPropType,\n\n /**\r\n * Country `` options are sorted by their labels.\r\n * The default sorting function uses `a.localeCompare(b, locales)`,\r\n * and, if that's not available, falls back to simple `a > b` / `a < b`.\r\n * Some languages, like Chinese, support multiple sorting variants\r\n * (called \"collations\"), and the user might prefer one or another.\r\n * Also, sometimes the Operating System language is not always\r\n * the preferred language for a person using a website or an application,\r\n * so there should be a way to specify custom locale.\r\n * This `locales` property mimicks the `locales` argument of `Intl` constructors,\r\n * and can be either a Unicode BCP 47 locale identifier or an array of such locale identifiers.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\r\n */\n locales: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n\n /*\r\n * Custom country `` options sorting function.\r\n * The default one uses `a.localeCompare(b)`, and,\r\n * if that's not available, falls back to simple `a > b`/`a < b`.\r\n * There have been requests to add custom sorter for cases\r\n * like Chinese language and \"pinyin\" (non-default) sorting order.\r\n * https://stackoverflow.com/questions/22907288/chinese-sorting-by-pinyin-in-javascript-with-localecompare\r\n compareStrings: PropTypes.func,\r\n */\n\n /**\r\n * A URL template of a country flag, where\r\n * \"{XX}\" is a two-letter country code in upper case,\r\n * or where \"{xx}\" is a two-letter country code in lower case.\r\n * By default it points to `country-flag-icons` gitlab pages website.\r\n * I imagine someone might want to download those country flag icons\r\n * and host them on their own servers instead\r\n * (all flags are available in the `country-flag-icons` library).\r\n * There's a catch though: new countries may be added in future,\r\n * so when hosting country flag icons on your own server\r\n * one should check the `CHANGELOG.md` every time before updating this library,\r\n * otherwise there's a possibility that some new country flag would be missing.\r\n */\n flagUrl: PropTypes.string,\n\n /**\r\n * Custom country flag icon components.\r\n * These flags will be used instead of the default ones.\r\n * The the \"Flags\" section of the readme for more info.\r\n *\r\n * The shape is an object where keys are country codes\r\n * and values are flag icon components.\r\n * Flag icon components receive the same properties\r\n * as `flagComponent` (see below).\r\n *\r\n * Example:\r\n *\r\n * `{ \"RU\": (props) => }`\r\n *\r\n * Example:\r\n *\r\n * `import flags from 'country-flag-icons/react/3x2'`\r\n *\r\n * `import PhoneInput from 'react-phone-number-input'`\r\n *\r\n * ``\r\n */\n flags: PropTypes.objectOf(PropTypes.elementType),\n\n /**\r\n * Country flag icon component.\r\n *\r\n * Takes properties:\r\n *\r\n * * `country: string` — The country code.\r\n * * `countryName: string` — The country name.\r\n * * `flagUrl: string` — The `flagUrl` property (see above).\r\n * * `flags: object` — The `flags` property (see above).\r\n */\n flagComponent: PropTypes.elementType,\n\n /**\r\n * Set to `false` to remove the \"International\" option from country ``.\r\n */\n addInternationalOption: PropTypes.bool,\n\n /**\r\n * \"International\" icon component.\r\n * Should have the same aspect ratio.\r\n *\r\n * Receives properties:\r\n *\r\n * * `title: string` — \"International\" country option label.\r\n */\n internationalIcon: PropTypes.elementType,\n\n /**\r\n * Can be used to place some countries on top of the list of country `` options.\r\n *\r\n * * `\"XX\"` — inserts an option for \"XX\" country.\r\n * * `\"🌐\"` — inserts \"International\" option.\r\n * * `\"|\"` — inserts a separator.\r\n * * `\"...\"` — inserts options for the rest of the countries (can be omitted, in which case it will be automatically added at the end).\r\n *\r\n * Example:\r\n *\r\n * `[\"US\", \"CA\", \"AU\", \"|\", \"...\"]`\r\n */\n countryOptionsOrder: PropTypes.arrayOf(PropTypes.string),\n\n /**\r\n * `` component CSS style object.\r\n */\n style: PropTypes.object,\n\n /**\r\n * `` component CSS class.\r\n */\n className: PropTypes.string,\n\n /**\r\n * Country `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `name: string?` — HTML `name` attribute.\r\n * * `value: string?` — The currently selected country code.\r\n * * `onChange(value: string?)` — Updates the `value`.\r\n * * `onFocus()` — Is used to toggle the `--focus` CSS class.\r\n * * `onBlur()` — Is used to toggle the `--focus` CSS class.\r\n * * `options: object[]` — The list of all selectable countries (including \"International\") each being an object of shape `{ value: string?, label: string }`.\r\n * * `iconComponent: PropTypes.elementType` — React component that renders a country icon: ``. If `country` is `undefined` then it renders an \"International\" icon.\r\n * * `disabled: boolean?` — HTML `disabled` attribute.\r\n * * `readOnly: boolean?` — HTML `readOnly` attribute.\r\n * * `tabIndex: (number|string)?` — HTML `tabIndex` attribute.\r\n * * `className: string` — CSS class name.\r\n */\n countrySelectComponent: PropTypes.elementType,\n\n /**\r\n * Country `` component props.\r\n * Along with the usual DOM properties such as `aria-label` and `tabIndex`,\r\n * some custom properties are supported, such as `arrowComponent` and `unicodeFlags`.\r\n */\n countrySelectProps: PropTypes.object,\n\n /**\r\n * Phone number `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `value: string` — The formatted `value`.\r\n * * `onChange(event: Event)` — Updates the formatted `value` from `event.target.value`.\r\n * * `onFocus()` — Is used to toggle the `--focus` CSS class.\r\n * * `onBlur()` — Is used to toggle the `--focus` CSS class.\r\n * * Other properties like `type=\"tel\"` or `autoComplete=\"tel\"` that should be passed through to the DOM ``.\r\n *\r\n * Must also either use `React.forwardRef()` to \"forward\" `ref` to the `` or implement `.focus()` method.\r\n */\n inputComponent: PropTypes.elementType,\n\n /**\r\n * Wrapping `` component.\r\n *\r\n * Receives properties:\r\n *\r\n * * `style: object` — A component CSS style object.\r\n * * `className: string` — Classes to attach to the component, typically changes when component focuses or blurs.\r\n */\n containerComponent: PropTypes.elementType,\n\n /**\r\n * Phone number `` component props.\r\n */\n numberInputProps: PropTypes.object,\n\n /**\r\n * When the user attempts to insert a digit somewhere in the middle of a phone number,\r\n * the caret position is moved right before the next available digit skipping\r\n * any punctuation in between. This is called \"smart\" caret positioning.\r\n * Another case would be the phone number format changing as a result of\r\n * the user inserting the digit somewhere in the middle, which would require\r\n * re-positioning the caret because all digit positions have changed.\r\n * This \"smart\" caret positioning feature can be turned off by passing\r\n * `smartCaret={false}` property: use it in case of any possible issues\r\n * with caret position during phone number input.\r\n */\n // Is `true` by default.\n smartCaret: PropTypes.bool,\n\n /**\r\n * Set to `true` to force \"international\" phone number format.\r\n * Set to `false` to force \"national\" phone number format.\r\n * By default it's `undefined` meaning that it doesn't enforce any phone number format.\r\n */\n international: PropTypes.bool,\n\n /**\r\n * If set to `true`, the phone number input will get trimmed\r\n * if it exceeds the maximum length for the country.\r\n */\n limitMaxLength: PropTypes.bool,\n\n /**\r\n * If set to `false`, and `international` is `true`, then\r\n * users won't be able to erase the \"country calling part\"\r\n * of a phone number in the ``.\r\n */\n countryCallingCodeEditable: PropTypes.bool,\n\n /**\r\n * `libphonenumber-js` metadata.\r\n *\r\n * Can be used to pass custom `libphonenumber-js` metadata\r\n * to reduce the overall bundle size for those who compile \"custom\" metadata.\r\n */\n metadata: metadataPropType,\n\n /**\r\n * Is called every time the selected country changes:\r\n * either programmatically or when user selects it manually from the list.\r\n */\n // People have been asking for a way to get the selected country.\n // @see https://github.com/catamphetamine/react-phone-number-input/issues/128\n // For some it's just a \"business requirement\".\n // I guess it's about gathering as much info on the user as a website can\n // without introducing any addional fields that would complicate the form\n // therefore reducing \"conversion\" (that's a marketing term).\n // Assuming that the phone number's country is the user's country\n // is not 100% correct but in most cases I guess it's valid.\n onCountryChange: PropTypes.func,\n\n /**\r\n * If set to `false`, will not focus the `` component\r\n * when the user selects a country from the list of countries.\r\n * This can be used to conform to the Web Content Accessibility Guidelines (WCAG).\r\n * Quote:\r\n * \"On input: Changing the setting of any user interface component\r\n * does not automatically cause a change of context unless the user\r\n * has been advised of the behaviour before using the component.\"\r\n */\n focusInputOnCountrySelection: PropTypes.bool\n};\nvar defaultProps = {\n /**\r\n * Remember (and autofill) the value as a phone number.\r\n */\n autoComplete: 'tel',\n\n /**\r\n * Country `` component.\r\n */\n countrySelectComponent: CountrySelect,\n\n /**\r\n * Flag icon component.\r\n */\n flagComponent: Flag,\n\n /**\r\n * By default, uses icons from `country-flag-icons` gitlab pages website.\r\n */\n // Must be equal to `flagUrl` in `./CountryIcon.js`.\n flagUrl: 'https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg',\n\n /**\r\n * Default \"International\" country `` option icon.\r\n */\n internationalIcon: InternationalIcon,\n\n /**\r\n * Phone number `` component.\r\n */\n inputComponent: 'input',\n\n /**\r\n * Wrapping `` component.\r\n */\n containerComponent: 'div',\n\n /**\r\n * Some users requested a way to reset the component:\r\n * both number `` and country ``.\r\n * Whenever `reset` property changes both number ``\r\n * and country `` are reset.\r\n * It's not implemented as some instance `.reset()` method\r\n * because `ref` is forwarded to ``.\r\n * It's also not replaced with just resetting `country` on\r\n * external `value` reset, because a user could select a country\r\n * and then not input any `value`, and so the selected country\r\n * would be \"stuck\", if not using this `reset` property.\r\n */\n // https://github.com/catamphetamine/react-phone-number-input/issues/300\n reset: PropTypes.any,\n\n /**\r\n *\r\n */\n\n /**\r\n * Set to `false` to use \"basic\" caret instead of the \"smart\" one.\r\n */\n smartCaret: true,\n\n /**\r\n * Whether to add the \"International\" option\r\n * to the list of countries.\r\n */\n addInternationalOption: true,\n\n /**\r\n * If set to `false`, and `international` is `true`, then\r\n * users won't be able to erase the \"country calling part\"\r\n * of a phone number in the ``.\r\n */\n countryCallingCodeEditable: true,\n\n /**\r\n * If set to `false`, will not focus the `` component\r\n * when the user selects a country from the list of countries.\r\n * This can be used to conform to the Web Content Accessibility Guidelines (WCAG).\r\n * Quote:\r\n * \"On input: Changing the setting of any user interface component\r\n * does not automatically cause a change of context unless the user\r\n * has been advised of the behaviour before using the component.\"\r\n */\n focusInputOnCountrySelection: true\n};\n\nfunction withDefaultProps(props) {\n props = _objectSpread({}, props);\n\n for (var key in defaultProps) {\n if (props[key] === undefined) {\n props[key] = defaultProps[key];\n }\n }\n\n return props;\n}\n\nexport default PhoneNumberInput;\n\nfunction areEqualArrays(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n\n var i = 0;\n\n while (i < a.length) {\n if (a[i] !== b[i]) {\n return false;\n }\n\n i++;\n }\n\n return true;\n}\n//# sourceMappingURL=PhoneInputWithCountry.js.map","var _excluded = [\"metadata\", \"labels\"];\n\nfunction _extends() { _extends = Object.assign ? Object.assign.bind() : 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; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport defaultLabels from '../locale/en.json.js';\nimport { metadata as metadataPropType, labels as labelsPropType } from './PropTypes.js';\nimport PhoneInput from './PhoneInputWithCountry.js';\nexport function createPhoneInput(defaultMetadata) {\n var PhoneInputDefault = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var _ref$metadata = _ref.metadata,\n metadata = _ref$metadata === void 0 ? defaultMetadata : _ref$metadata,\n _ref$labels = _ref.labels,\n labels = _ref$labels === void 0 ? defaultLabels : _ref$labels,\n rest = _objectWithoutProperties(_ref, _excluded);\n\n return /*#__PURE__*/React.createElement(PhoneInput, _extends({}, rest, {\n ref: ref,\n metadata: metadata,\n labels: labels\n }));\n });\n PhoneInputDefault.propTypes = {\n metadata: metadataPropType,\n labels: labelsPropType\n };\n return PhoneInputDefault;\n}\nexport default createPhoneInput();\n//# sourceMappingURL=PhoneInputWithCountryDefault.js.map","import metadata from 'libphonenumber-js/min/metadata'\r\n\r\nimport {\r\n\tparsePhoneNumber as _parsePhoneNumber,\r\n\tformatPhoneNumber as _formatPhoneNumber,\r\n\tformatPhoneNumberIntl as _formatPhoneNumberIntl,\r\n\tisValidPhoneNumber as _isValidPhoneNumber,\r\n\tisPossiblePhoneNumber as _isPossiblePhoneNumber,\r\n\tgetCountries as _getCountries,\r\n\tgetCountryCallingCode as _getCountryCallingCode,\r\n\tisSupportedCountry as _isSupportedCountry\r\n} from '../core/index.js'\r\n\r\nimport { createPhoneInput } from '../modules/PhoneInputWithCountryDefault.js'\r\n\r\nfunction call(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}\r\n\r\nexport default createPhoneInput(metadata)\r\n\r\nexport function parsePhoneNumber() {\r\n\treturn call(_parsePhoneNumber, arguments)\r\n}\r\n\r\nexport function formatPhoneNumber() {\r\n\treturn call(_formatPhoneNumber, arguments)\r\n}\r\n\r\nexport function formatPhoneNumberIntl() {\r\n\treturn call(_formatPhoneNumberIntl, arguments)\r\n}\r\n\r\nexport function isValidPhoneNumber() {\r\n\treturn call(_isValidPhoneNumber, arguments)\r\n}\r\n\r\nexport function isPossiblePhoneNumber() {\r\n\treturn call(_isPossiblePhoneNumber, arguments)\r\n}\r\n\r\nexport function getCountries() {\r\n\treturn call(_getCountries, arguments)\r\n}\r\n\r\nexport function getCountryCallingCode() {\r\n\treturn call(_getCountryCallingCode, arguments)\r\n}\r\n\r\nexport function isSupportedCountry() {\r\n\treturn call(_isSupportedCountry, arguments)\r\n}"],"names":["factory","module","exports","OldCookies","window","Cookies","api","noConflict","extend","i","result","arguments","length","attributes","key","decode","s","replace","decodeURIComponent","init","converter","set","value","document","path","defaults","expires","Date","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","escape","stringifiedAttributes","attributeName","split","cookie","get","json","jar","cookies","parts","slice","join","charAt","name","read","parse","getJSON","remove","withConverter","_excluded","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","source","forEach","getOwnPropertyDescriptors","defineProperties","defineProperty","withTranslation","ns","options","undefined","WrappedComponent","I18nextWithTranslation","_ref","forwardedRef","rest","_useTranslation","keyPrefix","_useTranslation2","t","i18n","ready","passDownProps","tReady","withRef","ref","createElement","displayName","concat","forwardRef","props","assign","_defineProperty","obj","configurable","writable","_slicedToArray","arr","Array","isArray","_arrayWithHoles","_i","Symbol","iterator","_s","_e","_arr","_n","_d","call","next","done","err","_iterableToArrayLimit","o","minLen","_arrayLikeToArray","n","prototype","toString","constructor","from","_unsupportedIterableToArray","TypeError","_nonIterableRest","len","arr2","normalizeArguments","args","text","metadata","_Array$prototype$slic2","arg_1","arg_2","arg_3","arg_4","isObject","Error","defaultCountry","parsePhoneNumber","v2","parsePhoneNumberWithError","error","ParseError","_normalizeArguments","country_calling_codes","isRequired","countries","labels","_createForOfIteratorHelperLoose","allowArrayLike","it","bind","count_occurences","symbol","string","_step","count","_iterator","template","placeholder","should_close_braces","characters_in_template","value_character_index","filled_in_template","character","retained_template","empty_placeholder","cut_before","dangling_braces","Keys","Backspace","Delete","setCaretPosition","element","caret_position","navigator","ANDROID_USER_AGENT_REG_EXP","userAgent","isAndroid","setSelectionRange","setTimeout","event","input","_parse","_format","on_change","hasAttribute","operation","keyCode","getOperation","preventDefault","selection","selectionStart","selectionEnd","start","end","eraseSelection","formatInputText","_parse2","parse_character","focused_input_character_index","index","caret","newValueAndCaret","edit","formatted","formatter","found","possibly_last_input_character_index","format","_extends","hasOwnProperty","this","_objectWithoutProperties","excluded","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","Input","InputComponent","inputComponent","onChange","onKeyDown","internalRef","useRef","setRef","useCallback","instance","current","_onChange","_onKeyDown","isEmptyValue","propTypes","type","onCut","onPaste","defaultProps","_defineProperties","descriptor","AsYouTypeState","onCountryChange","onCallingCodeChange","Constructor","_classCallCheck","protoProps","staticProps","_ref2","country","callingCode","international","missingPlus","IDDPrefix","digits","resetNationalSignificantNumber","initCountryAndCallingCode","nationalSignificantNumber","getNationalDigits","nationalSignificantNumberMatchesInput","nationalPrefix","carrierCode","complexPrefixBeforeNationalSignificantNumber","properties","_Object$keys","setCountry","setCallingCode","nextDigits","DIGIT_PLACEHOLDER","DIGIT_PLACEHOLDER_MATCHER","RegExp","repeat","times","cutAndStripNonPairedParens","cutBeforeIndex","pop","cleared_string","_dangling_braces","stripNonPairedParens","formatCompleteNumber","state","shouldTryNationalPrefixFormattingRule","getSeparatorAfterNationalPrefix","pattern","formattedNumber","formatNationalNumber","useNationalPrefixFormattingRule","formatNationalNumberWithAndWithoutNationalPrefixFormattingRule","_ref3","formattedNationalNumber","formatNationalNumberUsingFormat","useInternationalFormat","withNationalPrefix","parseDigits","isValidFormattedNationalNumber","PatternParser","context","or","instructions","parsePattern","_this$context$","branches","op","expandSingleElementArray","match","OPERATOR","operator","before","rightPart","startContext","getContext","endContext","oneOfSet","parseOneOfSet","ILLEGAL_CHARACTER_REGEXP","values","prevValue","charCodeAt","nextValue","fromCharCode","array","PatternMatcher","matchTree","allowOverflow","_match","matchedChars","overflow","characters","tree","last","characterString","partialMatch","restCharacters","_result","_step2","_iterator2","_char","LONGEST_DUMMY_PHONE_NUMBER","NATIONAL_PREFIX_SEPARATORS_PATTERN","CREATE_CHARACTER_CLASS_PATTERN","CREATE_STANDALONE_DIGIT_PATTERN","NON_ALTERING_FORMAT_REG_EXP","AsYouTypeFormatter","resetFormat","chosenFormat","nationalNumberTemplate","populatedNationalNumberTemplate","populatedNationalNumberTemplatePosition","numberingPlan","isNANP","matchingFormats","formats","narrowDownMatchingFormats","_this","checkNumberLength","canFormatCompleteNumber","formattedCompleteNumber","setNationalNumberTemplate","lastIndexOf","formatNationalNumberWithNextDigits","previouslyChosenFormat","newlyChosenFormat","chooseFormat","formatNextNationalNumberDigits","_this2","leadingDigits","leadingDigitsPatternIndex","formatSuits","formatMatches","usesNationalPrefix","nationalPrefixIsOptionalWhenFormattingInNationalFormat","nationalPrefixIsMandatoryWhenFormattingInNationalFormat","leadingDigitsPatternsCount","leadingDigitsPatterns","Math","min","leadingDigitsPattern","console","internationalFormat","_this3","_loop","getFormatFormat","createTemplateForFormat","_","_ret","getTemplateForFormat","nationalPrefixFormattingRule","spacing","internationalPrefix","getInternationalPrefixBeforeCountryCallingCode","getDigitsWithoutInternationalPrefix","_ref4","strictPattern","nationalNumberDummyDigits","nationalPrefixIncludedInTemplate","numberFormat","numberFormatWithNationalPrefix","applyInternationalSeparatorStyle","position","digit","search","populateTemplateWithDigits","_ref5","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART","VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN","VALID_FORMATTED_PHONE_NUMBER_PART","AFTER_PHONE_NUMBER_DIGITS_END_PATTERN","COMPLEX_NATIONAL_PREFIX","AsYouTypeParser","defaultCallingCode","onNationalSignificantNumberChange","justLeadingPlus","_extractFormattedDigi","_extractFormattedDigi3","extractedNumber","hasPlus","startsAt","extractFormattedPhoneNumber","_extractFormattedDigitsAndPlus","_extractFormattedDigi4","formattedDigits","extractFormattedDigitsAndPlus","_extractFormattedDigi2","startInternationalNumber","inputDigits","hasReceivedThreeLeadingDigits","appendDigits","extractIddPrefix","isWaitingForCountryCallingCode","extractCountryCallingCode","appendNationalSignificantNumberDigits","hasExtractedNationalSignificantNumber","extractNationalSignificantNumber","stateUpdate","update","_extractCountryCallin","countryCallingCode","number","hasSelectedNumberingPlan","nationalPrefixForParsing","_nationalPrefixForParsing","couldPossiblyExtractAnotherNationalSignificantNumber","nationalDigits","setState","_extractNationalNumbe","extractNationalNumberFromPossiblyIncompleteNumber","nationalNumber","onExtractedNationalNumber","prevNationalSignificantNumber","_extractNationalNumbe2","nationalSignificantNumberIndex","prefixBeforeNationalNumber","extractAnotherNationalSignificantNumber","fixMissingPlus","extractCallingCodeAndNationalSignificantNumber","numberWithoutIDD","stripIddPrefix","_extractCountryCallin2","extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","newCallingCode","AsYouType","optionsOrDefaultCountry","_this$getCountryAndCa2","getCountryAndCallingCode","reset","hasCountry","_this$parser$input","parser","formattedOutput","determineTheCountryIfNeeded","reExtractNationalSignificantNumber","getFullNumber","getNonFormattedNumber","selectNumberingPlan","isInternational","getCallingCode","_getCountry","isCountryCallingCodeAmbiguous","determineTheCountry","prefix","_this$state","getNonFormattedNationalNumberWithPrefix","countryCodes","getCountryCodesForCallingCode","getCountryByCallingCode","_this$state2","_this$state3","_callingCode","ambiguousCountries","exactCountry","getCountryByNationalNumber","phoneNumber","PhoneNumber","getNumber","isPossible","isValid","getTemplate","getNonFormattedTemplate","getInputValuePrefix","withCountryCallingCode","removeInputValuePrefix","defaultMetadata","InputSmart","_ref$metadata","InputBasic","_ref$inputComponent","newValue","parseIncompletePhoneNumber","formatIncompletePhoneNumber","getRegionalIndicatorSymbol","letter","fromCodePoint","toUpperCase","_excluded2","CountrySelect","disabled","readOnly","onChange_","useMemo","getSelectedOption","map","label","divider","style","DIVIDER_STYLE","fontSize","backgroundColor","color","CountrySelectWithIcon","className","Icon","iconComponent","_ref3$arrowComponent","getIconAspectRatio","arrowComponent","Arrow","DefaultArrowComponent","unicodeFlags","selectedOption","aspectRatio","option","FlagComponent","countryName","flags","flagUrl","title","alt","role","src","toLowerCase","_excluded3","InternationalIcon1x1","InternationalIcon3x2","xmlns","viewBox","stroke","fill","strokeWidth","strokeMiterlimit","strokeLinecap","d","x1","y1","x2","y2","isCountrySupportedWithError","getSupportedCountries","getCountries","createCountryIconComponent","flagComponent","InternationalIcon","internationalIcon","CountryIcon","_aspectRatio","getInternationalPhoneNumberPrefix","getPhoneDigitsForNewCountry","phoneDigits","prevCountry","newCountry","useNationalFormat","countryCallingCodePrefix","country_calling_code","stripCountryCallingCode","newCountryPrefix","defaultValue","e164","asYouType","getNumberValue","partial_national_significant_number","getNationalSignificantNumberDigits","trimNumber","nationalSignificantNumberPart","overflowDigitsCount","possibleLengths","getMaxNumberLength","getCountryForPartialE164Number","partialE164Number","required","derived_country","getCountry","getCountryFromPossiblyIncompleteInternationalPhoneNumber","couldNumberBelongToCountry","convertInternationalPhoneDigitsToNational","formatNational","compareStrings","a","b","locales","localeCompare","intlPhoneNumberPrefix","getInitialPhoneDigits","_ref6","generateNationalNumberDigits","valuesAreEqual","value1","value2","_typeof","_setPrototypeOf","p","setPrototypeOf","__proto__","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","_isNativeReflectConstruct","Super","_getPrototypeOf","NewTarget","self","_assertThisInitialized","_possibleConstructorReturn","ReferenceError","getPrototypeOf","PhoneNumberInput_","_React$PureComponent","subClass","superClass","create","_inherits","_super","inputRef","_this$props","focusInputOnCountrySelection","newPhoneDigits","focus","hasUserSelectedACountry","_phoneDigits","_this$props2","addInternationalOption","limitMaxLength","countryCallingCodeEditable","_onPhoneDigitsChange","prevPhoneDigits","countryRequired","getAnyCountry","_value","onPhoneDigitsChange","getFirstSupportedCountry","forceRerender","isFocused","_onFocus","onFocus","onBlur","_onBlur","countrySelectProps","_this$props3","_international","_addInternationalOption","displayInitialValueAsLocalNumber","initialValueFormat","_metadata","_this$props4","_defaultCountry","_countries","preSelectedCountry","getPreSelectedCountry","selectedCountry","prevProps","prevState","_this$props5","countryOptionsOrder","useMemoCountrySelectOptions","order","optionsOnTop","optionsOnBottom","appendTo","countryCode","splice","sortCountryOptions","countryNames","compareStringsLocales","_compareStrings","countrySelectOptions","sort","unshift","ZZ","countryOptions","getSupportedCountryOptions","generator","dependencies","countrySelectOptionsMemoDependencies","areEqualArrays","countrySelectOptionsMemo","getCountrySelectOptions","_this$props6","autoComplete","numberInputProps","smartCaret","CountrySelectComponent","countrySelectComponent","ContainerComponent","containerComponent","onCountryFocus","onCountryBlur","setInputRef","newDefaultCountry","newReset","prevDefaultCountry","prevReset","_getInitialPhoneDigits","parameters","isNewDefaultCountrySupported","noValueHasBeenEnteredByTheUser","parsedCountry","hasUserSelectedACountryUpdate","supportedCountries","getPhoneInputWithCountryStateUpdateFromNewProps","PhoneNumberInput","withDefaultProps","createPhoneInput","PhoneInputDefault","_ref$labels","func","_arguments"],"sourceRoot":""}