From 2e6cc376237ba26f47664c20cdc95df57baf9bbd Mon Sep 17 00:00:00 2001 From: Daniel Guimaraes Date: Thu, 7 Jun 2018 16:03:50 -0700 Subject: [PATCH] Squashing the many disparit commits into a single commit. --- .gitignore | 2 +- CHANGELOG.md | 5 ++ LICENSE | 2 +- README.md | 5 +- index.js | 5 ++ lib/isIPRange.js | 47 +++++++++++++++ lib/isMobilePhone.js | 12 +++- src/index.js | 2 + src/lib/isIPRange.js | 24 ++++++++ src/lib/isMobilePhone.js | 12 +++- test/validators.js | 66 ++++++++++++++++++--- validator.js | 120 ++++++++++++++++++++++++++++++++++++++- validator.min.js | 4 +- 13 files changed, 287 insertions(+), 19 deletions(-) create mode 100644 lib/isIPRange.js create mode 100644 src/lib/isIPRange.js diff --git a/.gitignore b/.gitignore index 2f117391f..322fbf702 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ node_modules coverage package-lock.json -yarn.lock \ No newline at end of file +yarn.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index a6117a77a..ff522f91d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +#### HEAD + +- Accept an array of locales in `isMobilePhone()` + ([#742](https://github.com/chriso/validator.js/pull/742)) + #### 10.3.0 - Strict Gmail validation in `isEmail()` diff --git a/LICENSE b/LICENSE index 37a807cbc..4e49a3840 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2016 Chris O'Hara +Copyright (c) 2018 Chris O'Hara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/README.md b/README.md index ea143692b..9ab381af2 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ Validator | Description **isHexColor(str)** | check if the string is a hexadecimal color. **isHexadecimal(str)** | check if the string is a hexadecimal number. **isIP(str [, version])** | check if the string is an IP (version 4 or 6). +**isIPRange(str)** | check if the string is an IP Range(version 4 only). **isISBN(str [, version])** | check if the string is an ISBN (version 10 or 13). **isISSN(str [, options])** | check if the string is an [ISSN](https://en.wikipedia.org/wiki/International_Standard_Serial_Number).

`options` is an object which defaults to `{ case_sensitive: false, require_hyphen: false }`. If `case_sensitive` is true, ISSNs with a lowercase `'x'` as the check digit are rejected. **isISIN(str)** | check if the string is an [ISIN][ISIN] (stock/security identifier). @@ -102,7 +103,7 @@ Validator | Description **isMACAddress(str)** | check if the string is a MAC address. **isMD5(str)** | check if the string is a MD5 hash. **isMimeType(str)** | check if the string matches to a valid [MIME type](https://en.wikipedia.org/wiki/Media_type) format -**isMobilePhone(str, locale [, options])** | check if the string is a mobile phone number,

(locale is one of `['ar-AE', 'ar-DZ', 'ar-EG', 'ar-JO', 'ar-SA', 'ar-SY', 'ar-TN', 'be-BY', 'bg-BG', 'cs-CZ', 'de-DE', 'da-DK', 'el-GR', 'en-AU', 'en-CA', 'en-GB', 'en-HK', 'en-IN', 'en-KE', 'en-NG', 'en-NZ', 'en-RW', 'en-SG', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-PK', 'es-ES', 'et-EE', 'fa-IR', 'fi-FI', 'fr-FR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'ko-KR', 'lt-LT', 'ms-MY', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'pt-BR', 'ro-RO', 'ru-RU', 'sk-SK', 'sr-RS', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-TW']` OR 'any'. If 'any' is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. +**isMobilePhone(str, locale [, options])** | check if the string is a mobile phone number,

(locale is either an array of locales (e.g `['sk-SK', 'sr-RS']`) OR one of `['ar-AE', 'ar-DZ', 'ar-EG', 'ar-JO', 'ar-SA', 'ar-SY', 'ar-TN', 'be-BY', 'bg-BG', 'cs-CZ', 'de-DE', 'da-DK', 'el-GR', 'en-AU', 'en-CA', 'en-GB', 'en-HK', 'en-IN', 'en-KE', 'en-NG', 'en-NZ', 'en-RW', 'en-SG', 'en-UG', 'en-US', 'en-TZ', 'en-ZA', 'en-ZM', 'en-PK', 'es-ES', 'et-EE', 'fa-IR', 'fi-FI', 'fr-FR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'ko-KR', 'lt-LT', 'ms-MY', 'nb-NO', 'nn-NO', 'pl-PL', 'pt-PT', 'pt-BR', 'ro-RO', 'ru-RU', 'sk-SK', 'sr-RS', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA', 'vi-VN', 'zh-CN', 'zh-HK', 'zh-TW']` OR 'any'. If 'any' is used, function will check if any of the locales match).

`options` is an optional object that can be supplied with the following keys: `strictMode`, if this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`. **isMongoId(str)** | check if the string is a valid hex-encoded representation of a [MongoDB ObjectId][mongoid]. **isMultibyte(str)** | check if the string contains one or more multibyte chars. **isNumeric(str)** | check if the string contains only numbers. @@ -174,7 +175,7 @@ Remember, validating can be troublesome sometimes. See [A list of articles about ## License (MIT) ``` -Copyright (c) 2017 Chris O'Hara +Copyright (c) 2018 Chris O'Hara Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/index.js b/index.js index a495329c6..4cb5e28e6 100644 --- a/index.js +++ b/index.js @@ -48,6 +48,10 @@ var _isIP = require('./lib/isIP'); var _isIP2 = _interopRequireDefault(_isIP); +var _isIPRange = require('./lib/isIPRange'); + +var _isIPRange2 = _interopRequireDefault(_isIPRange); + var _isFQDN = require('./lib/isFQDN'); var _isFQDN2 = _interopRequireDefault(_isFQDN); @@ -297,6 +301,7 @@ var validator = { isURL: _isURL2.default, isMACAddress: _isMACAddress2.default, isIP: _isIP2.default, + isIPRange: _isIPRange2.default, isFQDN: _isFQDN2.default, isBoolean: _isBoolean2.default, isAlpha: _isAlpha2.default, diff --git a/lib/isIPRange.js b/lib/isIPRange.js new file mode 100644 index 000000000..79b9a781b --- /dev/null +++ b/lib/isIPRange.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.default = isIPRange; + +var _assertString = require('./util/assertString'); + +var _assertString2 = _interopRequireDefault(_assertString); + +var _isIP = require('./isIP'); + +var _isIP2 = _interopRequireDefault(_isIP); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var subnetMaybe = /^\d{1,2}$/; + +function isIPRange(str) { + (0, _assertString2.default)(str); + + var _str$split = str.split('/'), + _str$split2 = _slicedToArray(_str$split, 3), + ip = _str$split2[0], + subnet = _str$split2[1], + err = _str$split2[2]; + + if (typeof err !== 'undefined') { + return false; + } + + if (!subnetMaybe.test(subnet)) { + return false; + } + + // Disallow preceding 0 i.e. 01, 02, ... + if (subnet.length > 1 && subnet.startsWith('0')) { + return false; + } + + return (0, _isIP2.default)(ip) && subnet <= 32 && subnet >= 0; +} +module.exports = exports['default']; \ No newline at end of file diff --git a/lib/isMobilePhone.js b/lib/isMobilePhone.js index f96b56d52..1f15dfe8d 100644 --- a/lib/isMobilePhone.js +++ b/lib/isMobilePhone.js @@ -87,7 +87,17 @@ function isMobilePhone(str, locale, options) { if (options && options.strictMode && !str.startsWith('+')) { return false; } - if (locale in phones) { + if (Array.isArray(locale)) { + return locale.some(function (key) { + if (phones.hasOwnProperty(key)) { + var phone = phones[key]; + if (phone.test(str)) { + return true; + } + } + return false; + }); + } else if (locale in phones) { return phones[locale].test(str); } else if (locale === 'any') { for (var key in phones) { diff --git a/src/index.js b/src/index.js index 49968b7c6..6ea6ff1e1 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,7 @@ import isEmail from './lib/isEmail'; import isURL from './lib/isURL'; import isMACAddress from './lib/isMACAddress'; import isIP from './lib/isIP'; +import isIPRange from './lib/isIPRange'; import isFQDN from './lib/isFQDN'; import isBoolean from './lib/isBoolean'; @@ -106,6 +107,7 @@ const validator = { isURL, isMACAddress, isIP, + isIPRange, isFQDN, isBoolean, isAlpha, diff --git a/src/lib/isIPRange.js b/src/lib/isIPRange.js new file mode 100644 index 000000000..835c223d3 --- /dev/null +++ b/src/lib/isIPRange.js @@ -0,0 +1,24 @@ +import assertString from './util/assertString'; +import isIP from './isIP'; + +const subnetMaybe = /^\d{1,2}$/; + +export default function isIPRange(str) { + assertString(str); + const [ip, subnet, err] = str.split('/'); + + if (typeof err !== 'undefined') { + return false; + } + + if (!subnetMaybe.test(subnet)) { + return false; + } + + // Disallow preceding 0 i.e. 01, 02, ... + if (subnet.length > 1 && subnet.startsWith('0')) { + return false; + } + + return isIP(ip, 4) && subnet <= 32 && subnet >= 0; +} diff --git a/src/lib/isMobilePhone.js b/src/lib/isMobilePhone.js index 8fce02d79..cb94ec4db 100644 --- a/src/lib/isMobilePhone.js +++ b/src/lib/isMobilePhone.js @@ -76,7 +76,17 @@ export default function isMobilePhone(str, locale, options) { if (options && options.strictMode && !str.startsWith('+')) { return false; } - if (locale in phones) { + if (Array.isArray(locale)) { + return locale.some((key) => { + if (phones.hasOwnProperty(key)) { + const phone = phones[key]; + if (phone.test(str)) { + return true; + } + } + return false; + }); + } else if (locale in phones) { return phones[locale].test(str); } else if (locale === 'any') { for (const key in phones) { diff --git a/test/validators.js b/test/validators.js index f12bc94f4..32838f82d 100644 --- a/test/validators.js +++ b/test/validators.js @@ -654,6 +654,29 @@ describe('Validators', () => { }); }); + it('should validate isIPRange', () => { + test({ + validator: 'isIPRange', + valid: [ + '127.0.0.1/24', + '0.0.0.0/0', + '255.255.255.0/32', + ], + invalid: [ + '127.200.230.1/35', + '127.200.230.1/-1', + '1.1.1.1/011', + '::1/64', + '1.1.1/24.1', + '1.1.1.1/01', + '1.1.1.1/1.1', + '1.1.1.1/1.', + '1.1.1.1/1/1', + '1.1.1.1', + ], + }); + }); + it('should validate FQDN', () => { test({ validator: 'isFQDN', @@ -4158,6 +4181,35 @@ describe('Validators', () => { '081234567891', ], }, + { + locale: ['en-ZA', 'be-BY'], + valid: [ + '0821231234', + '+27821231234', + '27821231234', + '+375241234567', + '+375251234567', + '+375291234567', + '+375331234567', + '+375441234567', + '375331234567', + ], + invalid: [ + '082123', + '08212312345', + '21821231234', + '+21821231234', + '+0821231234', + '12345', + '', + 'ASDFGJKLmZXJtZtesting123', + '010-38238383', + '+9676338855', + '19676338855', + '6676338855', + '+99676338855', + ], + }, ]; let allValid = []; @@ -4167,15 +4219,11 @@ describe('Validators', () => { if (fixture.valid) allValid = allValid.concat(fixture.valid); if (Array.isArray(fixture.locale)) { - // for fixtures that are shared across multiple locales - // e.g. 'nb-NO' and 'nn-NO' - fixture.locale.forEach((locale) => { - test({ - validator: 'isMobilePhone', - valid: fixture.valid, - invalid: fixture.invalid, - args: [locale], - }); + test({ + validator: 'isMobilePhone', + valid: fixture.valid, + invalid: fixture.invalid, + args: [fixture.locale], }); } else { test({ diff --git a/validator.js b/validator.js index 7e67b829c..a48806f11 100644 --- a/validator.js +++ b/validator.js @@ -1,5 +1,5 @@ /*! - * Copyright (c) 2016 Chris O'Hara + * Copyright (c) 2018 Chris O'Hara * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -69,6 +69,84 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + function toString(input) { if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && input !== null) { if (typeof input.toString === 'function') { @@ -458,6 +536,33 @@ function isMACAddress(str) { return macAddress.test(str); } +var subnetMaybe = /^\d{1,2}$/; + +function isIPRange(str) { + assertString(str); + + var _str$split = str.split('/'), + _str$split2 = slicedToArray(_str$split, 3), + ip = _str$split2[0], + subnet = _str$split2[1], + err = _str$split2[2]; + + if (typeof err !== 'undefined') { + return false; + } + + if (!subnetMaybe.test(subnet)) { + return false; + } + + // Disallow preceding 0 i.e. 01, 02, ... + if (subnet.length > 1 && subnet.startsWith('0')) { + return false; + } + + return isIP(ip) && subnet <= 32 && subnet >= 0; +} + function isBoolean(str) { assertString(str); return ['true', 'false', '1', '0'].indexOf(str) >= 0; @@ -1046,7 +1151,17 @@ function isMobilePhone(str, locale, options) { if (options && options.strictMode && !str.startsWith('+')) { return false; } - if (locale in phones) { + if (Array.isArray(locale)) { + return locale.some(function (key) { + if (phones.hasOwnProperty(key)) { + var phone = phones[key]; + if (phone.test(str)) { + return true; + } + } + return false; + }); + } else if (locale in phones) { return phones[locale].test(str); } else if (locale === 'any') { for (var key in phones) { @@ -1567,6 +1682,7 @@ var validator = { isURL: isURL, isMACAddress: isMACAddress, isIP: isIP, + isIPRange: isIPRange, isFQDN: isFQDN, isBoolean: isBoolean, isAlpha: isAlpha, diff --git a/validator.min.js b/validator.min.js index 7ca23fc29..9912703c5 100644 --- a/validator.min.js +++ b/validator.min.js @@ -1,5 +1,5 @@ /*! - * Copyright (c) 2016 Chris O'Hara + * Copyright (c) 2018 Chris O'Hara * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -20,4 +20,4 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.validator=t()}(this,function(){"use strict";function p(e){if(!("string"==typeof e||e instanceof String))throw new TypeError("This library (validator.js) validates strings only")}function i(e){return p(e),e=Date.parse(e),isNaN(e)?null:new Date(e)}function r(e){return p(e),parseFloat(e)}var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function n(e){return"object"===(void 0===e?"undefined":a(e))&&null!==e?e="function"==typeof e.toString?e.toString():"[object Object]":(null==e||isNaN(e)&&!e.length)&&(e=""),String(e)}function g(){var e=0$/i,$=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,_=/^[a-z\d]+$/,F=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,S=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,R=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;var s=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,u=/^[0-9A-F]{1,4}$/i;function c(e){var t=1n)return!1;if("::"===e)return!0;"::"===e.substr(0,2)?(r.shift(),r.shift(),o=!0):"::"===e.substr(e.length-2)&&(r.pop(),r.pop(),o=!0);for(var a=0;a=t.min,i=!t.hasOwnProperty("max")||e<=t.max,n=!t.hasOwnProperty("lt")||et.gt;return r.test(e)&&o&&i&&n&&a}var b=/^[\x00-\x7F]+$/;var P=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;var k=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;var K=/[^\x00-\x7F]/;var H=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;var z={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},V=["","-","+"];var W=/^[0-9A-F]+$/i;function Y(e){return p(e),W.test(e)}var j=/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;var J=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;var q=/^[a-f0-9]{32}$/;var Q={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};var X={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};var ee=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;var te=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;var re=/^(?:[0-9]{9}X|[0-9]{10})$/,oe=/^(?:[0-9]{13})$/,ie=[1,3];var ne={"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-EG":/^((\+?20)|0)?1[012]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^(\+?49[ \.\-]?)?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,"el-GR":/^(\+?30|0)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-HK":/^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-KE":/^(\+?254|0)?[7]\d{8}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)2\d{7,9}$/,"en-PK":/^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[89]\d{7}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"es-ES":/^(\+?34)?(6\d{1}|7[1234])\d{7}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}/,"hu-HU":/^(\+?36)(20|30|70)\d{7}$/,"id-ID":/^(\+?62|0[1-9])[\s|\d]+$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"ja-JP":/^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"ms-MY":/^(\+?6?01){1}(([145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nl-BE":/^(\+?32|0)4?\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"vi-VN":/^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,"zh-CN":/^(\+?0?86\-?)?1[3456789]\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/};ne["en-CA"]=ne["en-US"],ne["fr-BE"]=ne["nl-BE"],ne["zh-HK"]=ne["en-HK"];var ae={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};var le=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;var se=/([01][0-9]|2[0-3])/,ue=/[0-5][0-9]/,de=new RegExp("[-+]"+se.source+":"+ue.source),ce=new RegExp("([zZ]|"+de.source+")"),fe=new RegExp(se.source+":"+ue.source+":"+/([0-5][0-9]|60)/.source+/(\.[0-9]+)?/.source),pe=new RegExp(/[0-9]{4}/.source+"-"+/(0[1-9]|1[0-2])/.source+"-"+/([12]\d|0[1-9]|3[01])/.source),ge=new RegExp(""+fe.source+ce.source),Ae=new RegExp(pe.source+"[ tT]"+ge.source);var he=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];var ve=["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"];var me=/[^A-Z0-9+\/=]/i;var $e=/^[a-z]+\/[a-z0-9\-\+]+$/i,_e=/^[a-z\-]+=[a-z0-9\-]+$/i,Fe=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;var Se=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i,Re=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,Ee=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;var xe=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,Ce=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,Me=/^\d{4}$/,Ne=/^\d{5}$/,we=/^\d{6}$/,Te={AT:Me,AU:Me,BE:Me,BG:Me,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:Me,CZ:/^\d{3}\s?\d{2}$/,DE:Ne,DK:Me,DZ:Ne,EE:Ne,ES:Ne,FI:Ne,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HU:Me,IL:Ne,IN:we,IS:/^\d{3}$/,IT:Ne,JP:/^\d{3}\-\d{4}$/,KE:Ne,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:Me,LV:/^LV\-\d{4}$/,MX:Ne,NL:/^\d{4}\s?[a-z]{2}$/i,NO:Me,PL:/^\d{2}\-\d{3}$/,PT:/^\d{4}\-\d{3}?$/,RO:we,RU:we,SA:Ne,SE:/^\d{3}\s?\d{2}$/,SI:Me,SK:/^\d{3}\s?\d{2}$/,TN:Me,TW:/^\d{3}(\d{2})?$/,US:/^\d{5}(-\d{4})?$/,ZA:Me,ZM:Ne},Le=Object.keys(Te);function Ze(e,t){p(e);var r=t?new RegExp("^["+t+"]+","g"):/^\s+/g;return e.replace(r,"")}function Be(e,t){p(e);for(var r=t?new RegExp("["+t+"]"):/\s/,o=e.length-1;0<=o&&r.test(e[o]);o--);return o]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;t=g(t,f);var r=void 0,o=void 0,i=void 0,n=void 0,a=void 0,l=void 0,s=void 0,u=void 0;if(1<(s=(e=(s=(e=(s=e.split("#")).shift()).split("?")).shift()).split("://")).length){if(r=s.shift(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else{if(t.require_protocol)return!1;t.allow_protocol_relative_urls&&"//"===e.substr(0,2)&&(s[0]=e.substr(2))}if(""===(e=s.join("://")))return!1;if(""===(e=(s=e.split("/")).shift())&&!t.require_host)return!0;if(1<(s=e.split("@")).length&&0<=(o=s.shift()).indexOf(":")&&2=t.min)&&(!t.hasOwnProperty("max")||o<=t.max)&&(!t.hasOwnProperty("lt")||ot.gt)},isDecimal:function(e,t){if(p(e),(t=g(t,z)).locale in C)return!V.includes(e.replace(/ /g,""))&&(r=t,new RegExp("^[-+]?([0-9]+)?(\\"+C[r.locale]+"[0-9]{"+r.decimal_digits+"})"+(r.force_decimal?"":"?")+"$")).test(e);var r;throw new Error("Invalid locale '"+t.locale+"'")},isHexadecimal:Y,isDivisibleBy:function(e,t){return p(e),r(e)%parseInt(t,10)==0},isHexColor:function(e){return p(e),j.test(e)},isISRC:function(e){return p(e),J.test(e)},isMD5:function(e){return p(e),q.test(e)},isHash:function(e,t){return p(e),new RegExp("^[a-f0-9]{"+Q[t]+"}$").test(e)},isJSON:function(e){p(e);try{var t=JSON.parse(e);return!!t&&"object"===(void 0===t?"undefined":a(t))}catch(e){}return!1},isEmpty:function(e){return p(e),0===e.length},isLength:function(e,t){p(e);var r=void 0,o=void 0;"object"===(void 0===t?"undefined":a(t))?(r=t.min||0,o=t.max):(r=t,o=arguments[2]);var i=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],n=e.length-i.length;return r<=n&&(void 0===o||n<=o)},isByteLength:A,isUUID:function(e){var t=1/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")},unescape:function(e){return p(e),e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`")},stripLow:function(e,t){return p(e),Ie(e,t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F")},whitelist:function(e,t){return p(e),e.replace(new RegExp("[^"+t+"]+","g"),"")},blacklist:Ie,isWhitelisted:function(e,t){p(e);for(var r=e.length-1;0<=r;r--)if(-1===t.indexOf(e[r]))return!1;return!0},normalizeEmail:function(e,t){t=g(t,Ge);var r=e.split("@"),o=r.pop(),i=[r.join("@"),o];if(i[1]=i[1].toLowerCase(),"gmail.com"===i[1]||"googlemail.com"===i[1]){if(t.gmail_remove_subaddress&&(i[0]=i[0].split("+")[0]),t.gmail_remove_dots&&(i[0]=i[0].replace(/\.+/g,be)),!i[0].length)return!1;(t.all_lowercase||t.gmail_lowercase)&&(i[0]=i[0].toLowerCase()),i[1]=t.gmail_convert_googlemaildotcom?"gmail.com":i[1]}else if(0<=De.indexOf(i[1])){if(t.icloud_remove_subaddress&&(i[0]=i[0].split("+")[0]),!i[0].length)return!1;(t.all_lowercase||t.icloud_lowercase)&&(i[0]=i[0].toLowerCase())}else if(0<=Oe.indexOf(i[1])){if(t.outlookdotcom_remove_subaddress&&(i[0]=i[0].split("+")[0]),!i[0].length)return!1;(t.all_lowercase||t.outlookdotcom_lowercase)&&(i[0]=i[0].toLowerCase())}else if(0<=ye.indexOf(i[1])){if(t.yahoo_remove_subaddress){var n=i[0].split("-");i[0]=1$/i,$=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,_=/^[a-z\d]+$/,F=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,S=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,R=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;var u=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,d=/^[0-9A-F]{1,4}$/i;function c(e){var t=1n)return!1;if("::"===e)return!0;"::"===e.substr(0,2)?(r.shift(),r.shift(),i=!0):"::"===e.substr(e.length-2)&&(r.pop(),r.pop(),i=!0);for(var a=0;a=t.min,o=!t.hasOwnProperty("max")||e<=t.max,n=!t.hasOwnProperty("lt")||et.gt;return r.test(e)&&i&&o&&n&&a}var k=/^[\x00-\x7F]+$/;var K=/[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;var H=/[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/;var z=/[^\x00-\x7F]/;var V=/[\uD800-\uDBFF][\uDC00-\uDFFF]/;var W={force_decimal:!1,decimal_digits:"1,",locale:"en-US"},Y=["","-","+"];var j=/^[0-9A-F]+$/i;function J(e){return p(e),j.test(e)}var q=/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i;var Q=/^[A-Z]{2}[0-9A-Z]{3}\d{2}\d{5}$/;var X=/^[a-f0-9]{32}$/;var ee={md5:32,md4:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8};var te={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i};var re=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;var ie=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/;var oe=/^(?:[0-9]{9}X|[0-9]{10})$/,ne=/^(?:[0-9]{13})$/,ae=[1,3];var le={"ar-AE":/^((\+?971)|0)?5[024568]\d{7}$/,"ar-DZ":/^(\+?213|0)(5|6|7)\d{8}$/,"ar-EG":/^((\+?20)|0)?1[012]\d{8}$/,"ar-JO":/^(\+?962|0)?7[789]\d{7}$/,"ar-SA":/^(!?(\+?966)|0)?5\d{8}$/,"ar-SY":/^(!?(\+?963)|0)?9\d{8}$/,"ar-TN":/^(\+?216)?[2459]\d{7}$/,"be-BY":/^(\+?375)?(24|25|29|33|44)\d{7}$/,"bg-BG":/^(\+?359|0)?8[789]\d{7}$/,"cs-CZ":/^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"da-DK":/^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,"de-DE":/^(\+?49[ \.\-]?)?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/,"el-GR":/^(\+?30|0)?(69\d{8})$/,"en-AU":/^(\+?61|0)4\d{8}$/,"en-GB":/^(\+?44|0)7\d{9}$/,"en-HK":/^(\+?852\-?)?[456789]\d{3}\-?\d{4}$/,"en-IN":/^(\+?91|0)?[6789]\d{9}$/,"en-KE":/^(\+?254|0)?[7]\d{8}$/,"en-NG":/^(\+?234|0)?[789]\d{9}$/,"en-NZ":/^(\+?64|0)2\d{7,9}$/,"en-PK":/^((\+92)|(0092))-{0,1}\d{3}-{0,1}\d{7}$|^\d{11}$|^\d{4}-\d{7}$/,"en-RW":/^(\+?250|0)?[7]\d{8}$/,"en-SG":/^(\+65)?[89]\d{7}$/,"en-TZ":/^(\+?255|0)?[67]\d{8}$/,"en-UG":/^(\+?256|0)?[7]\d{8}$/,"en-US":/^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/,"en-ZA":/^(\+?27|0)\d{9}$/,"en-ZM":/^(\+?26)?09[567]\d{7}$/,"es-ES":/^(\+?34)?(6\d{1}|7[1234])\d{7}$/,"et-EE":/^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,"fa-IR":/^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,"fi-FI":/^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,"fo-FO":/^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"fr-FR":/^(\+?33|0)[67]\d{8}$/,"he-IL":/^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}/,"hu-HU":/^(\+?36)(20|30|70)\d{7}$/,"id-ID":/^(\+?62|0[1-9])[\s|\d]+$/,"it-IT":/^(\+?39)?\s?3\d{2} ?\d{6,7}$/,"ja-JP":/^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,"kk-KZ":/^(\+?7|8)?7\d{9}$/,"kl-GL":/^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,"ko-KR":/^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,"lt-LT":/^(\+370|8)\d{8}$/,"ms-MY":/^(\+?6?01){1}(([145]{1}(\-|\s)?\d{7,8})|([236789]{1}(\s|\-)?\d{7}))$/,"nb-NO":/^(\+?47)?[49]\d{7}$/,"nl-BE":/^(\+?32|0)4?\d{8}$/,"nn-NO":/^(\+?47)?[49]\d{7}$/,"pl-PL":/^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,"pt-BR":/^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/,"pt-PT":/^(\+?351)?9[1236]\d{7}$/,"ro-RO":/^(\+?4?0)\s?7\d{2}(\/|\s|\.|\-)?\d{3}(\s|\.|\-)?\d{3}$/,"ru-RU":/^(\+?7|8)?9\d{9}$/,"sk-SK":/^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,"sr-RS":/^(\+3816|06)[- \d]{5,9}$/,"sv-SE":/^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,"th-TH":/^(\+66|66|0)\d{9}$/,"tr-TR":/^(\+?90|0)?5\d{9}$/,"uk-UA":/^(\+?38|8)?0\d{9}$/,"vi-VN":/^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,"zh-CN":/^(\+?0?86\-?)?1[3456789]\d{9}$/,"zh-TW":/^(\+?886\-?|0)?9\d{8}$/};le["en-CA"]=le["en-US"],le["fr-BE"]=le["nl-BE"],le["zh-HK"]=le["en-HK"];var se={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_decimal:!0,require_decimal:!1,digits_after_decimal:[2],allow_space_after_digits:!1};var ue=/^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;var de=/([01][0-9]|2[0-3])/,ce=/[0-5][0-9]/,fe=new RegExp("[-+]"+de.source+":"+ce.source),pe=new RegExp("([zZ]|"+fe.source+")"),ge=new RegExp(de.source+":"+ce.source+":"+/([0-5][0-9]|60)/.source+/(\.[0-9]+)?/.source),Ae=new RegExp(/[0-9]{4}/.source+"-"+/(0[1-9]|1[0-2])/.source+"-"+/([12]\d|0[1-9]|3[01])/.source),he=new RegExp(""+ge.source+pe.source),ve=new RegExp(Ae.source+"[ tT]"+he.source);var me=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];var $e=["AFG","ALA","ALB","DZA","ASM","AND","AGO","AIA","ATA","ATG","ARG","ARM","ABW","AUS","AUT","AZE","BHS","BHR","BGD","BRB","BLR","BEL","BLZ","BEN","BMU","BTN","BOL","BES","BIH","BWA","BVT","BRA","IOT","BRN","BGR","BFA","BDI","KHM","CMR","CAN","CPV","CYM","CAF","TCD","CHL","CHN","CXR","CCK","COL","COM","COG","COD","COK","CRI","CIV","HRV","CUB","CUW","CYP","CZE","DNK","DJI","DMA","DOM","ECU","EGY","SLV","GNQ","ERI","EST","ETH","FLK","FRO","FJI","FIN","FRA","GUF","PYF","ATF","GAB","GMB","GEO","DEU","GHA","GIB","GRC","GRL","GRD","GLP","GUM","GTM","GGY","GIN","GNB","GUY","HTI","HMD","VAT","HND","HKG","HUN","ISL","IND","IDN","IRN","IRQ","IRL","IMN","ISR","ITA","JAM","JPN","JEY","JOR","KAZ","KEN","KIR","PRK","KOR","KWT","KGZ","LAO","LVA","LBN","LSO","LBR","LBY","LIE","LTU","LUX","MAC","MKD","MDG","MWI","MYS","MDV","MLI","MLT","MHL","MTQ","MRT","MUS","MYT","MEX","FSM","MDA","MCO","MNG","MNE","MSR","MAR","MOZ","MMR","NAM","NRU","NPL","NLD","NCL","NZL","NIC","NER","NGA","NIU","NFK","MNP","NOR","OMN","PAK","PLW","PSE","PAN","PNG","PRY","PER","PHL","PCN","POL","PRT","PRI","QAT","REU","ROU","RUS","RWA","BLM","SHN","KNA","LCA","MAF","SPM","VCT","WSM","SMR","STP","SAU","SEN","SRB","SYC","SLE","SGP","SXM","SVK","SVN","SLB","SOM","ZAF","SGS","SSD","ESP","LKA","SDN","SUR","SJM","SWZ","SWE","CHE","SYR","TWN","TJK","TZA","THA","TLS","TGO","TKL","TON","TTO","TUN","TUR","TKM","TCA","TUV","UGA","UKR","ARE","GBR","USA","UMI","URY","UZB","VUT","VEN","VNM","VGB","VIR","WLF","ESH","YEM","ZMB","ZWE"];var _e=/[^A-Z0-9+\/=]/i;var Fe=/^[a-z]+\/[a-z0-9\-\+]+$/i,Se=/^[a-z\-]+=[a-z0-9\-]+$/i,Re=/^[a-z0-9!\$&'\(\)\*\+,;=\-\._~:@\/\?%\s]*$/i;var Ee=/^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+]{1,100}$/i,xe=/^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i,Ce=/^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i;var Me=/^\(?[+-]?(90(\.0+)?|[1-8]?\d(\.\d+)?)$/,Ne=/^\s?[+-]?(180(\.0+)?|1[0-7]\d(\.\d+)?|\d{1,2}(\.\d+)?)\)?$/,we=/^\d{4}$/,Te=/^\d{5}$/,Le=/^\d{6}$/,Ie={AT:we,AU:we,BE:we,BG:we,CA:/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][\s\-]?\d[ABCEGHJ-NPRSTV-Z]\d$/i,CH:we,CZ:/^\d{3}\s?\d{2}$/,DE:Te,DK:we,DZ:Te,EE:Te,ES:Te,FI:Te,FR:/^\d{2}\s?\d{3}$/,GB:/^(gir\s?0aa|[a-z]{1,2}\d[\da-z]?\s?(\d[a-z]{2})?)$/i,GR:/^\d{3}\s?\d{2}$/,HR:/^([1-5]\d{4}$)/,HU:we,IL:Te,IN:Le,IS:/^\d{3}$/,IT:Te,JP:/^\d{3}\-\d{4}$/,KE:Te,LI:/^(948[5-9]|949[0-7])$/,LT:/^LT\-\d{5}$/,LU:we,LV:/^LV\-\d{4}$/,MX:Te,NL:/^\d{4}\s?[a-z]{2}$/i,NO:we,PL:/^\d{2}\-\d{3}$/,PT:/^\d{4}\-\d{3}?$/,RO:Le,RU:Le,SA:Te,SE:/^\d{3}\s?\d{2}$/,SI:we,SK:/^\d{3}\s?\d{2}$/,TN:we,TW:/^\d{3}(\d{2})?$/,US:/^\d{5}(-\d{4})?$/,ZA:we,ZM:Te},ye=Object.keys(Ie);function Ze(e,t){p(e);var r=t?new RegExp("^["+t+"]+","g"):/^\s+/g;return e.replace(r,"")}function Be(e,t){p(e);for(var r=t?new RegExp("["+t+"]"):/\s/,i=e.length-1;0<=i&&r.test(e[i]);i--);return i]/.test(e))return!1;if(0===e.indexOf("mailto:"))return!1;t=g(t,f);var r=void 0,i=void 0,o=void 0,n=void 0,a=void 0,l=void 0,s=void 0,u=void 0;if(1<(s=(e=(s=(e=(s=e.split("#")).shift()).split("?")).shift()).split("://")).length){if(r=s.shift(),t.require_valid_protocol&&-1===t.protocols.indexOf(r))return!1}else{if(t.require_protocol)return!1;t.allow_protocol_relative_urls&&"//"===e.substr(0,2)&&(s[0]=e.substr(2))}if(""===(e=s.join("://")))return!1;if(""===(e=(s=e.split("/")).shift())&&!t.require_host)return!0;if(1<(s=e.split("@")).length&&0<=(i=s.shift()).indexOf(":")&&2=t.min)&&(!t.hasOwnProperty("max")||i<=t.max)&&(!t.hasOwnProperty("lt")||it.gt)},isDecimal:function(e,t){if(p(e),(t=g(t,W)).locale in N)return!Y.includes(e.replace(/ /g,""))&&(r=t,new RegExp("^[-+]?([0-9]+)?(\\"+N[r.locale]+"[0-9]{"+r.decimal_digits+"})"+(r.force_decimal?"":"?")+"$")).test(e);var r;throw new Error("Invalid locale '"+t.locale+"'")},isHexadecimal:J,isDivisibleBy:function(e,t){return p(e),r(e)%parseInt(t,10)==0},isHexColor:function(e){return p(e),q.test(e)},isISRC:function(e){return p(e),Q.test(e)},isMD5:function(e){return p(e),X.test(e)},isHash:function(e,t){return p(e),new RegExp("^[a-f0-9]{"+ee[t]+"}$").test(e)},isJSON:function(e){p(e);try{var t=JSON.parse(e);return!!t&&"object"===(void 0===t?"undefined":a(t))}catch(e){}return!1},isEmpty:function(e){return p(e),0===e.length},isLength:function(e,t){p(e);var r=void 0,i=void 0;"object"===(void 0===t?"undefined":a(t))?(r=t.min||0,i=t.max):(r=t,i=arguments[2]);var o=e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],n=e.length-o.length;return r<=n&&(void 0===i||n<=i)},isByteLength:A,isUUID:function(e){var t=1/g,">").replace(/\//g,"/").replace(/\\/g,"\").replace(/`/g,"`")},unescape:function(e){return p(e),e.replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(///g,"/").replace(/\/g,"\\").replace(/`/g,"`")},stripLow:function(e,t){return p(e),Ge(e,t?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F")},whitelist:function(e,t){return p(e),e.replace(new RegExp("[^"+t+"]+","g"),"")},blacklist:Ge,isWhitelisted:function(e,t){p(e);for(var r=e.length-1;0<=r;r--)if(-1===t.indexOf(e[r]))return!1;return!0},normalizeEmail:function(e,t){t=g(t,Oe);var r=e.split("@"),i=r.pop(),o=[r.join("@"),i];if(o[1]=o[1].toLowerCase(),"gmail.com"===o[1]||"googlemail.com"===o[1]){if(t.gmail_remove_subaddress&&(o[0]=o[0].split("+")[0]),t.gmail_remove_dots&&(o[0]=o[0].replace(/\.+/g,ke)),!o[0].length)return!1;(t.all_lowercase||t.gmail_lowercase)&&(o[0]=o[0].toLowerCase()),o[1]=t.gmail_convert_googlemaildotcom?"gmail.com":o[1]}else if(0<=De.indexOf(o[1])){if(t.icloud_remove_subaddress&&(o[0]=o[0].split("+")[0]),!o[0].length)return!1;(t.all_lowercase||t.icloud_lowercase)&&(o[0]=o[0].toLowerCase())}else if(0<=be.indexOf(o[1])){if(t.outlookdotcom_remove_subaddress&&(o[0]=o[0].split("+")[0]),!o[0].length)return!1;(t.all_lowercase||t.outlookdotcom_lowercase)&&(o[0]=o[0].toLowerCase())}else if(0<=Ue.indexOf(o[1])){if(t.yahoo_remove_subaddress){var n=o[0].split("-");o[0]=1