intl-tel-input 25.8.1 → 25.8.3

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.
@@ -1,4 +1,4 @@
1
- import { mergeModels as r2, useModel as D2, ref as v1, onMounted as x2, watch as P2, onUnmounted as R2, withDirectives as B2, createElementBlock as k2, openBlock as O2, mergeProps as G2, vModelText as U2 } from "vue";
1
+ import { mergeModels as r2, useModel as D2, ref as v1, onMounted as P2, watch as x2, onUnmounted as R2, withDirectives as B2, createElementBlock as k2, openBlock as O2, mergeProps as G2, vModelText as U2 } from "vue";
2
2
  const F2 = [
3
3
  [
4
4
  "af",
@@ -1579,8 +1579,8 @@ const V2 = {
1579
1579
  zm: "Zambia",
1580
1580
  zw: "Zimbabwe"
1581
1581
  }, K2 = {
1582
- selectedCountryAriaLabel: "Selected country",
1583
- noCountrySelected: "No country selected",
1582
+ selectedCountryAriaLabel: "Change country, selected ${country}",
1583
+ noCountrySelected: "Select country",
1584
1584
  countryListAriaLabel: "List of countries",
1585
1585
  searchPlaceholder: "Search",
1586
1586
  clearSearchAriaLabel: "Clear search",
@@ -1590,14 +1590,14 @@ const V2 = {
1590
1590
  // additional countries (not supported by country-list library)
1591
1591
  ac: "Ascension Island",
1592
1592
  xk: "Kosovo"
1593
- }, u2 = { ...V2, ...K2 };
1593
+ }, a2 = { ...V2, ...K2 };
1594
1594
  for (const y of q)
1595
- y.name = u2[y.iso2];
1595
+ y.name = a2[y.iso2];
1596
1596
  let H2 = 0;
1597
1597
  const S1 = (y) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches, j2 = () => {
1598
1598
  if (typeof navigator < "u" && typeof window < "u") {
1599
- const y = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = S1("(max-width: 500px)"), i = S1("(max-height: 600px)"), s = S1("(pointer: coarse)");
1600
- return y || e || s && i;
1599
+ const y = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = S1("(max-width: 500px)"), i = S1("(max-height: 600px)"), n = S1("(pointer: coarse)");
1600
+ return y || e || n && i;
1601
1601
  }
1602
1602
  return !1;
1603
1603
  }, l2 = {
@@ -1667,30 +1667,30 @@ const S1 = (y) => typeof window < "u" && typeof window.matchMedia == "function"
1667
1667
  "887",
1668
1668
  "888",
1669
1669
  "889"
1670
- ], f1 = (y) => y.replace(/\D/g, ""), o2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), a2 = (y) => {
1670
+ ], f1 = (y) => y.replace(/\D/g, ""), o2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), u2 = (y) => {
1671
1671
  const e = f1(y);
1672
1672
  if (e.charAt(0) === "1") {
1673
1673
  const i = e.substring(1, 4);
1674
1674
  return W2.includes(i);
1675
1675
  }
1676
1676
  return !1;
1677
- }, z2 = (y, e, i, s) => {
1678
- if (i === 0 && !s)
1677
+ }, z2 = (y, e, i, n) => {
1678
+ if (i === 0 && !n)
1679
1679
  return 0;
1680
- let r = 0;
1680
+ let o = 0;
1681
1681
  for (let l = 0; l < e.length; l++) {
1682
- if (/[+0-9]/.test(e[l]) && r++, r === y && !s)
1682
+ if (/[+0-9]/.test(e[l]) && o++, o === y && !n)
1683
1683
  return l + 1;
1684
- if (s && r === y + 1)
1684
+ if (n && o === y + 1)
1685
1685
  return l;
1686
1686
  }
1687
1687
  return e.length;
1688
1688
  }, T = (y, e, i) => {
1689
- const s = document.createElement(y);
1690
- return e && Object.entries(e).forEach(([r, l]) => s.setAttribute(r, l)), i && i.appendChild(s), s;
1689
+ const n = document.createElement(y);
1690
+ return e && Object.entries(e).forEach(([o, l]) => n.setAttribute(o, l)), i && i.appendChild(n), n;
1691
1691
  }, i1 = (y, ...e) => {
1692
1692
  const { instances: i } = m;
1693
- Object.values(i).forEach((s) => s[y](...e));
1693
+ Object.values(i).forEach((n) => n[y](...e));
1694
1694
  };
1695
1695
  class p1 {
1696
1696
  /**
@@ -1707,13 +1707,13 @@ class p1 {
1707
1707
  _init() {
1708
1708
  this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.onlyCountries.length === 1 && (this.options.initialCountry = this.options.onlyCountries[0]), this.options.separateDialCode && (this.options.nationalMode = !1), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.telInput.dir = "ltr";
1709
1709
  const e = this.options.allowDropdown || this.options.separateDialCode;
1710
- this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...u2, ...this.options.i18n };
1711
- const i = new Promise((r, l) => {
1712
- this.resolveAutoCountryPromise = r, this.rejectAutoCountryPromise = l;
1713
- }), s = new Promise((r, l) => {
1714
- this.resolveUtilsScriptPromise = r, this.rejectUtilsScriptPromise = l;
1710
+ this.showSelectedCountryOnLeft = this.isRTL ? !e : e, this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...a2, ...this.options.i18n };
1711
+ const i = new Promise((o, l) => {
1712
+ this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = l;
1713
+ }), n = new Promise((o, l) => {
1714
+ this.resolveUtilsScriptPromise = o, this.rejectUtilsScriptPromise = l;
1715
1715
  });
1716
- this.promise = Promise.all([i, s]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1716
+ this.promise = Promise.all([i, n]), this.selectedCountryData = {}, this._processCountryData(), this._generateMarkup(), this._setInitialState(), this._initListeners(), this._initRequests();
1717
1717
  }
1718
1718
  //********************
1719
1719
  //* PRIVATE METHODS
@@ -1730,40 +1730,40 @@ class p1 {
1730
1730
  //* Sort countries by countryOrder option (if present), then name.
1731
1731
  _sortCountries() {
1732
1732
  this.options.countryOrder && (this.options.countryOrder = this.options.countryOrder.map((e) => e.toLowerCase())), this.countries.sort((e, i) => {
1733
- const { countryOrder: s } = this.options;
1734
- if (s) {
1735
- const r = s.indexOf(e.iso2), l = s.indexOf(i.iso2), c = r > -1, C = l > -1;
1736
- if (c || C)
1737
- return c && C ? r - l : c ? -1 : 1;
1733
+ const { countryOrder: n } = this.options;
1734
+ if (n) {
1735
+ const o = n.indexOf(e.iso2), l = n.indexOf(i.iso2), C = o > -1, g = l > -1;
1736
+ if (C || g)
1737
+ return C && g ? o - l : C ? -1 : 1;
1738
1738
  }
1739
1739
  return e.name.localeCompare(i.name);
1740
1740
  });
1741
1741
  }
1742
1742
  //* Add a dial code to this.dialCodeToIso2Map.
1743
- _addToDialCodeMap(e, i, s) {
1743
+ _addToDialCodeMap(e, i, n) {
1744
1744
  i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
1745
- const r = this.dialCodeToIso2Map[i];
1746
- if (r.includes(e))
1745
+ const o = this.dialCodeToIso2Map[i];
1746
+ if (o.includes(e))
1747
1747
  return;
1748
- const l = s !== void 0 ? s : r.length;
1749
- r[l] = e;
1748
+ const l = n !== void 0 ? n : o.length;
1749
+ o[l] = e;
1750
1750
  }
1751
1751
  //* Process onlyCountries or excludeCountries array if present.
1752
1752
  _processAllCountries() {
1753
1753
  const { onlyCountries: e, excludeCountries: i } = this.options;
1754
1754
  if (e.length) {
1755
- const s = e.map(
1756
- (r) => r.toLowerCase()
1755
+ const n = e.map(
1756
+ (o) => o.toLowerCase()
1757
1757
  );
1758
1758
  this.countries = q.filter(
1759
- (r) => s.includes(r.iso2)
1759
+ (o) => n.includes(o.iso2)
1760
1760
  );
1761
1761
  } else if (i.length) {
1762
- const s = i.map(
1763
- (r) => r.toLowerCase()
1762
+ const n = i.map(
1763
+ (o) => o.toLowerCase()
1764
1764
  );
1765
1765
  this.countries = q.filter(
1766
- (r) => !s.includes(r.iso2)
1766
+ (o) => !n.includes(o.iso2)
1767
1767
  );
1768
1768
  } else
1769
1769
  this.countries = q;
@@ -1783,38 +1783,38 @@ class p1 {
1783
1783
  for (const e of this.countries)
1784
1784
  if (e.areaCodes) {
1785
1785
  const i = this.dialCodeToIso2Map[e.dialCode][0];
1786
- for (const s of e.areaCodes) {
1787
- for (let r = 1; r < s.length; r++) {
1788
- const l = s.substring(0, r), c = e.dialCode + l;
1789
- this._addToDialCodeMap(i, c), this._addToDialCodeMap(e.iso2, c);
1786
+ for (const n of e.areaCodes) {
1787
+ for (let o = 1; o < n.length; o++) {
1788
+ const l = n.substring(0, o), C = e.dialCode + l;
1789
+ this._addToDialCodeMap(i, C), this._addToDialCodeMap(e.iso2, C);
1790
1790
  }
1791
- this._addToDialCodeMap(e.iso2, e.dialCode + s);
1791
+ this._addToDialCodeMap(e.iso2, e.dialCode + n);
1792
1792
  }
1793
1793
  }
1794
1794
  }
1795
1795
  //* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
1796
1796
  _generateMarkup() {
1797
- var p, I, G;
1797
+ var f, I, G;
1798
1798
  this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
1799
1799
  const {
1800
1800
  allowDropdown: e,
1801
1801
  separateDialCode: i,
1802
- showFlags: s,
1803
- containerClass: r,
1802
+ showFlags: n,
1803
+ containerClass: o,
1804
1804
  hiddenInput: l,
1805
- dropdownContainer: c,
1806
- fixDropdownWidth: C,
1807
- useFullscreenPopup: f,
1805
+ dropdownContainer: C,
1806
+ fixDropdownWidth: g,
1807
+ useFullscreenPopup: c,
1808
1808
  countrySearch: S,
1809
1809
  i18n: w
1810
1810
  } = this.options, b = p1._buildClassNames({
1811
1811
  iti: !0,
1812
1812
  "iti--allow-dropdown": e,
1813
- "iti--show-flags": s,
1814
- "iti--inline-dropdown": !f,
1815
- [r]: !!r
1813
+ "iti--show-flags": n,
1814
+ "iti--inline-dropdown": !c,
1815
+ [o]: !!o
1816
1816
  }), L = T("div", { class: b });
1817
- if ((p = this.telInput.parentNode) == null || p.insertBefore(L, this.telInput), e || s || i) {
1817
+ if ((f = this.telInput.parentNode) == null || f.insertBefore(L, this.telInput), e || n || i) {
1818
1818
  this.countryContainer = T(
1819
1819
  "div",
1820
1820
  { class: "iti__country-container" },
@@ -1825,7 +1825,7 @@ class p1 {
1825
1825
  type: "button",
1826
1826
  class: "iti__selected-country",
1827
1827
  "aria-expanded": "false",
1828
- "aria-label": this.options.i18n.selectedCountryAriaLabel,
1828
+ "aria-label": this.options.i18n.noCountrySelected,
1829
1829
  "aria-haspopup": "dialog",
1830
1830
  "aria-controls": `iti-${this.id}__dropdown-content`
1831
1831
  },
@@ -1835,28 +1835,32 @@ class p1 {
1835
1835
  { class: "iti__selected-country" },
1836
1836
  this.countryContainer
1837
1837
  );
1838
- const U = T("div", { class: "iti__selected-country-primary" }, this.selectedCountry);
1839
- if (this.selectedCountryInner = T("div", { class: "iti__flag" }, U), this.selectedCountryA11yText = T(
1840
- "span",
1841
- { class: "iti__a11y-text" },
1842
- this.selectedCountryInner
1838
+ const U = T(
1839
+ "div",
1840
+ { class: "iti__selected-country-primary" },
1841
+ this.selectedCountry
1842
+ );
1843
+ if (this.selectedCountryInner = T(
1844
+ "div",
1845
+ { class: "iti__flag" },
1846
+ U
1843
1847
  ), e && (this.dropdownArrow = T(
1844
1848
  "div",
1845
1849
  { class: "iti__arrow", "aria-hidden": "true" },
1846
1850
  U
1847
1851
  )), i && (this.selectedDialCode = T(
1848
1852
  "div",
1849
- { class: "iti__selected-dial-code", "aria-hidden": "true", dir: "ltr" },
1853
+ { class: "iti__selected-dial-code", dir: "ltr" },
1850
1854
  this.selectedCountry
1851
1855
  )), e) {
1852
- const D = C ? "" : "iti--flexible-dropdown-width";
1856
+ const D = g ? "" : "iti--flexible-dropdown-width";
1853
1857
  if (this.dropdownContent = T("div", {
1854
1858
  id: `iti-${this.id}__dropdown-content`,
1855
1859
  class: `iti__dropdown-content iti__hide ${D}`,
1856
1860
  role: "dialog",
1857
1861
  "aria-modal": "true"
1858
1862
  }), S) {
1859
- const P = T(
1863
+ const x = T(
1860
1864
  "div",
1861
1865
  { class: "iti__search-input-wrapper" },
1862
1866
  this.dropdownContent
@@ -1867,7 +1871,7 @@ class p1 {
1867
1871
  class: "iti__search-icon",
1868
1872
  "aria-hidden": "true"
1869
1873
  },
1870
- P
1874
+ x
1871
1875
  ), this.searchIcon.innerHTML = `
1872
1876
  <svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
1873
1877
  <circle cx="11" cy="11" r="7" />
@@ -1888,7 +1892,7 @@ class p1 {
1888
1892
  "aria-autocomplete": "list",
1889
1893
  autocomplete: "off"
1890
1894
  },
1891
- P
1895
+ x
1892
1896
  ), this.searchClearButton = T(
1893
1897
  "button",
1894
1898
  {
@@ -1897,7 +1901,7 @@ class p1 {
1897
1901
  "aria-label": w.clearSearchAriaLabel,
1898
1902
  tabindex: "-1"
1899
1903
  },
1900
- P
1904
+ x
1901
1905
  );
1902
1906
  const Y = `iti-${this.id}-clear-mask`;
1903
1907
  this.searchClearButton.innerHTML = `
@@ -1930,15 +1934,15 @@ class p1 {
1930
1934
  "aria-label": w.countryListAriaLabel
1931
1935
  },
1932
1936
  this.dropdownContent
1933
- ), this._appendListItems(), S && this._updateSearchResultsA11yText(), c) {
1934
- const P = p1._buildClassNames({
1937
+ ), this._appendListItems(), S && this._updateSearchResultsA11yText(), C) {
1938
+ const x = p1._buildClassNames({
1935
1939
  iti: !0,
1936
1940
  "iti--container": !0,
1937
- "iti--fullscreen-popup": f,
1938
- "iti--inline-dropdown": !f,
1939
- [r]: !!r
1941
+ "iti--fullscreen-popup": c,
1942
+ "iti--inline-dropdown": !c,
1943
+ [o]: !!o
1940
1944
  });
1941
- this.dropdown = T("div", { class: P }), this.dropdown.appendChild(this.dropdownContent);
1945
+ this.dropdown = T("div", { class: x }), this.dropdown.appendChild(this.dropdownContent);
1942
1946
  } else
1943
1947
  this.countryContainer.appendChild(this.dropdownContent);
1944
1948
  }
@@ -1946,15 +1950,15 @@ class p1 {
1946
1950
  if (L.appendChild(this.telInput), this._updateInputPadding(), l) {
1947
1951
  const U = this.telInput.getAttribute("name") || "", D = l(U);
1948
1952
  if (D.phone) {
1949
- const P = (I = this.telInput.form) == null ? void 0 : I.querySelector(`input[name="${D.phone}"]`);
1950
- P ? this.hiddenInput = P : (this.hiddenInput = T("input", {
1953
+ const x = (I = this.telInput.form) == null ? void 0 : I.querySelector(`input[name="${D.phone}"]`);
1954
+ x ? this.hiddenInput = x : (this.hiddenInput = T("input", {
1951
1955
  type: "hidden",
1952
1956
  name: D.phone
1953
1957
  }), L.appendChild(this.hiddenInput));
1954
1958
  }
1955
1959
  if (D.country) {
1956
- const P = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${D.country}"]`);
1957
- P ? this.hiddenInputCountry = P : (this.hiddenInputCountry = T("input", {
1960
+ const x = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${D.country}"]`);
1961
+ x ? this.hiddenInputCountry = x : (this.hiddenInputCountry = T("input", {
1958
1962
  type: "hidden",
1959
1963
  name: D.country
1960
1964
  }), L.appendChild(this.hiddenInputCountry));
@@ -1964,11 +1968,11 @@ class p1 {
1964
1968
  //* For each country: add a country list item <li> to the countryList <ul> container.
1965
1969
  _appendListItems() {
1966
1970
  for (let e = 0; e < this.countries.length; e++) {
1967
- const i = this.countries[e], s = e === 0 ? "iti__highlight" : "", r = T(
1971
+ const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o = T(
1968
1972
  "li",
1969
1973
  {
1970
1974
  id: `iti-${this.id}__item-${i.iso2}`,
1971
- class: `iti__country ${s}`,
1975
+ class: `iti__country ${n}`,
1972
1976
  tabindex: "-1",
1973
1977
  role: "option",
1974
1978
  "data-dial-code": i.dialCode,
@@ -1977,21 +1981,21 @@ class p1 {
1977
1981
  },
1978
1982
  this.countryList
1979
1983
  );
1980
- i.nodeById[this.id] = r;
1984
+ i.nodeById[this.id] = o;
1981
1985
  let l = "";
1982
- this.options.showFlags && (l += `<div class='iti__flag iti__${i.iso2}'></div>`), l += `<span class='iti__country-name'>${i.name}</span>`, l += `<span class='iti__dial-code' dir='ltr'>+${i.dialCode}</span>`, r.insertAdjacentHTML("beforeend", l);
1986
+ this.options.showFlags && (l += `<div class='iti__flag iti__${i.iso2}'></div>`), l += `<span class='iti__country-name'>${i.name}</span>`, l += `<span class='iti__dial-code' dir='ltr'>+${i.dialCode}</span>`, o.insertAdjacentHTML("beforeend", l);
1983
1987
  }
1984
1988
  }
1985
1989
  //* Set the initial state of the input value and the selected country by:
1986
1990
  //* 1. Extracting a dial code from the given number
1987
1991
  //* 2. Using explicit initialCountry
1988
1992
  _setInitialState(e = !1) {
1989
- const i = this.telInput.getAttribute("value"), s = this.telInput.value, l = i && i.charAt(0) === "+" && (!s || s.charAt(0) !== "+") ? i : s, c = this._getDialCode(l), C = a2(l), { initialCountry: f, geoIpLookup: S } = this.options, w = f === "auto" && S;
1990
- if (c && !C)
1993
+ const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n, C = this._getDialCode(l), g = u2(l), { initialCountry: c, geoIpLookup: S } = this.options, w = c === "auto" && S;
1994
+ if (C && !g)
1991
1995
  this._updateCountryFromNumber(l);
1992
1996
  else if (!w || e) {
1993
- const b = f ? f.toLowerCase() : "";
1994
- b && this._getCountryData(b, !0) ? this._setCountry(b) : c && C ? this._setCountry("us") : this._setCountry();
1997
+ const b = c ? c.toLowerCase() : "";
1998
+ b && this._getCountryData(b, !0) ? this._setCountry(b) : C && g ? this._setCountry("us") : this._setCountry();
1995
1999
  }
1996
2000
  l && this._updateValFromNumber(l);
1997
2001
  }
@@ -2026,12 +2030,12 @@ class p1 {
2026
2030
  }
2027
2031
  //* Init many requests: utils script / geo ip lookup.
2028
2032
  _initRequests() {
2029
- let { loadUtils: e, initialCountry: i, geoIpLookup: s } = this.options;
2033
+ let { loadUtils: e, initialCountry: i, geoIpLookup: n } = this.options;
2030
2034
  e && !m.utils ? (this._handlePageLoad = () => {
2031
2035
  var l;
2032
2036
  window.removeEventListener("load", this._handlePageLoad), (l = m.attachUtils(e)) == null || l.catch(() => {
2033
2037
  });
2034
- }, m.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && s && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
2038
+ }, m.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && n && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
2035
2039
  }
2036
2040
  //* Perform the geo ip lookup.
2037
2041
  _loadAutoCountry() {
@@ -2050,31 +2054,31 @@ class p1 {
2050
2054
  }
2051
2055
  //* Initialize the tel input listeners.
2052
2056
  _initTelInputListeners() {
2053
- const { strictMode: e, formatAsYouType: i, separateDialCode: s, formatOnDisplay: r, allowDropdown: l, countrySearch: c } = this.options;
2054
- let C = !1;
2055
- new RegExp("\\p{L}", "u").test(this.telInput.value) && (C = !0), this._handleInputEvent = (f) => {
2056
- if (this.isAndroid && (f == null ? void 0 : f.data) === "+" && s && l && c) {
2057
- const L = this.telInput.selectionStart || 0, p = this.telInput.value.substring(0, L - 1), I = this.telInput.value.substring(L);
2058
- this.telInput.value = p + I, this._openDropdownWithPlus();
2057
+ const { strictMode: e, formatAsYouType: i, separateDialCode: n, formatOnDisplay: o, allowDropdown: l, countrySearch: C } = this.options;
2058
+ let g = !1;
2059
+ new RegExp("\\p{L}", "u").test(this.telInput.value) && (g = !0), this._handleInputEvent = (c) => {
2060
+ if (this.isAndroid && (c == null ? void 0 : c.data) === "+" && n && l && C) {
2061
+ const L = this.telInput.selectionStart || 0, f = this.telInput.value.substring(0, L - 1), I = this.telInput.value.substring(L);
2062
+ this.telInput.value = f + I, this._openDropdownWithPlus();
2059
2063
  return;
2060
2064
  }
2061
2065
  this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
2062
- const S = (f == null ? void 0 : f.data) && /[^+0-9]/.test(f.data), w = (f == null ? void 0 : f.inputType) === "insertFromPaste" && this.telInput.value;
2063
- S || w && !e ? C = !0 : /[^+0-9]/.test(this.telInput.value) || (C = !1);
2064
- const b = (f == null ? void 0 : f.detail) && f.detail.isSetNumber && !r;
2065
- if (i && !C && !b) {
2066
- const L = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, G = (f == null ? void 0 : f.inputType) === "deleteContentForward", U = this._formatNumberAsYouType(), D = z2(I, U, L, G);
2066
+ const S = (c == null ? void 0 : c.data) && /[^+0-9]/.test(c.data), w = (c == null ? void 0 : c.inputType) === "insertFromPaste" && this.telInput.value;
2067
+ S || w && !e ? g = !0 : /[^+0-9]/.test(this.telInput.value) || (g = !1);
2068
+ const b = (c == null ? void 0 : c.detail) && c.detail.isSetNumber && !o;
2069
+ if (i && !g && !b) {
2070
+ const L = this.telInput.selectionStart || 0, I = this.telInput.value.substring(0, L).replace(/[^+0-9]/g, "").length, G = (c == null ? void 0 : c.inputType) === "deleteContentForward", U = this._formatNumberAsYouType(), D = z2(I, U, L, G);
2067
2071
  this.telInput.value = U, this.telInput.setSelectionRange(D, D);
2068
2072
  }
2069
- }, this.telInput.addEventListener("input", this._handleInputEvent), (e || s) && (this._handleKeydownEvent = (f) => {
2070
- if (f.key && f.key.length === 1 && !f.altKey && !f.ctrlKey && !f.metaKey) {
2071
- if (s && l && c && f.key === "+") {
2072
- f.preventDefault(), this._openDropdownWithPlus();
2073
+ }, this.telInput.addEventListener("input", this._handleInputEvent), (e || n) && (this._handleKeydownEvent = (c) => {
2074
+ if (c.key && c.key.length === 1 && !c.altKey && !c.ctrlKey && !c.metaKey) {
2075
+ if (n && l && C && c.key === "+") {
2076
+ c.preventDefault(), this._openDropdownWithPlus();
2073
2077
  return;
2074
2078
  }
2075
2079
  if (e) {
2076
- const S = this.telInput.value, b = !(S.charAt(0) === "+") && this.telInput.selectionStart === 0 && f.key === "+", L = /^[0-9]$/.test(f.key), p = s ? L : b || L, I = S.slice(0, this.telInput.selectionStart) + f.key + S.slice(this.telInput.selectionEnd), G = this._getFullNumber(I), U = m.utils.getCoreNumber(G, this.selectedCountryData.iso2), D = this.maxCoreNumberLength && U.length > this.maxCoreNumberLength, Y = this._getNewCountryFromNumber(G) !== null;
2077
- (!p || D && !Y && !b) && f.preventDefault();
2080
+ const S = this.telInput.value, b = !(S.charAt(0) === "+") && this.telInput.selectionStart === 0 && c.key === "+", L = /^[0-9]$/.test(c.key), f = n ? L : b || L, I = S.slice(0, this.telInput.selectionStart) + c.key + S.slice(this.telInput.selectionEnd), G = this._getFullNumber(I), U = m.utils.getCoreNumber(G, this.selectedCountryData.iso2), D = this.maxCoreNumberLength && U.length > this.maxCoreNumberLength, Y = this._getNewCountryFromNumber(G) !== null;
2081
+ (!f || D && !Y && !b) && c.preventDefault();
2078
2082
  }
2079
2083
  }
2080
2084
  }, this.telInput.addEventListener("keydown", this._handleKeydownEvent));
@@ -2086,19 +2090,19 @@ class p1 {
2086
2090
  }
2087
2091
  //* Trigger a custom event on the input.
2088
2092
  _trigger(e, i = {}) {
2089
- const s = new CustomEvent(e, {
2093
+ const n = new CustomEvent(e, {
2090
2094
  bubbles: !0,
2091
2095
  cancelable: !0,
2092
2096
  detail: i
2093
2097
  });
2094
- this.telInput.dispatchEvent(s);
2098
+ this.telInput.dispatchEvent(n);
2095
2099
  }
2096
2100
  //* Open the dropdown.
2097
2101
  _openDropdown() {
2098
2102
  const { fixDropdownWidth: e, countrySearch: i } = this.options;
2099
2103
  if (e && (this.dropdownContent.style.width = `${this.telInput.offsetWidth}px`), this.dropdownContent.classList.remove("iti__hide"), this.selectedCountry.setAttribute("aria-expanded", "true"), this._setDropdownPosition(), i) {
2100
- const s = this.countryList.firstElementChild;
2101
- s && (this._highlightListItem(s, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2104
+ const n = this.countryList.firstElementChild;
2105
+ n && (this._highlightListItem(n, !1), this.countryList.scrollTop = 0), this.searchInput.focus();
2102
2106
  }
2103
2107
  this._bindDropdownListeners(), this.dropdownArrow.classList.add("iti__arrow--up"), this._trigger("open:countrydropdown");
2104
2108
  }
@@ -2111,85 +2115,85 @@ class p1 {
2111
2115
  }
2112
2116
  //* We only bind dropdown listeners when the dropdown is open.
2113
2117
  _bindDropdownListeners() {
2114
- this._handleMouseoverCountryList = (r) => {
2115
- var c;
2116
- const l = (c = r.target) == null ? void 0 : c.closest(".iti__country");
2117
- l && this._highlightListItem(l, !1);
2118
+ this._handleMouseoverCountryList = (n) => {
2119
+ var l;
2120
+ const o = (l = n.target) == null ? void 0 : l.closest(".iti__country");
2121
+ o && this._highlightListItem(o, !1);
2118
2122
  }, this.countryList.addEventListener(
2119
2123
  "mouseover",
2120
2124
  this._handleMouseoverCountryList
2121
- ), this._handleClickCountryList = (r) => {
2122
- var c;
2123
- const l = (c = r.target) == null ? void 0 : c.closest(".iti__country");
2124
- l && this._selectListItem(l);
2125
- }, this.countryList.addEventListener("click", this._handleClickCountryList);
2126
- let e = !0;
2127
- this._handleClickOffToClose = () => {
2128
- e || this._closeDropdown(), e = !1;
2129
- }, document.documentElement.addEventListener(
2130
- "click",
2131
- this._handleClickOffToClose
2132
- );
2133
- let i = "", s = null;
2134
- if (this._handleKeydownOnDropdown = (r) => {
2135
- ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(r.key) && (r.preventDefault(), r.stopPropagation(), r.key === "ArrowUp" || r.key === "ArrowDown" ? this._handleUpDownKey(r.key) : r.key === "Enter" ? this._handleEnterKey() : r.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(r.key) && (r.stopPropagation(), s && clearTimeout(s), i += r.key.toLowerCase(), this._searchForCountry(i), s = setTimeout(() => {
2136
- i = "";
2125
+ ), this._handleClickCountryList = (n) => {
2126
+ var l;
2127
+ const o = (l = n.target) == null ? void 0 : l.closest(".iti__country");
2128
+ o && this._selectListItem(o);
2129
+ }, this.countryList.addEventListener("click", this._handleClickCountryList), this._handleClickOffToClose = (n) => {
2130
+ !!n.target.closest(`#iti-${this.id}__dropdown-content`) || this._closeDropdown();
2131
+ }, setTimeout(() => {
2132
+ document.documentElement.addEventListener(
2133
+ "click",
2134
+ this._handleClickOffToClose
2135
+ );
2136
+ }, 0);
2137
+ let e = "", i = null;
2138
+ if (this._handleKeydownOnDropdown = (n) => {
2139
+ ["ArrowUp", "ArrowDown", "Enter", "Escape"].includes(n.key) && (n.preventDefault(), n.stopPropagation(), n.key === "ArrowUp" || n.key === "ArrowDown" ? this._handleUpDownKey(n.key) : n.key === "Enter" ? this._handleEnterKey() : n.key === "Escape" && this._closeDropdown()), !this.options.countrySearch && /^[a-zA-ZÀ-ÿа-яА-Я ]$/.test(n.key) && (n.stopPropagation(), i && clearTimeout(i), e += n.key.toLowerCase(), this._searchForCountry(e), i = setTimeout(() => {
2140
+ e = "";
2137
2141
  }, 1e3));
2138
2142
  }, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
2139
- const r = () => {
2140
- const c = this.searchInput.value.trim();
2141
- c ? this._filterCountries(c) : this._filterCountries("", !0), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
2143
+ const n = () => {
2144
+ const l = this.searchInput.value.trim();
2145
+ l ? this._filterCountries(l) : this._filterCountries("", !0), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
2142
2146
  };
2143
- let l = null;
2147
+ let o = null;
2144
2148
  this._handleSearchChange = () => {
2145
- l && clearTimeout(l), l = setTimeout(() => {
2146
- r(), l = null;
2149
+ o && clearTimeout(o), o = setTimeout(() => {
2150
+ n(), o = null;
2147
2151
  }, 100);
2148
- }, this.searchInput.addEventListener("input", this._handleSearchChange), this._handleSearchClear = (c) => {
2149
- c.stopPropagation(), this.searchInput.value = "", this.searchInput.focus(), r();
2150
- }, this.searchClearButton.addEventListener("click", this._handleSearchClear), this.searchInput.addEventListener("click", (c) => c.stopPropagation());
2152
+ }, this.searchInput.addEventListener("input", this._handleSearchChange), this._handleSearchClear = () => {
2153
+ this.searchInput.value = "", this.searchInput.focus(), n();
2154
+ }, this.searchClearButton.addEventListener("click", this._handleSearchClear);
2151
2155
  }
2152
2156
  }
2153
2157
  //* Hidden search (countrySearch disabled): Find the first list item whose name starts with the query string.
2154
2158
  _searchForCountry(e) {
2155
2159
  for (const i of this.countries)
2156
2160
  if (i.name.substring(0, e.length).toLowerCase() === e) {
2157
- const r = i.nodeById[this.id];
2158
- this._highlightListItem(r, !1), this._scrollTo(r);
2161
+ const o = i.nodeById[this.id];
2162
+ this._highlightListItem(o, !1), this._scrollTo(o);
2159
2163
  break;
2160
2164
  }
2161
2165
  }
2162
2166
  //* Country search enabled: Filter the countries according to the search query.
2163
2167
  _filterCountries(e, i = !1) {
2164
- let s = !0;
2168
+ let n = !0;
2165
2169
  this.countryList.innerHTML = "";
2166
- const r = o2(e), l = r.length, c = [], C = [], f = [], S = [], w = [], b = [];
2167
- for (const p of this.countries)
2168
- i || l === 0 ? f.push(p) : p.iso2 === r ? c.push(p) : p.normalisedName.startsWith(r) ? C.push(p) : p.normalisedName.includes(r) ? f.push(p) : r === p.dialCode || r === p.dialCodePlus ? S.push(p) : p.dialCodePlus.includes(r) ? w.push(p) : p.initials.includes(r) && b.push(p);
2170
+ const o = o2(e), l = o.length, C = [], g = [], c = [], S = [], w = [], b = [];
2171
+ for (const f of this.countries)
2172
+ i || l === 0 ? c.push(f) : f.iso2 === o ? C.push(f) : f.normalisedName.startsWith(o) ? g.push(f) : f.normalisedName.includes(o) ? c.push(f) : o === f.dialCode || o === f.dialCodePlus ? S.push(f) : f.dialCodePlus.includes(o) ? w.push(f) : f.initials.includes(o) && b.push(f);
2169
2173
  const L = [
2170
- ...c.sort((p, I) => p.priority - I.priority),
2171
- ...C.sort((p, I) => p.priority - I.priority),
2172
- ...f.sort((p, I) => p.priority - I.priority),
2173
- ...S.sort((p, I) => p.priority - I.priority),
2174
- ...w.sort((p, I) => p.priority - I.priority),
2175
- ...b.sort((p, I) => p.priority - I.priority)
2174
+ ...C.sort((f, I) => f.priority - I.priority),
2175
+ ...g.sort((f, I) => f.priority - I.priority),
2176
+ ...c.sort((f, I) => f.priority - I.priority),
2177
+ ...S.sort((f, I) => f.priority - I.priority),
2178
+ ...w.sort((f, I) => f.priority - I.priority),
2179
+ ...b.sort((f, I) => f.priority - I.priority)
2176
2180
  ];
2177
- for (const p of L) {
2178
- const I = p.nodeById[this.id];
2179
- I && (this.countryList.appendChild(I), s && (this._highlightListItem(I, !1), s = !1));
2181
+ for (const f of L) {
2182
+ const I = f.nodeById[this.id];
2183
+ I && (this.countryList.appendChild(I), n && (this._highlightListItem(I, !1), n = !1));
2180
2184
  }
2181
- s ? (this._highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove("iti__hide")) : this.searchNoResults && this.searchNoResults.classList.add("iti__hide"), this.countryList.scrollTop = 0, this._updateSearchResultsA11yText();
2185
+ n ? (this._highlightListItem(null, !1), this.searchNoResults && this.searchNoResults.classList.remove("iti__hide")) : this.searchNoResults && this.searchNoResults.classList.add("iti__hide"), this.countryList.scrollTop = 0, this._updateSearchResultsA11yText();
2182
2186
  }
2183
2187
  //* Update search results text (for a11y).
2184
2188
  _updateSearchResultsA11yText() {
2185
2189
  const { i18n: e } = this.options, i = this.countryList.childElementCount;
2186
- let s;
2187
- "searchResultsText" in e ? s = e.searchResultsText(i) : i === 0 ? s = e.zeroSearchResults : i === 1 ? s = e.oneSearchResult : s = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = s;
2190
+ let n;
2191
+ "searchResultsText" in e ? n = e.searchResultsText(i) : i === 0 ? n = e.zeroSearchResults : i === 1 ? n = e.oneSearchResult : n = e.multipleSearchResults.replace("${count}", i.toString()), this.searchResultsA11yText.textContent = n;
2188
2192
  }
2189
2193
  //* Highlight the next/prev item in the list (and ensure it is visible).
2190
2194
  _handleUpDownKey(e) {
2191
- var s, r;
2192
- let i = e === "ArrowUp" ? (s = this.highlightedItem) == null ? void 0 : s.previousElementSibling : (r = this.highlightedItem) == null ? void 0 : r.nextElementSibling;
2195
+ var n, o;
2196
+ let i = e === "ArrowUp" ? (n = this.highlightedItem) == null ? void 0 : n.previousElementSibling : (o = this.highlightedItem) == null ? void 0 : o.nextElementSibling;
2193
2197
  !i && this.countryList.childElementCount > 1 && (i = e === "ArrowUp" ? this.countryList.lastElementChild : this.countryList.firstElementChild), i && (this._scrollTo(i), this._highlightListItem(i, !1));
2194
2198
  }
2195
2199
  //* Select the currently highlighted item.
@@ -2201,11 +2205,11 @@ class p1 {
2201
2205
  _updateValFromNumber(e) {
2202
2206
  let i = e;
2203
2207
  if (this.options.formatOnDisplay && m.utils && this.selectedCountryData) {
2204
- const s = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: r, INTERNATIONAL: l } = m.utils.numberFormat, c = s ? r : l;
2208
+ const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } = m.utils.numberFormat, C = n ? o : l;
2205
2209
  i = m.utils.formatNumber(
2206
2210
  i,
2207
2211
  this.selectedCountryData.iso2,
2208
- c
2212
+ C
2209
2213
  );
2210
2214
  }
2211
2215
  i = this._beforeSetNumber(i), this.telInput.value = i;
@@ -2217,54 +2221,54 @@ class p1 {
2217
2221
  return i !== null ? this._setCountry(i) : !1;
2218
2222
  }
2219
2223
  _ensureHasDialCode(e) {
2220
- const { dialCode: i, nationalPrefix: s } = this.selectedCountryData;
2224
+ const { dialCode: i, nationalPrefix: n } = this.selectedCountryData;
2221
2225
  if (e.charAt(0) === "+" || !i)
2222
2226
  return e;
2223
- const c = s && e.charAt(0) === s && !this.options.separateDialCode ? e.substring(1) : e;
2224
- return `+${i}${c}`;
2227
+ const C = n && e.charAt(0) === n && !this.options.separateDialCode ? e.substring(1) : e;
2228
+ return `+${i}${C}`;
2225
2229
  }
2226
2230
  // Get the country ISO2 code from the given number
2227
2231
  // BUT ONLY IF ITS CHANGED FROM THE CURRENTLY SELECTED COUNTRY
2228
2232
  // NOTE: consider refactoring this to be more clear
2229
2233
  _getNewCountryFromNumber(e) {
2230
2234
  const i = e.indexOf("+");
2231
- let s = i ? e.substring(i) : e;
2232
- const r = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
2233
- s = this._ensureHasDialCode(s);
2234
- const c = this._getDialCode(s, !0), C = f1(s);
2235
- if (c) {
2236
- const f = f1(c), S = this.dialCodeToIso2Map[f];
2237
- if (!r && this.defaultCountry && S.includes(this.defaultCountry))
2235
+ let n = i ? e.substring(i) : e;
2236
+ const o = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
2237
+ n = this._ensureHasDialCode(n);
2238
+ const C = this._getDialCode(n, !0), g = f1(n);
2239
+ if (C) {
2240
+ const c = f1(C), S = this.dialCodeToIso2Map[c];
2241
+ if (!o && this.defaultCountry && S.includes(this.defaultCountry))
2238
2242
  return this.defaultCountry;
2239
- const w = this.selectedCountryData.areaCodes && C.length > f.length, b = r && S.includes(r) && !w;
2240
- if (!(l === "1" && a2(C)) && !b) {
2241
- for (const p of S)
2242
- if (p)
2243
- return p;
2243
+ const w = this.selectedCountryData.areaCodes && g.length > c.length, b = o && S.includes(o) && !w;
2244
+ if (!(l === "1" && u2(g)) && !b) {
2245
+ for (const f of S)
2246
+ if (f)
2247
+ return f;
2244
2248
  }
2245
2249
  } else {
2246
- if (s.charAt(0) === "+" && C.length)
2250
+ if (n.charAt(0) === "+" && g.length)
2247
2251
  return "";
2248
- if ((!s || s === "+") && !this.selectedCountryData.iso2)
2252
+ if ((!n || n === "+") && !this.selectedCountryData.iso2)
2249
2253
  return this.defaultCountry;
2250
2254
  }
2251
2255
  return null;
2252
2256
  }
2253
2257
  //* Remove highlighting from other list items and highlight the given item.
2254
2258
  _highlightListItem(e, i) {
2255
- const s = this.highlightedItem;
2256
- if (s && (s.classList.remove("iti__highlight"), s.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true"), this.options.countrySearch)) {
2257
- const r = this.highlightedItem.getAttribute("id") || "";
2258
- this.searchInput.setAttribute("aria-activedescendant", r);
2259
+ const n = this.highlightedItem;
2260
+ if (n && (n.classList.remove("iti__highlight"), n.setAttribute("aria-selected", "false")), this.highlightedItem = e, this.highlightedItem && (this.highlightedItem.classList.add("iti__highlight"), this.highlightedItem.setAttribute("aria-selected", "true"), this.options.countrySearch)) {
2261
+ const o = this.highlightedItem.getAttribute("id") || "";
2262
+ this.searchInput.setAttribute("aria-activedescendant", o);
2259
2263
  }
2260
2264
  i && this.highlightedItem.focus();
2261
2265
  }
2262
2266
  //* Find the country data for the given iso2 code
2263
2267
  //* 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
2264
2268
  _getCountryData(e, i) {
2265
- const s = this.countryByIso2.get(e);
2266
- if (s)
2267
- return s;
2269
+ const n = this.countryByIso2.get(e);
2270
+ if (n)
2271
+ return n;
2268
2272
  if (i)
2269
2273
  return null;
2270
2274
  throw new Error(`No country data for '${e}'`);
@@ -2272,14 +2276,15 @@ class p1 {
2272
2276
  //* Update the selected country, dial code (if separateDialCode), placeholder, title, and active list item.
2273
2277
  //* Note: called from _setInitialState, _updateCountryFromNumber, _selectListItem, setCountry.
2274
2278
  _setCountry(e) {
2275
- const { separateDialCode: i, showFlags: s, i18n: r } = this.options, l = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
2276
- if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountryInner) {
2277
- let c = "", C = "";
2278
- e && s ? (c = `iti__flag iti__${e}`, C = `${this.selectedCountryData.name} +${this.selectedCountryData.dialCode}`) : (c = "iti__flag iti__globe", C = r.noCountrySelected), this.selectedCountryInner.className = c, this.selectedCountryA11yText.textContent = C;
2279
+ const { separateDialCode: i, showFlags: n, i18n: o } = this.options, l = this.selectedCountryData.iso2 ? this.selectedCountryData : {};
2280
+ if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountry) {
2281
+ const C = e && n ? `iti__flag iti__${e}` : "iti__flag iti__globe";
2282
+ let g, c;
2283
+ e ? (c = this.selectedCountryData.name, g = o.selectedCountryAriaLabel.replace("${country}", this.selectedCountryData.name)) : (c = o.noCountrySelected, g = o.noCountrySelected), this.selectedCountryInner.className = C, this.selectedCountry.setAttribute("title", c), this.selectedCountry.setAttribute("aria-label", g);
2279
2284
  }
2280
- if (this._setSelectedCountryTitleAttribute(e, i), i) {
2281
- const c = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
2282
- this.selectedDialCode.innerHTML = c, this._updateInputPadding();
2285
+ if (i) {
2286
+ const C = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
2287
+ this.selectedDialCode.innerHTML = C, this._updateInputPadding();
2283
2288
  }
2284
2289
  return this._updatePlaceholder(), this._updateMaxLength(), l.iso2 !== e;
2285
2290
  }
@@ -2292,29 +2297,23 @@ class p1 {
2292
2297
  }
2293
2298
  //* Update the maximum valid number length for the currently selected country.
2294
2299
  _updateMaxLength() {
2295
- const { strictMode: e, placeholderNumberType: i, validationNumberTypes: s } = this.options, { iso2: r } = this.selectedCountryData;
2300
+ const { strictMode: e, placeholderNumberType: i, validationNumberTypes: n } = this.options, { iso2: o } = this.selectedCountryData;
2296
2301
  if (e && m.utils)
2297
- if (r) {
2302
+ if (o) {
2298
2303
  const l = m.utils.numberType[i];
2299
- let c = m.utils.getExampleNumber(
2300
- r,
2304
+ let C = m.utils.getExampleNumber(
2305
+ o,
2301
2306
  !1,
2302
2307
  l,
2303
2308
  !0
2304
- ), C = c;
2305
- for (; m.utils.isPossibleNumber(c, r, s); )
2306
- C = c, c += "0";
2307
- const f = m.utils.getCoreNumber(C, r);
2308
- this.maxCoreNumberLength = f.length, r === "by" && (this.maxCoreNumberLength = f.length + 1);
2309
+ ), g = C;
2310
+ for (; m.utils.isPossibleNumber(C, o, n); )
2311
+ g = C, C += "0";
2312
+ const c = m.utils.getCoreNumber(g, o);
2313
+ this.maxCoreNumberLength = c.length, o === "by" && (this.maxCoreNumberLength = c.length + 1);
2309
2314
  } else
2310
2315
  this.maxCoreNumberLength = null;
2311
2316
  }
2312
- _setSelectedCountryTitleAttribute(e = null, i) {
2313
- if (!this.selectedCountry)
2314
- return;
2315
- let s;
2316
- e && !i ? s = `${this.selectedCountryData.name}: +${this.selectedCountryData.dialCode}` : e ? s = this.selectedCountryData.name : s = "Unknown", this.selectedCountry.setAttribute("title", s);
2317
- }
2318
2317
  //* When the input is in a hidden container during initialisation, we must inject some markup
2319
2318
  //* into the end of the DOM to calculate the correct offsetWidth.
2320
2319
  //* NOTE: this is only used when separateDialCode is enabled, so countryContainer and selectedCountry
@@ -2325,10 +2324,10 @@ class p1 {
2325
2324
  e.style.visibility = "hidden", document.body.appendChild(e);
2326
2325
  const i = this.countryContainer.cloneNode();
2327
2326
  e.appendChild(i);
2328
- const s = this.selectedCountry.cloneNode(!0);
2329
- i.appendChild(s);
2330
- const r = s.offsetWidth;
2331
- return document.body.removeChild(e), r;
2327
+ const n = this.selectedCountry.cloneNode(!0);
2328
+ i.appendChild(n);
2329
+ const o = n.offsetWidth;
2330
+ return document.body.removeChild(e), o;
2332
2331
  }
2333
2332
  return 0;
2334
2333
  }
@@ -2337,17 +2336,17 @@ class p1 {
2337
2336
  const {
2338
2337
  autoPlaceholder: e,
2339
2338
  placeholderNumberType: i,
2340
- nationalMode: s,
2341
- customPlaceholder: r
2339
+ nationalMode: n,
2340
+ customPlaceholder: o
2342
2341
  } = this.options, l = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
2343
2342
  if (m.utils && l) {
2344
- const c = m.utils.numberType[i];
2345
- let C = this.selectedCountryData.iso2 ? m.utils.getExampleNumber(
2343
+ const C = m.utils.numberType[i];
2344
+ let g = this.selectedCountryData.iso2 ? m.utils.getExampleNumber(
2346
2345
  this.selectedCountryData.iso2,
2347
- s,
2348
- c
2346
+ n,
2347
+ C
2349
2348
  ) : "";
2350
- C = this._beforeSetNumber(C), typeof r == "function" && (C = r(C, this.selectedCountryData)), this.telInput.setAttribute("placeholder", C);
2349
+ g = this._beforeSetNumber(g), typeof o == "function" && (g = o(g, this.selectedCountryData)), this.telInput.setAttribute("placeholder", g);
2351
2350
  }
2352
2351
  }
2353
2352
  //* Called when the user selects a list item from the dropdown.
@@ -2369,62 +2368,62 @@ class p1 {
2369
2368
  }
2370
2369
  //* Check if an element is visible within it's container, else scroll until it is.
2371
2370
  _scrollTo(e) {
2372
- const i = this.countryList, s = document.documentElement.scrollTop, r = i.offsetHeight, l = i.getBoundingClientRect().top + s, c = l + r, C = e.offsetHeight, f = e.getBoundingClientRect().top + s, S = f + C, w = f - l + i.scrollTop;
2373
- if (f < l)
2371
+ const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n, C = l + o, g = e.offsetHeight, c = e.getBoundingClientRect().top + n, S = c + g, w = c - l + i.scrollTop;
2372
+ if (c < l)
2374
2373
  i.scrollTop = w;
2375
- else if (S > c) {
2376
- const b = r - C;
2374
+ else if (S > C) {
2375
+ const b = o - g;
2377
2376
  i.scrollTop = w - b;
2378
2377
  }
2379
2378
  }
2380
2379
  //* Replace any existing dial code with the new one
2381
2380
  //* Note: called from _selectListItem and setCountry
2382
2381
  _updateDialCode(e) {
2383
- const i = this.telInput.value, s = `+${e}`;
2384
- let r;
2382
+ const i = this.telInput.value, n = `+${e}`;
2383
+ let o;
2385
2384
  if (i.charAt(0) === "+") {
2386
2385
  const l = this._getDialCode(i);
2387
- l ? r = i.replace(l, s) : r = s, this.telInput.value = r;
2386
+ l ? o = i.replace(l, n) : o = n, this.telInput.value = o;
2388
2387
  }
2389
2388
  }
2390
2389
  //* Try and extract a valid international dial code from a full telephone number.
2391
2390
  //* Note: returns the raw string inc plus character and any whitespace/dots etc.
2392
2391
  _getDialCode(e, i) {
2393
- let s = "";
2392
+ let n = "";
2394
2393
  if (e.charAt(0) === "+") {
2395
- let r = "";
2394
+ let o = "";
2396
2395
  for (let l = 0; l < e.length; l++) {
2397
- const c = e.charAt(l);
2398
- if (!isNaN(parseInt(c, 10))) {
2399
- if (r += c, i)
2400
- this.dialCodeToIso2Map[r] && (s = e.substring(0, l + 1));
2401
- else if (this.dialCodes.has(r)) {
2402
- s = e.substring(0, l + 1);
2396
+ const C = e.charAt(l);
2397
+ if (!isNaN(parseInt(C, 10))) {
2398
+ if (o += C, i)
2399
+ this.dialCodeToIso2Map[o] && (n = e.substring(0, l + 1));
2400
+ else if (this.dialCodes.has(o)) {
2401
+ n = e.substring(0, l + 1);
2403
2402
  break;
2404
2403
  }
2405
- if (r.length === this.dialCodeMaxLen)
2404
+ if (o.length === this.dialCodeMaxLen)
2406
2405
  break;
2407
2406
  }
2408
2407
  }
2409
2408
  }
2410
- return s;
2409
+ return n;
2411
2410
  }
2412
2411
  //* Get the input val, adding the dial code if separateDialCode is enabled.
2413
2412
  _getFullNumber(e) {
2414
- const i = e || this.telInput.value.trim(), { dialCode: s } = this.selectedCountryData;
2415
- let r;
2413
+ const i = e || this.telInput.value.trim(), { dialCode: n } = this.selectedCountryData;
2414
+ let o;
2416
2415
  const l = f1(i);
2417
- return this.options.separateDialCode && i.charAt(0) !== "+" && s && l ? r = `+${s}` : r = "", r + i;
2416
+ return this.options.separateDialCode && i.charAt(0) !== "+" && n && l ? o = `+${n}` : o = "", o + i;
2418
2417
  }
2419
2418
  //* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
2420
2419
  _beforeSetNumber(e) {
2421
2420
  let i = e;
2422
2421
  if (this.options.separateDialCode) {
2423
- let s = this._getDialCode(i);
2424
- if (s) {
2425
- s = `+${this.selectedCountryData.dialCode}`;
2426
- const r = i[s.length] === " " || i[s.length] === "-" ? s.length + 1 : s.length;
2427
- i = i.substring(r);
2422
+ let n = this._getDialCode(i);
2423
+ if (n) {
2424
+ n = `+${this.selectedCountryData.dialCode}`;
2425
+ const o = i[n.length] === " " || i[n.length] === "-" ? n.length + 1 : n.length;
2426
+ i = i.substring(o);
2428
2427
  }
2429
2428
  }
2430
2429
  return this._cap(i);
@@ -2435,8 +2434,8 @@ class p1 {
2435
2434
  }
2436
2435
  //* Format the number as the user types.
2437
2436
  _formatNumberAsYouType() {
2438
- const e = this._getFullNumber(), i = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: s } = this.selectedCountryData;
2439
- return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${s}`) ? (i.split(`+${s}`)[1] || "").trim() : i;
2437
+ const e = this._getFullNumber(), i = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: n } = this.selectedCountryData;
2438
+ return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${n}`) ? (i.split(`+${n}`)[1] || "").trim() : i;
2440
2439
  }
2441
2440
  //**************************
2442
2441
  //* SECRET PUBLIC METHODS
@@ -2454,7 +2453,7 @@ class p1 {
2454
2453
  //********************
2455
2454
  //* Remove plugin.
2456
2455
  destroy() {
2457
- var l, c;
2456
+ var l, C;
2458
2457
  this.telInput.iti = void 0;
2459
2458
  const { allowDropdown: e, separateDialCode: i } = this.options;
2460
2459
  if (e) {
@@ -2465,13 +2464,13 @@ class p1 {
2465
2464
  "keydown",
2466
2465
  this._handleCountryContainerKeydown
2467
2466
  );
2468
- const C = this.telInput.closest("label");
2469
- C && C.removeEventListener("click", this._handleLabelClick);
2467
+ const g = this.telInput.closest("label");
2468
+ g && g.removeEventListener("click", this._handleLabelClick);
2470
2469
  }
2471
- const { form: s } = this.telInput;
2472
- this._handleHiddenInputSubmit && s && s.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
2473
- const r = this.telInput.parentNode;
2474
- (l = r == null ? void 0 : r.parentNode) == null || l.insertBefore(this.telInput, r), (c = r == null ? void 0 : r.parentNode) == null || c.removeChild(r), delete m.instances[this.id];
2470
+ const { form: n } = this.telInput;
2471
+ this._handleHiddenInputSubmit && n && n.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
2472
+ const o = this.telInput.parentNode;
2473
+ (l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (C = o == null ? void 0 : o.parentNode) == null || C.removeChild(o), delete m.instances[this.id];
2475
2474
  }
2476
2475
  //* Get the extension from the current number.
2477
2476
  getExtension() {
@@ -2526,20 +2525,20 @@ class p1 {
2526
2525
  _validateNumber(e) {
2527
2526
  if (!this.selectedCountryData.iso2)
2528
2527
  return !1;
2529
- const i = this._getFullNumber(), s = i.search(new RegExp("\\p{L}", "u")), r = (l) => e ? this._utilsIsValidNumber(l) : this._utilsIsPossibleNumber(l);
2530
- if (s > -1) {
2531
- const l = i.substring(0, s), c = r(l), C = r(i);
2532
- return c && C;
2528
+ const i = this._getFullNumber(), n = i.search(new RegExp("\\p{L}", "u")), o = (l) => e ? this._utilsIsValidNumber(l) : this._utilsIsPossibleNumber(l);
2529
+ if (n > -1) {
2530
+ const l = i.substring(0, n), C = o(l), g = o(i);
2531
+ return C && g;
2533
2532
  }
2534
- return r(i);
2533
+ return o(i);
2535
2534
  }
2536
2535
  _utilsIsValidNumber(e) {
2537
2536
  return m.utils ? m.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
2538
2537
  }
2539
2538
  //* Update the selected country, and update the input val accordingly.
2540
2539
  setCountry(e) {
2541
- const i = e == null ? void 0 : e.toLowerCase(), s = this.selectedCountryData.iso2;
2542
- (e && i !== s || !e && s) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
2540
+ const i = e == null ? void 0 : e.toLowerCase(), n = this.selectedCountryData.iso2;
2541
+ (e && i !== n || !e && n) && (this._setCountry(i), this._updateDialCode(this.selectedCountryData.dialCode), this._triggerCountryChange());
2543
2542
  }
2544
2543
  //* Set the input value and update the country.
2545
2544
  setNumber(e) {
@@ -2566,10 +2565,10 @@ const Z2 = (y) => {
2566
2565
  else
2567
2566
  return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof y}`));
2568
2567
  return m.startedLoadingUtilsScript = !0, e.then((i) => {
2569
- const s = i == null ? void 0 : i.default;
2570
- if (!s || typeof s != "object")
2568
+ const n = i == null ? void 0 : i.default;
2569
+ if (!n || typeof n != "object")
2571
2570
  throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
2572
- return m.utils = s, i1("handleUtils"), !0;
2571
+ return m.utils = n, i1("handleUtils"), !0;
2573
2572
  }).catch((i) => {
2574
2573
  throw i1("rejectUtilsScriptPromise", i), i;
2575
2574
  });
@@ -2596,7 +2595,7 @@ const Z2 = (y) => {
2596
2595
  attachUtils: Z2,
2597
2596
  startedLoadingUtilsScript: !1,
2598
2597
  startedLoadingAutoCountry: !1,
2599
- version: "25.8.1"
2598
+ version: "25.8.3"
2600
2599
  }
2601
2600
  );
2602
2601
  (function() {
@@ -2605,23 +2604,23 @@ const Z2 = (y) => {
2605
2604
  d = d.split(".");
2606
2605
  var $ = y;
2607
2606
  d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
2608
- for (var n; d.length && (n = d.shift()); ) d.length || t === void 0 ? $[n] && $[n] !== Object.prototype[n] ? $ = $[n] : $ = $[n] = {} : $[n] = t;
2607
+ for (var s; d.length && (s = d.shift()); ) d.length || t === void 0 ? $[s] && $[s] !== Object.prototype[s] ? $ = $[s] : $ = $[s] = {} : $[s] = t;
2609
2608
  }
2610
2609
  function i(d, t) {
2611
2610
  function $() {
2612
2611
  }
2613
- $.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(n, o, a) {
2614
- for (var u = Array(arguments.length - 2), h = 2; h < arguments.length; h++) u[h - 2] = arguments[h];
2615
- return t.prototype[o].apply(n, u);
2612
+ $.prototype = t.prototype, d.ma = t.prototype, d.prototype = new $(), d.prototype.constructor = d, d.sa = function(s, r, u) {
2613
+ for (var a = Array(arguments.length - 2), h = 2; h < arguments.length; h++) a[h - 2] = arguments[h];
2614
+ return t.prototype[r].apply(s, a);
2616
2615
  };
2617
2616
  }
2618
- function s(d) {
2617
+ function n(d) {
2619
2618
  const t = [];
2620
2619
  let $ = 0;
2621
- for (const n in d) t[$++] = d[n];
2620
+ for (const s in d) t[$++] = d[s];
2622
2621
  return t;
2623
2622
  }
2624
- var r = class {
2623
+ var o = class {
2625
2624
  constructor(d) {
2626
2625
  if (l !== l) throw Error("SafeUrl is not meant to be built directly");
2627
2626
  this.g = d;
@@ -2630,21 +2629,21 @@ const Z2 = (y) => {
2630
2629
  return this.g.toString();
2631
2630
  }
2632
2631
  }, l = {};
2633
- new r("about:invalid#zClosurez"), new r("about:blank");
2634
- const c = {};
2635
- class C {
2632
+ new o("about:invalid#zClosurez"), new o("about:blank");
2633
+ const C = {};
2634
+ class g {
2636
2635
  constructor() {
2637
- if (c !== c) throw Error("SafeStyle is not meant to be built directly");
2636
+ if (C !== C) throw Error("SafeStyle is not meant to be built directly");
2638
2637
  }
2639
2638
  toString() {
2640
2639
  return "";
2641
2640
  }
2642
2641
  }
2643
- new C();
2644
- const f = {};
2642
+ new g();
2643
+ const c = {};
2645
2644
  class S {
2646
2645
  constructor() {
2647
- if (f !== f) throw Error("SafeStyleSheet is not meant to be built directly");
2646
+ if (c !== c) throw Error("SafeStyleSheet is not meant to be built directly");
2648
2647
  }
2649
2648
  toString() {
2650
2649
  return "";
@@ -2668,15 +2667,15 @@ const Z2 = (y) => {
2668
2667
  case G:
2669
2668
  case U:
2670
2669
  case D:
2671
- case P:
2670
+ case x:
2672
2671
  case Y:
2673
2672
  case I:
2674
- case p:
2673
+ case f:
2675
2674
  this.o = !0;
2676
2675
  }
2677
2676
  this.j = t.defaultValue;
2678
2677
  }
2679
- var p = 1, I = 2, G = 3, U = 4, D = 6, P = 16, Y = 18;
2678
+ var f = 1, I = 2, G = 3, U = 4, D = 6, x = 16, Y = 18;
2680
2679
  function c2(d, t) {
2681
2680
  for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
2682
2681
  var $ = t[d];
@@ -2684,7 +2683,7 @@ const Z2 = (y) => {
2684
2683
  }
2685
2684
  }
2686
2685
  function f2(d) {
2687
- return d = s(d.g), d.sort(function(t, $) {
2686
+ return d = n(d.g), d.sort(function(t, $) {
2688
2687
  return t.g - $.g;
2689
2688
  }), d;
2690
2689
  }
@@ -2694,22 +2693,22 @@ const Z2 = (y) => {
2694
2693
  R.prototype.has = function(d) {
2695
2694
  return B(this, d.g);
2696
2695
  }, R.prototype.get = function(d, t) {
2697
- return g(this, d.g, t);
2696
+ return p(this, d.g, t);
2698
2697
  }, R.prototype.set = function(d, t) {
2699
2698
  E(this, d.g, t);
2700
2699
  }, R.prototype.add = function(d, t) {
2701
2700
  b1(this, d.g, t);
2702
2701
  };
2703
2702
  function w1(d, t) {
2704
- for (var $ = f2(d.m()), n = 0; n < $.length; n++) {
2705
- var o = $[n], a = o.g;
2706
- if (B(t, a)) {
2707
- d.g && delete d.g[o.g];
2708
- var u = o.h == 11 || o.h == 10;
2709
- if (o.l) {
2710
- o = x(t, a);
2711
- for (var h = 0; h < o.length; h++) b1(d, a, u ? o[h].clone() : o[h]);
2712
- } else o = n1(t, a), u ? (u = n1(d, a)) ? w1(u, o) : E(d, a, o.clone()) : E(d, a, o);
2703
+ for (var $ = f2(d.m()), s = 0; s < $.length; s++) {
2704
+ var r = $[s], u = r.g;
2705
+ if (B(t, u)) {
2706
+ d.g && delete d.g[r.g];
2707
+ var a = r.h == 11 || r.h == 10;
2708
+ if (r.l) {
2709
+ r = P(t, u);
2710
+ for (var h = 0; h < r.length; h++) b1(d, u, a ? r[h].clone() : r[h]);
2711
+ } else r = n1(t, u), a ? (a = n1(d, u)) ? w1(a, r) : E(d, u, r.clone()) : E(d, u, r);
2713
2712
  }
2714
2713
  }
2715
2714
  }
@@ -2725,23 +2724,23 @@ const Z2 = (y) => {
2725
2724
  if ($ == null) return null;
2726
2725
  if (d.l) {
2727
2726
  if (!(t in d.g)) {
2728
- var n = d.l, o = d.j[t];
2729
- if ($ != null) if (o.l) {
2730
- for (var a = [], u = 0; u < $.length; u++) a[u] = n.h(o, $[u]);
2731
- $ = a;
2732
- } else $ = n.h(o, $);
2727
+ var s = d.l, r = d.j[t];
2728
+ if ($ != null) if (r.l) {
2729
+ for (var u = [], a = 0; a < $.length; a++) u[a] = s.h(r, $[a]);
2730
+ $ = u;
2731
+ } else $ = s.h(r, $);
2733
2732
  return d.g[t] = $;
2734
2733
  }
2735
2734
  return d.g[t];
2736
2735
  }
2737
2736
  return $;
2738
2737
  }
2739
- function g(d, t, $) {
2740
- var n = n1(d, t);
2741
- return d.j[t].l ? n[$ || 0] : n;
2738
+ function p(d, t, $) {
2739
+ var s = n1(d, t);
2740
+ return d.j[t].l ? s[$ || 0] : s;
2742
2741
  }
2743
2742
  function v(d, t) {
2744
- if (B(d, t)) d = g(d, t);
2743
+ if (B(d, t)) d = p(d, t);
2745
2744
  else d: {
2746
2745
  if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
2747
2746
  else if (t === Number) d.j = 0;
@@ -2754,7 +2753,7 @@ const Z2 = (y) => {
2754
2753
  }
2755
2754
  return d;
2756
2755
  }
2757
- function x(d, t) {
2756
+ function P(d, t) {
2758
2757
  return n1(d, t) || [];
2759
2758
  }
2760
2759
  function K(d, t) {
@@ -2767,8 +2766,8 @@ const Z2 = (y) => {
2767
2766
  d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
2768
2767
  }
2769
2768
  function s1(d, t) {
2770
- var $ = [], n;
2771
- for (n in t) n != 0 && $.push(new L(n, t[n]));
2769
+ var $ = [], s;
2770
+ for (s in t) s != 0 && $.push(new L(s, t[s]));
2772
2771
  return new c2(d, $);
2773
2772
  }
2774
2773
  function r1() {
@@ -2803,7 +2802,7 @@ const Z2 = (y) => {
2803
2802
  A.prototype.h = "", A.prototype.set = function(d) {
2804
2803
  this.h = "" + d;
2805
2804
  }, A.prototype.g = function(d, t, $) {
2806
- if (this.h += String(d), t != null) for (let n = 1; n < arguments.length; n++) this.h += arguments[n];
2805
+ if (this.h += String(d), t != null) for (let s = 1; s < arguments.length; s++) this.h += arguments[s];
2807
2806
  return this;
2808
2807
  };
2809
2808
  function k(d) {
@@ -8298,10 +8297,10 @@ const Z2 = (y) => {
8298
8297
  function J(d) {
8299
8298
  return "([0-90-9٠-٩۰-۹]{1," + d + "})";
8300
8299
  }
8301
- function x1() {
8300
+ function P1() {
8302
8301
  return ";ext=" + J("20") + "|[  \\t,]*(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)[:\\..]?[  \\t,-]*" + (J("20") + "#?|[  \\t,]*(?:[xx##~~]|int|int)[:\\..]?[  \\t,-]*") + (J("9") + "#?|[- ]+") + (J("6") + "#|[  \\t]*(?:,{2}|;)[:\\..]?[  \\t,-]*") + (J("15") + "#?|[  \\t]*(?:,)+[:\\..]?[  \\t,-]*") + (J("9") + "#?");
8303
8302
  }
8304
- var P1 = new RegExp("(?:" + x1() + ")$", "i"), b2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + x1() + ")?$", "i"), L2 = /(\$\d)/, N2 = /^\(?\$1\)?$/;
8303
+ var x1 = new RegExp("(?:" + P1() + ")$", "i"), b2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + P1() + ")?$", "i"), L2 = /(\$\d)/, N2 = /^\(?\$1\)?$/;
8305
8304
  function R1(d) {
8306
8305
  return 2 > d.length ? !1 : F(b2, d);
8307
8306
  }
@@ -8313,91 +8312,91 @@ const Z2 = (y) => {
8313
8312
  k(d), d.g(t);
8314
8313
  }
8315
8314
  function O1(d) {
8316
- return d != null && (K(d, 9) != 1 || x(d, 9)[0] != -1);
8315
+ return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
8317
8316
  }
8318
8317
  function o1(d, t) {
8319
- for (var $ = new A(), n, o = d.length, a = 0; a < o; ++a) n = d.charAt(a), n = t[n.toUpperCase()], n != null && $.g(n);
8318
+ for (var $ = new A(), s, r = d.length, u = 0; u < r; ++u) s = d.charAt(u), s = t[s.toUpperCase()], s != null && $.g(s);
8320
8319
  return $.toString();
8321
8320
  }
8322
8321
  function G1(d) {
8323
8322
  return d.length == 0 || N2.test(d);
8324
8323
  }
8325
- function a1(d) {
8324
+ function u1(d) {
8326
8325
  return d != null && isNaN(d) && d.toUpperCase() in M1;
8327
8326
  }
8328
8327
  M.prototype.format = function(d, t) {
8329
- if (g(d, 2) == 0 && B(d, 5)) {
8328
+ if (p(d, 2) == 0 && B(d, 5)) {
8330
8329
  var $ = v(d, 5);
8331
8330
  if (0 < $.length) return $;
8332
8331
  }
8333
8332
  $ = v(d, 1);
8334
- var n = e1(d);
8335
- if (t == 0) return U1($, 0, n, "");
8336
- if (!($ in Q)) return n;
8337
- var o = t1(this, $, $1($));
8338
- d = B(d, 3) && g(d, 3).length != 0 ? t == 3 ? ";ext=" + g(d, 3) : B(o, 13) ? g(o, 13) + v(d, 3) : " ext. " + v(d, 3) : "";
8333
+ var s = e1(d);
8334
+ if (t == 0) return U1($, 0, s, "");
8335
+ if (!($ in Q)) return s;
8336
+ var r = t1(this, $, $1($));
8337
+ d = B(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : B(r, 13) ? p(r, 13) + v(d, 3) : " ext. " + v(d, 3) : "";
8339
8338
  d: {
8340
- o = x(o, 20).length == 0 || t == 2 ? x(o, 19) : x(o, 20);
8341
- for (var a, u = o.length, h = 0; h < u; ++h) {
8342
- a = o[h];
8343
- var _ = K(a, 3);
8344
- if ((_ == 0 || n.search(g(a, 3, _ - 1)) == 0) && (_ = new RegExp(g(a, 1)), F(_, n))) {
8345
- o = a;
8339
+ r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
8340
+ for (var u, a = r.length, h = 0; h < a; ++h) {
8341
+ u = r[h];
8342
+ var _ = K(u, 3);
8343
+ if ((_ == 0 || s.search(p(u, 3, _ - 1)) == 0) && (_ = new RegExp(p(u, 1)), F(_, s))) {
8344
+ r = u;
8346
8345
  break d;
8347
8346
  }
8348
8347
  }
8349
- o = null;
8348
+ r = null;
8350
8349
  }
8351
- return o != null && (u = o, o = v(u, 2), a = new RegExp(g(u, 1)), v(
8352
- u,
8350
+ return r != null && (a = r, r = v(a, 2), u = new RegExp(p(a, 1)), v(
8351
+ a,
8353
8352
  5
8354
- ), u = v(u, 4), n = t == 2 && u != null && 0 < u.length ? n.replace(a, o.replace(L2, u)) : n.replace(a, o), t == 3 && (n = n.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), n = n.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), U1($, t, n, d);
8353
+ ), a = v(a, 4), s = t == 2 && a != null && 0 < a.length ? s.replace(u, r.replace(L2, a)) : s.replace(u, r), t == 3 && (s = s.replace(RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+"), ""), s = s.replace(RegExp("[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), U1($, t, s, d);
8355
8354
  };
8356
8355
  function t1(d, t, $) {
8357
8356
  return $ == "001" ? j(d, "" + t) : j(d, $);
8358
8357
  }
8359
8358
  function e1(d) {
8360
8359
  if (!B(d, 2)) return "";
8361
- var t = "" + g(d, 2);
8362
- return B(d, 4) && g(d, 4) && 0 < v(d, 8) ? Array(v(d, 8) + 1).join("0") + t : t;
8360
+ var t = "" + p(d, 2);
8361
+ return B(d, 4) && p(d, 4) && 0 < v(d, 8) ? Array(v(d, 8) + 1).join("0") + t : t;
8363
8362
  }
8364
- function U1(d, t, $, n) {
8363
+ function U1(d, t, $, s) {
8365
8364
  switch (t) {
8366
8365
  case 0:
8367
- return "+" + d + $ + n;
8366
+ return "+" + d + $ + s;
8368
8367
  case 1:
8369
- return "+" + d + " " + $ + n;
8368
+ return "+" + d + " " + $ + s;
8370
8369
  case 3:
8371
- return "tel:+" + d + "-" + $ + n;
8370
+ return "tel:+" + d + "-" + $ + s;
8372
8371
  default:
8373
- return $ + n;
8372
+ return $ + s;
8374
8373
  }
8375
8374
  }
8376
- function u1(d, t) {
8375
+ function a1(d, t) {
8377
8376
  switch (t) {
8378
8377
  case 4:
8379
- return g(d, 5);
8378
+ return p(d, 5);
8380
8379
  case 3:
8381
- return g(d, 4);
8380
+ return p(d, 4);
8382
8381
  case 1:
8383
- return g(d, 3);
8382
+ return p(d, 3);
8384
8383
  case 0:
8385
8384
  case 2:
8386
- return g(d, 2);
8385
+ return p(d, 2);
8387
8386
  case 5:
8388
- return g(d, 6);
8387
+ return p(d, 6);
8389
8388
  case 6:
8390
- return g(d, 8);
8389
+ return p(d, 8);
8391
8390
  case 7:
8392
- return g(d, 7);
8391
+ return p(d, 7);
8393
8392
  case 8:
8394
- return g(d, 21);
8393
+ return p(d, 21);
8395
8394
  case 9:
8396
- return g(d, 25);
8395
+ return p(d, 25);
8397
8396
  case 10:
8398
- return g(d, 28);
8397
+ return p(d, 28);
8399
8398
  default:
8400
- return g(d, 1);
8399
+ return p(d, 1);
8401
8400
  }
8402
8401
  }
8403
8402
  function F1(d, t) {
@@ -8405,7 +8404,7 @@ const Z2 = (y) => {
8405
8404
  return d = t1(d, v(t, 1), $), d == null ? -1 : (t = e1(t), m1(t, d));
8406
8405
  }
8407
8406
  function m1(d, t) {
8408
- return O(d, g(t, 1)) ? O(d, g(t, 5)) ? 4 : O(d, g(t, 4)) ? 3 : O(d, g(t, 6)) ? 5 : O(d, g(t, 8)) ? 6 : O(d, g(t, 7)) ? 7 : O(d, g(t, 21)) ? 8 : O(d, g(t, 25)) ? 9 : O(d, g(t, 28)) ? 10 : O(d, g(t, 2)) ? g(t, 18) || O(d, g(t, 3)) ? 2 : 0 : !g(t, 18) && O(d, g(t, 3)) ? 1 : -1 : -1;
8407
+ return O(d, p(t, 1)) ? O(d, p(t, 5)) ? 4 : O(d, p(t, 4)) ? 3 : O(d, p(t, 6)) ? 5 : O(d, p(t, 8)) ? 6 : O(d, p(t, 7)) ? 7 : O(d, p(t, 21)) ? 8 : O(d, p(t, 25)) ? 9 : O(d, p(t, 28)) ? 10 : O(d, p(t, 2)) ? p(t, 18) || O(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && O(d, p(t, 3)) ? 1 : -1 : -1;
8409
8408
  }
8410
8409
  function j(d, t) {
8411
8410
  if (t == null) return null;
@@ -8419,11 +8418,11 @@ const Z2 = (y) => {
8419
8418
  }
8420
8419
  function O(d, t) {
8421
8420
  var $ = d.length;
8422
- return 0 < K(t, 9) && x(t, 9).indexOf($) == -1 ? !1 : F(v(t, 2), d);
8421
+ return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : F(v(t, 2), d);
8423
8422
  }
8424
8423
  function T2(d, t) {
8425
- var $ = V1(d, t), n = v(t, 1), o = t1(d, n, $);
8426
- return o == null || $ != "001" && n != K1(d, $) ? o = !1 : (d = e1(t), o = m1(d, o) != -1), o;
8424
+ var $ = V1(d, t), s = v(t, 1), r = t1(d, s, $);
8425
+ return r == null || $ != "001" && s != K1(d, $) ? r = !1 : (d = e1(t), r = m1(d, r) != -1), r;
8427
8426
  }
8428
8427
  function V1(d, t) {
8429
8428
  if (t == null) return null;
@@ -8432,16 +8431,16 @@ const Z2 = (y) => {
8432
8431
  else if ($.length == 1) d = $[0];
8433
8432
  else d: {
8434
8433
  t = e1(t);
8435
- for (var n, o = $.length, a = 0; a < o; a++) {
8436
- n = $[a];
8437
- var u = j(d, n);
8438
- if (B(u, 23)) {
8439
- if (t.search(g(u, 23)) == 0) {
8440
- d = n;
8434
+ for (var s, r = $.length, u = 0; u < r; u++) {
8435
+ s = $[u];
8436
+ var a = j(d, s);
8437
+ if (B(a, 23)) {
8438
+ if (t.search(p(a, 23)) == 0) {
8439
+ d = s;
8441
8440
  break d;
8442
8441
  }
8443
- } else if (m1(t, u) != -1) {
8444
- d = n;
8442
+ } else if (m1(t, a) != -1) {
8443
+ d = s;
8445
8444
  break d;
8446
8445
  }
8447
8446
  }
@@ -8456,102 +8455,102 @@ const Z2 = (y) => {
8456
8455
  if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
8457
8456
  return v(d, 10);
8458
8457
  }
8459
- function l1(d, t, $, n) {
8460
- var o = u1($, n), a = K(o, 9) == 0 ? x(g($, 1), 9) : x(o, 9);
8461
- if (o = x(o, 10), n == 2) if (O1(u1($, 0))) d = u1($, 1), O1(d) && (a = a.concat(K(d, 9) == 0 ? x(g($, 1), 9) : x(d, 9)), a.sort(), o.length == 0 ? o = x(d, 10) : (o = o.concat(x(d, 10)), o.sort()));
8458
+ function l1(d, t, $, s) {
8459
+ var r = a1($, s), u = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
8460
+ if (r = P(r, 10), s == 2) if (O1(a1($, 0))) d = a1($, 1), O1(d) && (u = u.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), u.sort(), r.length == 0 ? r = P(d, 10) : (r = r.concat(P(d, 10)), r.sort()));
8462
8461
  else return l1(d, t, $, 1);
8463
- return a[0] == -1 ? 5 : (t = t.length, -1 < o.indexOf(t) ? 4 : ($ = a[0], $ == t ? 0 : $ > t ? 2 : a[a.length - 1] < t ? 3 : -1 < a.indexOf(t, 1) ? 0 : 5));
8462
+ return u[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = u[0], $ == t ? 0 : $ > t ? 2 : u[u.length - 1] < t ? 3 : -1 < u.indexOf(t, 1) ? 0 : 5));
8464
8463
  }
8465
8464
  function h1(d, t, $) {
8466
- var n = e1(t);
8467
- return t = v(t, 1), t in Q ? (t = t1(d, t, $1(t)), l1(d, n, t, $)) : 1;
8465
+ var s = e1(t);
8466
+ return t = v(t, 1), t in Q ? (t = t1(d, t, $1(t)), l1(d, s, t, $)) : 1;
8468
8467
  }
8469
8468
  function H1(d, t) {
8470
8469
  if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
8471
- for (var $, n = d.length, o = 1; 3 >= o && o <= n; ++o) if ($ = parseInt(d.substring(0, o), 10), $ in Q) return t.g(d.substring(o)), $;
8470
+ for (var $, s = d.length, r = 1; 3 >= r && r <= s; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in Q) return t.g(d.substring(r)), $;
8472
8471
  return 0;
8473
8472
  }
8474
- function j1(d, t, $, n, o, a) {
8473
+ function j1(d, t, $, s, r, u) {
8475
8474
  if (t.length == 0) return 0;
8476
8475
  t = new A(t);
8477
- var u;
8478
- $ != null && (u = g($, 11)), u == null && (u = "NonMatch");
8476
+ var a;
8477
+ $ != null && (a = p($, 11)), a == null && (a = "NonMatch");
8479
8478
  var h = t.toString();
8480
- if (h.length == 0) u = 20;
8481
- else if (d1.test(h)) h = h.replace(d1, ""), k(t), t.g(B1(h)), u = 1;
8479
+ if (h.length == 0) a = 20;
8480
+ else if (d1.test(h)) h = h.replace(d1, ""), k(t), t.g(B1(h)), a = 1;
8482
8481
  else {
8483
- if (h = new RegExp(u), k1(t), u = t.toString(), u.search(h) == 0) {
8484
- h = u.match(h)[0].length;
8485
- var _ = u.substring(h).match(D1);
8486
- _ && _[1] != null && 0 < _[1].length && o1(_[1], C1) == "0" ? u = !1 : (k(t), t.g(u.substring(h)), u = !0);
8487
- } else u = !1;
8488
- u = u ? 5 : 20;
8482
+ if (h = new RegExp(a), k1(t), a = t.toString(), a.search(h) == 0) {
8483
+ h = a.match(h)[0].length;
8484
+ var _ = a.substring(h).match(D1);
8485
+ _ && _[1] != null && 0 < _[1].length && o1(_[1], C1) == "0" ? a = !1 : (k(t), t.g(a.substring(h)), a = !0);
8486
+ } else a = !1;
8487
+ a = a ? 5 : 20;
8489
8488
  }
8490
- if (o && E(a, 6, u), u != 20) {
8489
+ if (r && E(u, 6, a), a != 20) {
8491
8490
  if (2 >= t.h.length) throw Error("Phone number too short after IDD");
8492
- if (d = H1(t, n), d != 0) return E(a, 1, d), d;
8491
+ if (d = H1(t, s), d != 0) return E(u, 1, d), d;
8493
8492
  throw Error("Invalid country calling code");
8494
8493
  }
8495
- return $ != null && (u = v($, 10), h = "" + u, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new A(_.substring(h.length)), _ = g($, 1), _ = new RegExp(v(_, 2)), W1(h, $, null), h = h.toString(), !F(_, t.toString()) && F(_, h) || l1(d, t.toString(), $, -1) == 3)) ? (n.g(h), o && E(a, 6, 10), E(a, 1, u), u) : (E(a, 1, 0), 0);
8494
+ return $ != null && (a = v($, 10), h = "" + a, _ = t.toString(), _.lastIndexOf(h, 0) == 0 && (h = new A(_.substring(h.length)), _ = p($, 1), _ = new RegExp(v(_, 2)), W1(h, $, null), h = h.toString(), !F(_, t.toString()) && F(_, h) || l1(d, t.toString(), $, -1) == 3)) ? (s.g(h), r && E(u, 6, 10), E(u, 1, a), a) : (E(u, 1, 0), 0);
8496
8495
  }
8497
8496
  function W1(d, t, $) {
8498
- var n = d.toString(), o = n.length, a = g(t, 15);
8499
- if (o != 0 && a != null && a.length != 0) {
8500
- var u = new RegExp("^(?:" + a + ")");
8501
- if (o = u.exec(n)) {
8502
- a = new RegExp(v(g(t, 1), 2));
8503
- var h = F(a, n), _ = o.length - 1;
8504
- t = g(t, 16), t == null || t.length == 0 || o[_] == null || o[_].length == 0 ? (!h || F(a, n.substring(o[0].length))) && ($ != null && 0 < _ && o[_] != null && $.g(o[1]), d.set(n.substring(o[0].length))) : (n = n.replace(u, t), (!h || F(a, n)) && ($ != null && 0 < _ && $.g(o[1]), d.set(n)));
8497
+ var s = d.toString(), r = s.length, u = p(t, 15);
8498
+ if (r != 0 && u != null && u.length != 0) {
8499
+ var a = new RegExp("^(?:" + u + ")");
8500
+ if (r = a.exec(s)) {
8501
+ u = new RegExp(v(p(t, 1), 2));
8502
+ var h = F(u, s), _ = r.length - 1;
8503
+ t = p(t, 16), t == null || t.length == 0 || r[_] == null || r[_].length == 0 ? (!h || F(u, s.substring(r[0].length))) && ($ != null && 0 < _ && r[_] != null && $.g(r[1]), d.set(s.substring(r[0].length))) : (s = s.replace(a, t), (!h || F(u, s)) && ($ != null && 0 < _ && $.g(r[1]), d.set(s)));
8505
8504
  }
8506
8505
  }
8507
8506
  }
8508
8507
  function Z(d, t, $) {
8509
- if (!a1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8508
+ if (!u1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
8510
8509
  return z1(d, t, $, !0);
8511
8510
  }
8512
- function z1(d, t, $, n) {
8511
+ function z1(d, t, $, s) {
8513
8512
  if (t == null) throw Error("The string supplied did not seem to be a phone number");
8514
8513
  if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
8515
- var o = new A(), a = t.indexOf(";phone-context=");
8516
- if (a === -1) a = null;
8517
- else if (a += 15, a >= t.length) a = "";
8514
+ var r = new A(), u = t.indexOf(";phone-context=");
8515
+ if (u === -1) u = null;
8516
+ else if (u += 15, u >= t.length) u = "";
8518
8517
  else {
8519
- var u = t.indexOf(";", a);
8520
- a = u !== -1 ? t.substring(a, u) : t.substring(a);
8518
+ var a = t.indexOf(";", u);
8519
+ u = a !== -1 ? t.substring(u, a) : t.substring(u);
8521
8520
  }
8522
- var h = a;
8523
- if (h == null ? u = !0 : h.length === 0 ? u = !1 : (u = S2.exec(h), h = w2.exec(h), u = u !== null || h !== null), !u || (a != null ? (a.charAt(0) === "+" && o.g(a), a = t.indexOf("tel:"), o.g(t.substring(0 <= a ? a + 4 : 0, t.indexOf(";phone-context=")))) : (a = o.g, u = t ?? "", h = u.search(y2), 0 <= h ? (u = u.substring(h), u = u.replace(I2, ""), h = u.search(_2), 0 <= h && (u = u.substring(0, h))) : u = "", a.call(o, u)), a = o.toString(), u = a.indexOf(";isub="), 0 < u && (k(o), o.g(a.substring(0, u))), !R1(o.toString()))) throw Error("The string supplied did not seem to be a phone number");
8524
- if (a = o.toString(), !(a1($) || a != null && 0 < a.length && d1.test(a))) throw Error("Invalid country calling code");
8525
- a = new H(), n && E(a, 5, t);
8521
+ var h = u;
8522
+ if (h == null ? a = !0 : h.length === 0 ? a = !1 : (a = S2.exec(h), h = w2.exec(h), a = a !== null || h !== null), !a || (u != null ? (u.charAt(0) === "+" && r.g(u), u = t.indexOf("tel:"), r.g(t.substring(0 <= u ? u + 4 : 0, t.indexOf(";phone-context=")))) : (u = r.g, a = t ?? "", h = a.search(y2), 0 <= h ? (a = a.substring(h), a = a.replace(I2, ""), h = a.search(_2), 0 <= h && (a = a.substring(0, h))) : a = "", u.call(r, a)), u = r.toString(), a = u.indexOf(";isub="), 0 < a && (k(r), r.g(u.substring(0, a))), !R1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
8523
+ if (u = r.toString(), !(u1($) || u != null && 0 < u.length && d1.test(u))) throw Error("Invalid country calling code");
8524
+ u = new H(), s && E(u, 5, t);
8526
8525
  d: {
8527
- if (t = o.toString(), u = t.search(P1), 0 <= u && R1(t.substring(0, u))) {
8528
- h = t.match(P1);
8526
+ if (t = r.toString(), a = t.search(x1), 0 <= a && R1(t.substring(0, a))) {
8527
+ h = t.match(x1);
8529
8528
  for (var _ = h.length, V = 1; V < _; ++V) if (h[V] != null && 0 < h[V].length) {
8530
- k(o), o.g(t.substring(0, u)), t = h[V];
8529
+ k(r), r.g(t.substring(0, a)), t = h[V];
8531
8530
  break d;
8532
8531
  }
8533
8532
  }
8534
8533
  t = "";
8535
8534
  }
8536
- 0 < t.length && E(a, 3, t), u = j(d, $), t = new A(), h = 0, _ = o.toString();
8535
+ 0 < t.length && E(u, 3, t), a = j(d, $), t = new A(), h = 0, _ = r.toString();
8537
8536
  try {
8538
- h = j1(d, _, u, t, n, a);
8537
+ h = j1(d, _, a, t, s, u);
8539
8538
  } catch (I1) {
8540
8539
  if (I1.message == "Invalid country calling code" && d1.test(_)) {
8541
- if (_ = _.replace(d1, ""), h = j1(d, _, u, t, n, a), h == 0) throw I1;
8540
+ if (_ = _.replace(d1, ""), h = j1(d, _, a, t, s, u), h == 0) throw I1;
8542
8541
  } else throw I1;
8543
8542
  }
8544
- if (h != 0 ? (o = $1(h), o != $ && (u = t1(d, h, o))) : (k1(o), t.g(o.toString()), $ != null ? (h = v(u, 10), E(
8545
- a,
8543
+ if (h != 0 ? (r = $1(h), r != $ && (a = t1(d, h, r))) : (k1(r), t.g(r.toString()), $ != null ? (h = v(a, 10), E(
8544
+ u,
8546
8545
  1,
8547
8546
  h
8548
- )) : n && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (u != null && ($ = new A(), o = new A(t.toString()), W1(o, u, $), d = l1(d, o.toString(), u, -1), d != 2 && d != 4 && d != 5 && (t = o, n && 0 < $.toString().length && E(a, 7, $.toString()))), n = t.toString(), d = n.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8547
+ )) : s && (delete u.h[6], u.g && delete u.g[6])), 2 > t.h.length || (a != null && ($ = new A(), r = new A(t.toString()), W1(r, a, $), d = l1(d, r.toString(), a, -1), d != 2 && d != 4 && d != 5 && (t = r, s && 0 < $.toString().length && E(u, 7, $.toString()))), s = t.toString(), d = s.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
8549
8548
  if (17 < d) throw Error("The string supplied is too long to be a phone number");
8550
- if (1 < n.length && n.charAt(0) == "0") {
8551
- for (E(a, 4, !0), d = 1; d < n.length - 1 && n.charAt(d) == "0"; ) d++;
8552
- d != 1 && E(a, 8, d);
8549
+ if (1 < s.length && s.charAt(0) == "0") {
8550
+ for (E(u, 4, !0), d = 1; d < s.length - 1 && s.charAt(d) == "0"; ) d++;
8551
+ d != 1 && E(u, 8, d);
8553
8552
  }
8554
- return E(a, 2, parseInt(n, 10)), a;
8553
+ return E(u, 2, parseInt(s, 10)), u;
8555
8554
  }
8556
8555
  function F(d, t) {
8557
8556
  return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
@@ -8564,25 +8563,25 @@ const Z2 = (y) => {
8564
8563
  var E2 = RegExp("^[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/  ­​⁠ ()()[].\\[\\]/~⁓∼~]*)*$"), Y1 = /[- ]/;
8565
8564
  function J1(d, t) {
8566
8565
  var $ = d.ga;
8567
- return t = a1(t) ? K1($, t) : 0, d = j(d.ga, $1(t)), d ?? Z1;
8566
+ return t = u1(t) ? K1($, t) : 0, d = j(d.ga, $1(t)), d ?? Z1;
8568
8567
  }
8569
8568
  function q1(d) {
8570
8569
  for (var t = d.j.length, $ = 0; $ < t; ++$) {
8571
- var n = d.j[$], o = v(n, 1);
8572
- if (d.da == o) return !1;
8573
- var a = d, u = n, h = v(u, 1);
8574
- k(a.v);
8575
- var _ = a;
8576
- u = v(u, 2);
8570
+ var s = d.j[$], r = v(s, 1);
8571
+ if (d.da == r) return !1;
8572
+ var u = d, a = s, h = v(a, 1);
8573
+ k(u.v);
8574
+ var _ = u;
8575
+ a = v(a, 2);
8577
8576
  var V = "999999999999999".match(h)[0];
8578
- if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), u), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (a.v.g(_), a = !0) : a = !1, a) return d.da = o, d.ha = Y1.test(g(n, 4)), d.$ = 0, !0;
8577
+ if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(h, "g"), a), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (u.v.g(_), u = !0) : u = !1, u) return d.da = r, d.ha = Y1.test(p(s, 4)), d.$ = 0, !0;
8579
8578
  }
8580
8579
  return d.u = !1;
8581
8580
  }
8582
8581
  function X1(d, t) {
8583
- for (var $ = [], n = t.length - 3, o = d.j.length, a = 0; a < o; ++a) {
8584
- var u = d.j[a];
8585
- K(u, 3) == 0 ? $.push(d.j[a]) : (u = g(u, 3, Math.min(n, K(u, 3) - 1)), t.search(u) == 0 && $.push(d.j[a]));
8582
+ for (var $ = [], s = t.length - 3, r = d.j.length, u = 0; u < r; ++u) {
8583
+ var a = d.j[u];
8584
+ K(a, 3) == 0 ? $.push(d.j[u]) : (a = p(a, 3, Math.min(s, K(a, 3) - 1)), t.search(a) == 0 && $.push(d.j[u]));
8586
8585
  }
8587
8586
  d.j = $;
8588
8587
  }
@@ -8613,9 +8612,9 @@ const Z2 = (y) => {
8613
8612
  return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, k(d.v), d.da = "", y1(d);
8614
8613
  }
8615
8614
  function d2(d) {
8616
- for (var t = d.g.toString(), $ = d.j.length, n = 0; n < $; ++n) {
8617
- var o = d.j[n], a = v(o, 1);
8618
- if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha = Y1.test(g(o, 4)), o = t.replace(new RegExp(a, "g"), g(o, 2)), o = c1(d, o), o1(o, g2) == d.ba)) return o;
8615
+ for (var t = d.g.toString(), $ = d.j.length, s = 0; s < $; ++s) {
8616
+ var r = d.j[s], u = v(r, 1);
8617
+ if (new RegExp("^(?:" + u + ")$").test(t) && (d.ha = Y1.test(p(r, 4)), r = t.replace(new RegExp(u, "g"), p(r, 2)), r = c1(d, r), o1(r, g2) == d.ba)) return r;
8619
8618
  }
8620
8619
  return "";
8621
8620
  }
@@ -8626,9 +8625,9 @@ const Z2 = (y) => {
8626
8625
  function y1(d) {
8627
8626
  var t = d.g.toString();
8628
8627
  if (3 <= t.length) {
8629
- for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? x(d.l, 20) : x(d.l, 19), n = $.length, o = 0; o < n; ++o) {
8630
- var a = $[o];
8631
- 0 < d.o.length && G1(v(a, 4)) && !g(a, 6) && !B(a, 5) || (d.o.length != 0 || d.ca || G1(v(a, 4)) || g(a, 6)) && E2.test(v(a, 2)) && d.j.push(a);
8628
+ for (var $ = d.ca && d.o.length == 0 && 0 < K(d.l, 20) ? P(d.l, 20) : P(d.l, 19), s = $.length, r = 0; r < s; ++r) {
8629
+ var u = $[r];
8630
+ 0 < d.o.length && G1(v(u, 4)) && !p(u, 6) && !B(u, 5) || (d.o.length != 0 || d.ca || G1(v(u, 4)) || p(u, 6)) && E2.test(v(u, 2)) && d.j.push(u);
8632
8631
  }
8633
8632
  return X1(d, t), t = d2(d), 0 < t.length ? t : q1(d) ? t2(d) : d.s.toString();
8634
8633
  }
@@ -8637,19 +8636,19 @@ const Z2 = (y) => {
8637
8636
  function t2(d) {
8638
8637
  var t = d.g.toString(), $ = t.length;
8639
8638
  if (0 < $) {
8640
- for (var n = "", o = 0; o < $; o++) n = n2(d, t.charAt(o));
8641
- return d.u ? c1(d, n) : d.s.toString();
8639
+ for (var s = "", r = 0; r < $; r++) s = n2(d, t.charAt(r));
8640
+ return d.u ? c1(d, s) : d.s.toString();
8642
8641
  }
8643
8642
  return d.h.toString();
8644
8643
  }
8645
8644
  function e2(d) {
8646
8645
  var t = d.g.toString(), $ = 0;
8647
- if (g(d.l, 10) != 1) var n = !1;
8648
- else n = d.g.toString(), n = n.charAt(0) == "1" && n.charAt(1) != "0" && n.charAt(1) != "1";
8649
- return n ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (n = new RegExp("^(?:" + g(d.l, 15) + ")"), n = t.match(n), n != null && n[0] != null && 0 < n[0].length && (d.ca = !0, $ = n[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
8646
+ if (p(d.l, 10) != 1) var s = !1;
8647
+ else s = d.g.toString(), s = s.charAt(0) == "1" && s.charAt(1) != "0" && s.charAt(1) != "1";
8648
+ return s ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : B(d.l, 15) && (s = new RegExp("^(?:" + p(d.l, 15) + ")"), s = t.match(s), s != null && s[0] != null && 0 < s[0].length && (d.ca = !0, $ = s[0].length, d.h.g(t.substring(0, $)))), k(d.g), d.g.g(t.substring($)), t.substring(0, $);
8650
8649
  }
8651
8650
  function $2(d) {
8652
- var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + g(d.l, 11) + ")");
8651
+ var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
8653
8652
  return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, k(d.g), d.g.g(t.substring($)), k(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
8654
8653
  }
8655
8654
  function i2(d) {
@@ -8660,8 +8659,8 @@ const Z2 = (y) => {
8660
8659
  function n2(d, t) {
8661
8660
  var $ = d.v.toString();
8662
8661
  if (0 <= $.substring(d.$).search(d.fa)) {
8663
- var n = $.search(d.fa);
8664
- return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = n, t.substring(0, d.$ + 1);
8662
+ var s = $.search(d.fa);
8663
+ return t = $.replace(d.fa, t), k(d.v), d.v.g(t), d.$ = s, t.substring(0, d.$ + 1);
8665
8664
  }
8666
8665
  return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
8667
8666
  }
@@ -8671,31 +8670,31 @@ const Z2 = (y) => {
8671
8670
  }, _1 = { 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 };
8672
8671
  e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
8673
8672
  try {
8674
- const $ = d.replace(/[^+0-9]/g, ""), n = new A2(t);
8673
+ const $ = d.replace(/[^+0-9]/g, ""), s = new A2(t);
8675
8674
  t = "";
8676
- for (let o = 0; o < $.length; o++) n.ja = M2(n, $.charAt(o)), t = n.ja;
8675
+ for (let r = 0; r < $.length; r++) s.ja = M2(s, $.charAt(r)), t = s.ja;
8677
8676
  return t;
8678
8677
  } catch {
8679
8678
  return d;
8680
8679
  }
8681
8680
  }), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
8682
8681
  try {
8683
- const o = M.g(), a = Z(o, d, t);
8684
- var n = h1(o, a, -1);
8685
- return n == 0 || n == 4 ? o.format(a, typeof $ > "u" ? 0 : $) : d;
8682
+ const r = M.g(), u = Z(r, d, t);
8683
+ var s = h1(r, u, -1);
8684
+ return s == 0 || s == 4 ? r.format(u, typeof $ > "u" ? 0 : $) : d;
8686
8685
  } catch {
8687
8686
  return d;
8688
8687
  }
8689
- }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, n) => {
8688
+ }), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, s) => {
8690
8689
  try {
8691
8690
  const _ = M.g();
8692
8691
  d: {
8693
- var o = _;
8694
- if (a1(d)) {
8695
- var a = u1(j(o, d), $);
8692
+ var r = _;
8693
+ if (u1(d)) {
8694
+ var u = a1(j(r, d), $);
8696
8695
  try {
8697
- if (B(a, 6)) {
8698
- var u = g(a, 6), h = z1(o, u, d, !1);
8696
+ if (B(u, 6)) {
8697
+ var a = p(u, 6), h = z1(r, a, d, !1);
8699
8698
  break d;
8700
8699
  }
8701
8700
  } catch {
@@ -8703,57 +8702,57 @@ const Z2 = (y) => {
8703
8702
  }
8704
8703
  h = null;
8705
8704
  }
8706
- return _.format(h, n ? 0 : t ? 2 : 1);
8705
+ return _.format(h, s ? 0 : t ? 2 : 1);
8707
8706
  } catch {
8708
8707
  return "";
8709
8708
  }
8710
8709
  }), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
8711
8710
  try {
8712
- return g(Z(M.g(), d, t), 3);
8711
+ return p(Z(M.g(), d, t), 3);
8713
8712
  } catch {
8714
8713
  return "";
8715
8714
  }
8716
8715
  }), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
8717
8716
  try {
8718
- const $ = M.g(), n = Z($, d, t);
8719
- return F1($, n);
8717
+ const $ = M.g(), s = Z($, d, t);
8718
+ return F1($, s);
8720
8719
  } catch {
8721
8720
  return -99;
8722
8721
  }
8723
8722
  }), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
8724
8723
  if (!t) return 1;
8725
8724
  try {
8726
- const $ = M.g(), n = Z($, d, t);
8727
- return h1($, n, -1);
8725
+ const $ = M.g(), s = Z($, d, t);
8726
+ return h1($, s, -1);
8728
8727
  } catch ($) {
8729
8728
  return $.message === "Invalid country calling code" ? 1 : 3 >= d.length || $.message === "Phone number too short after IDD" || $.message === "The string supplied is too short to be a phone number" ? 2 : $.message === "The string supplied is too long to be a phone number" ? 3 : -99;
8730
8729
  }
8731
8730
  }), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
8732
8731
  try {
8733
- const n = M.g(), o = Z(n, d, t), a = T2(n, o);
8732
+ const s = M.g(), r = Z(s, d, t), u = T2(s, r);
8734
8733
  if ($) {
8735
- const u = s2($).map((h) => _1[h]);
8736
- return a && u.includes(F1(n, o));
8734
+ const a = s2($).map((h) => _1[h]);
8735
+ return u && a.includes(F1(s, r));
8737
8736
  }
8738
- return a;
8737
+ return u;
8739
8738
  } catch {
8740
8739
  return !1;
8741
8740
  }
8742
8741
  }), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
8743
8742
  try {
8744
- const n = M.g(), o = Z(n, d, t);
8743
+ const s = M.g(), r = Z(s, d, t);
8745
8744
  if ($) {
8746
- const a = s2($);
8747
- for (let u of a) if (h1(n, o, _1[u]) === 0) return !0;
8745
+ const u = s2($);
8746
+ for (let a of u) if (h1(s, r, _1[a]) === 0) return !0;
8748
8747
  return !1;
8749
8748
  }
8750
- return h1(n, o, -1) === 0;
8749
+ return h1(s, r, -1) === 0;
8751
8750
  } catch {
8752
8751
  return !1;
8753
8752
  }
8754
8753
  }), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
8755
8754
  try {
8756
- return g(Z(M.g(), d, t), 2).toString();
8755
+ return p(Z(M.g(), d, t), 2).toString();
8757
8756
  } catch {
8758
8757
  return "";
8759
8758
  }
@@ -8795,41 +8794,41 @@ const q2 = {
8795
8794
  "changeErrorCode"
8796
8795
  ], ["update:modelValue"]),
8797
8796
  setup(y, { expose: e, emit: i }) {
8798
- const s = D2(y, "modelValue"), r = y, l = i, c = v1(), C = v1(), f = v1(!1), S = () => C.value ? r.options.strictMode ? C.value.isValidNumberPrecise() : C.value.isValidNumber() : null, w = () => {
8799
- let p = S();
8800
- f.value !== p && (f.value = p, l("changeValidity", !!p), l(
8797
+ const n = D2(y, "modelValue"), o = y, l = i, C = v1(), g = v1(), c = v1(!1), S = () => g.value ? o.options.strictMode ? g.value.isValidNumberPrecise() : g.value.isValidNumber() : null, w = () => {
8798
+ let f = S();
8799
+ c.value !== f && (c.value = f, l("changeValidity", !!f), l(
8801
8800
  "changeErrorCode",
8802
- p ? null : C.value.getValidationError()
8801
+ f ? null : g.value.getValidationError()
8803
8802
  ));
8804
8803
  }, b = () => {
8805
- var p;
8806
- l("changeNumber", ((p = C.value) == null ? void 0 : p.getNumber()) ?? ""), w();
8804
+ var f;
8805
+ l("changeNumber", ((f = g.value) == null ? void 0 : f.getNumber()) ?? ""), w();
8807
8806
  }, L = () => {
8808
- var p;
8809
- l("changeCountry", ((p = C.value) == null ? void 0 : p.getSelectedCountryData().iso2) ?? ""), b(), w();
8807
+ var f;
8808
+ l("changeCountry", ((f = g.value) == null ? void 0 : f.getSelectedCountryData().iso2) ?? ""), b(), w();
8810
8809
  };
8811
- return x2(() => {
8812
- c.value && (C.value = m(c.value, r.options), r.value && C.value.setNumber(r.value), r.disabled && C.value.setDisabled(r.disabled), f.value = S());
8813
- }), P2(
8814
- () => r.disabled,
8815
- (p) => {
8810
+ return P2(() => {
8811
+ C.value && (g.value = m(C.value, o.options), o.value && g.value.setNumber(o.value), o.disabled && g.value.setDisabled(o.disabled), c.value = S());
8812
+ }), x2(
8813
+ () => o.disabled,
8814
+ (f) => {
8816
8815
  var I;
8817
- return (I = C.value) == null ? void 0 : I.setDisabled(p);
8816
+ return (I = g.value) == null ? void 0 : I.setDisabled(f);
8818
8817
  }
8819
8818
  ), R2(() => {
8820
- var p;
8821
- return (p = C.value) == null ? void 0 : p.destroy();
8822
- }), e({ instance: C, input: c }), (p, I) => B2((O2(), k2("input", G2({
8819
+ var f;
8820
+ return (f = g.value) == null ? void 0 : f.destroy();
8821
+ }), e({ instance: g, input: C }), (f, I) => B2((O2(), k2("input", G2({
8823
8822
  ref_key: "input",
8824
- ref: c,
8825
- "onUpdate:modelValue": I[0] || (I[0] = (G) => s.value = G),
8823
+ ref: C,
8824
+ "onUpdate:modelValue": I[0] || (I[0] = (G) => n.value = G),
8826
8825
  type: "tel",
8827
8826
  onCountrychange: L,
8828
8827
  onInput: b
8829
8828
  }, y.inputProps), null, 16)), [
8830
8829
  [
8831
8830
  U2,
8832
- s.value,
8831
+ n.value,
8833
8832
  void 0,
8834
8833
  { lazy: !0 }
8835
8834
  ]