intl-tel-input 25.10.5 → 25.10.7
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.
- package/README.md +6 -6
- package/angular/README.md +1 -1
- package/angular/build/IntlTelInput.js +97 -53
- package/angular/build/IntlTelInputWithUtils.js +97 -53
- package/angular/build/types/intl-tel-input.d.ts +1 -0
- package/build/js/data.js +8 -8
- package/build/js/data.min.js +2 -2
- package/build/js/intlTelInput.d.ts +1 -0
- package/build/js/intlTelInput.js +98 -54
- package/build/js/intlTelInput.min.js +4 -4
- package/build/js/intlTelInputWithUtils.js +98 -54
- package/build/js/intlTelInputWithUtils.min.js +6 -6
- package/package.json +11 -6
- package/react/README.md +1 -1
- package/react/build/IntlTelInput.cjs +97 -53
- package/react/build/IntlTelInput.d.ts +1 -0
- package/react/build/IntlTelInput.js +97 -53
- package/react/build/IntlTelInputWithUtils.cjs +97 -53
- package/react/build/IntlTelInputWithUtils.js +97 -53
- package/vue/README.md +1 -1
- package/vue/build/IntlTelInput.mjs +286 -260
- package/vue/build/IntlTelInputWithUtils.mjs +539 -513
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeModels as
|
|
1
|
+
import { mergeModels as a2, useModel as D2, ref as S1, onMounted as P2, watch as x2, onUnmounted as R2, withDirectives as B2, createElementBlock as k2, openBlock as O2, mergeProps as G2, vModelText as F2 } from "vue";
|
|
2
2
|
const U2 = [
|
|
3
3
|
[
|
|
4
4
|
"af",
|
|
@@ -1226,6 +1226,13 @@ const U2 = [
|
|
|
1226
1226
|
// Tuvalu
|
|
1227
1227
|
"688"
|
|
1228
1228
|
],
|
|
1229
|
+
[
|
|
1230
|
+
"vi",
|
|
1231
|
+
// U.S. Virgin Islands
|
|
1232
|
+
"1",
|
|
1233
|
+
24,
|
|
1234
|
+
["340"]
|
|
1235
|
+
],
|
|
1229
1236
|
[
|
|
1230
1237
|
"ug",
|
|
1231
1238
|
// Uganda
|
|
@@ -1260,13 +1267,6 @@ const U2 = [
|
|
|
1260
1267
|
// Uruguay
|
|
1261
1268
|
"598"
|
|
1262
1269
|
],
|
|
1263
|
-
[
|
|
1264
|
-
"vi",
|
|
1265
|
-
// U.S. Virgin Islands
|
|
1266
|
-
"1",
|
|
1267
|
-
24,
|
|
1268
|
-
["340"]
|
|
1269
|
-
],
|
|
1270
1270
|
[
|
|
1271
1271
|
"uz",
|
|
1272
1272
|
// Uzbekistan
|
|
@@ -1322,18 +1322,18 @@ const U2 = [
|
|
|
1322
1322
|
// Zimbabwe
|
|
1323
1323
|
"263"
|
|
1324
1324
|
]
|
|
1325
|
-
],
|
|
1326
|
-
for (const
|
|
1327
|
-
|
|
1325
|
+
], q = [];
|
|
1326
|
+
for (const y of U2)
|
|
1327
|
+
q.push({
|
|
1328
1328
|
name: "",
|
|
1329
1329
|
// populated in the plugin
|
|
1330
|
-
iso2:
|
|
1331
|
-
dialCode:
|
|
1332
|
-
priority:
|
|
1333
|
-
areaCodes:
|
|
1330
|
+
iso2: y[0],
|
|
1331
|
+
dialCode: y[1],
|
|
1332
|
+
priority: y[2] || 0,
|
|
1333
|
+
areaCodes: y[3] || null,
|
|
1334
1334
|
nodeById: {},
|
|
1335
1335
|
// populated by the plugin
|
|
1336
|
-
nationalPrefix:
|
|
1336
|
+
nationalPrefix: y[4] || null
|
|
1337
1337
|
});
|
|
1338
1338
|
const V2 = {
|
|
1339
1339
|
ad: "Andorra",
|
|
@@ -1590,17 +1590,17 @@ const V2 = {
|
|
|
1590
1590
|
// additional countries (not supported by country-list library)
|
|
1591
1591
|
ac: "Ascension Island",
|
|
1592
1592
|
xk: "Kosovo"
|
|
1593
|
-
},
|
|
1594
|
-
for (const
|
|
1595
|
-
|
|
1593
|
+
}, h2 = { ...V2, ...K2 };
|
|
1594
|
+
for (const y of q)
|
|
1595
|
+
y.name = h2[y.iso2];
|
|
1596
1596
|
let H2 = 0;
|
|
1597
|
-
const
|
|
1597
|
+
const b1 = (y) => typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia(y).matches, j2 = () => {
|
|
1598
1598
|
if (typeof navigator < "u" && typeof window < "u") {
|
|
1599
|
-
const
|
|
1600
|
-
return
|
|
1599
|
+
const y = /Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), e = b1("(max-width: 500px)"), i = b1("(max-height: 600px)"), n = b1("(pointer: coarse)");
|
|
1600
|
+
return y || e || n && i;
|
|
1601
1601
|
}
|
|
1602
1602
|
return !1;
|
|
1603
|
-
},
|
|
1603
|
+
}, c2 = {
|
|
1604
1604
|
// Allow alphanumeric "phonewords" (e.g. +1 800 FLOWERS) as valid numbers
|
|
1605
1605
|
allowPhonewords: !1,
|
|
1606
1606
|
//* Whether or not to allow the dropdown.
|
|
@@ -1669,32 +1669,32 @@ const w1 = (m) => typeof window < "u" && typeof window.matchMedia == "function"
|
|
|
1669
1669
|
"887",
|
|
1670
1670
|
"888",
|
|
1671
1671
|
"889"
|
|
1672
|
-
],
|
|
1673
|
-
const e =
|
|
1672
|
+
], p1 = (y) => y.replace(/\D/g, ""), u2 = (y = "") => y.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), l2 = (y) => {
|
|
1673
|
+
const e = p1(y);
|
|
1674
1674
|
if (e.charAt(0) === "1") {
|
|
1675
1675
|
const i = e.substring(1, 4);
|
|
1676
1676
|
return W2.includes(i);
|
|
1677
1677
|
}
|
|
1678
1678
|
return !1;
|
|
1679
|
-
}, z2 = (
|
|
1679
|
+
}, z2 = (y, e, i, n) => {
|
|
1680
1680
|
if (i === 0 && !n)
|
|
1681
1681
|
return 0;
|
|
1682
1682
|
let o = 0;
|
|
1683
1683
|
for (let l = 0; l < e.length; l++) {
|
|
1684
|
-
if (/[+0-9]/.test(e[l]) && o++, o ===
|
|
1684
|
+
if (/[+0-9]/.test(e[l]) && o++, o === y && !n)
|
|
1685
1685
|
return l + 1;
|
|
1686
|
-
if (n && o ===
|
|
1686
|
+
if (n && o === y + 1)
|
|
1687
1687
|
return l;
|
|
1688
1688
|
}
|
|
1689
1689
|
return e.length;
|
|
1690
|
-
},
|
|
1691
|
-
const n = document.createElement(
|
|
1690
|
+
}, T = (y, e, i) => {
|
|
1691
|
+
const n = document.createElement(y);
|
|
1692
1692
|
return e && Object.entries(e).forEach(([o, l]) => n.setAttribute(o, l)), i && i.appendChild(n), n;
|
|
1693
|
-
},
|
|
1694
|
-
const { instances: i } =
|
|
1695
|
-
Object.values(i).forEach((n) => n[
|
|
1693
|
+
}, i1 = (y, ...e) => {
|
|
1694
|
+
const { instances: i } = m;
|
|
1695
|
+
Object.values(i).forEach((n) => n[y](...e));
|
|
1696
1696
|
};
|
|
1697
|
-
class
|
|
1697
|
+
class g1 {
|
|
1698
1698
|
/**
|
|
1699
1699
|
* Build a space-delimited class string from an object map of className -> truthy/falsey.
|
|
1700
1700
|
* Only keys with truthy values are included.
|
|
@@ -1703,13 +1703,13 @@ class p1 {
|
|
|
1703
1703
|
return Object.keys(e).filter((i) => !!e[i]).join(" ");
|
|
1704
1704
|
}
|
|
1705
1705
|
constructor(e, i = {}) {
|
|
1706
|
-
this.id = H2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({},
|
|
1706
|
+
this.id = H2++, this.telInput = e, this.highlightedItem = null, this.options = Object.assign({}, c2, i), this.hadInitialPlaceholder = !!e.getAttribute("placeholder");
|
|
1707
1707
|
}
|
|
1708
1708
|
//* Can't be private as it's called from intlTelInput convenience wrapper.
|
|
1709
1709
|
_init() {
|
|
1710
1710
|
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";
|
|
1711
1711
|
const e = this.options.allowDropdown || this.options.separateDialCode;
|
|
1712
|
-
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 = { ...
|
|
1712
|
+
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 = { ...h2, ...this.options.i18n };
|
|
1713
1713
|
const i = new Promise((o, l) => {
|
|
1714
1714
|
this.resolveAutoCountryPromise = o, this.rejectAutoCountryPromise = l;
|
|
1715
1715
|
}), n = new Promise((o, l) => {
|
|
@@ -1727,7 +1727,7 @@ class p1 {
|
|
|
1727
1727
|
//* Precompute and cache country search tokens to speed up filtering
|
|
1728
1728
|
_cacheSearchTokens() {
|
|
1729
1729
|
for (const e of this.countries)
|
|
1730
|
-
e.normalisedName =
|
|
1730
|
+
e.normalisedName = u2(e.name), e.initials = e.name.split(/[^a-zA-ZÀ-ÿа-яА-Я]/).map((i) => i[0]).join("").toLowerCase(), e.dialCodePlus = `+${e.dialCode}`;
|
|
1731
1731
|
}
|
|
1732
1732
|
//* Sort countries by countryOrder option (if present), then name.
|
|
1733
1733
|
_sortCountries() {
|
|
@@ -1743,6 +1743,8 @@ class p1 {
|
|
|
1743
1743
|
}
|
|
1744
1744
|
//* Add a dial code to this.dialCodeToIso2Map.
|
|
1745
1745
|
_addToDialCodeMap(e, i, n) {
|
|
1746
|
+
if (!e || !i)
|
|
1747
|
+
return;
|
|
1746
1748
|
i.length > this.dialCodeMaxLen && (this.dialCodeMaxLen = i.length), this.dialCodeToIso2Map.hasOwnProperty(i) || (this.dialCodeToIso2Map[i] = []);
|
|
1747
1749
|
const o = this.dialCodeToIso2Map[i];
|
|
1748
1750
|
if (o.includes(e))
|
|
@@ -1757,18 +1759,18 @@ class p1 {
|
|
|
1757
1759
|
const n = e.map(
|
|
1758
1760
|
(o) => o.toLowerCase()
|
|
1759
1761
|
);
|
|
1760
|
-
this.countries =
|
|
1762
|
+
this.countries = q.filter(
|
|
1761
1763
|
(o) => n.includes(o.iso2)
|
|
1762
1764
|
);
|
|
1763
1765
|
} else if (i.length) {
|
|
1764
1766
|
const n = i.map(
|
|
1765
1767
|
(o) => o.toLowerCase()
|
|
1766
1768
|
);
|
|
1767
|
-
this.countries =
|
|
1769
|
+
this.countries = q.filter(
|
|
1768
1770
|
(o) => !n.includes(o.iso2)
|
|
1769
1771
|
);
|
|
1770
1772
|
} else
|
|
1771
|
-
this.countries =
|
|
1773
|
+
this.countries = q;
|
|
1772
1774
|
}
|
|
1773
1775
|
//* Translate Countries by object literal provided on config.
|
|
1774
1776
|
_translateCountryNames() {
|
|
@@ -1782,6 +1784,9 @@ class p1 {
|
|
|
1782
1784
|
this.dialCodes = /* @__PURE__ */ new Set(), this.dialCodeMaxLen = 0, this.dialCodeToIso2Map = {};
|
|
1783
1785
|
for (const e of this.countries)
|
|
1784
1786
|
this.dialCodes.has(e.dialCode) || this.dialCodes.add(e.dialCode), this._addToDialCodeMap(e.iso2, e.dialCode, e.priority);
|
|
1787
|
+
(this.options.onlyCountries.length || this.options.excludeCountries.length) && this.dialCodes.forEach((e) => {
|
|
1788
|
+
this.dialCodeToIso2Map[e] = this.dialCodeToIso2Map[e].filter(Boolean);
|
|
1789
|
+
});
|
|
1785
1790
|
for (const e of this.countries)
|
|
1786
1791
|
if (e.areaCodes) {
|
|
1787
1792
|
const i = this.dialCodeToIso2Map[e.dialCode][0];
|
|
@@ -1796,7 +1801,7 @@ class p1 {
|
|
|
1796
1801
|
}
|
|
1797
1802
|
//* Generate all of the markup for the plugin: the selected country overlay, and the dropdown.
|
|
1798
1803
|
_generateMarkup() {
|
|
1799
|
-
var
|
|
1804
|
+
var S, A, G;
|
|
1800
1805
|
this.telInput.classList.add("iti__tel-input"), !this.telInput.hasAttribute("autocomplete") && !(this.telInput.form && this.telInput.form.hasAttribute("autocomplete")) && this.telInput.setAttribute("autocomplete", "off");
|
|
1801
1806
|
const {
|
|
1802
1807
|
allowDropdown: e,
|
|
@@ -1806,23 +1811,23 @@ class p1 {
|
|
|
1806
1811
|
hiddenInput: l,
|
|
1807
1812
|
dropdownContainer: f,
|
|
1808
1813
|
fixDropdownWidth: h,
|
|
1809
|
-
useFullscreenPopup:
|
|
1810
|
-
countrySearch:
|
|
1814
|
+
useFullscreenPopup: C,
|
|
1815
|
+
countrySearch: I,
|
|
1811
1816
|
i18n: v
|
|
1812
|
-
} = this.options,
|
|
1817
|
+
} = this.options, g = g1._buildClassNames({
|
|
1813
1818
|
iti: !0,
|
|
1814
1819
|
"iti--allow-dropdown": e,
|
|
1815
1820
|
"iti--show-flags": n,
|
|
1816
|
-
"iti--inline-dropdown": !
|
|
1821
|
+
"iti--inline-dropdown": !C,
|
|
1817
1822
|
[o]: !!o
|
|
1818
|
-
}),
|
|
1819
|
-
if ((
|
|
1820
|
-
this.countryContainer =
|
|
1823
|
+
}), w = T("div", { class: g });
|
|
1824
|
+
if ((S = this.telInput.parentNode) == null || S.insertBefore(w, this.telInput), e || n || i) {
|
|
1825
|
+
this.countryContainer = T(
|
|
1821
1826
|
"div",
|
|
1822
1827
|
// visibly hidden until we measure it's width to set the input padding correctly
|
|
1823
1828
|
{ class: "iti__country-container iti__v-hide" },
|
|
1824
|
-
|
|
1825
|
-
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry =
|
|
1829
|
+
w
|
|
1830
|
+
), this.showSelectedCountryOnLeft ? this.countryContainer.style.left = "0px" : this.countryContainer.style.right = "0px", e ? (this.selectedCountry = T(
|
|
1826
1831
|
"button",
|
|
1827
1832
|
{
|
|
1828
1833
|
type: "button",
|
|
@@ -1833,53 +1838,53 @@ class p1 {
|
|
|
1833
1838
|
"aria-controls": `iti-${this.id}__dropdown-content`
|
|
1834
1839
|
},
|
|
1835
1840
|
this.countryContainer
|
|
1836
|
-
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry =
|
|
1841
|
+
), this.telInput.disabled && this.selectedCountry.setAttribute("disabled", "true")) : this.selectedCountry = T(
|
|
1837
1842
|
"div",
|
|
1838
1843
|
{ class: "iti__selected-country" },
|
|
1839
1844
|
this.countryContainer
|
|
1840
1845
|
);
|
|
1841
|
-
const
|
|
1846
|
+
const x = T(
|
|
1842
1847
|
"div",
|
|
1843
1848
|
{ class: "iti__selected-country-primary" },
|
|
1844
1849
|
this.selectedCountry
|
|
1845
1850
|
);
|
|
1846
|
-
if (this.selectedCountryInner =
|
|
1851
|
+
if (this.selectedCountryInner = T(
|
|
1847
1852
|
"div",
|
|
1848
1853
|
{ class: "iti__flag" },
|
|
1849
|
-
|
|
1850
|
-
), e && (this.dropdownArrow =
|
|
1854
|
+
x
|
|
1855
|
+
), e && (this.dropdownArrow = T(
|
|
1851
1856
|
"div",
|
|
1852
1857
|
{ class: "iti__arrow", "aria-hidden": "true" },
|
|
1853
|
-
|
|
1854
|
-
)), i && (this.selectedDialCode =
|
|
1858
|
+
x
|
|
1859
|
+
)), i && (this.selectedDialCode = T(
|
|
1855
1860
|
"div",
|
|
1856
1861
|
{ class: "iti__selected-dial-code", dir: "ltr" },
|
|
1857
1862
|
this.selectedCountry
|
|
1858
1863
|
)), e) {
|
|
1859
|
-
const
|
|
1860
|
-
if (this.dropdownContent =
|
|
1864
|
+
const R = h ? "" : "iti--flexible-dropdown-width";
|
|
1865
|
+
if (this.dropdownContent = T("div", {
|
|
1861
1866
|
id: `iti-${this.id}__dropdown-content`,
|
|
1862
|
-
class: `iti__dropdown-content iti__hide ${
|
|
1867
|
+
class: `iti__dropdown-content iti__hide ${R}`,
|
|
1863
1868
|
role: "dialog",
|
|
1864
1869
|
"aria-modal": "true"
|
|
1865
|
-
}),
|
|
1866
|
-
const
|
|
1870
|
+
}), I) {
|
|
1871
|
+
const N = T(
|
|
1867
1872
|
"div",
|
|
1868
1873
|
{ class: "iti__search-input-wrapper" },
|
|
1869
1874
|
this.dropdownContent
|
|
1870
1875
|
);
|
|
1871
|
-
this.searchIcon =
|
|
1876
|
+
this.searchIcon = T(
|
|
1872
1877
|
"span",
|
|
1873
1878
|
{
|
|
1874
1879
|
class: "iti__search-icon",
|
|
1875
1880
|
"aria-hidden": "true"
|
|
1876
1881
|
},
|
|
1877
|
-
|
|
1882
|
+
N
|
|
1878
1883
|
), this.searchIcon.innerHTML = `
|
|
1879
1884
|
<svg class="iti__search-icon-svg" width="14" height="14" viewBox="0 0 24 24" focusable="false" aria-hidden="true">
|
|
1880
1885
|
<circle cx="11" cy="11" r="7" />
|
|
1881
1886
|
<line x1="21" y1="21" x2="16.65" y2="16.65" />
|
|
1882
|
-
</svg>`, this.searchInput =
|
|
1887
|
+
</svg>`, this.searchInput = T(
|
|
1883
1888
|
"input",
|
|
1884
1889
|
{
|
|
1885
1890
|
id: `iti-${this.id}__search-input`,
|
|
@@ -1895,8 +1900,8 @@ class p1 {
|
|
|
1895
1900
|
"aria-autocomplete": "list",
|
|
1896
1901
|
autocomplete: "off"
|
|
1897
1902
|
},
|
|
1898
|
-
|
|
1899
|
-
), this.searchClearButton =
|
|
1903
|
+
N
|
|
1904
|
+
), this.searchClearButton = T(
|
|
1900
1905
|
"button",
|
|
1901
1906
|
{
|
|
1902
1907
|
type: "button",
|
|
@@ -1904,21 +1909,21 @@ class p1 {
|
|
|
1904
1909
|
"aria-label": v.clearSearchAriaLabel,
|
|
1905
1910
|
tabindex: "-1"
|
|
1906
1911
|
},
|
|
1907
|
-
|
|
1912
|
+
N
|
|
1908
1913
|
);
|
|
1909
|
-
const
|
|
1914
|
+
const W = `iti-${this.id}-clear-mask`;
|
|
1910
1915
|
this.searchClearButton.innerHTML = `
|
|
1911
1916
|
<svg class="iti__search-clear-svg" width="12" height="12" viewBox="0 0 16 16" aria-hidden="true" focusable="false">
|
|
1912
|
-
<mask id="${
|
|
1917
|
+
<mask id="${W}" maskUnits="userSpaceOnUse">
|
|
1913
1918
|
<rect width="16" height="16" fill="white" />
|
|
1914
1919
|
<path d="M5.2 5.2 L10.8 10.8 M10.8 5.2 L5.2 10.8" stroke="black" stroke-linecap="round" class="iti__search-clear-x" />
|
|
1915
1920
|
</mask>
|
|
1916
|
-
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${
|
|
1917
|
-
</svg>`, this.searchResultsA11yText =
|
|
1921
|
+
<circle cx="8" cy="8" r="8" class="iti__search-clear-bg" mask="url(#${W})" />
|
|
1922
|
+
</svg>`, this.searchResultsA11yText = T(
|
|
1918
1923
|
"span",
|
|
1919
1924
|
{ class: "iti__a11y-text" },
|
|
1920
1925
|
this.dropdownContent
|
|
1921
|
-
), this.searchNoResults =
|
|
1926
|
+
), this.searchNoResults = T(
|
|
1922
1927
|
"div",
|
|
1923
1928
|
{
|
|
1924
1929
|
class: "iti__no-results iti__hide",
|
|
@@ -1928,7 +1933,7 @@ class p1 {
|
|
|
1928
1933
|
this.dropdownContent
|
|
1929
1934
|
), this.searchNoResults.textContent = v.zeroSearchResults;
|
|
1930
1935
|
}
|
|
1931
|
-
if (this.countryList =
|
|
1936
|
+
if (this.countryList = T(
|
|
1932
1937
|
"ul",
|
|
1933
1938
|
{
|
|
1934
1939
|
class: "iti__country-list",
|
|
@@ -1937,41 +1942,41 @@ class p1 {
|
|
|
1937
1942
|
"aria-label": v.countryListAriaLabel
|
|
1938
1943
|
},
|
|
1939
1944
|
this.dropdownContent
|
|
1940
|
-
), this._appendListItems(),
|
|
1941
|
-
const
|
|
1945
|
+
), this._appendListItems(), I && this._updateSearchResultsA11yText(), f) {
|
|
1946
|
+
const N = g1._buildClassNames({
|
|
1942
1947
|
iti: !0,
|
|
1943
1948
|
"iti--container": !0,
|
|
1944
|
-
"iti--fullscreen-popup":
|
|
1945
|
-
"iti--inline-dropdown": !
|
|
1949
|
+
"iti--fullscreen-popup": C,
|
|
1950
|
+
"iti--inline-dropdown": !C,
|
|
1946
1951
|
[o]: !!o
|
|
1947
1952
|
});
|
|
1948
|
-
this.dropdown =
|
|
1953
|
+
this.dropdown = T("div", { class: N }), this.dropdown.appendChild(this.dropdownContent);
|
|
1949
1954
|
} else
|
|
1950
1955
|
this.countryContainer.appendChild(this.dropdownContent);
|
|
1951
1956
|
}
|
|
1952
1957
|
}
|
|
1953
|
-
if (
|
|
1954
|
-
const
|
|
1955
|
-
if (
|
|
1956
|
-
const
|
|
1957
|
-
|
|
1958
|
+
if (w.appendChild(this.telInput), this.countryContainer && (this._updateInputPadding(), this.countryContainer.classList.remove("iti__v-hide")), l) {
|
|
1959
|
+
const x = this.telInput.getAttribute("name") || "", R = l(x);
|
|
1960
|
+
if (R.phone) {
|
|
1961
|
+
const N = (A = this.telInput.form) == null ? void 0 : A.querySelector(`input[name="${R.phone}"]`);
|
|
1962
|
+
N ? this.hiddenInput = N : (this.hiddenInput = T("input", {
|
|
1958
1963
|
type: "hidden",
|
|
1959
|
-
name:
|
|
1960
|
-
}),
|
|
1964
|
+
name: R.phone
|
|
1965
|
+
}), w.appendChild(this.hiddenInput));
|
|
1961
1966
|
}
|
|
1962
|
-
if (
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1967
|
+
if (R.country) {
|
|
1968
|
+
const N = (G = this.telInput.form) == null ? void 0 : G.querySelector(`input[name="${R.country}"]`);
|
|
1969
|
+
N ? this.hiddenInputCountry = N : (this.hiddenInputCountry = T("input", {
|
|
1965
1970
|
type: "hidden",
|
|
1966
|
-
name:
|
|
1967
|
-
}),
|
|
1971
|
+
name: R.country
|
|
1972
|
+
}), w.appendChild(this.hiddenInputCountry));
|
|
1968
1973
|
}
|
|
1969
1974
|
}
|
|
1970
1975
|
}
|
|
1971
1976
|
//* For each country: add a country list item <li> to the countryList <ul> container.
|
|
1972
1977
|
_appendListItems() {
|
|
1973
1978
|
for (let e = 0; e < this.countries.length; e++) {
|
|
1974
|
-
const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o =
|
|
1979
|
+
const i = this.countries[e], n = e === 0 ? "iti__highlight" : "", o = T(
|
|
1975
1980
|
"li",
|
|
1976
1981
|
{
|
|
1977
1982
|
id: `iti-${this.id}__item-${i.iso2}`,
|
|
@@ -1993,12 +1998,12 @@ class p1 {
|
|
|
1993
1998
|
//* 1. Extracting a dial code from the given number
|
|
1994
1999
|
//* 2. Using explicit initialCountry
|
|
1995
2000
|
_setInitialState(e = !1) {
|
|
1996
|
-
const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n, f = this._getDialCode(l), h =
|
|
2001
|
+
const i = this.telInput.getAttribute("value"), n = this.telInput.value, l = i && i.charAt(0) === "+" && (!n || n.charAt(0) !== "+") ? i : n, f = this._getDialCode(l), h = l2(l), { initialCountry: C, geoIpLookup: I } = this.options, v = C === "auto" && I;
|
|
1997
2002
|
if (f && !h)
|
|
1998
2003
|
this._updateCountryFromNumber(l);
|
|
1999
2004
|
else if (!v || e) {
|
|
2000
|
-
const
|
|
2001
|
-
|
|
2005
|
+
const g = C ? C.toLowerCase() : "";
|
|
2006
|
+
g && this._getCountryData(g, !0) ? this._setCountry(g) : f && h ? this._setCountry("us") : this._setCountry();
|
|
2002
2007
|
}
|
|
2003
2008
|
l && this._updateValFromNumber(l);
|
|
2004
2009
|
}
|
|
@@ -2034,26 +2039,26 @@ class p1 {
|
|
|
2034
2039
|
//* Init many requests: utils script / geo ip lookup.
|
|
2035
2040
|
_initRequests() {
|
|
2036
2041
|
let { loadUtils: e, initialCountry: i, geoIpLookup: n } = this.options;
|
|
2037
|
-
e && !
|
|
2042
|
+
e && !m.utils ? (this._handlePageLoad = () => {
|
|
2038
2043
|
var l;
|
|
2039
|
-
window.removeEventListener("load", this._handlePageLoad), (l =
|
|
2044
|
+
window.removeEventListener("load", this._handlePageLoad), (l = m.attachUtils(e)) == null || l.catch(() => {
|
|
2040
2045
|
});
|
|
2041
|
-
},
|
|
2046
|
+
}, m.documentReady() ? this._handlePageLoad() : window.addEventListener("load", this._handlePageLoad)) : this.resolveUtilsScriptPromise(), i === "auto" && n && !this.selectedCountryData.iso2 ? this._loadAutoCountry() : this.resolveAutoCountryPromise();
|
|
2042
2047
|
}
|
|
2043
2048
|
//* Perform the geo ip lookup.
|
|
2044
2049
|
_loadAutoCountry() {
|
|
2045
|
-
|
|
2050
|
+
m.autoCountry ? this.handleAutoCountry() : m.startedLoadingAutoCountry || (m.startedLoadingAutoCountry = !0, typeof this.options.geoIpLookup == "function" && this.options.geoIpLookup(
|
|
2046
2051
|
(e = "") => {
|
|
2047
2052
|
const i = e.toLowerCase();
|
|
2048
|
-
i && this._getCountryData(i, !0) ? (
|
|
2053
|
+
i && this._getCountryData(i, !0) ? (m.autoCountry = i, setTimeout(() => i1("handleAutoCountry"))) : (this._setInitialState(!0), i1("rejectAutoCountryPromise"));
|
|
2049
2054
|
},
|
|
2050
2055
|
() => {
|
|
2051
|
-
this._setInitialState(!0),
|
|
2056
|
+
this._setInitialState(!0), i1("rejectAutoCountryPromise");
|
|
2052
2057
|
}
|
|
2053
2058
|
));
|
|
2054
2059
|
}
|
|
2055
2060
|
_openDropdownWithPlus() {
|
|
2056
|
-
this._openDropdown(), this.searchInput.value = "+", this._filterCountries(""
|
|
2061
|
+
this._openDropdown(), this.searchInput.value = "+", this._filterCountries("");
|
|
2057
2062
|
}
|
|
2058
2063
|
//* Initialize the tel input listeners.
|
|
2059
2064
|
_initTelInputListeners() {
|
|
@@ -2061,17 +2066,17 @@ class p1 {
|
|
|
2061
2066
|
let f = !1;
|
|
2062
2067
|
new RegExp("\\p{L}", "u").test(this.telInput.value) && (f = !0), this._handleInputEvent = (h) => {
|
|
2063
2068
|
if (this.isAndroid && (h == null ? void 0 : h.data) === "+" && n && o && l) {
|
|
2064
|
-
const
|
|
2065
|
-
this.telInput.value =
|
|
2069
|
+
const g = this.telInput.selectionStart || 0, w = this.telInput.value.substring(0, g - 1), S = this.telInput.value.substring(g);
|
|
2070
|
+
this.telInput.value = w + S, this._openDropdownWithPlus();
|
|
2066
2071
|
return;
|
|
2067
2072
|
}
|
|
2068
2073
|
this._updateCountryFromNumber(this.telInput.value) && this._triggerCountryChange();
|
|
2069
|
-
const
|
|
2070
|
-
|
|
2074
|
+
const C = (h == null ? void 0 : h.data) && /[^+0-9]/.test(h.data), I = (h == null ? void 0 : h.inputType) === "insertFromPaste" && this.telInput.value;
|
|
2075
|
+
C || I && !e ? f = !0 : /[^+0-9]/.test(this.telInput.value) || (f = !1);
|
|
2071
2076
|
const v = (h == null ? void 0 : h.detail) && h.detail.isSetNumber;
|
|
2072
2077
|
if (i && !f && !v) {
|
|
2073
|
-
const
|
|
2074
|
-
this.telInput.value =
|
|
2078
|
+
const g = this.telInput.selectionStart || 0, S = this.telInput.value.substring(0, g).replace(/[^+0-9]/g, "").length, A = (h == null ? void 0 : h.inputType) === "deleteContentForward", G = this._formatNumberAsYouType(), x = z2(S, G, g, A);
|
|
2079
|
+
this.telInput.value = G, this.telInput.setSelectionRange(x, x);
|
|
2075
2080
|
}
|
|
2076
2081
|
}, this.telInput.addEventListener("input", this._handleInputEvent), (e || n) && (this._handleKeydownEvent = (h) => {
|
|
2077
2082
|
if (h.key && h.key.length === 1 && !h.altKey && !h.ctrlKey && !h.metaKey) {
|
|
@@ -2080,11 +2085,25 @@ class p1 {
|
|
|
2080
2085
|
return;
|
|
2081
2086
|
}
|
|
2082
2087
|
if (e) {
|
|
2083
|
-
const
|
|
2084
|
-
(!
|
|
2088
|
+
const C = this.telInput.value, v = !(C.charAt(0) === "+") && this.telInput.selectionStart === 0 && h.key === "+", g = /^[0-9]$/.test(h.key), w = n ? g : v || g, S = C.slice(0, this.telInput.selectionStart) + h.key + C.slice(this.telInput.selectionEnd), A = this._getFullNumber(S), G = m.utils.getCoreNumber(A, this.selectedCountryData.iso2), x = this.maxCoreNumberLength && G.length > this.maxCoreNumberLength, N = this._getNewCountryFromNumber(A) !== null;
|
|
2089
|
+
(!w || x && !N && !v) && h.preventDefault();
|
|
2085
2090
|
}
|
|
2086
2091
|
}
|
|
2087
|
-
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent))
|
|
2092
|
+
}, this.telInput.addEventListener("keydown", this._handleKeydownEvent)), e && (this._handlePasteEvent = (h) => {
|
|
2093
|
+
h.preventDefault();
|
|
2094
|
+
const C = this.telInput, I = C.selectionStart, v = C.selectionEnd, g = h.clipboardData.getData("text"), w = I === 0 && v > 0, S = !C.value.startsWith("+") || w, A = g.replace(/[^0-9+]/g, ""), G = A.startsWith("+"), x = A.replace(/\+/g, ""), R = G && S ? `+${x}` : x;
|
|
2095
|
+
let N = C.value.slice(0, I) + R + C.value.slice(v);
|
|
2096
|
+
const W = m.utils.getCoreNumber(N, this.selectedCountryData.iso2);
|
|
2097
|
+
if (this.maxCoreNumberLength && W.length > this.maxCoreNumberLength)
|
|
2098
|
+
if (C.selectionEnd === C.value.length) {
|
|
2099
|
+
const C1 = W.length - this.maxCoreNumberLength;
|
|
2100
|
+
N = N.slice(0, N.length - C1);
|
|
2101
|
+
} else
|
|
2102
|
+
return;
|
|
2103
|
+
C.value = N;
|
|
2104
|
+
const n1 = I + R.length;
|
|
2105
|
+
C.setSelectionRange(n1, n1), C.dispatchEvent(new InputEvent("input", { bubbles: !0 }));
|
|
2106
|
+
}, this.telInput.addEventListener("paste", this._handlePasteEvent));
|
|
2088
2107
|
}
|
|
2089
2108
|
//* Adhere to the input's maxlength attr.
|
|
2090
2109
|
_cap(e) {
|
|
@@ -2145,7 +2164,7 @@ class p1 {
|
|
|
2145
2164
|
}, document.addEventListener("keydown", this._handleKeydownOnDropdown), this.options.countrySearch) {
|
|
2146
2165
|
const n = () => {
|
|
2147
2166
|
const l = this.searchInput.value.trim();
|
|
2148
|
-
|
|
2167
|
+
this._filterCountries(l), this.searchInput.value ? this.searchClearButton.classList.remove("iti__hide") : this.searchClearButton.classList.add("iti__hide");
|
|
2149
2168
|
};
|
|
2150
2169
|
let o = null;
|
|
2151
2170
|
this._handleSearchChange = () => {
|
|
@@ -2167,25 +2186,31 @@ class p1 {
|
|
|
2167
2186
|
}
|
|
2168
2187
|
}
|
|
2169
2188
|
//* Country search enabled: Filter the countries according to the search query.
|
|
2170
|
-
_filterCountries(e
|
|
2171
|
-
let
|
|
2189
|
+
_filterCountries(e) {
|
|
2190
|
+
let i = !0;
|
|
2172
2191
|
this.countryList.innerHTML = "";
|
|
2173
|
-
const
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2192
|
+
const n = u2(e);
|
|
2193
|
+
let o;
|
|
2194
|
+
if (e === "")
|
|
2195
|
+
o = this.countries;
|
|
2196
|
+
else {
|
|
2197
|
+
const l = [], f = [], h = [], C = [], I = [], v = [];
|
|
2198
|
+
for (const g of this.countries)
|
|
2199
|
+
g.iso2 === n ? l.push(g) : g.normalisedName.startsWith(n) ? f.push(g) : g.normalisedName.includes(n) ? h.push(g) : n === g.dialCode || n === g.dialCodePlus ? C.push(g) : g.dialCodePlus.includes(n) ? I.push(g) : g.initials.includes(n) && v.push(g);
|
|
2200
|
+
o = [
|
|
2201
|
+
...l.sort((g, w) => g.priority - w.priority),
|
|
2202
|
+
...f.sort((g, w) => g.priority - w.priority),
|
|
2203
|
+
...h.sort((g, w) => g.priority - w.priority),
|
|
2204
|
+
...C.sort((g, w) => g.priority - w.priority),
|
|
2205
|
+
...I.sort((g, w) => g.priority - w.priority),
|
|
2206
|
+
...v.sort((g, w) => g.priority - w.priority)
|
|
2207
|
+
];
|
|
2208
|
+
}
|
|
2209
|
+
for (const l of o) {
|
|
2210
|
+
const f = l.nodeById[this.id];
|
|
2211
|
+
f && (this.countryList.appendChild(f), i && (this._highlightListItem(f, !1), i = !1));
|
|
2187
2212
|
}
|
|
2188
|
-
|
|
2213
|
+
i ? (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();
|
|
2189
2214
|
}
|
|
2190
2215
|
//* Update search results text (for a11y).
|
|
2191
2216
|
_updateSearchResultsA11yText() {
|
|
@@ -2207,9 +2232,9 @@ class p1 {
|
|
|
2207
2232
|
//* NOTE: this is called from _setInitialState, handleUtils and setNumber.
|
|
2208
2233
|
_updateValFromNumber(e) {
|
|
2209
2234
|
let i = e;
|
|
2210
|
-
if (this.options.formatOnDisplay &&
|
|
2211
|
-
const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } =
|
|
2212
|
-
i =
|
|
2235
|
+
if (this.options.formatOnDisplay && m.utils && this.selectedCountryData) {
|
|
2236
|
+
const n = this.options.nationalMode || i.charAt(0) !== "+" && !this.options.separateDialCode, { NATIONAL: o, INTERNATIONAL: l } = m.utils.numberFormat, f = n ? o : l;
|
|
2237
|
+
i = m.utils.formatNumber(
|
|
2213
2238
|
i,
|
|
2214
2239
|
this.selectedCountryData.iso2,
|
|
2215
2240
|
f
|
|
@@ -2238,21 +2263,22 @@ class p1 {
|
|
|
2238
2263
|
let n = i ? e.substring(i) : e;
|
|
2239
2264
|
const o = this.selectedCountryData.iso2, l = this.selectedCountryData.dialCode;
|
|
2240
2265
|
n = this._ensureHasDialCode(n);
|
|
2241
|
-
const f = this._getDialCode(n, !0), h =
|
|
2266
|
+
const f = this._getDialCode(n, !0), h = p1(n);
|
|
2242
2267
|
if (f) {
|
|
2243
|
-
const
|
|
2244
|
-
if (
|
|
2268
|
+
const C = p1(f), I = this.dialCodeToIso2Map[C];
|
|
2269
|
+
if (I.length === 1)
|
|
2270
|
+
return I[0] === o ? null : I[0];
|
|
2271
|
+
if (!o && this.defaultCountry && I.includes(this.defaultCountry))
|
|
2245
2272
|
return this.defaultCountry;
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
}
|
|
2273
|
+
if (l === "1" && l2(h))
|
|
2274
|
+
return null;
|
|
2275
|
+
const g = this.selectedCountryData.areaCodes && h.length > C.length;
|
|
2276
|
+
if (!(o && I.includes(o) && !g))
|
|
2277
|
+
return I[0];
|
|
2252
2278
|
} else {
|
|
2253
2279
|
if (n.charAt(0) === "+" && h.length)
|
|
2254
2280
|
return "";
|
|
2255
|
-
if ((!n || n === "+") && !
|
|
2281
|
+
if ((!n || n === "+") && !o)
|
|
2256
2282
|
return this.defaultCountry;
|
|
2257
2283
|
}
|
|
2258
2284
|
return null;
|
|
@@ -2282,13 +2308,13 @@ class p1 {
|
|
|
2282
2308
|
const { separateDialCode: i, showFlags: n, i18n: o } = this.options, l = this.selectedCountryData.iso2 || "";
|
|
2283
2309
|
if (this.selectedCountryData = e ? this._getCountryData(e, !1) || {} : {}, this.selectedCountryData.iso2 && (this.defaultCountry = this.selectedCountryData.iso2), this.selectedCountry) {
|
|
2284
2310
|
const f = e && n ? `iti__flag iti__${e}` : "iti__flag iti__globe";
|
|
2285
|
-
let h,
|
|
2311
|
+
let h, C;
|
|
2286
2312
|
if (e) {
|
|
2287
|
-
const { name:
|
|
2288
|
-
|
|
2313
|
+
const { name: I, dialCode: v } = this.selectedCountryData;
|
|
2314
|
+
C = I, h = o.selectedCountryAriaLabel.replace("${countryName}", I).replace("${dialCode}", `+${v}`);
|
|
2289
2315
|
} else
|
|
2290
|
-
|
|
2291
|
-
this.selectedCountryInner.className = f, this.selectedCountry.setAttribute("title",
|
|
2316
|
+
C = o.noCountrySelected, h = o.noCountrySelected;
|
|
2317
|
+
this.selectedCountryInner.className = f, this.selectedCountry.setAttribute("title", C), this.selectedCountry.setAttribute("aria-label", h);
|
|
2292
2318
|
}
|
|
2293
2319
|
if (i) {
|
|
2294
2320
|
const f = this.selectedCountryData.dialCode ? `+${this.selectedCountryData.dialCode}` : "";
|
|
@@ -2306,19 +2332,19 @@ class p1 {
|
|
|
2306
2332
|
//* Update the maximum valid number length for the currently selected country.
|
|
2307
2333
|
_updateMaxLength() {
|
|
2308
2334
|
const { strictMode: e, placeholderNumberType: i, validationNumberTypes: n } = this.options, { iso2: o } = this.selectedCountryData;
|
|
2309
|
-
if (e &&
|
|
2335
|
+
if (e && m.utils)
|
|
2310
2336
|
if (o) {
|
|
2311
|
-
const l =
|
|
2312
|
-
let f =
|
|
2337
|
+
const l = m.utils.numberType[i];
|
|
2338
|
+
let f = m.utils.getExampleNumber(
|
|
2313
2339
|
o,
|
|
2314
2340
|
!1,
|
|
2315
2341
|
l,
|
|
2316
2342
|
!0
|
|
2317
2343
|
), h = f;
|
|
2318
|
-
for (;
|
|
2344
|
+
for (; m.utils.isPossibleNumber(f, o, n); )
|
|
2319
2345
|
h = f, f += "0";
|
|
2320
|
-
const
|
|
2321
|
-
this.maxCoreNumberLength =
|
|
2346
|
+
const C = m.utils.getCoreNumber(h, o);
|
|
2347
|
+
this.maxCoreNumberLength = C.length, o === "by" && (this.maxCoreNumberLength = C.length + 1);
|
|
2322
2348
|
} else
|
|
2323
2349
|
this.maxCoreNumberLength = null;
|
|
2324
2350
|
}
|
|
@@ -2353,9 +2379,9 @@ class p1 {
|
|
|
2353
2379
|
nationalMode: n,
|
|
2354
2380
|
customPlaceholder: o
|
|
2355
2381
|
} = this.options, l = e === "aggressive" || !this.hadInitialPlaceholder && e === "polite";
|
|
2356
|
-
if (
|
|
2357
|
-
const f =
|
|
2358
|
-
let h = this.selectedCountryData.iso2 ?
|
|
2382
|
+
if (m.utils && l) {
|
|
2383
|
+
const f = m.utils.numberType[i];
|
|
2384
|
+
let h = this.selectedCountryData.iso2 ? m.utils.getExampleNumber(
|
|
2359
2385
|
this.selectedCountryData.iso2,
|
|
2360
2386
|
n,
|
|
2361
2387
|
f
|
|
@@ -2382,12 +2408,12 @@ class p1 {
|
|
|
2382
2408
|
}
|
|
2383
2409
|
//* Check if an element is visible within it's container, else scroll until it is.
|
|
2384
2410
|
_scrollTo(e) {
|
|
2385
|
-
const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n, f = l + o, h = e.offsetHeight,
|
|
2386
|
-
if (
|
|
2411
|
+
const i = this.countryList, n = document.documentElement.scrollTop, o = i.offsetHeight, l = i.getBoundingClientRect().top + n, f = l + o, h = e.offsetHeight, C = e.getBoundingClientRect().top + n, I = C + h, v = C - l + i.scrollTop;
|
|
2412
|
+
if (C < l)
|
|
2387
2413
|
i.scrollTop = v;
|
|
2388
|
-
else if (
|
|
2389
|
-
const
|
|
2390
|
-
i.scrollTop = v -
|
|
2414
|
+
else if (I > f) {
|
|
2415
|
+
const g = o - h;
|
|
2416
|
+
i.scrollTop = v - g;
|
|
2391
2417
|
}
|
|
2392
2418
|
}
|
|
2393
2419
|
//* Replace any existing dial code with the new one
|
|
@@ -2426,7 +2452,7 @@ class p1 {
|
|
|
2426
2452
|
_getFullNumber(e) {
|
|
2427
2453
|
const i = e || this.telInput.value.trim(), { dialCode: n } = this.selectedCountryData;
|
|
2428
2454
|
let o;
|
|
2429
|
-
const l =
|
|
2455
|
+
const l = p1(i);
|
|
2430
2456
|
return this.options.separateDialCode && i.charAt(0) !== "+" && n && l ? o = `+${n}` : o = "", o + i;
|
|
2431
2457
|
}
|
|
2432
2458
|
//* Remove the dial code if separateDialCode is enabled also cap the length if the input has a maxlength attribute
|
|
@@ -2448,7 +2474,7 @@ class p1 {
|
|
|
2448
2474
|
}
|
|
2449
2475
|
//* Format the number as the user types.
|
|
2450
2476
|
_formatNumberAsYouType() {
|
|
2451
|
-
const e = this._getFullNumber(), i =
|
|
2477
|
+
const e = this._getFullNumber(), i = m.utils ? m.utils.formatNumberAsYouType(e, this.selectedCountryData.iso2) : e, { dialCode: n } = this.selectedCountryData;
|
|
2452
2478
|
return this.options.separateDialCode && this.telInput.value.charAt(0) !== "+" && i.includes(`+${n}`) ? (i.split(`+${n}`)[1] || "").trim() : i;
|
|
2453
2479
|
}
|
|
2454
2480
|
//**************************
|
|
@@ -2456,11 +2482,11 @@ class p1 {
|
|
|
2456
2482
|
//**************************
|
|
2457
2483
|
//* This is called when the geoip call returns.
|
|
2458
2484
|
handleAutoCountry() {
|
|
2459
|
-
this.options.initialCountry === "auto" &&
|
|
2485
|
+
this.options.initialCountry === "auto" && m.autoCountry && (this.defaultCountry = m.autoCountry, this.selectedCountryData.iso2 || this.selectedCountryInner.classList.contains("iti__globe") || this.setCountry(this.defaultCountry), this.resolveAutoCountryPromise());
|
|
2460
2486
|
}
|
|
2461
2487
|
//* This is called when the utils request completes.
|
|
2462
2488
|
handleUtils() {
|
|
2463
|
-
|
|
2489
|
+
m.utils && (this.telInput.value && this._updateValFromNumber(this.telInput.value), this.selectedCountryData.iso2 && (this._updatePlaceholder(), this._updateMaxLength())), this.resolveUtilsScriptPromise();
|
|
2464
2490
|
}
|
|
2465
2491
|
//********************
|
|
2466
2492
|
//* PUBLIC METHODS
|
|
@@ -2482,22 +2508,22 @@ class p1 {
|
|
|
2482
2508
|
h && h.removeEventListener("click", this._handleLabelClick);
|
|
2483
2509
|
}
|
|
2484
2510
|
const { form: n } = this.telInput;
|
|
2485
|
-
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);
|
|
2511
|
+
this._handleHiddenInputSubmit && n && n.removeEventListener("submit", this._handleHiddenInputSubmit), this.telInput.removeEventListener("input", this._handleInputEvent), this._handleKeydownEvent && this.telInput.removeEventListener("keydown", this._handleKeydownEvent), this._handlePasteEvent && this.telInput.removeEventListener("paste", this._handlePasteEvent), this.telInput.removeAttribute("data-intl-tel-input-id"), i && (this.isRTL ? this.telInput.style.paddingRight = this.originalPaddingRight : this.telInput.style.paddingLeft = this.originalPaddingLeft);
|
|
2486
2512
|
const o = this.telInput.parentNode;
|
|
2487
|
-
(l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (f = o == null ? void 0 : o.parentNode) == null || f.removeChild(o), delete
|
|
2513
|
+
(l = o == null ? void 0 : o.parentNode) == null || l.insertBefore(this.telInput, o), (f = o == null ? void 0 : o.parentNode) == null || f.removeChild(o), delete m.instances[this.id];
|
|
2488
2514
|
}
|
|
2489
2515
|
//* Get the extension from the current number.
|
|
2490
2516
|
getExtension() {
|
|
2491
|
-
return
|
|
2517
|
+
return m.utils ? m.utils.getExtension(
|
|
2492
2518
|
this._getFullNumber(),
|
|
2493
2519
|
this.selectedCountryData.iso2
|
|
2494
2520
|
) : "";
|
|
2495
2521
|
}
|
|
2496
2522
|
//* Format the number to the given format.
|
|
2497
2523
|
getNumber(e) {
|
|
2498
|
-
if (
|
|
2524
|
+
if (m.utils) {
|
|
2499
2525
|
const { iso2: i } = this.selectedCountryData;
|
|
2500
|
-
return
|
|
2526
|
+
return m.utils.formatNumber(
|
|
2501
2527
|
this._getFullNumber(),
|
|
2502
2528
|
i,
|
|
2503
2529
|
e
|
|
@@ -2507,7 +2533,7 @@ class p1 {
|
|
|
2507
2533
|
}
|
|
2508
2534
|
//* Get the type of the entered number e.g. landline/mobile.
|
|
2509
2535
|
getNumberType() {
|
|
2510
|
-
return
|
|
2536
|
+
return m.utils ? m.utils.getNumberType(
|
|
2511
2537
|
this._getFullNumber(),
|
|
2512
2538
|
this.selectedCountryData.iso2
|
|
2513
2539
|
) : -99;
|
|
@@ -2518,9 +2544,9 @@ class p1 {
|
|
|
2518
2544
|
}
|
|
2519
2545
|
//* Get the validation error.
|
|
2520
2546
|
getValidationError() {
|
|
2521
|
-
if (
|
|
2547
|
+
if (m.utils) {
|
|
2522
2548
|
const { iso2: e } = this.selectedCountryData;
|
|
2523
|
-
return
|
|
2549
|
+
return m.utils.getValidationError(this._getFullNumber(), e);
|
|
2524
2550
|
}
|
|
2525
2551
|
return -99;
|
|
2526
2552
|
}
|
|
@@ -2533,7 +2559,7 @@ class p1 {
|
|
|
2533
2559
|
return this._validateNumber(!0);
|
|
2534
2560
|
}
|
|
2535
2561
|
_utilsIsPossibleNumber(e) {
|
|
2536
|
-
return
|
|
2562
|
+
return m.utils ? m.utils.isPossibleNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2537
2563
|
}
|
|
2538
2564
|
//* Shared internal validation logic to handle alpha character extension rules.
|
|
2539
2565
|
_validateNumber(e) {
|
|
@@ -2541,13 +2567,13 @@ class p1 {
|
|
|
2541
2567
|
return !1;
|
|
2542
2568
|
const i = (f) => e ? this._utilsIsValidNumber(f) : this._utilsIsPossibleNumber(f), n = this._getFullNumber(), o = n.search(new RegExp("\\p{L}", "u"));
|
|
2543
2569
|
if (o > -1 && !this.options.allowPhonewords) {
|
|
2544
|
-
const f = n.substring(0, o), h = i(f),
|
|
2545
|
-
return h &&
|
|
2570
|
+
const f = n.substring(0, o), h = i(f), C = i(n);
|
|
2571
|
+
return h && C;
|
|
2546
2572
|
}
|
|
2547
2573
|
return i(n);
|
|
2548
2574
|
}
|
|
2549
2575
|
_utilsIsValidNumber(e) {
|
|
2550
|
-
return
|
|
2576
|
+
return m.utils ? m.utils.isValidNumber(e, this.selectedCountryData.iso2, this.options.validationNumberTypes) : null;
|
|
2551
2577
|
}
|
|
2552
2578
|
//* Update the selected country, and update the input val accordingly.
|
|
2553
2579
|
setCountry(e) {
|
|
@@ -2567,56 +2593,56 @@ class p1 {
|
|
|
2567
2593
|
this.telInput.disabled = e, e ? this.selectedCountry.setAttribute("disabled", "true") : this.selectedCountry.removeAttribute("disabled");
|
|
2568
2594
|
}
|
|
2569
2595
|
}
|
|
2570
|
-
const Z2 = (
|
|
2571
|
-
if (!
|
|
2596
|
+
const Z2 = (y) => {
|
|
2597
|
+
if (!m.utils && !m.startedLoadingUtilsScript) {
|
|
2572
2598
|
let e;
|
|
2573
|
-
if (typeof
|
|
2599
|
+
if (typeof y == "function")
|
|
2574
2600
|
try {
|
|
2575
|
-
e = Promise.resolve(
|
|
2601
|
+
e = Promise.resolve(y());
|
|
2576
2602
|
} catch (i) {
|
|
2577
2603
|
return Promise.reject(i);
|
|
2578
2604
|
}
|
|
2579
2605
|
else
|
|
2580
|
-
return Promise.reject(new TypeError(`The argument passed to attachUtils must be a function that returns a promise for the utilities module, not ${typeof
|
|
2581
|
-
return
|
|
2606
|
+
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}`));
|
|
2607
|
+
return m.startedLoadingUtilsScript = !0, e.then((i) => {
|
|
2582
2608
|
const n = i == null ? void 0 : i.default;
|
|
2583
2609
|
if (!n || typeof n != "object")
|
|
2584
2610
|
throw new TypeError("The loader function passed to attachUtils did not resolve to a module object with utils as its default export.");
|
|
2585
|
-
return
|
|
2611
|
+
return m.utils = n, i1("handleUtils"), !0;
|
|
2586
2612
|
}).catch((i) => {
|
|
2587
|
-
throw
|
|
2613
|
+
throw i1("rejectUtilsScriptPromise", i), i;
|
|
2588
2614
|
});
|
|
2589
2615
|
}
|
|
2590
2616
|
return null;
|
|
2591
|
-
},
|
|
2592
|
-
(
|
|
2593
|
-
const i = new
|
|
2594
|
-
return i._init(),
|
|
2617
|
+
}, m = Object.assign(
|
|
2618
|
+
(y, e) => {
|
|
2619
|
+
const i = new g1(y, e);
|
|
2620
|
+
return i._init(), y.setAttribute("data-intl-tel-input-id", i.id.toString()), m.instances[i.id] = i, y.iti = i, i;
|
|
2595
2621
|
},
|
|
2596
2622
|
{
|
|
2597
|
-
defaults:
|
|
2623
|
+
defaults: c2,
|
|
2598
2624
|
//* Using a static var like this allows us to mock it in the tests.
|
|
2599
2625
|
documentReady: () => document.readyState === "complete",
|
|
2600
2626
|
//* Get the country data object.
|
|
2601
|
-
getCountryData: () =>
|
|
2627
|
+
getCountryData: () => q,
|
|
2602
2628
|
//* A getter for the plugin instance.
|
|
2603
|
-
getInstance: (
|
|
2604
|
-
const e =
|
|
2605
|
-
return e ?
|
|
2629
|
+
getInstance: (y) => {
|
|
2630
|
+
const e = y.getAttribute("data-intl-tel-input-id");
|
|
2631
|
+
return e ? m.instances[e] : null;
|
|
2606
2632
|
},
|
|
2607
2633
|
//* A map from instance ID to instance object.
|
|
2608
2634
|
instances: {},
|
|
2609
2635
|
attachUtils: Z2,
|
|
2610
2636
|
startedLoadingUtilsScript: !1,
|
|
2611
2637
|
startedLoadingAutoCountry: !1,
|
|
2612
|
-
version: "25.10.
|
|
2638
|
+
version: "25.10.7"
|
|
2613
2639
|
}
|
|
2614
2640
|
);
|
|
2615
2641
|
(function() {
|
|
2616
|
-
var
|
|
2642
|
+
var y = this || self;
|
|
2617
2643
|
function e(d, t) {
|
|
2618
2644
|
d = d.split(".");
|
|
2619
|
-
var $ =
|
|
2645
|
+
var $ = y;
|
|
2620
2646
|
d[0] in $ || typeof $.execScript > "u" || $.execScript("var " + d[0]);
|
|
2621
2647
|
for (var s; d.length && (s = d.shift()); ) d.length || t === void 0 ? $[s] && $[s] !== Object.prototype[s] ? $ = $[s] : $ = $[s] = {} : $[s] = t;
|
|
2622
2648
|
}
|
|
@@ -2654,20 +2680,20 @@ const Z2 = (m) => {
|
|
|
2654
2680
|
}
|
|
2655
2681
|
}
|
|
2656
2682
|
new h();
|
|
2657
|
-
const
|
|
2658
|
-
class
|
|
2683
|
+
const C = {};
|
|
2684
|
+
class I {
|
|
2659
2685
|
constructor() {
|
|
2660
|
-
if (
|
|
2686
|
+
if (C !== C) throw Error("SafeStyleSheet is not meant to be built directly");
|
|
2661
2687
|
}
|
|
2662
2688
|
toString() {
|
|
2663
2689
|
return "";
|
|
2664
2690
|
}
|
|
2665
2691
|
}
|
|
2666
|
-
new
|
|
2692
|
+
new I();
|
|
2667
2693
|
const v = {};
|
|
2668
|
-
class
|
|
2694
|
+
class g {
|
|
2669
2695
|
constructor() {
|
|
2670
|
-
var t =
|
|
2696
|
+
var t = y.trustedTypes && y.trustedTypes.emptyHTML || "";
|
|
2671
2697
|
if (v !== v) throw Error("SafeHtml is not meant to be built directly");
|
|
2672
2698
|
this.g = t;
|
|
2673
2699
|
}
|
|
@@ -2675,65 +2701,65 @@ const Z2 = (m) => {
|
|
|
2675
2701
|
return this.g.toString();
|
|
2676
2702
|
}
|
|
2677
2703
|
}
|
|
2678
|
-
new
|
|
2679
|
-
function
|
|
2704
|
+
new g();
|
|
2705
|
+
function w(d, t) {
|
|
2680
2706
|
switch (this.g = d, this.l = !!t.aa, this.h = t.i, this.s = t.type, this.o = !1, this.h) {
|
|
2681
|
-
case O:
|
|
2682
2707
|
case G:
|
|
2683
|
-
case
|
|
2684
|
-
case
|
|
2685
|
-
case
|
|
2686
|
-
case
|
|
2687
|
-
case
|
|
2708
|
+
case x:
|
|
2709
|
+
case R:
|
|
2710
|
+
case N:
|
|
2711
|
+
case W:
|
|
2712
|
+
case A:
|
|
2713
|
+
case S:
|
|
2688
2714
|
this.o = !0;
|
|
2689
2715
|
}
|
|
2690
2716
|
this.j = t.defaultValue;
|
|
2691
2717
|
}
|
|
2692
|
-
var
|
|
2693
|
-
function
|
|
2718
|
+
var S = 1, A = 2, G = 3, x = 4, R = 6, N = 16, W = 18;
|
|
2719
|
+
function n1(d, t) {
|
|
2694
2720
|
for (this.h = d, this.g = {}, d = 0; d < t.length; d++) {
|
|
2695
2721
|
var $ = t[d];
|
|
2696
2722
|
this.g[$.g] = $;
|
|
2697
2723
|
}
|
|
2698
2724
|
}
|
|
2699
|
-
function
|
|
2725
|
+
function C1(d) {
|
|
2700
2726
|
return d = n(d.g), d.sort(function(t, $) {
|
|
2701
2727
|
return t.g - $.g;
|
|
2702
2728
|
}), d;
|
|
2703
2729
|
}
|
|
2704
|
-
function
|
|
2730
|
+
function B() {
|
|
2705
2731
|
this.h = {}, this.j = this.m().g, this.g = this.l = null;
|
|
2706
2732
|
}
|
|
2707
|
-
|
|
2708
|
-
return
|
|
2709
|
-
},
|
|
2710
|
-
return
|
|
2711
|
-
},
|
|
2712
|
-
|
|
2713
|
-
},
|
|
2714
|
-
|
|
2733
|
+
B.prototype.has = function(d) {
|
|
2734
|
+
return k(this, d.g);
|
|
2735
|
+
}, B.prototype.get = function(d, t) {
|
|
2736
|
+
return p(this, d.g, t);
|
|
2737
|
+
}, B.prototype.set = function(d, t) {
|
|
2738
|
+
M(this, d.g, t);
|
|
2739
|
+
}, B.prototype.add = function(d, t) {
|
|
2740
|
+
N1(this, d.g, t);
|
|
2715
2741
|
};
|
|
2716
|
-
function
|
|
2717
|
-
for (var $ =
|
|
2742
|
+
function L1(d, t) {
|
|
2743
|
+
for (var $ = C1(d.m()), s = 0; s < $.length; s++) {
|
|
2718
2744
|
var r = $[s], a = r.g;
|
|
2719
|
-
if (
|
|
2745
|
+
if (k(t, a)) {
|
|
2720
2746
|
d.g && delete d.g[r.g];
|
|
2721
2747
|
var u = r.h == 11 || r.h == 10;
|
|
2722
2748
|
if (r.l) {
|
|
2723
2749
|
r = P(t, a);
|
|
2724
|
-
for (var c = 0; c < r.length; c++)
|
|
2725
|
-
} else r =
|
|
2750
|
+
for (var c = 0; c < r.length; c++) N1(d, a, u ? r[c].clone() : r[c]);
|
|
2751
|
+
} else r = s1(t, a), u ? (u = s1(d, a)) ? L1(u, r) : M(d, a, r.clone()) : M(d, a, r);
|
|
2726
2752
|
}
|
|
2727
2753
|
}
|
|
2728
2754
|
}
|
|
2729
|
-
|
|
2755
|
+
B.prototype.clone = function() {
|
|
2730
2756
|
var d = new this.constructor();
|
|
2731
|
-
return d != this && (d.h = {}, d.g && (d.g = {}),
|
|
2757
|
+
return d != this && (d.h = {}, d.g && (d.g = {}), L1(d, this)), d;
|
|
2732
2758
|
};
|
|
2733
|
-
function
|
|
2759
|
+
function k(d, t) {
|
|
2734
2760
|
return d.h[t] != null;
|
|
2735
2761
|
}
|
|
2736
|
-
function
|
|
2762
|
+
function s1(d, t) {
|
|
2737
2763
|
var $ = d.h[t];
|
|
2738
2764
|
if ($ == null) return null;
|
|
2739
2765
|
if (d.l) {
|
|
@@ -2749,12 +2775,12 @@ const Z2 = (m) => {
|
|
|
2749
2775
|
}
|
|
2750
2776
|
return $;
|
|
2751
2777
|
}
|
|
2752
|
-
function
|
|
2753
|
-
var s =
|
|
2778
|
+
function p(d, t, $) {
|
|
2779
|
+
var s = s1(d, t);
|
|
2754
2780
|
return d.j[t].l ? s[$ || 0] : s;
|
|
2755
2781
|
}
|
|
2756
|
-
function
|
|
2757
|
-
if (
|
|
2782
|
+
function b(d, t) {
|
|
2783
|
+
if (k(d, t)) d = p(d, t);
|
|
2758
2784
|
else d: {
|
|
2759
2785
|
if (d = d.j[t], d.j === void 0) if (t = d.s, t === Boolean) d.j = !1;
|
|
2760
2786
|
else if (t === Number) d.j = 0;
|
|
@@ -2768,87 +2794,87 @@ const Z2 = (m) => {
|
|
|
2768
2794
|
return d;
|
|
2769
2795
|
}
|
|
2770
2796
|
function P(d, t) {
|
|
2771
|
-
return
|
|
2797
|
+
return s1(d, t) || [];
|
|
2772
2798
|
}
|
|
2773
2799
|
function K(d, t) {
|
|
2774
|
-
return d.j[t].l ?
|
|
2800
|
+
return d.j[t].l ? k(d, t) ? d.h[t].length : 0 : k(d, t) ? 1 : 0;
|
|
2775
2801
|
}
|
|
2776
|
-
function
|
|
2802
|
+
function M(d, t, $) {
|
|
2777
2803
|
d.h[t] = $, d.g && (d.g[t] = $);
|
|
2778
2804
|
}
|
|
2779
|
-
function
|
|
2805
|
+
function N1(d, t, $) {
|
|
2780
2806
|
d.h[t] || (d.h[t] = []), d.h[t].push($), d.g && delete d.g[t];
|
|
2781
2807
|
}
|
|
2782
|
-
function
|
|
2808
|
+
function r1(d, t) {
|
|
2783
2809
|
var $ = [], s;
|
|
2784
|
-
for (s in t) s != 0 && $.push(new
|
|
2785
|
-
return new
|
|
2810
|
+
for (s in t) s != 0 && $.push(new w(s, t[s]));
|
|
2811
|
+
return new n1(d, $);
|
|
2786
2812
|
}
|
|
2787
|
-
function
|
|
2813
|
+
function o1() {
|
|
2788
2814
|
}
|
|
2789
|
-
|
|
2815
|
+
o1.prototype.g = function(d) {
|
|
2790
2816
|
throw new d.h(), Error("Unimplemented");
|
|
2791
|
-
},
|
|
2792
|
-
if (d.h == 11 || d.h == 10) return t instanceof
|
|
2793
|
-
if (d.h == 14) return typeof t == "string" &&
|
|
2817
|
+
}, o1.prototype.h = function(d, t) {
|
|
2818
|
+
if (d.h == 11 || d.h == 10) return t instanceof B ? t : this.g(d.s.prototype.m(), t);
|
|
2819
|
+
if (d.h == 14) return typeof t == "string" && T1.test(t) && (d = Number(t), 0 < d) ? d : t;
|
|
2794
2820
|
if (!d.o) return t;
|
|
2795
2821
|
if (d = d.s, d === String) {
|
|
2796
2822
|
if (typeof t == "number") return String(t);
|
|
2797
|
-
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" ||
|
|
2823
|
+
} else if (d === Number && typeof t == "string" && (t === "Infinity" || t === "-Infinity" || t === "NaN" || T1.test(t))) return Number(t);
|
|
2798
2824
|
return t;
|
|
2799
2825
|
};
|
|
2800
|
-
var
|
|
2801
|
-
function
|
|
2826
|
+
var T1 = /^-?[0-9]+$/;
|
|
2827
|
+
function m1() {
|
|
2802
2828
|
}
|
|
2803
|
-
i(
|
|
2829
|
+
i(m1, o1), m1.prototype.g = function(d, t) {
|
|
2804
2830
|
return d = new d.h(), d.l = this, d.h = t, d.g = {}, d;
|
|
2805
2831
|
};
|
|
2806
|
-
function
|
|
2832
|
+
function X() {
|
|
2807
2833
|
}
|
|
2808
|
-
i(
|
|
2809
|
-
return d.h == 8 ? !!t :
|
|
2810
|
-
},
|
|
2811
|
-
return
|
|
2834
|
+
i(X, m1), X.prototype.h = function(d, t) {
|
|
2835
|
+
return d.h == 8 ? !!t : o1.prototype.h.apply(this, arguments);
|
|
2836
|
+
}, X.prototype.g = function(d, t) {
|
|
2837
|
+
return X.ma.g.call(this, d, t);
|
|
2812
2838
|
};
|
|
2813
|
-
function
|
|
2839
|
+
function E(d, t) {
|
|
2814
2840
|
d != null && this.g.apply(this, arguments);
|
|
2815
2841
|
}
|
|
2816
|
-
|
|
2842
|
+
E.prototype.h = "", E.prototype.set = function(d) {
|
|
2817
2843
|
this.h = "" + d;
|
|
2818
|
-
},
|
|
2844
|
+
}, E.prototype.g = function(d, t, $) {
|
|
2819
2845
|
if (this.h += String(d), t != null) for (let s = 1; s < arguments.length; s++) this.h += arguments[s];
|
|
2820
2846
|
return this;
|
|
2821
2847
|
};
|
|
2822
|
-
function
|
|
2848
|
+
function O(d) {
|
|
2823
2849
|
d.h = "";
|
|
2824
2850
|
}
|
|
2825
|
-
|
|
2851
|
+
E.prototype.toString = function() {
|
|
2826
2852
|
return this.h;
|
|
2827
2853
|
};
|
|
2828
|
-
function
|
|
2829
|
-
|
|
2854
|
+
function z() {
|
|
2855
|
+
B.call(this);
|
|
2830
2856
|
}
|
|
2831
|
-
i(
|
|
2832
|
-
var
|
|
2857
|
+
i(z, B);
|
|
2858
|
+
var A1 = null;
|
|
2833
2859
|
function L() {
|
|
2834
|
-
|
|
2860
|
+
B.call(this);
|
|
2835
2861
|
}
|
|
2836
|
-
i(L,
|
|
2837
|
-
var
|
|
2838
|
-
function
|
|
2839
|
-
|
|
2840
|
-
}
|
|
2841
|
-
i(
|
|
2842
|
-
var
|
|
2843
|
-
|
|
2844
|
-
var d = N1;
|
|
2845
|
-
return d || (N1 = d = s1(W, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
|
|
2846
|
-
}, W.m = W.prototype.m, L.prototype.m = function() {
|
|
2862
|
+
i(L, B);
|
|
2863
|
+
var E1 = null;
|
|
2864
|
+
function Z() {
|
|
2865
|
+
B.call(this);
|
|
2866
|
+
}
|
|
2867
|
+
i(Z, B);
|
|
2868
|
+
var M1 = null;
|
|
2869
|
+
z.prototype.m = function() {
|
|
2847
2870
|
var d = A1;
|
|
2848
|
-
return d || (A1 = d =
|
|
2849
|
-
},
|
|
2850
|
-
var d =
|
|
2851
|
-
return d || (
|
|
2871
|
+
return d || (A1 = d = r1(z, { 0: { name: "NumberFormat", ia: "i18n.phonenumbers.NumberFormat" }, 1: { name: "pattern", required: !0, i: 9, type: String }, 2: { name: "format", required: !0, i: 9, type: String }, 3: { name: "leading_digits_pattern", aa: !0, i: 9, type: String }, 4: { name: "national_prefix_formatting_rule", i: 9, type: String }, 6: { name: "national_prefix_optional_when_formatting", i: 8, defaultValue: !1, type: Boolean }, 5: { name: "domestic_carrier_code_formatting_rule", i: 9, type: String } })), d;
|
|
2872
|
+
}, z.m = z.prototype.m, L.prototype.m = function() {
|
|
2873
|
+
var d = E1;
|
|
2874
|
+
return d || (E1 = d = r1(L, { 0: { name: "PhoneNumberDesc", ia: "i18n.phonenumbers.PhoneNumberDesc" }, 2: { name: "national_number_pattern", i: 9, type: String }, 9: { name: "possible_length", aa: !0, i: 5, type: Number }, 10: { name: "possible_length_local_only", aa: !0, i: 5, type: Number }, 6: { name: "example_number", i: 9, type: String } })), d;
|
|
2875
|
+
}, L.m = L.prototype.m, Z.prototype.m = function() {
|
|
2876
|
+
var d = M1;
|
|
2877
|
+
return d || (M1 = d = r1(Z, {
|
|
2852
2878
|
0: { name: "PhoneMetadata", ia: "i18n.phonenumbers.PhoneMetadata" },
|
|
2853
2879
|
1: { name: "general_desc", i: 11, type: L },
|
|
2854
2880
|
2: { name: "fixed_line", i: 11, type: L },
|
|
@@ -2880,26 +2906,26 @@ const Z2 = (m) => {
|
|
|
2880
2906
|
},
|
|
2881
2907
|
16: { name: "national_prefix_transform_rule", i: 9, type: String },
|
|
2882
2908
|
18: { name: "same_mobile_and_fixed_line_pattern", i: 8, defaultValue: !1, type: Boolean },
|
|
2883
|
-
19: { name: "number_format", aa: !0, i: 11, type:
|
|
2884
|
-
20: { name: "intl_number_format", aa: !0, i: 11, type:
|
|
2909
|
+
19: { name: "number_format", aa: !0, i: 11, type: z },
|
|
2910
|
+
20: { name: "intl_number_format", aa: !0, i: 11, type: z },
|
|
2885
2911
|
22: { name: "main_country_for_code", i: 8, defaultValue: !1, type: Boolean },
|
|
2886
2912
|
23: { name: "leading_digits", i: 9, type: String }
|
|
2887
2913
|
})), d;
|
|
2888
|
-
},
|
|
2914
|
+
}, Z.m = Z.prototype.m;
|
|
2889
2915
|
function H() {
|
|
2890
|
-
|
|
2916
|
+
B.call(this);
|
|
2891
2917
|
}
|
|
2892
|
-
i(H,
|
|
2893
|
-
var
|
|
2918
|
+
i(H, B);
|
|
2919
|
+
var D1 = null, p2 = { ra: 0, qa: 1, pa: 5, oa: 10, na: 20 };
|
|
2894
2920
|
H.prototype.m = function() {
|
|
2895
|
-
var d =
|
|
2896
|
-
return d || (
|
|
2921
|
+
var d = D1;
|
|
2922
|
+
return d || (D1 = d = r1(H, { 0: { name: "PhoneNumber", ia: "i18n.phonenumbers.PhoneNumber" }, 1: { name: "country_code", required: !0, i: 5, type: Number }, 2: { name: "national_number", required: !0, i: 4, type: Number }, 3: { name: "extension", i: 9, type: String }, 4: { name: "italian_leading_zero", i: 8, type: Boolean }, 8: { name: "number_of_leading_zeros", i: 5, defaultValue: 1, type: Number }, 5: { name: "raw_input", i: 9, type: String }, 6: { name: "country_code_source", i: 14, defaultValue: 0, type: p2 }, 7: {
|
|
2897
2923
|
name: "preferred_domestic_carrier_code",
|
|
2898
2924
|
i: 9,
|
|
2899
2925
|
type: String
|
|
2900
2926
|
} })), d;
|
|
2901
2927
|
}, H.ctor = H, H.ctor.m = H.prototype.m;
|
|
2902
|
-
var
|
|
2928
|
+
var Q = {
|
|
2903
2929
|
1: "US AG AI AS BB BM BS CA DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI".split(" "),
|
|
2904
2930
|
7: ["RU", "KZ"],
|
|
2905
2931
|
20: ["EG"],
|
|
@@ -3115,7 +3141,7 @@ const Z2 = (m) => {
|
|
|
3115
3141
|
995: ["GE"],
|
|
3116
3142
|
996: ["KG"],
|
|
3117
3143
|
998: ["UZ"]
|
|
3118
|
-
},
|
|
3144
|
+
}, P1 = {
|
|
3119
3145
|
AC: [, [
|
|
3120
3146
|
,
|
|
3121
3147
|
,
|
|
@@ -8220,13 +8246,13 @@ const Z2 = (m) => {
|
|
|
8220
8246
|
], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 888, , , , , , , , 1, [[, "(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , "\\d{11}", , , , "12345678901"], , , [, , , , , , , , , [-1]]],
|
|
8221
8247
|
979: [, [, , "[1359]\\d{8}", , , , , , , [9], [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , "[1359]\\d{8}", , , , "123456789", , , , [8]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], "001", 979, , , , , , , , 1, [[, "(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], , [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]], [, , , , , , , , , [-1]], , , [, , , , , , , , , [-1]]]
|
|
8222
8248
|
};
|
|
8223
|
-
function
|
|
8249
|
+
function D() {
|
|
8224
8250
|
this.g = {};
|
|
8225
8251
|
}
|
|
8226
|
-
|
|
8227
|
-
return
|
|
8252
|
+
D.h = void 0, D.g = function() {
|
|
8253
|
+
return D.h ? D.h : D.h = new D();
|
|
8228
8254
|
};
|
|
8229
|
-
var
|
|
8255
|
+
var y1 = { 0: "0", 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8", 9: "9", "0": "0", "1": "1", "2": "2", "3": "3", "4": "4", "5": "5", "6": "6", "7": "7", "8": "8", "9": "9", "٠": "0", "١": "1", "٢": "2", "٣": "3", "٤": "4", "٥": "5", "٦": "6", "٧": "7", "٨": "8", "٩": "9", "۰": "0", "۱": "1", "۲": "2", "۳": "3", "۴": "4", "۵": "5", "۶": "6", "۷": "7", "۸": "8", "۹": "9" }, g2 = {
|
|
8230
8256
|
0: "0",
|
|
8231
8257
|
1: "1",
|
|
8232
8258
|
2: "2",
|
|
@@ -8307,74 +8333,74 @@ const Z2 = (m) => {
|
|
|
8307
8333
|
X: "9",
|
|
8308
8334
|
Y: "9",
|
|
8309
8335
|
Z: "9"
|
|
8310
|
-
}, m2 = RegExp("[++]+"),
|
|
8311
|
-
function
|
|
8336
|
+
}, m2 = RegExp("[++]+"), d1 = RegExp("^[++]+"), x1 = RegExp("([0-90-9٠-٩۰-۹])"), y2 = RegExp("[++0-90-9٠-٩۰-۹]"), _2 = /[\\\/] *x/, I2 = RegExp("[^0-90-9٠-٩۰-۹A-Za-z#]+$"), v2 = /(?:.*?[A-Za-z]){3}.*/, w2 = RegExp("^\\+([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*[0-90-9٠-٩۰-۹]([0-90-9٠-٩۰-۹]|[\\-\\.\\(\\)]?)*$"), S2 = RegExp("^([A-Za-z0-90-9٠-٩۰-۹]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.)*[A-Za-z]+((\\-)*[A-Za-z0-90-9٠-٩۰-۹])*\\.?$");
|
|
8337
|
+
function J(d) {
|
|
8312
8338
|
return "([0-90-9٠-٩۰-۹]{1," + d + "})";
|
|
8313
8339
|
}
|
|
8314
|
-
function
|
|
8315
|
-
return ";ext=" +
|
|
8340
|
+
function R1() {
|
|
8341
|
+
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") + "#?");
|
|
8316
8342
|
}
|
|
8317
|
-
var
|
|
8318
|
-
function
|
|
8343
|
+
var B1 = new RegExp("(?:" + R1() + ")$", "i"), b2 = new RegExp("^[0-90-9٠-٩۰-۹]{2}$|^[++]*(?:[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*]*[0-90-9٠-٩۰-۹]){3,}[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~*A-Za-z0-90-9٠-٩۰-۹]*(?:" + R1() + ")?$", "i"), L2 = /(\$\d)/, N2 = /^\(?\$1\)?$/;
|
|
8344
|
+
function k1(d) {
|
|
8319
8345
|
return 2 > d.length ? !1 : U(b2, d);
|
|
8320
8346
|
}
|
|
8321
|
-
function
|
|
8322
|
-
return U(v2, d) ?
|
|
8347
|
+
function O1(d) {
|
|
8348
|
+
return U(v2, d) ? a1(d, C2) : a1(d, y1);
|
|
8323
8349
|
}
|
|
8324
|
-
function
|
|
8325
|
-
var t =
|
|
8326
|
-
|
|
8350
|
+
function G1(d) {
|
|
8351
|
+
var t = O1(d.toString());
|
|
8352
|
+
O(d), d.g(t);
|
|
8327
8353
|
}
|
|
8328
|
-
function
|
|
8354
|
+
function F1(d) {
|
|
8329
8355
|
return d != null && (K(d, 9) != 1 || P(d, 9)[0] != -1);
|
|
8330
8356
|
}
|
|
8331
|
-
function
|
|
8332
|
-
for (var $ = new
|
|
8357
|
+
function a1(d, t) {
|
|
8358
|
+
for (var $ = new E(), s, r = d.length, a = 0; a < r; ++a) s = d.charAt(a), s = t[s.toUpperCase()], s != null && $.g(s);
|
|
8333
8359
|
return $.toString();
|
|
8334
8360
|
}
|
|
8335
|
-
function
|
|
8361
|
+
function U1(d) {
|
|
8336
8362
|
return d.length == 0 || N2.test(d);
|
|
8337
8363
|
}
|
|
8338
|
-
function
|
|
8339
|
-
return d != null && isNaN(d) && d.toUpperCase() in
|
|
8364
|
+
function u1(d) {
|
|
8365
|
+
return d != null && isNaN(d) && d.toUpperCase() in P1;
|
|
8340
8366
|
}
|
|
8341
|
-
|
|
8342
|
-
if (
|
|
8343
|
-
var $ =
|
|
8367
|
+
D.prototype.format = function(d, t) {
|
|
8368
|
+
if (p(d, 2) == 0 && k(d, 5)) {
|
|
8369
|
+
var $ = b(d, 5);
|
|
8344
8370
|
if (0 < $.length) return $;
|
|
8345
8371
|
}
|
|
8346
|
-
$ =
|
|
8347
|
-
var s =
|
|
8348
|
-
if (t == 0) return
|
|
8349
|
-
if (!($ in
|
|
8350
|
-
var r =
|
|
8351
|
-
d =
|
|
8372
|
+
$ = b(d, 1);
|
|
8373
|
+
var s = e1(d);
|
|
8374
|
+
if (t == 0) return V1($, 0, s, "");
|
|
8375
|
+
if (!($ in Q)) return s;
|
|
8376
|
+
var r = t1(this, $, $1($));
|
|
8377
|
+
d = k(d, 3) && p(d, 3).length != 0 ? t == 3 ? ";ext=" + p(d, 3) : k(r, 13) ? p(r, 13) + b(d, 3) : " ext. " + b(d, 3) : "";
|
|
8352
8378
|
d: {
|
|
8353
8379
|
r = P(r, 20).length == 0 || t == 2 ? P(r, 19) : P(r, 20);
|
|
8354
8380
|
for (var a, u = r.length, c = 0; c < u; ++c) {
|
|
8355
8381
|
a = r[c];
|
|
8356
|
-
var
|
|
8357
|
-
if ((
|
|
8382
|
+
var _ = K(a, 3);
|
|
8383
|
+
if ((_ == 0 || s.search(p(a, 3, _ - 1)) == 0) && (_ = new RegExp(p(a, 1)), U(_, s))) {
|
|
8358
8384
|
r = a;
|
|
8359
8385
|
break d;
|
|
8360
8386
|
}
|
|
8361
8387
|
}
|
|
8362
8388
|
r = null;
|
|
8363
8389
|
}
|
|
8364
|
-
return r != null && (u = r, r =
|
|
8390
|
+
return r != null && (u = r, r = b(u, 2), a = new RegExp(p(u, 1)), b(
|
|
8365
8391
|
u,
|
|
8366
8392
|
5
|
|
8367
|
-
), u =
|
|
8393
|
+
), u = b(u, 4), s = t == 2 && u != null && 0 < u.length ? s.replace(a, r.replace(L2, u)) : s.replace(a, r), t == 3 && (s = s.replace(RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+"), ""), s = s.replace(RegExp("[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]+", "g"), "-"))), V1($, t, s, d);
|
|
8368
8394
|
};
|
|
8369
|
-
function
|
|
8395
|
+
function t1(d, t, $) {
|
|
8370
8396
|
return $ == "001" ? j(d, "" + t) : j(d, $);
|
|
8371
8397
|
}
|
|
8372
|
-
function
|
|
8373
|
-
if (!
|
|
8374
|
-
var t = "" +
|
|
8375
|
-
return
|
|
8398
|
+
function e1(d) {
|
|
8399
|
+
if (!k(d, 2)) return "";
|
|
8400
|
+
var t = "" + p(d, 2);
|
|
8401
|
+
return k(d, 4) && p(d, 4) && 0 < b(d, 8) ? Array(b(d, 8) + 1).join("0") + t : t;
|
|
8376
8402
|
}
|
|
8377
|
-
function
|
|
8403
|
+
function V1(d, t, $, s) {
|
|
8378
8404
|
switch (t) {
|
|
8379
8405
|
case 0:
|
|
8380
8406
|
return "+" + d + $ + s;
|
|
@@ -8386,74 +8412,74 @@ const Z2 = (m) => {
|
|
|
8386
8412
|
return $ + s;
|
|
8387
8413
|
}
|
|
8388
8414
|
}
|
|
8389
|
-
function
|
|
8415
|
+
function l1(d, t) {
|
|
8390
8416
|
switch (t) {
|
|
8391
8417
|
case 4:
|
|
8392
|
-
return
|
|
8418
|
+
return p(d, 5);
|
|
8393
8419
|
case 3:
|
|
8394
|
-
return
|
|
8420
|
+
return p(d, 4);
|
|
8395
8421
|
case 1:
|
|
8396
|
-
return
|
|
8422
|
+
return p(d, 3);
|
|
8397
8423
|
case 0:
|
|
8398
8424
|
case 2:
|
|
8399
|
-
return
|
|
8425
|
+
return p(d, 2);
|
|
8400
8426
|
case 5:
|
|
8401
|
-
return
|
|
8427
|
+
return p(d, 6);
|
|
8402
8428
|
case 6:
|
|
8403
|
-
return
|
|
8429
|
+
return p(d, 8);
|
|
8404
8430
|
case 7:
|
|
8405
|
-
return
|
|
8431
|
+
return p(d, 7);
|
|
8406
8432
|
case 8:
|
|
8407
|
-
return
|
|
8433
|
+
return p(d, 21);
|
|
8408
8434
|
case 9:
|
|
8409
|
-
return
|
|
8435
|
+
return p(d, 25);
|
|
8410
8436
|
case 10:
|
|
8411
|
-
return
|
|
8437
|
+
return p(d, 28);
|
|
8412
8438
|
default:
|
|
8413
|
-
return
|
|
8439
|
+
return p(d, 1);
|
|
8414
8440
|
}
|
|
8415
8441
|
}
|
|
8416
|
-
function
|
|
8417
|
-
var $ =
|
|
8418
|
-
return d =
|
|
8442
|
+
function K1(d, t) {
|
|
8443
|
+
var $ = H1(d, t);
|
|
8444
|
+
return d = t1(d, b(t, 1), $), d == null ? -1 : (t = e1(t), _1(t, d));
|
|
8419
8445
|
}
|
|
8420
|
-
function
|
|
8421
|
-
return
|
|
8446
|
+
function _1(d, t) {
|
|
8447
|
+
return F(d, p(t, 1)) ? F(d, p(t, 5)) ? 4 : F(d, p(t, 4)) ? 3 : F(d, p(t, 6)) ? 5 : F(d, p(t, 8)) ? 6 : F(d, p(t, 7)) ? 7 : F(d, p(t, 21)) ? 8 : F(d, p(t, 25)) ? 9 : F(d, p(t, 28)) ? 10 : F(d, p(t, 2)) ? p(t, 18) || F(d, p(t, 3)) ? 2 : 0 : !p(t, 18) && F(d, p(t, 3)) ? 1 : -1 : -1;
|
|
8422
8448
|
}
|
|
8423
8449
|
function j(d, t) {
|
|
8424
8450
|
if (t == null) return null;
|
|
8425
8451
|
t = t.toUpperCase();
|
|
8426
8452
|
var $ = d.g[t];
|
|
8427
8453
|
if ($ == null) {
|
|
8428
|
-
if ($ =
|
|
8429
|
-
$ = new
|
|
8454
|
+
if ($ = P1[t], $ == null) return null;
|
|
8455
|
+
$ = new X().g(Z.m(), $), d.g[t] = $;
|
|
8430
8456
|
}
|
|
8431
8457
|
return $;
|
|
8432
8458
|
}
|
|
8433
|
-
function
|
|
8459
|
+
function F(d, t) {
|
|
8434
8460
|
var $ = d.length;
|
|
8435
|
-
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(
|
|
8461
|
+
return 0 < K(t, 9) && P(t, 9).indexOf($) == -1 ? !1 : U(b(t, 2), d);
|
|
8436
8462
|
}
|
|
8437
|
-
function
|
|
8438
|
-
var $ =
|
|
8439
|
-
return r == null || $ != "001" && s !=
|
|
8463
|
+
function T2(d, t) {
|
|
8464
|
+
var $ = H1(d, t), s = b(t, 1), r = t1(d, s, $);
|
|
8465
|
+
return r == null || $ != "001" && s != j1(d, $) ? r = !1 : (d = e1(t), r = _1(d, r) != -1), r;
|
|
8440
8466
|
}
|
|
8441
|
-
function
|
|
8467
|
+
function H1(d, t) {
|
|
8442
8468
|
if (t == null) return null;
|
|
8443
|
-
var $ =
|
|
8444
|
-
if ($ =
|
|
8469
|
+
var $ = b(t, 1);
|
|
8470
|
+
if ($ = Q[$], $ == null) d = null;
|
|
8445
8471
|
else if ($.length == 1) d = $[0];
|
|
8446
8472
|
else d: {
|
|
8447
|
-
t =
|
|
8473
|
+
t = e1(t);
|
|
8448
8474
|
for (var s, r = $.length, a = 0; a < r; a++) {
|
|
8449
8475
|
s = $[a];
|
|
8450
8476
|
var u = j(d, s);
|
|
8451
|
-
if (
|
|
8452
|
-
if (t.search(
|
|
8477
|
+
if (k(u, 23)) {
|
|
8478
|
+
if (t.search(p(u, 23)) == 0) {
|
|
8453
8479
|
d = s;
|
|
8454
8480
|
break d;
|
|
8455
8481
|
}
|
|
8456
|
-
} else if (
|
|
8482
|
+
} else if (_1(t, u) != -1) {
|
|
8457
8483
|
d = s;
|
|
8458
8484
|
break d;
|
|
8459
8485
|
}
|
|
@@ -8462,70 +8488,70 @@ const Z2 = (m) => {
|
|
|
8462
8488
|
}
|
|
8463
8489
|
return d;
|
|
8464
8490
|
}
|
|
8465
|
-
function
|
|
8466
|
-
return d =
|
|
8491
|
+
function $1(d) {
|
|
8492
|
+
return d = Q[d], d == null ? "ZZ" : d[0];
|
|
8467
8493
|
}
|
|
8468
|
-
function
|
|
8494
|
+
function j1(d, t) {
|
|
8469
8495
|
if (d = j(d, t), d == null) throw Error("Invalid region code: " + t);
|
|
8470
|
-
return
|
|
8496
|
+
return b(d, 10);
|
|
8471
8497
|
}
|
|
8472
|
-
function
|
|
8473
|
-
var r =
|
|
8474
|
-
if (r = P(r, 10), s == 2) if (
|
|
8475
|
-
else return
|
|
8498
|
+
function h1(d, t, $, s) {
|
|
8499
|
+
var r = l1($, s), a = K(r, 9) == 0 ? P(p($, 1), 9) : P(r, 9);
|
|
8500
|
+
if (r = P(r, 10), s == 2) if (F1(l1($, 0))) d = l1($, 1), F1(d) && (a = a.concat(K(d, 9) == 0 ? P(p($, 1), 9) : P(d, 9)), a.sort(), r.length == 0 ? r = P(d, 10) : (r = r.concat(P(d, 10)), r.sort()));
|
|
8501
|
+
else return h1(d, t, $, 1);
|
|
8476
8502
|
return a[0] == -1 ? 5 : (t = t.length, -1 < r.indexOf(t) ? 4 : ($ = a[0], $ == t ? 0 : $ > t ? 2 : a[a.length - 1] < t ? 3 : -1 < a.indexOf(t, 1) ? 0 : 5));
|
|
8477
8503
|
}
|
|
8478
|
-
function
|
|
8479
|
-
var s =
|
|
8480
|
-
return t =
|
|
8504
|
+
function c1(d, t, $) {
|
|
8505
|
+
var s = e1(t);
|
|
8506
|
+
return t = b(t, 1), t in Q ? (t = t1(d, t, $1(t)), h1(d, s, t, $)) : 1;
|
|
8481
8507
|
}
|
|
8482
|
-
function
|
|
8508
|
+
function W1(d, t) {
|
|
8483
8509
|
if (d = d.toString(), d.length == 0 || d.charAt(0) == "0") return 0;
|
|
8484
|
-
for (var $, s = d.length, r = 1; 3 >= r && r <= s; ++r) if ($ = parseInt(d.substring(0, r), 10), $ in
|
|
8510
|
+
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)), $;
|
|
8485
8511
|
return 0;
|
|
8486
8512
|
}
|
|
8487
|
-
function
|
|
8513
|
+
function z1(d, t, $, s, r, a) {
|
|
8488
8514
|
if (t.length == 0) return 0;
|
|
8489
|
-
t = new
|
|
8515
|
+
t = new E(t);
|
|
8490
8516
|
var u;
|
|
8491
|
-
$ != null && (u =
|
|
8517
|
+
$ != null && (u = p($, 11)), u == null && (u = "NonMatch");
|
|
8492
8518
|
var c = t.toString();
|
|
8493
8519
|
if (c.length == 0) u = 20;
|
|
8494
|
-
else if (
|
|
8520
|
+
else if (d1.test(c)) c = c.replace(d1, ""), O(t), t.g(O1(c)), u = 1;
|
|
8495
8521
|
else {
|
|
8496
|
-
if (c = new RegExp(u),
|
|
8522
|
+
if (c = new RegExp(u), G1(t), u = t.toString(), u.search(c) == 0) {
|
|
8497
8523
|
c = u.match(c)[0].length;
|
|
8498
|
-
var
|
|
8499
|
-
|
|
8524
|
+
var _ = u.substring(c).match(x1);
|
|
8525
|
+
_ && _[1] != null && 0 < _[1].length && a1(_[1], y1) == "0" ? u = !1 : (O(t), t.g(u.substring(c)), u = !0);
|
|
8500
8526
|
} else u = !1;
|
|
8501
8527
|
u = u ? 5 : 20;
|
|
8502
8528
|
}
|
|
8503
|
-
if (r &&
|
|
8529
|
+
if (r && M(a, 6, u), u != 20) {
|
|
8504
8530
|
if (2 >= t.h.length) throw Error("Phone number too short after IDD");
|
|
8505
|
-
if (d =
|
|
8531
|
+
if (d = W1(t, s), d != 0) return M(a, 1, d), d;
|
|
8506
8532
|
throw Error("Invalid country calling code");
|
|
8507
8533
|
}
|
|
8508
|
-
return $ != null && (u =
|
|
8534
|
+
return $ != null && (u = b($, 10), c = "" + u, _ = t.toString(), _.lastIndexOf(c, 0) == 0 && (c = new E(_.substring(c.length)), _ = p($, 1), _ = new RegExp(b(_, 2)), Z1(c, $, null), c = c.toString(), !U(_, t.toString()) && U(_, c) || h1(d, t.toString(), $, -1) == 3)) ? (s.g(c), r && M(a, 6, 10), M(a, 1, u), u) : (M(a, 1, 0), 0);
|
|
8509
8535
|
}
|
|
8510
|
-
function
|
|
8511
|
-
var s = d.toString(), r = s.length, a =
|
|
8536
|
+
function Z1(d, t, $) {
|
|
8537
|
+
var s = d.toString(), r = s.length, a = p(t, 15);
|
|
8512
8538
|
if (r != 0 && a != null && a.length != 0) {
|
|
8513
8539
|
var u = new RegExp("^(?:" + a + ")");
|
|
8514
8540
|
if (r = u.exec(s)) {
|
|
8515
|
-
a = new RegExp(
|
|
8516
|
-
var c = U(a, s),
|
|
8517
|
-
t =
|
|
8541
|
+
a = new RegExp(b(p(t, 1), 2));
|
|
8542
|
+
var c = U(a, s), _ = r.length - 1;
|
|
8543
|
+
t = p(t, 16), t == null || t.length == 0 || r[_] == null || r[_].length == 0 ? (!c || U(a, s.substring(r[0].length))) && ($ != null && 0 < _ && r[_] != null && $.g(r[1]), d.set(s.substring(r[0].length))) : (s = s.replace(u, t), (!c || U(a, s)) && ($ != null && 0 < _ && $.g(r[1]), d.set(s)));
|
|
8518
8544
|
}
|
|
8519
8545
|
}
|
|
8520
8546
|
}
|
|
8521
|
-
function
|
|
8522
|
-
if (!
|
|
8523
|
-
return
|
|
8547
|
+
function Y(d, t, $) {
|
|
8548
|
+
if (!u1($) && 0 < t.length && t.charAt(0) != "+") throw Error("Invalid country calling code");
|
|
8549
|
+
return Y1(d, t, $, !0);
|
|
8524
8550
|
}
|
|
8525
|
-
function
|
|
8551
|
+
function Y1(d, t, $, s) {
|
|
8526
8552
|
if (t == null) throw Error("The string supplied did not seem to be a phone number");
|
|
8527
8553
|
if (250 < t.length) throw Error("The string supplied is too long to be a phone number");
|
|
8528
|
-
var r = new
|
|
8554
|
+
var r = new E(), a = t.indexOf(";phone-context=");
|
|
8529
8555
|
if (a === -1) a = null;
|
|
8530
8556
|
else if (a += 15, a >= t.length) a = "";
|
|
8531
8557
|
else {
|
|
@@ -8533,80 +8559,80 @@ const Z2 = (m) => {
|
|
|
8533
8559
|
a = u !== -1 ? t.substring(a, u) : t.substring(a);
|
|
8534
8560
|
}
|
|
8535
8561
|
var c = a;
|
|
8536
|
-
if (c == null ? u = !0 : c.length === 0 ? u = !1 : (u = w2.exec(c), c = S2.exec(c), u = u !== null || c !== null), !u || (a != null ? (a.charAt(0) === "+" && r.g(a), a = t.indexOf("tel:"), r.g(t.substring(0 <= a ? a + 4 : 0, t.indexOf(";phone-context=")))) : (a = r.g, u = t ?? "", c = u.search(y2), 0 <= c ? (u = u.substring(c), u = u.replace(I2, ""), c = u.search(_2), 0 <= c && (u = u.substring(0, c))) : u = "", a.call(r, u)), a = r.toString(), u = a.indexOf(";isub="), 0 < u && (
|
|
8537
|
-
if (a = r.toString(), !(
|
|
8538
|
-
a = new H(), s &&
|
|
8562
|
+
if (c == null ? u = !0 : c.length === 0 ? u = !1 : (u = w2.exec(c), c = S2.exec(c), u = u !== null || c !== null), !u || (a != null ? (a.charAt(0) === "+" && r.g(a), a = t.indexOf("tel:"), r.g(t.substring(0 <= a ? a + 4 : 0, t.indexOf(";phone-context=")))) : (a = r.g, u = t ?? "", c = u.search(y2), 0 <= c ? (u = u.substring(c), u = u.replace(I2, ""), c = u.search(_2), 0 <= c && (u = u.substring(0, c))) : u = "", a.call(r, u)), a = r.toString(), u = a.indexOf(";isub="), 0 < u && (O(r), r.g(a.substring(0, u))), !k1(r.toString()))) throw Error("The string supplied did not seem to be a phone number");
|
|
8563
|
+
if (a = r.toString(), !(u1($) || a != null && 0 < a.length && d1.test(a))) throw Error("Invalid country calling code");
|
|
8564
|
+
a = new H(), s && M(a, 5, t);
|
|
8539
8565
|
d: {
|
|
8540
|
-
if (t = r.toString(), u = t.search(
|
|
8541
|
-
c = t.match(
|
|
8542
|
-
for (var
|
|
8543
|
-
|
|
8566
|
+
if (t = r.toString(), u = t.search(B1), 0 <= u && k1(t.substring(0, u))) {
|
|
8567
|
+
c = t.match(B1);
|
|
8568
|
+
for (var _ = c.length, V = 1; V < _; ++V) if (c[V] != null && 0 < c[V].length) {
|
|
8569
|
+
O(r), r.g(t.substring(0, u)), t = c[V];
|
|
8544
8570
|
break d;
|
|
8545
8571
|
}
|
|
8546
8572
|
}
|
|
8547
8573
|
t = "";
|
|
8548
8574
|
}
|
|
8549
|
-
0 < t.length &&
|
|
8575
|
+
0 < t.length && M(a, 3, t), u = j(d, $), t = new E(), c = 0, _ = r.toString();
|
|
8550
8576
|
try {
|
|
8551
|
-
c =
|
|
8552
|
-
} catch (
|
|
8553
|
-
if (
|
|
8554
|
-
if (
|
|
8555
|
-
} else throw
|
|
8577
|
+
c = z1(d, _, u, t, s, a);
|
|
8578
|
+
} catch (w1) {
|
|
8579
|
+
if (w1.message == "Invalid country calling code" && d1.test(_)) {
|
|
8580
|
+
if (_ = _.replace(d1, ""), c = z1(d, _, u, t, s, a), c == 0) throw w1;
|
|
8581
|
+
} else throw w1;
|
|
8556
8582
|
}
|
|
8557
|
-
if (c != 0 ? (r =
|
|
8583
|
+
if (c != 0 ? (r = $1(c), r != $ && (u = t1(d, c, r))) : (G1(r), t.g(r.toString()), $ != null ? (c = b(u, 10), M(
|
|
8558
8584
|
a,
|
|
8559
8585
|
1,
|
|
8560
8586
|
c
|
|
8561
|
-
)) : s && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (u != null && ($ = new
|
|
8587
|
+
)) : s && (delete a.h[6], a.g && delete a.g[6])), 2 > t.h.length || (u != null && ($ = new E(), r = new E(t.toString()), Z1(r, u, $), d = h1(d, r.toString(), u, -1), d != 2 && d != 4 && d != 5 && (t = r, s && 0 < $.toString().length && M(a, 7, $.toString()))), s = t.toString(), d = s.length, 2 > d)) throw Error("The string supplied is too short to be a phone number");
|
|
8562
8588
|
if (17 < d) throw Error("The string supplied is too long to be a phone number");
|
|
8563
8589
|
if (1 < s.length && s.charAt(0) == "0") {
|
|
8564
|
-
for (
|
|
8565
|
-
d != 1 &&
|
|
8590
|
+
for (M(a, 4, !0), d = 1; d < s.length - 1 && s.charAt(d) == "0"; ) d++;
|
|
8591
|
+
d != 1 && M(a, 8, d);
|
|
8566
8592
|
}
|
|
8567
|
-
return
|
|
8593
|
+
return M(a, 2, parseInt(s, 10)), a;
|
|
8568
8594
|
}
|
|
8569
8595
|
function U(d, t) {
|
|
8570
8596
|
return !!((d = t.match(new RegExp("^(?:" + (typeof d == "string" ? d : d.source) + ")$", "i"))) && d[0].length == t.length);
|
|
8571
8597
|
}
|
|
8572
|
-
function
|
|
8573
|
-
this.fa = RegExp(" "), this.ja = "", this.v = new
|
|
8598
|
+
function A2(d) {
|
|
8599
|
+
this.fa = RegExp(" "), this.ja = "", this.v = new E(), this.da = "", this.s = new E(), this.ba = new E(), this.u = !0, this.ea = this.ca = this.la = !1, this.ga = D.g(), this.$ = 0, this.h = new E(), this.ha = !1, this.o = "", this.g = new E(), this.j = [], this.ka = d, this.l = X1(this, this.ka);
|
|
8574
8600
|
}
|
|
8575
|
-
var
|
|
8576
|
-
|
|
8577
|
-
var E2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"),
|
|
8578
|
-
function
|
|
8601
|
+
var J1 = new Z();
|
|
8602
|
+
M(J1, 11, "NA");
|
|
8603
|
+
var E2 = RegExp("^[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*\\$1[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*(\\$\\d[-x‐-―−ー--/ ()()[].\\[\\]/~⁓∼~]*)*$"), q1 = /[- ]/;
|
|
8604
|
+
function X1(d, t) {
|
|
8579
8605
|
var $ = d.ga;
|
|
8580
|
-
return t =
|
|
8606
|
+
return t = u1(t) ? j1($, t) : 0, d = j(d.ga, $1(t)), d ?? J1;
|
|
8581
8607
|
}
|
|
8582
|
-
function
|
|
8608
|
+
function Q1(d) {
|
|
8583
8609
|
for (var t = d.j.length, $ = 0; $ < t; ++$) {
|
|
8584
|
-
var s = d.j[$], r =
|
|
8610
|
+
var s = d.j[$], r = b(s, 1);
|
|
8585
8611
|
if (d.da == r) return !1;
|
|
8586
|
-
var a = d, u = s, c =
|
|
8587
|
-
|
|
8588
|
-
var
|
|
8589
|
-
u =
|
|
8612
|
+
var a = d, u = s, c = b(u, 1);
|
|
8613
|
+
O(a.v);
|
|
8614
|
+
var _ = a;
|
|
8615
|
+
u = b(u, 2);
|
|
8590
8616
|
var V = "999999999999999".match(c)[0];
|
|
8591
|
-
if (V.length <
|
|
8617
|
+
if (V.length < _.g.h.length ? _ = "" : (_ = V.replace(new RegExp(c, "g"), u), _ = _.replace(RegExp("9", "g"), " ")), 0 < _.length ? (a.v.g(_), a = !0) : a = !1, a) return d.da = r, d.ha = q1.test(p(s, 4)), d.$ = 0, !0;
|
|
8592
8618
|
}
|
|
8593
8619
|
return d.u = !1;
|
|
8594
8620
|
}
|
|
8595
|
-
function
|
|
8621
|
+
function d2(d, t) {
|
|
8596
8622
|
for (var $ = [], s = t.length - 3, r = d.j.length, a = 0; a < r; ++a) {
|
|
8597
8623
|
var u = d.j[a];
|
|
8598
|
-
K(u, 3) == 0 ? $.push(d.j[a]) : (u =
|
|
8624
|
+
K(u, 3) == 0 ? $.push(d.j[a]) : (u = p(u, 3, Math.min(s, K(u, 3) - 1)), t.search(u) == 0 && $.push(d.j[a]));
|
|
8599
8625
|
}
|
|
8600
8626
|
d.j = $;
|
|
8601
8627
|
}
|
|
8602
8628
|
function M2(d, t) {
|
|
8603
8629
|
d.s.g(t);
|
|
8604
8630
|
var $ = t;
|
|
8605
|
-
if (
|
|
8631
|
+
if (x1.test($) || d.s.h.length == 1 && m2.test($) ? (t == "+" ? ($ = t, d.ba.g(t)) : ($ = y1[t], d.ba.g($), d.g.g($)), t = $) : (d.u = !1, d.la = !0), !d.u) {
|
|
8606
8632
|
if (!d.la) {
|
|
8607
|
-
if (
|
|
8608
|
-
if (
|
|
8609
|
-
} else if (0 < d.o.length && (t = d.g.toString(),
|
|
8633
|
+
if (n2(d)) {
|
|
8634
|
+
if (s2(d)) return t2(d);
|
|
8635
|
+
} else if (0 < d.o.length && (t = d.g.toString(), O(d.g), d.g.g(d.o), d.g.g(t), t = d.h.toString(), $ = t.lastIndexOf(d.o), O(d.h), d.h.g(t.substring(0, $))), d.o != i2(d)) return d.h.g(" "), t2(d);
|
|
8610
8636
|
}
|
|
8611
8637
|
return d.s.toString();
|
|
8612
8638
|
}
|
|
@@ -8616,75 +8642,75 @@ const Z2 = (m) => {
|
|
|
8616
8642
|
case 2:
|
|
8617
8643
|
return d.s.toString();
|
|
8618
8644
|
case 3:
|
|
8619
|
-
if (
|
|
8620
|
-
else return d.o =
|
|
8645
|
+
if (n2(d)) d.ea = !0;
|
|
8646
|
+
else return d.o = i2(d), I1(d);
|
|
8621
8647
|
default:
|
|
8622
|
-
return d.ea ? (
|
|
8648
|
+
return d.ea ? (s2(d) && (d.ea = !1), d.h.toString() + d.g.toString()) : 0 < d.j.length ? (t = r2(d, t), $ = e2(d), 0 < $.length ? $ : (d2(d, d.g.toString()), Q1(d) ? $2(d) : d.u ? f1(d, t) : d.s.toString())) : I1(d);
|
|
8623
8649
|
}
|
|
8624
8650
|
}
|
|
8625
|
-
function
|
|
8626
|
-
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0,
|
|
8651
|
+
function t2(d) {
|
|
8652
|
+
return d.u = !0, d.ea = !1, d.j = [], d.$ = 0, O(d.v), d.da = "", I1(d);
|
|
8627
8653
|
}
|
|
8628
|
-
function
|
|
8654
|
+
function e2(d) {
|
|
8629
8655
|
for (var t = d.g.toString(), $ = d.j.length, s = 0; s < $; ++s) {
|
|
8630
|
-
var r = d.j[s], a =
|
|
8631
|
-
if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha =
|
|
8656
|
+
var r = d.j[s], a = b(r, 1);
|
|
8657
|
+
if (new RegExp("^(?:" + a + ")$").test(t) && (d.ha = q1.test(p(r, 4)), r = t.replace(new RegExp(a, "g"), p(r, 2)), r = f1(d, r), a1(r, g2) == d.ba)) return r;
|
|
8632
8658
|
}
|
|
8633
8659
|
return "";
|
|
8634
8660
|
}
|
|
8635
|
-
function
|
|
8661
|
+
function f1(d, t) {
|
|
8636
8662
|
var $ = d.h.h.length;
|
|
8637
8663
|
return d.ha && 0 < $ && d.h.toString().charAt($ - 1) != " " ? d.h + " " + t : d.h + t;
|
|
8638
8664
|
}
|
|
8639
|
-
function
|
|
8665
|
+
function I1(d) {
|
|
8640
8666
|
var t = d.g.toString();
|
|
8641
8667
|
if (3 <= t.length) {
|
|
8642
8668
|
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) {
|
|
8643
8669
|
var a = $[r];
|
|
8644
|
-
0 < d.o.length &&
|
|
8670
|
+
0 < d.o.length && U1(b(a, 4)) && !p(a, 6) && !k(a, 5) || (d.o.length != 0 || d.ca || U1(b(a, 4)) || p(a, 6)) && E2.test(b(a, 2)) && d.j.push(a);
|
|
8645
8671
|
}
|
|
8646
|
-
return
|
|
8672
|
+
return d2(d, t), t = e2(d), 0 < t.length ? t : Q1(d) ? $2(d) : d.s.toString();
|
|
8647
8673
|
}
|
|
8648
|
-
return
|
|
8674
|
+
return f1(d, t);
|
|
8649
8675
|
}
|
|
8650
|
-
function
|
|
8676
|
+
function $2(d) {
|
|
8651
8677
|
var t = d.g.toString(), $ = t.length;
|
|
8652
8678
|
if (0 < $) {
|
|
8653
|
-
for (var s = "", r = 0; r < $; r++) s =
|
|
8654
|
-
return d.u ?
|
|
8679
|
+
for (var s = "", r = 0; r < $; r++) s = r2(d, t.charAt(r));
|
|
8680
|
+
return d.u ? f1(d, s) : d.s.toString();
|
|
8655
8681
|
}
|
|
8656
8682
|
return d.h.toString();
|
|
8657
8683
|
}
|
|
8658
|
-
function
|
|
8684
|
+
function i2(d) {
|
|
8659
8685
|
var t = d.g.toString(), $ = 0;
|
|
8660
|
-
if (
|
|
8686
|
+
if (p(d.l, 10) != 1) var s = !1;
|
|
8661
8687
|
else s = d.g.toString(), s = s.charAt(0) == "1" && s.charAt(1) != "0" && s.charAt(1) != "1";
|
|
8662
|
-
return s ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) :
|
|
8688
|
+
return s ? ($ = 1, d.h.g("1").g(" "), d.ca = !0) : k(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, $)))), O(d.g), d.g.g(t.substring($)), t.substring(0, $);
|
|
8663
8689
|
}
|
|
8664
|
-
function
|
|
8665
|
-
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" +
|
|
8666
|
-
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length,
|
|
8690
|
+
function n2(d) {
|
|
8691
|
+
var t = d.ba.toString(), $ = new RegExp("^(?:\\+|" + p(d.l, 11) + ")");
|
|
8692
|
+
return $ = t.match($), $ != null && $[0] != null && 0 < $[0].length ? (d.ca = !0, $ = $[0].length, O(d.g), d.g.g(t.substring($)), O(d.h), d.h.g(t.substring(0, $)), t.charAt(0) != "+" && d.h.g(" "), !0) : !1;
|
|
8667
8693
|
}
|
|
8668
|
-
function
|
|
8694
|
+
function s2(d) {
|
|
8669
8695
|
if (d.g.h.length == 0) return !1;
|
|
8670
|
-
var t = new
|
|
8671
|
-
return $ == 0 ? !1 : (
|
|
8696
|
+
var t = new E(), $ = W1(d.g, t);
|
|
8697
|
+
return $ == 0 ? !1 : (O(d.g), d.g.g(t.toString()), t = $1($), t == "001" ? d.l = j(d.ga, "" + $) : t != d.ka && (d.l = X1(d, t)), d.h.g("" + $).g(" "), d.o = "", !0);
|
|
8672
8698
|
}
|
|
8673
|
-
function
|
|
8699
|
+
function r2(d, t) {
|
|
8674
8700
|
var $ = d.v.toString();
|
|
8675
8701
|
if (0 <= $.substring(d.$).search(d.fa)) {
|
|
8676
8702
|
var s = $.search(d.fa);
|
|
8677
|
-
return t = $.replace(d.fa, t),
|
|
8703
|
+
return t = $.replace(d.fa, t), O(d.v), d.v.g(t), d.$ = s, t.substring(0, d.$ + 1);
|
|
8678
8704
|
}
|
|
8679
8705
|
return d.j.length == 1 && (d.u = !1), d.da = "", d.s.toString();
|
|
8680
8706
|
}
|
|
8681
|
-
const
|
|
8707
|
+
const o2 = (d) => {
|
|
8682
8708
|
const t = [];
|
|
8683
8709
|
return d.includes("FIXED_LINE_OR_MOBILE") ? (d.includes("MOBILE") || t.push("MOBILE"), d.includes("FIXED_LINE") || t.push("FIXED_LINE")) : (d.includes("MOBILE") || d.includes("FIXED_LINE")) && t.push("FIXED_LINE_OR_MOBILE"), d.concat(t);
|
|
8684
|
-
},
|
|
8710
|
+
}, v1 = { 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 };
|
|
8685
8711
|
e("intlTelInputUtilsTemp", {}), e("intlTelInputUtilsTemp.formatNumberAsYouType", (d, t) => {
|
|
8686
8712
|
try {
|
|
8687
|
-
const $ = d.replace(/[^+0-9]/g, ""), s = new
|
|
8713
|
+
const $ = d.replace(/[^+0-9]/g, ""), s = new A2(t);
|
|
8688
8714
|
t = "";
|
|
8689
8715
|
for (let r = 0; r < $.length; r++) s.ja = M2(s, $.charAt(r)), t = s.ja;
|
|
8690
8716
|
return t;
|
|
@@ -8693,22 +8719,22 @@ const Z2 = (m) => {
|
|
|
8693
8719
|
}
|
|
8694
8720
|
}), e("intlTelInputUtilsTemp.formatNumber", (d, t, $) => {
|
|
8695
8721
|
try {
|
|
8696
|
-
const r =
|
|
8697
|
-
var s =
|
|
8722
|
+
const r = D.g(), a = Y(r, d, t);
|
|
8723
|
+
var s = c1(r, a, -1);
|
|
8698
8724
|
return s == 0 || s == 4 ? r.format(a, typeof $ > "u" ? 0 : $) : d;
|
|
8699
8725
|
} catch {
|
|
8700
8726
|
return d;
|
|
8701
8727
|
}
|
|
8702
8728
|
}), e("intlTelInputUtilsTemp.getExampleNumber", (d, t, $, s) => {
|
|
8703
8729
|
try {
|
|
8704
|
-
const
|
|
8730
|
+
const _ = D.g();
|
|
8705
8731
|
d: {
|
|
8706
|
-
var r =
|
|
8707
|
-
if (
|
|
8708
|
-
var a =
|
|
8732
|
+
var r = _;
|
|
8733
|
+
if (u1(d)) {
|
|
8734
|
+
var a = l1(j(r, d), $);
|
|
8709
8735
|
try {
|
|
8710
|
-
if (
|
|
8711
|
-
var u =
|
|
8736
|
+
if (k(a, 6)) {
|
|
8737
|
+
var u = p(a, 6), c = Y1(r, u, d, !1);
|
|
8712
8738
|
break d;
|
|
8713
8739
|
}
|
|
8714
8740
|
} catch {
|
|
@@ -8716,37 +8742,37 @@ const Z2 = (m) => {
|
|
|
8716
8742
|
}
|
|
8717
8743
|
c = null;
|
|
8718
8744
|
}
|
|
8719
|
-
return
|
|
8745
|
+
return _.format(c, s ? 0 : t ? 2 : 1);
|
|
8720
8746
|
} catch {
|
|
8721
8747
|
return "";
|
|
8722
8748
|
}
|
|
8723
8749
|
}), e("intlTelInputUtilsTemp.getExtension", (d, t) => {
|
|
8724
8750
|
try {
|
|
8725
|
-
return
|
|
8751
|
+
return p(Y(D.g(), d, t), 3);
|
|
8726
8752
|
} catch {
|
|
8727
8753
|
return "";
|
|
8728
8754
|
}
|
|
8729
8755
|
}), e("intlTelInputUtilsTemp.getNumberType", (d, t) => {
|
|
8730
8756
|
try {
|
|
8731
|
-
const $ =
|
|
8732
|
-
return
|
|
8757
|
+
const $ = D.g(), s = Y($, d, t);
|
|
8758
|
+
return K1($, s);
|
|
8733
8759
|
} catch {
|
|
8734
8760
|
return -99;
|
|
8735
8761
|
}
|
|
8736
8762
|
}), e("intlTelInputUtilsTemp.getValidationError", (d, t) => {
|
|
8737
8763
|
if (!t) return 1;
|
|
8738
8764
|
try {
|
|
8739
|
-
const $ =
|
|
8740
|
-
return
|
|
8765
|
+
const $ = D.g(), s = Y($, d, t);
|
|
8766
|
+
return c1($, s, -1);
|
|
8741
8767
|
} catch ($) {
|
|
8742
8768
|
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;
|
|
8743
8769
|
}
|
|
8744
8770
|
}), e("intlTelInputUtilsTemp.isValidNumber", (d, t, $) => {
|
|
8745
8771
|
try {
|
|
8746
|
-
const s =
|
|
8772
|
+
const s = D.g(), r = Y(s, d, t), a = T2(s, r);
|
|
8747
8773
|
if ($) {
|
|
8748
|
-
const u =
|
|
8749
|
-
return a && u.includes(
|
|
8774
|
+
const u = o2($).map((c) => v1[c]);
|
|
8775
|
+
return a && u.includes(K1(s, r));
|
|
8750
8776
|
}
|
|
8751
8777
|
return a;
|
|
8752
8778
|
} catch {
|
|
@@ -8754,30 +8780,30 @@ const Z2 = (m) => {
|
|
|
8754
8780
|
}
|
|
8755
8781
|
}), e("intlTelInputUtilsTemp.isPossibleNumber", (d, t, $) => {
|
|
8756
8782
|
try {
|
|
8757
|
-
const s =
|
|
8783
|
+
const s = D.g(), r = Y(s, d, t);
|
|
8758
8784
|
if ($) {
|
|
8759
|
-
const a =
|
|
8760
|
-
for (let u of a) if (
|
|
8785
|
+
const a = o2($);
|
|
8786
|
+
for (let u of a) if (c1(s, r, v1[u]) === 0) return !0;
|
|
8761
8787
|
return !1;
|
|
8762
8788
|
}
|
|
8763
|
-
return
|
|
8789
|
+
return c1(s, r, -1) === 0;
|
|
8764
8790
|
} catch {
|
|
8765
8791
|
return !1;
|
|
8766
8792
|
}
|
|
8767
8793
|
}), e("intlTelInputUtilsTemp.getCoreNumber", (d, t) => {
|
|
8768
8794
|
try {
|
|
8769
|
-
return
|
|
8795
|
+
return p(Y(D.g(), d, t), 2).toString();
|
|
8770
8796
|
} catch {
|
|
8771
8797
|
return "";
|
|
8772
8798
|
}
|
|
8773
|
-
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType",
|
|
8799
|
+
}), e("intlTelInputUtilsTemp.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 }), e("intlTelInputUtilsTemp.numberType", v1), e("intlTelInputUtilsTemp.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, IS_POSSIBLE_LOCAL_ONLY: 4, INVALID_LENGTH: 5 });
|
|
8774
8800
|
})();
|
|
8775
|
-
const
|
|
8776
|
-
delete
|
|
8777
|
-
|
|
8801
|
+
const f2 = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : void 0, Y2 = f2.intlTelInputUtilsTemp;
|
|
8802
|
+
delete f2.intlTelInputUtilsTemp;
|
|
8803
|
+
m.utils = Y2;
|
|
8778
8804
|
const q2 = {
|
|
8779
8805
|
__name: "IntlTelInputWithUtils",
|
|
8780
|
-
props: /* @__PURE__ */
|
|
8806
|
+
props: /* @__PURE__ */ a2({
|
|
8781
8807
|
disabled: {
|
|
8782
8808
|
type: Boolean,
|
|
8783
8809
|
default: !1
|
|
@@ -8801,45 +8827,45 @@ const q2 = {
|
|
|
8801
8827
|
},
|
|
8802
8828
|
modelModifiers: {}
|
|
8803
8829
|
}),
|
|
8804
|
-
emits: /* @__PURE__ */
|
|
8830
|
+
emits: /* @__PURE__ */ a2([
|
|
8805
8831
|
"changeNumber",
|
|
8806
8832
|
"changeCountry",
|
|
8807
8833
|
"changeValidity",
|
|
8808
8834
|
"changeErrorCode"
|
|
8809
8835
|
], ["update:modelValue"]),
|
|
8810
|
-
setup(
|
|
8811
|
-
const n = D2(
|
|
8812
|
-
let
|
|
8813
|
-
|
|
8836
|
+
setup(y, { expose: e, emit: i }) {
|
|
8837
|
+
const n = D2(y, "modelValue"), o = y, l = i, f = S1(), h = S1(), C = S1(!1), I = () => h.value ? o.options.strictMode ? h.value.isValidNumberPrecise() : h.value.isValidNumber() : null, v = () => {
|
|
8838
|
+
let S = I();
|
|
8839
|
+
C.value !== S && (C.value = S, l("changeValidity", !!S), l(
|
|
8814
8840
|
"changeErrorCode",
|
|
8815
|
-
|
|
8841
|
+
S ? null : h.value.getValidationError()
|
|
8816
8842
|
));
|
|
8843
|
+
}, g = () => {
|
|
8844
|
+
var S;
|
|
8845
|
+
l("changeNumber", ((S = h.value) == null ? void 0 : S.getNumber()) ?? ""), v();
|
|
8817
8846
|
}, w = () => {
|
|
8818
|
-
var
|
|
8819
|
-
l("
|
|
8820
|
-
}, A = () => {
|
|
8821
|
-
var p;
|
|
8822
|
-
l("changeCountry", ((p = h.value) == null ? void 0 : p.getSelectedCountryData().iso2) ?? ""), w(), v();
|
|
8847
|
+
var S;
|
|
8848
|
+
l("changeCountry", ((S = h.value) == null ? void 0 : S.getSelectedCountryData().iso2) ?? ""), g(), v();
|
|
8823
8849
|
};
|
|
8824
8850
|
return P2(() => {
|
|
8825
|
-
f.value && (h.value =
|
|
8851
|
+
f.value && (h.value = m(f.value, o.options), o.value && h.value.setNumber(o.value), o.disabled && h.value.setDisabled(o.disabled), C.value = I());
|
|
8826
8852
|
}), x2(
|
|
8827
8853
|
() => o.disabled,
|
|
8828
|
-
(
|
|
8829
|
-
var
|
|
8830
|
-
return (
|
|
8854
|
+
(S) => {
|
|
8855
|
+
var A;
|
|
8856
|
+
return (A = h.value) == null ? void 0 : A.setDisabled(S);
|
|
8831
8857
|
}
|
|
8832
8858
|
), R2(() => {
|
|
8833
|
-
var
|
|
8834
|
-
return (
|
|
8835
|
-
}), e({ instance: h, input: f }), (
|
|
8859
|
+
var S;
|
|
8860
|
+
return (S = h.value) == null ? void 0 : S.destroy();
|
|
8861
|
+
}), e({ instance: h, input: f }), (S, A) => B2((O2(), k2("input", G2({
|
|
8836
8862
|
ref_key: "input",
|
|
8837
8863
|
ref: f,
|
|
8838
|
-
"onUpdate:modelValue":
|
|
8864
|
+
"onUpdate:modelValue": A[0] || (A[0] = (G) => n.value = G),
|
|
8839
8865
|
type: "tel",
|
|
8840
|
-
onCountrychange:
|
|
8841
|
-
onInput:
|
|
8842
|
-
},
|
|
8866
|
+
onCountrychange: w,
|
|
8867
|
+
onInput: g
|
|
8868
|
+
}, y.inputProps), null, 16)), [
|
|
8843
8869
|
[
|
|
8844
8870
|
F2,
|
|
8845
8871
|
n.value,
|