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,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v27.3.1
2
+ * International Telephone Input v28.0.0
3
3
  * git+https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -23,13 +23,13 @@ var _factory = (() => {
23
23
  };
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
 
26
- // src/js/intlTelInputWithUtils.ts
26
+ // packages/core/src/js/intlTelInputWithUtils.ts
27
27
  var intlTelInputWithUtils_exports = {};
28
28
  __export(intlTelInputWithUtils_exports, {
29
29
  default: () => intlTelInputWithUtils_default
30
30
  });
31
31
 
32
- // src/js/data.ts
32
+ // packages/core/src/js/data.ts
33
33
  var rawCountryData = [
34
34
  [
35
35
  "af",
@@ -1781,7 +1781,7 @@ var _factory = (() => {
1781
1781
  var isIso2 = (val) => iso2Set.has(val);
1782
1782
  var data_default = allCountries;
1783
1783
 
1784
- // src/js/constants.ts
1784
+ // packages/core/src/js/constants.ts
1785
1785
  var EVENTS = {
1786
1786
  OPEN_COUNTRY_DROPDOWN: "open:countrydropdown",
1787
1787
  CLOSE_COUNTRY_DROPDOWN: "close:countrydropdown",
@@ -1827,10 +1827,6 @@ var _factory = (() => {
1827
1827
  HIDDEN_SEARCH_RESET_MS: 1e3,
1828
1828
  NEXT_TICK: 0
1829
1829
  };
1830
- var SENTINELS = {
1831
- UNKNOWN_NUMBER_TYPE: -99,
1832
- UNKNOWN_VALIDATION_ERROR: -99
1833
- };
1834
1830
  var LAYOUT = {
1835
1831
  NARROW_VIEWPORT_WIDTH: 500,
1836
1832
  // keep in sync with .iti__country-list CSS media query
@@ -1872,6 +1868,12 @@ var _factory = (() => {
1872
1868
  var INITIAL_COUNTRY = {
1873
1869
  AUTO: "auto"
1874
1870
  };
1871
+ var NUMBER_FORMATS = [
1872
+ "E164",
1873
+ "INTERNATIONAL",
1874
+ "NATIONAL",
1875
+ "RFC3966"
1876
+ ];
1875
1877
  var NUMBER_TYPES = [
1876
1878
  "FIXED_LINE",
1877
1879
  "MOBILE",
@@ -1886,11 +1888,21 @@ var _factory = (() => {
1886
1888
  "VOICEMAIL",
1887
1889
  "UNKNOWN"
1888
1890
  ];
1889
- var NUMBER_TYPE_SET = new Set(NUMBER_TYPES);
1891
+ var VALIDATION_ERRORS = [
1892
+ "IS_POSSIBLE",
1893
+ "INVALID_COUNTRY_CODE",
1894
+ "TOO_SHORT",
1895
+ "TOO_LONG",
1896
+ "IS_POSSIBLE_LOCAL_ONLY",
1897
+ "INVALID_LENGTH"
1898
+ ];
1899
+ var toEnumObject = (arr) => Object.fromEntries(arr.map((v) => [v, v]));
1900
+ var NUMBER_FORMAT = toEnumObject(NUMBER_FORMATS);
1901
+ var NUMBER_TYPE = toEnumObject(NUMBER_TYPES);
1902
+ var VALIDATION_ERROR = toEnumObject(VALIDATION_ERRORS);
1890
1903
  var DATA_KEYS = {
1891
- // e.g. <li data-country-code="us"> for country items in dropdown
1892
- // in the future, the value should be changed to "iso2", but this is a breaking change for another day
1893
- ISO2: "countryCode",
1904
+ // e.g. <li data-iso2="us"> for country items in dropdown
1905
+ ISO2: "iso2",
1894
1906
  DIAL_CODE: "dialCode",
1895
1907
  // e.g. <input data-intl-tel-input-id="0"> on the input element
1896
1908
  INSTANCE_ID: "intlTelInputId"
@@ -1907,7 +1919,7 @@ var _factory = (() => {
1907
1919
  MODAL: "aria-modal"
1908
1920
  };
1909
1921
 
1910
- // src/js/i18n/en.ts
1922
+ // packages/core/src/js/i18n/en.ts
1911
1923
  var interfaceTranslations = {
1912
1924
  selectedCountryAriaLabel: "Change country for phone number, currently selected ${countryName} (${dialCode})",
1913
1925
  noCountrySelected: "Select country for phone number",
@@ -1927,7 +1939,7 @@ var _factory = (() => {
1927
1939
  };
1928
1940
  var en_default = interfaceTranslations;
1929
1941
 
1930
- // src/js/core/options.ts
1942
+ // packages/core/src/js/core/options.ts
1931
1943
  var mediaQuery = (q) => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
1932
1944
  var isNarrowViewport = () => mediaQuery(`(max-width: ${LAYOUT.NARROW_VIEWPORT_WIDTH}px)`);
1933
1945
  var computeDefaultUseFullscreenPopup = () => {
@@ -1942,7 +1954,7 @@ var _factory = (() => {
1942
1954
  //* Whether or not to allow the dropdown.
1943
1955
  allowDropdown: true,
1944
1956
  //* The number type to enforce during validation.
1945
- allowedNumberTypes: ["MOBILE", "FIXED_LINE"],
1957
+ allowedNumberTypes: [NUMBER_TYPE.MOBILE, NUMBER_TYPE.FIXED_LINE],
1946
1958
  //* Whether or not to allow extensions after the main number.
1947
1959
  allowNumberExtensions: false,
1948
1960
  // Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
@@ -1953,6 +1965,8 @@ var _factory = (() => {
1953
1965
  containerClass: "",
1954
1966
  //* Locale for localising country names via Intl.DisplayNames.
1955
1967
  countryNameLocale: "en",
1968
+ //* Override individual country names by iso2 code.
1969
+ countryNameOverrides: {},
1956
1970
  //* The order of the countries in the dropdown. Defaults to alphabetical.
1957
1971
  countryOrder: null,
1958
1972
  //* Add a country search input at the top of the dropdown.
@@ -1986,17 +2000,17 @@ var _factory = (() => {
1986
2000
  //* Display only these countries.
1987
2001
  onlyCountries: null,
1988
2002
  //* Number type to use for placeholders.
1989
- placeholderNumberType: "MOBILE",
2003
+ placeholderNumberType: NUMBER_TYPE.MOBILE,
1990
2004
  //* Add custom classes to the search input element.
1991
2005
  searchInputClass: "",
1992
2006
  //* Display the international dial code next to the selected flag.
1993
- separateDialCode: false,
2007
+ separateDialCode: true,
1994
2008
  //* When strictMode rejects a key (etc), play a short feedback animation
1995
- strictRejectAnimation: false,
2009
+ strictRejectAnimation: true,
1996
2010
  //* Show flags - for both the selected country, and in the country dropdown
1997
2011
  showFlags: true,
1998
2012
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1999
- strictMode: false,
2013
+ strictMode: true,
2000
2014
  //* Use full screen popup instead of dropdown for country list.
2001
2015
  useFullscreenPopup: computeDefaultUseFullscreenPopup()
2002
2016
  };
@@ -2140,6 +2154,13 @@ var _factory = (() => {
2140
2154
  }
2141
2155
  validatedOptions[key] = value;
2142
2156
  break;
2157
+ case "countryNameOverrides":
2158
+ if (value && !isPlainObject(value)) {
2159
+ warnOption("countryNameOverrides", "an object", value);
2160
+ break;
2161
+ }
2162
+ validatedOptions[key] = value;
2163
+ break;
2143
2164
  case "initialCountry": {
2144
2165
  if (typeof value !== "string") {
2145
2166
  warnOption("initialCountry", "a string", value);
@@ -2158,8 +2179,8 @@ var _factory = (() => {
2158
2179
  break;
2159
2180
  }
2160
2181
  case "placeholderNumberType":
2161
- if (typeof value !== "string" || !NUMBER_TYPE_SET.has(value)) {
2162
- const validTypes = Array.from(NUMBER_TYPE_SET).join(", ");
2182
+ if (typeof value !== "string" || !NUMBER_TYPES.includes(value)) {
2183
+ const validTypes = NUMBER_TYPES.join(", ");
2163
2184
  warnOption("placeholderNumberType", `one of ${validTypes}`, value);
2164
2185
  break;
2165
2186
  }
@@ -2177,8 +2198,8 @@ var _factory = (() => {
2177
2198
  }
2178
2199
  let allValid = true;
2179
2200
  for (const v of value) {
2180
- if (typeof v !== "string" || !NUMBER_TYPE_SET.has(v)) {
2181
- const validTypes = Array.from(NUMBER_TYPE_SET).join(", ");
2201
+ if (typeof v !== "string" || !NUMBER_TYPES.includes(v)) {
2202
+ const validTypes = NUMBER_TYPES.join(", ");
2182
2203
  warnOption(
2183
2204
  "allowedNumberTypes",
2184
2205
  `an array of valid number types (${validTypes})`,
@@ -2240,11 +2261,11 @@ var _factory = (() => {
2240
2261
  o.i18n = { ...en_default, ...o.i18n };
2241
2262
  };
2242
2263
 
2243
- // src/js/helpers/string.ts
2264
+ // packages/core/src/js/helpers/string.ts
2244
2265
  var getNumeric = (s) => s.replace(/\D/g, "");
2245
2266
  var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
2246
2267
 
2247
- // src/js/helpers/dom.ts
2268
+ // packages/core/src/js/helpers/dom.ts
2248
2269
  var buildClassNames = (flags) => Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
2249
2270
  var createEl = (tagName, attrs, container) => {
2250
2271
  const el = document.createElement(tagName);
@@ -2259,7 +2280,7 @@ var _factory = (() => {
2259
2280
  return el;
2260
2281
  };
2261
2282
 
2262
- // src/js/core/icons.ts
2283
+ // packages/core/src/js/core/icons.ts
2263
2284
  var buildSearchIcon = () => `
2264
2285
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" ${ARIA.HIDDEN}="true">
2265
2286
  <circle cx="11" cy="11" r="7" />
@@ -2286,7 +2307,7 @@ var _factory = (() => {
2286
2307
  <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"/>
2287
2308
  </svg>`;
2288
2309
 
2289
- // src/js/core/countrySearch.ts
2310
+ // packages/core/src/js/core/countrySearch.ts
2290
2311
  var buildSearchTokens = (countries) => {
2291
2312
  const tokens = /* @__PURE__ */ new Map();
2292
2313
  for (const c of countries) {
@@ -2346,7 +2367,7 @@ var _factory = (() => {
2346
2367
  return null;
2347
2368
  };
2348
2369
 
2349
- // src/js/core/numerals.ts
2370
+ // packages/core/src/js/core/numerals.ts
2350
2371
  var Numerals = class _Numerals {
2351
2372
  #userNumeralSet;
2352
2373
  //* Stateless conversion of any Arabic-Indic / Persian digits to ASCII 0-9.
@@ -2404,7 +2425,7 @@ var _factory = (() => {
2404
2425
  }
2405
2426
  };
2406
2427
 
2407
- // src/js/core/ui.ts
2428
+ // packages/core/src/js/core/ui.ts
2408
2429
  var UI = class _UI {
2409
2430
  // private
2410
2431
  #options;
@@ -3157,7 +3178,7 @@ var _factory = (() => {
3157
3178
  }
3158
3179
  if (iso2 && !this.#selectedListItemEl) {
3159
3180
  const newListItem = this.#countryListEl.querySelector(
3160
- `[data-country-code="${iso2}"]`
3181
+ `[data-iso2="${iso2}"]`
3161
3182
  );
3162
3183
  if (newListItem) {
3163
3184
  newListItem.setAttribute(ARIA.SELECTED, "true");
@@ -3345,7 +3366,7 @@ var _factory = (() => {
3345
3366
  }
3346
3367
  };
3347
3368
 
3348
- // src/js/data/country-data.ts
3369
+ // packages/core/src/js/data/country-data.ts
3349
3370
  var processAllCountries = (options) => {
3350
3371
  const { onlyCountries, excludeCountries } = options;
3351
3372
  if (onlyCountries?.length) {
@@ -3360,7 +3381,7 @@ var _factory = (() => {
3360
3381
  return [...data_default];
3361
3382
  };
3362
3383
  var generateCountryNames = (countries, options) => {
3363
- const { countryNameLocale, i18n } = options;
3384
+ const { countryNameLocale, countryNameOverrides } = options;
3364
3385
  let displayNames;
3365
3386
  try {
3366
3387
  const hasDisplayNames = typeof Intl !== "undefined" && typeof Intl.DisplayNames === "function";
@@ -3376,7 +3397,7 @@ var _factory = (() => {
3376
3397
  displayNames = null;
3377
3398
  }
3378
3399
  for (const c of countries) {
3379
- c.name = i18n[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
3400
+ c.name = countryNameOverrides[c.iso2] || displayNames?.of(c.iso2.toUpperCase()) || "";
3380
3401
  }
3381
3402
  };
3382
3403
  var processDialCodes = (countries) => {
@@ -3445,7 +3466,7 @@ var _factory = (() => {
3445
3466
  });
3446
3467
  };
3447
3468
 
3448
- // src/js/data/intl-regionless.ts
3469
+ // packages/core/src/js/data/intl-regionless.ts
3449
3470
  var regionlessDialCodes = /* @__PURE__ */ new Set([
3450
3471
  "800",
3451
3472
  "808",
@@ -3461,7 +3482,7 @@ var _factory = (() => {
3461
3482
  return number.startsWith("+") && regionlessDialCodes.has(dialCode);
3462
3483
  };
3463
3484
 
3464
- // src/js/format/formatting.ts
3485
+ // packages/core/src/js/format/formatting.ts
3465
3486
  var stripSeparateDialCode = (fullNumber, hasValidDialCode, separateDialCode, selectedCountryData) => {
3466
3487
  if (!separateDialCode || !hasValidDialCode) {
3467
3488
  return fullNumber;
@@ -3480,7 +3501,7 @@ var _factory = (() => {
3480
3501
  return result;
3481
3502
  };
3482
3503
 
3483
- // src/js/format/caret.ts
3504
+ // packages/core/src/js/format/caret.ts
3484
3505
  var computeNewCaretPosition = (relevantChars, formattedValue, prevCaretPos, isDeleteForwards) => {
3485
3506
  if (prevCaretPos === 0 && !isDeleteForwards) {
3486
3507
  return 0;
@@ -3500,7 +3521,7 @@ var _factory = (() => {
3500
3521
  return formattedValue.length;
3501
3522
  };
3502
3523
 
3503
- // src/js/data/nanp-regionless.ts
3524
+ // packages/core/src/js/data/nanp-regionless.ts
3504
3525
  var regionlessNanpAreaCodes = /* @__PURE__ */ new Set([
3505
3526
  "800",
3506
3527
  "822",
@@ -3529,7 +3550,7 @@ var _factory = (() => {
3529
3550
  return false;
3530
3551
  };
3531
3552
 
3532
- // src/js/intlTelInput.ts
3553
+ // packages/core/src/js/intlTelInput.ts
3533
3554
  var nextId = 0;
3534
3555
  var ensureUtils = (methodName) => {
3535
3556
  if (!intlTelInput.utils) {
@@ -3696,7 +3717,7 @@ var _factory = (() => {
3696
3717
  if (this.#utilsDeferred) {
3697
3718
  const { loadUtils } = this.#options;
3698
3719
  const doAttachUtils = () => {
3699
- intlTelInput.attachUtils(loadUtils)?.catch(() => {
3720
+ intlTelInput.attachUtils(loadUtils).catch(() => {
3700
3721
  });
3701
3722
  };
3702
3723
  if (intlTelInput.documentReady()) {
@@ -3716,7 +3737,7 @@ var _factory = (() => {
3716
3737
  }
3717
3738
  }
3718
3739
  //* Perform the geo ip lookup.
3719
- #loadAutoCountry() {
3740
+ async #loadAutoCountry() {
3720
3741
  if (intlTelInput.autoCountry) {
3721
3742
  this.#handleAutoCountryLoaded();
3722
3743
  return;
@@ -3727,19 +3748,18 @@ var _factory = (() => {
3727
3748
  }
3728
3749
  intlTelInput.startedLoadingAutoCountry = true;
3729
3750
  if (typeof this.#options.geoIpLookup === "function") {
3730
- const successCallback = (iso2 = "") => {
3731
- const iso2Lower = iso2.toLowerCase();
3732
- if (isIso2(iso2Lower)) {
3733
- intlTelInput.autoCountry = iso2Lower;
3734
- setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
3735
- } else {
3751
+ try {
3752
+ const iso2 = await this.#options.geoIpLookup();
3753
+ const iso2Lower = typeof iso2 === "string" ? iso2.toLowerCase() : "";
3754
+ if (!isIso2(iso2Lower)) {
3736
3755
  _Iti.forEachInstance("handleAutoCountryFailure");
3756
+ return;
3737
3757
  }
3738
- };
3739
- const failureCallback = () => {
3758
+ intlTelInput.autoCountry = iso2Lower;
3759
+ setTimeout(() => _Iti.forEachInstance("handleAutoCountryLoaded"));
3760
+ } catch {
3740
3761
  _Iti.forEachInstance("handleAutoCountryFailure");
3741
- };
3742
- this.#options.geoIpLookup(successCallback, failureCallback);
3762
+ }
3743
3763
  }
3744
3764
  }
3745
3765
  #openDropdownWithPlus() {
@@ -4054,8 +4074,7 @@ var _factory = (() => {
4054
4074
  if (formatOnDisplay && intlTelInput.utils && this.#selectedCountry) {
4055
4075
  const isRegionless = hasRegionlessDialCode(fullNumber);
4056
4076
  const useNational = nationalMode && !isRegionless || !number.startsWith("+") && !separateDialCode;
4057
- const { NATIONAL, INTERNATIONAL } = intlTelInput.utils.numberFormat;
4058
- const format = useNational ? NATIONAL : INTERNATIONAL;
4077
+ const format = useNational ? NUMBER_FORMAT.NATIONAL : NUMBER_FORMAT.INTERNATIONAL;
4059
4078
  number = intlTelInput.utils.formatNumber(
4060
4079
  number,
4061
4080
  this.#selectedCountry?.iso2,
@@ -4175,11 +4194,10 @@ var _factory = (() => {
4175
4194
  this.#maxCoreNumberLength = null;
4176
4195
  return;
4177
4196
  }
4178
- const numberType = intlTelInput.utils.numberType[placeholderNumberType];
4179
4197
  let exampleNumber = intlTelInput.utils.getExampleNumber(
4180
4198
  iso2,
4181
4199
  false,
4182
- numberType,
4200
+ placeholderNumberType,
4183
4201
  true
4184
4202
  );
4185
4203
  let validNumber = exampleNumber;
@@ -4209,11 +4227,10 @@ var _factory = (() => {
4209
4227
  if (!intlTelInput.utils || !shouldSetPlaceholder) {
4210
4228
  return;
4211
4229
  }
4212
- const numberType = intlTelInput.utils.numberType[placeholderNumberType];
4213
4230
  let placeholder = this.#selectedCountry ? intlTelInput.utils.getExampleNumber(
4214
4231
  this.#selectedCountry.iso2,
4215
4232
  nationalMode,
4216
- numberType
4233
+ placeholderNumberType
4217
4234
  ) : "";
4218
4235
  placeholder = this.#prepareNumberForInput(placeholder);
4219
4236
  if (typeof customPlaceholder === "function") {
@@ -4323,19 +4340,9 @@ var _factory = (() => {
4323
4340
  );
4324
4341
  return this.#truncateToMaxLength(number);
4325
4342
  }
4326
- //* Return only the public-facing subset of the selected country data.
4327
- #getPublicCountryData() {
4328
- const d = this.#selectedCountry;
4329
- if (!d) {
4330
- return null;
4331
- }
4332
- const { iso2, dialCode, name } = d;
4333
- return { iso2, dialCode, name };
4334
- }
4335
4343
  //* Dispatch the 'countrychange' event.
4336
4344
  #dispatchCountryChangeEvent() {
4337
- const countryData = this.#getPublicCountryData();
4338
- this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, countryData);
4345
+ this.#dispatchEvent(EVENTS.COUNTRY_CHANGE, this.#selectedCountry ?? null);
4339
4346
  }
4340
4347
  //**************************
4341
4348
  //* INTERNAL METHODS
@@ -4426,7 +4433,7 @@ var _factory = (() => {
4426
4433
  this.#selectedCountry?.iso2
4427
4434
  );
4428
4435
  }
4429
- //* Format the number to the given format.
4436
+ //* Format the number to the given format (defaults to "E164").
4430
4437
  getNumber(format) {
4431
4438
  if (!this.#isActive) {
4432
4439
  return "";
@@ -4441,10 +4448,10 @@ var _factory = (() => {
4441
4448
  );
4442
4449
  return this.#numerals.denormalise(formattedNumber);
4443
4450
  }
4444
- //* Get the type of the entered number e.g. landline/mobile.
4451
+ //* Get the type of the entered number e.g. "FIXED_LINE" / "MOBILE", or null if it can't be determined / instance is destroyed.
4445
4452
  getNumberType() {
4446
4453
  if (!this.#isActive) {
4447
- return SENTINELS.UNKNOWN_NUMBER_TYPE;
4454
+ return null;
4448
4455
  }
4449
4456
  ensureUtils("getNumberType");
4450
4457
  return intlTelInput.utils.getNumberType(
@@ -4454,12 +4461,12 @@ var _factory = (() => {
4454
4461
  }
4455
4462
  //* Get the country data for the currently selected country.
4456
4463
  getSelectedCountryData() {
4457
- return this.#getPublicCountryData();
4464
+ return this.#selectedCountry ?? null;
4458
4465
  }
4459
- //* Get the validation error.
4466
+ //* Get the validation error e.g. "TOO_SHORT" / "TOO_LONG", or null if it can't be determined / instance is destroyed.
4460
4467
  getValidationError() {
4461
4468
  if (!this.#isActive) {
4462
- return SENTINELS.UNKNOWN_VALIDATION_ERROR;
4469
+ return null;
4463
4470
  }
4464
4471
  ensureUtils("getValidationError");
4465
4472
  const iso2 = this.#selectedCountry?.iso2;
@@ -4608,39 +4615,31 @@ var _factory = (() => {
4608
4615
  });
4609
4616
  }
4610
4617
  };
4611
- var attachUtils = (source) => {
4612
- if (!intlTelInput.utils && !intlTelInput.startedLoadingUtils) {
4613
- let loadCall;
4614
- if (typeof source === "function") {
4615
- try {
4616
- loadCall = Promise.resolve(source());
4617
- } catch (error) {
4618
- return Promise.reject(error);
4619
- }
4620
- } else {
4621
- return Promise.reject(
4622
- new TypeError(
4623
- `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4624
- )
4618
+ var attachUtils = async (source) => {
4619
+ if (intlTelInput.utils || intlTelInput.startedLoadingUtils) {
4620
+ return null;
4621
+ }
4622
+ if (typeof source !== "function") {
4623
+ throw new TypeError(
4624
+ `The argument passed to attachUtils must be a function that returns a promise for the utils module, not ${typeof source}`
4625
+ );
4626
+ }
4627
+ intlTelInput.startedLoadingUtils = true;
4628
+ try {
4629
+ const module = await source();
4630
+ const utils = module?.default;
4631
+ if (!utils || typeof utils !== "object") {
4632
+ throw new TypeError(
4633
+ "The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
4625
4634
  );
4626
4635
  }
4627
- intlTelInput.startedLoadingUtils = true;
4628
- return loadCall.then((module) => {
4629
- const utils = module?.default;
4630
- if (!utils || typeof utils !== "object") {
4631
- throw new TypeError(
4632
- "The loader function passed to attachUtils did not resolve to a module object with utils as its default export."
4633
- );
4634
- }
4635
- intlTelInput.utils = utils;
4636
- Iti.forEachInstance("handleUtilsLoaded");
4637
- return true;
4638
- }).catch((error) => {
4639
- Iti.forEachInstance("handleUtilsFailure", error);
4640
- throw error;
4641
- });
4636
+ intlTelInput.utils = utils;
4637
+ Iti.forEachInstance("handleUtilsLoaded");
4638
+ return true;
4639
+ } catch (error) {
4640
+ Iti.forEachInstance("handleUtilsFailure", error);
4641
+ throw error;
4642
4642
  }
4643
- return null;
4644
4643
  };
4645
4644
  var intlTelInput = Object.assign(
4646
4645
  (input, options) => {
@@ -4665,22 +4664,25 @@ var _factory = (() => {
4665
4664
  attachUtils,
4666
4665
  startedLoadingUtils: false,
4667
4666
  startedLoadingAutoCountry: false,
4668
- version: "27.3.1"
4667
+ version: "28.0.0",
4668
+ NUMBER_FORMAT,
4669
+ NUMBER_TYPE,
4670
+ VALIDATION_ERROR
4669
4671
  }
4670
4672
  );
4671
4673
  var intlTelInput_default = intlTelInput;
4672
4674
 
4673
- // dist/js/utils.js
4675
+ // packages/core/dist/js/utils.js
4674
4676
  var _scope = {};
4675
4677
  (function() {
4676
- var k = this || self;
4677
- function m(a, b) {
4678
+ var aa = this || self;
4679
+ function k(a, b) {
4678
4680
  a = a.split(".");
4679
- var c = k;
4681
+ var c = aa;
4680
4682
  a[0] in c || typeof c.execScript == "undefined" || c.execScript("var " + a[0]);
4681
4683
  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;
4682
4684
  }
4683
- function n(a, b) {
4685
+ function m(a, b) {
4684
4686
  function c() {
4685
4687
  }
4686
4688
  c.prototype = b.prototype;
@@ -4693,7 +4695,7 @@ var _factory = (() => {
4693
4695
  };
4694
4696
  }
4695
4697
  ;
4696
- function aa(a) {
4698
+ function ba(a) {
4697
4699
  const b = [];
4698
4700
  let c = 0;
4699
4701
  for (const d in a) b[c++] = a[d];
@@ -4702,13 +4704,13 @@ var _factory = (() => {
4702
4704
  ;
4703
4705
  var da = class {
4704
4706
  constructor(a) {
4705
- if (ba !== ba) throw Error("SafeUrl is not meant to be built directly");
4707
+ if (ca !== ca) throw Error("SafeUrl is not meant to be built directly");
4706
4708
  this.g = a;
4707
4709
  }
4708
4710
  toString() {
4709
4711
  return this.g.toString();
4710
4712
  }
4711
- }, ba = {};
4713
+ }, ca = {};
4712
4714
  new da("about:invalid#zClosurez");
4713
4715
  new da("about:blank");
4714
4716
  const ea = {};
@@ -4734,7 +4736,7 @@ var _factory = (() => {
4734
4736
  const ja = {};
4735
4737
  class ka {
4736
4738
  constructor() {
4737
- var a = k.trustedTypes && k.trustedTypes.emptyHTML || "";
4739
+ var a = aa.trustedTypes && aa.trustedTypes.emptyHTML || "";
4738
4740
  if (ja !== ja) throw Error("SafeHtml is not meant to be built directly");
4739
4741
  this.g = a;
4740
4742
  }
@@ -4771,38 +4773,38 @@ var _factory = (() => {
4771
4773
  }
4772
4774
  }
4773
4775
  function ua(a) {
4774
- a = aa(a.g);
4776
+ a = ba(a.g);
4775
4777
  a.sort(function(b, c) {
4776
4778
  return b.g - c.g;
4777
4779
  });
4778
4780
  return a;
4779
4781
  }
4780
4782
  ;
4781
- function p() {
4783
+ function n() {
4782
4784
  this.h = {};
4783
4785
  this.j = this.m().g;
4784
4786
  this.g = this.l = null;
4785
4787
  }
4786
- p.prototype.has = function(a) {
4787
- return q(this, a.g);
4788
+ n.prototype.has = function(a) {
4789
+ return p(this, a.g);
4788
4790
  };
4789
- p.prototype.get = function(a, b) {
4790
- return r(this, a.g, b);
4791
+ n.prototype.get = function(a, b) {
4792
+ return q(this, a.g, b);
4791
4793
  };
4792
- p.prototype.set = function(a, b) {
4793
- t(this, a.g, b);
4794
+ n.prototype.set = function(a, b) {
4795
+ r(this, a.g, b);
4794
4796
  };
4795
- p.prototype.add = function(a, b) {
4797
+ n.prototype.add = function(a, b) {
4796
4798
  va(this, a.g, b);
4797
4799
  };
4798
- p.prototype.equals = function(a) {
4800
+ n.prototype.equals = function(a) {
4799
4801
  if (!a || this.constructor != a.constructor) return false;
4800
4802
  for (var b = ua(this.m()), c = 0; c < b.length; c++) {
4801
4803
  var d = b[c], e = d.g;
4802
- if (q(this, e) != q(a, e)) return false;
4803
- if (q(this, e)) {
4804
- var f = d.h == 11 || d.h == 10, g = u(this, e);
4805
- e = u(a, e);
4804
+ if (p(this, e) != p(a, e)) return false;
4805
+ if (p(this, e)) {
4806
+ var f = d.h == 11 || d.h == 10, g = t(this, e);
4807
+ e = t(a, e);
4806
4808
  if (d.l) {
4807
4809
  if (g.length != e.length) return false;
4808
4810
  for (d = 0; d < g.length; d++) {
@@ -4817,25 +4819,25 @@ var _factory = (() => {
4817
4819
  function wa(a, b) {
4818
4820
  for (var c = ua(a.m()), d = 0; d < c.length; d++) {
4819
4821
  var e = c[d], f = e.g;
4820
- if (q(b, f)) {
4822
+ if (p(b, f)) {
4821
4823
  a.g && delete a.g[e.g];
4822
4824
  var g = e.h == 11 || e.h == 10;
4823
4825
  if (e.l) {
4824
- e = u(b, f) || [];
4826
+ e = t(b, f) || [];
4825
4827
  for (var h = 0; h < e.length; h++) va(a, f, g ? e[h].clone() : e[h]);
4826
- } else e = u(b, f), g ? (g = u(a, f)) ? wa(g, e) : t(a, f, e.clone()) : t(a, f, e);
4828
+ } else e = t(b, f), g ? (g = t(a, f)) ? wa(g, e) : r(a, f, e.clone()) : r(a, f, e);
4827
4829
  }
4828
4830
  }
4829
4831
  }
4830
- p.prototype.clone = function() {
4832
+ n.prototype.clone = function() {
4831
4833
  var a = new this.constructor();
4832
4834
  a != this && (a.h = {}, a.g && (a.g = {}), wa(a, this));
4833
4835
  return a;
4834
4836
  };
4835
- function q(a, b) {
4837
+ function p(a, b) {
4836
4838
  return a.h[b] != null;
4837
4839
  }
4838
- function u(a, b) {
4840
+ function t(a, b) {
4839
4841
  var c = a.h[b];
4840
4842
  if (c == null) return null;
4841
4843
  if (a.l) {
@@ -4851,12 +4853,12 @@ var _factory = (() => {
4851
4853
  }
4852
4854
  return c;
4853
4855
  }
4854
- function r(a, b, c) {
4855
- var d = u(a, b);
4856
+ function q(a, b, c) {
4857
+ var d = t(a, b);
4856
4858
  return a.j[b].l ? d[c || 0] : d;
4857
4859
  }
4858
- function v(a, b) {
4859
- if (q(a, b)) a = r(a, b);
4860
+ function u(a, b) {
4861
+ if (p(a, b)) a = q(a, b);
4860
4862
  else a: {
4861
4863
  a = a.j[b];
4862
4864
  if (a.j === void 0) if (b = a.u, b === Boolean) a.j = false;
@@ -4870,10 +4872,10 @@ var _factory = (() => {
4870
4872
  }
4871
4873
  return a;
4872
4874
  }
4873
- function w(a, b) {
4874
- return a.j[b].l ? q(a, b) ? a.h[b].length : 0 : q(a, b) ? 1 : 0;
4875
+ function v(a, b) {
4876
+ return a.j[b].l ? p(a, b) ? a.h[b].length : 0 : p(a, b) ? 1 : 0;
4875
4877
  }
4876
- function t(a, b, c) {
4878
+ function r(a, b, c) {
4877
4879
  a.h[b] = c;
4878
4880
  a.g && (a.g[b] = c);
4879
4881
  }
@@ -4882,20 +4884,20 @@ var _factory = (() => {
4882
4884
  a.h[b].push(c);
4883
4885
  a.g && delete a.g[b];
4884
4886
  }
4885
- function x(a, b) {
4887
+ function w(a, b) {
4886
4888
  var c = [], d;
4887
4889
  for (d in b) d != 0 && c.push(new la(d, b[d]));
4888
4890
  return new ta(a, c);
4889
4891
  }
4890
4892
  ;
4891
- function y() {
4893
+ function x() {
4892
4894
  }
4893
- y.prototype.g = function(a) {
4895
+ x.prototype.g = function(a) {
4894
4896
  new a.h();
4895
4897
  throw Error("Unimplemented");
4896
4898
  };
4897
- y.prototype.h = function(a, b) {
4898
- if (a.h == 11 || a.h == 10) return b instanceof p ? b : this.g(a.u.prototype.m(), b);
4899
+ x.prototype.h = function(a, b) {
4900
+ if (a.h == 11 || a.h == 10) return b instanceof n ? b : this.g(a.u.prototype.m(), b);
4899
4901
  if (a.h == 14) return typeof b === "string" && xa.test(b) && (a = Number(b), a > 0) ? a : b;
4900
4902
  if (!a.o) return b;
4901
4903
  a = a.u;
@@ -4905,94 +4907,94 @@ var _factory = (() => {
4905
4907
  return b;
4906
4908
  };
4907
4909
  var xa = /^-?[0-9]+$/;
4908
- function z() {
4910
+ function ya() {
4909
4911
  }
4910
- n(z, y);
4911
- z.prototype.g = function(a, b) {
4912
+ m(ya, x);
4913
+ ya.prototype.g = function(a, b) {
4912
4914
  a = new a.h();
4913
4915
  a.l = this;
4914
4916
  a.h = b;
4915
4917
  a.g = {};
4916
4918
  return a;
4917
4919
  };
4918
- function B() {
4920
+ function z() {
4919
4921
  }
4920
- n(B, z);
4921
- B.prototype.h = function(a, b) {
4922
- return a.h == 8 ? !!b : y.prototype.h.apply(this, arguments);
4922
+ m(z, ya);
4923
+ z.prototype.h = function(a, b) {
4924
+ return a.h == 8 ? !!b : x.prototype.h.apply(this, arguments);
4923
4925
  };
4924
- B.prototype.g = function(a, b) {
4925
- return B.na.g.call(this, a, b);
4926
+ z.prototype.g = function(a, b) {
4927
+ return z.na.g.call(this, a, b);
4926
4928
  };
4927
- function C(a, b) {
4929
+ function A(a, b) {
4928
4930
  a != null && this.g.apply(this, arguments);
4929
4931
  }
4930
- C.prototype.h = "";
4931
- C.prototype.set = function(a) {
4932
+ A.prototype.h = "";
4933
+ A.prototype.set = function(a) {
4932
4934
  this.h = "" + a;
4933
4935
  };
4934
- C.prototype.g = function(a, b, c) {
4936
+ A.prototype.g = function(a, b, c) {
4935
4937
  this.h += String(a);
4936
4938
  if (b != null) for (let d = 1; d < arguments.length; d++) this.h += arguments[d];
4937
4939
  return this;
4938
4940
  };
4939
- function D(a) {
4941
+ function B(a) {
4940
4942
  a.h = "";
4941
4943
  }
4942
- C.prototype.toString = function() {
4944
+ A.prototype.toString = function() {
4943
4945
  return this.h;
4944
4946
  };
4945
- function E() {
4946
- p.call(this);
4947
- }
4948
- n(E, p);
4949
- var ya = null;
4950
- function F() {
4951
- p.call(this);
4947
+ function C() {
4948
+ n.call(this);
4952
4949
  }
4953
- n(F, p);
4950
+ m(C, n);
4954
4951
  var za = null;
4955
- function G(a) {
4956
- return u(a, 9) || [];
4952
+ function D() {
4953
+ n.call(this);
4957
4954
  }
4958
- function H() {
4959
- p.call(this);
4960
- }
4961
- n(H, p);
4955
+ m(D, n);
4962
4956
  var Aa = null;
4963
- E.prototype.m = function() {
4964
- var a = ya;
4965
- 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 } }));
4966
- return a;
4967
- };
4968
- E.m = E.prototype.m;
4969
- F.prototype.m = function() {
4957
+ function E(a) {
4958
+ return t(a, 9) || [];
4959
+ }
4960
+ function F() {
4961
+ n.call(this);
4962
+ }
4963
+ m(F, n);
4964
+ var Ba = null;
4965
+ C.prototype.m = function() {
4970
4966
  var a = za;
4971
- 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 } }));
4967
+ 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 } }));
4972
4968
  return a;
4973
4969
  };
4974
- F.m = F.prototype.m;
4975
- H.prototype.m = function() {
4970
+ C.m = C.prototype.m;
4971
+ D.prototype.m = function() {
4976
4972
  var a = Aa;
4977
- a || (Aa = a = x(H, {
4973
+ 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 } }));
4974
+ return a;
4975
+ };
4976
+ D.m = D.prototype.m;
4977
+ F.prototype.m = function() {
4978
+ var a = Ba;
4979
+ a || (Ba = a = w(F, {
4978
4980
  0: { name: "PhoneMetadata", ja: "i18n.phonenumbers.PhoneMetadata" },
4979
- 1: { name: "general_desc", i: 11, type: F },
4980
- 2: { name: "fixed_line", i: 11, type: F },
4981
- 3: { name: "mobile", i: 11, type: F },
4982
- 4: { name: "toll_free", i: 11, type: F },
4983
- 5: { name: "premium_rate", i: 11, type: F },
4984
- 6: { name: "shared_cost", i: 11, type: F },
4985
- 7: { name: "personal_number", i: 11, type: F },
4986
- 8: { name: "voip", i: 11, type: F },
4987
- 21: { name: "pager", i: 11, type: F },
4988
- 25: { name: "uan", i: 11, type: F },
4989
- 27: { name: "emergency", i: 11, type: F },
4990
- 28: { name: "voicemail", i: 11, type: F },
4991
- 29: { name: "short_code", i: 11, type: F },
4992
- 30: { name: "standard_rate", i: 11, type: F },
4993
- 31: { name: "carrier_specific", i: 11, type: F },
4994
- 33: { name: "sms_services", i: 11, type: F },
4995
- 24: { name: "no_international_dialling", i: 11, type: F },
4981
+ 1: { name: "general_desc", i: 11, type: D },
4982
+ 2: { name: "fixed_line", i: 11, type: D },
4983
+ 3: { name: "mobile", i: 11, type: D },
4984
+ 4: { name: "toll_free", i: 11, type: D },
4985
+ 5: { name: "premium_rate", i: 11, type: D },
4986
+ 6: { name: "shared_cost", i: 11, type: D },
4987
+ 7: { name: "personal_number", i: 11, type: D },
4988
+ 8: { name: "voip", i: 11, type: D },
4989
+ 21: { name: "pager", i: 11, type: D },
4990
+ 25: { name: "uan", i: 11, type: D },
4991
+ 27: { name: "emergency", i: 11, type: D },
4992
+ 28: { name: "voicemail", i: 11, type: D },
4993
+ 29: { name: "short_code", i: 11, type: D },
4994
+ 30: { name: "standard_rate", i: 11, type: D },
4995
+ 31: { name: "carrier_specific", i: 11, type: D },
4996
+ 33: { name: "sms_services", i: 11, type: D },
4997
+ 24: { name: "no_international_dialling", i: 11, type: D },
4996
4998
  9: { name: "id", required: true, i: 9, type: String },
4997
4999
  10: { name: "country_code", i: 5, type: Number },
4998
5000
  11: { name: "international_prefix", i: 9, type: String },
@@ -5006,31 +5008,31 @@ var _factory = (() => {
5006
5008
  },
5007
5009
  16: { name: "national_prefix_transform_rule", i: 9, type: String },
5008
5010
  18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: false, type: Boolean },
5009
- 19: { name: "number_format", ca: true, i: 11, type: E },
5010
- 20: { name: "intl_number_format", ca: true, i: 11, type: E },
5011
+ 19: { name: "number_format", ca: true, i: 11, type: C },
5012
+ 20: { name: "intl_number_format", ca: true, i: 11, type: C },
5011
5013
  22: { name: "main_country_for_code", i: 8, defaultValue: false, type: Boolean },
5012
5014
  23: { name: "leading_digits", i: 9, type: String }
5013
5015
  }));
5014
5016
  return a;
5015
5017
  };
5016
- H.m = H.prototype.m;
5017
- function I() {
5018
- p.call(this);
5019
- }
5020
- n(I, p);
5021
- var Ba = null, Ca = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
5022
- I.prototype.m = function() {
5023
- var a = Ba;
5024
- 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: {
5018
+ F.m = F.prototype.m;
5019
+ function G() {
5020
+ n.call(this);
5021
+ }
5022
+ m(G, n);
5023
+ var Ca = null, Da = { sa: 0, ra: 1, qa: 5, pa: 10, oa: 20 };
5024
+ G.prototype.m = function() {
5025
+ var a = Ca;
5026
+ 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: {
5025
5027
  name: "preferred_domestic_carrier_code",
5026
5028
  i: 9,
5027
5029
  type: String
5028
5030
  } }));
5029
5031
  return a;
5030
5032
  };
5031
- I.ctor = I;
5032
- I.ctor.m = I.prototype.m;
5033
- var J = {
5033
+ G.ctor = G;
5034
+ G.ctor.m = G.prototype.m;
5035
+ var H = {
5034
5036
  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(" "),
5035
5037
  7: ["RU", "KZ"],
5036
5038
  20: ["EG"],
@@ -5246,7 +5248,7 @@ var _factory = (() => {
5246
5248
  995: ["GE"],
5247
5249
  996: ["KG"],
5248
5250
  998: ["UZ"]
5249
- }, Da = {
5251
+ }, Ea = {
5250
5252
  AC: [, [
5251
5253
  ,
5252
5254
  ,
@@ -10318,14 +10320,14 @@ var _factory = (() => {
10318
10320
  ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
10319
10321
  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]]]
10320
10322
  };
10321
- function K() {
10323
+ function I() {
10322
10324
  this.g = {};
10323
10325
  }
10324
- K.h = void 0;
10325
- K.g = function() {
10326
- return K.h ? K.h : K.h = new K();
10326
+ I.h = void 0;
10327
+ I.g = function() {
10328
+ return I.h ? I.h : I.h = new I();
10327
10329
  };
10328
- 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 = {
10330
+ 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 = {
10329
10331
  0: "0",
10330
10332
  1: "1",
10331
10333
  2: "2",
@@ -10339,7 +10341,7 @@ var _factory = (() => {
10339
10341
  "+": "+",
10340
10342
  "*": "*",
10341
10343
  "#": "#"
10342
- }, Ga = {
10344
+ }, Ha = {
10343
10345
  0: "0",
10344
10346
  1: "1",
10345
10347
  2: "2",
@@ -10406,56 +10408,56 @@ var _factory = (() => {
10406
10408
  X: "9",
10407
10409
  Y: "9",
10408
10410
  Z: "9"
10409
- }, 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])*\\.?$");
10410
- function M(a) {
10411
+ }, 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])*\\.?$");
10412
+ function K(a) {
10411
10413
  return "([0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9]{1," + a + "})";
10412
10414
  }
10413
- function Pa() {
10414
- 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") + "#?");
10415
- }
10416
- 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\)?$/;
10417
- function Ua(a) {
10418
- return a.length < 2 ? false : N(Ra, a);
10415
+ function Qa() {
10416
+ 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") + "#?");
10419
10417
  }
10418
+ 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\)?$/;
10420
10419
  function Va(a) {
10421
- return N(Ma, a) ? O(a, Ga) : O(a, Ea);
10420
+ return a.length < 2 ? false : L(Sa, a);
10422
10421
  }
10423
10422
  function Wa(a) {
10424
- var b = Va(a.toString());
10425
- D(a);
10426
- a.g(b);
10423
+ return L(Na, a) ? M(a, Ha) : M(a, Fa);
10427
10424
  }
10428
10425
  function Xa(a) {
10429
- return a != null && (w(a, 9) != 1 || G(a)[0] != -1);
10426
+ var b = Wa(a.toString());
10427
+ B(a);
10428
+ a.g(b);
10430
10429
  }
10431
- function O(a, b) {
10432
- 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);
10430
+ function Ya(a) {
10431
+ return a != null && (v(a, 9) != 1 || E(a)[0] != -1);
10432
+ }
10433
+ function M(a, b) {
10434
+ 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);
10433
10435
  return c.toString();
10434
10436
  }
10435
- function Ya(a) {
10436
- return a.length == 0 || Ta.test(a);
10437
+ function Za(a) {
10438
+ return a.length == 0 || Ua.test(a);
10437
10439
  }
10438
- function P(a) {
10439
- return a != null && isNaN(a) && a.toUpperCase() in Da;
10440
+ function N(a) {
10441
+ return a != null && isNaN(a) && a.toUpperCase() in Ea;
10440
10442
  }
10441
- K.prototype.format = function(a, b) {
10442
- if (r(a, 2) == 0 && q(a, 5)) {
10443
- var c = v(a, 5);
10443
+ I.prototype.format = function(a, b) {
10444
+ if (q(a, 2) == 0 && p(a, 5)) {
10445
+ var c = u(a, 5);
10444
10446
  if (c.length > 0) return c;
10445
10447
  }
10446
- c = v(a, 1);
10447
- var d = Q(a);
10448
- if (b == 0) return Za(c, 0, d, "");
10449
- if (!(c in J)) return d;
10450
- var e = R(this, c, S(c));
10451
- 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) : "";
10448
+ c = u(a, 1);
10449
+ var d = O(a);
10450
+ if (b == 0) return $a(c, 0, d, "");
10451
+ if (!(c in H)) return d;
10452
+ var e = P(this, c, Q(c));
10453
+ 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) : "";
10452
10454
  a: {
10453
- e = (u(e, 20) || []).length == 0 || b == 2 ? u(e, 19) || [] : u(e, 20) || [];
10455
+ e = (t(e, 20) || []).length == 0 || b == 2 ? t(e, 19) || [] : t(e, 20) || [];
10454
10456
  for (var f, g = e.length, h = 0; h < g; ++h) {
10455
10457
  f = e[h];
10456
- var l = w(f, 3);
10457
- if (l == 0 || d.search(r(f, 3, l - 1)) == 0) {
10458
- if (l = new RegExp(r(f, 1)), N(l, d)) {
10458
+ var l = v(f, 3);
10459
+ if (l == 0 || d.search(q(f, 3, l - 1)) == 0) {
10460
+ if (l = new RegExp(q(f, 1)), L(l, d)) {
10459
10461
  e = f;
10460
10462
  break a;
10461
10463
  }
@@ -10463,21 +10465,21 @@ var _factory = (() => {
10463
10465
  }
10464
10466
  e = null;
10465
10467
  }
10466
- e != null && (g = e, e = v(g, 2), f = new RegExp(r(
10468
+ e != null && (g = e, e = u(g, 2), f = new RegExp(q(
10467
10469
  g,
10468
10470
  1
10469
- )), 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"), "-")));
10470
- return Za(c, b, d, a);
10471
+ )), 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"), "-")));
10472
+ return $a(c, b, d, a);
10471
10473
  };
10472
- function R(a, b, c) {
10473
- return "001" == c ? T(a, "" + b) : T(a, c);
10474
+ function P(a, b, c) {
10475
+ return "001" == c ? R(a, "" + b) : R(a, c);
10474
10476
  }
10475
- function Q(a) {
10476
- if (!q(a, 2)) return "";
10477
- var b = "" + r(a, 2);
10478
- return q(a, 4) && r(a, 4) && v(a, 8) > 0 ? Array(v(a, 8) + 1).join("0") + b : b;
10477
+ function O(a) {
10478
+ if (!p(a, 2)) return "";
10479
+ var b = "" + q(a, 2);
10480
+ return p(a, 4) && q(a, 4) && u(a, 8) > 0 ? Array(u(a, 8) + 1).join("0") + b : b;
10479
10481
  }
10480
- function Za(a, b, c, d) {
10482
+ function $a(a, b, c, d) {
10481
10483
  switch (b) {
10482
10484
  case 0:
10483
10485
  return "+" + a + c + d;
@@ -10489,83 +10491,83 @@ var _factory = (() => {
10489
10491
  return c + d;
10490
10492
  }
10491
10493
  }
10492
- function U(a, b) {
10494
+ function S(a, b) {
10493
10495
  switch (b) {
10494
10496
  case 4:
10495
- return r(a, 5);
10497
+ return q(a, 5);
10496
10498
  case 3:
10497
- return r(a, 4);
10499
+ return q(a, 4);
10498
10500
  case 1:
10499
- return r(a, 3);
10501
+ return q(a, 3);
10500
10502
  case 0:
10501
10503
  case 2:
10502
- return r(a, 2);
10504
+ return q(a, 2);
10503
10505
  case 5:
10504
- return r(a, 6);
10506
+ return q(a, 6);
10505
10507
  case 6:
10506
- return r(a, 8);
10508
+ return q(a, 8);
10507
10509
  case 7:
10508
- return r(a, 7);
10510
+ return q(a, 7);
10509
10511
  case 8:
10510
- return r(a, 21);
10512
+ return q(a, 21);
10511
10513
  case 9:
10512
- return r(a, 25);
10514
+ return q(a, 25);
10513
10515
  case 10:
10514
- return r(a, 28);
10516
+ return q(a, 28);
10515
10517
  default:
10516
- return r(a, 1);
10518
+ return q(a, 1);
10517
10519
  }
10518
10520
  }
10519
- function $a(a, b) {
10520
- var c = ab(a, b);
10521
- a = R(a, v(b, 1), c);
10521
+ function ab(a, b) {
10522
+ var c = bb(a, b);
10523
+ a = P(a, u(b, 1), c);
10522
10524
  if (a == null) return -1;
10523
- b = Q(b);
10524
- return bb(b, a);
10525
+ b = O(b);
10526
+ return cb(b, a);
10525
10527
  }
10526
- function bb(a, b) {
10527
- 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;
10528
+ function cb(a, b) {
10529
+ 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;
10528
10530
  }
10529
- function T(a, b) {
10531
+ function R(a, b) {
10530
10532
  if (b == null) return null;
10531
10533
  b = b.toUpperCase();
10532
10534
  var c = a.g[b];
10533
10535
  if (c == null) {
10534
- c = Da[b];
10536
+ c = Ea[b];
10535
10537
  if (c == null) return null;
10536
- c = new B().g(H.m(), c);
10538
+ c = new z().g(F.m(), c);
10537
10539
  a.g[b] = c;
10538
10540
  }
10539
10541
  return c;
10540
10542
  }
10541
- function V(a, b) {
10543
+ function T(a, b) {
10542
10544
  var c = a.length;
10543
- return w(b, 9) > 0 && G(b).indexOf(c) == -1 ? false : N(v(b, 2), a);
10545
+ return v(b, 9) > 0 && E(b).indexOf(c) == -1 ? false : L(u(b, 2), a);
10544
10546
  }
10545
- function cb(a, b) {
10546
- var c = ab(a, b);
10547
- var d = v(b, 1);
10548
- var e = R(a, d, c);
10549
- e == null || "001" != c && d != db(a, c) ? e = false : (a = Q(b), e = bb(a, e) != -1);
10547
+ function db(a, b) {
10548
+ var c = bb(a, b);
10549
+ var d = u(b, 1);
10550
+ var e = P(a, d, c);
10551
+ e == null || "001" != c && d != eb(a, c) ? e = false : (a = O(b), e = cb(a, e) != -1);
10550
10552
  return e;
10551
10553
  }
10552
- function ab(a, b) {
10554
+ function bb(a, b) {
10553
10555
  if (b == null) return null;
10554
- var c = v(b, 1);
10555
- c = J[c];
10556
+ var c = u(b, 1);
10557
+ c = H[c];
10556
10558
  if (c == null) a = null;
10557
10559
  else if (c.length == 1) a = c[0];
10558
10560
  else a: {
10559
- b = Q(b);
10561
+ b = O(b);
10560
10562
  for (var d, e = c.length, f = 0; f < e; f++) {
10561
10563
  d = c[f];
10562
- var g = T(a, d);
10563
- if (q(g, 23)) {
10564
- if (b.search(r(g, 23)) == 0) {
10564
+ var g = R(a, d);
10565
+ if (p(g, 23)) {
10566
+ if (b.search(q(g, 23)) == 0) {
10565
10567
  a = d;
10566
10568
  break a;
10567
10569
  }
10568
- } else if (bb(b, g) != -1) {
10570
+ } else if (cb(b, g) != -1) {
10569
10571
  a = d;
10570
10572
  break a;
10571
10573
  }
@@ -10574,93 +10576,93 @@ var _factory = (() => {
10574
10576
  }
10575
10577
  return a;
10576
10578
  }
10577
- function S(a) {
10578
- a = J[a];
10579
+ function Q(a) {
10580
+ a = H[a];
10579
10581
  return a == null ? "ZZ" : a[0];
10580
10582
  }
10581
- function db(a, b) {
10582
- a = T(a, b);
10583
+ function eb(a, b) {
10584
+ a = R(a, b);
10583
10585
  if (a == null) throw Error("Invalid region code: " + b);
10584
- return v(a, 10);
10586
+ return u(a, 10);
10585
10587
  }
10586
- function W(a, b, c, d) {
10587
- var e = U(c, d), f = w(e, 9) == 0 ? G(r(c, 1)) : G(e);
10588
- e = u(e, 10) || [];
10589
- 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()));
10590
- else return W(a, b, c, 1);
10588
+ function U(a, b, c, d) {
10589
+ var e = S(c, d), f = v(e, 9) == 0 ? E(q(c, 1)) : E(e);
10590
+ e = t(e, 10) || [];
10591
+ 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()));
10592
+ else return U(a, b, c, 1);
10591
10593
  if (f[0] == -1) return 5;
10592
10594
  b = b.length;
10593
10595
  if (e.indexOf(b) > -1) return 4;
10594
10596
  c = f[0];
10595
10597
  return c == b ? 0 : c > b ? 2 : f[f.length - 1] < b ? 3 : f.indexOf(b, 1) > -1 ? 0 : 5;
10596
10598
  }
10597
- function X(a, b, c) {
10598
- var d = Q(b);
10599
- b = v(b, 1);
10600
- if (!(b in J)) return 1;
10601
- b = R(a, b, S(b));
10602
- return W(a, d, b, c);
10599
+ function V(a, b, c) {
10600
+ var d = O(b);
10601
+ b = u(b, 1);
10602
+ if (!(b in H)) return 1;
10603
+ b = P(a, b, Q(b));
10604
+ return U(a, d, b, c);
10603
10605
  }
10604
- function eb(a, b) {
10606
+ function fb(a, b) {
10605
10607
  a = a.toString();
10606
10608
  if (a.length == 0 || a.charAt(0) == "0") return 0;
10607
- 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;
10609
+ 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;
10608
10610
  return 0;
10609
10611
  }
10610
- function fb(a, b, c, d, e, f) {
10612
+ function gb(a, b, c, d, e, f) {
10611
10613
  if (b.length == 0) return 0;
10612
- b = new C(b);
10614
+ b = new A(b);
10613
10615
  var g;
10614
- c != null && (g = r(c, 11));
10616
+ c != null && (g = q(c, 11));
10615
10617
  g == null && (g = "NonMatch");
10616
10618
  var h = b.toString();
10617
10619
  if (h.length == 0) g = 20;
10618
- else if (L.test(h)) h = h.replace(L, ""), D(b), b.g(Va(h)), g = 1;
10620
+ else if (J.test(h)) h = h.replace(J, ""), B(b), b.g(Wa(h)), g = 1;
10619
10621
  else {
10620
10622
  h = new RegExp(g);
10621
- Wa(b);
10623
+ Xa(b);
10622
10624
  g = b.toString();
10623
10625
  if (g.search(h) == 0) {
10624
10626
  h = g.match(h)[0].length;
10625
- var l = g.substring(h).match(Ia);
10626
- l && l[1] != null && l[1].length > 0 && O(l[1], Ea) == "0" ? g = false : (D(b), b.g(g.substring(h)), g = true);
10627
+ var l = g.substring(h).match(Ja);
10628
+ l && l[1] != null && l[1].length > 0 && M(l[1], Fa) == "0" ? g = false : (B(b), b.g(g.substring(h)), g = true);
10627
10629
  } else g = false;
10628
10630
  g = g ? 5 : 20;
10629
10631
  }
10630
- e && t(f, 6, g);
10632
+ e && r(f, 6, g);
10631
10633
  if (g != 20) {
10632
10634
  if (b.h.length <= 2) throw Error("Phone number too short after IDD");
10633
- a = eb(b, d);
10634
- if (a != 0) return t(f, 1, a), a;
10635
+ a = fb(b, d);
10636
+ if (a != 0) return r(f, 1, a), a;
10635
10637
  throw Error("Invalid country calling code");
10636
10638
  }
10637
- 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;
10638
- t(f, 1, 0);
10639
+ 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;
10640
+ r(f, 1, 0);
10639
10641
  return 0;
10640
10642
  }
10641
- function gb(a, b, c) {
10642
- var d = a.toString(), e = d.length, f = r(b, 15);
10643
+ function hb(a, b, c) {
10644
+ var d = a.toString(), e = d.length, f = q(b, 15);
10643
10645
  if (e != 0 && f != null && f.length != 0 && (f = new RegExp("^(?:" + f + ")"), e = f.exec(d))) {
10644
10646
  var g = RegExp;
10645
- var h = r(b, 1);
10646
- h = v(h, 2);
10647
+ var h = q(b, 1);
10648
+ h = u(h, 2);
10647
10649
  g = new g(h);
10648
- h = N(g, d);
10650
+ h = L(g, d);
10649
10651
  var l = e.length - 1;
10650
- b = r(b, 16);
10652
+ b = q(b, 16);
10651
10653
  if (b == null || b.length == 0 || e[l] == null || e[l].length == 0) {
10652
- 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));
10653
- } else if (d = d.replace(f, b), !h || N(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
10654
+ 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));
10655
+ } else if (d = d.replace(f, b), !h || L(g, d)) c != null && l > 0 && c.g(e[1]), a.set(d);
10654
10656
  }
10655
10657
  }
10656
- function Y(a, b, c) {
10657
- if (!P(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
10658
- return hb(a, b, c, true);
10658
+ function W(a, b, c) {
10659
+ if (!N(c) && b.length > 0 && b.charAt(0) != "+") throw Error("Invalid country calling code");
10660
+ return ib(a, b, c, true);
10659
10661
  }
10660
- function hb(a, b, c, d) {
10662
+ function ib(a, b, c, d) {
10661
10663
  if (b == null) throw Error("The string supplied did not seem to be a phone number");
10662
10664
  if (b.length > 250) throw Error("The string supplied is too long to be a phone number");
10663
- var e = new C();
10665
+ var e = new A();
10664
10666
  var f = b.indexOf(";phone-context=");
10665
10667
  if (f === -1) f = null;
10666
10668
  else if (f += 15, f >= b.length) f = "";
@@ -10669,126 +10671,126 @@ var _factory = (() => {
10669
10671
  f = g !== -1 ? b.substring(f, g) : b.substring(f);
10670
10672
  }
10671
10673
  var h = f;
10672
- h == null ? g = true : h.length === 0 ? g = false : (g = Na.exec(h), h = Oa.exec(h), g = g !== null || h !== null);
10674
+ h == null ? g = true : h.length === 0 ? g = false : (g = Oa.exec(h), h = Pa.exec(h), g = g !== null || h !== null);
10673
10675
  if (!g) throw Error("The string supplied did not seem to be a phone number");
10674
- 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));
10676
+ 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));
10675
10677
  f = e.toString();
10676
10678
  g = f.indexOf(";isub=");
10677
- g > 0 && (D(e), e.g(f.substring(0, g)));
10678
- if (!Ua(e.toString())) throw Error("The string supplied did not seem to be a phone number");
10679
+ g > 0 && (B(e), e.g(f.substring(0, g)));
10680
+ if (!Va(e.toString())) throw Error("The string supplied did not seem to be a phone number");
10679
10681
  f = e.toString();
10680
- if (!(P(c) || f != null && f.length > 0 && L.test(f))) throw Error("Invalid country calling code");
10681
- f = new I();
10682
- d && t(f, 5, b);
10682
+ if (!(N(c) || f != null && f.length > 0 && J.test(f))) throw Error("Invalid country calling code");
10683
+ f = new G();
10684
+ d && r(f, 5, b);
10683
10685
  a: {
10684
10686
  b = e.toString();
10685
- g = b.search(Qa);
10686
- if (g >= 0 && Ua(b.substring(0, g))) {
10687
- h = b.match(Qa);
10688
- for (var l = h.length, A = 1; A < l; ++A) if (h[A] != null && h[A].length > 0) {
10689
- D(e);
10687
+ g = b.search(Ra);
10688
+ if (g >= 0 && Va(b.substring(0, g))) {
10689
+ h = b.match(Ra);
10690
+ for (var l = h.length, y = 1; y < l; ++y) if (h[y] != null && h[y].length > 0) {
10691
+ B(e);
10690
10692
  e.g(b.substring(0, g));
10691
- b = h[A];
10693
+ b = h[y];
10692
10694
  break a;
10693
10695
  }
10694
10696
  }
10695
10697
  b = "";
10696
10698
  }
10697
- b.length > 0 && t(f, 3, b);
10698
- g = T(a, c);
10699
- b = new C();
10699
+ b.length > 0 && r(f, 3, b);
10700
+ g = R(a, c);
10701
+ b = new A();
10700
10702
  h = 0;
10701
10703
  l = e.toString();
10702
10704
  try {
10703
- h = fb(a, l, g, b, d, f);
10704
- } catch (ca) {
10705
- if (ca.message == "Invalid country calling code" && L.test(l)) {
10706
- if (l = l.replace(L, ""), h = fb(a, l, g, b, d, f), h == 0) throw ca;
10707
- } else throw ca;
10705
+ h = gb(a, l, g, b, d, f);
10706
+ } catch (Y) {
10707
+ if (Y.message == "Invalid country calling code" && J.test(l)) {
10708
+ if (l = l.replace(J, ""), h = gb(a, l, g, b, d, f), h == 0) throw Y;
10709
+ } else throw Y;
10708
10710
  }
10709
- 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(
10711
+ 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(
10710
10712
  f,
10711
10713
  1,
10712
10714
  h
10713
10715
  )) : d && (delete f.h[6], f.g && delete f.g[6]));
10714
10716
  if (b.h.length < 2) throw Error("The string supplied is too short to be a phone number");
10715
- 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())));
10717
+ 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())));
10716
10718
  d = b.toString();
10717
10719
  a = d.length;
10718
10720
  if (a < 2) throw Error("The string supplied is too short to be a phone number");
10719
10721
  if (a > 17) throw Error("The string supplied is too long to be a phone number");
10720
10722
  if (d.length > 1 && d.charAt(0) == "0") {
10721
- t(f, 4, true);
10723
+ r(f, 4, true);
10722
10724
  for (a = 1; a < d.length - 1 && d.charAt(a) == "0"; ) a++;
10723
- a != 1 && t(f, 8, a);
10725
+ a != 1 && r(f, 8, a);
10724
10726
  }
10725
- t(f, 2, parseInt(d, 10));
10727
+ r(f, 2, parseInt(d, 10));
10726
10728
  return f;
10727
10729
  }
10728
- function N(a, b) {
10730
+ function L(a, b) {
10729
10731
  return (a = b.match(new RegExp("^(?:" + (typeof a == "string" ? a : a.source) + ")$", "i"))) && a[0].length == b.length ? true : false;
10730
10732
  }
10731
10733
  ;
10732
- function ib(a) {
10734
+ function jb(a) {
10733
10735
  this.ga = RegExp("\u2008");
10734
10736
  this.ka = "";
10735
- this.$ = new C();
10737
+ this.$ = new A();
10736
10738
  this.ea = "";
10737
- this.u = new C();
10738
- this.da = new C();
10739
+ this.u = new A();
10740
+ this.da = new A();
10739
10741
  this.v = true;
10740
10742
  this.fa = this.aa = this.ma = false;
10741
- this.ha = K.g();
10743
+ this.ha = I.g();
10742
10744
  this.ba = 0;
10743
- this.h = new C();
10745
+ this.h = new A();
10744
10746
  this.ia = false;
10745
10747
  this.o = "";
10746
- this.g = new C();
10748
+ this.g = new A();
10747
10749
  this.j = [];
10748
10750
  this.la = a;
10749
- this.l = jb(this, this.la);
10751
+ this.l = kb(this, this.la);
10750
10752
  }
10751
- var kb = new H();
10752
- t(kb, 11, "NA");
10753
- 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 = /[- ]/;
10754
- function jb(a, b) {
10753
+ var lb = new F();
10754
+ r(lb, 11, "NA");
10755
+ 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 = /[- ]/;
10756
+ function kb(a, b) {
10755
10757
  var c = a.ha;
10756
- b = P(b) ? db(c, b) : 0;
10757
- a = T(a.ha, S(b));
10758
- return a != null ? a : kb;
10758
+ b = N(b) ? eb(c, b) : 0;
10759
+ a = R(a.ha, Q(b));
10760
+ return a != null ? a : lb;
10759
10761
  }
10760
- function nb(a) {
10762
+ function ob(a) {
10761
10763
  for (var b = a.j.length, c = 0; c < b; ++c) {
10762
- var d = a.j[c], e = v(d, 1);
10764
+ var d = a.j[c], e = u(d, 1);
10763
10765
  if (a.ea == e) return false;
10764
10766
  var f = a;
10765
- var g = d, h = v(g, 1);
10766
- D(f.$);
10767
+ var g = d, h = u(g, 1);
10768
+ B(f.$);
10767
10769
  var l = f;
10768
- g = v(g, 2);
10769
- var A = "999999999999999".match(h)[0];
10770
- A.length < l.g.h.length ? l = "" : (l = A.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
10770
+ g = u(g, 2);
10771
+ var y = "999999999999999".match(h)[0];
10772
+ y.length < l.g.h.length ? l = "" : (l = y.replace(new RegExp(h, "g"), g), l = l.replace(RegExp("9", "g"), "\u2008"));
10771
10773
  l.length > 0 ? (f.$.g(l), f = true) : f = false;
10772
- if (f) return a.ea = e, a.ia = mb.test(r(d, 4)), a.ba = 0, true;
10774
+ if (f) return a.ea = e, a.ia = nb.test(q(d, 4)), a.ba = 0, true;
10773
10775
  }
10774
10776
  return a.v = false;
10775
10777
  }
10776
- function ob(a, b) {
10778
+ function pb(a, b) {
10777
10779
  for (var c = [], d = b.length - 3, e = a.j.length, f = 0; f < e; ++f) {
10778
10780
  var g = a.j[f];
10779
- 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]));
10781
+ 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]));
10780
10782
  }
10781
10783
  a.j = c;
10782
10784
  }
10783
- function pb(a, b) {
10785
+ function qb(a, b) {
10784
10786
  a.u.g(b);
10785
10787
  var c = b;
10786
- 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);
10788
+ 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);
10787
10789
  if (!a.v) {
10788
10790
  if (!a.ma) {
10789
- if (qb(a)) {
10790
- if (rb(a)) return sb(a);
10791
- } 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);
10791
+ if (rb(a)) {
10792
+ if (sb(a)) return tb(a);
10793
+ } 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);
10792
10794
  }
10793
10795
  return a.u.toString();
10794
10796
  }
@@ -10798,93 +10800,93 @@ var _factory = (() => {
10798
10800
  case 2:
10799
10801
  return a.u.toString();
10800
10802
  case 3:
10801
- if (qb(a)) a.fa = true;
10802
- else return a.o = tb(a), ub(a);
10803
+ if (rb(a)) a.fa = true;
10804
+ else return a.o = ub(a), vb(a);
10803
10805
  default:
10804
- if (a.fa) return rb(a) && (a.fa = false), a.h.toString() + a.g.toString();
10806
+ if (a.fa) return sb(a) && (a.fa = false), a.h.toString() + a.g.toString();
10805
10807
  if (a.j.length > 0) {
10806
- b = vb(a, b);
10807
- c = wb(a);
10808
+ b = wb(a, b);
10809
+ c = xb(a);
10808
10810
  if (c.length > 0) return c;
10809
- ob(a, a.g.toString());
10810
- return nb(a) ? xb(a) : a.v ? Z(a, b) : a.u.toString();
10811
+ pb(a, a.g.toString());
10812
+ return ob(a) ? yb(a) : a.v ? X(a, b) : a.u.toString();
10811
10813
  }
10812
- return ub(a);
10814
+ return vb(a);
10813
10815
  }
10814
10816
  }
10815
- function sb(a) {
10817
+ function tb(a) {
10816
10818
  a.v = true;
10817
10819
  a.fa = false;
10818
10820
  a.j = [];
10819
10821
  a.ba = 0;
10820
- D(a.$);
10822
+ B(a.$);
10821
10823
  a.ea = "";
10822
- return ub(a);
10824
+ return vb(a);
10823
10825
  }
10824
- function wb(a) {
10826
+ function xb(a) {
10825
10827
  for (var b = a.g.toString(), c = a.j.length, d = 0; d < c; ++d) {
10826
- var e = a.j[d], f = v(e, 1);
10827
- 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;
10828
+ var e = a.j[d], f = u(e, 1);
10829
+ 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;
10828
10830
  }
10829
10831
  return "";
10830
10832
  }
10831
- function Z(a, b) {
10833
+ function X(a, b) {
10832
10834
  var c = a.h.h.length;
10833
10835
  return a.ia && c > 0 && a.h.toString().charAt(c - 1) != " " ? a.h + " " + b : a.h + b;
10834
10836
  }
10835
- function ub(a) {
10837
+ function vb(a) {
10836
10838
  var b = a.g.toString();
10837
10839
  if (b.length >= 3) {
10838
- 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) {
10840
+ 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) {
10839
10841
  var f = c[e];
10840
- 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);
10842
+ 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);
10841
10843
  }
10842
- ob(a, b);
10843
- b = wb(a);
10844
- return b.length > 0 ? b : nb(a) ? xb(a) : a.u.toString();
10844
+ pb(a, b);
10845
+ b = xb(a);
10846
+ return b.length > 0 ? b : ob(a) ? yb(a) : a.u.toString();
10845
10847
  }
10846
- return Z(a, b);
10848
+ return X(a, b);
10847
10849
  }
10848
- function xb(a) {
10850
+ function yb(a) {
10849
10851
  var b = a.g.toString(), c = b.length;
10850
10852
  if (c > 0) {
10851
- for (var d = "", e = 0; e < c; e++) d = vb(a, b.charAt(e));
10852
- return a.v ? Z(a, d) : a.u.toString();
10853
+ for (var d = "", e = 0; e < c; e++) d = wb(a, b.charAt(e));
10854
+ return a.v ? X(a, d) : a.u.toString();
10853
10855
  }
10854
10856
  return a.h.toString();
10855
10857
  }
10856
- function tb(a) {
10858
+ function ub(a) {
10857
10859
  var b = a.g.toString(), c = 0;
10858
- if (r(a.l, 10) != 1) var d = false;
10860
+ if (q(a.l, 10) != 1) var d = false;
10859
10861
  else d = a.g.toString(), d = d.charAt(0) == "1" && d.charAt(1) != "0" && d.charAt(1) != "1";
10860
- 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))));
10861
- D(a.g);
10862
+ 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))));
10863
+ B(a.g);
10862
10864
  a.g.g(b.substring(c));
10863
10865
  return b.substring(0, c);
10864
10866
  }
10865
- function qb(a) {
10866
- var b = a.da.toString(), c = new RegExp("^(?:\\+|" + r(a.l, 11) + ")");
10867
+ function rb(a) {
10868
+ var b = a.da.toString(), c = new RegExp("^(?:\\+|" + q(a.l, 11) + ")");
10867
10869
  c = b.match(c);
10868
- 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;
10870
+ 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;
10869
10871
  }
10870
- function rb(a) {
10872
+ function sb(a) {
10871
10873
  if (a.g.h.length == 0) return false;
10872
- var b = new C(), c = eb(a.g, b);
10874
+ var b = new A(), c = fb(a.g, b);
10873
10875
  if (c == 0) return false;
10874
- D(a.g);
10876
+ B(a.g);
10875
10877
  a.g.g(b.toString());
10876
- b = S(c);
10877
- "001" == b ? a.l = T(a.ha, "" + c) : b != a.la && (a.l = jb(a, b));
10878
+ b = Q(c);
10879
+ "001" == b ? a.l = R(a.ha, "" + c) : b != a.la && (a.l = kb(a, b));
10878
10880
  a.h.g("" + c).g(" ");
10879
10881
  a.o = "";
10880
10882
  return true;
10881
10883
  }
10882
- function vb(a, b) {
10884
+ function wb(a, b) {
10883
10885
  var c = a.$.toString();
10884
10886
  if (c.substring(a.ba).search(a.ga) >= 0) {
10885
10887
  var d = c.search(a.ga);
10886
10888
  b = c.replace(a.ga, b);
10887
- D(a.$);
10889
+ B(a.$);
10888
10890
  a.$.g(b);
10889
10891
  a.ba = d;
10890
10892
  return b.substring(0, a.ba + 1);
@@ -10894,119 +10896,137 @@ var _factory = (() => {
10894
10896
  return a.u.toString();
10895
10897
  }
10896
10898
  ;
10897
- const yb = (a) => {
10899
+ const zb = {};
10900
+ ["E164", "INTERNATIONAL", "NATIONAL", "RFC3966"].forEach((a, b) => {
10901
+ zb[a] = b;
10902
+ });
10903
+ const Z = {};
10904
+ "FIXED_LINE MOBILE FIXED_LINE_OR_MOBILE TOLL_FREE PREMIUM_RATE SHARED_COST VOIP PERSONAL_NUMBER PAGER UAN VOICEMAIL UNKNOWN".split(" ").forEach((a, b) => {
10905
+ Z[a] = b;
10906
+ });
10907
+ Z.UNKNOWN = -1;
10908
+ const Ab = {};
10909
+ "IS_POSSIBLE INVALID_COUNTRY_CODE TOO_SHORT TOO_LONG IS_POSSIBLE_LOCAL_ONLY INVALID_LENGTH".split(" ").forEach((a, b) => {
10910
+ Ab[a] = b;
10911
+ });
10912
+ const Bb = {};
10913
+ Object.keys(Z).forEach((a) => {
10914
+ Bb[Z[a]] = a;
10915
+ });
10916
+ const Cb = {};
10917
+ Object.keys(Ab).forEach((a) => {
10918
+ Cb[Ab[a]] = a;
10919
+ });
10920
+ const Db = (a) => {
10898
10921
  const b = [];
10899
10922
  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");
10900
10923
  return a.concat(b);
10901
- }, 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 };
10902
- m("utils", {});
10903
- m("utils.formatNumberAsYouType", (a, b) => {
10924
+ };
10925
+ k("utils", {});
10926
+ k("utils.formatNumberAsYouType", (a, b) => {
10904
10927
  try {
10905
- const c = a.replace(/[^+0-9]/g, ""), d = new ib(b);
10928
+ const c = a.replace(/[^+0-9]/g, ""), d = new jb(b);
10906
10929
  b = "";
10907
- for (let e = 0; e < c.length; e++) d.ka = pb(d, c.charAt(e)), b = d.ka;
10930
+ for (let e = 0; e < c.length; e++) d.ka = qb(d, c.charAt(e)), b = d.ka;
10908
10931
  return b;
10909
10932
  } catch {
10910
10933
  return a;
10911
10934
  }
10912
10935
  });
10913
- m("utils.formatNumber", (a, b, c) => {
10936
+ k("utils.formatNumber", (a, b, c) => {
10914
10937
  try {
10915
- const e = K.g(), f = Y(e, a, b);
10916
- var d = X(e, f, -1);
10917
- return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : c) : a;
10938
+ const e = I.g(), f = W(e, a, b);
10939
+ var d = V(e, f, -1);
10940
+ return d == 0 || d == 4 ? e.format(f, typeof c === "undefined" ? 0 : zb[c]) : a;
10918
10941
  } catch {
10919
10942
  return a;
10920
10943
  }
10921
10944
  });
10922
- m("utils.getExampleNumber", (a, b, c, d) => {
10945
+ k("utils.getExampleNumber", (a, b, c, d) => {
10923
10946
  try {
10924
- const l = K.g();
10947
+ const y = I.g();
10925
10948
  a: {
10926
- var e = l;
10927
- if (P(a)) {
10928
- var f = U(T(e, a), c);
10949
+ var e = y, f = Z[c];
10950
+ if (N(a)) {
10951
+ var g = S(R(e, a), f);
10929
10952
  try {
10930
- if (q(f, 6)) {
10931
- var g = r(f, 6);
10932
- var h = hb(e, g, a, false);
10953
+ if (p(g, 6)) {
10954
+ var h = q(g, 6);
10955
+ var l = ib(e, h, a, false);
10933
10956
  break a;
10934
10957
  }
10935
- } catch (A) {
10958
+ } catch (Y) {
10936
10959
  }
10937
10960
  }
10938
- h = null;
10961
+ l = null;
10939
10962
  }
10940
- return l.format(h, d ? 0 : b ? 2 : 1);
10963
+ return y.format(l, d ? 0 : b ? 2 : 1);
10941
10964
  } catch {
10942
10965
  return "";
10943
10966
  }
10944
10967
  });
10945
- m("utils.getExtension", (a, b) => {
10968
+ k("utils.getExtension", (a, b) => {
10946
10969
  try {
10947
- var c = Y(K.g(), a, b);
10948
- return r(c, 3);
10970
+ var c = W(I.g(), a, b);
10971
+ return q(c, 3);
10949
10972
  } catch {
10950
10973
  return "";
10951
10974
  }
10952
10975
  });
10953
- m("utils.getNumberType", (a, b) => {
10976
+ k("utils.getNumberType", (a, b) => {
10954
10977
  try {
10955
- const c = K.g(), d = Y(c, a, b);
10956
- return $a(c, d);
10978
+ const c = I.g(), d = W(c, a, b), e = ab(c, d);
10979
+ return Bb[e] || null;
10957
10980
  } catch {
10958
- return -99;
10981
+ return null;
10959
10982
  }
10960
10983
  });
10961
- m("utils.getValidationError", (a, b) => {
10962
- if (!b) return 1;
10984
+ k("utils.getValidationError", (a, b) => {
10985
+ if (!b) return "INVALID_COUNTRY_CODE";
10963
10986
  try {
10964
- const c = K.g(), d = Y(c, a, b);
10965
- return X(c, d, -1);
10987
+ const c = I.g(), d = W(c, a, b), e = V(c, d, -1);
10988
+ return Cb[e] || null;
10966
10989
  } catch (c) {
10967
- 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;
10990
+ 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;
10968
10991
  }
10969
10992
  });
10970
- m("utils.isValidNumber", (a, b, c) => {
10993
+ k("utils.isValidNumber", (a, b, c) => {
10971
10994
  try {
10972
- const d = K.g(), e = Y(d, a, b), f = cb(d, e);
10995
+ const d = I.g(), e = W(d, a, b), f = db(d, e);
10973
10996
  if (c) {
10974
- const g = yb(c).map((h) => zb[h]);
10975
- return f && g.includes($a(d, e));
10997
+ const g = Db(c).map((h) => Z[h]);
10998
+ return f && g.includes(ab(d, e));
10976
10999
  }
10977
11000
  return f;
10978
11001
  } catch {
10979
11002
  return false;
10980
11003
  }
10981
11004
  });
10982
- m("utils.isPossibleNumber", (a, b, c) => {
11005
+ k("utils.isPossibleNumber", (a, b, c) => {
10983
11006
  try {
10984
- const d = K.g(), e = Y(d, a, b);
11007
+ const d = I.g(), e = W(d, a, b);
10985
11008
  if (c) {
10986
- const f = yb(c);
10987
- for (let g of f) if (X(d, e, zb[g]) === 0) return true;
11009
+ const f = Db(c);
11010
+ for (let g of f) if (V(d, e, Z[g]) === 0) return true;
10988
11011
  return false;
10989
11012
  }
10990
- return X(d, e, -1) === 0;
11013
+ return V(d, e, -1) === 0;
10991
11014
  } catch {
10992
11015
  return false;
10993
11016
  }
10994
11017
  });
10995
- m("utils.getCoreNumber", (a, b) => {
11018
+ k("utils.getCoreNumber", (a, b) => {
10996
11019
  try {
10997
- var c = Y(K.g(), a, b);
10998
- return r(c, 2).toString();
11020
+ var c = W(I.g(), a, b);
11021
+ return q(c, 2).toString();
10999
11022
  } catch {
11000
11023
  return "";
11001
11024
  }
11002
11025
  });
11003
- m("utils.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 });
11004
- m("utils.numberType", zb);
11005
- m("utils.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
11006
11026
  }).call(_scope);
11007
11027
  var utils_default = _scope.utils;
11008
11028
 
11009
- // src/js/intlTelInputWithUtils.ts
11029
+ // packages/core/src/js/intlTelInputWithUtils.ts
11010
11030
  intlTelInput_default.utils = utils_default;
11011
11031
  var intlTelInputWithUtils_default = intlTelInput_default;
11012
11032
  return __toCommonJS(intlTelInputWithUtils_exports);