intl-tel-input 27.3.1 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/css/intlTelInput-no-assets.css +2 -2
  2. package/dist/css/intlTelInput.css +3 -3
  3. package/dist/js/data.js +2 -2
  4. package/dist/js/data.min.js +1 -1
  5. package/dist/js/data.mjs +1 -1
  6. package/dist/js/i18n.d.ts +1 -1592
  7. package/dist/js/intlTelInput.d.ts +61 -45
  8. package/dist/js/intlTelInput.js +109 -104
  9. package/dist/js/intlTelInput.min.js +6 -6
  10. package/dist/js/intlTelInput.mjs +107 -102
  11. package/dist/js/intlTelInputWithUtils.js +510 -490
  12. package/dist/js/intlTelInputWithUtils.min.js +9 -9
  13. package/dist/js/intlTelInputWithUtils.mjs +508 -488
  14. package/dist/js/utils.js +56 -55
  15. package/package.json +14 -181
  16. package/CHANGELOG.md +0 -33
  17. package/angular/README.md +0 -13
  18. package/angular/dist/IntlTelInput.d.ts +0 -110
  19. package/angular/dist/IntlTelInput.js +0 -5130
  20. package/angular/dist/IntlTelInputWithUtils.d.ts +0 -3
  21. package/angular/dist/IntlTelInputWithUtils.js +0 -11469
  22. package/react/README.md +0 -13
  23. package/react/dist/IntlTelInput.d.ts +0 -25
  24. package/react/dist/IntlTelInput.js +0 -4822
  25. package/react/dist/IntlTelInputWithUtils.d.ts +0 -4
  26. package/react/dist/IntlTelInputWithUtils.js +0 -11161
  27. package/svelte/README.md +0 -14
  28. package/svelte/src/IntlTelInput.svelte +0 -233
  29. package/svelte/src/IntlTelInput.svelte.d.ts +0 -36
  30. package/svelte/src/IntlTelInputWithUtils.svelte +0 -24
  31. package/vue/README.md +0 -14
  32. package/vue/dist/IntlTelInput-DWpqqgvZ.js +0 -2684
  33. package/vue/dist/IntlTelInput.js +0 -5
  34. package/vue/dist/IntlTelInput.vue.d.ts +0 -43
  35. package/vue/dist/IntlTelInputWithUtils.js +0 -49403
  36. package/vue/dist/index.d.ts +0 -4
  37. package/vue/dist/indexWithUtils.d.ts +0 -3
@@ -1,4 +1,4 @@
1
- // src/js/data.ts
1
+ // packages/core/src/js/data.ts
2
2
  var rawCountryData = [
3
3
  [
4
4
  "af",
@@ -1750,7 +1750,7 @@ var iso2Set = new Set(allCountries.map((c) => c.iso2));
1750
1750
  var isIso2 = (val) => iso2Set.has(val);
1751
1751
  var data_default = allCountries;
1752
1752
 
1753
- // src/js/constants.ts
1753
+ // packages/core/src/js/constants.ts
1754
1754
  var EVENTS = {
1755
1755
  OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
1756
1756
  CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
@@ -1796,10 +1796,6 @@ var TIMINGS = {
1796
1796
  HIDDEN_SEARCH_RESET_MS: 1e3,
1797
1797
  NEXT_TICK: 0
1798
1798
  };
1799
- var SENTINELS = {
1800
- UNKNOWN_NUMBER_TYPE: -99,
1801
- UNKNOWN_VALIDATION_ERROR: -99
1802
- };
1803
1799
  var LAYOUT = {
1804
1800
  NARROW_VIEWPORT_WIDTH: 500,
1805
1801
  // keep in sync with .iti__country-list CSS media query
@@ -1841,6 +1837,12 @@ var PLACEHOLDER_MODES = {
1841
1837
  var INITIAL_COUNTRY = {
1842
1838
  AUTO: "auto"
1843
1839
  };
1840
+ var NUMBER_FORMATS = [
1841
+ "E164",
1842
+ "INTERNATIONAL",
1843
+ "NATIONAL",
1844
+ "RFC3966"
1845
+ ];
1844
1846
  var NUMBER_TYPES = [
1845
1847
  "FIXED_LINE",
1846
1848
  "MOBILE",
@@ -1855,11 +1857,21 @@ var NUMBER_TYPES = [
1855
1857
  "VOICEMAIL",
1856
1858
  "UNKNOWN"
1857
1859
  ];
1858
- var NUMBER_TYPE_SET = new Set(NUMBER_TYPES);
1860
+ var VALIDATION_ERRORS = [
1861
+ "IS_POSSIBLE",
1862
+ "INVALID_COUNTRY_CODE",
1863
+ "TOO_SHORT",
1864
+ "TOO_LONG",
1865
+ "IS_POSSIBLE_LOCAL_ONLY",
1866
+ "INVALID_LENGTH"
1867
+ ];
1868
+ var toEnumObject = (arr) => Object.fromEntries(arr.map((v) => [v, v]));
1869
+ var NUMBER_FORMAT = toEnumObject(NUMBER_FORMATS);
1870
+ var NUMBER_TYPE = toEnumObject(NUMBER_TYPES);
1871
+ var VALIDATION_ERROR = toEnumObject(VALIDATION_ERRORS);
1859
1872
  var DATA_KEYS = {
1860
- // e.g. <li data-country-code="us"> for country items in dropdown
1861
- // in the future, the value should be changed to "iso2", but this is a breaking change for another day
1862
- ISO2: "countryCode",
1873
+ // e.g. <li data-iso2="us"> for country items in dropdown
1874
+ ISO2: "iso2",
1863
1875
  DIAL_CODE: "dialCode",
1864
1876
  // e.g. <input data-intl-tel-input-id="0"> on the input element
1865
1877
  INSTANCE_ID: "intlTelInputId"
@@ -1876,7 +1888,7 @@ var ARIA = {
1876
1888
  MODAL: "aria-modal"
1877
1889
  };
1878
1890
 
1879
- // src/js/i18n/en.ts
1891
+ // packages/core/src/js/i18n/en.ts
1880
1892
  var interfaceTranslations = {
1881
1893
  selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
1882
1894
  noCountrySelected: "Select country for phone number",
@@ -1896,7 +1908,7 @@ var interfaceTranslations = {
1896
1908
  };
1897
1909
  var en_default = interfaceTranslations;
1898
1910
 
1899
- // src/js/core/options.ts
1911
+ // packages/core/src/js/core/options.ts
1900
1912
  var mediaQuery = (q) => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
1901
1913
  var isNarrowViewport = () => mediaQuery(`(max-width: ${LAYOUT.NARROW_VIEWPORT_WIDTH}px)`);
1902
1914
  var computeDefaultUseFullscreenPopup = () => {
@@ -1911,7 +1923,7 @@ var defaults = {
1911
1923
  //* Whether or not to allow the dropdown.
1912
1924
  allowDropdown: true,
1913
1925
  //* The number type to enforce during validation.
1914
- allowedNumberTypes: ["MOBILE", "FIXED_LINE"],
1926
+ allowedNumberTypes: [NUMBER_TYPE.MOBILE, NUMBER_TYPE.FIXED_LINE],
1915
1927
  //* Whether or not to allow extensions after the main number.
1916
1928
  allowNumberExtensions: false,
1917
1929
  // Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
@@ -1922,6 +1934,8 @@ var defaults = {
1922
1934
  containerClass: "",
1923
1935
  //* Locale for localising country names via Intl.DisplayNames.
1924
1936
  countryNameLocale: "en",
1937
+ //* Override individual country names by iso2 code.
1938
+ countryNameOverrides: {},
1925
1939
  //* The order of the countries in the dropdown. Defaults to alphabetical.
1926
1940
  countryOrder: null,
1927
1941
  //* Add a country search input at the top of the dropdown.
@@ -1955,17 +1969,17 @@ var defaults = {
1955
1969
  //* Display only these countries.
1956
1970
  onlyCountries: null,
1957
1971
  //* Number type to use for placeholders.
1958
- placeholderNumberType: "MOBILE",
1972
+ placeholderNumberType: NUMBER_TYPE.MOBILE,
1959
1973
  //* Add custom classes to the search input element.
1960
1974
  searchInputClass: "",
1961
1975
  //* Display the international dial code next to the selected flag.
1962
- separateDialCode: false,
1976
+ separateDialCode: true,
1963
1977
  //* When strictMode rejects a key (etc), play a short feedback animation
1964
- strictRejectAnimation: false,
1978
+ strictRejectAnimation: true,
1965
1979
  //* Show flags - for both the selected country, and in the country dropdown
1966
1980
  showFlags: true,
1967
1981
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1968
- strictMode: false,
1982
+ strictMode: true,
1969
1983
  //* Use full screen popup instead of dropdown for country list.
1970
1984
  useFullscreenPopup: computeDefaultUseFullscreenPopup()
1971
1985
  };
@@ -2109,6 +2123,13 @@ var validateOptions = (customOptions) => {
2109
2123
  }
2110
2124
  validatedOptions[key] = value;
2111
2125
  break;
2126
+ case "countryNameOverrides":
2127
+ if (value && !isPlainObject(value)) {
2128
+ warnOption("countryNameOverrides", "an object", value);
2129
+ break;
2130
+ }
2131
+ validatedOptions[key] = value;
2132
+ break;
2112
2133
  case "initialCountry": {
2113
2134
  if (typeof value !== "string") {
2114
2135
  warnOption("initialCountry", "a string", value);
@@ -2127,8 +2148,8 @@ var validateOptions = (customOptions) => {
2127
2148
  break;
2128
2149
  }
2129
2150
  case "placeholderNumberType":
2130
- if (typeof value !== "string" || !NUMBER_TYPE_SET.has(value)) {
2131
- const validTypes = Array.from(NUMBER_TYPE_SET).join(", ");
2151
+ if (typeof value !== "string" || !NUMBER_TYPES.includes(value)) {
2152
+ const validTypes = NUMBER_TYPES.join(", ");
2132
2153
  warnOption("placeholderNumberType", `one of ${validTypes}`, value);
2133
2154
  break;
2134
2155
  }
@@ -2146,8 +2167,8 @@ var validateOptions = (customOptions) => {
2146
2167
  }
2147
2168
  let allValid = true;
2148
2169
  for (const v of value) {
2149
- if (typeof v !== "string" || !NUMBER_TYPE_SET.has(v)) {
2150
- const validTypes = Array.from(NUMBER_TYPE_SET).join(", ");
2170
+ if (typeof v !== "string" || !NUMBER_TYPES.includes(v)) {
2171
+ const validTypes = NUMBER_TYPES.join(", ");
2151
2172
  warnOption(
2152
2173
  "allowedNumberTypes",
2153
2174
  `an array of valid number types (${validTypes})`,
@@ -2209,11 +2230,11 @@ var applyOptionSideEffects = (o) => {
2209
2230
  o.i18n = { ...en_default, ...o.i18n };
2210
2231
  };
2211
2232
 
2212
- // src/js/helpers/string.ts
2233
+ // packages/core/src/js/helpers/string.ts
2213
2234
  var getNumeric = (s) => s.replace(/\D/g, "");
2214
2235
  var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
2215
2236
 
2216
- // src/js/helpers/dom.ts
2237
+ // packages/core/src/js/helpers/dom.ts
2217
2238
  var buildClassNames = (flags) => Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
2218
2239
  var createEl = (tagName, attrs, container) => {
2219
2240
  const el = document.createElement(tagName);
@@ -2228,7 +2249,7 @@ var createEl = (tagName, attrs, container) => {
2228
2249
  return el;
2229
2250
  };
2230
2251
 
2231
- // src/js/core/icons.ts
2252
+ // packages/core/src/js/core/icons.ts
2232
2253
  var buildSearchIcon = () => `
2233
2254
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
2234
2255
  <circle cx="11" cy="11" r="7" />
@@ -2255,7 +2276,7 @@ var buildGlobeIcon = () => `
2255
2276
  <path d="m261 428-2-2-22-21a40 40 0 0 0-32-11h-1a37 37 0 0 0-18 8l-1 1-4 2-2 2-5 4c-9-3-36-31-47-44s-32-45-34-55l3-2a151 151 0 0 0 11-9v-1a39 39 0 0 0 5-48l-3-3-11-19-3-4-5-7h-1l-3-3-4-3-5-2a35 35 0 0 0-16-3h-5c-4 1-14 5-24 11l-4 2-4 3-4 2c-9 8-17 17-18 27a380 380 0 0 0 212 259h3c12 0 25-10 36-21l10-12 6-11a39 39 0 0 0-8-40"/>
2256
2277
  </svg>`;
2257
2278
 
2258
- // src/js/core/countrySearch.ts
2279
+ // packages/core/src/js/core/countrySearch.ts
2259
2280
  var buildSearchTokens = (countries) => {
2260
2281
  const tokens = /* @__PURE__ */ new Map();
2261
2282
  for (const c of countries) {
@@ -2315,7 +2336,7 @@ var findFirstCountryStartingWith = (countries, searchTokens, query) => {
2315
2336
  return null;
2316
2337
  };
2317
2338
 
2318
- // src/js/core/numerals.ts
2339
+ // packages/core/src/js/core/numerals.ts
2319
2340
  var Numerals = class _Numerals {
2320
2341
  #userNumeralSet;
2321
2342
  //* Stateless conversion of any Arabic-Indic / Persian digits to ASCII 0-9.
@@ -2373,7 +2394,7 @@ var Numerals = class _Numerals {
2373
2394
  }
2374
2395
  };
2375
2396
 
2376
- // src/js/core/ui.ts
2397
+ // packages/core/src/js/core/ui.ts
2377
2398
  var UI = class _UI {
2378
2399
  // private
2379
2400
  #options;
@@ -3126,7 +3147,7 @@ var UI = class _UI {
3126
3147
  }
3127
3148
  if (iso2 && !this.#selectedListItemEl) {
3128
3149
  const newListItem = this.#countryListEl.querySelector(
3129
- `[data-country-code="${iso2}"]`
3150
+ `[data-iso2="${iso2}"]`
3130
3151
  );
3131
3152
  if (newListItem) {
3132
3153
  newListItem.setAttribute(ARIA.SELECTED, "true");
@@ -3314,7 +3335,7 @@ var UI = class _UI {
3314
3335
  }
3315
3336
  };
3316
3337
 
3317
- // src/js/data/country-data.ts
3338
+ // packages/core/src/js/data/country-data.ts
3318
3339
  var processAllCountries = (options) => {
3319
3340
  const { onlyCountries, excludeCountries } = options;
3320
3341
  if (onlyCountries?.length) {
@@ -3329,7 +3350,7 @@ var processAllCountries = (options) => {
3329
3350
  return [...data_default];
3330
3351
  };
3331
3352
  var generateCountryNames = (countries, options) => {
3332
- const { countryNameLocale, i18n } = options;
3353
+ const { countryNameLocale, countryNameOverrides } = options;
3333
3354
  let displayNames;
3334
3355
  try {
3335
3356
  const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
@@ -3345,7 +3366,7 @@ var generateCountryNames = (countries, options) => {
3345
3366
  displayNames = null;
3346
3367
  }
3347
3368
  for (const c of countries) {
3348
- c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
3369
+ c.name = countryNameOverrides[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
3349
3370
  }
3350
3371
  };
3351
3372
  var processDialCodes = (countries) => {
@@ -3414,7 +3435,7 @@ var sortCountries = (countries, options) => {
3414
3435
  });
3415
3436
  };
3416
3437
 
3417
- // src/js/data/intl-regionless.ts
3438
+ // packages/core/src/js/data/intl-regionless.ts
3418
3439
  var regionlessDialCodes = /* @__PURE__ */ new Set([
3419
3440
  "800",
3420
3441
  "808",
@@ -3430,7 +3451,7 @@ var hasRegionlessDialCode = (number) => {
3430
3451
  return number.startsWith("+") && regionlessDialCodes.has(dialCode);
3431
3452
  };
3432
3453
 
3433
- // src/js/format/formatting.ts
3454
+ // packages/core/src/js/format/formatting.ts
3434
3455
  var stripSeparateDialCode = (fullNumber, hasValidDialCode, separateDialCode, selectedCountryData) => {
3435
3456
  if (!separateDialCode || !hasValidDialCode) {
3436
3457
  return fullNumber;
@@ -3449,7 +3470,7 @@ var formatNumberAsYouType = (fullNumber, telInputValue, utils, selectedCountryDa
3449
3470
  return result;
3450
3471
  };
3451
3472
 
3452
- // src/js/format/caret.ts
3473
+ // packages/core/src/js/format/caret.ts
3453
3474
  var computeNewCaretPosition = (relevantChars, formattedValue, prevCaretPos, isDeleteForwards) => {
3454
3475
  if (prevCaretPos === 0 && !isDeleteForwards) {
3455
3476
  return 0;
@@ -3469,7 +3490,7 @@ var computeNewCaretPosition = (relevantChars, formattedValue, prevCaretPos, isDe
3469
3490
  return formattedValue.length;
3470
3491
  };
3471
3492
 
3472
- // src/js/data/nanp-regionless.ts
3493
+ // packages/core/src/js/data/nanp-regionless.ts
3473
3494
  var regionlessNanpAreaCodes = /* @__PURE__ */ new Set([
3474
3495
  "800",
3475
3496
  "822",
@@ -3498,7 +3519,7 @@ var isRegionlessNanp = (number) => {
3498
3519
  return false;
3499
3520
  };
3500
3521
 
3501
- // src/js/intlTelInput.ts
3522
+ // packages/core/src/js/intlTelInput.ts
3502
3523
  var nextId = 0;
3503
3524
  var ensureUtils = (methodName) => {
3504
3525
  if (!intlTelInput.utils) {
@@ -3665,7 +3686,7 @@ var Iti = class _Iti {
3665
3686
  if (this.#utilsDeferred) {
3666
3687
  const { loadUtils } = this.#options;
3667
3688
  const doAttachUtils = () => {
3668
- intlTelInput.attachUtils(loadUtils)?.catch(() => {
3689
+ intlTelInput.attachUtils(loadUtils).catch(() => {
3669
3690
  });
3670
3691
  };
3671
3692
  if (intlTelInput.documentReady()) {
@@ -3685,7 +3706,7 @@ var Iti = class _Iti {
3685
3706
  }
3686
3707
  }
3687
3708
  //* Perform the geo ip lookup.
3688
- #loadAutoCountry() {
3709
+ async #loadAutoCountry() {
3689
3710
  if (intlTelInput.autoCountry) {
3690
3711
  this.#handleAutoCountryLoaded();
3691
3712
  return;
@@ -3696,19 +3717,18 @@ var Iti = class _Iti {
3696
3717
  }
3697
3718
  intlTelInput.startedLoadingAutoCountry = true;
3698
3719
  if (typeof this.#options.geoIpLookup === "function") {
3699
- const successCallback = (iso2 = "") => {
3700
- const iso2Lower = iso2.toLowerCase();
3701
- if (isIso2(iso2Lower)) {
3702
- intlTelInput.autoCountry = iso2Lower;
3703
- setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
3704
- } else {
3720
+ try {
3721
+ const iso2 = await this.#options.geoIpLookup();
3722
+ const iso2Lower = typeof iso2 === "string" ? iso2.toLowerCase() : "";
3723
+ if (!isIso2(iso2Lower)) {
3705
3724
  _Iti.forEachInstance("handleAutoCountryFailure");
3725
+ return;
3706
3726
  }
3707
- };
3708
- const failureCallback = () => {
3727
+ intlTelInput.autoCountry = iso2Lower;
3728
+ setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
3729
+ } catch {
3709
3730
  _Iti.forEachInstance("handleAutoCountryFailure");
3710
- };
3711
- this.#options.geoIpLookup(successCallback, failureCallback);
3731
+ }
3712
3732
  }
3713
3733
  }
3714
3734
  #openDropdownWithPlus() {
@@ -4023,8 +4043,7 @@ var Iti = class _Iti {
4023
4043
  if (formatOnDisplay && intlTelInput.utils && this.#selectedCountry) {
4024
4044
  const isRegionless = hasRegionlessDialCode(fullNumber);
4025
4045
  const useNational = nationalMode && !isRegionless || !number.startsWith("+") && !separateDialCode;
4026
- const { NATIONAL, INTERNATIONAL } = intlTelInput.utils.numberFormat;
4027
- const format = useNational ? NATIONAL : INTERNATIONAL;
4046
+ const format = useNational ? NUMBER_FORMAT.NATIONAL : NUMBER_FORMAT.INTERNATIONAL;
4028
4047
  number = intlTelInput.utils.formatNumber(
4029
4048
  number,
4030
4049
  this.#selectedCountry?.iso2,
@@ -4144,11 +4163,10 @@ var Iti = class _Iti {
4144
4163
  this.#maxCoreNumberLength = null;
4145
4164
  return;
4146
4165
  }
4147
- const numberType = intlTelInput.utils.numberType[placeholderNumberType];
4148
4166
  let exampleNumber = intlTelInput.utils.getExampleNumber(
4149
4167
  iso2,
4150
4168
  false,
4151
- numberType,
4169
+ placeholderNumberType,
4152
4170
  true
4153
4171
  );
4154
4172
  let validNumber = exampleNumber;
@@ -4178,11 +4196,10 @@ var Iti = class _Iti {
4178
4196
  if (!intlTelInput.utils || !shouldSetPlaceholder) {
4179
4197
  return;
4180
4198
  }
4181
- const numberType = intlTelInput.utils.numberType[placeholderNumberType];
4182
4199
  let placeholder = this.#selectedCountry ? intlTelInput.utils.getExampleNumber(
4183
4200
  this.#selectedCountry.iso2,
4184
4201
  nationalMode,
4185
- numberType
4202
+ placeholderNumberType
4186
4203
  ) : "";
4187
4204
  placeholder = this.#prepareNumberForInput(placeholder);
4188
4205
  if (typeof customPlaceholder === "function") {
@@ -4292,19 +4309,9 @@ var Iti = class _Iti {
4292
4309
  );
4293
4310
  return this.#truncateToMaxLength(number);
4294
4311
  }
4295
- //* Return only the public-facing subset of the selected country data.
4296
- #getPublicCountryData() {
4297
- const d = this.#selectedCountry;
4298
- if (!d) {
4299
- return null;
4300
- }
4301
- const { iso2, dialCode, name } = d;
4302
- return { iso2, dialCode, name };
4303
- }
4304
4312
  //* Dispatch the 'countrychange' event.
4305
4313
  #dispatchCountryChangeEvent() {
4306
- const countryData = this.#getPublicCountryData();
4307
- this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, countryData);
4314
+ this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, this.#selectedCountry ?? null);
4308
4315
  }
4309
4316
  //**************************
4310
4317
  //* INTERNAL METHODS
@@ -4395,7 +4402,7 @@ var Iti = class _Iti {
4395
4402
  this.#selectedCountry?.iso2
4396
4403
  );
4397
4404
  }
4398
- //* Format the number to the given format.
4405
+ //* Format the number to the given format (defaults to "E164").
4399
4406
  getNumber(format) {
4400
4407
  if (!this.#isActive) {
4401
4408
  return "";
@@ -4410,10 +4417,10 @@ var Iti = class _Iti {
4410
4417
  );
4411
4418
  return this.#numerals.denormalise(formattedNumber);
4412
4419
  }
4413
- //* Get the type of the entered number e.g. landline/mobile.
4420
+ //* Get the type of the entered number e.g. "FIXED_LINE" / "MOBILE", or null if it can't be determined / instance is destroyed.
4414
4421
  getNumberType() {
4415
4422
  if (!this.#isActive) {
4416
- return SENTINELS.UNKNOWN_NUMBER_TYPE;
4423
+ return null;
4417
4424
  }
4418
4425
  ensureUtils("getNumberType");
4419
4426
  return intlTelInput.utils.getNumberType(
@@ -4423,12 +4430,12 @@ var Iti = class _Iti {
4423
4430
  }
4424
4431
  //* Get the country data for the currently selected country.
4425
4432
  getSelectedCountryData() {
4426
- return this.#getPublicCountryData();
4433
+ return this.#selectedCountry ?? null;
4427
4434
  }
4428
- //* Get the validation error.
4435
+ //* Get the validation error e.g. "TOO_SHORT" / "TOO_LONG", or null if it can't be determined / instance is destroyed.
4429
4436
  getValidationError() {
4430
4437
  if (!this.#isActive) {
4431
- return SENTINELS.UNKNOWN_VALIDATION_ERROR;
4438
+ return null;
4432
4439
  }
4433
4440
  ensureUtils("getValidationError");
4434
4441
  const iso2 = this.#selectedCountry?.iso2;
@@ -4577,39 +4584,31 @@ var Iti = class _Iti {
4577
4584
  });
4578
4585
  }
4579
4586
  };
4580
- var attachUtils = (source) => {
4581
- if (!intlTelInput.utils && !intlTelInput.startedLoadingUtils) {
4582
- let loadCall;
4583
- if (typeof source === "function") {
4584
- try {
4585
- loadCall = Promise.resolve(source());
4586
- } catch (error) {
4587
- return Promise.reject(error);
4588
- }
4589
- } else {
4590
- return Promise.reject(
4591
- new TypeError(
4592
- `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4593
- )
4587
+ var attachUtils = async (source) => {
4588
+ if (intlTelInput.utils || intlTelInput.startedLoadingUtils) {
4589
+ return null;
4590
+ }
4591
+ if (typeof source !== "function") {
4592
+ throw new TypeError(
4593
+ `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4594
+ );
4595
+ }
4596
+ intlTelInput.startedLoadingUtils = true;
4597
+ try {
4598
+ const module = await source();
4599
+ const utils = module?.default;
4600
+ if (!utils || typeof utils !== "object") {
4601
+ throw new TypeError(
4602
+ "The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
4594
4603
  );
4595
4604
  }
4596
- intlTelInput.startedLoadingUtils = true;
4597
- return loadCall.then((module) => {
4598
- const utils = module?.default;
4599
- if (!utils || typeof utils !== "object") {
4600
- throw new TypeError(
4601
- "The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
4602
- );
4603
- }
4604
- intlTelInput.utils = utils;
4605
- Iti.forEachInstance("handleUtilsLoaded");
4606
- return true;
4607
- }).catch((error) => {
4608
- Iti.forEachInstance("handleUtilsFailure", error);
4609
- throw error;
4610
- });
4605
+ intlTelInput.utils = utils;
4606
+ Iti.forEachInstance("handleUtilsLoaded");
4607
+ return true;
4608
+ } catch (error) {
4609
+ Iti.forEachInstance("handleUtilsFailure", error);
4610
+ throw error;
4611
4611
  }
4612
- return null;
4613
4612
  };
4614
4613
  var intlTelInput = Object.assign(
4615
4614
  (input, options) => {
@@ -4634,22 +4633,25 @@ var intlTelInput = Object.assign(
4634
4633
  attachUtils,
4635
4634
  startedLoadingUtils: false,
4636
4635
  startedLoadingAutoCountry: false,
4637
- version: "27.3.1"
4636
+ version: "28.0.0",
4637
+ NUMBER_FORMAT,
4638
+ NUMBER_TYPE,
4639
+ VALIDATION_ERROR
4638
4640
  }
4639
4641
  );
4640
4642
  var intlTelInput_default = intlTelInput;
4641
4643
 
4642
- // dist/js/utils.js
4644
+ // packages/core/dist/js/utils.js
4643
4645
  var _scope = {};
4644
4646
  (function() {
4645
- var k = this || self;
4646
- function m(a, b) {
4647
+ var aa = this || self;
4648
+ function k(a, b) {
4647
4649
  a = a.split(".");
4648
- var c = k;
4650
+ var c = aa;
4649
4651
  a[0] in c || typeof c.execScript == "undefined" || c.execScript("var " + a[0]);
4650
4652
  for (var d; a.length && (d = a.shift()); ) a.length || b === void 0 ? c[d] && c[d] !== Object.prototype[d] ? c = c[d] : c = c[d] = {} : c[d] = b;
4651
4653
  }
4652
- function n(a, b) {
4654
+ function m(a, b) {
4653
4655
  function c() {
4654
4656
  }
4655
4657
  c.prototype = b.prototype;
@@ -4662,7 +4664,7 @@ var _scope = {};
4662
4664
  };
4663
4665
  }
4664
4666
  ;
4665
- function aa(a) {
4667
+ function ba(a) {
4666
4668
  const b = [];
4667
4669
  let c = 0;
4668
4670
  for (const d in a) b[c++] = a[d];
@@ -4671,13 +4673,13 @@ var _scope = {};
4671
4673
  ;
4672
4674
  var da = class {
4673
4675
  constructor(a) {
4674
- if (ba !== ba) throw Error("SafeUrl is not meant to be built directly");
4676
+ if (ca !== ca) throw Error("SafeUrl is not meant to be built directly");
4675
4677
  this.g = a;
4676
4678
  }
4677
4679
  toString() {
4678
4680
  return this.g.toString();
4679
4681
  }
4680
- }, ba = {};
4682
+ }, ca = {};
4681
4683
  new da("about:invalid#zClosurez");
4682
4684
  new da("about:blank");
4683
4685
  const ea = {};
@@ -4703,7 +4705,7 @@ var _scope = {};
4703
4705
  const ja = {};
4704
4706
  class ka {
4705
4707
  constructor() {
4706
- var a = k.trustedTypes && k.trustedTypes.emptyHTML || "";
4708
+ var a = aa.trustedTypes && aa.trustedTypes.emptyHTML || "";
4707
4709
  if (ja !== ja) throw Error("SafeHtml is not meant to be built directly");
4708
4710
  this.g = a;
4709
4711
  }
@@ -4740,38 +4742,38 @@ var _scope = {};
4740
4742
  }
4741
4743
  }
4742
4744
  function ua(a) {
4743
- a = aa(a.g);
4745
+ a = ba(a.g);
4744
4746
  a.sort(function(b, c) {
4745
4747
  return b.g - c.g;
4746
4748
  });
4747
4749
  return a;
4748
4750
  }
4749
4751
  ;
4750
- function p() {
4752
+ function n() {
4751
4753
  this.h = {};
4752
4754
  this.j = this.m().g;
4753
4755
  this.g = this.l = null;
4754
4756
  }
4755
- p.prototype.has = function(a) {
4756
- return q(this, a.g);
4757
+ n.prototype.has = function(a) {
4758
+ return p(this, a.g);
4757
4759
  };
4758
- p.prototype.get = function(a, b) {
4759
- return r(this, a.g, b);
4760
+ n.prototype.get = function(a, b) {
4761
+ return q(this, a.g, b);
4760
4762
  };
4761
- p.prototype.set = function(a, b) {
4762
- t(this, a.g, b);
4763
+ n.prototype.set = function(a, b) {
4764
+ r(this, a.g, b);
4763
4765
  };
4764
- p.prototype.add = function(a, b) {
4766
+ n.prototype.add = function(a, b) {
4765
4767
  va(this, a.g, b);
4766
4768
  };
4767
- p.prototype.equals = function(a) {
4769
+ n.prototype.equals = function(a) {
4768
4770
  if (!a || this.constructor != a.constructor) return false;
4769
4771
  for (var b = ua(this.m()), c = 0; c < b.length; c++) {
4770
4772
  var d = b[c], e = d.g;
4771
- if (q(this, e) != q(a, e)) return false;
4772
- if (q(this, e)) {
4773
- var f = d.h == 11 || d.h == 10, g = u(this, e);
4774
- e = u(a, e);
4773
+ if (p(this, e) != p(a, e)) return false;
4774
+ if (p(this, e)) {
4775
+ var f = d.h == 11 || d.h == 10, g = t(this, e);
4776
+ e = t(a, e);
4775
4777
  if (d.l) {
4776
4778
  if (g.length != e.length) return false;
4777
4779
  for (d = 0; d < g.length; d++) {
@@ -4786,25 +4788,25 @@ var _scope = {};
4786
4788
  function wa(a, b) {
4787
4789
  for (var c = ua(a.m()), d = 0; d < c.length; d++) {
4788
4790
  var e = c[d], f = e.g;
4789
- if (q(b, f)) {
4791
+ if (p(b, f)) {
4790
4792
  a.g && delete a.g[e.g];
4791
4793
  var g = e.h == 11 || e.h == 10;
4792
4794
  if (e.l) {
4793
- e = u(b, f) || [];
4795
+ e = t(b, f) || [];
4794
4796
  for (var h = 0; h < e.length; h++) va(a, f, g ? e[h].clone() : e[h]);
4795
- } else e = u(b, f), g ? (g = u(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
4797
+ } else e = t(b, f), g ? (g = t(a, f)) ? wa(g, e) : r(a, f, e.clone()) : r(a, f, e);
4796
4798
  }
4797
4799
  }
4798
4800
  }
4799
- p.prototype.clone = function() {
4801
+ n.prototype.clone = function() {
4800
4802
  var a = new this.constructor();
4801
4803
  a != this && (a.h = {}, a.g && (a.g = {}), wa(a, this));
4802
4804
  return a;
4803
4805
  };
4804
- function q(a, b) {
4806
+ function p(a, b) {
4805
4807
  return a.h[b] != null;
4806
4808
  }
4807
- function u(a, b) {
4809
+ function t(a, b) {
4808
4810
  var c = a.h[b];
4809
4811
  if (c == null) return null;
4810
4812
  if (a.l) {
@@ -4820,12 +4822,12 @@ var _scope = {};
4820
4822
  }
4821
4823
  return c;
4822
4824
  }
4823
- function r(a, b, c) {
4824
- var d = u(a, b);
4825
+ function q(a, b, c) {
4826
+ var d = t(a, b);
4825
4827
  return a.j[b].l ? d[c || 0] : d;
4826
4828
  }
4827
- function v(a, b) {
4828
- if (q(a, b)) a = r(a, b);
4829
+ function u(a, b) {
4830
+ if (p(a, b)) a = q(a, b);
4829
4831
  else a: {
4830
4832
  a = a.j[b];
4831
4833
  if (a.j === void 0) if (b = a.u, b === Boolean) a.j = false;
@@ -4839,10 +4841,10 @@ var _scope = {};
4839
4841
  }
4840
4842
  return a;
4841
4843
  }
4842
- function w(a, b) {
4843
- return a.j[b].l ? q(a, b) ? a.h[b].length : 0 : q(a, b) ? 1 : 0;
4844
+ function v(a, b) {
4845
+ return a.j[b].l ? p(a, b) ? a.h[b].length : 0 : p(a, b) ? 1 : 0;
4844
4846
  }
4845
- function t(a, b, c) {
4847
+ function r(a, b, c) {
4846
4848
  a.h[b] = c;
4847
4849
  a.g && (a.g[b] = c);
4848
4850
  }
@@ -4851,20 +4853,20 @@ var _scope = {};
4851
4853
  a.h[b].push(c);
4852
4854
  a.g && delete a.g[b];
4853
4855
  }
4854
- function x(a, b) {
4856
+ function w(a, b) {
4855
4857
  var c = [], d;
4856
4858
  for (d in b) d != 0 && c.push(new la(d, b[d]));
4857
4859
  return new ta(a, c);
4858
4860
  }
4859
4861
  ;
4860
- function y() {
4862
+ function x() {
4861
4863
  }
4862
- y.prototype.g = function(a) {
4864
+ x.prototype.g = function(a) {
4863
4865
  new a.h();
4864
4866
  throw Error("Unimplemented");
4865
4867
  };
4866
- y.prototype.h = function(a, b) {
4867
- if (a.h == 11 || a.h == 10) return b instanceof p ? b : this.g(a.u.prototype.m(), b);
4868
+ x.prototype.h = function(a, b) {
4869
+ if (a.h == 11 || a.h == 10) return b instanceof n ? b : this.g(a.u.prototype.m(), b);
4868
4870
  if (a.h == 14) return typeof b === "string" && xa.test(b) && (a = Number(b), a > 0) ? a : b;
4869
4871
  if (!a.o) return b;
4870
4872
  a = a.u;
@@ -4874,94 +4876,94 @@ var _scope = {};
4874
4876
  return b;
4875
4877
  };
4876
4878
  var xa = /^-?[0-9]+$/;
4877
- function z() {
4879
+ function ya() {
4878
4880
  }
4879
- n(z, y);
4880
- z.prototype.g = function(a, b) {
4881
+ m(ya, x);
4882
+ ya.prototype.g = function(a, b) {
4881
4883
  a = new a.h();
4882
4884
  a.l = this;
4883
4885
  a.h = b;
4884
4886
  a.g = {};
4885
4887
  return a;
4886
4888
  };
4887
- function B() {
4889
+ function z() {
4888
4890
  }
4889
- n(B, z);
4890
- B.prototype.h = function(a, b) {
4891
- return a.h == 8 ? !!b : y.prototype.h.apply(this, arguments);
4891
+ m(z, ya);
4892
+ z.prototype.h = function(a, b) {
4893
+ return a.h == 8 ? !!b : x.prototype.h.apply(this, arguments);
4892
4894
  };
4893
- B.prototype.g = function(a, b) {
4894
- return B.na.g.call(this, a, b);
4895
+ z.prototype.g = function(a, b) {
4896
+ return z.na.g.call(this, a, b);
4895
4897
  };
4896
- function C(a, b) {
4898
+ function A(a, b) {
4897
4899
  a != null && this.g.apply(this, arguments);
4898
4900
  }
4899
- C.prototype.h = "";
4900
- C.prototype.set = function(a) {
4901
+ A.prototype.h = "";
4902
+ A.prototype.set = function(a) {
4901
4903
  this.h = "" + a;
4902
4904
  };
4903
- C.prototype.g = function(a, b, c) {
4905
+ A.prototype.g = function(a, b, c) {
4904
4906
  this.h += String(a);
4905
4907
  if (b != null) for (let d = 1; d < arguments.length; d++) this.h += arguments[d];
4906
4908
  return this;
4907
4909
  };
4908
- function D(a) {
4910
+ function B(a) {
4909
4911
  a.h = "";
4910
4912
  }
4911
- C.prototype.toString = function() {
4913
+ A.prototype.toString = function() {
4912
4914
  return this.h;
4913
4915
  };
4914
- function E() {
4915
- p.call(this);
4916
- }
4917
- n(E, p);
4918
- var ya = null;
4919
- function F() {
4920
- p.call(this);
4916
+ function C() {
4917
+ n.call(this);
4921
4918
  }
4922
- n(F, p);
4919
+ m(C, n);
4923
4920
  var za = null;
4924
- function G(a) {
4925
- return u(a, 9) || [];
4921
+ function D() {
4922
+ n.call(this);
4926
4923
  }
4927
- function H() {
4928
- p.call(this);
4929
- }
4930
- n(H, p);
4924
+ m(D, n);
4931
4925
  var Aa = null;
4932
- E.prototype.m = function() {
4933
- var a = ya;
4934
- a || (ya = a = x(E, { 0: { name: "NumberFormat", ja: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: true, i: 9, type: String }, 2: { name: "format", required: true, i: 9, type: String }, 3: { name: "leading_digits_pattern", ca: true, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: false, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } }));
4935
- return a;
4936
- };
4937
- E.m = E.prototype.m;
4938
- F.prototype.m = function() {
4926
+ function E(a) {
4927
+ return t(a, 9) || [];
4928
+ }
4929
+ function F() {
4930
+ n.call(this);
4931
+ }
4932
+ m(F, n);
4933
+ var Ba = null;
4934
+ C.prototype.m = function() {
4939
4935
  var a = za;
4940
- a || (za = a = x(F, { 0: { name: "PhoneNumberDesc", ja: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", ca: true, i: 5, type: Number }, 10: { name: "possible_length_local_only", ca: true, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } }));
4936
+ a || (za = a = w(C, { 0: { name: "NumberFormat", ja: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: true, i: 9, type: String }, 2: { name: "format", required: true, i: 9, type: String }, 3: { name: "leading_digits_pattern", ca: true, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: false, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } }));
4941
4937
  return a;
4942
4938
  };
4943
- F.m = F.prototype.m;
4944
- H.prototype.m = function() {
4939
+ C.m = C.prototype.m;
4940
+ D.prototype.m = function() {
4945
4941
  var a = Aa;
4946
- a || (Aa = a = x(H, {
4942
+ a || (Aa = a = w(D, { 0: { name: "PhoneNumberDesc", ja: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", ca: true, i: 5, type: Number }, 10: { name: "possible_length_local_only", ca: true, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } }));
4943
+ return a;
4944
+ };
4945
+ D.m = D.prototype.m;
4946
+ F.prototype.m = function() {
4947
+ var a = Ba;
4948
+ a || (Ba = a = w(F, {
4947
4949
  0: { name: "PhoneMetadata", ja: "i18n.phonenumbers.PhoneMetadata" },
4948
- 1: { name: "general_desc", i: 11, type: F },
4949
- 2: { name: "fixed_line", i: 11, type: F },
4950
- 3: { name: "mobile", i: 11, type: F },
4951
- 4: { name: "toll_free", i: 11, type: F },
4952
- 5: { name: "premium_rate", i: 11, type: F },
4953
- 6: { name: "shared_cost", i: 11, type: F },
4954
- 7: { name: "personal_number", i: 11, type: F },
4955
- 8: { name: "voip", i: 11, type: F },
4956
- 21: { name: "pager", i: 11, type: F },
4957
- 25: { name: "uan", i: 11, type: F },
4958
- 27: { name: "emergency", i: 11, type: F },
4959
- 28: { name: "voicemail", i: 11, type: F },
4960
- 29: { name: "short_code", i: 11, type: F },
4961
- 30: { name: "standard_rate", i: 11, type: F },
4962
- 31: { name: "carrier_specific", i: 11, type: F },
4963
- 33: { name: "sms_services", i: 11, type: F },
4964
- 24: { name: "no_international_dialling", i: 11, type: F },
4950
+ 1: { name: "general_desc", i: 11, type: D },
4951
+ 2: { name: "fixed_line", i: 11, type: D },
4952
+ 3: { name: "mobile", i: 11, type: D },
4953
+ 4: { name: "toll_free", i: 11, type: D },
4954
+ 5: { name: "premium_rate", i: 11, type: D },
4955
+ 6: { name: "shared_cost", i: 11, type: D },
4956
+ 7: { name: "personal_number", i: 11, type: D },
4957
+ 8: { name: "voip", i: 11, type: D },
4958
+ 21: { name: "pager", i: 11, type: D },
4959
+ 25: { name: "uan", i: 11, type: D },
4960
+ 27: { name: "emergency", i: 11, type: D },
4961
+ 28: { name: "voicemail", i: 11, type: D },
4962
+ 29: { name: "short_code", i: 11, type: D },
4963
+ 30: { name: "standard_rate", i: 11, type: D },
4964
+ 31: { name: "carrier_specific", i: 11, type: D },
4965
+ 33: { name: "sms_services", i: 11, type: D },
4966
+ 24: { name: "no_international_dialling", i: 11, type: D },
4965
4967
  9: { name: "id", required: true, i: 9, type: String },
4966
4968
  10: { name: "country_code", i: 5, type: Number },
4967
4969
  11: { name: "international_prefix", i: 9, type: String },
@@ -4975,31 +4977,31 @@ var _scope = {};
4975
4977
  },
4976
4978
  16: { name: "national_prefix_transform_rule", i: 9, type: String },
4977
4979
  18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: false, type: Boolean },
4978
- 19: { name: "number_format", ca: true, i: 11, type: E },
4979
- 20: { name: "intl_number_format", ca: true, i: 11, type: E },
4980
+ 19: { name: "number_format", ca: true, i: 11, type: C },
4981
+ 20: { name: "intl_number_format", ca: true, i: 11, type: C },
4980
4982
  22: { name: "main_country_for_code", i: 8, defaultValue: false, type: Boolean },
4981
4983
  23: { name: "leading_digits", i: 9, type: String }
4982
4984
  }));
4983
4985
  return a;
4984
4986
  };
4985
- H.m = H.prototype.m;
4986
- function I() {
4987
- p.call(this);
4988
- }
4989
- n(I, p);
4990
- var Ba = null, Ca = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
4991
- I.prototype.m = function() {
4992
- var a = Ba;
4993
- a || (Ba = a = x(I, { 0: { name: "PhoneNumber", ja: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: true, i: 5, type: Number }, 2: { name: "national_number", required: true, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: Ca }, 7: {
4987
+ F.m = F.prototype.m;
4988
+ function G() {
4989
+ n.call(this);
4990
+ }
4991
+ m(G, n);
4992
+ var Ca = null, Da = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
4993
+ G.prototype.m = function() {
4994
+ var a = Ca;
4995
+ a || (Ca = a = w(G, { 0: { name: "PhoneNumber", ja: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: true, i: 5, type: Number }, 2: { name: "national_number", required: true, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: Da }, 7: {
4994
4996
  name: "preferred_domestic_carrier_code",
4995
4997
  i: 9,
4996
4998
  type: String
4997
4999
  } }));
4998
5000
  return a;
4999
5001
  };
5000
- I.ctor = I;
5001
- I.ctor.m = I.prototype.m;
5002
- var J = {
5002
+ G.ctor = G;
5003
+ G.ctor.m = G.prototype.m;
5004
+ var H = {
5003
5005
  1: "US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),
5004
5006
  7: ["RU", "KZ"],
5005
5007
  20: ["EG"],
@@ -5215,7 +5217,7 @@ var _scope = {};
5215
5217
  995: ["GE"],
5216
5218
  996: ["KG"],
5217
5219
  998: ["UZ"]
5218
- }, Da = {
5220
+ }, Ea = {
5219
5221
  AC: [, [
5220
5222
  ,
5221
5223
  ,
@@ -10287,14 +10289,14 @@ var _scope = {};
10287
10289
  ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
10288
10290
  979: [, [, , "[1359]\\d{8}", , , , , , , [9], [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "[1359]\\d{8}", , , , "123456789", , , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 979, , , , , , , , 1, [[, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]]
10289
10291
  };
10290
- function K() {
10292
+ function I() {
10291
10293
  this.g = {};
10292
10294
  }
10293
- K.h = void 0;
10294
- K.g = function() {
10295
- return K.h ? K.h : K.h = new K();
10295
+ I.h = void 0;
10296
+ I.g = function() {
10297
+ return I.h ? I.h : I.h = new I();
10296
10298
  };
10297
- var Ea = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "\uFF10": "0", "\uFF11": "1", "\uFF12": "2", "\uFF13": "3", "\uFF14": "4", "\uFF15": "5", "\uFF16": "6", "\uFF17": "7", "\uFF18": "8", "\uFF19": "9", "\u0660": "0", "\u0661": "1", "\u0662": "2", "\u0663": "3", "\u0664": "4", "\u0665": "5", "\u0666": "6", "\u0667": "7", "\u0668": "8", "\u0669": "9", "\u06F0": "0", "\u06F1": "1", "\u06F2": "2", "\u06F3": "3", "\u06F4": "4", "\u06F5": "5", "\u06F6": "6", "\u06F7": "7", "\u06F8": "8", "\u06F9": "9" }, Fa = {
10299
+ var Fa = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "\uFF10": "0", "\uFF11": "1", "\uFF12": "2", "\uFF13": "3", "\uFF14": "4", "\uFF15": "5", "\uFF16": "6", "\uFF17": "7", "\uFF18": "8", "\uFF19": "9", "\u0660": "0", "\u0661": "1", "\u0662": "2", "\u0663": "3", "\u0664": "4", "\u0665": "5", "\u0666": "6", "\u0667": "7", "\u0668": "8", "\u0669": "9", "\u06F0": "0", "\u06F1": "1", "\u06F2": "2", "\u06F3": "3", "\u06F4": "4", "\u06F5": "5", "\u06F6": "6", "\u06F7": "7", "\u06F8": "8", "\u06F9": "9" }, Ga = {
10298
10300
  0: "0",
10299
10301
  1: "1",
10300
10302
  2: "2",
@@ -10308,7 +10310,7 @@ var _scope = {};
10308
10310
  "+": "+",
10309
10311
  "*": "*",
10310
10312
  "#": "#"
10311
- }, Ga = {
10313
+ }, Ha = {
10312
10314
  0: "0",
10313
10315
  1: "1",
10314
10316
  2: "2",
@@ -10375,56 +10377,56 @@ var _scope = {};
10375
10377
  X: "9",
10376
10378
  Y: "9",
10377
10379
  Z: "9"
10378
- }, Ha = RegExp("[+\uFF0B]+"), L = RegExp("^[+\uFF0B]+"), Ia = RegExp("([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])"), Ja = RegExp("[+\uFF0B0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]"), Ka = /[\\\/] *x/, La = RegExp("[^0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9A-Za-z#]+$"), Ma = /(?:.*?[A-Za-z]){3}.*/, Na = RegExp("^\\+([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*$"), Oa = RegExp("^([A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.?$");
10379
- function M(a) {
10380
+ }, Ia = RegExp("[+\uFF0B]+"), J = RegExp("^[+\uFF0B]+"), Ja = RegExp("([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])"), Ka = RegExp("[+\uFF0B0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]"), La = /[\\\/] *x/, Ma = RegExp("[^0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9A-Za-z#]+$"), Na = /(?:.*?[A-Za-z]){3}.*/, Oa = RegExp("^\\+([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]|[\\-\\.\\(\\)]?)*$"), Pa = RegExp("^([A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9])*\\.?$");
10381
+ function K(a) {
10380
10382
  return "([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{1," + a + "})";
10381
10383
  }
10382
- function Pa() {
10383
- return ";ext=" + M("20") + "|[ \xA0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)[:\\.\uFF0E]?[ \xA0\\t,-]*" + (M("20") + "#?|[ \xA0\\t,]*(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (M("9") + "#?|[- ]+") + (M("6") + "#|[ \xA0\\t]*(?:,{2}|;)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (M("15") + "#?|[ \xA0\\t]*(?:,)+[:\\.\uFF0E]?[ \xA0\\t,-]*") + (M("9") + "#?");
10384
- }
10385
- var Qa = new RegExp("(?:" + Pa() + ")$", "i"), Ra = new RegExp("^[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{2}$|^[+\uFF0B]*(?:[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*]*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]){3,}[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]*(?:" + Pa() + ")?$", "i"), Sa = /(\$\d)/, Ta = /^\(?\$1\)?$/;
10386
- function Ua(a) {
10387
- return a.length < 2 ? false : N(Ra, a);
10384
+ function Qa() {
10385
+ return ";ext=" + K("20") + "|[ \xA0\\t,]*(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)[:\\.\uFF0E]?[ \xA0\\t,-]*" + (K("20") + "#?|[ \xA0\\t,]*(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("9") + "#?|[- ]+") + (K("6") + "#|[ \xA0\\t]*(?:,{2}|;)[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("15") + "#?|[ \xA0\\t]*(?:,)+[:\\.\uFF0E]?[ \xA0\\t,-]*") + (K("9") + "#?");
10388
10386
  }
10387
+ var Ra = new RegExp("(?:" + Qa() + ")$", "i"), Sa = new RegExp("^[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{2}$|^[+\uFF0B]*(?:[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*]*[0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]){3,}[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E*A-Za-z0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]*(?:" + Qa() + ")?$", "i"), Ta = /(\$\d)/, Ua = /^\(?\$1\)?$/;
10389
10388
  function Va(a) {
10390
- return N(Ma, a) ? O(a, Ga) : O(a, Ea);
10389
+ return a.length < 2 ? false : L(Sa, a);
10391
10390
  }
10392
10391
  function Wa(a) {
10393
- var b = Va(a.toString());
10394
- D(a);
10395
- a.g(b);
10392
+ return L(Na, a) ? M(a, Ha) : M(a, Fa);
10396
10393
  }
10397
10394
  function Xa(a) {
10398
- return a != null && (w(a, 9) != 1 || G(a)[0] != -1);
10395
+ var b = Wa(a.toString());
10396
+ B(a);
10397
+ a.g(b);
10399
10398
  }
10400
- function O(a, b) {
10401
- for (var c = new C(), d, e = a.length, f = 0; f < e; ++f) d = a.charAt(f), d = b[d.toUpperCase()], d != null && c.g(d);
10399
+ function Ya(a) {
10400
+ return a != null && (v(a, 9) != 1 || E(a)[0] != -1);
10401
+ }
10402
+ function M(a, b) {
10403
+ for (var c = new A(), d, e = a.length, f = 0; f < e; ++f) d = a.charAt(f), d = b[d.toUpperCase()], d != null && c.g(d);
10402
10404
  return c.toString();
10403
10405
  }
10404
- function Ya(a) {
10405
- return a.length == 0 || Ta.test(a);
10406
+ function Za(a) {
10407
+ return a.length == 0 || Ua.test(a);
10406
10408
  }
10407
- function P(a) {
10408
- return a != null && isNaN(a) && a.toUpperCase() in Da;
10409
+ function N(a) {
10410
+ return a != null && isNaN(a) && a.toUpperCase() in Ea;
10409
10411
  }
10410
- K.prototype.format = function(a, b) {
10411
- if (r(a, 2) == 0 && q(a, 5)) {
10412
- var c = v(a, 5);
10412
+ I.prototype.format = function(a, b) {
10413
+ if (q(a, 2) == 0 && p(a, 5)) {
10414
+ var c = u(a, 5);
10413
10415
  if (c.length > 0) return c;
10414
10416
  }
10415
- c = v(a, 1);
10416
- var d = Q(a);
10417
- if (b == 0) return Za(c, 0, d, "");
10418
- if (!(c in J)) return d;
10419
- var e = R(this, c, S(c));
10420
- a = q(a, 3) && r(a, 3).length != 0 ? b == 3 ? ";ext=" + r(a, 3) : q(e, 13) ? r(e, 13) + v(a, 3) : " ext. " + v(a, 3) : "";
10417
+ c = u(a, 1);
10418
+ var d = O(a);
10419
+ if (b == 0) return $a(c, 0, d, "");
10420
+ if (!(c in H)) return d;
10421
+ var e = P(this, c, Q(c));
10422
+ a = p(a, 3) && q(a, 3).length != 0 ? b == 3 ? ";ext=" + q(a, 3) : p(e, 13) ? q(e, 13) + u(a, 3) : " ext. " + u(a, 3) : "";
10421
10423
  a: {
10422
- e = (u(e, 20) || []).length == 0 || b == 2 ? u(e, 19) || [] : u(e, 20) || [];
10424
+ e = (t(e, 20) || []).length == 0 || b == 2 ? t(e, 19) || [] : t(e, 20) || [];
10423
10425
  for (var f, g = e.length, h = 0; h < g; ++h) {
10424
10426
  f = e[h];
10425
- var l = w(f, 3);
10426
- if (l == 0 || d.search(r(f, 3, l - 1)) == 0) {
10427
- if (l = new RegExp(r(f, 1)), N(l, d)) {
10427
+ var l = v(f, 3);
10428
+ if (l == 0 || d.search(q(f, 3, l - 1)) == 0) {
10429
+ if (l = new RegExp(q(f, 1)), L(l, d)) {
10428
10430
  e = f;
10429
10431
  break a;
10430
10432
  }
@@ -10432,21 +10434,21 @@ var _scope = {};
10432
10434
  }
10433
10435
  e = null;
10434
10436
  }
10435
- e != null && (g = e, e = v(g, 2), f = new RegExp(r(
10437
+ e != null && (g = e, e = u(g, 2), f = new RegExp(q(
10436
10438
  g,
10437
10439
  1
10438
- )), v(g, 5), g = v(g, 4), d = b == 2 && g != null && g.length > 0 ? d.replace(f, e.replace(Sa, g)) : d.replace(f, e), b == 3 && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
10439
- return Za(c, b, d, a);
10440
+ )), u(g, 5), g = u(g, 4), d = b == 2 && g != null && g.length > 0 ? d.replace(f, e.replace(Ta, g)) : d.replace(f, e), b == 3 && (d = d.replace(RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+"), ""), d = d.replace(RegExp("[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]+", "g"), "-")));
10441
+ return $a(c, b, d, a);
10440
10442
  };
10441
- function R(a, b, c) {
10442
- return "001" == c ? T(a, "" + b) : T(a, c);
10443
+ function P(a, b, c) {
10444
+ return "001" == c ? R(a, "" + b) : R(a, c);
10443
10445
  }
10444
- function Q(a) {
10445
- if (!q(a, 2)) return "";
10446
- var b = "" + r(a, 2);
10447
- return q(a, 4) && r(a, 4) && v(a, 8) > 0 ? Array(v(a, 8) + 1).join("0") + b : b;
10446
+ function O(a) {
10447
+ if (!p(a, 2)) return "";
10448
+ var b = "" + q(a, 2);
10449
+ return p(a, 4) && q(a, 4) && u(a, 8) > 0 ? Array(u(a, 8) + 1).join("0") + b : b;
10448
10450
  }
10449
- function Za(a, b, c, d) {
10451
+ function $a(a, b, c, d) {
10450
10452
  switch (b) {
10451
10453
  case 0:
10452
10454
  return "+" + a + c + d;
@@ -10458,83 +10460,83 @@ var _scope = {};
10458
10460
  return c + d;
10459
10461
  }
10460
10462
  }
10461
- function U(a, b) {
10463
+ function S(a, b) {
10462
10464
  switch (b) {
10463
10465
  case 4:
10464
- return r(a, 5);
10466
+ return q(a, 5);
10465
10467
  case 3:
10466
- return r(a, 4);
10468
+ return q(a, 4);
10467
10469
  case 1:
10468
- return r(a, 3);
10470
+ return q(a, 3);
10469
10471
  case 0:
10470
10472
  case 2:
10471
- return r(a, 2);
10473
+ return q(a, 2);
10472
10474
  case 5:
10473
- return r(a, 6);
10475
+ return q(a, 6);
10474
10476
  case 6:
10475
- return r(a, 8);
10477
+ return q(a, 8);
10476
10478
  case 7:
10477
- return r(a, 7);
10479
+ return q(a, 7);
10478
10480
  case 8:
10479
- return r(a, 21);
10481
+ return q(a, 21);
10480
10482
  case 9:
10481
- return r(a, 25);
10483
+ return q(a, 25);
10482
10484
  case 10:
10483
- return r(a, 28);
10485
+ return q(a, 28);
10484
10486
  default:
10485
- return r(a, 1);
10487
+ return q(a, 1);
10486
10488
  }
10487
10489
  }
10488
- function $a(a, b) {
10489
- var c = ab(a, b);
10490
- a = R(a, v(b, 1), c);
10490
+ function ab(a, b) {
10491
+ var c = bb(a, b);
10492
+ a = P(a, u(b, 1), c);
10491
10493
  if (a == null) return -1;
10492
- b = Q(b);
10493
- return bb(b, a);
10494
+ b = O(b);
10495
+ return cb(b, a);
10494
10496
  }
10495
- function bb(a, b) {
10496
- return V(a, r(b, 1)) ? V(a, r(b, 5)) ? 4 : V(a, r(b, 4)) ? 3 : V(a, r(b, 6)) ? 5 : V(a, r(b, 8)) ? 6 : V(a, r(b, 7)) ? 7 : V(a, r(b, 21)) ? 8 : V(a, r(b, 25)) ? 9 : V(a, r(b, 28)) ? 10 : V(a, r(b, 2)) ? r(b, 18) || V(a, r(b, 3)) ? 2 : 0 : !r(b, 18) && V(a, r(b, 3)) ? 1 : -1 : -1;
10497
+ function cb(a, b) {
10498
+ return T(a, q(b, 1)) ? T(a, q(b, 5)) ? 4 : T(a, q(b, 4)) ? 3 : T(a, q(b, 6)) ? 5 : T(a, q(b, 8)) ? 6 : T(a, q(b, 7)) ? 7 : T(a, q(b, 21)) ? 8 : T(a, q(b, 25)) ? 9 : T(a, q(b, 28)) ? 10 : T(a, q(b, 2)) ? q(b, 18) || T(a, q(b, 3)) ? 2 : 0 : !q(b, 18) && T(a, q(b, 3)) ? 1 : -1 : -1;
10497
10499
  }
10498
- function T(a, b) {
10500
+ function R(a, b) {
10499
10501
  if (b == null) return null;
10500
10502
  b = b.toUpperCase();
10501
10503
  var c = a.g[b];
10502
10504
  if (c == null) {
10503
- c = Da[b];
10505
+ c = Ea[b];
10504
10506
  if (c == null) return null;
10505
- c = new B().g(H.m(), c);
10507
+ c = new z().g(F.m(), c);
10506
10508
  a.g[b] = c;
10507
10509
  }
10508
10510
  return c;
10509
10511
  }
10510
- function V(a, b) {
10512
+ function T(a, b) {
10511
10513
  var c = a.length;
10512
- return w(b, 9) > 0 && G(b).indexOf(c) == -1 ? false : N(v(b, 2), a);
10514
+ return v(b, 9) > 0 && E(b).indexOf(c) == -1 ? false : L(u(b, 2), a);
10513
10515
  }
10514
- function cb(a, b) {
10515
- var c = ab(a, b);
10516
- var d = v(b, 1);
10517
- var e = R(a, d, c);
10518
- e == null || "001" != c && d != db(a, c) ? e = false : (a = Q(b), e = bb(a, e) != -1);
10516
+ function db(a, b) {
10517
+ var c = bb(a, b);
10518
+ var d = u(b, 1);
10519
+ var e = P(a, d, c);
10520
+ e == null || "001" != c && d != eb(a, c) ? e = false : (a = O(b), e = cb(a, e) != -1);
10519
10521
  return e;
10520
10522
  }
10521
- function ab(a, b) {
10523
+ function bb(a, b) {
10522
10524
  if (b == null) return null;
10523
- var c = v(b, 1);
10524
- c = J[c];
10525
+ var c = u(b, 1);
10526
+ c = H[c];
10525
10527
  if (c == null) a = null;
10526
10528
  else if (c.length == 1) a = c[0];
10527
10529
  else a: {
10528
- b = Q(b);
10530
+ b = O(b);
10529
10531
  for (var d, e = c.length, f = 0; f < e; f++) {
10530
10532
  d = c[f];
10531
- var g = T(a, d);
10532
- if (q(g, 23)) {
10533
- if (b.search(r(g, 23)) == 0) {
10533
+ var g = R(a, d);
10534
+ if (p(g, 23)) {
10535
+ if (b.search(q(g, 23)) == 0) {
10534
10536
  a = d;
10535
10537
  break a;
10536
10538
  }
10537
- } else if (bb(b, g) != -1) {
10539
+ } else if (cb(b, g) != -1) {
10538
10540
  a = d;
10539
10541
  break a;
10540
10542
  }
@@ -10543,93 +10545,93 @@ var _scope = {};
10543
10545
  }
10544
10546
  return a;
10545
10547
  }
10546
- function S(a) {
10547
- a = J[a];
10548
+ function Q(a) {
10549
+ a = H[a];
10548
10550
  return a == null ? "ZZ" : a[0];
10549
10551
  }
10550
- function db(a, b) {
10551
- a = T(a, b);
10552
+ function eb(a, b) {
10553
+ a = R(a, b);
10552
10554
  if (a == null) throw Error("Invalid region code: " + b);
10553
- return v(a, 10);
10555
+ return u(a, 10);
10554
10556
  }
10555
- function W(a, b, c, d) {
10556
- var e = U(c, d), f = w(e, 9) == 0 ? G(r(c, 1)) : G(e);
10557
- e = u(e, 10) || [];
10558
- if (d == 2) if (Xa(U(c, 0))) a = U(c, 1), Xa(a) && (f = f.concat(w(a, 9) == 0 ? G(r(c, 1)) : G(a)), f.sort(), e.length == 0 ? e = u(a, 10) || [] : (e = e.concat(u(a, 10) || []), e.sort()));
10559
- else return W(a, b, c, 1);
10557
+ function U(a, b, c, d) {
10558
+ var e = S(c, d), f = v(e, 9) == 0 ? E(q(c, 1)) : E(e);
10559
+ e = t(e, 10) || [];
10560
+ if (d == 2) if (Ya(S(c, 0))) a = S(c, 1), Ya(a) && (f = f.concat(v(a, 9) == 0 ? E(q(c, 1)) : E(a)), f.sort(), e.length == 0 ? e = t(a, 10) || [] : (e = e.concat(t(a, 10) || []), e.sort()));
10561
+ else return U(a, b, c, 1);
10560
10562
  if (f[0] == -1) return 5;
10561
10563
  b = b.length;
10562
10564
  if (e.indexOf(b) > -1) return 4;
10563
10565
  c = f[0];
10564
10566
  return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : f.indexOf(b, 1) > -1 ? 0 : 5;
10565
10567
  }
10566
- function X(a, b, c) {
10567
- var d = Q(b);
10568
- b = v(b, 1);
10569
- if (!(b in J)) return 1;
10570
- b = R(a, b, S(b));
10571
- return W(a, d, b, c);
10568
+ function V(a, b, c) {
10569
+ var d = O(b);
10570
+ b = u(b, 1);
10571
+ if (!(b in H)) return 1;
10572
+ b = P(a, b, Q(b));
10573
+ return U(a, d, b, c);
10572
10574
  }
10573
- function eb(a, b) {
10575
+ function fb(a, b) {
10574
10576
  a = a.toString();
10575
10577
  if (a.length == 0 || a.charAt(0) == "0") return 0;
10576
- for (var c, d = a.length, e = 1; e <= 3 && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in J) return b.g(a.substring(e)), c;
10578
+ for (var c, d = a.length, e = 1; e <= 3 && e <= d; ++e) if (c = parseInt(a.substring(0, e), 10), c in H) return b.g(a.substring(e)), c;
10577
10579
  return 0;
10578
10580
  }
10579
- function fb(a, b, c, d, e, f) {
10581
+ function gb(a, b, c, d, e, f) {
10580
10582
  if (b.length == 0) return 0;
10581
- b = new C(b);
10583
+ b = new A(b);
10582
10584
  var g;
10583
- c != null && (g = r(c, 11));
10585
+ c != null && (g = q(c, 11));
10584
10586
  g == null && (g = "NonMatch");
10585
10587
  var h = b.toString();
10586
10588
  if (h.length == 0) g = 20;
10587
- else if (L.test(h)) h = h.replace(L, ""), D(b), b.g(Va(h)), g = 1;
10589
+ else if (J.test(h)) h = h.replace(J, ""), B(b), b.g(Wa(h)), g = 1;
10588
10590
  else {
10589
10591
  h = new RegExp(g);
10590
- Wa(b);
10592
+ Xa(b);
10591
10593
  g = b.toString();
10592
10594
  if (g.search(h) == 0) {
10593
10595
  h = g.match(h)[0].length;
10594
- var l = g.substring(h).match(Ia);
10595
- l && l[1] != null && l[1].length > 0 && O(l[1], Ea) == "0" ? g = false : (D(b), b.g(g.substring(h)), g = true);
10596
+ var l = g.substring(h).match(Ja);
10597
+ l && l[1] != null && l[1].length > 0 && M(l[1], Fa) == "0" ? g = false : (B(b), b.g(g.substring(h)), g = true);
10596
10598
  } else g = false;
10597
10599
  g = g ? 5 : 20;
10598
10600
  }
10599
- e && t(f, 6, g);
10601
+ e && r(f, 6, g);
10600
10602
  if (g != 20) {
10601
10603
  if (b.h.length <= 2) throw Error("Phone number too short after IDD");
10602
- a = eb(b, d);
10603
- if (a != 0) return t(f, 1, a), a;
10604
+ a = fb(b, d);
10605
+ if (a != 0) return r(f, 1, a), a;
10604
10606
  throw Error("Invalid country calling code");
10605
10607
  }
10606
- if (c != null && (g = v(c, 10), h = "" + g, l = b.toString(), l.lastIndexOf(h, 0) == 0 && (h = new C(l.substring(h.length)), l = r(c, 1), l = new RegExp(v(l, 2)), gb(h, c, null), h = h.toString(), !N(l, b.toString()) && N(l, h) || W(a, b.toString(), c, -1) == 3))) return d.g(h), e && t(f, 6, 10), t(f, 1, g), g;
10607
- t(f, 1, 0);
10608
+ if (c != null && (g = u(c, 10), h = "" + g, l = b.toString(), l.lastIndexOf(h, 0) == 0 && (h = new A(l.substring(h.length)), l = q(c, 1), l = new RegExp(u(l, 2)), hb(h, c, null), h = h.toString(), !L(l, b.toString()) && L(l, h) || U(a, b.toString(), c, -1) == 3))) return d.g(h), e && r(f, 6, 10), r(f, 1, g), g;
10609
+ r(f, 1, 0);
10608
10610
  return 0;
10609
10611
  }
10610
- function gb(a, b, c) {
10611
- var d = a.toString(), e = d.length, f = r(b, 15);
10612
+ function hb(a, b, c) {
10613
+ var d = a.toString(), e = d.length, f = q(b, 15);
10612
10614
  if (e != 0 && f != null && f.length != 0 && (f = new RegExp("^(?:" + f + ")"), e = f.exec(d))) {
10613
10615
  var g = RegExp;
10614
- var h = r(b, 1);
10615
- h = v(h, 2);
10616
+ var h = q(b, 1);
10617
+ h = u(h, 2);
10616
10618
  g = new g(h);
10617
- h = N(g, d);
10619
+ h = L(g, d);
10618
10620
  var l = e.length - 1;
10619
- b = r(b, 16);
10621
+ b = q(b, 16);
10620
10622
  if (b == null || b.length == 0 || e[l] == null || e[l].length == 0) {
10621
- if (!h || N(g, d.substring(e[0].length))) c != null && l > 0 && e[l] != null && c.g(e[1]), a.set(d.substring(e[0].length));
10622
- } else if (d = d.replace(f, b), !h || N(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
10623
+ if (!h || L(g, d.substring(e[0].length))) c != null && l > 0 && e[l] != null && c.g(e[1]), a.set(d.substring(e[0].length));
10624
+ } else if (d = d.replace(f, b), !h || L(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
10623
10625
  }
10624
10626
  }
10625
- function Y(a, b, c) {
10626
- if (!P(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
10627
- return hb(a, b, c, true);
10627
+ function W(a, b, c) {
10628
+ if (!N(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
10629
+ return ib(a, b, c, true);
10628
10630
  }
10629
- function hb(a, b, c, d) {
10631
+ function ib(a, b, c, d) {
10630
10632
  if (b == null) throw Error("The string supplied did not seem to be a phone number");
10631
10633
  if (b.length > 250) throw Error("The string supplied is too long to be a phone number");
10632
- var e = new C();
10634
+ var e = new A();
10633
10635
  var f = b.indexOf(";phone-context=");
10634
10636
  if (f === -1) f = null;
10635
10637
  else if (f += 15, f >= b.length) f = "";
@@ -10638,126 +10640,126 @@ var _scope = {};
10638
10640
  f = g !== -1 ? b.substring(f, g) : b.substring(f);
10639
10641
  }
10640
10642
  var h = f;
10641
- h == null ? g = true : h.length === 0 ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = g !== null || h !== null);
10643
+ h == null ? g = true : h.length === 0 ? g = false : (g = Oa.exec(h), h = Pa.exec(h), g = g !== null || h !== null);
10642
10644
  if (!g) throw Error("The string supplied did not seem to be a phone number");
10643
- f != null ? (f.charAt(0) === "+" && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(f >= 0 ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b ?? "", h = g.search(Ja), h >= 0 ? (g = g.substring(h), g = g.replace(La, ""), h = g.search(Ka), h >= 0 && (g = g.substring(0, h))) : g = "", f.call(e, g));
10645
+ f != null ? (f.charAt(0) === "+" && e.g(f), f = b.indexOf("tel:"), e.g(b.substring(f >= 0 ? f + 4 : 0, b.indexOf(";phone-context=")))) : (f = e.g, g = b ?? "", h = g.search(Ka), h >= 0 ? (g = g.substring(h), g = g.replace(Ma, ""), h = g.search(La), h >= 0 && (g = g.substring(0, h))) : g = "", f.call(e, g));
10644
10646
  f = e.toString();
10645
10647
  g = f.indexOf(";isub=");
10646
- g > 0 && (D(e), e.g(f.substring(0, g)));
10647
- if (!Ua(e.toString())) throw Error("The string supplied did not seem to be a phone number");
10648
+ g > 0 && (B(e), e.g(f.substring(0, g)));
10649
+ if (!Va(e.toString())) throw Error("The string supplied did not seem to be a phone number");
10648
10650
  f = e.toString();
10649
- if (!(P(c) || f != null && f.length > 0 && L.test(f))) throw Error("Invalid country calling code");
10650
- f = new I();
10651
- d && t(f, 5, b);
10651
+ if (!(N(c) || f != null && f.length > 0 && J.test(f))) throw Error("Invalid country calling code");
10652
+ f = new G();
10653
+ d && r(f, 5, b);
10652
10654
  a: {
10653
10655
  b = e.toString();
10654
- g = b.search(Qa);
10655
- if (g >= 0 && Ua(b.substring(0, g))) {
10656
- h = b.match(Qa);
10657
- for (var l = h.length, A = 1; A < l; ++A) if (h[A] != null && h[A].length > 0) {
10658
- D(e);
10656
+ g = b.search(Ra);
10657
+ if (g >= 0 && Va(b.substring(0, g))) {
10658
+ h = b.match(Ra);
10659
+ for (var l = h.length, y = 1; y < l; ++y) if (h[y] != null && h[y].length > 0) {
10660
+ B(e);
10659
10661
  e.g(b.substring(0, g));
10660
- b = h[A];
10662
+ b = h[y];
10661
10663
  break a;
10662
10664
  }
10663
10665
  }
10664
10666
  b = "";
10665
10667
  }
10666
- b.length > 0 && t(f, 3, b);
10667
- g = T(a, c);
10668
- b = new C();
10668
+ b.length > 0 && r(f, 3, b);
10669
+ g = R(a, c);
10670
+ b = new A();
10669
10671
  h = 0;
10670
10672
  l = e.toString();
10671
10673
  try {
10672
- h = fb(a, l, g, b, d, f);
10673
- } catch (ca) {
10674
- if (ca.message == "Invalid country calling code" && L.test(l)) {
10675
- if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), h == 0) throw ca;
10676
- } else throw ca;
10674
+ h = gb(a, l, g, b, d, f);
10675
+ } catch (Y) {
10676
+ if (Y.message == "Invalid country calling code" && J.test(l)) {
10677
+ if (l = l.replace(J, ""), h = gb(a, l, g, b, d, f), h == 0) throw Y;
10678
+ } else throw Y;
10677
10679
  }
10678
- h != 0 ? (e = S(h), e != c && (g = R(a, h, e))) : (Wa(e), b.g(e.toString()), c != null ? (h = v(g, 10), t(
10680
+ h != 0 ? (e = Q(h), e != c && (g = P(a, h, e))) : (Xa(e), b.g(e.toString()), c != null ? (h = u(g, 10), r(
10679
10681
  f,
10680
10682
  1,
10681
10683
  h
10682
10684
  )) : d && (delete f.h[6], f.g && delete f.g[6]));
10683
10685
  if (b.h.length < 2) throw Error("The string supplied is too short to be a phone number");
10684
- g != null && (c = new C(), e = new C(b.toString()), gb(e, g, c), a = W(a, e.toString(), g, -1), a != 2 && a != 4 && a != 5 && (b = e, d && c.toString().length > 0 && t(f, 7, c.toString())));
10686
+ g != null && (c = new A(), e = new A(b.toString()), hb(e, g, c), a = U(a, e.toString(), g, -1), a != 2 && a != 4 && a != 5 && (b = e, d && c.toString().length > 0 && r(f, 7, c.toString())));
10685
10687
  d = b.toString();
10686
10688
  a = d.length;
10687
10689
  if (a < 2) throw Error("The string supplied is too short to be a phone number");
10688
10690
  if (a > 17) throw Error("The string supplied is too long to be a phone number");
10689
10691
  if (d.length > 1 && d.charAt(0) == "0") {
10690
- t(f, 4, true);
10692
+ r(f, 4, true);
10691
10693
  for (a = 1; a < d.length - 1 && d.charAt(a) == "0"; ) a++;
10692
- a != 1 && t(f, 8, a);
10694
+ a != 1 && r(f, 8, a);
10693
10695
  }
10694
- t(f, 2, parseInt(d, 10));
10696
+ r(f, 2, parseInt(d, 10));
10695
10697
  return f;
10696
10698
  }
10697
- function N(a, b) {
10699
+ function L(a, b) {
10698
10700
  return (a = b.match(new RegExp("^(?:" + (typeof a == "string" ? a : a.source) + ")$", "i"))) && a[0].length == b.length ? true : false;
10699
10701
  }
10700
10702
  ;
10701
- function ib(a) {
10703
+ function jb(a) {
10702
10704
  this.ga = RegExp("\u2008");
10703
10705
  this.ka = "";
10704
- this.$ = new C();
10706
+ this.$ = new A();
10705
10707
  this.ea = "";
10706
- this.u = new C();
10707
- this.da = new C();
10708
+ this.u = new A();
10709
+ this.da = new A();
10708
10710
  this.v = true;
10709
10711
  this.fa = this.aa = this.ma = false;
10710
- this.ha = K.g();
10712
+ this.ha = I.g();
10711
10713
  this.ba = 0;
10712
- this.h = new C();
10714
+ this.h = new A();
10713
10715
  this.ia = false;
10714
10716
  this.o = "";
10715
- this.g = new C();
10717
+ this.g = new A();
10716
10718
  this.j = [];
10717
10719
  this.la = a;
10718
- this.l = jb(this, this.la);
10720
+ this.l = kb(this, this.la);
10719
10721
  }
10720
- var kb = new H();
10721
- t(kb, 11, "NA");
10722
- var lb = RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*\\$1[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*(\\$\\d[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*)*$"), mb = /[- ]/;
10723
- function jb(a, b) {
10722
+ var lb = new F();
10723
+ r(lb, 11, "NA");
10724
+ var mb = RegExp("^[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*\\$1[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*(\\$\\d[-x\u2010-\u2015\u2212\u30FC\uFF0D-\uFF0F \xA0\xAD\u200B\u2060\u3000()\uFF08\uFF09\uFF3B\uFF3D.\\[\\]/~\u2053\u223C\uFF5E]*)*$"), nb = /[- ]/;
10725
+ function kb(a, b) {
10724
10726
  var c = a.ha;
10725
- b = P(b) ? db(c, b) : 0;
10726
- a = T(a.ha, S(b));
10727
- return a != null ? a : kb;
10727
+ b = N(b) ? eb(c, b) : 0;
10728
+ a = R(a.ha, Q(b));
10729
+ return a != null ? a : lb;
10728
10730
  }
10729
- function nb(a) {
10731
+ function ob(a) {
10730
10732
  for (var b = a.j.length, c = 0; c < b; ++c) {
10731
- var d = a.j[c], e = v(d, 1);
10733
+ var d = a.j[c], e = u(d, 1);
10732
10734
  if (a.ea == e) return false;
10733
10735
  var f = a;
10734
- var g = d, h = v(g, 1);
10735
- D(f.$);
10736
+ var g = d, h = u(g, 1);
10737
+ B(f.$);
10736
10738
  var l = f;
10737
- g = v(g, 2);
10738
- var A = "999999999999999".match(h)[0];
10739
- A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
10739
+ g = u(g, 2);
10740
+ var y = "999999999999999".match(h)[0];
10741
+ y.length < l.g.h.length ? l = "" : (l = y.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
10740
10742
  l.length > 0 ? (f.$.g(l), f = true) : f = false;
10741
- if (f) return a.ea = e, a.ia = mb.test(r(d, 4)), a.ba = 0, true;
10743
+ if (f) return a.ea = e, a.ia = nb.test(q(d, 4)), a.ba = 0, true;
10742
10744
  }
10743
10745
  return a.v = false;
10744
10746
  }
10745
- function ob(a, b) {
10747
+ function pb(a, b) {
10746
10748
  for (var c = [], d = b.length - 3, e = a.j.length, f = 0; f < e; ++f) {
10747
10749
  var g = a.j[f];
10748
- w(g, 3) == 0 ? c.push(a.j[f]) : (g = r(g, 3, Math.min(d, w(g, 3) - 1)), b.search(g) == 0 && c.push(a.j[f]));
10750
+ v(g, 3) == 0 ? c.push(a.j[f]) : (g = q(g, 3, Math.min(d, v(g, 3) - 1)), b.search(g) == 0 && c.push(a.j[f]));
10749
10751
  }
10750
10752
  a.j = c;
10751
10753
  }
10752
- function pb(a, b) {
10754
+ function qb(a, b) {
10753
10755
  a.u.g(b);
10754
10756
  var c = b;
10755
- Ia.test(c) || a.u.h.length == 1 && Ha.test(c) ? (b == "+" ? (c = b, a.da.g(b)) : (c = Ea[b], a.da.g(c), a.g.g(c)), b = c) : (a.v = false, a.ma = true);
10757
+ Ja.test(c) || a.u.h.length == 1 && Ia.test(c) ? (b == "+" ? (c = b, a.da.g(b)) : (c = Fa[b], a.da.g(c), a.g.g(c)), b = c) : (a.v = false, a.ma = true);
10756
10758
  if (!a.v) {
10757
10759
  if (!a.ma) {
10758
- if (qb(a)) {
10759
- if (rb(a)) return sb(a);
10760
- } else if (a.o.length > 0 && (b = a.g.toString(), D(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), D(a.h), a.h.g(b.substring(0, c))), a.o != tb(a)) return a.h.g(" "), sb(a);
10760
+ if (rb(a)) {
10761
+ if (sb(a)) return tb(a);
10762
+ } else if (a.o.length > 0 && (b = a.g.toString(), B(a.g), a.g.g(a.o), a.g.g(b), b = a.h.toString(), c = b.lastIndexOf(a.o), B(a.h), a.h.g(b.substring(0, c))), a.o != ub(a)) return a.h.g(" "), tb(a);
10761
10763
  }
10762
10764
  return a.u.toString();
10763
10765
  }
@@ -10767,93 +10769,93 @@ var _scope = {};
10767
10769
  case 2:
10768
10770
  return a.u.toString();
10769
10771
  case 3:
10770
- if (qb(a)) a.fa = true;
10771
- else return a.o = tb(a), ub(a);
10772
+ if (rb(a)) a.fa = true;
10773
+ else return a.o = ub(a), vb(a);
10772
10774
  default:
10773
- if (a.fa) return rb(a) && (a.fa = false), a.h.toString() + a.g.toString();
10775
+ if (a.fa) return sb(a) && (a.fa = false), a.h.toString() + a.g.toString();
10774
10776
  if (a.j.length > 0) {
10775
- b = vb(a, b);
10776
- c = wb(a);
10777
+ b = wb(a, b);
10778
+ c = xb(a);
10777
10779
  if (c.length > 0) return c;
10778
- ob(a, a.g.toString());
10779
- return nb(a) ? xb(a) : a.v ? Z(a, b) : a.u.toString();
10780
+ pb(a, a.g.toString());
10781
+ return ob(a) ? yb(a) : a.v ? X(a, b) : a.u.toString();
10780
10782
  }
10781
- return ub(a);
10783
+ return vb(a);
10782
10784
  }
10783
10785
  }
10784
- function sb(a) {
10786
+ function tb(a) {
10785
10787
  a.v = true;
10786
10788
  a.fa = false;
10787
10789
  a.j = [];
10788
10790
  a.ba = 0;
10789
- D(a.$);
10791
+ B(a.$);
10790
10792
  a.ea = "";
10791
- return ub(a);
10793
+ return vb(a);
10792
10794
  }
10793
- function wb(a) {
10795
+ function xb(a) {
10794
10796
  for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
10795
- var e = a.j[d], f = v(e, 1);
10796
- if (new RegExp("^(?:" + f + ")$").test(b) && (a.ia = mb.test(r(e, 4)), e = b.replace(new RegExp(f, "g"), r(e, 2)), e = Z(a, e), O(e, Fa) == a.da)) return e;
10797
+ var e = a.j[d], f = u(e, 1);
10798
+ if (new RegExp("^(?:" + f + ")$").test(b) && (a.ia = nb.test(q(e, 4)), e = b.replace(new RegExp(f, "g"), q(e, 2)), e = X(a, e), M(e, Ga) == a.da)) return e;
10797
10799
  }
10798
10800
  return "";
10799
10801
  }
10800
- function Z(a, b) {
10802
+ function X(a, b) {
10801
10803
  var c = a.h.h.length;
10802
10804
  return a.ia && c > 0 && a.h.toString().charAt(c - 1) != " " ? a.h + " " + b : a.h + b;
10803
10805
  }
10804
- function ub(a) {
10806
+ function vb(a) {
10805
10807
  var b = a.g.toString();
10806
10808
  if (b.length >= 3) {
10807
- for (var c = a.aa && a.o.length == 0 && w(a.l, 20) > 0 ? u(a.l, 20) || [] : u(a.l, 19) || [], d = c.length, e = 0; e < d; ++e) {
10809
+ for (var c = a.aa && a.o.length == 0 && v(a.l, 20) > 0 ? t(a.l, 20) || [] : t(a.l, 19) || [], d = c.length, e = 0; e < d; ++e) {
10808
10810
  var f = c[e];
10809
- a.o.length > 0 && Ya(v(f, 4)) && !r(f, 6) && !q(f, 5) || (a.o.length != 0 || a.aa || Ya(v(f, 4)) || r(f, 6)) && lb.test(v(f, 2)) && a.j.push(f);
10811
+ a.o.length > 0 && Za(u(f, 4)) && !q(f, 6) && !p(f, 5) || (a.o.length != 0 || a.aa || Za(u(f, 4)) || q(f, 6)) && mb.test(u(f, 2)) && a.j.push(f);
10810
10812
  }
10811
- ob(a, b);
10812
- b = wb(a);
10813
- return b.length > 0 ? b : nb(a) ? xb(a) : a.u.toString();
10813
+ pb(a, b);
10814
+ b = xb(a);
10815
+ return b.length > 0 ? b : ob(a) ? yb(a) : a.u.toString();
10814
10816
  }
10815
- return Z(a, b);
10817
+ return X(a, b);
10816
10818
  }
10817
- function xb(a) {
10819
+ function yb(a) {
10818
10820
  var b = a.g.toString(), c = b.length;
10819
10821
  if (c > 0) {
10820
- for (var d = "", e = 0; e < c; e++) d = vb(a, b.charAt(e));
10821
- return a.v ? Z(a, d) : a.u.toString();
10822
+ for (var d = "", e = 0; e < c; e++) d = wb(a, b.charAt(e));
10823
+ return a.v ? X(a, d) : a.u.toString();
10822
10824
  }
10823
10825
  return a.h.toString();
10824
10826
  }
10825
- function tb(a) {
10827
+ function ub(a) {
10826
10828
  var b = a.g.toString(), c = 0;
10827
- if (r(a.l, 10) != 1) var d = false;
10829
+ if (q(a.l, 10) != 1) var d = false;
10828
10830
  else d = a.g.toString(), d = d.charAt(0) == "1" && d.charAt(1) != "0" && d.charAt(1) != "1";
10829
- d ? (c = 1, a.h.g("1").g(" "), a.aa = true) : q(a.l, 15) && (d = new RegExp("^(?:" + r(a.l, 15) + ")"), d = b.match(d), d != null && d[0] != null && d[0].length > 0 && (a.aa = true, c = d[0].length, a.h.g(b.substring(0, c))));
10830
- D(a.g);
10831
+ d ? (c = 1, a.h.g("1").g(" "), a.aa = true) : p(a.l, 15) && (d = new RegExp("^(?:" + q(a.l, 15) + ")"), d = b.match(d), d != null && d[0] != null && d[0].length > 0 && (a.aa = true, c = d[0].length, a.h.g(b.substring(0, c))));
10832
+ B(a.g);
10831
10833
  a.g.g(b.substring(c));
10832
10834
  return b.substring(0, c);
10833
10835
  }
10834
- function qb(a) {
10835
- var b = a.da.toString(), c = new RegExp("^(?:\\+|" + r(a.l, 11) + ")");
10836
+ function rb(a) {
10837
+ var b = a.da.toString(), c = new RegExp("^(?:\\+|" + q(a.l, 11) + ")");
10836
10838
  c = b.match(c);
10837
- return c != null && c[0] != null && c[0].length > 0 ? (a.aa = true, c = c[0].length, D(a.g), a.g.g(b.substring(c)), D(a.h), a.h.g(b.substring(0, c)), b.charAt(0) != "+" && a.h.g(" "), true) : false;
10839
+ return c != null && c[0] != null && c[0].length > 0 ? (a.aa = true, c = c[0].length, B(a.g), a.g.g(b.substring(c)), B(a.h), a.h.g(b.substring(0, c)), b.charAt(0) != "+" && a.h.g(" "), true) : false;
10838
10840
  }
10839
- function rb(a) {
10841
+ function sb(a) {
10840
10842
  if (a.g.h.length == 0) return false;
10841
- var b = new C(), c = eb(a.g, b);
10843
+ var b = new A(), c = fb(a.g, b);
10842
10844
  if (c == 0) return false;
10843
- D(a.g);
10845
+ B(a.g);
10844
10846
  a.g.g(b.toString());
10845
- b = S(c);
10846
- "001" == b ? a.l = T(a.ha, "" + c) : b != a.la && (a.l = jb(a, b));
10847
+ b = Q(c);
10848
+ "001" == b ? a.l = R(a.ha, "" + c) : b != a.la && (a.l = kb(a, b));
10847
10849
  a.h.g("" + c).g(" ");
10848
10850
  a.o = "";
10849
10851
  return true;
10850
10852
  }
10851
- function vb(a, b) {
10853
+ function wb(a, b) {
10852
10854
  var c = a.$.toString();
10853
10855
  if (c.substring(a.ba).search(a.ga) >= 0) {
10854
10856
  var d = c.search(a.ga);
10855
10857
  b = c.replace(a.ga, b);
10856
- D(a.$);
10858
+ B(a.$);
10857
10859
  a.$.g(b);
10858
10860
  a.ba = d;
10859
10861
  return b.substring(0, a.ba + 1);
@@ -10863,119 +10865,137 @@ var _scope = {};
10863
10865
  return a.u.toString();
10864
10866
  }
10865
10867
  ;
10866
- const yb = (a) => {
10868
+ const zb = {};
10869
+ ["E164", "INTERNATIONAL", "NATIONAL", "RFC3966"].forEach((a, b) => {
10870
+ zb[a] = b;
10871
+ });
10872
+ const Z = {};
10873
+ "FIXED_LINE MOBILE FIXED_LINE_OR_MOBILE TOLL_FREE PREMIUM_RATE SHARED_COST VOIP PERSONAL_NUMBER PAGER UAN VOICEMAIL UNKNOWN".split(" ").forEach((a, b) => {
10874
+ Z[a] = b;
10875
+ });
10876
+ Z.UNKNOWN = -1;
10877
+ const Ab = {};
10878
+ "IS_POSSIBLE INVALID_COUNTRY_CODE TOO_SHORT TOO_LONG IS_POSSIBLE_LOCAL_ONLY INVALID_LENGTH".split(" ").forEach((a, b) => {
10879
+ Ab[a] = b;
10880
+ });
10881
+ const Bb = {};
10882
+ Object.keys(Z).forEach((a) => {
10883
+ Bb[Z[a]] = a;
10884
+ });
10885
+ const Cb = {};
10886
+ Object.keys(Ab).forEach((a) => {
10887
+ Cb[Ab[a]] = a;
10888
+ });
10889
+ const Db = (a) => {
10867
10890
  const b = [];
10868
10891
  a.includes("FIXED_LINE_OR_MOBILE") ? (a.includes("MOBILE") || b.push("MOBILE"), a.includes("FIXED_LINE") || b.push("FIXED_LINE")) : (a.includes("MOBILE") || a.includes("FIXED_LINE")) && b.push("FIXED_LINE_OR_MOBILE");
10869
10892
  return a.concat(b);
10870
- }, zb = { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 };
10871
- m("utils", {});
10872
- m("utils.formatNumberAsYouType", (a, b) => {
10893
+ };
10894
+ k("utils", {});
10895
+ k("utils.formatNumberAsYouType", (a, b) => {
10873
10896
  try {
10874
- const c = a.replace(/[^+0-9]/g, ""), d = new ib(b);
10897
+ const c = a.replace(/[^+0-9]/g, ""), d = new jb(b);
10875
10898
  b = "";
10876
- for (let e = 0; e < c.length; e++) d.ka = pb(d, c.charAt(e)), b = d.ka;
10899
+ for (let e = 0; e < c.length; e++) d.ka = qb(d, c.charAt(e)), b = d.ka;
10877
10900
  return b;
10878
10901
  } catch {
10879
10902
  return a;
10880
10903
  }
10881
10904
  });
10882
- m("utils.formatNumber", (a, b, c) => {
10905
+ k("utils.formatNumber", (a, b, c) => {
10883
10906
  try {
10884
- const e = K.g(), f = Y(e, a, b);
10885
- var d = X(e, f, -1);
10886
- return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : c) : a;
10907
+ const e = I.g(), f = W(e, a, b);
10908
+ var d = V(e, f, -1);
10909
+ return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : zb[c]) : a;
10887
10910
  } catch {
10888
10911
  return a;
10889
10912
  }
10890
10913
  });
10891
- m("utils.getExampleNumber", (a, b, c, d) => {
10914
+ k("utils.getExampleNumber", (a, b, c, d) => {
10892
10915
  try {
10893
- const l = K.g();
10916
+ const y = I.g();
10894
10917
  a: {
10895
- var e = l;
10896
- if (P(a)) {
10897
- var f = U(T(e, a), c);
10918
+ var e = y, f = Z[c];
10919
+ if (N(a)) {
10920
+ var g = S(R(e, a), f);
10898
10921
  try {
10899
- if (q(f, 6)) {
10900
- var g = r(f, 6);
10901
- var h = hb(e, g, a, false);
10922
+ if (p(g, 6)) {
10923
+ var h = q(g, 6);
10924
+ var l = ib(e, h, a, false);
10902
10925
  break a;
10903
10926
  }
10904
- } catch (A) {
10927
+ } catch (Y) {
10905
10928
  }
10906
10929
  }
10907
- h = null;
10930
+ l = null;
10908
10931
  }
10909
- return l.format(h, d ? 0 : b ? 2 : 1);
10932
+ return y.format(l, d ? 0 : b ? 2 : 1);
10910
10933
  } catch {
10911
10934
  return "";
10912
10935
  }
10913
10936
  });
10914
- m("utils.getExtension", (a, b) => {
10937
+ k("utils.getExtension", (a, b) => {
10915
10938
  try {
10916
- var c = Y(K.g(), a, b);
10917
- return r(c, 3);
10939
+ var c = W(I.g(), a, b);
10940
+ return q(c, 3);
10918
10941
  } catch {
10919
10942
  return "";
10920
10943
  }
10921
10944
  });
10922
- m("utils.getNumberType", (a, b) => {
10945
+ k("utils.getNumberType", (a, b) => {
10923
10946
  try {
10924
- const c = K.g(), d = Y(c, a, b);
10925
- return $a(c, d);
10947
+ const c = I.g(), d = W(c, a, b), e = ab(c, d);
10948
+ return Bb[e] || null;
10926
10949
  } catch {
10927
- return -99;
10950
+ return null;
10928
10951
  }
10929
10952
  });
10930
- m("utils.getValidationError", (a, b) => {
10931
- if (!b) return 1;
10953
+ k("utils.getValidationError", (a, b) => {
10954
+ if (!b) return "INVALID_COUNTRY_CODE";
10932
10955
  try {
10933
- const c = K.g(), d = Y(c, a, b);
10934
- return X(c, d, -1);
10956
+ const c = I.g(), d = W(c, a, b), e = V(c, d, -1);
10957
+ return Cb[e] || null;
10935
10958
  } catch (c) {
10936
- return c.message === "Invalid country calling code" ? 1 : a.length <= 3 || c.message === "Phone number too short after IDD" || c.message === "The string supplied is too short to be a phone number" ? 2 : c.message === "The string supplied is too long to be a phone number" ? 3 : -99;
10959
+ return c.message === "Invalid country calling code" ? "INVALID_COUNTRY_CODE" : a.length <= 3 || c.message === "Phone number too short after IDD" || c.message === "The string supplied is too short to be a phone number" ? "TOO_SHORT" : c.message === "The string supplied is too long to be a phone number" ? "TOO_LONG" : null;
10937
10960
  }
10938
10961
  });
10939
- m("utils.isValidNumber", (a, b, c) => {
10962
+ k("utils.isValidNumber", (a, b, c) => {
10940
10963
  try {
10941
- const d = K.g(), e = Y(d, a, b), f = cb(d, e);
10964
+ const d = I.g(), e = W(d, a, b), f = db(d, e);
10942
10965
  if (c) {
10943
- const g = yb(c).map((h) => zb[h]);
10944
- return f && g.includes($a(d, e));
10966
+ const g = Db(c).map((h) => Z[h]);
10967
+ return f && g.includes(ab(d, e));
10945
10968
  }
10946
10969
  return f;
10947
10970
  } catch {
10948
10971
  return false;
10949
10972
  }
10950
10973
  });
10951
- m("utils.isPossibleNumber", (a, b, c) => {
10974
+ k("utils.isPossibleNumber", (a, b, c) => {
10952
10975
  try {
10953
- const d = K.g(), e = Y(d, a, b);
10976
+ const d = I.g(), e = W(d, a, b);
10954
10977
  if (c) {
10955
- const f = yb(c);
10956
- for (let g of f) if (X(d, e, zb[g]) === 0) return true;
10978
+ const f = Db(c);
10979
+ for (let g of f) if (V(d, e, Z[g]) === 0) return true;
10957
10980
  return false;
10958
10981
  }
10959
- return X(d, e, -1) === 0;
10982
+ return V(d, e, -1) === 0;
10960
10983
  } catch {
10961
10984
  return false;
10962
10985
  }
10963
10986
  });
10964
- m("utils.getCoreNumber", (a, b) => {
10987
+ k("utils.getCoreNumber", (a, b) => {
10965
10988
  try {
10966
- var c = Y(K.g(), a, b);
10967
- return r(c, 2).toString();
10989
+ var c = W(I.g(), a, b);
10990
+ return q(c, 2).toString();
10968
10991
  } catch {
10969
10992
  return "";
10970
10993
  }
10971
10994
  });
10972
- m("utils.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 });
10973
- m("utils.numberType", zb);
10974
- m("utils.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
10975
10995
  }).call(_scope);
10976
10996
  var utils_default = _scope.utils;
10977
10997
 
10978
- // src/js/intlTelInputWithUtils.ts
10998
+ // packages/core/src/js/intlTelInputWithUtils.ts
10979
10999
  intlTelInput_default.utils = utils_default;
10980
11000
  var intlTelInputWithUtils_default = intlTelInput_default;
10981
11001
  export {