intl-tel-input 25.5.2 → 25.8.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.
@@ -1360,18 +1360,18 @@ var rawCountryData = [
1360
1360
  ]
1361
1361
  ];
1362
1362
  var allCountries = [];
1363
- for (let i = 0; i < rawCountryData.length; i++) {
1364
- const c = rawCountryData[i];
1365
- allCountries[i] = {
1363
+ for (const c of rawCountryData) {
1364
+ allCountries.push({
1366
1365
  name: "",
1367
- // this is now populated in the plugin
1366
+ // populated in the plugin
1368
1367
  iso2: c[0],
1369
1368
  dialCode: c[1],
1370
1369
  priority: c[2] || 0,
1371
1370
  areaCodes: c[3] || null,
1372
1371
  nodeById: {},
1372
+ // populated by the plugin
1373
1373
  nationalPrefix: c[4] || null
1374
- };
1374
+ });
1375
1375
  }
1376
1376
  var data_default = allCountries;
1377
1377
 
@@ -1628,6 +1628,7 @@ var interfaceTranslations = {
1628
1628
  noCountrySelected: "No country selected",
1629
1629
  countryListAriaLabel: "List of countries",
1630
1630
  searchPlaceholder: "Search",
1631
+ clearSearchAriaLabel: "Clear search",
1631
1632
  zeroSearchResults: "No results found",
1632
1633
  oneSearchResult: "1 result found",
1633
1634
  multipleSearchResults: "${count} results found",
@@ -1642,10 +1643,23 @@ var allTranslations = { ...countries_default, ...interface_default };
1642
1643
  var en_default = allTranslations;
1643
1644
 
1644
1645
  // src/js/intl-tel-input.ts
1645
- for (let i = 0; i < data_default.length; i++) {
1646
- data_default[i].name = en_default[data_default[i].iso2];
1646
+ for (const c of data_default) {
1647
+ c.name = en_default[c.iso2];
1647
1648
  }
1648
1649
  var id = 0;
1650
+ var mq = (q) => {
1651
+ return typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(q).matches;
1652
+ };
1653
+ var computeDefaultUseFullscreenPopup = () => {
1654
+ if (typeof navigator !== "undefined" && typeof window !== "undefined") {
1655
+ const isMobileUserAgent = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1656
+ const isNarrowViewport = mq("(max-width: 500px)");
1657
+ const isShortViewport = mq("(max-height: 600px)");
1658
+ const isCoarsePointer = mq("(pointer: coarse)");
1659
+ return isMobileUserAgent || isNarrowViewport || isCoarsePointer && isShortViewport;
1660
+ }
1661
+ return false;
1662
+ };
1649
1663
  var defaults = {
1650
1664
  //* Whether or not to allow the dropdown.
1651
1665
  allowDropdown: true,
@@ -1692,13 +1706,7 @@ var defaults = {
1692
1706
  //* Only allow certain chars e.g. a plus followed by numeric digits, and cap at max valid length.
1693
1707
  strictMode: false,
1694
1708
  //* Use full screen popup instead of dropdown for country list.
1695
- useFullscreenPopup: typeof navigator !== "undefined" && typeof window !== "undefined" ? (
1696
- //* We cannot just test screen size as some smartphones/website meta tags will report desktop resolutions.
1697
- //* Note: to target Android Mobiles (and not Tablets), we must find 'Android' and 'Mobile'
1698
- /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
1699
- navigator.userAgent
1700
- ) || window.innerWidth <= 500
1701
- ) : false,
1709
+ useFullscreenPopup: computeDefaultUseFullscreenPopup(),
1702
1710
  //* The number type to enforce during validation.
1703
1711
  validationNumberTypes: ["MOBILE"]
1704
1712
  };
@@ -1726,7 +1734,7 @@ var normaliseString = (s = "") => s.normalize("NFD").replace(/[\u0300-\u036f]/g,
1726
1734
  var isRegionlessNanp = (number) => {
1727
1735
  const numeric = getNumeric(number);
1728
1736
  if (numeric.charAt(0) === "1") {
1729
- const areaCode = numeric.substr(1, 3);
1737
+ const areaCode = numeric.substring(1, 4);
1730
1738
  return regionlessNanpNumbers.includes(areaCode);
1731
1739
  }
1732
1740
  return false;
@@ -1749,8 +1757,8 @@ var translateCursorPosition = (relevantChars, formattedValue, prevCaretPos, isDe
1749
1757
  }
1750
1758
  return formattedValue.length;
1751
1759
  };
1752
- var createEl = (name, attrs, container) => {
1753
- const el = document.createElement(name);
1760
+ var createEl = (tagName, attrs, container) => {
1761
+ const el = document.createElement(tagName);
1754
1762
  if (attrs) {
1755
1763
  Object.entries(attrs).forEach(([key, value]) => el.setAttribute(key, value));
1756
1764
  }
@@ -1763,7 +1771,14 @@ var forEachInstance = (method, ...args) => {
1763
1771
  const { instances } = intlTelInput;
1764
1772
  Object.values(instances).forEach((instance) => instance[method](...args));
1765
1773
  };
1766
- var Iti = class {
1774
+ var Iti = class _Iti {
1775
+ /**
1776
+ * Build a space-delimited class string from an object map of className -> truthy/falsey.
1777
+ * Only keys with truthy values are included.
1778
+ */
1779
+ static _buildClassNames(flags) {
1780
+ return Object.keys(flags).filter((k) => Boolean(flags[k])).join(" ");
1781
+ }
1767
1782
  constructor(input, customOptions = {}) {
1768
1783
  this.id = id++;
1769
1784
  this.telInput = input;
@@ -1826,6 +1841,16 @@ var Iti = class {
1826
1841
  this._processDialCodes();
1827
1842
  this._translateCountryNames();
1828
1843
  this._sortCountries();
1844
+ this.countryByIso2 = new Map(this.countries.map((c) => [c.iso2, c]));
1845
+ this._cacheSearchTokens();
1846
+ }
1847
+ //* Precompute and cache country search tokens to speed up filtering
1848
+ _cacheSearchTokens() {
1849
+ for (const c of this.countries) {
1850
+ c.normalisedName = normaliseString(c.name);
1851
+ c.initials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
1852
+ c.dialCodePlus = `+${c.dialCode}`;
1853
+ }
1829
1854
  }
1830
1855
  //* Sort countries by countryOrder option (if present), then name.
1831
1856
  _sortCountries() {
@@ -1857,13 +1882,12 @@ var Iti = class {
1857
1882
  if (!this.dialCodeToIso2Map.hasOwnProperty(dialCode)) {
1858
1883
  this.dialCodeToIso2Map[dialCode] = [];
1859
1884
  }
1860
- for (let i = 0; i < this.dialCodeToIso2Map[dialCode].length; i++) {
1861
- if (this.dialCodeToIso2Map[dialCode][i] === iso2) {
1862
- return;
1863
- }
1885
+ const iso2List = this.dialCodeToIso2Map[dialCode];
1886
+ if (iso2List.includes(iso2)) {
1887
+ return;
1864
1888
  }
1865
- const index = priority !== void 0 ? priority : this.dialCodeToIso2Map[dialCode].length;
1866
- this.dialCodeToIso2Map[dialCode][index] = iso2;
1889
+ const index = priority !== void 0 ? priority : iso2List.length;
1890
+ iso2List[index] = iso2;
1867
1891
  }
1868
1892
  //* Process onlyCountries or excludeCountries array if present.
1869
1893
  _processAllCountries() {
@@ -1888,33 +1912,30 @@ var Iti = class {
1888
1912
  }
1889
1913
  //* Translate Countries by object literal provided on config.
1890
1914
  _translateCountryNames() {
1891
- for (let i = 0; i < this.countries.length; i++) {
1892
- const iso2 = this.countries[i].iso2.toLowerCase();
1915
+ for (const c of this.countries) {
1916
+ const iso2 = c.iso2.toLowerCase();
1893
1917
  if (this.options.i18n.hasOwnProperty(iso2)) {
1894
- this.countries[i].name = this.options.i18n[iso2];
1918
+ c.name = this.options.i18n[iso2];
1895
1919
  }
1896
1920
  }
1897
1921
  }
1898
1922
  //* Generate this.dialCodes and this.dialCodeToIso2Map.
1899
1923
  _processDialCodes() {
1900
- this.dialCodes = {};
1924
+ this.dialCodes = /* @__PURE__ */ new Set();
1901
1925
  this.dialCodeMaxLen = 0;
1902
1926
  this.dialCodeToIso2Map = {};
1903
- for (let i = 0; i < this.countries.length; i++) {
1904
- const c = this.countries[i];
1905
- if (!this.dialCodes[c.dialCode]) {
1906
- this.dialCodes[c.dialCode] = true;
1927
+ for (const c of this.countries) {
1928
+ if (!this.dialCodes.has(c.dialCode)) {
1929
+ this.dialCodes.add(c.dialCode);
1907
1930
  }
1908
1931
  this._addToDialCodeMap(c.iso2, c.dialCode, c.priority);
1909
1932
  }
1910
- for (let i = 0; i < this.countries.length; i++) {
1911
- const c = this.countries[i];
1933
+ for (const c of this.countries) {
1912
1934
  if (c.areaCodes) {
1913
1935
  const rootIso2Code = this.dialCodeToIso2Map[c.dialCode][0];
1914
- for (let j = 0; j < c.areaCodes.length; j++) {
1915
- const areaCode = c.areaCodes[j];
1936
+ for (const areaCode of c.areaCodes) {
1916
1937
  for (let k = 1; k < areaCode.length; k++) {
1917
- const partialAreaCode = areaCode.substr(0, k);
1938
+ const partialAreaCode = areaCode.substring(0, k);
1918
1939
  const partialDialCode = c.dialCode + partialAreaCode;
1919
1940
  this._addToDialCodeMap(rootIso2Code, partialDialCode);
1920
1941
  this._addToDialCodeMap(c.iso2, partialDialCode);
@@ -1942,20 +1963,14 @@ var Iti = class {
1942
1963
  countrySearch,
1943
1964
  i18n
1944
1965
  } = this.options;
1945
- let parentClass = "iti";
1946
- if (allowDropdown) {
1947
- parentClass += " iti--allow-dropdown";
1948
- }
1949
- if (showFlags) {
1950
- parentClass += " iti--show-flags";
1951
- }
1952
- if (containerClass) {
1953
- parentClass += ` ${containerClass}`;
1954
- }
1955
- if (!useFullscreenPopup) {
1956
- parentClass += " iti--inline-dropdown";
1957
- }
1958
- const wrapper = createEl("div", { class: parentClass });
1966
+ const parentClasses = _Iti._buildClassNames({
1967
+ "iti": true,
1968
+ "iti--allow-dropdown": allowDropdown,
1969
+ "iti--show-flags": showFlags,
1970
+ "iti--inline-dropdown": !useFullscreenPopup,
1971
+ [containerClass]: Boolean(containerClass)
1972
+ });
1973
+ const wrapper = createEl("div", { class: parentClasses });
1959
1974
  this.telInput.parentNode?.insertBefore(wrapper, this.telInput);
1960
1975
  if (allowDropdown || showFlags || separateDialCode) {
1961
1976
  this.countryContainer = createEl(
@@ -1976,9 +1991,8 @@ var Iti = class {
1976
1991
  class: "iti__selected-country",
1977
1992
  "aria-expanded": "false",
1978
1993
  "aria-label": this.options.i18n.selectedCountryAriaLabel,
1979
- "aria-haspopup": "true",
1980
- "aria-controls": `iti-${this.id}__dropdown-content`,
1981
- "role": "combobox"
1994
+ "aria-haspopup": "dialog",
1995
+ "aria-controls": `iti-${this.id}__dropdown-content`
1982
1996
  },
1983
1997
  this.countryContainer
1984
1998
  );
@@ -2017,15 +2031,38 @@ var Iti = class {
2017
2031
  const extraClasses = fixDropdownWidth ? "" : "iti--flexible-dropdown-width";
2018
2032
  this.dropdownContent = createEl("div", {
2019
2033
  id: `iti-${this.id}__dropdown-content`,
2020
- class: `iti__dropdown-content iti__hide ${extraClasses}`
2034
+ class: `iti__dropdown-content iti__hide ${extraClasses}`,
2035
+ role: "dialog",
2036
+ "aria-modal": "true"
2021
2037
  });
2022
2038
  if (countrySearch) {
2039
+ const searchWrapper = createEl(
2040
+ "div",
2041
+ { class: "iti__search-input-wrapper" },
2042
+ this.dropdownContent
2043
+ );
2044
+ this.searchIcon = createEl(
2045
+ "span",
2046
+ {
2047
+ class: "iti__search-icon",
2048
+ "aria-hidden": "true"
2049
+ },
2050
+ searchWrapper
2051
+ );
2052
+ this.searchIcon.innerHTML = `
2053
+ <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
2054
+ <circle cx="11" cy="11" r="7" />
2055
+ <line x1="21" y1="21" x2="16.65" y2="16.65" />
2056
+ </svg>`;
2023
2057
  this.searchInput = createEl(
2024
2058
  "input",
2025
2059
  {
2026
- type: "text",
2060
+ id: `iti-${this.id}__search-input`,
2061
+ // Chrome says inputs need either a name or an id
2062
+ type: "search",
2027
2063
  class: "iti__search-input",
2028
2064
  placeholder: i18n.searchPlaceholder,
2065
+ // role=combobox + aria-autocomplete=list + aria-activedescendant allows maintaining focus on the search input while allowing users to navigate search results with up/down keyboard keys
2029
2066
  role: "combobox",
2030
2067
  "aria-expanded": "true",
2031
2068
  "aria-label": i18n.searchPlaceholder,
@@ -2033,13 +2070,42 @@ var Iti = class {
2033
2070
  "aria-autocomplete": "list",
2034
2071
  "autocomplete": "off"
2035
2072
  },
2036
- this.dropdownContent
2073
+ searchWrapper
2037
2074
  );
2075
+ this.searchClearButton = createEl(
2076
+ "button",
2077
+ {
2078
+ type: "button",
2079
+ class: "iti__search-clear iti__hide",
2080
+ "aria-label": i18n.clearSearchAriaLabel,
2081
+ tabindex: "-1"
2082
+ },
2083
+ searchWrapper
2084
+ );
2085
+ const maskId = `iti-${this.id}-clear-mask`;
2086
+ this.searchClearButton.innerHTML = `
2087
+ <svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
2088
+ <mask id="${maskId}" maskUnits="userSpaceOnUse">
2089
+ <rect width="16" height="16" fill="white" />
2090
+ <path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
2091
+ </mask>
2092
+ <circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${maskId})" />
2093
+ </svg>`;
2038
2094
  this.searchResultsA11yText = createEl(
2039
2095
  "span",
2040
2096
  { class: "iti__a11y-text" },
2041
2097
  this.dropdownContent
2042
2098
  );
2099
+ this.searchNoResults = createEl(
2100
+ "div",
2101
+ {
2102
+ class: "iti__no-results iti__hide",
2103
+ "aria-hidden": "true"
2104
+ // all a11y messaging happens in this.searchResultsA11yText
2105
+ },
2106
+ this.dropdownContent
2107
+ );
2108
+ this.searchNoResults.textContent = i18n.zeroSearchResults;
2043
2109
  }
2044
2110
  this.countryList = createEl(
2045
2111
  "ul",
@@ -2053,18 +2119,16 @@ var Iti = class {
2053
2119
  );
2054
2120
  this._appendListItems();
2055
2121
  if (countrySearch) {
2056
- this._updateSearchResultsText();
2122
+ this._updateSearchResultsA11yText();
2057
2123
  }
2058
2124
  if (dropdownContainer) {
2059
- let dropdownClasses = "iti iti--container";
2060
- if (containerClass) {
2061
- dropdownClasses += ` ${containerClass}`;
2062
- }
2063
- if (useFullscreenPopup) {
2064
- dropdownClasses += " iti--fullscreen-popup";
2065
- } else {
2066
- dropdownClasses += " iti--inline-dropdown";
2067
- }
2125
+ const dropdownClasses = _Iti._buildClassNames({
2126
+ "iti": true,
2127
+ "iti--container": true,
2128
+ "iti--fullscreen-popup": useFullscreenPopup,
2129
+ "iti--inline-dropdown": !useFullscreenPopup,
2130
+ [containerClass]: Boolean(containerClass)
2131
+ });
2068
2132
  this.dropdown = createEl("div", { class: dropdownClasses });
2069
2133
  this.dropdown.appendChild(this.dropdownContent);
2070
2134
  } else {
@@ -2349,7 +2413,7 @@ var Iti = class {
2349
2413
  //* Adhere to the input's maxlength attr.
2350
2414
  _cap(number) {
2351
2415
  const max = parseInt(this.telInput.getAttribute("maxlength") || "", 10);
2352
- return max && number.length > max ? number.substr(0, max) : number;
2416
+ return max && number.length > max ? number.substring(0, max) : number;
2353
2417
  }
2354
2418
  //* Trigger a custom event on the input.
2355
2419
  _trigger(name, detailProps = {}) {
@@ -2462,6 +2526,11 @@ var Iti = class {
2462
2526
  } else {
2463
2527
  this._filterCountries("", true);
2464
2528
  }
2529
+ if (this.searchInput.value) {
2530
+ this.searchClearButton.classList.remove("iti__hide");
2531
+ } else {
2532
+ this.searchClearButton.classList.add("iti__hide");
2533
+ }
2465
2534
  };
2466
2535
  let keyupTimer = null;
2467
2536
  this._handleSearchChange = () => {
@@ -2474,14 +2543,20 @@ var Iti = class {
2474
2543
  }, 100);
2475
2544
  };
2476
2545
  this.searchInput.addEventListener("input", this._handleSearchChange);
2546
+ this._handleSearchClear = (e) => {
2547
+ e.stopPropagation();
2548
+ this.searchInput.value = "";
2549
+ this.searchInput.focus();
2550
+ doFilter();
2551
+ };
2552
+ this.searchClearButton.addEventListener("click", this._handleSearchClear);
2477
2553
  this.searchInput.addEventListener("click", (e) => e.stopPropagation());
2478
2554
  }
2479
2555
  }
2480
2556
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2481
2557
  _searchForCountry(query) {
2482
- for (let i = 0; i < this.countries.length; i++) {
2483
- const c = this.countries[i];
2484
- const startsWith = c.name.substr(0, query.length).toLowerCase() === query;
2558
+ for (const c of this.countries) {
2559
+ const startsWith = c.name.substring(0, query.length).toLowerCase() === query;
2485
2560
  if (startsWith) {
2486
2561
  const listItem = c.nodeById[this.id];
2487
2562
  this._highlightListItem(listItem, false);
@@ -2502,23 +2577,20 @@ var Iti = class {
2502
2577
  const dialCodeMatches = [];
2503
2578
  const dialCodeContains = [];
2504
2579
  const initialsMatches = [];
2505
- for (let i = 0; i < this.countries.length; i++) {
2506
- const c = this.countries[i];
2507
- const normalisedCountryName = normaliseString(c.name);
2508
- const countryInitials = c.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((word) => word[0]).join("").toLowerCase();
2580
+ for (const c of this.countries) {
2509
2581
  if (isReset || queryLength === 0) {
2510
2582
  nameContains.push(c);
2511
- } else if (c.iso2.toLowerCase() === normalisedQuery) {
2583
+ } else if (c.iso2 === normalisedQuery) {
2512
2584
  iso2Matches.push(c);
2513
- } else if (normalisedCountryName.startsWith(normalisedQuery)) {
2585
+ } else if (c.normalisedName.startsWith(normalisedQuery)) {
2514
2586
  nameStartWith.push(c);
2515
- } else if (normalisedCountryName.includes(normalisedQuery)) {
2587
+ } else if (c.normalisedName.includes(normalisedQuery)) {
2516
2588
  nameContains.push(c);
2517
- } else if (normalisedQuery === c.dialCode || normalisedQuery === `+${c.dialCode}`) {
2589
+ } else if (normalisedQuery === c.dialCode || normalisedQuery === c.dialCodePlus) {
2518
2590
  dialCodeMatches.push(c);
2519
- } else if (`+${c.dialCode}`.includes(normalisedQuery)) {
2591
+ } else if (c.dialCodePlus.includes(normalisedQuery)) {
2520
2592
  dialCodeContains.push(c);
2521
- } else if (countryInitials.includes(normalisedQuery)) {
2593
+ } else if (c.initials.includes(normalisedQuery)) {
2522
2594
  initialsMatches.push(c);
2523
2595
  }
2524
2596
  }
@@ -2542,12 +2614,17 @@ var Iti = class {
2542
2614
  }
2543
2615
  if (noCountriesAddedYet) {
2544
2616
  this._highlightListItem(null, false);
2617
+ if (this.searchNoResults) {
2618
+ this.searchNoResults.classList.remove("iti__hide");
2619
+ }
2620
+ } else if (this.searchNoResults) {
2621
+ this.searchNoResults.classList.add("iti__hide");
2545
2622
  }
2546
2623
  this.countryList.scrollTop = 0;
2547
- this._updateSearchResultsText();
2624
+ this._updateSearchResultsA11yText();
2548
2625
  }
2549
2626
  //* Update search results text (for a11y).
2550
- _updateSearchResultsText() {
2627
+ _updateSearchResultsA11yText() {
2551
2628
  const { i18n } = this.options;
2552
2629
  const count = this.countryList.childElementCount;
2553
2630
  let searchText;
@@ -2638,9 +2715,9 @@ var Iti = class {
2638
2715
  const alreadySelected = selectedIso2 && iso2Codes.includes(selectedIso2) && !hasAreaCodesButNoneMatched;
2639
2716
  const isRegionlessNanpNumber = selectedDialCode === "1" && isRegionlessNanp(numeric);
2640
2717
  if (!isRegionlessNanpNumber && !alreadySelected) {
2641
- for (let j = 0; j < iso2Codes.length; j++) {
2642
- if (iso2Codes[j]) {
2643
- return iso2Codes[j];
2718
+ for (const iso2 of iso2Codes) {
2719
+ if (iso2) {
2720
+ return iso2;
2644
2721
  }
2645
2722
  }
2646
2723
  }
@@ -2662,9 +2739,8 @@ var Iti = class {
2662
2739
  if (this.highlightedItem) {
2663
2740
  this.highlightedItem.classList.add("iti__highlight");
2664
2741
  this.highlightedItem.setAttribute("aria-selected", "true");
2665
- const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2666
- this.selectedCountry.setAttribute("aria-activedescendant", activeDescendant);
2667
2742
  if (this.options.countrySearch) {
2743
+ const activeDescendant = this.highlightedItem.getAttribute("id") || "";
2668
2744
  this.searchInput.setAttribute("aria-activedescendant", activeDescendant);
2669
2745
  }
2670
2746
  }
@@ -2673,12 +2749,11 @@ var Iti = class {
2673
2749
  }
2674
2750
  }
2675
2751
  //* Find the country data for the given iso2 code
2676
- //* the ignoreOnlyCountriesOption is only used during init() while parsing the onlyCountries array
2752
+ //* the allowFail option is only used during init() for the initialCountry option, and for the iso2 returned from geoIpLookup - in these 2 cases we don't want to error out
2677
2753
  _getCountryData(iso2, allowFail) {
2678
- for (let i = 0; i < this.countries.length; i++) {
2679
- if (this.countries[i].iso2 === iso2) {
2680
- return this.countries[i];
2681
- }
2754
+ const country = this.countryByIso2.get(iso2);
2755
+ if (country) {
2756
+ return country;
2682
2757
  }
2683
2758
  if (allowFail) {
2684
2759
  return null;
@@ -2829,7 +2904,6 @@ var Iti = class {
2829
2904
  _closeDropdown() {
2830
2905
  this.dropdownContent.classList.add("iti__hide");
2831
2906
  this.selectedCountry.setAttribute("aria-expanded", "false");
2832
- this.selectedCountry.removeAttribute("aria-activedescendant");
2833
2907
  if (this.highlightedItem) {
2834
2908
  this.highlightedItem.setAttribute("aria-selected", "false");
2835
2909
  }
@@ -2837,9 +2911,9 @@ var Iti = class {
2837
2911
  this.searchInput.removeAttribute("aria-activedescendant");
2838
2912
  }
2839
2913
  this.dropdownArrow.classList.remove("iti__arrow--up");
2840
- document.removeEventListener("keydown", this._handleKeydownOnDropdown);
2841
2914
  if (this.options.countrySearch) {
2842
2915
  this.searchInput.removeEventListener("input", this._handleSearchChange);
2916
+ this.searchClearButton.removeEventListener("click", this._handleSearchClear);
2843
2917
  }
2844
2918
  document.documentElement.removeEventListener(
2845
2919
  "click",
@@ -2909,11 +2983,11 @@ var Iti = class {
2909
2983
  numericChars += c;
2910
2984
  if (includeAreaCode) {
2911
2985
  if (this.dialCodeToIso2Map[numericChars]) {
2912
- dialCode = number.substr(0, i + 1);
2986
+ dialCode = number.substring(0, i + 1);
2913
2987
  }
2914
2988
  } else {
2915
- if (this.dialCodes[numericChars]) {
2916
- dialCode = number.substr(0, i + 1);
2989
+ if (this.dialCodes.has(numericChars)) {
2990
+ dialCode = number.substring(0, i + 1);
2917
2991
  break;
2918
2992
  }
2919
2993
  }
@@ -2946,7 +3020,7 @@ var Iti = class {
2946
3020
  if (dialCode) {
2947
3021
  dialCode = `+${this.selectedCountryData.dialCode}`;
2948
3022
  const start = number[dialCode.length] === " " || number[dialCode.length] === "-" ? dialCode.length + 1 : dialCode.length;
2949
- number = number.substr(start);
3023
+ number = number.substring(start);
2950
3024
  }
2951
3025
  }
2952
3026
  return this._cap(number);
@@ -3080,38 +3154,32 @@ var Iti = class {
3080
3154
  }
3081
3155
  return -99;
3082
3156
  }
3083
- //* Validate the input val
3157
+ //* Validate the input val (with precise=false)
3084
3158
  isValidNumber() {
3085
- if (!this.selectedCountryData.iso2) {
3086
- return false;
3087
- }
3088
- const val = this._getFullNumber();
3089
- const alphaCharPosition = val.search(/\p{L}/u);
3090
- if (alphaCharPosition > -1) {
3091
- const beforeAlphaChar = val.substring(0, alphaCharPosition);
3092
- const beforeAlphaIsValid = this._utilsIsPossibleNumber(beforeAlphaChar);
3093
- const isValid = this._utilsIsPossibleNumber(val);
3094
- return beforeAlphaIsValid && isValid;
3095
- }
3096
- return this._utilsIsPossibleNumber(val);
3159
+ return this._validateNumber(false);
3160
+ }
3161
+ //* Validate the input val (with precise=true)
3162
+ isValidNumberPrecise() {
3163
+ return this._validateNumber(true);
3097
3164
  }
3098
3165
  _utilsIsPossibleNumber(val) {
3099
3166
  return intlTelInput.utils ? intlTelInput.utils.isPossibleNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
3100
3167
  }
3101
- //* Validate the input val (precise)
3102
- isValidNumberPrecise() {
3168
+ //* Shared internal validation logic to handle alpha character extension rules.
3169
+ _validateNumber(precise) {
3103
3170
  if (!this.selectedCountryData.iso2) {
3104
3171
  return false;
3105
3172
  }
3106
3173
  const val = this._getFullNumber();
3107
3174
  const alphaCharPosition = val.search(/\p{L}/u);
3175
+ const testValidity = (s) => precise ? this._utilsIsValidNumber(s) : this._utilsIsPossibleNumber(s);
3108
3176
  if (alphaCharPosition > -1) {
3109
3177
  const beforeAlphaChar = val.substring(0, alphaCharPosition);
3110
- const beforeAlphaIsValid = this._utilsIsValidNumber(beforeAlphaChar);
3111
- const isValid = this._utilsIsValidNumber(val);
3178
+ const beforeAlphaIsValid = testValidity(beforeAlphaChar);
3179
+ const isValid = testValidity(val);
3112
3180
  return beforeAlphaIsValid && isValid;
3113
3181
  }
3114
- return this._utilsIsValidNumber(val);
3182
+ return testValidity(val);
3115
3183
  }
3116
3184
  _utilsIsValidNumber(val) {
3117
3185
  return intlTelInput.utils ? intlTelInput.utils.isValidNumber(val, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
@@ -3203,7 +3271,7 @@ var intlTelInput = Object.assign(
3203
3271
  attachUtils,
3204
3272
  startedLoadingUtilsScript: false,
3205
3273
  startedLoadingAutoCountry: false,
3206
- version: "25.5.2"
3274
+ version: "25.8.0"
3207
3275
  }
3208
3276
  );
3209
3277
  var intl_tel_input_default = intlTelInput;
@@ -4547,37 +4615,12 @@ var intl_tel_input_default = intlTelInput;
4547
4615
  ,
4548
4616
  [-1]
4549
4617
  ], [, , "242225\\d{4}", , , , "2422250123"], , , [, , , , , , , , , [-1]]],
4550
- BT: [
4551
- ,
4552
- [, , "[17]\\d{7}|[2-8]\\d{6}", , , , , , , [7, 8], [6]],
4553
- [, , "(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}", , , , "2345678", , , [7], [6]],
4554
- [, , "(?:1[67]|77)\\d{6}", , , , "17123456", , , [8]],
4555
- [, , , , , , , , , [-1]],
4556
- [, , , , , , , , , [-1]],
4557
- [, , , , , , , , , [-1]],
4558
- [, , , , , , , , , [-1]],
4559
- [, , , , , , , , , [-1]],
4560
- "BT",
4561
- 975,
4562
- "00",
4563
- ,
4618
+ BT: [, [, , "[178]\\d{7}|[2-8]\\d{6}", , , , , , , [7, 8], [6]], [, , "(?:2[3-6]|[34][5-7]|5[236]|6[2-46]|7[246]|8[2-4])\\d{5}", , , , "2345678", , , [7], [6]], [, , "(?:1[67]|[78]7)\\d{6}", , , , "17123456", , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "BT", 975, "00", , , , , , , , [[, "(\\d{3})(\\d{3})", "$1 $2", ["[2-7]"]], [, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], [
4564
4619
  ,
4565
- ,
4566
- ,
4567
- ,
4568
- ,
4569
- ,
4570
- [[, "(\\d{3})(\\d{3})", "$1 $2", ["[2-7]"]], [, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]],
4571
- [[, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-68]|7[246]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|7"]]],
4572
- [, , , , , , , , , [-1]],
4573
- ,
4574
- ,
4575
- [, , , , , , , , , [-1]],
4576
- [, , , , , , , , , [-1]],
4577
- ,
4578
- ,
4579
- [, , , , , , , , , [-1]]
4580
- ],
4620
+ "(\\d{2})(\\d{2})(\\d{2})(\\d{2})",
4621
+ "$1 $2 $3 $4",
4622
+ ["1[67]|[78]"]
4623
+ ]], [[, "(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], [, "(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
4581
4624
  BW: [, [, , "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", , , , , , , [7, 8, 10]], [, , "(?:2(?:4[0-48]|6[0-24]|9[0578])|3(?:1[0-35-9]|55|[69]\\d|7[013]|81)|4(?:6[03]|7[1267]|9[0-5])|5(?:3[03489]|4[0489]|7[1-47]|88|9[0-49])|6(?:2[1-35]|5[149]|8[013467]))\\d{4}", , , , "2401234", , , [7]], [
4582
4625
  ,
4583
4626
  ,
@@ -4589,7 +4632,7 @@ var intl_tel_input_default = intlTelInput;
4589
4632
  ,
4590
4633
  ,
4591
4634
  [8]
4592
- ], [, , "(?:0800|800\\d)\\d{6}", , , , "0800012345", , , [10]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}", , , , "79101234", , , [8]], "BW", 267, "00", , , , , , , , [[, "(\\d{2})(\\d{5})", "$1 $2", ["90"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], [, "(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [
4635
+ ], [, , "(?:0800|800\\d)\\d{6}", , , , "0800012345", , , [10]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "79(?:1(?:[0-2]\\d|3[0-8])|2[0-7]\\d)\\d{3}", , , , "79101234", , , [8]], "BW", 267, "00", , , , , , , , [[, "(\\d{2})(\\d{5})", "$1 $2", ["90"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], [, "(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [
4593
4636
  ,
4594
4637
  ,
4595
4638
  ,
@@ -4600,7 +4643,7 @@ var intl_tel_input_default = intlTelInput;
4600
4643
  ,
4601
4644
  ,
4602
4645
  [-1]
4603
- ]],
4646
+ ], , , [, , , , , , , , , [-1]]],
4604
4647
  BY: [, [, , "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", , , , , , , [6, 7, 8, 9, 10, 11], [5]], [, , "(?:1(?:5(?:1[1-5]|[24]\\d|6[2-4]|9[1-7])|6(?:[235]\\d|4[1-7])|7\\d\\d)|2(?:1(?:[246]\\d|3[0-35-9]|5[1-9])|2(?:[235]\\d|4[0-8])|3(?:[26]\\d|3[02-79]|4[024-7]|5[03-7])))\\d{5}", , , , "152450911", , , [9], [5, 6, 7]], [, , "(?:2(?:5[5-79]|9[1-9])|(?:33|44)\\d)\\d{6}", , , , "294911911", , , [9]], [
4605
4648
  ,
4606
4649
  ,
@@ -4995,7 +5038,7 @@ var intl_tel_input_default = intlTelInput;
4995
5038
  ,
4996
5039
  [5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
4997
5040
  [2, 3, 4]
4998
- ], [, , "15310\\d{6}|1(?:5[0-25-9]\\d|7[013-5])\\d{7}|1(?:6[023]|7[26-9])\\d{7,8}", , , , "15123456789", , , [10, 11]], [, , "800\\d{7,12}", , , , "8001234567890", , , [10, 11, 12, 13, 14, 15]], [, , "(?:137[7-9]|900(?:[135]|9\\d))\\d{6}", , , , "9001234567", , , [10, 11]], [, , "180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}", , , , "18012345", , , [7, 8, 9, 10, 11, 12, 13, 14]], [, , "700\\d{8}", , , , "70012345678", , , [11]], [, , , , , , , , , [-1]], "DE", 49, "00", "0", , , "0", , , , [
5041
+ ], [, , "1(?:(?:5(?:[0-25-9]\\d\\d|3(?:10|33))|7[26-9]\\d\\d)\\d{6}|6[023]\\d{7,8})|17\\d{8}", , , , "15123456789", , , [10, 11]], [, , "800\\d{7,12}", , , , "8001234567890", , , [10, 11, 12, 13, 14, 15]], [, , "(?:137[7-9]|900(?:[135]|9\\d))\\d{6}", , , , "9001234567", , , [10, 11]], [, , "180\\d{5,11}|13(?:7[1-6]\\d\\d|8)\\d{4}", , , , "18012345", , , [7, 8, 9, 10, 11, 12, 13, 14]], [, , "700\\d{8}", , , , "70012345678", , , [11]], [, , , , , , , , , [-1]], "DE", 49, "00", "0", , , "0", , , , [
4999
5042
  [
5000
5043
  ,
5001
5044
  "(\\d{2})(\\d{3,13})",
@@ -5021,7 +5064,7 @@ var intl_tel_input_default = intlTelInput;
5021
5064
  [, "(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"],
5022
5065
  [, "(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"],
5023
5066
  [, "(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"],
5024
- [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|31)"], "0$1"],
5067
+ [, "(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"],
5025
5068
  [, "(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"],
5026
5069
  [, "(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"],
5027
5070
  [, "(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"],
@@ -5743,7 +5786,7 @@ var intl_tel_input_default = intlTelInput;
5743
5786
  ,
5744
5787
  ,
5745
5788
  "2201234"
5746
- ], [, , "(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[019]|70))\\d{4}", , , , "6091234"], [, , "(?:289|8(?:00|6[28]|88|99))\\d{4}", , , , "2891234"], [, , "9008\\d{3}", , , , "9008123"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "515\\d{4}", , , , "5151234"], "GY", 592, "001", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5789
+ ], [, , "(?:51[01]|6\\d\\d|7(?:[0-5]\\d|6[0-39]|70))\\d{4}", , , , "6091234"], [, , "(?:289|8(?:00|6[28]|88|99))\\d{4}", , , , "2891234"], [, , "9008\\d{3}", , , , "9008123"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "515\\d{4}", , , , "5151234"], "GY", 592, "001", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
5747
5790
  HK: [, [, , "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", , , , , , , [5, 6, 7, 8, 9, 11]], [
5748
5791
  ,
5749
5792
  ,
@@ -5906,7 +5949,7 @@ var intl_tel_input_default = intlTelInput;
5906
5949
  10,
5907
5950
  11,
5908
5951
  12
5909
- ]], [, , "153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}", , , , "21234567", , , [8, 11, 12], [7]], [, , "55(?:4(?:[01]0|5[0-5])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", , , , "502345678", , , [9]], [, , "1(?:255|80[019]\\d{3})\\d{3}", , , , "1800123456", , , [7, 10]], [, , "1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}", , , , "1919123456", , , [8, 10]], [, , "1700\\d{6}", , , , "1700123456", , , [10]], [, , , , , , , , , [-1]], [
5952
+ ]], [, , "153\\d{8,9}|29[1-9]\\d{5}|(?:2[0-8]|[3489]\\d)\\d{6}", , , , "21234567", , , [8, 11, 12], [7]], [, , "55(?:4(?:0[01]|10|5[0-7])|57[0-289])\\d{4}|5(?:(?:[0-2][02-9]|[36]\\d|[49][2-9]|8[3-7])\\d|5(?:01|2\\d|3[0-3]|4[34]|5[0-25689]|6[6-8]|7[0-267]|8[7-9]|9[1-9]))\\d{5}", , , , "502345678", , , [9]], [, , "1(?:255|80[019]\\d{3})\\d{3}", , , , "1800123456", , , [7, 10]], [, , "1212\\d{4}|1(?:200|9(?:0[0-2]|19))\\d{6}", , , , "1919123456", , , [8, 10]], [, , "1700\\d{6}", , , , "1700123456", , , [10]], [, , , , , , , , , [-1]], [
5910
5953
  ,
5911
5954
  ,
5912
5955
  "7(?:38(?:[05]\\d|8[018])|8(?:33|55|77|81)\\d)\\d{4}|7(?:18|2[23]|3[237]|47|6[258]|7\\d|82|9[2-9])\\d{6}",
@@ -7323,7 +7366,7 @@ var intl_tel_input_default = intlTelInput;
7323
7366
  ,
7324
7367
  [, , "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", , , , , , , [7, 8, 9]],
7325
7368
  [, , "2[1-6]\\d{6}", , , , "23123456", , , [8]],
7326
- [, , "1505\\d{4}|(?:7(?:[126-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7369
+ [, , "1505\\d{4}|(?:7(?:[125-9]\\d|41)|9(?:0[1-9]|[1-9]\\d))\\d{5}", , , , "92123456", , , [8]],
7327
7370
  [, , "8007\\d{4,5}|(?:500|800[05])\\d{4}", , , , "80071234"],
7328
7371
  [, , "900\\d{5}", , , , "90012345", , , [8]],
7329
7372
  [, , , , , , , , , [-1]],
@@ -7353,7 +7396,7 @@ var intl_tel_input_default = intlTelInput;
7353
7396
  PA: [, [, , "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", , , , , , , [7, 8, 10, 11]], [
7354
7397
  ,
7355
7398
  ,
7356
- "(?:1(?:0\\d|1[479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",
7399
+ "(?:1(?:0\\d|1[0479]|2[37]|3[0137]|4[17]|5[05]|6[058]|7[0167]|8[2358]|9[1389])|2(?:[0235-79]\\d|1[0-7]|4[013-9]|8[02-9])|3(?:[047-9]\\d|1[0-8]|2[0-5]|33|5[0-35]|6[068])|4(?:00|3[0-579]|4\\d|7[0-57-9])|5(?:[01]\\d|2[0-7]|[56]0|79)|7(?:0[09]|2[0-26-8]|3[03]|4[04]|5[05-9]|6[0156]|7[0-24-9]|8[4-9]|90)|8(?:09|2[89]|3\\d|4[0-24-689]|5[014]|8[02])|9(?:0[5-9]|1[0135-8]|2[036-9]|3[35-79]|40|5[0457-9]|6[05-9]|7[04-9]|8[35-8]|9\\d))\\d{4}",
7357
7400
  ,
7358
7401
  ,
7359
7402
  ,
@@ -7803,7 +7846,7 @@ var intl_tel_input_default = intlTelInput;
7803
7846
  ,
7804
7847
  ,
7805
7848
  [8]
7806
- ], [, , "89(?:7[0-689]|80)\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-6])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7849
+ ], [, , "8980\\d{4}|(?:8(?:0[1-9]|[1-8]\\d|9[0-7])|9[0-8]\\d)\\d{5}", , , , "81234567", , , [8]], [, , "(?:18|8)00\\d{7}", , , , "18001234567", , , [10, 11]], [, , "1900\\d{7}", , , , "19001234567", , , [11]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "(?:3[12]\\d|666)\\d{5}", , , , "31234567", , , [8]], "SG", 65, "0[0-3]\\d", , , , , , , , [[, "(\\d{4,5})", "$1", ["1[013-9]|77", "1(?:[013-8]|9(?:0[1-9]|[1-9]))|77"]], [, "(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], [, "(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], [
7807
7850
  ,
7808
7851
  "(\\d{4})(\\d{4})(\\d{3})",
7809
7852
  "$1 $2 $3",
@@ -7976,7 +8019,7 @@ var intl_tel_input_default = intlTelInput;
7976
8019
  "$1 $2",
7977
8020
  ["(?:2|90)4|[67]"]
7978
8021
  ], [, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], [, "(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|7[67]|9[2-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7979
- SR: [, [, , "(?:[2-5]|68|[78]\\d|90)\\d{5}", , , , , , , [6, 7]], [, , "(?:2[1-3]|3[0-7]|(?:4|68)\\d|5[2-58])\\d{4}", , , , "211234"], [, , "(?:7[124-7]|8[1-9])\\d{5}", , , , "7412345", , , [7]], [, , "80\\d{5}", , , , "8012345", , , [7]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [
8022
+ SR: [, [, , "(?:[2-5]|[6-8]\\d|90)\\d{5}", , , , , , , [6, 7]], [, , "(?:2[1-3]|3[0-7]|4\\d|5[2-58])\\d{4}", , , , "211234", , , [6]], [, , "(?:6[08]|7[124-7]|8[1-9])\\d{5}", , , , "7412345", , , [7]], [, , "80\\d{5}", , , , "8012345", , , [7]], [, , "90\\d{5}", , , , "9012345", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [
7980
8023
  ,
7981
8024
  ,
7982
8025
  "56\\d{4}",
@@ -7988,37 +8031,13 @@ var intl_tel_input_default = intlTelInput;
7988
8031
  ,
7989
8032
  [6]
7990
8033
  ], "SR", 597, "00", , , , , , , , [[, "(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], [, "(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], [, "(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
7991
- SS: [
8034
+ SS: [, [, , "[19]\\d{8}", , , , , , , [9]], [, , "1[89]\\d{7}", , , , "181234567"], [, , "(?:12|9[1257-9])\\d{7}", , , , "977123456"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "SS", 211, "00", "0", , , "0", , , , [[
7992
8035
  ,
7993
- [, , "[19]\\d{8}", , , , , , , [9]],
7994
- [, , "1[89]\\d{7}", , , , "181234567"],
7995
- [, , "(?:12|9[1257-9])\\d{7}", , , , "977123456"],
7996
- [, , , , , , , , , [-1]],
7997
- [, , , , , , , , , [-1]],
7998
- [, , , , , , , , , [-1]],
7999
- [, , , , , , , , , [-1]],
8000
- [, , , , , , , , , [-1]],
8001
- "SS",
8002
- 211,
8003
- "00",
8004
- "0",
8005
- ,
8006
- ,
8007
- "0",
8008
- ,
8009
- ,
8010
- ,
8011
- [[, "(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]],
8012
- ,
8013
- [, , , , , , , , , [-1]],
8014
- ,
8015
- ,
8016
- [, , , , , , , , , [-1]],
8017
- [, , , , , , , , , [-1]],
8018
- ,
8019
- ,
8020
- [, , , , , , , , , [-1]]
8021
- ],
8036
+ "(\\d{3})(\\d{3})(\\d{3})",
8037
+ "$1 $2 $3",
8038
+ ["[19]"],
8039
+ "0$1"
8040
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8022
8041
  ST: [, [, , "(?:22|9\\d)\\d{5}", , , , , , , [7]], [, , "22\\d{5}", , , , "2221234"], [, , "900[5-9]\\d{3}|9(?:0[1-9]|[89]\\d)\\d{4}", , , , "9812345"], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "ST", 239, "00", , , , , , , , [[, "(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8023
8042
  SV: [, [, , "[267]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", , , , , , , [7, 8, 11]], [
8024
8043
  ,
@@ -8431,35 +8450,62 @@ var intl_tel_input_default = intlTelInput;
8431
8450
  [, "(\\d{3})(\\d{4})", "$1-$2", ["[24-9]|3(?:[02-9]|1[1-9])"]],
8432
8451
  [, "(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], , , 1]
8433
8452
  ], [[, "(\\d{3})(\\d{4})", "$1-$2", ["310"], , , 1], [, "(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-9]"]]], [, , , , , , , , , [-1]], 1, , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8434
- UY: [, [, , "0004\\d{2,9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}", , , , , , , [6, 7, 8, 9, 10, 11, 12, 13]], [, , "(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}", , , , "21231234", , , [8], [7]], [, , "9[1-9]\\d{6}", , , , "94231234", , , [8]], [
8453
+ UY: [, [, , "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", , , , , , , [4, 5, 6, 7, 8, 9, 10, 11, 12, 13]], [, , "(?:1(?:770|9(?:20|[89]7))|(?:2\\d|4[2-7])\\d\\d)\\d{4}", , , , "21231234", , , [8], [7]], [
8435
8454
  ,
8436
8455
  ,
8437
- "0004\\d{2,9}|(?:405|80[05])\\d{4}",
8456
+ "9[1-9]\\d{6}",
8438
8457
  ,
8439
8458
  ,
8440
8459
  ,
8441
- "8001234"
8442
- ], [, , "90[0-8]\\d{4}", , , , "9001234", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UY", 598, "0(?:0|1[3-9]\\d)", "0", " int. ", , "0", , "00", , [[, "(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], [, "(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], [, "(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], [, "(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [
8460
+ "94231234",
8443
8461
  ,
8444
8462
  ,
8463
+ [8]
8464
+ ], [, , "0004\\d{2,9}|(?:405|80[05])\\d{4}", , , , "8001234", , , [6, 7, 8, 9, 10, 11, 12, 13]], [, , "90[0-8]\\d{4}", , , , "9001234", , , [7]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UY", 598, "0(?:0|1[3-9]\\d)", "0", " int. ", , "0", , "00", , [[, "(\\d{4,5})", "$1", ["21"]], [, "(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], [, "(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], [, "(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], [, "(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], [, "(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], [
8445
8465
  ,
8466
+ "(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})",
8467
+ "$1 $2 $3 $4",
8468
+ ["0"]
8469
+ ]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "21\\d{2,3}", , , , "21123", , , [4, 5]], , , [, , , , , , , , , [-1]]],
8470
+ UZ: [
8446
8471
  ,
8472
+ [, , "(?:20|33|[5-9]\\d)\\d{7}", , , , , , , [9]],
8473
+ [, , "(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}", , , , "669050123"],
8474
+ [
8475
+ ,
8476
+ ,
8477
+ "(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}",
8478
+ ,
8479
+ ,
8480
+ ,
8481
+ "912345678"
8482
+ ],
8483
+ [, , , , , , , , , [-1]],
8484
+ [, , , , , , , , , [-1]],
8485
+ [, , , , , , , , , [-1]],
8486
+ [, , , , , , , , , [-1]],
8487
+ [, , , , , , , , , [-1]],
8488
+ "UZ",
8489
+ 998,
8490
+ "00",
8447
8491
  ,
8448
8492
  ,
8449
8493
  ,
8450
8494
  ,
8451
8495
  ,
8452
- [-1]
8453
- ]],
8454
- UZ: [, [, , "(?:20|33|[5-9]\\d)\\d{7}", , , , , , , [9]], [, , "(?:55\\d\\d|6(?:1(?:22|3[124]|4[1-4]|5[1-3578]|64)|2(?:22|3[0-57-9]|41)|5(?:22|3[3-7]|5[024-8])|[69]\\d\\d|7(?:[23]\\d|7[69]))|7(?:0(?:5[4-9]|6[0146]|7[124-6]|9[135-8])|[168]\\d\\d|2(?:22|3[13-57-9]|4[1-3579]|5[14])|3(?:2\\d|3[1578]|4[1-35-7]|5[1-57]|61)|4(?:2\\d|3[1-579]|7[1-79])|5(?:22|5[1-9]|6[1457])|9(?:22|5[1-9])))\\d{5}", , , , "669050123"], [
8455
8496
  ,
8456
8497
  ,
8457
- "(?:(?:[25]0|33|8[78]|9[0-57-9])\\d{3}|6(?:1(?:2(?:2[01]|98)|35[0-4]|50\\d|61[23]|7(?:[01][017]|4\\d|55|9[5-9]))|2(?:(?:11|7\\d)\\d|2(?:[12]1|9[01379])|5(?:[126]\\d|3[0-4]))|5(?:19[01]|2(?:27|9[26])|(?:30|59|7\\d)\\d)|6(?:2(?:1[5-9]|2[0367]|38|41|52|60)|(?:3[79]|9[0-3])\\d|4(?:56|83)|7(?:[07]\\d|1[017]|3[07]|4[047]|5[057]|67|8[0178]|9[79]))|7(?:2(?:24|3[237]|4[5-9]|7[15-8])|5(?:7[12]|8[0589])|7(?:0\\d|[39][07])|9(?:0\\d|7[079])))|7(?:[07]\\d{3}|2(?:2(?:2[79]|95)|3(?:2[5-9]|6[0-6])|57\\d|7(?:0\\d|1[17]|2[27]|3[37]|44|5[057]|66|88))|3(?:2(?:1[0-6]|21|3[469]|7[159])|(?:33|9[4-6])\\d|5(?:0[0-4]|5[579]|9\\d)|7(?:[0-3579]\\d|4[0467]|6[67]|8[078]))|4(?:2(?:29|5[0257]|6[0-7]|7[1-57])|5(?:1[0-4]|8\\d|9[5-9])|7(?:0\\d|1[024589]|2[0-27]|3[0137]|[46][07]|5[01]|7[5-9]|9[079])|9(?:7[015-9]|[89]\\d))|5(?:112|2(?:0\\d|2[29]|[49]4)|3[1568]\\d|52[6-9]|7(?:0[01578]|1[017]|[23]7|4[047]|[5-7]\\d|8[78]|9[079]))|9(?:22[128]|3(?:2[0-4]|7\\d)|57[02569]|7(?:2[05-9]|3[37]|4\\d|60|7[2579]|87|9[07]))))\\d{4}",
8498
+ [[, "(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]],
8458
8499
  ,
8500
+ [, , , , , , , , , [-1]],
8501
+ ,
8502
+ ,
8503
+ [, , , , , , , , , [-1]],
8504
+ [, , , , , , , , , [-1]],
8459
8505
  ,
8460
8506
  ,
8461
- "912345678"
8462
- ], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "UZ", 998, "00", , , , , , , , [[, "(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]],
8507
+ [, , , , , , , , , [-1]]
8508
+ ],
8463
8509
  VA: [, [, , "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", , , , , , , [6, 7, 8, 9, 10, 11, 12]], [, , "06698\\d{1,6}", , , , "0669812345", , , [6, 7, 8, 9, 10, 11]], [, , "3[1-9]\\d{8}|3[2-9]\\d{7}", , , , "3123456789", , , [9, 10]], [
8464
8510
  ,
8465
8511
  ,
@@ -9467,7 +9513,9 @@ var intl_tel_input_default = intlTelInput;
9467
9513
  }
9468
9514
  ;
9469
9515
  const yb = (a) => {
9470
- a.includes("FIXED_LINE_OR_MOBILE") ? (a.includes("MOBILE") || a.push("MOBILE"), a.includes("FIXED_LINE") || a.push("FIXED_LINE")) : (a.includes("MOBILE") || a.includes("FIXED_LINE")) && a.push("FIXED_LINE_OR_MOBILE");
9516
+ const b = [];
9517
+ 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");
9518
+ return a.concat(b);
9471
9519
  }, 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 };
9472
9520
  m("intlTelInputUtilsTemp", {});
9473
9521
  m("intlTelInputUtilsTemp.formatNumberAsYouType", (a, b) => {
@@ -9540,8 +9588,7 @@ var intl_tel_input_default = intlTelInput;
9540
9588
  try {
9541
9589
  const d = K.g(), e = Y(d, a, b), f = cb(d, e);
9542
9590
  if (c) {
9543
- yb(c);
9544
- const g = c.map((h) => zb[h]);
9591
+ const g = yb(c).map((h) => zb[h]);
9545
9592
  return f && g.includes($a(d, e));
9546
9593
  }
9547
9594
  return f;
@@ -9553,8 +9600,8 @@ var intl_tel_input_default = intlTelInput;
9553
9600
  try {
9554
9601
  const d = K.g(), e = Y(d, a, b);
9555
9602
  if (c) {
9556
- yb(c);
9557
- for (let f of c) if (0 === X(d, e, zb[f])) return true;
9603
+ const f = yb(c);
9604
+ for (let g of f) if (0 === X(d, e, zb[g])) return true;
9558
9605
  return false;
9559
9606
  }
9560
9607
  return 0 === X(d, e, -1);